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

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

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

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

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

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

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

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

diff --git a/bundles/org.eclipse.jst.jsp.core/DevTimeSupport/CSSJSPParser/JSPedCSSTokenizer.flex b/bundles/org.eclipse.jst.jsp.core/DevTimeSupport/CSSJSPParser/JSPedCSSTokenizer.flex
index a48194e..6daf75a 100644
--- a/bundles/org.eclipse.jst.jsp.core/DevTimeSupport/CSSJSPParser/JSPedCSSTokenizer.flex
+++ b/bundles/org.eclipse.jst.jsp.core/DevTimeSupport/CSSJSPParser/JSPedCSSTokenizer.flex
@@ -1,5 +1,5 @@
 /*******************************************************************************

- * Copyright (c) 2006 IBM Corporation and others.

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

  * All rights reserved. This program and the accompanying materials

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

  * which accompanies this distribution, and is available at

@@ -94,7 +94,9 @@
 						break;

 					}

 				}

-				if (context == CSS_JSP_SCRIPTLET){

+				// [236008] - Should not try and consider the token a

+				// comment unless  a comment was started

+				if (context == CSS_JSP_SCRIPTLET && nextTokenType == CSS_JSP_COMMENT){

 					while (nextTokenType != CSS_JSP_COMMENT_END) {

 //						text.append(yytext());

 						textLength += yylength();

diff --git a/bundles/org.eclipse.jst.jsp.core/DevTimeSupport/HeadParsers/JSPHeadTokenizer.jFlex b/bundles/org.eclipse.jst.jsp.core/DevTimeSupport/HeadParsers/JSPHeadTokenizer.jFlex
index 858dd29..9cfce86 100644
--- a/bundles/org.eclipse.jst.jsp.core/DevTimeSupport/HeadParsers/JSPHeadTokenizer.jFlex
+++ b/bundles/org.eclipse.jst.jsp.core/DevTimeSupport/HeadParsers/JSPHeadTokenizer.jFlex
@@ -1,307 +1,304 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.jst.jsp.core.internal.contenttype;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
-import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;
-
-
-
-
-
-%%
-
-%{
-
-
-
-
-        private boolean hasMore = true;
-        private final static int MAX_TO_SCAN = 8000;
-        StringBuffer string = new StringBuffer();
-        // state stack for easier state handling
-        private IntStack fStateStack = new IntStack();
-        private String valueText = null;
-        private boolean isXHTML;
-        private boolean isWML;
-
-
-        public JSPHeadTokenizer() {
-                super();
-        }
-
-          public void reset (Reader in) {
-                /* the input device */
-                zzReader = in;
-
-                /* the current state of the DFA */
-                zzState = 0;
-
-                /* the current lexical state */
-                zzLexicalState = YYINITIAL;
-
-                /* this buffer contains the current text to be matched and is
-                 the source of the yytext() string */
-                java.util.Arrays.fill(zzBuffer, (char)0);
-
-                /* the textposition at the last accepting state */
-                zzMarkedPos = 0;
-
-                /* the textposition at the last state to be included in yytext */
-                zzPushbackPos = 0;
-
-                /* the current text position in the buffer */
-                zzCurrentPos = 0;
-
-                /* startRead marks the beginning of the yytext() string in the buffer */
-                zzStartRead = 0;
-
-                /**
-                 * endRead marks the last character in the buffer, that has been read
-                 * from input
-                 */
-                zzEndRead = 0;
-
-                /* number of newlines encountered up to the start of the matched text */
-                //yyline = 0;
-
-                /* the number of characters up to the start of the matched text */
-                yychar = 0;
-
-                /**
-                 * the number of characters from the last newline up to the start
-                 * of the matched text
-                 */
-                //yycolumn = 0;
-
-                /**
-                 * yy_atBOL == true <=> the scanner is currently at the beginning
-                 * of a line
-                 */
-                zzAtBOL = true;
-
-                /* yy_atEOF == true <=> the scanner has returned a value for EOF */
-                zzAtEOF = false;
-
-                /* denotes if the user-EOF-code has already been executed */
-                zzEOFDone = false;
-
-
-                fStateStack.clear();
-
-                hasMore = true;
-                isXHTML=false;
-                isWML=false;
-
-
-        }
-
-
-        public final HeadParserToken getNextToken() throws IOException {
-                String context = null;
-                context = primGetNextToken();
-                HeadParserToken result = null;
-                if (valueText != null) {
-                        result = createToken(context, yychar, valueText);
-                        valueText = null;
-                } else {
-                        result = createToken(context, yychar, yytext());
-                }
-                return result;
-        }
-
-        public final boolean hasMoreTokens() {
-                return hasMore && yychar < MAX_TO_SCAN;
-        }
-        private void pushCurrentState() {
-                fStateStack.push(yystate());
-
-        }
- 
-        private void popState() {
-                yybegin(fStateStack.pop());
-        }
-        private HeadParserToken createToken(String context, int start, String text) {
-                return new HeadParserToken(context, start, text);
-        }
-        
-        public boolean isXHTML() {
-            return isXHTML;
-        }
-        public boolean isWML() {
-            return isWML;
-        }        
-
-%}
-
-%eof{
-        hasMore=false;
-%eof}
-
-%public
-%class JSPHeadTokenizer
-%function primGetNextToken
-%type String
-%char
-%unicode
-%ignorecase
-//%debug
-%switch
-%buffer 8192
-
-
-UTF16BE = \xFE\xFF
-UTF16LE = \xFF\xFE
-UTF83ByteBOM = \xEF\xBB\xBF
-
-// SpaceChar = [\x20\x09]
-
-
-// [3] S ::= (0x20 | 0x9 | 0xD | 0xA)+
-S = [\x20\x09\x0D\x0A]
-
-BeginAttributeeValue = {S}* \= {S}*
-
-LineTerminator = \r|\n
-
-
-%state ST_XMLDecl
-%state ST_PAGE_DIRECTIVE
-%state QuotedAttributeValue
-%state DQ_STRING
-%state SQ_STRING
-%state UnDelimitedString
-
-%%
-
-
-<YYINITIAL>
-{
-         // force to start at beginning of line (^) and at beginning of file (yychar == 0)
-        ^ {UTF16BE}           {if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16BE;}}
-        ^ {UTF16LE}           {if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16LE;}}
-        ^ {UTF83ByteBOM}       {if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}}
-        
-        // force to be started on first line, but we do allow preceeding spaces
-        ^ {S}* "<\?xml" {S}+ {if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}}
-
-
-        // following are some simply rules to identify JSP content as "XHTML"
-        // see http://www.rfc-editor.org/rfc/rfc3236.txt
-        "<!DOCTYPE" {S}* "html" {S}* "PUBLIC" .* "//DTD XHTML"                {isXHTML = true;}
-        "<html" {S}* "xmlns" {S}* "=" {S}* (\" | \') "http://www.w3.org/1999/xhtml"     {isXHTML = true;}
-         // another case that's part of the "HTML family" is WML 1.0 (WML 2.0 is part of XHTML)
-         "<!DOCTYPE" {S}* "wml" {S}* "PUBLIC" .* "//DTD WML"                   {isWML = true;}
-
-        "<%" {S}* "@" {S}* ("page"|"tag") {S}+   {yybegin(ST_PAGE_DIRECTIVE); return JSPHeadTokenizerConstants.PageDirectiveStart;}
-        ("<jsp:directive.page"|"<jsp:directive.tag") {S}+           {yybegin(ST_PAGE_DIRECTIVE); return JSPHeadTokenizerConstants.PageDirectiveStart;}
-
-
-}
-
-<ST_XMLDecl>
-{
-        "version" {BeginAttributeeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;}
-        "encoding" {BeginAttributeeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;}
-        // note the "forced end" (via 'hasMore=false') once the end of XML Declaration found
-        // This is since non-ascii chars may follow and may cause IOExceptions which would not occur once stream is
-        // read with incorrect encoding (such as if platform encoding is in effect until true encoding detected).
-        // BUT, the hasMore=false was removed for this JSP case (probably still ok for pure XML) because
-        // in a JSP, we must parse past xmlDecl to get at JSP page directive.
-        // We'll assume all chars in this area are "readable" as is.
-        {S}* "\?>"    {yybegin(YYINITIAL); return XMLHeadTokenizerConstants.XMLDeclEnd;}
-}
-
-<ST_PAGE_DIRECTIVE>
-{
-//  removed 'language' since it really can be handled seperately from encoding, but may add it back later for simple re-use.
-        "language"     {BeginAttributeeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return JSPHeadTokenizerConstants.PageLanguage;}
-        "contentType" {BeginAttributeeValue}  {pushCurrentState(); yybegin(QuotedAttributeValue); return JSPHeadTokenizerConstants.PageContentType;}
-        "pageEncoding" {BeginAttributeeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return JSPHeadTokenizerConstants.PageEncoding;}
-        // note the "forced end" (via 'hasMore=false') once the end of XML Declaration found
-        // This is since non-ascii chars may follow and may cause IOExceptions which would not occur once stream is
-        // read in correct encoding.
-
-        // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4205 demonstrates how we need to keep parsing,
-        // even if come to end of one page directive, so hasMore=false was removed from these rules.
-        "%>"    { yybegin(YYINITIAL);  return JSPHeadTokenizerConstants.PageDirectiveEnd;}
-        "\/>"    { yybegin(YYINITIAL); return JSPHeadTokenizerConstants.PageDirectiveEnd;}
-}
-
-
-<QuotedAttributeValue>
-{
-        \"                      { yybegin(DQ_STRING); string.setLength(0); }
-        \'                      { yybegin(SQ_STRING); string.setLength(0); }
-        // in this state, anything other than a space character can start an undelimited string
-        {S}*.           { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);}
-
-}
-
-
-<DQ_STRING>
-{
-
-        \"                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
-        {LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-        "\?>"                   { yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-        '<'                     { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-        .                       { string.append( yytext() ); }
-
-        "%>"                    { yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-
-
-}
-
-<SQ_STRING>
-{
-
-        \'                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;}
-        {LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-        "%>"                    { yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-        '<'                     { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-        .                       { string.append( yytext() ); }
-        "%>"                    { yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-
-
-}
-
-<UnDelimitedString>
-{
-
-
-        {S}                     { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
-        {LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-        "\?>"                   { yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-        '<'                     { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-        // these are a bit special, since we started an undelimit string, but found a quote ... probably indicates a missing beginning quote
-        \'                      { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-        \"                      { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-
-        .                       { string.append( yytext() ); }
-        "%>"                    { yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-
-}
-
-// The "match anything" rule should always be in effect except for when looking for end of string
-// (That is, remember to update state list if/when new states added)
-<YYINITIAL, ST_XMLDecl, QuotedAttributeValue, ST_PAGE_DIRECTIVE>
-{
-// this is the fallback (match "anything") rule  (for this scanner, input is ignored, and position advanced, if not recognized)
-.|\n              {if (yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}}
-}
-
-// this rule always in effect
-<<EOF>>         {hasMore = false; return EncodingParserConstants.EOF;}
-
+/*******************************************************************************

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

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

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

+ * which accompanies this distribution, and is available at

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

+ *

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

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

+/*nlsXXX*/

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

+import java.io.IOException;

+import java.io.Reader;

+import java.util.Arrays;

+

+import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;

+import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;

+

+%%

+

+%{

+

+

+

+

+        private boolean hasMore = true;

+        private final static int MAX_TO_SCAN = 8000;

+        StringBuffer string = new StringBuffer();

+        // state stack for easier state handling

+        private IntStack fStateStack = new IntStack();

+        private String valueText = null;

+        private boolean isXHTML;

+        private boolean isWML;

+

+

+        public JSPHeadTokenizer() {

+                super();

+        }

+

+          public void reset (Reader in) {

+                /* the input device */

+                zzReader = in;

+

+                /* the current state of the DFA */

+                zzState = 0;

+

+                /* the current lexical state */

+                zzLexicalState = YYINITIAL;

+

+                /* this buffer contains the current text to be matched and is

+                 the source of the yytext() string */

+                Arrays.fill(zzBuffer, (char)0);

+

+                /* the textposition at the last accepting state */

+                zzMarkedPos = 0;

+

+                /* the textposition at the last state to be included in yytext */

+                //zzPushbackPos = 0;

+

+                /* the current text position in the buffer */

+                zzCurrentPos = 0;

+

+                /* startRead marks the beginning of the yytext() string in the buffer */

+                zzStartRead = 0;

+

+                /**

+                 * endRead marks the last character in the buffer, that has been read

+                 * from input

+                 */

+                zzEndRead = 0;

+

+                /* number of newlines encountered up to the start of the matched text */

+                //yyline = 0;

+

+                /* the number of characters up to the start of the matched text */

+                yychar = 0;

+

+                /**

+                 * the number of characters from the last newline up to the start

+                 * of the matched text

+                 */

+                //yycolumn = 0;

+

+                /**

+                 * yy_atBOL == true <=> the scanner is currently at the beginning

+                 * of a line

+                 */

+                zzAtBOL = true;

+

+                /* yy_atEOF == true <=> the scanner has returned a value for EOF */

+                zzAtEOF = false;

+

+                /* denotes if the user-EOF-code has already been executed */

+                zzEOFDone = false;

+

+

+                fStateStack.clear();

+

+                hasMore = true;

+                isXHTML=false;

+                isWML=false;

+

+

+        }

+

+

+        public final HeadParserToken getNextToken() throws IOException, Exception {

+                String context = null;

+                context = primGetNextToken();

+                HeadParserToken result = null;

+                if (valueText != null) {

+                        result = createToken(context, yychar, valueText);

+                        valueText = null;

+                } else {

+                        result = createToken(context, yychar, yytext());

+                }

+                return result;

+        }

+

+        public final boolean hasMoreTokens() {

+                return hasMore && yychar < MAX_TO_SCAN;

+        }

+        private void pushCurrentState() {

+                fStateStack.push(yystate());

+

+        }

+ 

+        private void popState() {

+                yybegin(fStateStack.pop());

+        }

+        private HeadParserToken createToken(String context, int start, String text) {

+                return new HeadParserToken(context, start, text);

+        }

+        

+        public boolean isXHTML() {

+            return isXHTML;

+        }

+        public boolean isWML() {

+            return isWML;

+        }        

+

+%}

+

+%eof{

+        hasMore=false;

+%eof}

+

+%public

+%class JSPHeadTokenizer

+%function primGetNextToken

+%type String

+%char

+%unicode

+%ignorecase

+//%debug

+%switch

+%buffer 8192

+%scanerror java.lang.Exception

+

+

+UTF16BE = \xFE\xFF

+UTF16LE = \xFF\xFE

+UTF83ByteBOM = \xEF\xBB\xBF

+

+// SpaceChar = [\x20\x09]

+

+

+// [3] S ::= (0x20 | 0x9 | 0xD | 0xA)+

+S = [\x20\x09\x0D\x0A]

+

+//BeginAttributeeValue = {S}* \= {S}*

+

+LineTerminator = \r|\n

+

+

+Z = (\x00)?

+S_UTF = {Z}{S}{Z}

+BeginAttributeValueUTF = {S_UTF}* \= {S_UTF}*

+

+%state ST_XMLDecl

+%state ST_PAGE_DIRECTIVE

+%state QuotedAttributeValue

+%state DQ_STRING

+%state SQ_STRING

+%state UnDelimitedString

+

+%%

+

+

+<YYINITIAL>

+{

+         // force to start at beginning of line (^) and at beginning of file (yychar == 0)

+        ^ {UTF16BE}           {if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16BE;}}

+        ^ {UTF16LE}           {if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16LE;}}

+        ^ {UTF83ByteBOM}       {if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}}

+        

+        // force to be started on first line, but we do allow preceeding spaces

+		^ {S_UTF}* ({Z}<{Z}\?{Z}x{Z}m{Z}l{Z}){S_UTF}+ {if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}}

+

+

+        // following are some simply rules to identify JSP content as "XHTML"

+        // see http://www.rfc-editor.org/rfc/rfc3236.txt

+		{Z}<{Z}\!{Z}D{Z}O{Z}C{Z}T{Z}Y{Z}P{Z}E{Z} {S_UTF}* {Z}h{Z}t{Z}m{Z}l{Z} {S_UTF}* {Z}P{Z}U{Z}B{Z}L{Z}I{Z}C{Z} .* {Z}\/{Z}\/{Z}D{Z}T{Z}D{Z}{S_UTF}{Z}X{Z}H{Z}T{Z}M{Z}L{Z}                {isXHTML = true;}

+		{Z}<{Z}h{Z}t{Z}m{Z}l{Z} {S_UTF}* {Z}x{Z}m{Z}l{Z}n{Z}s{Z} {S_UTF}* {Z}\={Z} {S_UTF}* (({Z}\"{Z}) | ({Z}\'{Z})) {Z}h{Z}t{Z}t{Z}p{Z}:{Z}\/{Z}\/{Z}w{Z}w{Z}w{Z}\.{Z}w{Z}3{Z}\.{Z}o{Z}r{Z}g{Z}\/{Z}1{Z}9{Z}9{Z}9{Z}\/{Z}x{Z}h{Z}t{Z}m{Z}l{Z}     {isXHTML = true;}

+         // another case that's part of the "HTML family" is WML 1.0 (WML 2.0 is part of XHTML)

+		{Z}<{Z}\!{Z}D{Z}O{Z}C{Z}T{Z}Y{Z}P{Z}E{Z} {S_UTF}* {Z}w{Z}m{Z}l{Z} {S_UTF}* {Z}P{Z}U{Z}B{Z}L{Z}I{Z}C{Z} .* {Z}\/{Z}\/{Z}D{Z}T{Z}D {S}{Z}W{Z}M{Z}L{Z}                   {isWML = true;}

+

+		{Z}<{Z}%{Z} {S_UTF}* {Z}@{Z} {S_UTF}* (({Z}p{Z}a{Z}g{Z}e{Z})|({Z}t{Z}a{Z}g{Z})) {S_UTF}+   {yybegin(ST_PAGE_DIRECTIVE); return JSPHeadTokenizerConstants.PageDirectiveStart;}

+		(({Z}<{Z}j{Z}s{Z}p{Z}:{Z}d{Z}i{Z}r{Z}e{Z}c{Z}t{Z}i{Z}v{Z}e{Z}\.{Z}p{Z}a{Z}g{Z}e{Z})|({Z}<{Z}j{Z}s{Z}p{Z}:{Z}d{Z}i{Z}r{Z}e{Z}c{Z}t{Z}i{Z}v{Z}e{Z}\.{Z}t{Z}a{Z}g{Z})) {S_UTF}+           {yybegin(ST_PAGE_DIRECTIVE); return JSPHeadTokenizerConstants.PageDirectiveStart;}

+

+}

+

+<ST_XMLDecl>

+{

+        ({Z}v{Z}e{Z}r{Z}s{Z}i{Z}o{Z}n{Z}) {BeginAttributeValueUTF} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;}

+        ({Z}e{Z}n{Z}c{Z}o{Z}d{Z}i{Z}n{Z}g{Z}) {BeginAttributeValueUTF} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;}

+        // note the "forced end" (via 'hasMore=false') once the end of XML Declaration found

+        // This is since non-ascii chars may follow and may cause IOExceptions which would not occur once stream is

+        // read with incorrect encoding (such as if platform encoding is in effect until true encoding detected).

+        // BUT, the hasMore=false was removed for this JSP case (probably still ok for pure XML) because

+        // in a JSP, we must parse past xmlDecl to get at JSP page directive.

+        // We'll assume all chars in this area are "readable" as is.

+		{S_UTF}* {Z}\?{Z}>{Z}    {yybegin(YYINITIAL); return XMLHeadTokenizerConstants.XMLDeclEnd;}

+}

+

+<ST_PAGE_DIRECTIVE>

+{

+//  removed 'language' since it really can be handled seperately from encoding, but may add it back later for simple re-use.

+		{Z}l{Z}a{Z}n{Z}g{Z}u{Z}a{Z}g{Z}e{Z}     {BeginAttributeValueUTF} {pushCurrentState(); yybegin(QuotedAttributeValue); return JSPHeadTokenizerConstants.PageLanguage;}

+        {Z}c{Z}o{Z}n{Z}t{Z}e{Z}n{Z}t{Z}T{Z}y{Z}p{Z}e{Z} {BeginAttributeValueUTF}  {pushCurrentState(); yybegin(QuotedAttributeValue); return JSPHeadTokenizerConstants.PageContentType;}

+        {Z}p{Z}a{Z}g{Z}e{Z}E{Z}n{Z}c{Z}o{Z}d{Z}i{Z}n{Z}g{Z} {BeginAttributeValueUTF} {pushCurrentState(); yybegin(QuotedAttributeValue); return JSPHeadTokenizerConstants.PageEncoding;}

+        // note the "forced end" (via 'hasMore=false') once the end of XML Declaration found

+        // This is since non-ascii chars may follow and may cause IOExceptions which would not occur once stream is

+        // read in correct encoding.

+

+        // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4205 demonstrates how we need to keep parsing,

+        // even if come to end of one page directive, so hasMore=false was removed from these rules.

+		{Z}%{Z}>{Z}    { yybegin(YYINITIAL);  return JSPHeadTokenizerConstants.PageDirectiveEnd;}

+        {Z}\/{Z}>{Z}    { yybegin(YYINITIAL); return JSPHeadTokenizerConstants.PageDirectiveEnd;}

+}

+

+

+<QuotedAttributeValue>

+{

+        {Z}\"{Z}                      { yybegin(DQ_STRING); string.setLength(0); }

+        {Z}\'{Z}                      { yybegin(SQ_STRING); string.setLength(0); }

+        // in this state, anything other than a space character can start an undelimited string

+		{S_UTF}*.           { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);}

+}

+

+

+<DQ_STRING>

+{

+

+        {Z}\"{Z}			{ popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }

+        {Z}{LineTerminator}{Z}        { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+        {Z}\?{Z}>{Z}	{ yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+        {Z}<{Z}				{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+		[^\x00]			{ string.append( yytext() ); }

+        {Z}%{Z}>{Z}		{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+

+

+}

+

+<SQ_STRING>

+{

+

+        {Z}\'{Z}                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;}

+		{Z}{LineTerminator}{Z}        { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+        {Z}%{Z}>{Z}               { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+        {Z}<{Z}                     { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+		// Skip over the single-byte 0s

+		[^\x00]			{ string.append( yytext() ); }

+        {Z}%{Z}>{Z}                    { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+

+

+}

+

+<UnDelimitedString>

+{

+

+

+        {S_UTF}                     { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }

+        {Z}{LineTerminator}{Z}        { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+        {Z}\?{Z}>{Z}                   { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+        {Z}<{Z}                     { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+        // these are a bit special, since we started an undelimit string, but found a quote ... probably indicates a missing beginning quote

+        {Z}\'{Z}                      { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}

+        {Z}\"{Z}                      { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}        

+

+		[^\x00]			{ string.append( yytext() ); }

+        {Z}%{Z}>{Z}                    { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+

+}

+

+// The "match anything" rule should always be in effect except for when looking for end of string

+// (That is, remember to update state list if/when new states added)

+.|\n	{if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}}

+

+// this rule always in effect

+<<EOF>>         {hasMore = false; return EncodingParserConstants.EOF;}

+

+

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 113bcfb..eaaf5db 100644
--- a/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jst.jsp.core; singleton:=true
-Bundle-Version: 1.2.100.qualifier
+Bundle-Version: 1.2.302.qualifier
 Bundle-Activator: org.eclipse.jst.jsp.core.internal.JSPCorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
@@ -42,19 +42,22 @@
  org.eclipse.jst.jsp.css.core.internal.modelhandler;x-friends:="org.eclipse.jst.jsp.ui",
  org.eclipse.jst.jsp.css.core.internal.parser;x-internal:=true,
  org.eclipse.jst.jsp.css.core.internal.parserz;x-internal:=true
-Require-Bundle: com.ibm.icu;bundle-version="[3.8.1,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.filebuffers;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,3.5.0)",
+Import-Package: com.ibm.icu.util; version="3.8",
+ com.ibm.icu.text; version="3.8",
+ javax.servlet.jsp.tagext;version="2.0.0"
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.jobs;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.filebuffers;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.jdt.core;bundle-version="[3.5.0,3.7.0)",
  org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.200,1.2.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.200,1.2.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.0,1.3.0)",
- javax.servlet.jsp;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.3.0,2.0.0)";resolution:=optional,
- org.eclipse.wst.common.modulecore;bundle-version="[1.1.200,2.0.0)";resolution:=optional
-Bundle-ActivationPolicy: lazy; exclude:="org.eclipse.jst.jsp.core.internal.contenttype"
+ org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.css.core;bundle-version="[1.1.300,1.2.0)",
+ org.eclipse.wst.html.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.wst.validation;bundle-version="[1.2.100,1.3.0)",
+ org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.0,2.0.0)";resolution:=optional,
+ org.eclipse.wst.common.modulecore;bundle-version="[1.1.300,2.0.0)";resolution:=optional,
+ org.eclipse.osgi.services;bundle-version="3.2.0"
+Bundle-ActivationPolicy: lazy; exclude:="org.eclipse.jst.jsp.core.internal.contenttype,org.eclipse.jst.jsp.css.core.internal.contenttype,org.eclipse.jst.jsp.core.internal.provisional.contenttype"
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.jst.jsp.core/about.html b/bundles/org.eclipse.jst.jsp.core/about.html
index 73db36e..2199df3 100644
--- a/bundles/org.eclipse.jst.jsp.core/about.html
+++ b/bundles/org.eclipse.jst.jsp.core/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/bundles/org.eclipse.jst.jsp.core/build.properties b/bundles/org.eclipse.jst.jsp.core/build.properties
index 92ef44d..09a522d 100644
--- a/bundles/org.eclipse.jst.jsp.core/build.properties
+++ b/bundles/org.eclipse.jst.jsp.core/build.properties
@@ -16,7 +16,6 @@
                about.html
 bin.excludes = @dot/**,\
                temp.folder/**
-src.includes = component.xml,\
-               DevTimeSupport/,\
+src.includes = DevTimeSupport/,\
                schema/
 source.. = src/
diff --git a/bundles/org.eclipse.jst.jsp.core/component.xml b/bundles/org.eclipse.jst.jsp.core/component.xml
deleted file mode 100644
index ab88fac..0000000
--- a/bundles/org.eclipse.jst.jsp.core/component.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jst.jsp">
-	<component-depends unrestricted="true" />
-	<plugin id="org.eclipse.jst.jsp.core" fragment="false" />
-	<package name="org.eclipse.jst.jsp.core.taglib" api="false">
-		<type name="IJarRecord" implement="false" />
-		<type name="ITagDirRecord" implement="false" />
-		<type name="ITaglibIndexDelta" implement="false" />
-		<type name="ITaglibIndexListener" implement="true" />
-		<type name="ITaglibDescriptor" implement="false" />
-		<type name="ITaglibRecord" implement="false" />
-		<!-- <type name="ITaglibRecordEvent" implement="false" /> -->
-		<type name="ITLDRecord" implement="false" />
-		<type name="IURLRecord" implement="false" />
-		<type name="TaglibIndex" subclass="false" instantiate="false" />
-		<type name="TaglibIndexDelta" subclass="false" instantiate="false" />
-	</package>
-	<plugin id="org.eclipse.jst.jsp.ui" fragment="false" />
-	<package name="org.eclipse.jst.jsp.ui" api="false">
-		<type name="StructuredTextViewerConfigurationJSP" subclass="true" instantiate="true" />
-	</package>
-	<package name="org.eclipse.jst.jsp.ui.views.contentoutline" api="false">
-		<type name="JSPContentOutlineConfiguration" subclass="true" instantiate="true" />
-	</package>
-	<plugin id="org.eclipse.jst.jsp.ui.infopop" fragment="false" />
-	<description url="http://eclipse.org/webtools/jst/components/jsp/overview.html" />
-</component>
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/plugin.properties b/bundles/org.eclipse.jst.jsp.core/plugin.properties
index f6fdf1e..f63b037 100644
--- a/bundles/org.eclipse.jst.jsp.core/plugin.properties
+++ b/bundles/org.eclipse.jst.jsp.core/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2008 IBM Corporation and others.
+# Copyright (c) 2004, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
 # Contributors:
 #     IBM Corporation - initial API and implementation
 ###############################################################################
-providerName=Eclipse.org
+providerName=Eclipse Web Tools Platform
 pluginName=Structured Source JSP Model
 Structured_JSP_Document_Factory_Extension.name=Structured JSP Document Factory Extension
 JSP_Content_Type_Extension_Element.name=JSP
@@ -20,6 +20,7 @@
 JSP_Directive_Validator.name=JSP Directive Validator
 EL_Syntax_Validator.name=EL Syntax Validator
 JSP_Content_Validator.name=JSP Content Validator
+TLDValidator.name=Tag Library Descriptor Validator
 Structured_JSP_Document_Setup_participant.name=Structured JSP Document Setup Participant
 _validationMarker.name=JSP Problem
 _taskMarker.name=JSP Task
diff --git a/bundles/org.eclipse.jst.jsp.core/plugin.xml b/bundles/org.eclipse.jst.jsp.core/plugin.xml
index 6ba64a7..be0b012 100644
--- a/bundles/org.eclipse.jst.jsp.core/plugin.xml
+++ b/bundles/org.eclipse.jst.jsp.core/plugin.xml
@@ -108,7 +108,7 @@
 		</processor>
 	</extension>
 
-	<extension point="org.eclipse.core.runtime.contentTypes">
+	<extension point="org.eclipse.core.contenttype.contentTypes">
 		<!-- create content type for JSP files -->
 		<content-type
 			file-extensions="jsp,jsv,jtpl,jspx"
@@ -138,7 +138,7 @@
 			name="%JSP_Tag_Content_Type_Extension_Element.name"
 			id="tagsource"
 			base-type="org.eclipse.jst.jsp.core.jspsource"
-			default-charset="UTF-8"/>
+			default-charset="ISO-8859-1"/>
 		<!-- create content type for .tld files -->
 		<content-type
 			file-extensions="tld"
@@ -146,7 +146,13 @@
 			name="%JSP_TLD_Content_Type_Extension_Element.name"
 			id="tldsource"
 			base-type="org.eclipse.core.runtime.xml"
-			default-charset="UTF-8"/>
+			default-charset="UTF-8">
+			<!-- add the describer so it's properly detected when opened from within .jar files -->
+			<describer class="org.eclipse.core.runtime.content.XMLRootElementContentDescriber">
+				<parameter name="element" value="taglib"/>
+			</describer>
+		</content-type>
+		
 
   	<!--======================================================================================-->
 	<!-- minimal content-type css jsp support                                                 -->
@@ -180,83 +186,125 @@
 	<!--======================================================================================-->
 	<!-- JSP batch validation                                       						  -->
 	<!--======================================================================================-->
-	<extension
-		id="JSPBatchValidator"
-		name="%JSP_Syntax_Validator.name"
-		point="org.eclipse.wst.validation.validator">
-		<validator>
-			<projectNature id="org.eclipse.jdt.core.javanature" />
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jsp">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jspf">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jsf">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jsv">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jtpl">
-			</filter>
-         	<contentTypeBinding contentTypeId="org.eclipse.jst.jsp.core.jspsource"/>
-			<!-- needed until bug 181443 is implemented -->
-         	<contentTypeBinding contentTypeId="org.eclipse.jst.jsp.core.jspfragmentsource"/>
-         	<contentTypeBinding contentTypeId="org.eclipse.jst.jsp.core.tagsource"/>
-			<helper class="org.eclipse.wst.validation.internal.operations.WorkbenchContext"/>
-			<run
-				enabled="true"
-				class="org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator"/>
-         <markerId markerIdValue="org.eclipse.jst.jsp.core.validationMarker"/>
+   <extension id="JSPBatchValidator" name="%JSP_Syntax_Validator.name" point="org.eclipse.wst.validation.validatorV2">
+      <validator
+            build="true"
+            class="org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator"
+            manual="true"
+            version="1"
+            markerId="org.eclipse.jst.jsp.core.validationMarker"
+            sourceid="org.eclipse.jst.jsp.jspelsourcevalidator, org.eclipse.jst.jsp.ui.internal.validation.jspactionvalidator, org.eclipse.jst.jsp.tldsourcevalidator, org.eclipse.jst.jsp.jspsourcevalidator">
+         <include>
+            <rules>
+	           <projectNature id="org.eclipse.jdt.core.javanature"/>
+            </rules>
+         </include>
+         <include>
+            <rules>
+				<contentType id="org.eclipse.jst.jsp.core.jspsource"/>
+				<!-- needed until bug 181443 is implemented -->
+				<contentType id="org.eclipse.jst.jsp.core.jspfragmentsource"/>
+				<contentType id="org.eclipse.jst.jsp.core.tagsource"/>
+               <fileext
+                     caseSensitive="false"
+                     ext="jsp">
+               </fileext>
+               <fileext
+                     caseSensitive="false"
+                     ext="jspf">
+               </fileext>
+               <fileext
+                     caseSensitive="false"
+                     ext="jsf">
+               </fileext>
+               <fileext
+                     caseSensitive="false"
+                     ext="tag">
+               </fileext>
+               <fileext
+                     caseSensitive="false"
+                     ext="tagf">
+               </fileext>
+               <fileext
+                     caseSensitive="false"
+                     ext="jsv">
+               </fileext>
+               <fileext
+                     caseSensitive="false"
+                     ext="jtpl">
+               </fileext>
+            </rules>
+         </include>
+         <group id="org.eclipse.wst.sse.core.structuredModelGroup"/>
       </validator>
-	</extension>
+   </extension>
 	
-	<extension
-		id="JSPContentValidator"
-		name="%JSP_Content_Validator.name"
-		point="org.eclipse.wst.validation.validator">
-		<validator>
-			<projectNature id="org.eclipse.jdt.core.javanature" />
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jsp">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jspf">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jsf">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jsv">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jtpl">
-			</filter>
-         	<contentTypeBinding contentTypeId="org.eclipse.jst.jsp.core.jspsource"/>			
-         	<!-- <contentTypeBinding contentTypeId="org.eclipse.jst.jsp.core.jspfragmentsource"/> -->
-         	<!-- <contentTypeBinding contentTypeId="org.eclipse.jst.jsp.core.tagsource"/> -->			
-			<helper class="org.eclipse.wst.validation.internal.operations.WorkbenchContext"/>
-			<run
-				async="true"
-				fullBuild="true"
-				incremental="true"
-				enabled="true"
-				class="org.eclipse.jst.jsp.core.internal.validation.JSPContentValidator"/>
-         <markerId markerIdValue="org.eclipse.jst.jsp.core.validationMarker"/>
-	</validator>
-	</extension>
+   <extension id="JSPContentValidator" name="%JSP_Content_Validator.name" point="org.eclipse.wst.validation.validatorV2">
+      <validator
+            build="true"
+            class="org.eclipse.jst.jsp.core.internal.validation.JSPContentValidator"
+            manual="true"
+            version="1"
+            markerId="org.eclipse.jst.jsp.core.validationMarker"
+            sourceid="org.eclipse.jst.jsp.ui.internal.validation.markupvalidator, org.eclipse.jst.jsp.ui.internal.validation.htmlsyntaxvalidator">
+         <include>
+            <rules>
+				<contentType id="org.eclipse.jst.jsp.core.jspsource"/>
+				<!-- needed until bug 181443 is implemented -->
+				<contentType id="org.eclipse.jst.jsp.core.jspfragmentsource"/>
+               <fileext
+                     caseSensitive="false"
+                     ext="jsp">
+               </fileext>
+               <fileext
+                     caseSensitive="false"
+                     ext="jspf">
+               </fileext>
+               <fileext
+                     caseSensitive="false"
+                     ext="jsf">
+               </fileext>
+               <fileext
+                     caseSensitive="false"
+                     ext="tag">
+               </fileext>
+               <fileext
+                     caseSensitive="false"
+                     ext="tagf">
+               </fileext>
+               <fileext
+                     caseSensitive="false"
+                     ext="jsv">
+               </fileext>
+               <fileext
+                     caseSensitive="false"
+                     ext="jtpl">
+               </fileext>
+            </rules>
+         </include>
+         <group id="org.eclipse.wst.sse.core.structuredModelGroup"/>
+      </validator>
+   </extension>
+   
+   <extension id="TLDValidator" name="%TLDValidator.name" point="org.eclipse.wst.validation.validatorV2">
+      <validator
+            build="true"
+            class="org.eclipse.jst.jsp.core.internal.validation.TLDValidator"
+            manual="true"
+            version="1"
+            markerId="org.eclipse.jst.jsp.core.validationMarker">
+         <include>
+            <rules>
+				<contentType id="org.eclipse.jst.jsp.core.tldsource"/>
+               <fileext
+                     caseSensitive="false"
+                     ext="tld">
+               </fileext>
+           </rules>
+         </include>
+         <group id="org.eclipse.wst.sse.core.structuredModelGroup"/>
+      </validator>
+   </extension>
 		
     <extension
        point="org.eclipse.jst.jsp.core.elTranslator">
@@ -305,4 +353,17 @@
 			class="org.eclipse.wst.sse.core.internal.filebuffers.BasicStructuredDocumentFactory" />
 	</extension>	
 	-->
+	<extension point="org.eclipse.wst.xml.core.modelQueryExtensions">
+		<modelQueryExtension
+			class="org.eclipse.jst.jsp.core.internal.modelquery.JSPModelQueryExtension"
+			contentType="org.eclipse.jst.jsp.core.jspsource">
+		</modelQueryExtension>
+	</extension>
+	<extension point="org.eclipse.wst.xml.core.modelQueryExtensions">
+		<modelQueryExtension
+			class="org.eclipse.jst.jsp.core.internal.modelquery.TaglibModelQueryExtension"
+			contentType="org.eclipse.jst.jsp.core.jspsource">
+		</modelQueryExtension>
+	</extension>
+
 </plugin>
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCoreMessages.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCoreMessages.java
index e6a72fc..697124d 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCoreMessages.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCoreMessages.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -29,7 +29,12 @@
 	public static String JSPDirectiveValidator_6;
 	public static String JSPDirectiveValidator_7;
 	public static String JSPDirectiveValidator_8;
+	public static String JSPDirectiveValidator_9;
+	public static String JSPDirectiveValidator_10;
+	public static String JSPDirectiveValidator_11;
 	public static String JSPActionValidator_0;
+
+	public static String JSPActionValidator_1;
 	public static String JSPIndexManager_0;
 	public static String JSPIndexManager_2;
 	public static String JSP_Search;
@@ -47,6 +52,14 @@
 	public static String JSPTranslator_1;
 	public static String JSPTranslator_2;
 	public static String JSPTranslator_3;
+	public static String JSPTranslator_4;
+	public static String JSPTranslator_5;
+	public static String JSPELTranslator_0;
+	public static String TLDValidator_MissingValidator;
+	public static String TLDValidator_MissingVariable;
+	public static String TLDValidator_MissingListener;
+	public static String Initializing;
+	public static String Persisting_JSP_Translations;
 	
 	/**
 	 * @deprecated
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java
index cda29d7..2b4fab5 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,11 +10,21 @@
  *******************************************************************************/
 package org.eclipse.jst.jsp.core.internal;
 
+import org.eclipse.core.resources.ISaveContext;
+import org.eclipse.core.resources.ISaveParticipant;
+import org.eclipse.core.resources.ISavedState;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
 import org.eclipse.jst.jsp.core.internal.contentproperties.JSPFContentPropertiesManager;
 import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslatorPersister;
 import org.eclipse.jst.jsp.core.internal.java.search.JSPIndexManager;
 import org.eclipse.jst.jsp.core.internal.taglib.TaglibHelperManager;
 import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
@@ -26,6 +36,9 @@
 public class JSPCorePlugin extends Plugin {
 	// The shared instance.
 	private static JSPCorePlugin plugin;
+	
+	/** Save participant for this plugin */
+	ISaveParticipant fSaveParticipant;
 
 	/**
 	 * The constructor.
@@ -33,13 +46,11 @@
 	public JSPCorePlugin() {
 		super();
 		plugin = this;
+		fSaveParticipant = new SaveParticipant();
 	}
 
 	/**
 	 * Returns the shared instance.
-	 * 
-	 * @deprecated - will be removed. Currently used to get "model
-	 *             preferences", but there are other, better ways.
 	 */
 	public static JSPCorePlugin getDefault() {
 		return plugin;
@@ -63,7 +74,35 @@
 		// listen for classpath changes
 		JavaCore.addElementChangedListener(TaglibHelperManager.getInstance());
 
-
+		//restore save state and process any events that happened before plugin loaded
+		if (JSPTranslatorPersister.ACTIVATED) {
+			Job persister = new Job(JSPCoreMessages.Initializing) {
+				protected IStatus run(IProgressMonitor monitor) {
+					ISavedState savedState = null;
+					try {
+						savedState = ResourcesPlugin.getWorkspace().addSaveParticipant(plugin.getBundle().getSymbolicName(), fSaveParticipant);
+					}
+					catch (CoreException e) {
+						Logger.logException("Could not load previous save state", e);
+					}
+					if (savedState != null) {
+						try {
+							Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
+						}
+						finally {
+							savedState.processResourceChangeEvents(JSPTranslatorPersister.getDefault());
+						}
+					}
+					return Status.OK_STATUS;
+				}
+			};
+			persister.setUser(false);
+			persister.schedule(2000);
+			// set up persister to listen to resource change events
+			ResourcesPlugin.getWorkspace().addResourceChangeListener(JSPTranslatorPersister.getDefault());
+		}
+		
+		//init the JSP index
 		JSPIndexManager.getInstance().initialize();
 
 		// listen for resource changes to update content properties keys
@@ -86,6 +125,14 @@
 		 */
 		JSPFContentPropertiesManager.shutdown();
 
+		//remove the plugin save participant
+		ResourcesPlugin.getWorkspace().removeSaveParticipant(plugin.getBundle().getSymbolicName());
+		
+		//remove the translator persister
+		if(JSPTranslatorPersister.ACTIVATED) {
+			ResourcesPlugin.getWorkspace().removeResourceChangeListener(JSPTranslatorPersister.getDefault());
+		}
+		
 		// stop any indexing
 		JSPIndexManager.getInstance().shutdown();
 
@@ -98,4 +145,44 @@
 
 		super.stop(context);
 	}
+	
+	/**
+	 * Used so that all of the IResourceChangeEvents that occurred before
+	 * this plugin loaded can be processed.
+	 */
+	private static class SaveParticipant implements ISaveParticipant {
+		/**
+		 * <p>Default constructor</p>
+		 */
+		protected SaveParticipant() {
+		}
+		
+		/**
+		 * @see org.eclipse.core.resources.ISaveParticipant#doneSaving(org.eclipse.core.resources.ISaveContext)
+		 */
+		public void doneSaving(ISaveContext context) {
+			//ignore
+		}
+	
+		/**
+		 * @see org.eclipse.core.resources.ISaveParticipant#prepareToSave(org.eclipse.core.resources.ISaveContext)
+		 */
+		public void prepareToSave(ISaveContext context) throws CoreException {
+			//ignore
+		}
+	
+		/**
+		 * @see org.eclipse.core.resources.ISaveParticipant#rollback(org.eclipse.core.resources.ISaveContext)
+		 */
+		public void rollback(ISaveContext context) {
+			//ignore
+		}
+	
+		/**
+		 * @see org.eclipse.core.resources.ISaveParticipant#saving(org.eclipse.core.resources.ISaveContext)
+		 */
+		public void saving(ISaveContext context) throws CoreException {
+			context.needDelta();
+		}
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePluginResources.properties b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePluginResources.properties
index 2ff51e7..e7e91b5 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePluginResources.properties
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePluginResources.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2008 IBM Corporation and others.
+# Copyright (c) 2004, 2009 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -18,21 +18,33 @@
 JSPFContentPropertiesManager_Updating=Updating JSP Fragment Content Settings
 JSPFContentPropertiesManager_Problems_Updating=Problem saving JSP Fragment Content Settings for {0}
 JSPDirectiveValidator_0={0} is a reserved prefix.  Try another
-JSPDirectiveValidator_1=Cannot find the tag library descriptor for "{0}"
+JSPDirectiveValidator_1=Can not find the tag library descriptor for "{0}"
 JSPDirectiveValidator_2=The prefix "{0} "is used more than once
 JSPDirectiveValidator_3=A {0} value is required in this directive
-JSPDirectiveValidator_4=Fragment "{0}" was not be found at expected path {1}
+JSPDirectiveValidator_4=Fragment "{0}" was not found at expected path {1}
 JSPDirectiveValidator_5=Missing required attribute "{0}"
 JSPDirectiveValidator_6=Undefined attribute name "{0}"
 JSPDirectiveValidator_7=A {0} or {1} value is required in this directive
-JSPDirectiveValidator_8=The superclass "{0}" was not found on the build path
+JSPDirectiveValidator_8=The superclass "{0}" was not found on the Java Build Path
+JSPDirectiveValidator_9=Can not find the tag library descriptor for "{0}".  Try increasing the version of the Dynamic Web Module project facet.
+JSPDirectiveValidator_10=Can not find the tag library descriptor for "{0}".  Try using a newer grammar or declared version in the Web Deployment Descriptor.
+JSPDirectiveValidator_11=Can not find the tag directory "{0}"
 JSPActionValidator_0=Tag ({0}) must be empty
+JSPActionValidator_1="{0}" does not support runtime expressions
 JSPBatchValidator_0=Gathering files in {0}
-TaglibHelper_0=The TagExtraInfo class for {0} ({1}) was not found on the build path
-TaglibHelper_1=The TagExtraInfo class for {0} ({1}) could not be instantiated
-TaglibHelper_2=A problem was encountered using TagExtraInfo class {1} for {0} 
-TaglibHelper_3=The tag handler class for {0} ({1}) was not found on the build path
+TaglibHelper_0=The TagExtraInfo class for "{0}" ({1}) was not found on the Java Build Path
+TaglibHelper_1=The TagExtraInfo class for "{0}" ({1}) could not be instantiated
+TaglibHelper_2=A problem was encountered using TagExtraInfo class {1} for '{0}' 
+TaglibHelper_3=The tag handler class for "{0}" ({1}) was not found on the Java Build Path
 JSPTranslator_0=Invalid identifier: "{0}"
 JSPTranslator_1=Undefined type: {0}
-JSPTranslator_2=Cannot declare both "class" and "beanName" attributes
+JSPTranslator_2=Can not declare both "class" and "beanName" attributes
 JSPTranslator_3=Unknown type for identifier "{0}"
+JSPTranslator_4=Missing start tag for "{0}"
+JSPTranslator_5=Missing end tag for "{0}"
+JSPELTranslator_0=The function {0} is undefined
+TLDValidator_MissingValidator=The TagLibraryValidator subclass '{0}' was not found on the Java Build Path
+TLDValidator_MissingVariable=The variable class '{0}' was not found on the Java Build Path
+TLDValidator_MissingListener=The listener class '{0}' was not found on the Java Build Path
+Initializing=Processing JSP changes since last activation
+Persisting_JSP_Translations=Persisting JSP Translations
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/JSPCMDocumentFactory.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/JSPCMDocumentFactory.java
index 59b2b3e..3ae1d2e 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/JSPCMDocumentFactory.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/JSPCMDocumentFactory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -25,7 +25,7 @@
 	}
 
 	public static CMDocument getCMDocument() {
-		return getCMDocument(CMDocType.JSP20_DOC_TYPE);
+		return getCMDocument(CMDocType.JSP21_DOC_TYPE);
 	}
 
 	/**
@@ -40,11 +40,13 @@
 	}
 
 	public static CMDocument getCMDocument(float jspVersion) {
-		if (jspVersion >= 2)
+		if (jspVersion >= 2.1f)
+			return getCMDocument(CMDocType.JSP21_DOC_TYPE);
+		else if (jspVersion >= 2)
 			return getCMDocument(CMDocType.JSP20_DOC_TYPE);
-		if (jspVersion >= 1.2)
+		else if (jspVersion >= 1.2f)
 			return getCMDocument(CMDocType.JSP12_DOC_TYPE);
-		if (jspVersion >= 1)
+		else if (jspVersion >= 1)
 			return getCMDocument(CMDocType.JSP11_DOC_TYPE);
 		return getCMDocument();
 	}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TaglibController.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TaglibController.java
index e4454cc..bea60aa 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TaglibController.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/TaglibController.java
@@ -28,13 +28,13 @@
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
-import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
 import org.eclipse.jst.jsp.core.taglib.ITaglibIndexDelta;
 import org.eclipse.jst.jsp.core.taglib.ITaglibIndexListener;
 import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument;
 import org.eclipse.wst.sse.core.internal.util.Assert;
+import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
 
 /**
  * Provides a direct mapping from IStructuredDocument to supporting
@@ -135,7 +135,7 @@
 					info.location = buffer.getLocation();
 					info.locationKind = LocationKind.NORMALIZE;
 					info.tldDocumentManager = new TLDCMDocumentManager();
-					info.tldDocumentManager.setSourceParser((JSPSourceParser) info.document.getParser());
+					info.tldDocumentManager.setSourceParser((XMLSourceParser) info.document.getParser());
 					synchronized (_instance.fDocumentMap) {
 						_instance.fDocumentMap.put(document, info);
 					}
@@ -364,7 +364,7 @@
 		synchronized (_instance.fDocumentMap) {
 			_instance.fDocumentMap.put(document, info);
 		}
-		info.tldDocumentManager.setSourceParser((JSPSourceParser) info.document.getParser());
+		info.tldDocumentManager.setSourceParser((XMLSourceParser) info.document.getParser());
 		if (document instanceof BasicStructuredDocument && document.getLength() > 0) {
 			((BasicStructuredDocument) document).reparse(this);
 		}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMAttributeDeclarationImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMAttributeDeclarationImpl.java
index 41d7ed9..6bfdfde 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMAttributeDeclarationImpl.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMAttributeDeclarationImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -24,7 +24,9 @@
 
 public class CMAttributeDeclarationImpl implements TLDAttributeDeclaration {
 
-	private CMDataType attrType = new CMDataTypeImpl(CMDataType.CDATA);
+	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=170556
+	private static final CMDataType attrType = new CMDataTypeImpl(CMDataType.CDATA);
+	
 	private String fDescription;
 
 	//
@@ -135,7 +137,7 @@
 	 * 
 	 * @return java.lang.Object
 	 * 
-	 * Returns the object property desciped by the propertyName
+	 * Returns the object property described by the propertyName
 	 * 
 	 */
 	public Object getProperty(String propertyName) {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentFactoryTLD.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentFactoryTLD.java
index 2b5acef..09daa42 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentFactoryTLD.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentFactoryTLD.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,7 +16,6 @@
 import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.net.URLConnection;
 
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.parsers.SAXParser;
@@ -82,7 +81,6 @@
  * TLDAttributeDeclaration interfaces for extended properties.
  */
 public class CMDocumentFactoryTLD implements CMDocumentFactory {
-
 	static final boolean _debug = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/tldcmdocument/factory")); //$NON-NLS-1$ //$NON-NLS-2$
 
 	/**
@@ -402,6 +400,9 @@
 				else if (nodeName.equals(JSP20TLDNames.TAG_EXTENSION) && child.getNodeType() == Node.ELEMENT_NODE) {
 					ed.getExtensions().add(child);
 				}
+				else if (nodeName.equals(JSP20TLDNames.DYNAMIC_ATTRIBUTES) && child.hasChildNodes()) {
+					ed.setDynamicAttributes(getContainedText(child));
+				}
 			}
 			child = child.getNextSibling();
 		}
@@ -562,7 +563,7 @@
 	protected String getContainedText(Node parent) {
 		NodeList children = parent.getChildNodes();
 		if (children.getLength() == 1) {
-			return children.item(0).getNodeValue().trim();
+			return getValue(children.item(0));
 		}
 		StringBuffer s = new StringBuffer();
 		Node child = parent.getFirstChild();
@@ -577,13 +578,22 @@
 				}
 			}
 			else {
-				s.append(child.getNodeValue().trim());
+				s.append(getValue(child));
 			}
 			child = child.getNextSibling();
 		}
 		return s.toString().trim();
 	}
 
+	private String getValue(Node n) {
+		if (n == null)
+			return ""; //$NON-NLS-1$
+		String value = n.getNodeValue();
+		if (value == null)
+			return ""; //$NON-NLS-1$
+		return value.trim();
+	}
+
 	public boolean isBuilderForGrammar(String grammarFileName) {
 		String fileName = grammarFileName.toLowerCase();
 		return fileName.endsWith(".tld") || fileName.endsWith(".jar"); //$NON-NLS-2$//$NON-NLS-1$
@@ -661,7 +671,7 @@
 			}
 			// New JSP 1.2
 			// description
-			else if (nodeName.equals(JSP12TLDNames.DESCRIPTION)) {
+			else if (nodeName.equals(JSP12TLDNames.DESCRIPTION) && child.hasChildNodes()) {
 				document.setDescription(getContainedText(child));
 			}
 			// display name
@@ -810,10 +820,14 @@
 
 	private void loadTagFile(CMElementDeclarationImpl ed, IFile tagFile, boolean allowIncludes) {
 		try {
-			IStructuredDocument document = (IStructuredDocument) new ModelHandlerForJSP().getDocumentLoader().createNewStructuredDocument(tagFile);
-			IStructuredDocumentRegion documentRegion = document.getFirstStructuredDocumentRegion();
 			ed.setPath(tagFile.getFullPath().toString());
 			ed.setTagSource(TLDElementDeclaration.SOURCE_TAG_FILE);
+			ed.setLocationString(tagFile.getFullPath().toString());
+			if (!tagFile.isAccessible())
+				return;
+
+			IStructuredDocument document = (IStructuredDocument) new ModelHandlerForJSP().getDocumentLoader().createNewStructuredDocument(tagFile);
+			IStructuredDocumentRegion documentRegion = document.getFirstStructuredDocumentRegion();
 			while (documentRegion != null) {
 				if (documentRegion.getType().equals(DOMJSPRegionContexts.JSP_DIRECTIVE_NAME)) {
 					if (documentRegion.getNumberOfRegions() > 2) {
@@ -973,12 +987,11 @@
 
 		}
 		catch (IOException e) {
-			Logger.logException("problem parsing " + tagFile, e);
+			// Logger.logException("problem parsing " + tagFile, e); // can be caused by a still-in-development file
 		}
 		catch (CoreException e) {
-			Logger.logException("problem parsing " + tagFile, e);
+			// Logger.logException("problem parsing " + tagFile, e); // frequently out of sync
 		}
-		ed.setLocationString(tagFile.getFullPath().toString());
 	}
 
 	/**
@@ -1033,35 +1046,26 @@
 				break;
 			case (ITaglibRecord.URL) : {
 				IURLRecord record = (IURLRecord) reference;
-				InputStream urlContents = null;
-				URLConnection connection = null;
-				try {
-					connection = record.getURL().openConnection();
-					if (connection != null) {
-						connection.setUseCaches(false);
-						urlContents = connection.getInputStream();
-						document = (CMDocumentImpl) buildCMDocument(record.getBaseLocation(), urlContents);
-						document.setLocationString(record.getURL().toString());
-						if (document.getSmallIcon() != null) {
-							String iconPath = URIHelper.normalize(((TLDDocument) document).getSmallIcon(), record.getURL().toString(), "/"); //$NON-NLS-1$
-							document.setProperty(JSP12TLDNames.SMALL_ICON, iconPath);
-						}
-						if (document.getLargeIcon() != null) {
-							String iconPath = URIHelper.normalize(((TLDDocument) document).getLargeIcon(), record.getURL().toString(), "/"); //$NON-NLS-1$
-							document.setProperty(JSP12TLDNames.LARGE_ICON, iconPath);
-						}
+				URL url = record.getURL();
+				InputStream urlContents = JarUtilities.getInputStream(url);
+				if (urlContents != null) {
+					document = (CMDocumentImpl) buildCMDocument(record.getBaseLocation(), urlContents);
+					String urlString = url.toString();
+					document.setLocationString(urlString);
+					if (document.getSmallIcon() != null) {
+						String iconPath = URIHelper.normalize(((TLDDocument) document).getSmallIcon(), urlString, "/"); //$NON-NLS-1$
+						document.setProperty(JSP12TLDNames.SMALL_ICON, iconPath);
+					}
+					if (document.getLargeIcon() != null) {
+						String iconPath = URIHelper.normalize(((TLDDocument) document).getLargeIcon(), urlString, "/"); //$NON-NLS-1$
+						document.setProperty(JSP12TLDNames.LARGE_ICON, iconPath);
 					}
 				}
-				catch (IOException e) {
-					// not uncommon given invalid URLs
-				}
-				finally {
-					if (urlContents != null) {
-						try {
-							urlContents.close();
-						}
-						catch (IOException e) {
-						}
+				if (urlContents != null) {
+					try {
+						urlContents.close();
+					}
+					catch (IOException e) {
 					}
 				}
 			}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMElementDeclarationImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMElementDeclarationImpl.java
index 52d0136..7984fba 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMElementDeclarationImpl.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMElementDeclarationImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -322,6 +322,9 @@
 			}
 			return getOwnerDocument().getProperty(propertyName);
 		}
+		else if(TLDElementDeclaration.IS_LIBRARY_TAG.equals(propertyName)) {
+			return Boolean.TRUE;
+		}
 		return null;
 	}
 
@@ -512,7 +515,7 @@
 	 * 
 	 */
 	public boolean supports(String propertyName) {
-		return propertyName == null || propertyName.equals("tagInfo") || propertyName.equals(JSP12TLDNames.DESCRIPTION) || propertyName.equals(TLDDocument.CM_KIND) || propertyName.equals(JSP12TLDNames.SMALL_ICON) || propertyName.equals(JSP12TLDNames.LARGE_ICON) || propertyName.equals(TLDElementDeclaration.TAG_SOURCE);//$NON-NLS-1$ //$NON-NLS-2$
+		return propertyName == null || propertyName.equals("tagInfo") || propertyName.equals(JSP12TLDNames.DESCRIPTION) || propertyName.equals(TLDDocument.CM_KIND) || propertyName.equals(JSP12TLDNames.SMALL_ICON) || propertyName.equals(JSP12TLDNames.LARGE_ICON) || propertyName.equals(TLDElementDeclaration.TAG_SOURCE) || propertyName.equals(TLDElementDeclaration.IS_LIBRARY_TAG);//$NON-NLS-1$ //$NON-NLS-2$
 	}
 
 	public String toString() {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDCMDocumentManager.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDCMDocumentManager.java
index 7ee622d..ee00cbb 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDCMDocumentManager.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/TLDCMDocumentManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,7 +12,7 @@
 
 import java.io.File;
 import java.lang.ref.Reference;
-import java.lang.ref.WeakReference;
+import java.lang.ref.SoftReference;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Hashtable;
@@ -37,7 +37,6 @@
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
 import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache;
 import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache.PropertyGroup;
-import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
 import org.eclipse.jst.jsp.core.internal.provisional.JSP12Namespace;
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
 import org.eclipse.jst.jsp.core.internal.util.FacetModuleCoreSupport;
@@ -53,6 +52,7 @@
 import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
 import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
 import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
+import org.eclipse.wst.sse.core.internal.ltk.parser.JSPCapableParser;
 import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionHandler;
 import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionHandlerExtension;
 import org.eclipse.wst.sse.core.internal.ltk.parser.TagMarker;
@@ -66,6 +66,7 @@
 import org.eclipse.wst.sse.core.utils.StringUtils;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 
 public class TLDCMDocumentManager implements ITaglibIndexListener {
@@ -75,7 +76,7 @@
 		 * Adds a block tagname (fully namespace qualified) into the list of
 		 * block tag names for the parser. The marker
 		 * IStructuredDocumentRegion along with position cues during reparses
-		 * allow the JSPSourceParser to enable/ignore the tags as blocks.
+		 * allow the XMLSourceParser to enable/ignore the tags as blocks.
 		 */
 		protected void addBlockTag(String tagnameNS, ITextRegionCollection marker) {
 			if (getParser() == null)
@@ -148,7 +149,7 @@
 			}
 		}
 		
-		protected void processRegionCollection(ITextRegionCollection regionCollection, IStructuredDocumentRegion anchorStructuredDocumentRegion, JSPSourceParser textSource) {
+		protected void processRegionCollection(ITextRegionCollection regionCollection, IStructuredDocumentRegion anchorStructuredDocumentRegion, XMLSourceParser textSource) {
 			/*
 			 * Would test > 1, but since we only care if there are 8 (<%@,
 			 * taglib, uri, =, where, prefix, =, what) [or 4 for include
@@ -196,7 +197,7 @@
 		 * anchorStructuredDocumentRegion. Includes use the including file as
 		 * the point of reference, not necessarily the "top" file.
 		 */
-		protected void processInclude(ITextRegionCollection includeDirectiveCollection, IStructuredDocumentRegion anchorStructuredDocumentRegion, JSPSourceParser textSource) {
+		protected void processInclude(ITextRegionCollection includeDirectiveCollection, IStructuredDocumentRegion anchorStructuredDocumentRegion, XMLSourceParser textSource) {
 			ITextRegionList regions = includeDirectiveCollection.getRegions();
 			String includedFile = null;
 			boolean isFilename = false;
@@ -226,13 +227,22 @@
 				// strip any extraneous quotes and white space
 				includedFile = StringUtils.strip(includedFile).trim();
 				IPath filePath = null;
-				if (getIncludes().isEmpty())
-					filePath = FacetModuleCoreSupport.resolve(TaglibController.getLocation(TLDCMDocumentManager.this), includedFile);
-				else
-					filePath = FacetModuleCoreSupport.resolve((IPath) getIncludes().peek(), includedFile);
+				/*
+				 * The resolution of the included fragment should use the file
+				 * containing the directive as the base reference, not always
+				 * the main JSP being invoked. Verified behavior with Apache
+				 * Tomcat 5.5.20.
+				 */
+				IPath modelBaseLocation = TaglibController.getLocation(TLDCMDocumentManager.this);
+				if(modelBaseLocation != null) {
+					if (getIncludes().isEmpty())
+						filePath = FacetModuleCoreSupport.resolve(modelBaseLocation, includedFile);
+					else
+						filePath = FacetModuleCoreSupport.resolve((IPath) getIncludes().peek(), includedFile);
+				}
 
 				// check for "loops"
-				if (filePath != null && !getIncludes().contains(filePath) && !filePath.equals(TaglibController.getLocation(TLDCMDocumentManager.this))) {
+				if (filePath != null && !getIncludes().contains(filePath) && !filePath.equals(modelBaseLocation)) {
 					/*
 					 * Prevent slow performance when editing scriptlet part of
 					 * the JSP by only processing includes if they've been
@@ -257,9 +267,11 @@
 						includeHelper.parse(filePath);
 						List references = includeHelper.taglibReferences;
 						fTLDCMReferencesMap.put(filePath, references);
-						for (int i = 0; references != null && i < references.size(); i++) {
-							TLDCMDocumentReference reference = (TLDCMDocumentReference) references.get(i);
-							getParser().addNestablePrefix(new TagMarker(reference.prefix + ":")); //$NON-NLS-1$
+						if (getParser() instanceof JSPCapableParser) {
+							for (int i = 0; references != null && i < references.size(); i++) {
+								TLDCMDocumentReference reference = (TLDCMDocumentReference) references.get(i);
+								((JSPCapableParser) getParser()).addNestablePrefix(new TagMarker(reference.prefix + ":")); //$NON-NLS-1$
+							}
 						}
 						/*
 						 * TODO: walk up the include hierarchy and add
@@ -278,18 +290,20 @@
 							 * relative to the JSP fragment.
 							 */
 							enableTaglibFromURI(reference.prefix, reference.uri, anchorStructuredDocumentRegion);
-							getParser().addNestablePrefix(new TagMarker(reference.prefix + ":")); //$NON-NLS-1$
+							if (getParser() instanceof JSPCapableParser) {
+								((JSPCapableParser) getParser()).addNestablePrefix(new TagMarker(reference.prefix + ":")); //$NON-NLS-1$
+							}
 						}
 					}
 				}
-				else {
+				else if (getIncludes().contains(filePath)) {
 					if (Debug.debugTokenizer)
 						System.out.println("LOOP IN @INCLUDES FOUND: " + filePath); //$NON-NLS-1$
 				}
 			}
 		}
 
-		protected void processXMLStartTag(ITextRegionCollection startTagRegionCollection, IStructuredDocumentRegion anchorStructuredDocumentRegion, JSPSourceParser textSource) {
+		protected void processXMLStartTag(ITextRegionCollection startTagRegionCollection, IStructuredDocumentRegion anchorStructuredDocumentRegion, XMLSourceParser textSource) {
 			ITextRegionList regions = startTagRegionCollection.getRegions();
 			String uri = null;
 			String prefix = null;
@@ -342,7 +356,7 @@
 		 * Pulls the URI and prefix from the given taglib directive
 		 * IStructuredDocumentRegion and makes sure the tags are known.
 		 */
-		protected void processTaglib(ITextRegionCollection taglibDirectiveCollection, IStructuredDocumentRegion anchorStructuredDocumentRegion, JSPSourceParser textSource) {
+		protected void processTaglib(ITextRegionCollection taglibDirectiveCollection, IStructuredDocumentRegion anchorStructuredDocumentRegion, XMLSourceParser textSource) {
 			ITextRegionList regions = taglibDirectiveCollection.getRegions();
 			String uri = null;
 			String prefix = null;
@@ -454,20 +468,20 @@
 		public void setStructuredDocument(IStructuredDocument newDocument) {
 			Assert.isTrue(newDocument != null, "null document"); //$NON-NLS-1$
 			Assert.isTrue(newDocument.getParser() != null, "null document parser"); //$NON-NLS-1$
-			Assert.isTrue(newDocument.getParser() instanceof JSPSourceParser, "can only listen to document with a JSPSourceParser"); //$NON-NLS-1$
+			Assert.isTrue(newDocument.getParser() instanceof XMLSourceParser, "can only listen to document with a XMLSourceParser"); //$NON-NLS-1$
 			getSourceParser().removeStructuredDocumentRegionHandler(this);
-			setSourceParser((JSPSourceParser) newDocument.getParser());
+			setSourceParser((XMLSourceParser) newDocument.getParser());
 			getSourceParser().addStructuredDocumentRegionHandler(this);
 		}
 	}
 
 	protected class IncludeHelper extends DirectiveStructuredDocumentRegionHandler {
 		protected IStructuredDocumentRegion fAnchor = null;
-		protected JSPSourceParser fLocalParser = null;
-		protected JSPSourceParser fParentParser = null;
+		protected XMLSourceParser fLocalParser = null;
+		protected XMLSourceParser fParentParser = null;
 		List taglibReferences = null;
 
-		public IncludeHelper(IStructuredDocumentRegion anchor, JSPSourceParser rootParser) {
+		public IncludeHelper(IStructuredDocumentRegion anchor, XMLSourceParser rootParser) {
 			super();
 			fAnchor = anchor;
 			fParentParser = rootParser;
@@ -495,7 +509,7 @@
 		 *            the fullpath for the resource to be parsed
 		 */
 		void parse(IPath path) {
-			JSPSourceParser p = new JSPSourceParser();
+			XMLSourceParser p = (XMLSourceParser) getParser().newInstance();
 			fLocalParser = p;
 			String s = getContents(path);
 			// Should we consider preludes on this segment?
@@ -506,9 +520,11 @@
 				BlockMarker marker = (BlockMarker) blockTags.get(i);
 				fLocalParser.addBlockMarker(new BlockMarker(marker.getTagName(), null, marker.getContext(), marker.isCaseSensitive()));
 			}
-			TagMarker[] knownPrefixes = (TagMarker[]) fParentParser.getNestablePrefixes().toArray(new TagMarker[0]);
-			for (int i = 0; i < knownPrefixes.length; i++) {
-				fLocalParser.addNestablePrefix(new TagMarker(knownPrefixes[i].getTagName(), null));
+			if (fParentParser instanceof JSPCapableParser && fLocalParser instanceof JSPCapableParser) {
+				TagMarker[] knownPrefixes = (TagMarker[]) ((JSPCapableParser) fParentParser).getNestablePrefixes().toArray(new TagMarker[0]);
+				for (int i = 0; i < knownPrefixes.length; i++) {
+					((JSPCapableParser) fLocalParser).addNestablePrefix(new TagMarker(knownPrefixes[i].getTagName(), null));
+				}
 			}
 			// force parse
 			fLocalParser.getDocumentRegions();
@@ -528,15 +544,6 @@
 		int referenceCount;
 	}
 
-	private static class TLDCMDocumentDescriptor {
-		Object cacheKey;
-		CMDocument document;
-
-		TLDCMDocumentDescriptor() {
-			super();
-		}
-	}
-
 	private class TLDCMDocumentReference {
 		String prefix;
 		String uri;
@@ -630,7 +637,7 @@
 
 	private Stack fIncludes = null;
 
-	private JSPSourceParser fParser = null;
+	private XMLSourceParser fParser = null;
 
 	private List fTaglibTrackers = null;
 
@@ -654,7 +661,7 @@
 					TLDCacheEntry entry = (TLDCacheEntry) o;
 					entry.referenceCount--;
 					if (entry.referenceCount <= 0) {
-						getSharedDocumentCache().put(key, new WeakReference(entry));
+						getSharedDocumentCache().put(key, new SoftReference(entry));
 					}
 				}
 			}
@@ -672,7 +679,11 @@
 	 * @return
 	 */
 	protected Object getCacheKey(String uri) {
-		ITaglibRecord record = TaglibIndex.resolve(getCurrentParserPath().toString(), uri, false);
+		IPath currentParserPath = getCurrentParserPath();
+		if (currentParserPath == null)
+			return null;
+		
+		ITaglibRecord record = TaglibIndex.resolve(currentParserPath.toString(), uri, false);
 		if (record != null) {
 			return getUniqueIdentifier(record);
 		}
@@ -688,6 +699,9 @@
 			return null;
 		String reference = uri;
 		Object cacheKey = getCacheKey(reference);
+		if (cacheKey == null)
+			return null;
+		
 		long lastModified = getModificationStamp(reference);
 		CMDocument doc = (CMDocument) getDocuments().get(cacheKey);
 		if (doc == null) {
@@ -731,10 +745,10 @@
 				if (_debugCache) {
 					System.out.println("TLDCMDocument cache miss on " + cacheKey);
 				}
-				TLDCMDocumentDescriptor descriptor = loadTaglib(reference);
-				if (descriptor != null) {
+				CMDocument document = loadTaglib(reference);
+				if (document != null) {
 					TLDCacheEntry entry = new TLDCacheEntry();
-					doc = entry.document = descriptor.document;
+					doc = entry.document = document;
 					entry.referenceCount = 1;
 					entry.modificationStamp = getModificationStamp(reference);
 					getSharedDocumentCache().put(cacheKey, entry);
@@ -788,7 +802,18 @@
 				}
 					break;
 				case (ITaglibRecord.URL) : {
-					modificationStamp = IResource.NULL_STAMP;
+                    String loc = ((IURLRecord) record).getBaseLocation();
+                    if (loc != null && loc.endsWith(".jar")) { //$NON-NLS-1$
+                        File jarfile = new File(loc);
+                        if (jarfile.exists()) {
+                            try {
+                                modificationStamp = jarfile.lastModified();
+                            }
+                            catch (SecurityException e) {
+                                modificationStamp = IResource.NULL_STAMP;
+                            }
+                        }
+                    }
 				}
 					break;
 				default :
@@ -813,9 +838,9 @@
 
 	public List getCMDocumentTrackers(int offset) {
 		List validDocs = new ArrayList();
-		Iterator alldocs = getTaglibTrackers().iterator();
-		while (alldocs.hasNext()) {
-			TaglibTracker aTracker = (TaglibTracker) alldocs.next();
+		Object[] alldocs = getTaglibTrackers().toArray();
+		for (int i = 0; i < alldocs.length; i++) {
+			TaglibTracker aTracker = (TaglibTracker) alldocs[i];
 			if (aTracker.getStructuredDocumentRegion().getStartOffset() <= offset || offset < 0) {
 				validDocs.add(aTracker);
 			}
@@ -825,11 +850,11 @@
 
 	public List getCMDocumentTrackers(String prefix, int offset) {
 		List validDocs = new ArrayList();
-		Iterator alldocs = getTaglibTrackers().iterator();
-		while (alldocs.hasNext()) {
-			TaglibTracker aTracker = (TaglibTracker) alldocs.next();
+		Object[] alldocs = getTaglibTrackers().toArray();
+		for (int i = 0; i < alldocs.length; i++) {
+			TaglibTracker aTracker = (TaglibTracker) alldocs[i];
 			/**
-			 * '<' is used to support the immediate use of a custom tag in jspx files
+			 * '<' is used to support the immediate use of a custom tag in jspx files (instead of '<=')
 			 */
 			if ((aTracker.getStructuredDocumentRegion().getStartOffset() <= offset || offset < 0) && aTracker.getPrefix().equals(prefix)) {
 				validDocs.add(aTracker);
@@ -849,6 +874,8 @@
 	IPath getCurrentBaseLocation() {
 		IPath baseLocation = null;
 		IPath path = getCurrentParserPath();
+		if (path == null || path.segmentCount() < 2)
+			return path;
 		baseLocation = ResourcesPlugin.getWorkspace().getRoot().getFile(path).getLocation();
 		if (baseLocation == null) {
 			baseLocation = path;
@@ -903,11 +930,11 @@
 		return fIncludes;
 	}
 
-	JSPSourceParser getParser() {
+	XMLSourceParser getParser() {
 		return fParser;
 	}
 
-	public JSPSourceParser getSourceParser() {
+	public XMLSourceParser getSourceParser() {
 		return fParser;
 	}
 
@@ -942,9 +969,11 @@
 							includeHelper.parse(preludes[i]);
 							List references = includeHelper.taglibReferences;
 							fTLDCMReferencesMap.put(preludes[i], references);
-							for (int j = 0; j < references.size(); j++) {
-								TLDCMDocumentReference reference = (TLDCMDocumentReference) references.get(j);
-								getParser().addNestablePrefix(new TagMarker(reference.prefix + ":")); //$NON-NLS-1$
+							if (getParser() instanceof JSPCapableParser) {
+								for (int j = 0; j < references.size(); j++) {
+									TLDCMDocumentReference reference = (TLDCMDocumentReference) references.get(j);
+									((JSPCapableParser) getParser()).addNestablePrefix(new TagMarker(reference.prefix + ":")); //$NON-NLS-1$
+								}
 							}
 						}
 						else
@@ -1030,19 +1059,13 @@
 	 * Loads the taglib from the specified URI. It must point to a valid
 	 * taglib descriptor to work.
 	 */
-	protected TLDCMDocumentDescriptor loadTaglib(String uri) {
-		TLDCMDocumentDescriptor entry = null;
+	protected CMDocument loadTaglib(String uri) {
+		CMDocument document = null;
 		IPath currentPath = getCurrentParserPath();
 		if (currentPath != null) {
-			CMDocument document = null;
 			ITaglibRecord record = TaglibIndex.resolve(currentPath.toString(), uri, false);
 			if (record != null) {
 				document = getCMDocumentBuilder().createCMDocument(record);
-				if (document != null) {
-					entry = new TLDCMDocumentDescriptor();
-					entry.document = document;
-					entry.cacheKey = getUniqueIdentifier(record);
-				}
 			}
 			else {
 				/* Not a very-often used code path (we hope) */
@@ -1054,14 +1077,11 @@
 							System.out.println("Loading tags from " + uri + " at " + location); //$NON-NLS-2$//$NON-NLS-1$
 						}
 						document = getCMDocumentBuilder().createCMDocument(location);
-						entry = new TLDCMDocumentDescriptor();
-						entry.document = document;
-						entry.cacheKey = location;
 					}
 				}
 			}
 		}
-		return entry;
+		return document;
 	}
 
 	protected void resetTaglibTrackers() {
@@ -1072,7 +1092,7 @@
 		getTaglibTrackers().clear();
 	}
 
-	public void setSourceParser(JSPSourceParser parser) {
+	public void setSourceParser(XMLSourceParser parser) {
 		if (fParser != null)
 			fParser.removeStructuredDocumentRegionHandler(getStructuredDocumentRegionHandler());
 		fParser = parser;
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/provisional/TLDElementDeclaration.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/provisional/TLDElementDeclaration.java
index 1057164..dd34980 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/provisional/TLDElementDeclaration.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/provisional/TLDElementDeclaration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,6 +16,12 @@
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
 
 public interface TLDElementDeclaration extends CMElementDeclaration {
+	/** 
+	 * Property stating whether the {@link CMElementDeclaration}
+	 * is a library tag or not
+	 */
+	String IS_LIBRARY_TAG = "isLibraryTag"; //$NON-NLS-1$
+	
 	String TAG_SOURCE = "Tag Definition Source"; //$NON-NLS-1$
 	String SOURCE_JSP_TLD = "JSP Tag Library Descriptor"; //$NON-NLS-1$
 	String SOURCE_TAG_FILE = "JSP Tag 2.0 File"; //$NON-NLS-1$
@@ -41,6 +47,16 @@
 	 */
 	String getDisplayName();
 
+
+	/**
+	 * Indicates that the declared tag handler supports dynamic attributes. It
+	 * is not a guarantee that the class itself implements
+	 * javax.servlet.jsp.tagext.DynamicAttributes.
+	 * 
+	 * @see JSP 2.0
+	 */
+	String getDynamicAttributes();
+	
 	/**
 	 * Optional informal description of an example of a use of this tag
 	 * 
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/DeploymentDescriptorPropertyCache.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/DeploymentDescriptorPropertyCache.java
index 89d43d2..d64107a 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/DeploymentDescriptorPropertyCache.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/DeploymentDescriptorPropertyCache.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,6 +17,7 @@
 import java.lang.ref.Reference;
 import java.lang.ref.SoftReference;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
@@ -46,6 +47,7 @@
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.w3c.dom.Document;
+import org.w3c.dom.DocumentType;
 import org.w3c.dom.Element;
 import org.w3c.dom.EntityReference;
 import org.w3c.dom.Node;
@@ -57,15 +59,16 @@
 import org.xml.sax.SAXParseException;
 
 /**
- * A cache fo property group information stored in web.xml files. Information
+ * A cache for property group information stored in web.xml files. Information
  * is not persisted.
  */
 public final class DeploymentDescriptorPropertyCache {
 	private static final PropertyGroup[] NO_PROPERTY_GROUPS = new PropertyGroup[0];
 
-	private static class DeploymentDescriptor {
+	static class DeploymentDescriptor {
 		PropertyGroup[] groups;
 		long modificationStamp;
+		StringMatcher[] urlPatterns;
 		Float version = new Float(defaultWebAppVersion);
 	}
 
@@ -222,27 +225,40 @@
 		}
 
 		public String toString() {
-			return number + ":" + url_pattern;
+			return number + ":" + url_pattern; //$NON-NLS-1$
 		}
 	}
 
-	private static class ResourceChangeListener implements IResourceChangeListener {
+	static class ResourceChangeListener implements IResourceChangeListener {
 		public void resourceChanged(IResourceChangeEvent event) {
 			IResourceDelta delta = event.getDelta();
 			if (event.getType() != IResourceChangeEvent.POST_CHANGE)
 				return;
 			if (delta.getKind() == IResourceDelta.CHANGED && (delta.getFlags() == IResourceDelta.ENCODING || delta.getFlags() == IResourceDelta.MARKERS))
 				return;
+
 			IResourceDeltaVisitor visitor = new IResourceDeltaVisitor() {
 				public boolean visit(IResourceDelta delta) {
 					IResource resource = delta.getResource();
 					if (resource.getType() == IResource.FILE) {
+						if (delta.getKind() == IResourceDelta.CHANGED && (delta.getFlags() == IResourceDelta.ENCODING || delta.getFlags() == IResourceDelta.MARKERS))
+							return false;
+
 						IPath path = resource.getFullPath();
 						int segmentCount = path.segmentCount();
 						if (segmentCount > 1 && path.lastSegment().equals(WEB_XML) && path.segment(segmentCount - 2).equals(WEB_INF)) {
 							getInstance().deploymentDescriptorChanged(path);
 						}
 					}
+					else if (resource.getType() == IResource.PROJECT) {
+						String name = resource.getName();
+						if (_debugResolutionCache) {
+							System.out.println("Removing DeploymentDescriptorPropertyCache resolution cache for project " + name); //$NON-NLS-1$ 
+						}
+						synchronized (LOCK) {
+							getInstance().resolvedMap.remove(name);
+						}
+					}
 					return true;
 				}
 			};
@@ -287,7 +303,7 @@
 	/**
 	 * Copied from org.eclipse.core.internal.propertytester.StringMatcher, but
 	 * should be replaced with a more accurate implementation of the rules in
-	 * Servlet spec SRV.11.2
+	 * Servlet spec SRV.11.2 and RFC 2396
 	 */
 	private static class StringMatcher {
 		private static final char SINGLE_WILD_CARD = '\u0000';
@@ -301,7 +317,7 @@
 
 		private boolean hasTrailingStar;
 
-		private final String pattern;
+		final String pattern;
 
 		private final int patternLength;
 
@@ -366,8 +382,8 @@
 
 		/**
 		 * Given the starting (inclusive) and the ending (exclusive) positions
-		 * in the <code>text</code>, determine if the given substring
-		 * matches with aPattern
+		 * in the <code>text</code>, determine if the given substring matches
+		 * with aPattern
 		 * 
 		 * @return true if the specified portion of the text matches the
 		 *         pattern
@@ -528,28 +544,33 @@
 			}
 			return true;
 		}
+		
+		public String toString() {
+			return "StringMatcher: " + pattern; //$NON-NLS-1$
+		}
 	}
 
-	private static DeploymentDescriptorPropertyCache _instance = new DeploymentDescriptorPropertyCache();
+	private static final DeploymentDescriptorPropertyCache _instance = new DeploymentDescriptorPropertyCache();
+	private static final boolean _debugResolutionCache = false;
 
-	private static final float defaultWebAppVersion = 2.4f;
-	private static String EL_IGNORED = "el-ignored";
-	private static String ID = "id";
-	private static String INCLUDE_CODA = "include-coda";
-	private static String INCLUDE_PRELUDE = "include-prelude";
+	private static final float defaultWebAppVersion = 3f;
+	static final String EL_IGNORED = "el-ignored"; //$NON-NLS-1$
+	static final String ID = "id"; //$NON-NLS-1$
+	static final String INCLUDE_CODA = "include-coda"; //$NON-NLS-1$
+	static final String INCLUDE_PRELUDE = "include-prelude"; //$NON-NLS-1$
 
-	private static String IS_XML = "is-xml";
-	private static String JSP_PROPERTY_GROUP = "jsp-property-group";
-	private static String PAGE_ENCODING = "page-encoding";
+	static final String IS_XML = "is-xml"; //$NON-NLS-1$
+	private static String JSP_PROPERTY_GROUP = "jsp-property-group"; //$NON-NLS-1$
+	static final String PAGE_ENCODING = "page-encoding"; //$NON-NLS-1$
 
-	private static String SCRIPTING_INVALID = "scripting-invalid";
-	private static String URL_PATTERN = "url-pattern";
-	private static final String WEB_APP_ELEMENT_LOCAL_NAME = ":web-app";
-	private static final String WEB_APP_ELEMENT_NAME = "web-app";
+	static final String SCRIPTING_INVALID = "scripting-invalid"; //$NON-NLS-1$
+	static final String URL_PATTERN = "url-pattern"; //$NON-NLS-1$
+	private static final String WEB_APP_ELEMENT_LOCAL_NAME = ":web-app"; //$NON-NLS-1$
+	private static final String WEB_APP_ELEMENT_NAME = "web-app"; //$NON-NLS-1$
 
-	private static final String WEB_APP_VERSION_NAME = "version";
-	private static final String WEB_INF = "WEB-INF";
-	private static final String WEB_XML = "web.xml";
+	private static final String WEB_APP_VERSION_NAME = "version"; //$NON-NLS-1$
+	private static final String WEB_INF = "WEB-INF"; //$NON-NLS-1$
+	private static final String WEB_XML = "web.xml"; //$NON-NLS-1$
 	// private static final String WEB_INF_WEB_XML = WEB_INF + IPath.SEPARATOR
 	// + WEB_XML;
 	private static final String SLASH_WEB_INF_WEB_XML = Path.ROOT.toString() + WEB_INF + IPath.SEPARATOR + WEB_XML;
@@ -603,30 +624,56 @@
 
 	private IResourceChangeListener fResourceChangeListener = new ResourceChangeListener();
 
+	// for use when reading TLDs
 	private EntityResolver resolver;
 
+	Map resolvedMap = new HashMap();
+
+	final static Object LOCK = new Object();
+
 	private DeploymentDescriptorPropertyCache() {
 		super();
 	}
 
-	private void _parseDocument(IPath path, Float[] version, List groupList, SubProgressMonitor subMonitor, Document document) {
+	private void _parseDocument(IPath path, Float[] version, List groupList, List urlPatterns, SubProgressMonitor subMonitor, Document document) {
 		Element webapp = document.getDocumentElement();
 		if (webapp != null) {
 			if (webapp.getTagName().equals(WEB_APP_ELEMENT_NAME) || webapp.getNodeName().endsWith(WEB_APP_ELEMENT_LOCAL_NAME)) {
-				String versionValue = webapp.getAttribute(WEB_APP_VERSION_NAME);
-				if (versionValue != null) {
-					try {
-						version[0] = Float.valueOf(versionValue);
+				// this convention only started with 2.4?
+				if (webapp.hasAttribute(WEB_APP_VERSION_NAME)) {
+					String versionValue = webapp.getAttribute(WEB_APP_VERSION_NAME);
+					versionValue = versionValue.trim();
+					if (versionValue.length() > 0) {
+						try {
+							version[0] = Float.valueOf(versionValue);
+						}
+						catch (NumberFormatException e) {
+							// doesn't matter
+						}
 					}
-					catch (NumberFormatException e) {
-						// doesn't matter
+				}
+				if (version[0] == null) {
+					// try determining the version from the doctype reference
+					DocumentType doctype = document.getDoctype();
+					if (doctype != null) {
+						String systemId = doctype.getSystemId();
+						String publicId = doctype.getPublicId();
+						if ((systemId != null && systemId.endsWith("web-app_2_3.dtd")) || (publicId != null && publicId.indexOf("Web Application 2.3") > 0)) { //$NON-NLS-1$ //$NON-NLS-2$
+							version[0] = new Float(2.3);
+						}
+						else if ((systemId != null && systemId.endsWith("web-app_2_2.dtd")) || (publicId != null && publicId.indexOf("Web Application 2.2") > 0)) { //$NON-NLS-1$ //$NON-NLS-2$
+							version[0] = new Float(2.2);
+						}
+						else if ((systemId != null && systemId.endsWith("web-app_2_1.dtd")) || (publicId != null && publicId.indexOf("Web Application 2.1") > 0)) { //$NON-NLS-1$ //$NON-NLS-2$
+							version[0] = new Float(2.1);
+						}
 					}
 				}
 			}
 		}
 		NodeList propertyGroupElements = document.getElementsByTagName(JSP_PROPERTY_GROUP);
 		int length = propertyGroupElements.getLength();
-		subMonitor.beginTask("Reading Property Groups", length);
+		subMonitor.beginTask("Reading Property Groups", length); //$NON-NLS-1$
 		for (int i = 0; i < length; i++) {
 			PropertyGroup group = PropertyGroup.createFrom(path, propertyGroupElements.item(i), i);
 			subMonitor.worked(1);
@@ -634,6 +681,14 @@
 				groupList.add(group);
 			}
 		}
+		
+		NodeList urlPatternElements = document.getElementsByTagName(URL_PATTERN);
+		for (int i = 0; i < urlPatternElements.getLength(); i++) {
+			String urlPattern = getContainedText(urlPatternElements.item(i));
+			if(urlPattern != null && urlPattern.length() > 0) {
+				urlPatterns.add(new StringMatcher(urlPattern));
+			}
+		}
 	}
 
 	/**
@@ -641,6 +696,8 @@
 	 */
 	private float convertSpecVersions(float version) {
 		if (version > 0) {
+			if (version == 3f)
+				return 2.2f;
 			if (version == 2.5f)
 				return 2.1f;
 			else if (version == 2.4f)
@@ -666,25 +723,26 @@
 	 * SSE XML parser to find the property groups.
 	 */
 	private DeploymentDescriptor fetchDescriptor(IPath path, IProgressMonitor monitor) {
-		monitor.beginTask("Reading Deployment Descriptor", 3);
+		monitor.beginTask(Messages.DeploymentDescriptorPropertyCache_1, 3);
 		IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
 
 		PropertyGroup groups[] = null;
 
 		IStructuredModel model = null;
 		List groupList = new ArrayList();
+		List urlPatterns = new ArrayList();
 		Float[] version = new Float[1];
 		SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, 2);
 		DocumentBuilder builder = CommonXML.getDocumentBuilder(false);
 		builder.setEntityResolver(getEntityResolver());
 		builder.setErrorHandler(getErrorHandler(path));
-		try {			
+		try {
 			InputSource inputSource = new InputSource();
 			String s = FileContentCache.getInstance().getContents(path);
 			inputSource.setCharacterStream(new StringReader(s));
 			inputSource.setSystemId(path.toString());
 			Document document = builder.parse(inputSource);
-			_parseDocument(path, version, groupList, subMonitor, document);
+			_parseDocument(path, version, groupList, urlPatterns, subMonitor, document);
 		}
 		catch (SAXException e1) {
 			/* encountered a fatal parsing error, try our own parser */
@@ -698,7 +756,7 @@
 				monitor.worked(1);
 				if (model instanceof IDOMModel) {
 					IDOMDocument document = ((IDOMModel) model).getDocument();
-					_parseDocument(path, version, groupList, subMonitor, document);
+					_parseDocument(path, version, groupList, urlPatterns, subMonitor, document);
 				}
 			}
 			catch (Exception e) {
@@ -725,12 +783,31 @@
 		DeploymentDescriptor deploymentDescriptor = new DeploymentDescriptor();
 		deploymentDescriptor.modificationStamp = file.getModificationStamp();
 		deploymentDescriptor.groups = groups;
+		deploymentDescriptor.urlPatterns = ((StringMatcher[]) urlPatterns.toArray(new StringMatcher[urlPatterns.size()]));
 		deploymentDescriptor.version = version[0];
 		monitor.done();
 		fDeploymentDescriptors.put(path, new SoftReference(deploymentDescriptor));
 		return deploymentDescriptor;
 	}
 
+	private DeploymentDescriptor getCachedDescriptor(IPath jspFilePath) {
+		IPath webxmlPath = getWebXMLPath(jspFilePath);
+		if (webxmlPath == null)
+			return null;
+
+		IFile webxmlFile = ResourcesPlugin.getWorkspace().getRoot().getFile(webxmlPath);
+		if (!webxmlFile.isAccessible())
+			return null;
+
+		Reference descriptorHolder = (Reference) fDeploymentDescriptors.get(webxmlPath);
+		DeploymentDescriptor descriptor = null;
+
+		if (descriptorHolder == null || ((descriptor = (DeploymentDescriptor) descriptorHolder.get()) == null) || (descriptor.modificationStamp == IResource.NULL_STAMP) || (descriptor.modificationStamp != webxmlFile.getModificationStamp())) {
+			descriptor = fetchDescriptor(webxmlPath, new NullProgressMonitor());
+		}
+		return descriptor;
+	}
+
 	private EntityResolver getEntityResolver() {
 		if (resolver == null) {
 			resolver = new EntityResolver() {
@@ -765,22 +842,10 @@
 	public float getJSPVersion(IPath fullPath) {
 		float version = defaultWebAppVersion;
 		/* try applicable web.xml file first */
-		IPath webxmlPath = FacetModuleCoreSupport.resolve(fullPath, SLASH_WEB_INF_WEB_XML);
-		if (webxmlPath != null) {
-			IFile webxmlFile = ResourcesPlugin.getWorkspace().getRoot().getFile(webxmlPath);
-			if (webxmlFile.isAccessible()) {
-				Reference descriptorHolder = (Reference) fDeploymentDescriptors.get(webxmlPath);
-				DeploymentDescriptor descriptor = null;
-
-				if (descriptorHolder == null || ((descriptor = (DeploymentDescriptor) descriptorHolder.get()) == null) || (descriptor.modificationStamp == IResource.NULL_STAMP) || (descriptor.modificationStamp != webxmlFile.getModificationStamp())) {
-					descriptor = fetchDescriptor(webxmlPath, new NullProgressMonitor());
-				}
-
-				if (descriptor.version != null) {
-					version = descriptor.version.floatValue();
-					return convertSpecVersions(version);
-				}
-			}
+		DeploymentDescriptor descriptor = getCachedDescriptor(fullPath);
+		if (descriptor != null && descriptor.version != null) {
+			version = descriptor.version.floatValue();
+			return convertSpecVersions(version);
 		}
 
 		/* check facet settings */
@@ -799,21 +864,10 @@
 	 */
 	public PropertyGroup[] getPropertyGroups(IPath jspFilePath) {
 		List matchingGroups = new ArrayList(1);
-		IPath webxmlPath = FacetModuleCoreSupport.resolve(jspFilePath, SLASH_WEB_INF_WEB_XML);
-		if (webxmlPath == null)
+		DeploymentDescriptor descriptor = getCachedDescriptor(jspFilePath);
+		if (descriptor == null)
 			return NO_PROPERTY_GROUPS;
 
-		IFile webxmlFile = ResourcesPlugin.getWorkspace().getRoot().getFile(webxmlPath);
-		if (!webxmlFile.isAccessible())
-			return NO_PROPERTY_GROUPS;
-
-		Reference descriptorHolder = (Reference) fDeploymentDescriptors.get(webxmlPath);
-		DeploymentDescriptor descriptor = null;
-
-		if (descriptorHolder == null || ((descriptor = (DeploymentDescriptor) descriptorHolder.get()) == null) || (descriptor.modificationStamp == IResource.NULL_STAMP) || (descriptor.modificationStamp != webxmlFile.getModificationStamp())) {
-			descriptor = fetchDescriptor(webxmlPath, new NullProgressMonitor());
-		}
-
 		for (int i = 0; i < descriptor.groups.length; i++) {
 			if (descriptor.groups[i].matches(FacetModuleCoreSupport.getRuntimePath(jspFilePath).toString(), false)) {
 				matchingGroups.add(descriptor.groups[i]);
@@ -829,6 +883,68 @@
 		return (PropertyGroup[]) matchingGroups.toArray(new PropertyGroup[matchingGroups.size()]);
 	}
 
+	/**
+	 * @param jspFilePath
+	 *            the path of the JSP file
+	 * @param reference
+	 *            a path reference to test for
+	 * @return a matching url-mapping value in the corresponding deployment
+	 *         descriptor for the given JSP file path, if a deployment
+	 *         descriptor could be found, null otherwise
+	 */
+	public String getURLMapping(IPath jspFilePath, String reference) {
+		DeploymentDescriptor descriptor = getCachedDescriptor(jspFilePath);
+		if (descriptor == null)
+			return null;
+		StringMatcher[] mappings = descriptor.urlPatterns;
+		for (int i = 0; i < mappings.length; i++) {
+			if (mappings[i].match(reference)) {
+				return mappings[i].pattern;
+			}
+		}
+		return null;
+	}
+	
+	private IPath getWebXMLPath(IPath fullPath) {
+		/*
+		 * It can take the better part of a full second to do this, so cache
+		 * the result.
+		 */
+		IPath resolved = null;
+		Map mapForProject = null;
+		synchronized (LOCK) {
+			mapForProject = (Map) resolvedMap.get(fullPath.segment(0));
+			if (mapForProject != null) {
+				resolved = (IPath) mapForProject.get(fullPath);
+			}
+			else {
+				mapForProject = new HashMap();
+				resolvedMap.put(fullPath.segment(0), mapForProject);
+			}
+		}
+		if (resolved != null) {
+			if (_debugResolutionCache) {
+				System.out.println("DeploymentDescriptorPropertyCache resolution cache hit for " + fullPath); //$NON-NLS-1$ 
+			}
+		}
+		else {
+			if (_debugResolutionCache) {
+				System.out.println("DeploymentDescriptorPropertyCache resolution cache miss for " + fullPath); //$NON-NLS-1$ 
+			}
+			resolved = FacetModuleCoreSupport.resolve(fullPath, SLASH_WEB_INF_WEB_XML);
+			mapForProject.put(fullPath, resolved);
+		}
+		return resolved;
+	}
+
+	public IFile getWebXML(IPath jspFilePath) {
+		IPath webxmlPath = getWebXMLPath(jspFilePath);
+		if (webxmlPath == null)
+			return null;
+
+		return ResourcesPlugin.getWorkspace().getRoot().getFile(webxmlPath);
+	}
+
 	private void updateCacheEntry(IPath fullPath) {
 		/* don't update right now; remove and wait for another query to update */
 		fDeploymentDescriptors.remove(fullPath);
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/IntStack.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/IntStack.java
index 99c7477..89fdc13 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/IntStack.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/IntStack.java
@@ -94,6 +94,21 @@
 	}
 
 	public int size() {
-		return list.length;
+		return size;
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	public String toString() {
+		StringBuffer s = new StringBuffer(getClass().getName() + ":" +size + " [");
+		for (int i = 0; i < size; i++) {
+			s.append(list[i]);
+			if(i < size - 1) {
+				s.append(", ");
+			}
+		}
+		s.append("]");
+		return s.toString();
 	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPHeadTokenizer.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPHeadTokenizer.java
index a7f549b..176c532 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPHeadTokenizer.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPHeadTokenizer.java
@@ -1,5 +1,7 @@
+/* The following code was generated by JFlex 1.4.2 on 7/28/08 9:29 AM */
+
 /*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,20 +14,17 @@
 package org.eclipse.jst.jsp.core.internal.contenttype;
 import java.io.IOException;
 import java.io.Reader;
+import java.util.Arrays;
 
 import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
 import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;
 
 
-
-
-
-
 /**
  * This class is a scanner generated by 
- * <a href="http://www.jflex.de/">JFlex</a> 1.4.1
- * on 4/17/07 12:35 AM from the specification file
- * <tt>D:/eclipse.wtp/workspace/org.eclipse.jst.jsp.core/DevTimeSupport/HeadParsers/JSPHeadTokenizer.jFlex</tt>
+ * <a href="http://www.jflex.de/">JFlex</a> 1.4.2
+ * on 7/28/08 9:29 AM from the specification file
+ * <tt>D:/workspaces/wtp301/workspace/org.eclipse.jst.jsp.core/DevTimeSupport/HeadParsers/JSPHeadTokenizer.jFlex</tt>
  */
 public class JSPHeadTokenizer {
 
@@ -58,16 +57,16 @@
    * Translates characters to character classes
    */
   private static final String ZZ_CMAP_PACKED = 
-    "\11\0\1\6\1\11\2\0\1\10\22\0\1\34\1\17\1\37\2\0"+
-    "\1\51\1\0\1\40\6\0\1\43\1\33\1\0\1\47\1\0\1\44"+
-    "\5\0\1\50\1\41\1\0\1\12\1\7\1\56\1\13\1\52\1\53"+
-    "\1\31\1\22\1\20\1\26\1\0\1\46\1\27\1\32\1\54\1\0"+
-    "\1\16\1\15\1\35\1\21\1\25\1\0\1\45\1\36\1\23\1\30"+
-    "\1\55\1\42\1\14\1\24\7\0\1\53\1\31\1\22\1\20\1\26"+
-    "\1\0\1\46\1\27\1\32\1\54\1\0\1\16\1\15\1\35\1\21"+
-    "\1\25\1\0\1\45\1\36\1\23\1\30\1\55\1\42\1\14\1\24"+
-    "\101\0\1\4\3\0\1\5\17\0\1\3\16\0\1\1\20\0\1\3"+
-    "\16\0\1\1\1\2\170\0\1\2\ufe87\0";
+    "\1\11\10\0\1\6\1\10\2\0\1\7\22\0\1\6\1\20\1\37"+
+    "\2\0\1\51\1\0\1\40\6\0\1\43\1\34\1\0\1\47\1\0"+
+    "\1\44\5\0\1\50\1\41\1\0\1\13\1\12\1\56\1\14\1\52"+
+    "\1\53\1\32\1\23\1\21\1\27\1\0\1\46\1\30\1\33\1\54"+
+    "\1\0\1\17\1\16\1\35\1\22\1\26\1\0\1\45\1\36\1\24"+
+    "\1\31\1\55\1\42\1\15\1\25\7\0\1\53\1\32\1\23\1\21"+
+    "\1\27\1\0\1\46\1\30\1\33\1\54\1\0\1\17\1\16\1\35"+
+    "\1\22\1\26\1\0\1\45\1\36\1\24\1\31\1\55\1\42\1\15"+
+    "\1\25\101\0\1\4\3\0\1\5\17\0\1\3\16\0\1\1\20\0"+
+    "\1\3\16\0\1\1\1\2\170\0\1\2\ufe87\0";
 
   /** 
    * Translates characters to character classes
@@ -80,15 +79,20 @@
   private static final int [] ZZ_ACTION = zzUnpackAction();
 
   private static final String ZZ_ACTION_PACKED_0 =
-    "\10\0\20\1\2\2\1\1\1\3\1\4\1\5\1\6"+
-    "\1\5\1\7\2\5\1\7\1\10\2\11\4\0\1\12"+
-    "\1\13\6\0\1\14\5\0\1\15\1\16\1\0\1\17"+
-    "\1\0\1\20\4\0\1\21\41\0\1\22\7\0\1\23"+
-    "\12\0\1\24\6\0\1\25\1\26\22\0\1\27\5\0"+
-    "\1\30\52\0\1\31\5\0\1\32\12\0\1\32";
+    "\10\0\24\1\2\2\1\1\1\2\1\3\1\4\1\5"+
+    "\1\6\1\1\1\5\1\7\1\5\1\1\1\10\1\1"+
+    "\1\11\6\0\1\12\1\13\15\0\1\14\20\0\1\15"+
+    "\1\0\1\16\1\0\1\2\1\3\1\4\1\6\3\0"+
+    "\1\17\1\7\1\0\1\10\1\11\10\0\1\20\5\0"+
+    "\1\14\12\0\1\15\1\16\1\2\1\17\67\0\1\21"+
+    "\20\0\1\22\4\0\1\21\17\0\1\22\6\0\1\23"+
+    "\15\0\1\24\1\0\1\23\2\0\1\25\14\0\1\24"+
+    "\2\0\1\25\34\0\1\26\14\0\1\26\2\0\1\27"+
+    "\13\0\1\27\132\0\1\30\1\0\1\30\6\0\2\30"+
+    "\11\0\1\31\1\0\1\31\2\0\2\31\11\0";
 
   private static int [] zzUnpackAction() {
-    int [] result = new int[214];
+    int [] result = new int[446];
     int offset = 0;
     offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
     return result;
@@ -135,9 +139,6 @@
   /** the textposition at the last accepting state */
   private int zzMarkedPos;
 
-  /** the textposition at the last state to be included in yytext */
-  private int zzPushbackPos;
-
   /** the current text position in the buffer */
   private int zzCurrentPos;
 
@@ -193,13 +194,13 @@
 
                 /* this buffer contains the current text to be matched and is
                  the source of the yytext() string */
-                java.util.Arrays.fill(zzBuffer, (char)0);
+                Arrays.fill(zzBuffer, (char)0);
 
                 /* the textposition at the last accepting state */
                 zzMarkedPos = 0;
 
                 /* the textposition at the last state to be included in yytext */
-                zzPushbackPos = 0;
+                //zzPushbackPos = 0;
 
                 /* the current text position in the buffer */
                 zzCurrentPos = 0;
@@ -248,7 +249,7 @@
         }
 
 
-        public final HeadParserToken getNextToken() throws IOException {
+        public final HeadParserToken getNextToken() throws IOException, Exception {
                 String context = null;
                 context = primGetNextToken();
                 HeadParserToken result = null;
@@ -315,7 +316,7 @@
     char [] map = new char[0x10000];
     int i = 0;  /* index in packed string  */
     int j = 0;  /* index in unpacked array */
-    while (i < 192) {
+    while (i < 194) {
       int  count = packed.charAt(i++);
       char value = packed.charAt(i++);
       do map[j++] = value; while (--count > 0);
@@ -343,7 +344,6 @@
       zzEndRead-= zzStartRead;
       zzCurrentPos-= zzStartRead;
       zzMarkedPos-= zzStartRead;
-      zzPushbackPos-= zzStartRead;
       zzStartRead = 0;
     }
 
@@ -359,13 +359,23 @@
     int numRead = zzReader.read(zzBuffer, zzEndRead,
                                             zzBuffer.length-zzEndRead);
 
-    if (numRead < 0) {
-      return true;
-    }
-    else {
+    if (numRead > 0) {
       zzEndRead+= numRead;
       return false;
     }
+    // unlikely but not impossible: read 0 characters, but not at end of stream    
+    if (numRead == 0) {
+      int c = zzReader.read();
+      if (c == -1) {
+        return true;
+      } else {
+        zzBuffer[zzEndRead++] = (char) c;
+        return false;
+      }     
+    }
+
+	// numRead < 0
+    return true;
   }
 
     
@@ -396,7 +406,7 @@
     zzAtBOL  = true;
     zzAtEOF  = false;
     zzEndRead = zzStartRead = 0;
-    zzCurrentPos = zzMarkedPos = zzPushbackPos = 0;
+    zzCurrentPos = zzMarkedPos = 0;
     yychar = 0;
     zzLexicalState = YYINITIAL;
   }
@@ -466,7 +476,7 @@
    *
    * @param   errorCode  the code of the errormessage to display
    */
-  private void zzScanError(int errorCode) {
+  private void zzScanError(int errorCode) throws java.lang.Exception {
     String message;
     try {
       message = ZZ_ERROR_MSG[errorCode];
@@ -475,7 +485,7 @@
       message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
     }
 
-    throw new Error(message);
+    throw new java.lang.Exception(message);
   } 
 
 
@@ -487,7 +497,7 @@
    * @param number  the number of characters to be read again.
    *                This number must not be greater than yylength()!
    */
-  public void yypushback(int number)  {
+  public void yypushback(int number)  throws java.lang.Exception {
     if ( number > yylength() )
       zzScanError(ZZ_PUSHBACK_2BIG);
 
@@ -515,7 +525,7 @@
    * @return      the next token
    * @exception   java.io.IOException  if any I/O-Error occurs
    */
-  public String primGetNextToken() throws java.io.IOException {
+  public String primGetNextToken() throws java.io.IOException, java.lang.Exception {
     int zzInput;
     int zzAction;
 
@@ -607,1367 +617,3172 @@
           zzForNext: { switch (zzState) {
             case 0:
               switch (zzInput) {
-                case 10: zzIsFinal = true; zzState = 9; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 9; break zzForNext;
+                case 11: zzIsFinal = true; zzState = 10; break zzForNext;
                 default: zzIsFinal = true; zzNoLookAhead = true; zzState = 8; break zzForNext;
               }
 
             case 1:
               switch (zzInput) {
-                case 1: zzIsFinal = true; zzState = 10; break zzForNext;
-                case 2: zzIsFinal = true; zzState = 11; break zzForNext;
-                case 3: zzIsFinal = true; zzState = 12; break zzForNext;
+                case 1: zzIsFinal = true; zzState = 11; break zzForNext;
+                case 2: zzIsFinal = true; zzState = 12; break zzForNext;
+                case 3: zzIsFinal = true; zzState = 13; break zzForNext;
                 case 6: 
-                case 8: 
-                case 9: 
-                case 28: zzIsFinal = true; zzState = 13; break zzForNext;
-                case 10: zzIsFinal = true; zzState = 14; break zzForNext;
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 14; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 15; break zzForNext;
+                case 11: zzIsFinal = true; zzState = 16; break zzForNext;
                 default: zzIsFinal = true; zzNoLookAhead = true; zzState = 8; break zzForNext;
               }
 
             case 2:
               switch (zzInput) {
                 case 6: 
-                case 8: 
-                case 9: 
-                case 28: zzIsFinal = true; zzState = 15; break zzForNext;
-                case 11: zzIsFinal = true; zzState = 16; break zzForNext;
-                case 22: zzIsFinal = true; zzState = 17; break zzForNext;
-                case 45: zzIsFinal = true; zzState = 18; break zzForNext;
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 17; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 18; break zzForNext;
+                case 12: zzIsFinal = true; zzState = 19; break zzForNext;
+                case 23: zzIsFinal = true; zzState = 20; break zzForNext;
+                case 45: zzIsFinal = true; zzState = 21; break zzForNext;
                 default: zzIsFinal = true; zzNoLookAhead = true; zzState = 8; break zzForNext;
               }
 
             case 3:
               switch (zzInput) {
-                case 14: zzIsFinal = true; zzState = 19; break zzForNext;
-                case 18: zzIsFinal = true; zzState = 20; break zzForNext;
-                case 21: zzIsFinal = true; zzState = 21; break zzForNext;
-                case 27: zzIsFinal = true; zzState = 22; break zzForNext;
-                case 41: zzIsFinal = true; zzState = 23; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 22; break zzForNext;
+                case 15: zzIsFinal = true; zzState = 23; break zzForNext;
+                case 19: zzIsFinal = true; zzState = 24; break zzForNext;
+                case 22: zzIsFinal = true; zzState = 25; break zzForNext;
+                case 28: zzIsFinal = true; zzState = 26; break zzForNext;
+                case 41: zzIsFinal = true; zzState = 27; break zzForNext;
                 default: zzIsFinal = true; zzNoLookAhead = true; zzState = 8; break zzForNext;
               }
 
             case 4:
               switch (zzInput) {
                 case 6: 
-                case 8: 
-                case 28: zzIsFinal = true; zzState = 25; break zzForNext;
-                case 9: zzIsFinal = true; zzState = 26; break zzForNext;
-                case 31: zzIsFinal = true; zzNoLookAhead = true; zzState = 27; break zzForNext;
-                case 32: zzIsFinal = true; zzNoLookAhead = true; zzState = 28; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 24; break zzForNext;
+                case 7: zzIsFinal = true; zzState = 29; break zzForNext;
+                case 8: zzIsFinal = true; zzState = 30; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 31; break zzForNext;
+                case 31: zzIsFinal = true; zzState = 32; break zzForNext;
+                case 32: zzIsFinal = true; zzState = 33; break zzForNext;
+                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 28; break zzForNext;
               }
 
             case 5:
               switch (zzInput) {
+                case 7: 
                 case 8: 
-                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 30; break zzForNext;
-                case 11: zzIsFinal = true; zzState = 31; break zzForNext;
-                case 31: zzIsFinal = true; zzNoLookAhead = true; zzState = 32; break zzForNext;
-                case 32: zzIsFinal = true; zzState = 33; break zzForNext;
-                case 41: zzIsFinal = true; zzState = 34; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 29; break zzForNext;
+                case 11: zzIsFinal = true; zzState = 35; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 36; break zzForNext;
+                case 12: zzIsFinal = true; zzState = 37; break zzForNext;
+                case 31: zzIsFinal = true; zzState = 38; break zzForNext;
+                case 41: zzIsFinal = true; zzState = 39; break zzForNext;
+                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 34; break zzForNext;
               }
 
             case 6:
               switch (zzInput) {
+                case 7: 
                 case 8: 
-                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 30; break zzForNext;
-                case 41: zzIsFinal = true; zzState = 34; break zzForNext;
-                case 32: zzIsFinal = true; zzState = 35; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 29; break zzForNext;
+                case 11: zzIsFinal = true; zzState = 35; break zzForNext;
+                case 32: zzIsFinal = true; zzState = 38; break zzForNext;
+                case 41: zzIsFinal = true; zzState = 39; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 40; break zzForNext;
+                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 34; break zzForNext;
               }
 
             case 7:
               switch (zzInput) {
-                case 11: 
-                case 41: zzIsFinal = true; zzState = 34; break zzForNext;
+                case 11: zzIsFinal = true; zzState = 35; break zzForNext;
+                case 12: 
+                case 41: zzIsFinal = true; zzState = 39; break zzForNext;
                 case 6: 
-                case 8: 
-                case 9: 
-                case 28: zzIsFinal = true; zzNoLookAhead = true; zzState = 36; break zzForNext;
-                case 31: zzIsFinal = true; zzNoLookAhead = true; zzState = 37; break zzForNext;
-                case 32: zzIsFinal = true; zzState = 38; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 29; break zzForNext;
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 41; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 42; break zzForNext;
+                case 31: 
+                case 32: zzIsFinal = true; zzState = 43; break zzForNext;
+                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 34; break zzForNext;
               }
 
             case 9:
               switch (zzInput) {
-                case 15: zzState = 39; break zzForNext;
-                case 23: zzState = 40; break zzForNext;
-                case 41: zzState = 41; break zzForNext;
-                case 44: zzState = 42; break zzForNext;
+                case 11: zzState = 44; break zzForNext;
                 default: break zzForAction;
               }
 
             case 10:
               switch (zzInput) {
-                case 2: zzIsFinal = true; zzNoLookAhead = true; zzState = 43; break zzForNext;
+                case 9: zzState = 45; break zzForNext;
+                case 16: zzState = 46; break zzForNext;
+                case 24: zzState = 47; break zzForNext;
+                case 41: zzState = 48; break zzForNext;
+                case 44: zzState = 49; break zzForNext;
                 default: break zzForAction;
               }
 
             case 11:
               switch (zzInput) {
-                case 1: zzIsFinal = true; zzNoLookAhead = true; zzState = 44; break zzForNext;
+                case 2: zzIsFinal = true; zzNoLookAhead = true; zzState = 50; break zzForNext;
                 default: break zzForAction;
               }
 
             case 12:
               switch (zzInput) {
-                case 4: zzState = 45; break zzForNext;
+                case 1: zzIsFinal = true; zzNoLookAhead = true; zzState = 51; break zzForNext;
                 default: break zzForAction;
               }
 
             case 13:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: zzState = 46; break zzForNext;
-                case 10: zzState = 47; break zzForNext;
+                case 4: zzState = 52; break zzForNext;
                 default: break zzForAction;
               }
 
             case 14:
               switch (zzInput) {
-                case 15: zzState = 39; break zzForNext;
-                case 23: zzState = 40; break zzForNext;
-                case 41: zzState = 41; break zzForNext;
-                case 44: zzState = 42; break zzForNext;
-                case 11: zzState = 48; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzState = 53; break zzForNext;
+                case 9: zzState = 54; break zzForNext;
+                case 11: zzState = 55; break zzForNext;
                 default: break zzForAction;
               }
 
             case 15:
               switch (zzInput) {
                 case 6: 
-                case 8: 
-                case 9: 
-                case 28: zzState = 49; break zzForNext;
-                case 11: zzState = 50; break zzForNext;
+                case 7: 
+                case 8: zzState = 53; break zzForNext;
+                case 11: zzState = 56; break zzForNext;
                 default: break zzForAction;
               }
 
             case 16:
               switch (zzInput) {
-                case 46: zzIsFinal = true; zzNoLookAhead = true; zzState = 51; break zzForNext;
+                case 16: zzState = 46; break zzForNext;
+                case 24: zzState = 47; break zzForNext;
+                case 41: zzState = 48; break zzForNext;
+                case 44: zzState = 49; break zzForNext;
+                case 9: zzState = 57; break zzForNext;
+                case 12: zzState = 58; break zzForNext;
                 default: break zzForAction;
               }
 
             case 17:
               switch (zzInput) {
-                case 29: zzState = 52; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzState = 59; break zzForNext;
+                case 9: zzState = 60; break zzForNext;
+                case 12: zzState = 61; break zzForNext;
                 default: break zzForAction;
               }
 
             case 18:
               switch (zzInput) {
-                case 22: zzState = 53; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzState = 59; break zzForNext;
+                case 12: zzState = 61; break zzForNext;
+                case 23: zzState = 62; break zzForNext;
+                case 45: zzState = 63; break zzForNext;
                 default: break zzForAction;
               }
 
             case 19:
               switch (zzInput) {
-                case 43: zzState = 54; break zzForNext;
+                case 9: zzState = 64; break zzForNext;
+                case 46: zzIsFinal = true; zzState = 65; break zzForNext;
                 default: break zzForAction;
               }
 
             case 20:
               switch (zzInput) {
-                case 17: zzState = 55; break zzForNext;
+                case 9: zzState = 66; break zzForNext;
+                case 29: zzState = 67; break zzForNext;
                 default: break zzForAction;
               }
 
             case 21:
               switch (zzInput) {
-                case 43: zzState = 56; break zzForNext;
+                case 9: zzState = 68; break zzForNext;
+                case 23: zzState = 69; break zzForNext;
                 default: break zzForAction;
               }
 
             case 22:
               switch (zzInput) {
-                case 46: zzIsFinal = true; zzNoLookAhead = true; zzState = 57; break zzForNext;
+                case 15: zzState = 70; break zzForNext;
+                case 19: zzState = 71; break zzForNext;
+                case 22: zzState = 72; break zzForNext;
+                case 28: zzState = 73; break zzForNext;
+                case 41: zzState = 74; break zzForNext;
                 default: break zzForAction;
               }
 
             case 23:
               switch (zzInput) {
-                case 46: zzIsFinal = true; zzNoLookAhead = true; zzState = 58; break zzForNext;
+                case 9: zzState = 75; break zzForNext;
+                case 43: zzState = 76; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 24:
+              switch (zzInput) {
+                case 9: zzState = 77; break zzForNext;
+                case 18: zzState = 78; break zzForNext;
                 default: break zzForAction;
               }
 
             case 25:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 28: zzIsFinal = true; break zzForNext;
-                case 9: zzState = 59; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 24; break zzForNext;
+                case 9: zzState = 79; break zzForNext;
+                case 43: zzState = 80; break zzForNext;
+                default: break zzForAction;
               }
 
             case 26:
               switch (zzInput) {
+                case 9: zzState = 81; break zzForNext;
+                case 46: zzIsFinal = true; zzState = 82; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 27:
+              switch (zzInput) {
+                case 9: zzState = 83; break zzForNext;
+                case 46: zzIsFinal = true; zzState = 84; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 29:
+              switch (zzInput) {
                 case 6: 
-                case 8: 
-                case 28: zzIsFinal = true; zzState = 25; break zzForNext;
-                case 9: zzState = 59; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 24; break zzForNext;
+                case 7: zzIsFinal = true; break zzForNext;
+                case 8: zzState = 85; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 86; break zzForNext;
+                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 28; break zzForNext;
+              }
+
+            case 30:
+              switch (zzInput) {
+                case 6: 
+                case 7: zzIsFinal = true; zzState = 29; break zzForNext;
+                case 8: zzState = 85; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 86; break zzForNext;
+                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 28; break zzForNext;
               }
 
             case 31:
               switch (zzInput) {
-                case 46: zzIsFinal = true; zzNoLookAhead = true; zzState = 60; break zzForNext;
+                case 31: zzIsFinal = true; zzState = 32; break zzForNext;
+                case 32: zzIsFinal = true; zzState = 33; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzState = 85; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 32:
+              switch (zzInput) {
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 87; break zzForNext;
                 default: break zzForAction;
               }
 
             case 33:
               switch (zzInput) {
-                case 10: zzState = 61; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 34:
-              switch (zzInput) {
-                case 46: zzIsFinal = true; zzNoLookAhead = true; zzState = 62; break zzForNext;
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 88; break zzForNext;
                 default: break zzForAction;
               }
 
             case 35:
               switch (zzInput) {
-                case 10: zzState = 61; break zzForNext;
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 89; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 36:
+              switch (zzInput) {
+                case 7: 
+                case 8: 
+                case 11: zzIsFinal = true; zzState = 35; break zzForNext;
+                case 31: zzIsFinal = true; zzState = 38; break zzForNext;
+                case 12: zzState = 90; break zzForNext;
+                case 41: zzState = 91; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 37:
+              switch (zzInput) {
+                case 9: zzState = 92; break zzForNext;
+                case 46: zzIsFinal = true; zzState = 93; break zzForNext;
                 default: break zzForAction;
               }
 
             case 38:
               switch (zzInput) {
-                case 10: zzState = 61; break zzForNext;
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 94; break zzForNext;
                 default: break zzForAction;
               }
 
             case 39:
               switch (zzInput) {
-                case 16: zzState = 63; break zzForNext;
+                case 46: zzIsFinal = true; zzState = 35; break zzForNext;
+                case 9: zzState = 95; break zzForNext;
                 default: break zzForAction;
               }
 
             case 40:
               switch (zzInput) {
-                case 19: zzState = 64; break zzForNext;
+                case 7: 
+                case 8: 
+                case 11: zzIsFinal = true; zzState = 35; break zzForNext;
+                case 32: zzIsFinal = true; zzState = 38; break zzForNext;
+                case 41: zzState = 91; break zzForNext;
                 default: break zzForAction;
               }
 
             case 41:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: break zzForNext;
-                case 42: zzState = 65; break zzForNext;
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 96; break zzForNext;
                 default: break zzForAction;
               }
 
             case 42:
               switch (zzInput) {
-                case 30: zzState = 66; break zzForNext;
+                case 11: zzIsFinal = true; zzState = 35; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 41; break zzForNext;
+                case 31: 
+                case 32: zzIsFinal = true; zzState = 43; break zzForNext;
+                case 12: 
+                case 41: zzState = 91; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 43:
+              switch (zzInput) {
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 97; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 44:
+              switch (zzInput) {
+                case 9: zzState = 45; break zzForNext;
+                case 16: zzState = 46; break zzForNext;
+                case 24: zzState = 47; break zzForNext;
+                case 41: zzState = 48; break zzForNext;
+                case 44: zzState = 49; break zzForNext;
                 default: break zzForAction;
               }
 
             case 45:
               switch (zzInput) {
-                case 5: zzIsFinal = true; zzNoLookAhead = true; zzState = 67; break zzForNext;
+                case 16: zzState = 46; break zzForNext;
+                case 24: zzState = 47; break zzForNext;
+                case 41: zzState = 48; break zzForNext;
+                case 44: zzState = 49; break zzForNext;
                 default: break zzForAction;
               }
 
             case 46:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: break zzForNext;
-                case 10: zzState = 47; break zzForNext;
+                case 9: zzState = 98; break zzForNext;
+                case 17: zzState = 99; break zzForNext;
                 default: break zzForAction;
               }
 
             case 47:
               switch (zzInput) {
-                case 11: zzState = 48; break zzForNext;
+                case 9: zzState = 100; break zzForNext;
+                case 20: zzState = 101; break zzForNext;
                 default: break zzForAction;
               }
 
             case 48:
               switch (zzInput) {
-                case 12: zzState = 68; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: break zzForNext;
+                case 9: zzState = 102; break zzForNext;
+                case 42: zzState = 103; break zzForNext;
                 default: break zzForAction;
               }
 
             case 49:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: break zzForNext;
-                case 11: zzState = 50; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 50:
-              switch (zzInput) {
-                case 46: zzIsFinal = true; zzNoLookAhead = true; zzState = 51; break zzForNext;
+                case 9: zzState = 104; break zzForNext;
+                case 30: zzState = 105; break zzForNext;
                 default: break zzForAction;
               }
 
             case 52:
               switch (zzInput) {
-                case 18: zzState = 69; break zzForNext;
+                case 5: zzIsFinal = true; zzNoLookAhead = true; zzState = 106; break zzForNext;
                 default: break zzForAction;
               }
 
             case 53:
               switch (zzInput) {
-                case 37: zzState = 70; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: break zzForNext;
+                case 9: zzState = 54; break zzForNext;
+                case 11: zzState = 55; break zzForNext;
                 default: break zzForAction;
               }
 
             case 54:
               switch (zzInput) {
-                case 29: zzState = 71; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzState = 53; break zzForNext;
+                case 11: zzState = 55; break zzForNext;
+                case 9: zzState = 107; break zzForNext;
                 default: break zzForAction;
               }
 
             case 55:
               switch (zzInput) {
-                case 29: zzState = 72; break zzForNext;
+                case 12: zzState = 58; break zzForNext;
+                case 9: zzState = 108; break zzForNext;
                 default: break zzForAction;
               }
 
             case 56:
               switch (zzInput) {
-                case 38: zzState = 73; break zzForNext;
+                case 16: zzState = 46; break zzForNext;
+                case 24: zzState = 47; break zzForNext;
+                case 41: zzState = 48; break zzForNext;
+                case 44: zzState = 49; break zzForNext;
+                case 9: zzState = 57; break zzForNext;
+                case 12: zzState = 58; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 57:
+              switch (zzInput) {
+                case 16: zzState = 46; break zzForNext;
+                case 24: zzState = 47; break zzForNext;
+                case 41: zzState = 48; break zzForNext;
+                case 44: zzState = 49; break zzForNext;
+                case 12: zzState = 58; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 58:
+              switch (zzInput) {
+                case 9: zzState = 109; break zzForNext;
+                case 13: zzState = 110; break zzForNext;
                 default: break zzForAction;
               }
 
             case 59:
               switch (zzInput) {
                 case 6: 
-                case 8: 
-                case 28: zzIsFinal = true; zzState = 25; break zzForNext;
-                case 9: break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 24; break zzForNext;
+                case 7: 
+                case 8: break zzForNext;
+                case 9: zzState = 60; break zzForNext;
+                case 12: zzState = 61; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 60:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 59; break zzForNext;
+                case 12: zzState = 61; break zzForNext;
+                case 9: zzState = 111; break zzForNext;
+                default: break zzForAction;
               }
 
             case 61:
               switch (zzInput) {
-                case 32: zzIsFinal = true; zzNoLookAhead = true; zzState = 30; break zzForNext;
+                case 9: zzState = 64; break zzForNext;
+                case 46: zzIsFinal = true; zzState = 65; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 62:
+              switch (zzInput) {
+                case 9: zzState = 66; break zzForNext;
+                case 29: zzState = 67; break zzForNext;
                 default: break zzForAction;
               }
 
             case 63:
               switch (zzInput) {
-                case 17: zzState = 74; break zzForNext;
+                case 9: zzState = 68; break zzForNext;
+                case 23: zzState = 69; break zzForNext;
                 default: break zzForAction;
               }
 
             case 64:
               switch (zzInput) {
-                case 13: zzState = 75; break zzForNext;
+                case 46: zzIsFinal = true; zzState = 65; break zzForNext;
                 default: break zzForAction;
               }
 
             case 65:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: break zzForNext;
-                case 19: zzState = 76; break zzForNext;
-                case 21: zzState = 77; break zzForNext;
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 112; break zzForNext;
                 default: break zzForAction;
               }
 
             case 66:
               switch (zzInput) {
-                case 21: zzState = 78; break zzForNext;
+                case 29: zzState = 67; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 67:
+              switch (zzInput) {
+                case 9: zzState = 113; break zzForNext;
+                case 19: zzState = 114; break zzForNext;
                 default: break zzForAction;
               }
 
             case 68:
               switch (zzInput) {
-                case 13: zzState = 79; break zzForNext;
+                case 23: zzState = 69; break zzForNext;
                 default: break zzForAction;
               }
 
             case 69:
               switch (zzInput) {
-                case 17: zzState = 80; break zzForNext;
+                case 9: zzState = 115; break zzForNext;
+                case 37: zzState = 116; break zzForNext;
                 default: break zzForAction;
               }
 
             case 70:
               switch (zzInput) {
-                case 30: zzState = 81; break zzForNext;
+                case 9: zzState = 75; break zzForNext;
+                case 43: zzState = 76; break zzForNext;
                 default: break zzForAction;
               }
 
             case 71:
               switch (zzInput) {
-                case 38: zzState = 82; break zzForNext;
+                case 9: zzState = 77; break zzForNext;
+                case 18: zzState = 78; break zzForNext;
                 default: break zzForAction;
               }
 
             case 72:
               switch (zzInput) {
-                case 19: zzState = 83; break zzForNext;
+                case 9: zzState = 79; break zzForNext;
+                case 43: zzState = 80; break zzForNext;
                 default: break zzForAction;
               }
 
             case 73:
               switch (zzInput) {
-                case 22: zzState = 84; break zzForNext;
+                case 9: zzState = 81; break zzForNext;
+                case 46: zzIsFinal = true; zzState = 82; break zzForNext;
                 default: break zzForAction;
               }
 
             case 74:
               switch (zzInput) {
-                case 18: zzState = 85; break zzForNext;
+                case 9: zzState = 83; break zzForNext;
+                case 46: zzIsFinal = true; zzState = 84; break zzForNext;
                 default: break zzForAction;
               }
 
             case 75:
               switch (zzInput) {
-                case 14: zzState = 86; break zzForNext;
+                case 43: zzState = 76; break zzForNext;
                 default: break zzForAction;
               }
 
             case 76:
               switch (zzInput) {
-                case 43: zzState = 87; break zzForNext;
+                case 9: zzState = 117; break zzForNext;
+                case 29: zzState = 118; break zzForNext;
                 default: break zzForAction;
               }
 
             case 77:
               switch (zzInput) {
-                case 43: zzState = 88; break zzForNext;
+                case 18: zzState = 78; break zzForNext;
                 default: break zzForAction;
               }
 
             case 78:
               switch (zzInput) {
-                case 33: zzState = 89; break zzForNext;
+                case 9: zzState = 119; break zzForNext;
+                case 29: zzState = 120; break zzForNext;
                 default: break zzForAction;
               }
 
             case 79:
               switch (zzInput) {
-                case 14: zzState = 90; break zzForNext;
+                case 43: zzState = 80; break zzForNext;
                 default: break zzForAction;
               }
 
             case 80:
               switch (zzInput) {
-                case 16: zzState = 91; break zzForNext;
+                case 9: zzState = 121; break zzForNext;
+                case 38: zzState = 122; break zzForNext;
                 default: break zzForAction;
               }
 
             case 81:
               switch (zzInput) {
-                case 26: zzState = 92; break zzForNext;
+                case 46: zzIsFinal = true; zzState = 82; break zzForNext;
                 default: break zzForAction;
               }
 
             case 82:
               switch (zzInput) {
-                case 24: zzState = 93; break zzForNext;
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 123; break zzForNext;
                 default: break zzForAction;
               }
 
             case 83:
               switch (zzInput) {
-                case 22: zzState = 94; break zzForNext;
+                case 46: zzIsFinal = true; zzState = 84; break zzForNext;
                 default: break zzForAction;
               }
 
             case 84:
               switch (zzInput) {
-                case 22: zzState = 95; break zzForNext;
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 124; break zzForNext;
                 default: break zzForAction;
               }
 
             case 85:
               switch (zzInput) {
-                case 19: zzState = 96; break zzForNext;
-                default: break zzForAction;
+                case 6: 
+                case 7: zzIsFinal = true; zzState = 29; break zzForNext;
+                case 8: break zzForNext;
+                case 9: zzIsFinal = true; zzState = 86; break zzForNext;
+                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 28; break zzForNext;
               }
 
             case 86:
               switch (zzInput) {
                 case 6: 
-                case 8: 
-                case 9: 
-                case 28: break zzForNext;
-                case 12: zzState = 97; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 87:
-              switch (zzInput) {
-                case 38: zzState = 98; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 88:
-              switch (zzInput) {
-                case 38: zzState = 99; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 89:
-              switch (zzInput) {
-                case 16: zzState = 100; break zzForNext;
-                default: break zzForAction;
+                case 7: zzIsFinal = true; zzState = 29; break zzForNext;
+                case 8: zzState = 85; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 125; break zzForNext;
+                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 28; break zzForNext;
               }
 
             case 90:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: zzIsFinal = true; zzState = 101; break zzForNext;
+                case 9: zzState = 92; break zzForNext;
+                case 46: zzIsFinal = true; zzState = 93; break zzForNext;
                 default: break zzForAction;
               }
 
             case 91:
               switch (zzInput) {
-                case 26: zzState = 102; break zzForNext;
+                case 46: zzIsFinal = true; zzState = 35; break zzForNext;
+                case 9: zzState = 95; break zzForNext;
                 default: break zzForAction;
               }
 
             case 92:
               switch (zzInput) {
-                case 17: zzState = 103; break zzForNext;
+                case 46: zzIsFinal = true; zzState = 93; break zzForNext;
                 default: break zzForAction;
               }
 
             case 93:
               switch (zzInput) {
-                case 43: zzState = 104; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 94:
-              switch (zzInput) {
-                case 29: zzState = 105; break zzForNext;
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 126; break zzForNext;
                 default: break zzForAction;
               }
 
             case 95:
               switch (zzInput) {
-                case 29: zzState = 106; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 96:
-              switch (zzInput) {
-                case 20: zzState = 107; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 97:
-              switch (zzInput) {
-                case 13: zzState = 108; break zzForNext;
+                case 46: zzIsFinal = true; zzState = 35; break zzForNext;
                 default: break zzForAction;
               }
 
             case 98:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: zzIsFinal = true; zzState = 109; break zzForNext;
+                case 17: zzState = 99; break zzForNext;
                 default: break zzForAction;
               }
 
             case 99:
               switch (zzInput) {
-                case 22: zzState = 98; break zzForNext;
+                case 9: zzState = 127; break zzForNext;
+                case 18: zzState = 128; break zzForNext;
                 default: break zzForAction;
               }
 
             case 100:
               switch (zzInput) {
-                case 26: zzState = 110; break zzForNext;
+                case 20: zzState = 101; break zzForNext;
                 default: break zzForAction;
               }
 
             case 101:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: zzIsFinal = true; break zzForNext;
+                case 9: zzState = 129; break zzForNext;
+                case 14: zzState = 130; break zzForNext;
                 default: break zzForAction;
               }
 
             case 102:
               switch (zzInput) {
-                case 29: zzState = 111; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzState = 48; break zzForNext;
+                case 42: zzState = 103; break zzForNext;
+                case 9: zzState = 131; break zzForNext;
                 default: break zzForAction;
               }
 
             case 103:
               switch (zzInput) {
-                case 29: zzState = 112; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: break zzForNext;
+                case 9: zzState = 132; break zzForNext;
+                case 20: zzState = 133; break zzForNext;
+                case 22: zzState = 134; break zzForNext;
                 default: break zzForAction;
               }
 
             case 104:
               switch (zzInput) {
-                case 38: zzState = 113; break zzForNext;
+                case 30: zzState = 105; break zzForNext;
                 default: break zzForAction;
               }
 
             case 105:
               switch (zzInput) {
-                case 19: zzState = 114; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 106:
-              switch (zzInput) {
-                case 18: zzState = 115; break zzForNext;
+                case 9: zzState = 135; break zzForNext;
+                case 22: zzState = 136; break zzForNext;
                 default: break zzForAction;
               }
 
             case 107:
               switch (zzInput) {
-                case 21: zzState = 116; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzState = 53; break zzForNext;
+                case 11: zzState = 55; break zzForNext;
                 default: break zzForAction;
               }
 
             case 108:
               switch (zzInput) {
-                case 14: zzState = 117; break zzForNext;
+                case 12: zzState = 58; break zzForNext;
                 default: break zzForAction;
               }
 
             case 109:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: zzIsFinal = true; break zzForNext;
+                case 13: zzState = 110; break zzForNext;
                 default: break zzForAction;
               }
 
             case 110:
               switch (zzInput) {
-                case 37: zzState = 118; break zzForNext;
+                case 9: zzState = 137; break zzForNext;
+                case 14: zzState = 138; break zzForNext;
                 default: break zzForAction;
               }
 
             case 111:
               switch (zzInput) {
-                case 38: zzState = 119; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 112:
-              switch (zzInput) {
                 case 6: 
-                case 8: 
-                case 9: 
-                case 28: break zzForNext;
-                case 7: zzIsFinal = true; zzState = 120; break zzForNext;
+                case 7: 
+                case 8: zzState = 59; break zzForNext;
+                case 12: zzState = 61; break zzForNext;
                 default: break zzForAction;
               }
 
             case 113:
               switch (zzInput) {
-                case 22: zzState = 121; break zzForNext;
+                case 19: zzState = 114; break zzForNext;
                 default: break zzForAction;
               }
 
             case 114:
               switch (zzInput) {
-                case 19: zzState = 122; break zzForNext;
+                case 9: zzState = 139; break zzForNext;
+                case 18: zzState = 140; break zzForNext;
                 default: break zzForAction;
               }
 
             case 115:
               switch (zzInput) {
-                case 17: zzState = 123; break zzForNext;
+                case 37: zzState = 116; break zzForNext;
                 default: break zzForAction;
               }
 
             case 116:
               switch (zzInput) {
-                case 22: zzState = 124; break zzForNext;
+                case 9: zzState = 141; break zzForNext;
+                case 30: zzState = 142; break zzForNext;
                 default: break zzForAction;
               }
 
             case 117:
               switch (zzInput) {
-                case 29: zzState = 125; break zzForNext;
+                case 29: zzState = 118; break zzForNext;
                 default: break zzForAction;
               }
 
             case 118:
               switch (zzInput) {
-                case 22: zzState = 126; break zzForNext;
+                case 9: zzState = 143; break zzForNext;
+                case 38: zzState = 144; break zzForNext;
                 default: break zzForAction;
               }
 
             case 119:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: break zzForNext;
-                case 7: zzIsFinal = true; zzState = 127; break zzForNext;
+                case 29: zzState = 120; break zzForNext;
                 default: break zzForAction;
               }
 
             case 120:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: zzIsFinal = true; break zzForNext;
+                case 9: zzState = 145; break zzForNext;
+                case 20: zzState = 146; break zzForNext;
                 default: break zzForAction;
               }
 
             case 121:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: break zzForNext;
-                case 7: zzIsFinal = true; zzState = 128; break zzForNext;
+                case 38: zzState = 122; break zzForNext;
                 default: break zzForAction;
               }
 
             case 122:
               switch (zzInput) {
-                case 20: zzState = 129; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 123:
-              switch (zzInput) {
-                case 16: zzState = 130; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 124:
-              switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: break zzForNext;
-                case 23: zzState = 131; break zzForNext;
-                case 34: zzState = 132; break zzForNext;
+                case 9: zzState = 147; break zzForNext;
+                case 23: zzState = 148; break zzForNext;
                 default: break zzForAction;
               }
 
             case 125:
               switch (zzInput) {
-                case 30: zzState = 133; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 126:
-              switch (zzInput) {
-                case 18: zzState = 134; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzState = 85; break zzForNext;
                 default: break zzForAction;
               }
 
             case 127:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: zzIsFinal = true; break zzForNext;
+                case 18: zzState = 128; break zzForNext;
                 default: break zzForAction;
               }
 
             case 128:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: zzIsFinal = true; break zzForNext;
+                case 9: zzState = 149; break zzForNext;
+                case 19: zzState = 150; break zzForNext;
                 default: break zzForAction;
               }
 
             case 129:
               switch (zzInput) {
-                case 21: zzState = 135; break zzForNext;
+                case 14: zzState = 130; break zzForNext;
                 default: break zzForAction;
               }
 
             case 130:
               switch (zzInput) {
-                case 26: zzState = 136; break zzForNext;
+                case 9: zzState = 151; break zzForNext;
+                case 15: zzState = 152; break zzForNext;
                 default: break zzForAction;
               }
 
             case 131:
               switch (zzInput) {
-                case 19: zzState = 137; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzState = 48; break zzForNext;
+                case 42: zzState = 103; break zzForNext;
                 default: break zzForAction;
               }
 
             case 132:
               switch (zzInput) {
-                case 13: zzState = 138; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzState = 103; break zzForNext;
+                case 20: zzState = 133; break zzForNext;
+                case 22: zzState = 134; break zzForNext;
+                case 9: zzState = 153; break zzForNext;
                 default: break zzForAction;
               }
 
             case 133:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: break zzForNext;
-                case 7: zzState = 139; break zzForNext;
+                case 9: zzState = 154; break zzForNext;
+                case 43: zzState = 155; break zzForNext;
                 default: break zzForAction;
               }
 
             case 134:
               switch (zzInput) {
-                case 19: zzState = 140; break zzForNext;
+                case 9: zzState = 156; break zzForNext;
+                case 43: zzState = 157; break zzForNext;
                 default: break zzForAction;
               }
 
             case 135:
               switch (zzInput) {
-                case 22: zzState = 141; break zzForNext;
+                case 22: zzState = 136; break zzForNext;
                 default: break zzForAction;
               }
 
             case 136:
               switch (zzInput) {
-                case 29: zzState = 142; break zzForNext;
+                case 9: zzState = 158; break zzForNext;
+                case 33: zzState = 159; break zzForNext;
                 default: break zzForAction;
               }
 
             case 137:
               switch (zzInput) {
-                case 13: zzState = 143; break zzForNext;
+                case 14: zzState = 138; break zzForNext;
                 default: break zzForAction;
               }
 
             case 138:
               switch (zzInput) {
-                case 14: zzState = 144; break zzForNext;
+                case 9: zzState = 160; break zzForNext;
+                case 15: zzState = 161; break zzForNext;
                 default: break zzForAction;
               }
 
             case 139:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: break zzForNext;
-                case 31: 
-                case 32: zzState = 145; break zzForNext;
+                case 18: zzState = 140; break zzForNext;
                 default: break zzForAction;
               }
 
             case 140:
               switch (zzInput) {
-                case 26: zzState = 146; break zzForNext;
+                case 9: zzState = 162; break zzForNext;
+                case 17: zzState = 163; break zzForNext;
                 default: break zzForAction;
               }
 
             case 141:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: break zzForNext;
-                case 7: zzIsFinal = true; zzState = 147; break zzForNext;
+                case 30: zzState = 142; break zzForNext;
                 default: break zzForAction;
               }
 
             case 142:
               switch (zzInput) {
-                case 38: zzState = 148; break zzForNext;
+                case 9: zzState = 164; break zzForNext;
+                case 27: zzState = 165; break zzForNext;
                 default: break zzForAction;
               }
 
             case 143:
               switch (zzInput) {
-                case 14: zzState = 149; break zzForNext;
+                case 38: zzState = 144; break zzForNext;
                 default: break zzForAction;
               }
 
             case 144:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: break zzForNext;
-                case 21: zzState = 150; break zzForNext;
+                case 9: zzState = 166; break zzForNext;
+                case 25: zzState = 167; break zzForNext;
                 default: break zzForAction;
               }
 
             case 145:
               switch (zzInput) {
-                case 23: zzState = 151; break zzForNext;
+                case 20: zzState = 146; break zzForNext;
                 default: break zzForAction;
               }
 
             case 146:
               switch (zzInput) {
-                case 45: zzState = 152; break zzForNext;
+                case 9: zzState = 168; break zzForNext;
+                case 23: zzState = 169; break zzForNext;
                 default: break zzForAction;
               }
 
             case 147:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: zzIsFinal = true; break zzForNext;
+                case 23: zzState = 148; break zzForNext;
                 default: break zzForAction;
               }
 
             case 148:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: break zzForNext;
-                case 7: zzIsFinal = true; zzState = 153; break zzForNext;
+                case 9: zzState = 170; break zzForNext;
+                case 23: zzState = 171; break zzForNext;
                 default: break zzForAction;
               }
 
             case 149:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: 
-                case 28: break zzForNext;
-                case 21: zzState = 154; break zzForNext;
+                case 19: zzState = 150; break zzForNext;
                 default: break zzForAction;
               }
 
             case 150:
               switch (zzInput) {
-                case 24: zzState = 155; break zzForNext;
+                case 9: zzState = 172; break zzForNext;
+                case 20: zzState = 173; break zzForNext;
                 default: break zzForAction;
               }
 
             case 151:
               switch (zzInput) {
-                case 19: zzState = 156; break zzForNext;
+                case 15: zzState = 152; break zzForNext;
                 default: break zzForAction;
               }
 
             case 152:
               switch (zzInput) {
-                case 22: zzState = 157; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: break zzForNext;
+                case 9: zzState = 174; break zzForNext;
+                case 13: zzState = 175; break zzForNext;
                 default: break zzForAction;
               }
 
             case 153:
               switch (zzInput) {
                 case 6: 
-                case 8: 
-                case 9: 
-                case 28: zzIsFinal = true; break zzForNext;
+                case 7: 
+                case 8: zzState = 103; break zzForNext;
+                case 20: zzState = 133; break zzForNext;
+                case 22: zzState = 134; break zzForNext;
                 default: break zzForAction;
               }
 
             case 154:
               switch (zzInput) {
-                case 24: zzState = 158; break zzForNext;
+                case 43: zzState = 155; break zzForNext;
                 default: break zzForAction;
               }
 
             case 155:
               switch (zzInput) {
-                case 25: zzState = 159; break zzForNext;
+                case 9: zzState = 176; break zzForNext;
+                case 38: zzState = 177; break zzForNext;
                 default: break zzForAction;
               }
 
             case 156:
               switch (zzInput) {
-                case 19: zzState = 160; break zzForNext;
+                case 43: zzState = 157; break zzForNext;
                 default: break zzForAction;
               }
 
             case 157:
               switch (zzInput) {
-                case 35: zzState = 161; break zzForNext;
+                case 9: zzState = 178; break zzForNext;
+                case 38: zzState = 179; break zzForNext;
                 default: break zzForAction;
               }
 
             case 158:
               switch (zzInput) {
-                case 25: zzState = 162; break zzForNext;
+                case 33: zzState = 159; break zzForNext;
                 default: break zzForAction;
               }
 
             case 159:
               switch (zzInput) {
-                case 14: zzState = 163; break zzForNext;
+                case 9: zzState = 180; break zzForNext;
+                case 17: zzState = 181; break zzForNext;
                 default: break zzForAction;
               }
 
             case 160:
               switch (zzInput) {
-                case 21: zzState = 164; break zzForNext;
+                case 15: zzState = 161; break zzForNext;
                 default: break zzForAction;
               }
 
             case 161:
               switch (zzInput) {
-                case 19: zzState = 76; break zzForNext;
-                case 21: zzState = 77; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 182; break zzForNext;
+                case 9: zzState = 183; break zzForNext;
                 default: break zzForAction;
               }
 
             case 162:
               switch (zzInput) {
-                case 14: zzState = 165; break zzForNext;
+                case 17: zzState = 163; break zzForNext;
                 default: break zzForAction;
               }
 
             case 163:
               switch (zzInput) {
-                case 26: zzState = 166; break zzForNext;
+                case 9: zzState = 184; break zzForNext;
+                case 27: zzState = 185; break zzForNext;
                 default: break zzForAction;
               }
 
             case 164:
               switch (zzInput) {
-                case 33: zzState = 167; break zzForNext;
+                case 27: zzState = 165; break zzForNext;
                 default: break zzForAction;
               }
 
             case 165:
               switch (zzInput) {
-                case 26: zzState = 168; break zzForNext;
+                case 9: zzState = 186; break zzForNext;
+                case 18: zzState = 187; break zzForNext;
                 default: break zzForAction;
               }
 
             case 166:
               switch (zzInput) {
-                case 18: zzState = 169; break zzForNext;
+                case 25: zzState = 167; break zzForNext;
                 default: break zzForAction;
               }
 
             case 167:
               switch (zzInput) {
-                case 27: zzState = 170; break zzForNext;
+                case 9: zzState = 188; break zzForNext;
+                case 43: zzState = 189; break zzForNext;
                 default: break zzForAction;
               }
 
             case 168:
               switch (zzInput) {
-                case 18: zzState = 171; break zzForNext;
+                case 23: zzState = 169; break zzForNext;
                 default: break zzForAction;
               }
 
             case 169:
               switch (zzInput) {
-                case 27: zzState = 172; break zzForNext;
-                case 9: break zzForAction;
-                default: break zzForNext;
+                case 9: zzState = 190; break zzForNext;
+                case 29: zzState = 191; break zzForNext;
+                default: break zzForAction;
               }
 
             case 170:
               switch (zzInput) {
-                case 27: zzState = 173; break zzForNext;
+                case 23: zzState = 171; break zzForNext;
                 default: break zzForAction;
               }
 
             case 171:
               switch (zzInput) {
-                case 27: zzState = 174; break zzForNext;
-                case 9: break zzForAction;
-                default: break zzForNext;
+                case 9: zzState = 192; break zzForNext;
+                case 29: zzState = 193; break zzForNext;
+                default: break zzForAction;
               }
 
             case 172:
               switch (zzInput) {
-                case 27: zzState = 175; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 169; break zzForNext;
+                case 20: zzState = 173; break zzForNext;
+                default: break zzForAction;
               }
 
             case 173:
               switch (zzInput) {
-                case 34: zzState = 176; break zzForNext;
+                case 9: zzState = 194; break zzForNext;
+                case 21: zzState = 195; break zzForNext;
                 default: break zzForAction;
               }
 
             case 174:
               switch (zzInput) {
-                case 27: zzState = 177; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 171; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzState = 152; break zzForNext;
+                case 13: zzState = 175; break zzForNext;
+                case 9: zzState = 196; break zzForNext;
+                default: break zzForAction;
               }
 
             case 175:
               switch (zzInput) {
-                case 27: break zzForNext;
-                case 16: zzState = 178; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 169; break zzForNext;
+                case 9: zzState = 197; break zzForNext;
+                case 14: zzState = 198; break zzForNext;
+                default: break zzForAction;
               }
 
             case 176:
               switch (zzInput) {
-                case 34: zzState = 179; break zzForNext;
+                case 38: zzState = 177; break zzForNext;
                 default: break zzForAction;
               }
 
             case 177:
               switch (zzInput) {
-                case 27: break zzForNext;
-                case 16: zzState = 180; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 171; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 199; break zzForNext;
+                case 9: zzState = 200; break zzForNext;
+                default: break zzForAction;
               }
 
             case 178:
               switch (zzInput) {
-                case 27: zzState = 172; break zzForNext;
-                case 19: zzState = 181; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 169; break zzForNext;
+                case 38: zzState = 179; break zzForNext;
+                default: break zzForAction;
               }
 
             case 179:
               switch (zzInput) {
-                case 34: zzState = 182; break zzForNext;
+                case 23: zzState = 177; break zzForNext;
+                case 9: zzState = 201; break zzForNext;
                 default: break zzForAction;
               }
 
             case 180:
               switch (zzInput) {
-                case 27: zzState = 174; break zzForNext;
-                case 19: zzState = 183; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 171; break zzForNext;
+                case 17: zzState = 181; break zzForNext;
+                default: break zzForAction;
               }
 
             case 181:
               switch (zzInput) {
-                case 27: zzState = 172; break zzForNext;
-                case 16: zzState = 184; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 169; break zzForNext;
+                case 9: zzState = 202; break zzForNext;
+                case 27: zzState = 203; break zzForNext;
+                default: break zzForAction;
               }
 
             case 182:
               switch (zzInput) {
-                case 35: zzState = 185; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 204; break zzForNext;
                 default: break zzForAction;
               }
 
             case 183:
               switch (zzInput) {
-                case 27: zzState = 174; break zzForNext;
-                case 16: zzState = 186; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 171; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 182; break zzForNext;
+                case 9: zzState = 205; break zzForNext;
+                default: break zzForAction;
               }
 
             case 184:
               switch (zzInput) {
-                case 27: zzState = 172; break zzForNext;
-                case 28: zzState = 187; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 169; break zzForNext;
+                case 27: zzState = 185; break zzForNext;
+                default: break zzForAction;
               }
 
             case 185:
               switch (zzInput) {
-                case 34: zzState = 188; break zzForNext;
+                case 9: zzState = 206; break zzForNext;
+                case 29: zzState = 207; break zzForNext;
                 default: break zzForAction;
               }
 
             case 186:
               switch (zzInput) {
-                case 27: zzState = 174; break zzForNext;
-                case 28: zzState = 189; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 171; break zzForNext;
+                case 18: zzState = 187; break zzForNext;
+                default: break zzForAction;
               }
 
             case 187:
               switch (zzInput) {
-                case 27: zzState = 172; break zzForNext;
-                case 34: zzState = 190; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 169; break zzForNext;
+                case 9: zzState = 208; break zzForNext;
+                case 29: zzState = 209; break zzForNext;
+                default: break zzForAction;
               }
 
             case 188:
               switch (zzInput) {
-                case 36: zzState = 191; break zzForNext;
+                case 43: zzState = 189; break zzForNext;
                 default: break zzForAction;
               }
 
             case 189:
               switch (zzInput) {
-                case 27: zzState = 174; break zzForNext;
-                case 12: zzState = 192; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 171; break zzForNext;
+                case 9: zzState = 210; break zzForNext;
+                case 38: zzState = 211; break zzForNext;
+                default: break zzForAction;
               }
 
             case 190:
               switch (zzInput) {
-                case 27: zzState = 172; break zzForNext;
-                case 13: zzState = 193; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 169; break zzForNext;
+                case 29: zzState = 191; break zzForNext;
+                default: break zzForAction;
               }
 
             case 191:
               switch (zzInput) {
-                case 35: zzState = 194; break zzForNext;
+                case 9: zzState = 212; break zzForNext;
+                case 20: zzState = 213; break zzForNext;
                 default: break zzForAction;
               }
 
             case 192:
               switch (zzInput) {
-                case 27: zzState = 174; break zzForNext;
-                case 23: zzState = 195; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 171; break zzForNext;
+                case 29: zzState = 193; break zzForNext;
+                default: break zzForAction;
               }
 
             case 193:
               switch (zzInput) {
-                case 27: zzState = 172; break zzForNext;
-                case 14: zzIsFinal = true; zzState = 196; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 169; break zzForNext;
+                case 9: zzState = 214; break zzForNext;
+                case 19: zzState = 215; break zzForNext;
+                default: break zzForAction;
               }
 
             case 194:
               switch (zzInput) {
-                case 17: zzState = 197; break zzForNext;
+                case 21: zzState = 195; break zzForNext;
                 default: break zzForAction;
               }
 
             case 195:
               switch (zzInput) {
-                case 27: zzState = 174; break zzForNext;
-                case 19: zzState = 198; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 171; break zzForNext;
+                case 9: zzState = 216; break zzForNext;
+                case 22: zzState = 217; break zzForNext;
+                default: break zzForAction;
               }
 
             case 196:
               switch (zzInput) {
-                case 27: zzState = 172; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 169; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzState = 152; break zzForNext;
+                case 13: zzState = 175; break zzForNext;
+                default: break zzForAction;
               }
 
             case 197:
               switch (zzInput) {
-                case 37: zzState = 199; break zzForNext;
+                case 14: zzState = 198; break zzForNext;
                 default: break zzForAction;
               }
 
             case 198:
               switch (zzInput) {
-                case 27: zzState = 174; break zzForNext;
-                case 13: zzState = 200; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 171; break zzForNext;
+                case 9: zzState = 218; break zzForNext;
+                case 15: zzState = 219; break zzForNext;
+                default: break zzForAction;
               }
 
             case 199:
               switch (zzInput) {
-                case 38: zzState = 201; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 220; break zzForNext;
                 default: break zzForAction;
               }
 
             case 200:
               switch (zzInput) {
-                case 27: zzState = 174; break zzForNext;
-                case 14: zzIsFinal = true; zzState = 202; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 171; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 199; break zzForNext;
+                case 9: zzState = 221; break zzForNext;
+                default: break zzForAction;
               }
 
             case 201:
               switch (zzInput) {
-                case 27: zzState = 203; break zzForNext;
+                case 23: zzState = 177; break zzForNext;
                 default: break zzForAction;
               }
 
             case 202:
               switch (zzInput) {
-                case 27: zzState = 174; break zzForNext;
-                case 9: break zzForAction;
-                default: zzState = 171; break zzForNext;
+                case 27: zzState = 203; break zzForNext;
+                default: break zzForAction;
               }
 
             case 203:
               switch (zzInput) {
-                case 39: zzState = 204; break zzForNext;
+                case 9: zzState = 222; break zzForNext;
+                case 37: zzState = 223; break zzForNext;
                 default: break zzForAction;
               }
 
             case 204:
               switch (zzInput) {
-                case 40: zzState = 205; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 182; break zzForNext;
+                case 9: zzState = 205; break zzForNext;
                 default: break zzForAction;
               }
 
             case 205:
               switch (zzInput) {
-                case 40: zzState = 206; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 182; break zzForNext;
                 default: break zzForAction;
               }
 
             case 206:
               switch (zzInput) {
-                case 40: zzState = 207; break zzForNext;
+                case 29: zzState = 207; break zzForNext;
                 default: break zzForAction;
               }
 
             case 207:
               switch (zzInput) {
-                case 27: zzState = 208; break zzForNext;
+                case 9: zzState = 224; break zzForNext;
+                case 38: zzState = 225; break zzForNext;
                 default: break zzForAction;
               }
 
             case 208:
               switch (zzInput) {
-                case 12: zzState = 209; break zzForNext;
+                case 29: zzState = 209; break zzForNext;
                 default: break zzForAction;
               }
 
             case 209:
               switch (zzInput) {
-                case 23: zzState = 210; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: break zzForNext;
+                case 9: zzState = 226; break zzForNext;
+                case 10: zzIsFinal = true; zzState = 227; break zzForNext;
                 default: break zzForAction;
               }
 
             case 210:
               switch (zzInput) {
-                case 19: zzState = 211; break zzForNext;
+                case 38: zzState = 211; break zzForNext;
                 default: break zzForAction;
               }
 
             case 211:
               switch (zzInput) {
-                case 13: zzState = 212; break zzForNext;
+                case 9: zzState = 228; break zzForNext;
+                case 23: zzState = 229; break zzForNext;
                 default: break zzForAction;
               }
 
             case 212:
               switch (zzInput) {
-                case 14: zzIsFinal = true; zzNoLookAhead = true; zzState = 213; break zzForNext;
+                case 20: zzState = 213; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 213:
+              switch (zzInput) {
+                case 9: zzState = 230; break zzForNext;
+                case 20: zzState = 231; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 214:
+              switch (zzInput) {
+                case 19: zzState = 215; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 215:
+              switch (zzInput) {
+                case 9: zzState = 232; break zzForNext;
+                case 18: zzState = 233; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 216:
+              switch (zzInput) {
+                case 22: zzState = 217; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 217:
+              switch (zzInput) {
+                case 9: zzState = 234; break zzForNext;
+                case 23: zzState = 235; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 218:
+              switch (zzInput) {
+                case 15: zzState = 219; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 219:
+              switch (zzInput) {
+                case 9: zzState = 236; break zzForNext;
+                case 29: zzState = 237; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 220:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 199; break zzForNext;
+                case 9: zzState = 221; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 221:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 199; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 222:
+              switch (zzInput) {
+                case 37: zzState = 223; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 223:
+              switch (zzInput) {
+                case 9: zzState = 238; break zzForNext;
+                case 23: zzState = 239; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 224:
+              switch (zzInput) {
+                case 38: zzState = 225; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 225:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: break zzForNext;
+                case 9: zzState = 240; break zzForNext;
+                case 10: zzIsFinal = true; zzState = 241; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 226:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 209; break zzForNext;
+                case 10: zzIsFinal = true; zzState = 227; break zzForNext;
+                case 9: zzState = 242; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 227:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 243; break zzForNext;
+                case 9: zzState = 244; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 228:
+              switch (zzInput) {
+                case 23: zzState = 229; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 229:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: break zzForNext;
+                case 9: zzState = 245; break zzForNext;
+                case 10: zzIsFinal = true; zzState = 246; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 230:
+              switch (zzInput) {
+                case 20: zzState = 231; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 231:
+              switch (zzInput) {
+                case 9: zzState = 247; break zzForNext;
+                case 21: zzState = 248; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 232:
+              switch (zzInput) {
+                case 18: zzState = 233; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 233:
+              switch (zzInput) {
+                case 9: zzState = 249; break zzForNext;
+                case 17: zzState = 250; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 234:
+              switch (zzInput) {
+                case 23: zzState = 235; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 235:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: break zzForNext;
+                case 9: zzState = 251; break zzForNext;
+                case 24: zzState = 252; break zzForNext;
+                case 34: zzState = 253; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 236:
+              switch (zzInput) {
+                case 29: zzState = 237; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 237:
+              switch (zzInput) {
+                case 9: zzState = 254; break zzForNext;
+                case 30: zzState = 255; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 238:
+              switch (zzInput) {
+                case 23: zzState = 239; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 239:
+              switch (zzInput) {
+                case 9: zzState = 256; break zzForNext;
+                case 19: zzState = 257; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 240:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 225; break zzForNext;
+                case 10: zzIsFinal = true; zzState = 241; break zzForNext;
+                case 9: zzState = 258; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 241:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 259; break zzForNext;
+                case 9: zzState = 260; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 242:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 209; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 243:
+              switch (zzInput) {
+                case 9: zzIsFinal = true; zzState = 227; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 244:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 243; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 245:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 229; break zzForNext;
+                case 10: zzIsFinal = true; zzState = 246; break zzForNext;
+                case 9: zzState = 261; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 246:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 262; break zzForNext;
+                case 9: zzState = 263; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 247:
+              switch (zzInput) {
+                case 21: zzState = 248; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 248:
+              switch (zzInput) {
+                case 9: zzState = 264; break zzForNext;
+                case 22: zzState = 265; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 249:
+              switch (zzInput) {
+                case 17: zzState = 250; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 250:
+              switch (zzInput) {
+                case 9: zzState = 266; break zzForNext;
+                case 27: zzState = 267; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 251:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 235; break zzForNext;
+                case 24: zzState = 252; break zzForNext;
+                case 34: zzState = 253; break zzForNext;
+                case 9: zzState = 268; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 252:
+              switch (zzInput) {
+                case 9: zzState = 269; break zzForNext;
+                case 20: zzState = 270; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 253:
+              switch (zzInput) {
+                case 9: zzState = 271; break zzForNext;
+                case 14: zzState = 272; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 254:
+              switch (zzInput) {
+                case 30: zzState = 255; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 255:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: break zzForNext;
+                case 9: zzState = 273; break zzForNext;
+                case 10: zzState = 274; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 256:
+              switch (zzInput) {
+                case 19: zzState = 257; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 257:
+              switch (zzInput) {
+                case 9: zzState = 275; break zzForNext;
+                case 20: zzState = 276; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 258:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 225; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 259:
+              switch (zzInput) {
+                case 9: zzIsFinal = true; zzState = 241; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 260:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 259; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 261:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 229; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 262:
+              switch (zzInput) {
+                case 9: zzIsFinal = true; zzState = 246; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 263:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 262; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 264:
+              switch (zzInput) {
+                case 22: zzState = 265; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 265:
+              switch (zzInput) {
+                case 9: zzState = 277; break zzForNext;
+                case 23: zzState = 278; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 266:
+              switch (zzInput) {
+                case 27: zzState = 267; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 267:
+              switch (zzInput) {
+                case 9: zzState = 279; break zzForNext;
+                case 29: zzState = 280; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 268:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 235; break zzForNext;
+                case 24: zzState = 252; break zzForNext;
+                case 34: zzState = 253; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 269:
+              switch (zzInput) {
+                case 20: zzState = 270; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 270:
+              switch (zzInput) {
+                case 9: zzState = 281; break zzForNext;
+                case 14: zzState = 282; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 271:
+              switch (zzInput) {
+                case 14: zzState = 272; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 272:
+              switch (zzInput) {
+                case 9: zzState = 283; break zzForNext;
+                case 15: zzState = 284; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 273:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 255; break zzForNext;
+                case 10: zzState = 274; break zzForNext;
+                case 9: zzState = 285; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 274:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: break zzForNext;
+                case 9: zzState = 286; break zzForNext;
+                case 31: 
+                case 32: zzState = 287; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 275:
+              switch (zzInput) {
+                case 20: zzState = 276; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 276:
+              switch (zzInput) {
+                case 9: zzState = 288; break zzForNext;
+                case 27: zzState = 289; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 277:
+              switch (zzInput) {
+                case 23: zzState = 278; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 278:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: break zzForNext;
+                case 9: zzState = 290; break zzForNext;
+                case 10: zzIsFinal = true; zzState = 291; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 279:
+              switch (zzInput) {
+                case 29: zzState = 280; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 280:
+              switch (zzInput) {
+                case 9: zzState = 292; break zzForNext;
+                case 38: zzState = 293; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 281:
+              switch (zzInput) {
+                case 14: zzState = 282; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 282:
+              switch (zzInput) {
+                case 9: zzState = 294; break zzForNext;
+                case 15: zzState = 295; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 283:
+              switch (zzInput) {
+                case 15: zzState = 284; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 284:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: break zzForNext;
+                case 9: zzState = 296; break zzForNext;
+                case 22: zzState = 297; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 285:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 255; break zzForNext;
+                case 10: zzState = 274; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 286:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 274; break zzForNext;
+                case 31: 
+                case 32: zzState = 287; break zzForNext;
+                case 9: zzState = 298; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 287:
+              switch (zzInput) {
+                case 9: zzState = 299; break zzForNext;
+                case 24: zzState = 300; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 288:
+              switch (zzInput) {
+                case 27: zzState = 289; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 289:
+              switch (zzInput) {
+                case 9: zzState = 301; break zzForNext;
+                case 45: zzState = 302; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 290:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 278; break zzForNext;
+                case 10: zzIsFinal = true; zzState = 291; break zzForNext;
+                case 9: zzState = 303; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 291:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 304; break zzForNext;
+                case 9: zzState = 305; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 292:
+              switch (zzInput) {
+                case 38: zzState = 293; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 293:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: break zzForNext;
+                case 9: zzState = 306; break zzForNext;
+                case 10: zzIsFinal = true; zzState = 307; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 294:
+              switch (zzInput) {
+                case 15: zzState = 295; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 295:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: break zzForNext;
+                case 9: zzState = 308; break zzForNext;
+                case 22: zzState = 309; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 296:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 284; break zzForNext;
+                case 22: zzState = 297; break zzForNext;
+                case 9: zzState = 310; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 297:
+              switch (zzInput) {
+                case 9: zzState = 311; break zzForNext;
+                case 25: zzState = 312; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 298:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 274; break zzForNext;
+                case 31: 
+                case 32: zzState = 287; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 299:
+              switch (zzInput) {
+                case 24: zzState = 300; break zzForNext;
+                case 9: zzState = 313; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 300:
+              switch (zzInput) {
+                case 9: zzState = 314; break zzForNext;
+                case 20: zzState = 315; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 301:
+              switch (zzInput) {
+                case 45: zzState = 302; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 302:
+              switch (zzInput) {
+                case 9: zzState = 316; break zzForNext;
+                case 23: zzState = 317; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 303:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 278; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 304:
+              switch (zzInput) {
+                case 9: zzIsFinal = true; zzState = 291; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 305:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 304; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 306:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 293; break zzForNext;
+                case 10: zzIsFinal = true; zzState = 307; break zzForNext;
+                case 9: zzState = 318; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 307:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 319; break zzForNext;
+                case 9: zzState = 320; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 308:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 295; break zzForNext;
+                case 22: zzState = 309; break zzForNext;
+                case 9: zzState = 321; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 309:
+              switch (zzInput) {
+                case 9: zzState = 322; break zzForNext;
+                case 25: zzState = 323; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 310:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 284; break zzForNext;
+                case 22: zzState = 297; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 311:
+              switch (zzInput) {
+                case 25: zzState = 312; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 312:
+              switch (zzInput) {
+                case 9: zzState = 324; break zzForNext;
+                case 26: zzState = 325; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 313:
+              switch (zzInput) {
+                case 24: zzState = 300; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 314:
+              switch (zzInput) {
+                case 20: zzState = 315; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 315:
+              switch (zzInput) {
+                case 9: zzState = 326; break zzForNext;
+                case 20: zzState = 327; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 316:
+              switch (zzInput) {
+                case 23: zzState = 317; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 317:
+              switch (zzInput) {
+                case 9: zzState = 328; break zzForNext;
+                case 35: zzState = 329; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 318:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 293; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 319:
+              switch (zzInput) {
+                case 9: zzIsFinal = true; zzState = 307; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 320:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 319; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 321:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 295; break zzForNext;
+                case 22: zzState = 309; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 322:
+              switch (zzInput) {
+                case 25: zzState = 323; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 323:
+              switch (zzInput) {
+                case 9: zzState = 330; break zzForNext;
+                case 26: zzState = 331; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 324:
+              switch (zzInput) {
+                case 26: zzState = 325; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 325:
+              switch (zzInput) {
+                case 9: zzState = 332; break zzForNext;
+                case 15: zzState = 333; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 326:
+              switch (zzInput) {
+                case 20: zzState = 327; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 327:
+              switch (zzInput) {
+                case 9: zzState = 334; break zzForNext;
+                case 22: zzState = 335; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 328:
+              switch (zzInput) {
+                case 35: zzState = 329; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 329:
+              switch (zzInput) {
+                case 20: zzState = 133; break zzForNext;
+                case 22: zzState = 134; break zzForNext;
+                case 9: zzState = 336; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 330:
+              switch (zzInput) {
+                case 26: zzState = 331; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 331:
+              switch (zzInput) {
+                case 9: zzState = 337; break zzForNext;
+                case 15: zzState = 338; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 332:
+              switch (zzInput) {
+                case 15: zzState = 333; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 333:
+              switch (zzInput) {
+                case 9: zzState = 339; break zzForNext;
+                case 27: zzState = 340; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 334:
+              switch (zzInput) {
+                case 22: zzState = 335; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 335:
+              switch (zzInput) {
+                case 9: zzState = 341; break zzForNext;
+                case 33: zzState = 342; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 336:
+              switch (zzInput) {
+                case 20: zzState = 133; break zzForNext;
+                case 22: zzState = 134; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 337:
+              switch (zzInput) {
+                case 15: zzState = 338; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 338:
+              switch (zzInput) {
+                case 9: zzState = 343; break zzForNext;
+                case 27: zzState = 344; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 339:
+              switch (zzInput) {
+                case 27: zzState = 340; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 340:
+              switch (zzInput) {
+                case 9: zzState = 345; break zzForNext;
+                case 19: zzState = 346; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 341:
+              switch (zzInput) {
+                case 33: zzState = 342; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 342:
+              switch (zzInput) {
+                case 9: zzState = 347; break zzForNext;
+                case 28: zzState = 348; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 343:
+              switch (zzInput) {
+                case 27: zzState = 344; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 344:
+              switch (zzInput) {
+                case 9: zzState = 349; break zzForNext;
+                case 19: zzState = 350; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 345:
+              switch (zzInput) {
+                case 19: zzState = 346; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 346:
+              switch (zzInput) {
+                case 28: zzState = 351; break zzForNext;
+                case 8: break zzForAction;
+                default: break zzForNext;
+              }
+
+            case 347:
+              switch (zzInput) {
+                case 28: zzState = 348; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 348:
+              switch (zzInput) {
+                case 9: zzState = 352; break zzForNext;
+                case 28: zzState = 353; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 349:
+              switch (zzInput) {
+                case 19: zzState = 350; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 350:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 8: break zzForAction;
+                default: break zzForNext;
+              }
+
+            case 351:
+              switch (zzInput) {
+                case 9: zzState = 355; break zzForNext;
+                case 28: zzState = 356; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 346; break zzForNext;
+              }
+
+            case 352:
+              switch (zzInput) {
+                case 28: zzState = 353; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 353:
+              switch (zzInput) {
+                case 9: zzState = 357; break zzForNext;
+                case 34: zzState = 358; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 354:
+              switch (zzInput) {
+                case 9: zzState = 359; break zzForNext;
+                case 28: zzState = 360; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 355:
+              switch (zzInput) {
+                case 28: zzState = 356; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 346; break zzForNext;
+              }
+
+            case 356:
+              switch (zzInput) {
+                case 28: break zzForNext;
+                case 9: zzState = 361; break zzForNext;
+                case 17: zzState = 362; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 346; break zzForNext;
+              }
+
+            case 357:
+              switch (zzInput) {
+                case 34: zzState = 358; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 358:
+              switch (zzInput) {
+                case 9: zzState = 363; break zzForNext;
+                case 34: zzState = 364; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 359:
+              switch (zzInput) {
+                case 28: zzState = 360; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 360:
+              switch (zzInput) {
+                case 28: break zzForNext;
+                case 9: zzState = 365; break zzForNext;
+                case 17: zzState = 366; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 361:
+              switch (zzInput) {
+                case 28: zzState = 356; break zzForNext;
+                case 17: zzState = 362; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 346; break zzForNext;
+              }
+
+            case 362:
+              switch (zzInput) {
+                case 28: zzState = 351; break zzForNext;
+                case 9: zzState = 367; break zzForNext;
+                case 20: zzState = 368; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 346; break zzForNext;
+              }
+
+            case 363:
+              switch (zzInput) {
+                case 34: zzState = 364; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 364:
+              switch (zzInput) {
+                case 9: zzState = 369; break zzForNext;
+                case 34: zzState = 370; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 365:
+              switch (zzInput) {
+                case 28: zzState = 360; break zzForNext;
+                case 17: zzState = 366; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 366:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 9: zzState = 371; break zzForNext;
+                case 20: zzState = 372; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 367:
+              switch (zzInput) {
+                case 28: zzState = 351; break zzForNext;
+                case 20: zzState = 368; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 346; break zzForNext;
+              }
+
+            case 368:
+              switch (zzInput) {
+                case 28: zzState = 351; break zzForNext;
+                case 9: zzState = 373; break zzForNext;
+                case 17: zzState = 374; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 346; break zzForNext;
+              }
+
+            case 369:
+              switch (zzInput) {
+                case 34: zzState = 370; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 370:
+              switch (zzInput) {
+                case 9: zzState = 375; break zzForNext;
+                case 35: zzState = 376; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 371:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 20: zzState = 372; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 372:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 9: zzState = 377; break zzForNext;
+                case 17: zzState = 378; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 373:
+              switch (zzInput) {
+                case 28: zzState = 351; break zzForNext;
+                case 17: zzState = 374; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 346; break zzForNext;
+              }
+
+            case 374:
+              switch (zzInput) {
+                case 28: zzState = 351; break zzForNext;
+                case 6: 
+                case 7: zzState = 379; break zzForNext;
+                case 8: zzState = 380; break zzForNext;
+                default: zzState = 346; break zzForNext;
+              }
+
+            case 375:
+              switch (zzInput) {
+                case 35: zzState = 376; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 376:
+              switch (zzInput) {
+                case 9: zzState = 381; break zzForNext;
+                case 34: zzState = 382; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 377:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 17: zzState = 378; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 378:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 6: 
+                case 7: zzState = 383; break zzForNext;
+                case 8: zzState = 384; break zzForNext;
+                case 9: zzState = 385; break zzForNext;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 379:
+              switch (zzInput) {
+                case 28: zzState = 351; break zzForNext;
+                case 9: zzState = 386; break zzForNext;
+                case 34: zzState = 387; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 346; break zzForNext;
+              }
+
+            case 380:
+              switch (zzInput) {
+                case 9: zzState = 388; break zzForNext;
+                case 34: zzState = 389; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 381:
+              switch (zzInput) {
+                case 34: zzState = 382; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 382:
+              switch (zzInput) {
+                case 9: zzState = 390; break zzForNext;
+                case 36: zzState = 391; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 383:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 9: zzState = 392; break zzForNext;
+                case 13: zzState = 393; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 384:
+              switch (zzInput) {
+                case 9: zzState = 394; break zzForNext;
+                case 13: zzState = 395; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 385:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 6: 
+                case 7: zzState = 383; break zzForNext;
+                case 8: zzState = 384; break zzForNext;
+                case 9: zzState = 396; break zzForNext;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 386:
+              switch (zzInput) {
+                case 28: zzState = 351; break zzForNext;
+                case 34: zzState = 387; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 346; break zzForNext;
+              }
+
+            case 387:
+              switch (zzInput) {
+                case 28: zzState = 351; break zzForNext;
+                case 9: zzState = 397; break zzForNext;
+                case 14: zzState = 398; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 346; break zzForNext;
+              }
+
+            case 388:
+              switch (zzInput) {
+                case 34: zzState = 389; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 389:
+              switch (zzInput) {
+                case 9: zzState = 399; break zzForNext;
+                case 14: zzState = 400; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 390:
+              switch (zzInput) {
+                case 36: zzState = 391; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 391:
+              switch (zzInput) {
+                case 9: zzState = 401; break zzForNext;
+                case 35: zzState = 402; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 392:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 13: zzState = 393; break zzForNext;
+                case 9: zzState = 403; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 393:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 9: zzState = 404; break zzForNext;
+                case 24: zzState = 405; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 394:
+              switch (zzInput) {
+                case 13: zzState = 395; break zzForNext;
+                case 9: zzState = 406; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 395:
+              switch (zzInput) {
+                case 9: zzState = 407; break zzForNext;
+                case 24: zzState = 408; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 396:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 6: 
+                case 7: zzState = 383; break zzForNext;
+                case 8: zzState = 384; break zzForNext;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 397:
+              switch (zzInput) {
+                case 28: zzState = 351; break zzForNext;
+                case 14: zzState = 398; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 346; break zzForNext;
+              }
+
+            case 398:
+              switch (zzInput) {
+                case 28: zzState = 351; break zzForNext;
+                case 9: zzState = 409; break zzForNext;
+                case 15: zzIsFinal = true; zzState = 410; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 346; break zzForNext;
+              }
+
+            case 399:
+              switch (zzInput) {
+                case 14: zzState = 400; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 400:
+              switch (zzInput) {
+                case 9: zzState = 411; break zzForNext;
+                case 15: zzIsFinal = true; zzState = 412; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 401:
+              switch (zzInput) {
+                case 35: zzState = 402; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 402:
+              switch (zzInput) {
+                case 9: zzState = 413; break zzForNext;
+                case 18: zzState = 414; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 403:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 13: zzState = 393; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 404:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 24: zzState = 405; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 405:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 9: zzState = 415; break zzForNext;
+                case 20: zzState = 416; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 406:
+              switch (zzInput) {
+                case 13: zzState = 395; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 407:
+              switch (zzInput) {
+                case 24: zzState = 408; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 408:
+              switch (zzInput) {
+                case 9: zzState = 417; break zzForNext;
+                case 20: zzState = 418; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 409:
+              switch (zzInput) {
+                case 28: zzState = 351; break zzForNext;
+                case 15: zzIsFinal = true; zzState = 410; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 346; break zzForNext;
+              }
+
+            case 410:
+              switch (zzInput) {
+                case 28: zzState = 351; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 419; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 346; break zzForNext;
+              }
+
+            case 411:
+              switch (zzInput) {
+                case 15: zzIsFinal = true; zzState = 412; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 412:
+              switch (zzInput) {
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 420; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 413:
+              switch (zzInput) {
+                case 18: zzState = 414; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 414:
+              switch (zzInput) {
+                case 9: zzState = 421; break zzForNext;
+                case 37: zzState = 422; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 415:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 20: zzState = 416; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 416:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 9: zzState = 423; break zzForNext;
+                case 14: zzState = 424; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 417:
+              switch (zzInput) {
+                case 20: zzState = 418; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 418:
+              switch (zzInput) {
+                case 9: zzState = 425; break zzForNext;
+                case 14: zzState = 426; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 419:
+              switch (zzInput) {
+                case 28: zzState = 351; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 346; break zzForNext;
+              }
+
+            case 421:
+              switch (zzInput) {
+                case 37: zzState = 422; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 422:
+              switch (zzInput) {
+                case 9: zzState = 427; break zzForNext;
+                case 38: zzState = 428; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 423:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 14: zzState = 424; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 424:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 9: zzState = 429; break zzForNext;
+                case 15: zzIsFinal = true; zzState = 430; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 425:
+              switch (zzInput) {
+                case 14: zzState = 426; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 426:
+              switch (zzInput) {
+                case 9: zzState = 431; break zzForNext;
+                case 15: zzIsFinal = true; zzState = 432; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 427:
+              switch (zzInput) {
+                case 38: zzState = 428; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 428:
+              switch (zzInput) {
+                case 9: zzState = 433; break zzForNext;
+                case 28: zzState = 434; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 429:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 15: zzIsFinal = true; zzState = 430; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 430:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 435; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 431:
+              switch (zzInput) {
+                case 15: zzIsFinal = true; zzState = 432; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 432:
+              switch (zzInput) {
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 436; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 433:
+              switch (zzInput) {
+                case 28: zzState = 434; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 434:
+              switch (zzInput) {
+                case 9: zzState = 437; break zzForNext;
+                case 39: zzState = 438; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 435:
+              switch (zzInput) {
+                case 28: zzState = 354; break zzForNext;
+                case 8: break zzForAction;
+                default: zzState = 350; break zzForNext;
+              }
+
+            case 437:
+              switch (zzInput) {
+                case 39: zzState = 438; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 438:
+              switch (zzInput) {
+                case 9: zzState = 439; break zzForNext;
+                case 40: zzState = 440; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 439:
+              switch (zzInput) {
+                case 40: zzState = 440; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 440:
+              switch (zzInput) {
+                case 9: zzState = 441; break zzForNext;
+                case 40: zzState = 442; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 441:
+              switch (zzInput) {
+                case 40: zzState = 442; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 442:
+              switch (zzInput) {
+                case 9: zzState = 443; break zzForNext;
+                case 40: zzState = 444; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 443:
+              switch (zzInput) {
+                case 40: zzState = 444; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 444:
+              switch (zzInput) {
+                case 28: zzState = 394; break zzForNext;
+                case 9: zzState = 445; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 445:
+              switch (zzInput) {
+                case 28: zzState = 394; break zzForNext;
                 default: break zzForAction;
               }
 
@@ -1993,107 +3808,103 @@
         case 10: 
           { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16BE;}
           }
-        case 27: break;
-        case 17: 
+        case 26: break;
+        case 16: 
           { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}
           }
+        case 27: break;
+        case 1: 
+          { if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}
+          }
         case 28: break;
         case 4: 
           { yybegin(SQ_STRING); string.setLength(0);
           }
         case 29: break;
+        case 8: 
+          { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;
+          }
+        case 30: break;
         case 5: 
           { string.append( yytext() );
           }
-        case 30: break;
-        case 22: 
-          { pushCurrentState(); yybegin(QuotedAttributeValue); return JSPHeadTokenizerConstants.PageLanguage;
-          }
         case 31: break;
-        case 26: 
-          { isXHTML = true;
+        case 9: 
+          { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;
           }
         case 32: break;
-        case 24: 
-          { pushCurrentState(); yybegin(QuotedAttributeValue); return JSPHeadTokenizerConstants.PageEncoding;
+        case 21: 
+          { pushCurrentState(); yybegin(QuotedAttributeValue); return JSPHeadTokenizerConstants.PageLanguage;
           }
         case 33: break;
-        case 1: 
-          { if (yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}
+        case 15: 
+          { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;
           }
         case 34: break;
+        case 25: 
+          { isXHTML = true;
+          }
+        case 35: break;
+        case 23: 
+          { pushCurrentState(); yybegin(QuotedAttributeValue); return JSPHeadTokenizerConstants.PageEncoding;
+          }
+        case 36: break;
         case 11: 
           { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16LE;}
           }
-        case 35: break;
-        case 6: 
-          { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;
-          }
-        case 36: break;
-        case 8: 
-          { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;
-          }
         case 37: break;
-        case 9: 
-          { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;
-          }
-        case 38: break;
         case 7: 
           { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;
           }
-        case 39: break;
+        case 38: break;
         case 14: 
           { yybegin(YYINITIAL);  return JSPHeadTokenizerConstants.PageDirectiveEnd;
           }
-        case 40: break;
-        case 23: 
+        case 39: break;
+        case 22: 
           { pushCurrentState(); yybegin(QuotedAttributeValue); return JSPHeadTokenizerConstants.PageContentType;
           }
-        case 41: break;
-        case 18: 
+        case 40: break;
+        case 17: 
           { if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}
           }
-        case 42: break;
-        case 15: 
-          { yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;
-          }
-        case 43: break;
+        case 41: break;
         case 2: 
           { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);
           }
-        case 44: break;
+        case 42: break;
         case 12: 
           { yybegin(YYINITIAL); return XMLHeadTokenizerConstants.XMLDeclEnd;
           }
-        case 45: break;
+        case 43: break;
         case 13: 
           { yybegin(YYINITIAL); return JSPHeadTokenizerConstants.PageDirectiveEnd;
           }
-        case 46: break;
-        case 25: 
+        case 44: break;
+        case 24: 
           { isWML = true;
           }
-        case 47: break;
-        case 19: 
+        case 45: break;
+        case 18: 
           { yybegin(ST_PAGE_DIRECTIVE); return JSPHeadTokenizerConstants.PageDirectiveStart;
           }
-        case 48: break;
-        case 21: 
+        case 46: break;
+        case 6: 
+          { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;
+          }
+        case 47: break;
+        case 20: 
           { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;
           }
-        case 49: break;
-        case 20: 
+        case 48: break;
+        case 19: 
           { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;
           }
-        case 50: break;
-        case 16: 
-          { yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;
-          }
-        case 51: break;
+        case 49: break;
         case 3: 
           { yybegin(DQ_STRING); string.setLength(0);
           }
-        case 52: break;
+        case 50: break;
         default: 
           if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
             zzAtEOF = true;
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java
index 5323479..8a6e5c6 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -22,13 +22,18 @@
 
 import org.eclipse.core.resources.IStorage;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.jst.jsp.core.internal.Logger;
 import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
 import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
 import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
 import org.eclipse.wst.sse.core.internal.encoding.NonContentBasedEncodingRules;
+import org.eclipse.wst.sse.core.utils.StringUtils;
 import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
 import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;
 
+import com.ibm.icu.util.StringTokenizer;
+
 public class JSPResourceEncodingDetector implements IResourceCharsetDetector {
 
 	private String fCharset;
@@ -216,15 +221,13 @@
 			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
 			fEncodingMemento.setUTF83ByteBOMUsed(true);
 		}
-		else if (tokenType == EncodingParserConstants.UTF16BE) {
-			canHandleAsUnicode = true;
-			String enc = "UTF-16BE"; //$NON-NLS-1$
-			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
-		}
-		else if (tokenType == EncodingParserConstants.UTF16LE) {
+		else if (tokenType == EncodingParserConstants.UTF16BE || tokenType == EncodingParserConstants.UTF16LE) {
 			canHandleAsUnicode = true;
 			String enc = "UTF-16"; //$NON-NLS-1$
+			byte[] bom = (tokenType == EncodingParserConstants.UTF16BE) ? IContentDescription.BOM_UTF_16BE : IContentDescription.BOM_UTF_16LE;
 			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
+			fEncodingMemento.setUnicodeStream(true);
+			fEncodingMemento.setUnicodeBOM(bom);
 		}
 		return canHandleAsUnicode;
 	}
@@ -341,33 +344,49 @@
 	 * @param contentType
 	 */
 	private void parseContentTypeValue(String contentType) {
-		Pattern pattern = Pattern.compile(";\\s*charset\\s*=\\s*"); //$NON-NLS-1$
-		String[] parts = pattern.split(contentType);
-		if (parts.length > 0) {
-			// if only one item, it can still be charset instead of
-			// contentType
-			if (parts.length == 1) {
-				if (parts[0].length() > 6) {
-					String checkForCharset = parts[0].substring(0, 7);
-					if (checkForCharset.equalsIgnoreCase("charset")) { //$NON-NLS-1$
-						int eqpos = parts[0].indexOf('=');
-						eqpos = eqpos + 1;
-						if (eqpos < parts[0].length()) {
-							fCharset = parts[0].substring(eqpos);
-							fCharset = fCharset.trim();
-						}
-					}
-					else {
-						fContentType = parts[0];
-					}
-				}
-			}
-			else {
-				fContentType = parts[0];
-			}
+		/*
+		 * Based partially on
+		 * org.eclipse.jst.jsp.core.internal.document.PageDirectiveAdapterImpl
+		 * .getMimeTypeFromContentTypeValue(String) , divides the full value
+		 * into segments according to ';', assumes the first specifies the
+		 * content type itself if it has no '=', and that the remainder are
+		 * parameters which may specify a charset
+		 */
+		
+		String cleanContentTypeValue = StringUtils.stripNonLetterDigits(contentType);
+		/* Break the mime header into the main value and its parameters, separated by ';' */
+		StringTokenizer tokenizer = new StringTokenizer(cleanContentTypeValue, ";"); //$NON-NLS-1$
+		int tLen = tokenizer.countTokens();
+		if (tLen == 0)
+			return;
+		String[] tokens = new String[tLen];
+		int j = 0;
+		while (tokenizer.hasMoreTokens()) {
+			tokens[j] = tokenizer.nextToken();
+			j++;
 		}
-		if (parts.length > 1) {
-			fCharset = parts[1];
+		
+		int firstParameter = 0;
+		if (tokens[0].indexOf('=') == -1) {
+			/*
+			 * no equal sign in the first segment, so assume it indicates a
+			 * content type properly
+			 */
+			fContentType = tokens[0].trim();
+			firstParameter = 1;
+		}
+		/*
+		 * now handle parameters as name=value pairs, looking for "charset"
+		 * specifically
+		 */
+		Pattern equalPattern = Pattern.compile("\\s*=\\s*"); //$NON-NLS-1$
+		for (int i = firstParameter; i < tokens.length; i++) {
+			String[] pair = equalPattern.split(tokens[i]);
+			if (pair.length < 2)
+				continue;
+			if (pair[0].trim().equals("charset")) { //$NON-NLS-1$
+				fCharset = pair[1].trim();
+			}
 		}
 	}
 
@@ -377,7 +396,7 @@
 	 * responsibility of the tokenizer to stop when appropriate and not go too
 	 * far.
 	 */
-	private void parseHeader(JSPHeadTokenizer tokenizer) throws IOException {
+	private void parseHeader(JSPHeadTokenizer tokenizer) throws Exception {
 		fPageEncodingValue = null;
 		fCharset = null;
 
@@ -389,7 +408,6 @@
 			if (canHandleAsUnicodeStream(tokenType))
 				unicodeCase = true;
 			else {
-
 				if (tokenType == XMLHeadTokenizerConstants.XMLDelEncoding) {
 					if (tokenizer.hasMoreTokens()) {
 						HeadParserToken valueToken = tokenizer.getNextToken();
@@ -438,21 +456,23 @@
 		if (tokenizer.isWML() ) {
 			fWML = true;
 		}
-		
-
 	}
 
 	private void parseInput() throws IOException {
 		JSPHeadTokenizer tokenizer = getTokinizer();
 		fReader.reset();
 		tokenizer.reset(fReader);
-		parseHeader(tokenizer);
-		// unicode stream cases are created directly in parseHeader
-		if (!unicodeCase) {
-			String enc = getAppropriateEncoding();
-			if (enc != null && enc.length() > 0) {
-				createEncodingMemento(enc, EncodingMemento.FOUND_ENCODING_IN_CONTENT);
+		try {
+			parseHeader(tokenizer);
+			// unicode stream cases are created directly in parseHeader
+			if (!unicodeCase) {
+				String enc = getAppropriateEncoding();
+				if (enc != null && enc.length() > 0) {
+					createEncodingMemento(enc, EncodingMemento.FOUND_ENCODING_IN_CONTENT);
+				}
 			}
+		} catch (Exception e) {
+			Logger.log(Logger.ERROR_DEBUG, e.getMessage());
 		}
 	}
 
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/Messages.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/Messages.java
new file mode 100644
index 0000000..bd8b462
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/Messages.java
@@ -0,0 +1,15 @@
+package org.eclipse.jst.jsp.core.internal.contenttype;

+

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

+

+public class Messages extends NLS {

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

+	public static String DeploymentDescriptorPropertyCache_1;

+	static {

+		// initialize resource bundle

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

+	}

+

+	private Messages() {

+	}

+}

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

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

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

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

  * Copyright (c) 2005 BEA Systems and others.

  * All rights reserved. This program and the accompanying materials

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

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

  *     

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

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

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

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

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

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

  */

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

         try {

 /*@egen*/

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

-                                                             {

-                                                               jjtree.closeNodeScope(jjtn000, true);

-                                                               jjtc000 = false;

-                                                               jjtreeCloseNodeScope(jjtn000);

-                                                             }

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

+                                                                            {

+                                                                              jjtree.closeNodeScope(jjtn000, true);

+                                                                              jjtc000 = false;

+                                                                              jjtreeCloseNodeScope(jjtn000);

+                                                                            }

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

         } catch (Throwable jjte000) {

           if (jjtc000) {

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

     try {

 /*@egen*/

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

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

     } catch (Throwable jjte000) {

       if (jjtc000) {

         jjtree.clearNodeScope(jjtn000);

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

                     jjtn000.setFullFunctionName(name.image);

         }

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

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

     } catch (Throwable jjte000) {

       if (jjtc000) {

         jjtree.clearNodeScope(jjtn000);

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

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

  * Copyright (c) 2005 BEA Systems and others.

  * All rights reserved. This program and the accompanying materials

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

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

 ASTExpression Expression() : {}

 {

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

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

 }

 

 void OrExpression() #OrExpression(>1) : 

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

 void ValuePrefix() : {}

 {

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

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

 }

 

 void ValueSuffix() : 

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

                     jjtThis.setFullFunctionName(name.image);

         }

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

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

 }

 

 void Literal() : {}

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

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

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

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

+ * which accompanies this distribution, and is available at

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

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

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

+

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

+

+import java.util.List;

+

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

+import org.w3c.dom.Element;

+import org.w3c.dom.Node;

+

+/**

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

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

+ * query, if one is found.

+ */

+public class TagModelQuery extends ModelQueryImpl implements ModelQuery, MovableModelQuery {

+	/**

+	 * The default mime-type for the embedded ModelQuery

+	 */

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

+

+

+	/**

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

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

+	 */

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

+

+	public static String createPreferenceKey(IPath fullPath) {

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

+	}

+

+	private ModelQuery fEmbeddedModelQuery;

+

+	/**

+	 * @param modelQueryAssociationProvider

+	 */

+	public TagModelQuery(ModelQueryAssociationProvider modelQueryAssociationProvider) {

+		super(modelQueryAssociationProvider);

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

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

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

+	 */

+	public CMElementDeclaration getCMElementDeclaration(Element element) {

+		CMElementDeclaration cmElementDeclaration = super.getCMElementDeclaration(element);

+		if (cmElementDeclaration == null) {

+			ModelQuery embeddedModelQuery = getEmbeddedModelQuery(element);

+			if (embeddedModelQuery != null) {

+				return embeddedModelQuery.getCMElementDeclaration(element);

+			}

+		}

+		return cmElementDeclaration;

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

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

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

+	 */

+	public CMDocument getCorrespondingCMDocument(Node node) {

+		CMDocument document = super.getCorrespondingCMDocument(node);

+		if (document == null) {

+			ModelQuery embeddedModelQuery = getEmbeddedModelQuery(node);

+			if (embeddedModelQuery != null) {

+				return embeddedModelQuery.getCorrespondingCMDocument(node);

+			}

+		}

+		return document;

+	}

+

+	private String getEmbeddedMimeType(Node node) {

+		String type = DEFAULT_MIMETYPE;

+		if (node instanceof IDOMNode) {

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

+			String baseLocation = model.getBaseLocation();

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

+				IPath path = new Path(baseLocation);

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

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

+					if (project.isAccessible()) {

+						String key = createPreferenceKey(path);

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

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

+					}

+				}

+			}

+		}

+		return type;

+	}

+

+	private ModelQuery getEmbeddedModelQuery(Node node) {

+		if (fEmbeddedModelQuery == null) {

+			String embeddedMimeType = getEmbeddedMimeType(node);

+			if (embeddedMimeType != null) {

+				EmbeddedTypeHandler embeddedContentTypeHandler = ModelHandlerUtility.getEmbeddedContentTypeFor(embeddedMimeType);

+				if (embeddedContentTypeHandler != null) {

+					List adapterFactories = embeddedContentTypeHandler.getAdapterFactories();

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

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

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

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

+							if (adapter instanceof ModelQueryAdapter) {

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

+							}

+						}

+					}

+				}

+			}

+		}

+		return fEmbeddedModelQuery;

+	}

+

+	/* (non-Javadoc)

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

+	 */

+	public void setIdResolver(URIResolver newURIResolver) {

+		fEmbeddedModelQuery = null;

+	}

+}

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

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

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

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

+ * which accompanies this distribution, and is available at

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

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

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

+

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

+

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

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

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

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

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

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

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

+

+

+/**

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

+ * JSPFContentProperties does not respect the project override preference.

+ * 

+ */

+class FragmentValidationTools {

+	/**

+	 * @param resource

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

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

+	 *         enabled

+	 */

+	static boolean shouldValidateFragment(IResource resource) {

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

+

+		IProject project = null;

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

+			project = (IProject) resource;

+		}

+		else {

+			project = resource.getProject();

+		}

+		if (project != null) {

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

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

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

+			if (useProjectSettings) {

+				// only if so, return that value

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

+			}

+			// if not, return the workspace value

+		}

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

+	}

+}

diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPActionValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPActionValidator.java
index e9cb19e..ad213e1 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPActionValidator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPActionValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.preferences.DefaultScope;
 import org.eclipse.core.runtime.preferences.IPreferencesService;
@@ -29,6 +30,12 @@
 import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDAttributeDeclaration;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
+import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache;
+import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache.PropertyGroup;
+import org.eclipse.jst.jsp.core.internal.document.PageDirectiveAdapter;
+import org.eclipse.jst.jsp.core.internal.document.PageDirectiveAdapterImpl;
 import org.eclipse.jst.jsp.core.internal.preferences.JSPCorePreferenceNames;
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
 import org.eclipse.osgi.util.NLS;
@@ -51,12 +58,16 @@
 import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
 import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
 import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
+import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMNodeWrapper;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.NodeList;
 
 /**
  * Checks for: missing required attributes & undefined attributes in jsp
@@ -74,8 +85,10 @@
 	private int fSeverityMissingRequiredAttribute = IMessage.HIGH_SEVERITY;
 	private int fSeverityNonEmptyInlineTag = IMessage.NORMAL_SEVERITY;
 	private int fSeverityUnknownAttribute = IMessage.NORMAL_SEVERITY;
+	private int fSeverityUnexpectedRuntimeExpression = IMessage.NORMAL_SEVERITY;
 
 	private HashSet fTaglibPrefixes = new HashSet();
+	private boolean fIsELIgnored = false;
 
 	public JSPActionValidator() {
 		this.fMessageOriginator = this;
@@ -100,6 +113,48 @@
 		}
 	}
 
+	/**
+	 * Checks an attribute for runtime expressions
+	 * @param a The attribute to check for runtime expressions
+	 * @return true if the attribute contains a runtime expression, false otherwise
+	 */
+	private boolean checkRuntimeValue(IDOMAttr a) {
+		ITextRegion value = a.getValueRegion();
+		if (value instanceof ITextRegionContainer) {
+			Iterator it = ((ITextRegionContainer) value).getRegions().iterator();
+			while (it.hasNext()) {
+				String type = ((ITextRegion) it.next()).getType();
+				if (type == DOMJSPRegionContexts.JSP_EL_OPEN)
+					return true;
+			}
+		}
+		return false;
+	}
+
+	/**
+	 * Determines if EL should be ignored. Checks
+	 * <ol>
+	 *  <li>JSP version</li>
+	 * 	<li>Page directive isELIgnored</li>
+	 *  <li>Deployment descriptor's el-ignored</li>
+	 * </ol>
+	 * @return true if EL should be ignored, false otherwise. If the JSP version is < 2.0, EL is ignored by default
+	 */
+	private boolean isElIgnored(IPath path, IStructuredModel model) {
+		if (DeploymentDescriptorPropertyCache.getInstance().getJSPVersion(path) < 2.0f)
+			return true;
+		String directiveIsELIgnored = ((PageDirectiveAdapterImpl)(((IDOMModel) model).getDocument().getAdapterFor(PageDirectiveAdapter.class))).getElIgnored();
+		// isELIgnored directive found
+		if (directiveIsELIgnored != null)
+			return Boolean.valueOf(directiveIsELIgnored).booleanValue();
+		// Check the deployment descriptor for el-ignored
+		PropertyGroup[] groups = DeploymentDescriptorPropertyCache.getInstance().getPropertyGroups(path);
+		if (groups.length > 0)
+			return groups[0].isELignored();
+		// JSP version >= 2.0 defaults to evaluating EL
+		return false;
+	}
+
 	private void checkRequiredAttributes(IDOMElement element, CMNamedNodeMap attrMap, IReporter reporter, IFile file, IStructuredDocument document, IStructuredDocumentRegion documentRegion) {
 		Iterator it = attrMap.iterator();
 		CMAttributeDeclaration attr = null;
@@ -108,48 +163,110 @@
 			if (attr.getUsage() == CMAttributeDeclaration.REQUIRED) {
 				Attr a = element.getAttributeNode(attr.getAttrName());
 				if (a == null) {
-					String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_5, attr.getAttrName());
-					LocalizedMessage message = new LocalizedMessage(fSeverityMissingRequiredAttribute, msgText, file);
-					int start = element.getStartOffset();
-					int length = element.getStartEndOffset() - start;
-					int lineNo = document.getLineOfOffset(start);
-					message.setLineNo(lineNo);
-					message.setOffset(start);
-					message.setLength(length);
-
-					reporter.addMessage(fMessageOriginator, message);
+					// Attribute may be defined using a jsp:attribute action
+					if (!checkJSPAttributeAction(element, attr)) {
+						String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_5, attr.getAttrName());
+						LocalizedMessage message = new LocalizedMessage(fSeverityMissingRequiredAttribute, msgText, file);
+						int start = element.getStartOffset();
+						int length = element.getStartEndOffset() - start;
+						int lineNo = document.getLineOfOffset(start);
+						message.setLineNo(lineNo);
+						message.setOffset(start);
+						message.setLength(length);
+	
+						reporter.addMessage(fMessageOriginator, message);
+					}
 				}
 			}
 		}
 	}
+	
+	/**
+	 * Checks for jsp:attribute actions of <code>element</code> to see if they
+	 * satisfy the required attribute <code>attr</code>
+	 * 
+	 * @param element The element with a required attribute
+	 * @param attr The required attribute
+	 * @return <code>true</code> if a jsp:attribute action has the name of
+	 * the required attribute <code>attr</code>; <code>false</code> otherwise.
+	 */
+	private boolean checkJSPAttributeAction(IDOMElement element, CMAttributeDeclaration attr) {
+		if (element != null && attr != null) {
+			NodeList elements = element.getElementsByTagName("jsp:attribute"); //$NON-NLS-1$
+			String neededAttrName = attr.getNodeName();
+			for (int i = 0; i < elements.getLength(); i++) {
+				Element childElement = (Element) elements.item(i);
+				/*
+				 * Get the name attribute of jsp:attribute and compare its
+				 * value to the required attribute name
+				 */
+				if (childElement.hasAttribute("name") && neededAttrName.equals(childElement.getAttribute("name"))) {//$NON-NLS-1$ //$NON-NLS-2$
+					return true;
+				}
+			}
+		}
+		return false;
+	}
 
-	private boolean checkUnknownAttributes(IDOMElement element, CMNamedNodeMap cmAttrs, IReporter reporter, IFile file, IStructuredDocument document, IStructuredDocumentRegion documentRegion) {
+	private boolean checkUnknownAttributes(IDOMElement element, CMElementDeclaration elementDecl, CMNamedNodeMap cmAttrs, IReporter reporter, IFile file, IStructuredDocument document, IStructuredDocumentRegion documentRegion) {
 		boolean foundjspattribute = false;
+		boolean dynamicAttributesAllowed = false;
+		CMElementDeclaration decl = elementDecl;
+		if (decl instanceof CMNodeWrapper)
+			decl = (CMElementDeclaration) ((CMNodeWrapper) decl).getOriginNode();
+		if (decl instanceof TLDElementDeclaration) {
+			String dynamicAttributes = ((TLDElementDeclaration) decl).getDynamicAttributes();
+			dynamicAttributesAllowed = dynamicAttributes != null ? Boolean.valueOf(dynamicAttributes).booleanValue() : false;
+		}
 
 		NamedNodeMap attrs = element.getAttributes();
 		for (int i = 0; i < attrs.getLength(); i++) {
 			Attr a = (Attr) attrs.item(i);
 			CMAttributeDeclaration adec = (CMAttributeDeclaration) cmAttrs.getNamedItem(a.getName());
 			if (adec == null) {
-				// No attr declaration was found. That is, the attr name is
-				// undefined.
-				// but not regard it as undefined name if it includes JSP
+				/*
+				 * No attr declaration was found. That is, the attr name is
+				 * undefined. Disregard it includes JSP structure or this
+				 * element supports dynamic attributes
+				 */
 				if (!hasJSPRegion(((IDOMNode) a).getNameRegion()) && fSeverityUnknownAttribute != ValidationMessage.IGNORE) {
-					String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_6, a.getName());
-					LocalizedMessage message = new LocalizedMessage(fSeverityUnknownAttribute, msgText, file);
-					int start = ((IDOMAttr) a).getNameRegionStartOffset();
-					int length = ((IDOMAttr) a).getNameRegionEndOffset() - start;
-					int lineNo = document.getLineOfOffset(start);
-					message.setLineNo(lineNo);
-					message.setOffset(start);
-					message.setLength(length);
+					if (!dynamicAttributesAllowed) {
+						String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_6, a.getName());
+						LocalizedMessage message = new LocalizedMessage(fSeverityUnknownAttribute, msgText, file);
+						int start = ((IDOMAttr) a).getNameRegionStartOffset();
+						int length = ((IDOMAttr) a).getNameRegionEndOffset() - start;
+						int lineNo = document.getLineOfOffset(start);
+						message.setLineNo(lineNo);
+						message.setOffset(start);
+						message.setLength(length);
 
-					reporter.addMessage(fMessageOriginator, message);
+						reporter.addMessage(fMessageOriginator, message);
+					}
 				}
 				else {
 					foundjspattribute = true;
 				}
 			}
+			else {
+				if (fSeverityUnexpectedRuntimeExpression != ValidationMessage.IGNORE && adec instanceof TLDAttributeDeclaration) {
+					// The attribute cannot have a runtime evaluation of an expression
+					if (!Boolean.valueOf(((TLDAttributeDeclaration) adec).getRtexprvalue()).booleanValue()) {
+						IDOMAttr attr = (IDOMAttr) a;
+						if(checkRuntimeValue(attr) && !fIsELIgnored) {
+							String msg = NLS.bind(JSPCoreMessages.JSPActionValidator_1, a.getName());
+							LocalizedMessage message = new LocalizedMessage(fSeverityUnexpectedRuntimeExpression, msg, file);
+							ITextRegion region = attr.getValueRegion();
+							int start = attr.getValueRegionStartOffset();
+							int length = region != null ? region.getTextLength() : 0;
+							int lineNo = document.getLineOfOffset(start);
+							message.setLineNo(lineNo);
+							message.setOffset(start);
+							message.setLength(length);
+							reporter.addMessage(fMessageOriginator, message);
+						}
+					}
+				}
+			}
 		}
 		return foundjspattribute;
 	}
@@ -251,6 +368,7 @@
 		fSeverityMissingRequiredAttribute = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE);
 		fSeverityNonEmptyInlineTag = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_NON_EMPTY_INLINE_TAG);
 		fSeverityUnknownAttribute = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_UNKNOWN_ATTRIBUTE);
+		fSeverityUnexpectedRuntimeExpression = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_UNEXPECTED_RTEXPRVALUE);
 	}
 
 	void performValidation(IFile f, IReporter reporter, IStructuredModel model) {
@@ -263,6 +381,7 @@
 		loadPreferences(f);
 		IStructuredDocument sDoc = model.getStructuredDocument();
 
+		fIsELIgnored = isElIgnored(f.getFullPath(), model);
 		// iterate all document regions
 		IStructuredDocumentRegion region = sDoc.getRegionAtCharacterOffset(validateRegion.getOffset());
 		while (region != null && !reporter.isCancelled() && (region.getStartOffset() <= (validateRegion.getOffset() + validateRegion.getLength()))) {
@@ -296,9 +415,9 @@
 			if (query != null) {
 				CMElementDeclaration cmElement = query.getCMElementDeclaration(element);
 				if (cmElement != null) {
-					CMNamedNodeMap cmAttributes = cmElement.getAttributes();
+					CMNamedNodeMap cmAttributes = null;
 
-					CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(cmAttributes);
+					CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl();
 					List nodes = query.getAvailableContent(element, cmElement, ModelQuery.INCLUDE_ATTRIBUTES);
 					for (int k = 0; k < nodes.size(); k++) {
 						CMNode cmnode = (CMNode) nodes.get(k);
@@ -308,7 +427,7 @@
 					}
 					cmAttributes = allAttributes;
 
-					boolean foundjspattribute = checkUnknownAttributes(element, cmAttributes, reporter, file, model.getStructuredDocument(), documentRegion);
+					boolean foundjspattribute = checkUnknownAttributes(element, cmElement, cmAttributes, reporter, file, model.getStructuredDocument(), documentRegion);
 					// required attributes could be hidden in jsp regions in
 					// tags, so if jsp regions were detected, do not check for
 					// missing required attributes
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPBatchValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPBatchValidator.java
index 677960a..42c287b 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPBatchValidator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPBatchValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * Copyright (c) 2006, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,6 +16,8 @@
 import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
 import java.util.List;
 
 import org.eclipse.core.resources.IFile;
@@ -29,6 +31,7 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IConfigurationElement;
 import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.NullProgressMonitor;
@@ -43,12 +46,16 @@
 import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jst.jsp.core.internal.JSPCoreMessages;
 import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.contentproperties.JSPFContentProperties;
+import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache;
+import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache.PropertyGroup;
 import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.validation.AbstractValidator;
+import org.eclipse.wst.validation.ValidationResult;
+import org.eclipse.wst.validation.ValidationState;
 import org.eclipse.wst.validation.internal.ConfigurationManager;
 import org.eclipse.wst.validation.internal.ProjectConfiguration;
 import org.eclipse.wst.validation.internal.ValidationRegistryReader;
@@ -64,7 +71,7 @@
  * Performs JSP validation tasks for batch validation. The individual
  * validator classes will still be used for source validation.
  */
-public final class JSPBatchValidator implements IValidatorJob, IExecutableExtension {
+public final class JSPBatchValidator extends AbstractValidator implements IValidatorJob, IExecutableExtension {
 	class JSPFileVisitor implements IResourceProxyVisitor {
 
 		private List fFiles = new ArrayList();
@@ -106,6 +113,11 @@
 	private static final String PLUGIN_ID_JSP_CORE = "org.eclipse.jst.jsp.core"; //$NON-NLS-1$
 
 	/**
+	 * List of IResources that the currently validating file depends upon
+	 */
+	private Collection fDependsOn;
+
+	/**
 	 * Gets current validation project configuration based on current project
 	 * (which is based on current document)
 	 * 
@@ -165,6 +177,11 @@
 
 	private JSPActionValidator fJSPActionValidator = new JSPActionValidator(this);
 
+	void addDependsOn(IResource resource) {
+		if(resource != null) {
+			fDependsOn.add(resource);
+		}
+	}
 
 	public void cleanup(IReporter reporter) {
 		fJSPDirectiveValidator.cleanup(reporter);
@@ -240,7 +257,7 @@
 		// quick check to see if this is possibly a jsp fragment
 		if (getJSPFContentType().isAssociatedWith(file.getName())) {
 			// get preference for validate jsp fragments
-			boolean shouldValidateFragments = Boolean.valueOf(JSPFContentProperties.getProperty(JSPFContentProperties.VALIDATE_FRAGMENTS, file, true)).booleanValue();
+			boolean shouldValidateFragments = FragmentValidationTools.shouldValidateFragment(file);
 			/*
 			 * if jsp fragments should not be validated, check if file is
 			 * really jsp fragment
@@ -465,4 +482,58 @@
 		}
 		return Status.OK_STATUS;
 	}
+
+	public ValidationResult validate(final IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
+		if (resource.getType() != IResource.FILE)
+			return null;
+		final ValidationResult result = new ValidationResult();
+		final IReporter reporter = result.getReporter(monitor);
+		
+		if(result.getDependsOn() != null) {
+			fDependsOn = new HashSet(Arrays.asList(result.getDependsOn()));
+		}
+		else {
+			fDependsOn = new HashSet();
+		}
+		
+		// add web.xml as a dependency
+		addDependsOn(DeploymentDescriptorPropertyCache.getInstance().getWebXML(resource.getFullPath()));
+
+		// List relevant JSP 2.0 preludes/codas as dependencies
+		IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
+		PropertyGroup[] propertyGroups = DeploymentDescriptorPropertyCache.getInstance().getPropertyGroups(resource.getFullPath());
+		for (int j = 0; j < propertyGroups.length; j++) {
+			IPath[] preludes = propertyGroups[j].getIncludePrelude();
+			for (int i = 0; i < preludes.length; i++) {
+				addDependsOn(workspaceRoot.getFile(preludes[i]));
+			}
+			IPath[] codas = propertyGroups[j].getIncludeCoda();
+			for (int i = 0; i < codas.length; i++) {
+				addDependsOn(workspaceRoot.getFile(codas[i]));
+			}
+		}
+		
+		IWorkspaceRunnable validationRunnable = new IWorkspaceRunnable() {
+			public void run(IProgressMonitor monitor) throws CoreException {
+				if (fragmentCheck((IFile) resource)) {
+					validateFile((IFile) resource, reporter);
+				}
+				IResource[] resources = (IResource[]) fDependsOn.toArray(new IResource[fDependsOn.size()]);
+				result.setDependsOn(resources);
+				fDependsOn.clear();
+			}
+		};
+		Job currentJob = Job.getJobManager().currentJob();
+		ISchedulingRule rule = null;
+		if (currentJob != null) {
+			rule = currentJob.getRule();
+		}
+		try {
+			JavaCore.run(validationRunnable, rule, new NullProgressMonitor());
+		}
+		catch (CoreException e) {
+			Logger.logException(e);
+		}
+		return result;
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPContentValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPContentValidator.java
index fd9a126..2c13d19 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPContentValidator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPContentValidator.java
@@ -11,26 +11,91 @@
 package org.eclipse.jst.jsp.core.internal.validation;
 
 import java.io.IOException;
+import java.io.InputStream;
 
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.core.runtime.content.IContentType;
 import org.eclipse.jst.jsp.core.internal.Logger;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
 import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeConstants;
 import org.eclipse.wst.html.core.internal.validate.HTMLValidationAdapterFactory;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
+import org.eclipse.wst.validation.ValidationResult;
+import org.eclipse.wst.validation.ValidationState;
 import org.eclipse.wst.validation.internal.provisional.core.IReporter;
 import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;
+import org.w3c.dom.Element;
 
 /**
  * This validator validates the contents of the content type of the JSP, like
  * the HTML regions in a JSP with content type="text/html"
  */
 public class JSPContentValidator extends JSPValidator {
+	private static final String HTTP_JAVA_SUN_COM_JSP_PAGE = "http://java.sun.com/JSP/Page"; //$NON-NLS-1$
+	private static final String XMLNS = "xmlns"; //$NON-NLS-1$
+	private static final String XMLNS_JSP = "xmlns:jsp"; //$NON-NLS-1$
+	private IContentType fJSPFContentType = null;
+
+
+	/**
+	 * Checks if file is a jsp fragment or not. If so, check if the fragment
+	 * should be validated or not.
+	 * 
+	 * @param file
+	 *            Assumes shouldValidate was already called on file so it
+	 *            should not be null and does exist
+	 * @return false if file is a fragment and it should not be validated,
+	 *         true otherwise
+	 */
+	private boolean fragmentCheck(IFile file) {
+		boolean shouldValidate = true;
+		// quick check to see if this is possibly a jsp fragment
+		if (getJSPFContentType().isAssociatedWith(file.getName())) {
+			// get preference for validate jsp fragments
+			boolean shouldValidateFragments = FragmentValidationTools.shouldValidateFragment(file);
+			/*
+			 * if jsp fragments should not be validated, check if file is
+			 * really jsp fragment
+			 */
+			if (!shouldValidateFragments) {
+				boolean isFragment = isFragment(file);
+				shouldValidate = !isFragment;
+			}
+		}
+		return shouldValidate;
+	}
+
+	/**
+	 * Returns JSP fragment content type
+	 * 
+	 * @return jspf content type
+	 */
+	private IContentType getJSPFContentType() {
+		if (fJSPFContentType == null) {
+			fJSPFContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSPFRAGMENT);
+		}
+		return fJSPFContentType;
+	}
+
+	/*
+	 * Copied from HTMLValidator
+	 */
+	private HTMLValidationReporter getReporter(IReporter reporter, IFile file, IDOMModel model) {
+		return new HTMLValidationReporter(this, reporter, file, model);
+	}
+
 	/*
 	 * Copied from HTMLValidator
 	 */
@@ -41,13 +106,81 @@
 		return adapter.hasFeature(HTMLDocumentTypeConstants.HTML);
 	}
 
-	/*
-	 * Copied from HTMLValidator
+	/**
+	 * Determines if file is jsp fragment or not (does a deep, indepth check,
+	 * looking into contents of file)
+	 * 
+	 * @param file
+	 *            assumes file is not null and exists
+	 * @return true if file is jsp fragment, false otherwise
 	 */
-	private HTMLValidationReporter getReporter(IReporter reporter, IFile file, IDOMModel model) {
-		return new HTMLValidationReporter(this, reporter, file, model);
+	private boolean isFragment(IFile file) {
+		boolean isFragment = false;
+		InputStream is = null;
+		try {
+			IContentDescription contentDescription = file.getContentDescription();
+			// it can be null
+			if (contentDescription == null) {
+				is = file.getContents();
+				contentDescription = Platform.getContentTypeManager().getDescriptionFor(is, file.getName(), new QualifiedName[]{IContentDescription.CHARSET});
+			}
+			if (contentDescription != null) {
+				String fileCtId = contentDescription.getContentType().getId();
+				isFragment = (fileCtId != null && ContentTypeIdForJSP.ContentTypeID_JSPFRAGMENT.equals(fileCtId));
+			}
+		}
+		catch (IOException e) {
+			// ignore, assume it's invalid JSP
+		}
+		catch (CoreException e) {
+			// ignore, assume it's invalid JSP
+		}
+		finally {
+			/*
+			 * must close input stream in case others need it
+			 * (IFile.getContents() requirement as well)
+			 */
+			if (is != null)
+				try {
+					is.close();
+				}
+				catch (Exception e) {
+					// not sure how to recover at this point
+				}
+		}
+		return isFragment;
 	}
 
+	private boolean isXMLJSP(IDOMDocument document) {
+		Element root = document.getDocumentElement();
+		return root != null && (root.hasAttribute(XMLNS_JSP) || HTTP_JAVA_SUN_COM_JSP_PAGE.equals(root.getAttribute(XMLNS)));
+	}
+
+	private void validate(IFile file, int kind, ValidationState state, IProgressMonitor monitor, IDOMModel model, IReporter reporter) {
+		IDOMDocument document = model.getDocument();
+		if (document == null)
+			return; // error
+
+		boolean isXMLJSP = isXMLJSP(document);
+		boolean hasHTMLFeature = hasHTMLFeature(document);
+
+		if (hasHTMLFeature && !isXMLJSP) {
+			INodeAdapterFactory factory = HTMLValidationAdapterFactory.getInstance();
+			ValidationAdapter adapter = (ValidationAdapter) factory.adapt(document);
+			if (adapter != null) {
+				HTMLValidationReporter rep = getReporter(reporter, file, model);
+				rep.clear();
+				adapter.setReporter(rep);
+				adapter.validate(document);
+			}
+		}
+		if (!hasHTMLFeature && isXMLJSP) {
+			Validator xmlValidator = new Validator();
+			xmlValidator.validate(file, kind, state, monitor);
+		}
+	}
+
+
 	/*
 	 * Mostly copied from HTMLValidator
 	 */
@@ -60,7 +193,9 @@
 
 		// This validator currently only handles validating HTML content in
 		// JSP
-		if (hasHTMLFeature(document)) {
+		boolean hasXMLFeature = isXMLJSP(document);
+		boolean hasHTMLFeature = hasHTMLFeature(document);
+		if (hasHTMLFeature && !hasXMLFeature) {
 			INodeAdapterFactory factory = HTMLValidationAdapterFactory.getInstance();
 			ValidationAdapter adapter = (ValidationAdapter) factory.adapt(document);
 			if (adapter == null)
@@ -73,13 +208,46 @@
 		}
 	}
 
+	public ValidationResult validate(final IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
+		if (resource.getType() != IResource.FILE)
+			return null;
+
+		ValidationResult result = new ValidationResult();
+		final IReporter reporter = result.getReporter(monitor);
+
+		if (fragmentCheck((IFile) resource)) {
+			IStructuredModel model = null;
+			try {
+				model = StructuredModelManager.getModelManager().getModelForRead((IFile) resource);
+				if (!reporter.isCancelled() && model instanceof IDOMModel) {
+					reporter.removeAllMessages(this, resource);
+					validate((IFile) resource, kind, state, monitor, (IDOMModel) model, reporter);
+				}
+			}
+			catch (IOException e) {
+				Logger.logException(e);
+			}
+			catch (CoreException e) {
+				Logger.logException(e);
+			}
+			finally {
+				if (model != null)
+					model.releaseFromRead();
+			}
+		}
+
+		return result;
+	}
+
 	protected void validateFile(IFile f, IReporter reporter) {
 		IStructuredModel model = null;
 		try {
-			model = StructuredModelManager.getModelManager().getModelForRead(f);
-			if (!reporter.isCancelled() && model instanceof IDOMModel) {
-				reporter.removeAllMessages(this, f);
-				validate(reporter, f, (IDOMModel) model);
+			if (fragmentCheck(f)) {
+				model = StructuredModelManager.getModelManager().getModelForRead(f);
+				if (!reporter.isCancelled() && model instanceof IDOMModel) {
+					reporter.removeAllMessages(this, f);
+					validate(reporter, f, (IDOMModel) model);
+				}
 			}
 		}
 		catch (IOException e) {
@@ -93,4 +261,5 @@
 				model.releaseFromRead();
 		}
 	}
+
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPDirectiveValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPDirectiveValidator.java
index 687e966..2be0563 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPDirectiveValidator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPDirectiveValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -19,9 +19,14 @@
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
 import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.preferences.DefaultScope;
 import org.eclipse.core.runtime.preferences.IEclipsePreferences;
@@ -35,11 +40,16 @@
 import org.eclipse.jst.jsp.core.internal.JSPCoreMessages;
 import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
 import org.eclipse.jst.jsp.core.internal.Logger;
+import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache;
 import org.eclipse.jst.jsp.core.internal.preferences.JSPCorePreferenceNames;
 import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
 import org.eclipse.jst.jsp.core.internal.util.FacetModuleCoreSupport;
+import org.eclipse.jst.jsp.core.taglib.IJarRecord;
+import org.eclipse.jst.jsp.core.taglib.ITLDRecord;
+import org.eclipse.jst.jsp.core.taglib.ITagDirRecord;
 import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
+import org.eclipse.jst.jsp.core.taglib.IURLRecord;
 import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.wst.html.core.internal.contentmodel.JSP20Namespace;
@@ -49,6 +59,8 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.core.internal.text.IRegionComparible;
 import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
 import org.eclipse.wst.sse.core.utils.StringUtils;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
@@ -105,6 +117,18 @@
 		this.fMessageOriginator = validator;
 	}
 
+	/**
+	 * Record that the currently validating resource depends on the given
+	 * file. Only possible during batch (not source) validation.
+	 * 
+	 * @param file
+	 */
+	private void addDependsOn(IResource file) {
+		if (fMessageOriginator instanceof JSPBatchValidator) {
+			((JSPBatchValidator) fMessageOriginator).addDependsOn(file);
+		}
+	}
+
 	public void cleanup(IReporter reporter) {
 		super.cleanup(reporter);
 		fTaglibPrefixesInUse.clear();
@@ -201,6 +225,10 @@
 		fPrefixValueRegionToDocumentRegionMap.clear();
 		fTaglibPrefixesInUse.clear();
 
+		IRegionComparible comparer = null;
+		if (sDoc instanceof IRegionComparible)
+			comparer = (IRegionComparible) sDoc;
+		
 		// iterate all document regions
 		IStructuredDocumentRegion region = sDoc.getFirstStructuredDocumentRegion();
 		while (region != null && !reporter.isCancelled()) {
@@ -208,6 +236,14 @@
 			if (region.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
 				processDirective(reporter, f, sDoc, region);
 			}
+			// requires tag name, attribute, equals, and value
+			else if (comparer != null && region.getNumberOfRegions() > 4) {
+				ITextRegion nameRegion = region.getRegions().get(1);
+				if (comparer.regionMatches(region.getStartOffset(nameRegion), nameRegion.getTextLength(), "jsp:include")) {
+					processIncludeDirective(reporter, f, sDoc, region);
+				}
+
+			}
 			region = region.getNext();
 		}
 
@@ -227,7 +263,7 @@
 		if (directiveName.equals("taglib")) { //$NON-NLS-1$
 			processTaglibDirective(reporter, file, sDoc, documentRegion);
 		}
-		else if (directiveName.equals("include")) { //$NON-NLS-1$
+		else if (directiveName.equals("include")||directiveName.equals("jsp:include")) { //$NON-NLS-1$ //$NON-NLS-2$
 			processIncludeDirective(reporter, file, sDoc, documentRegion);
 		}
 		else if (directiveName.equals("page")) { //$NON-NLS-1$
@@ -237,7 +273,10 @@
 
 	private void processIncludeDirective(IReporter reporter, IFile file, IStructuredDocument sDoc, IStructuredDocumentRegion documentRegion) {
 		ITextRegion fileValueRegion = getAttributeValueRegion(documentRegion, JSP11Namespace.ATTR_NAME_FILE);
-		if (fileValueRegion != null) {
+		if (fileValueRegion == null)
+			fileValueRegion = getAttributeValueRegion(documentRegion, JSP11Namespace.ATTR_NAME_PAGE);
+		// There is a file and it isn't a nested region which could contain a JSP expression
+		if (fileValueRegion != null && !hasNestedRegion(fileValueRegion)) {
 			// file specified
 			String fileValue = documentRegion.getText(fileValueRegion);
 			fileValue = StringUtils.stripQuotes(fileValue);
@@ -249,40 +288,43 @@
 				int start = documentRegion.getStartOffset(fileValueRegion);
 				int length = fileValueRegion.getTextLength();
 				int lineNo = sDoc.getLineOfOffset(start);
-				message.setLineNo(lineNo);
+				message.setLineNo(lineNo + 1);
 				message.setOffset(start);
 				message.setLength(length);
 
 				reporter.addMessage(fMessageOriginator, message);
 			}
-			else if (fSeverityIncludeFileMissing != ValidationMessage.IGNORE) {
+			else if (DeploymentDescriptorPropertyCache.getInstance().getURLMapping(file.getFullPath(), fileValue) == null) {
 				IPath testPath = FacetModuleCoreSupport.resolve(file.getFullPath(), fileValue);
 				if (testPath.segmentCount() > 1) {
 					IFile testFile = file.getWorkspace().getRoot().getFile(testPath);
+					addDependsOn(testFile);
 					if (!testFile.isAccessible()) {
-						// File not found
-						String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_4, new String[]{fileValue, testPath.toString()});
-						LocalizedMessage message = new LocalizedMessage(fSeverityIncludeFileMissing, msgText, file);
-						int start = documentRegion.getStartOffset(fileValueRegion);
-						int length = fileValueRegion.getTextLength();
-						int lineNo = sDoc.getLineOfOffset(start);
-						message.setLineNo(lineNo);
-						message.setOffset(start);
-						message.setLength(length);
+						if (fSeverityIncludeFileMissing != ValidationMessage.IGNORE) {
+							// File not found
+							String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_4, new String[]{fileValue, testPath.toString()});
+							LocalizedMessage message = new LocalizedMessage(fSeverityIncludeFileMissing, msgText, file);
+							int start = documentRegion.getStartOffset(fileValueRegion);
+							int length = fileValueRegion.getTextLength();
+							int lineNo = sDoc.getLineOfOffset(start);
+							message.setLineNo(lineNo + 1);
+							message.setOffset(start);
+							message.setLength(length);
 
-						reporter.addMessage(fMessageOriginator, message);
+							reporter.addMessage(fMessageOriginator, message);
+						}
 					}
 				}
 			}
 		}
-		else if (fSeverityIncludeFileNotSpecified != ValidationMessage.IGNORE) {
+		else if (fileValueRegion == null && fSeverityIncludeFileNotSpecified != ValidationMessage.IGNORE) {
 			// file is not specified at all
 			String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_3, JSP11Namespace.ATTR_NAME_FILE);
 			LocalizedMessage message = new LocalizedMessage(fSeverityIncludeFileNotSpecified, msgText, file);
 			int start = documentRegion.getStartOffset();
 			int length = documentRegion.getTextLength();
 			int lineNo = sDoc.getLineOfOffset(start);
-			message.setLineNo(lineNo);
+			message.setLineNo(lineNo + 1);
 			message.setOffset(start);
 			message.setLength(length);
 
@@ -314,13 +356,13 @@
 			}
 
 			if (superClass == null && fSeveritySuperClassNotFound != ValidationMessage.IGNORE) {
-				// file value is specified but empty
+				// superclass not found
 				String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_8, superclassName);
 				LocalizedMessage message = new LocalizedMessage(fSeveritySuperClassNotFound, msgText, file);
 				int start = documentRegion.getStartOffset(superclassValueRegion);
 				int length = superclassValueRegion.getTextLength();
 				int lineNo = doc.getLineOfOffset(start);
-				message.setLineNo(lineNo);
+				message.setLineNo(lineNo + 1);
 				message.setOffset(start);
 				message.setLength(length);
 
@@ -340,19 +382,98 @@
 			if (file != null) {
 				uri = StringUtils.stripQuotes(uri);
 				if (uri.length() > 0) {
-					ITaglibRecord tld = TaglibIndex.resolve(file.getFullPath().toString(), uri, false);
-					if (tld == null && fSeverityTaglibUnresolvableURI != ValidationMessage.IGNORE) {
+					ITaglibRecord reference = TaglibIndex.resolve(file.getFullPath().toString(), uri, false);
+					if (reference != null) {
+						switch (reference.getRecordType()) {
+							case (ITaglibRecord.TLD) : {
+								ITLDRecord record = (ITLDRecord) reference;
+								IResource tldfile = ResourcesPlugin.getWorkspace().getRoot().getFile(record.getPath());
+								addDependsOn(tldfile);
+							}
+								break;
+							case (ITaglibRecord.JAR) : {
+								IJarRecord record = (IJarRecord) reference;
+								IFile[] foundFilesForLocation = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(record.getLocation());
+								for (int i = 0; i < foundFilesForLocation.length; i++) {
+									addDependsOn(foundFilesForLocation[i]);
+								}
+							}
+								break;
+							case (ITaglibRecord.TAGDIR) : {
+								ITagDirRecord record = (ITagDirRecord) reference;
+								IPath path = record.getPath();
+								IResource found = ResourcesPlugin.getWorkspace().getRoot().findMember(path, false);
+
+								try {
+									found.accept(new IResourceVisitor() {
+										public boolean visit(IResource resource) throws CoreException {
+											if (resource.getType() == IResource.FILE) {
+												addDependsOn(resource);
+											}
+											return true;
+										}
+									});
+								}
+								catch (CoreException e) {
+									Logger.logException(e);
+								}
+							}
+								break;
+							case (ITaglibRecord.URL) : {
+								IURLRecord record = (IURLRecord) reference;
+								String baseLocation = record.getBaseLocation();
+								if (baseLocation != null && baseLocation.indexOf("://") < 0) {
+									IResource found = ResourcesPlugin.getWorkspace().getRoot().findMember(baseLocation, false);
+									if (found != null) {
+										try {
+											found.accept(new IResourceVisitor() {
+												public boolean visit(IResource resource) throws CoreException {
+													if (resource.getType() == IResource.FILE) {
+														addDependsOn(resource);
+													}
+													return true;
+												}
+											});
+										}
+										catch (CoreException e) {
+											Logger.logException(e);
+										}
+									}
+									else {
+										IFile externalJar = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(baseLocation));
+										if (externalJar != null) {
+											addDependsOn(externalJar);
+										}
+									}
+								}
+							}
+								break;
+						}
+					}
+					if (reference == null && fSeverityTaglibUnresolvableURI != ValidationMessage.IGNORE) {
 						// URI specified but does not resolve
-						String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_1, uri);
+						String msgText = null;
+						// provide better messages for typical "http:*" URIs
+						if (uri.startsWith("http:") && DeploymentDescriptorPropertyCache.getInstance().getJSPVersion(file.getFullPath()) < 1.2) { //$NON-NLS-1$
+							if (FacetModuleCoreSupport.isDynamicWebProject(file.getProject())) {
+								msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_9, uri);
+							}
+							else {
+								msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_10, uri);
+							}
+						}
+						else {
+							msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_1, uri);
+						}
 						LocalizedMessage message = new LocalizedMessage(fSeverityTaglibUnresolvableURI, msgText, file);
 						int start = documentRegion.getStartOffset(uriValueRegion);
 						int length = uriValueRegion.getTextLength();
 						int lineNo = sDoc.getLineOfOffset(start);
-						message.setLineNo(lineNo);
+						message.setLineNo(lineNo + 1);
 						message.setOffset(start);
 						message.setLength(length);
 
-						message.setAttribute("PROBLEM_ID", new Integer(611));
+						message.setAttribute("PROBLEM_ID", new Integer(611)); //$NON-NLS-1$
 
 						reporter.addMessage(fMessageOriginator, message);
 					}
@@ -364,7 +485,7 @@
 					int start = documentRegion.getStartOffset(uriValueRegion);
 					int length = uriValueRegion.getTextLength();
 					int lineNo = sDoc.getLineOfOffset(start);
-					message.setLineNo(lineNo);
+					message.setLineNo(lineNo + 1);
 					message.setOffset(start);
 					message.setLength(length);
 
@@ -385,7 +506,7 @@
 					int start = documentRegion.getStartOffset(tagdirValueRegion);
 					int length = tagdirValueRegion.getTextLength();
 					int lineNo = sDoc.getLineOfOffset(start);
-					message.setLineNo(lineNo);
+					message.setLineNo(lineNo + 1);
 					message.setOffset(start);
 					message.setLength(length);
 
@@ -393,12 +514,12 @@
 				}
 				else if (TaglibIndex.resolve(file.getFullPath().toString(), tagdir, false) == null && fSeverityTagdirUnresolvableURI != ValidationMessage.IGNORE) {
 					// URI specified but does not resolve
-					String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_1, tagdir);
+					String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_11, tagdir);
 					LocalizedMessage message = new LocalizedMessage(fSeverityTaglibUnresolvableURI, msgText, file);
 					int start = documentRegion.getStartOffset(tagdirValueRegion);
 					int length = tagdirValueRegion.getTextLength();
 					int lineNo = sDoc.getLineOfOffset(start);
-					message.setLineNo(lineNo);
+					message.setLineNo(lineNo + 1);
 					message.setOffset(start);
 					message.setLength(length);
 
@@ -413,7 +534,7 @@
 			int start = documentRegion.getStartOffset();
 			int length = documentRegion.getTextLength();
 			int lineNo = sDoc.getLineOfOffset(start);
-			message.setLineNo(lineNo);
+			message.setLineNo(lineNo + 1);
 			message.setOffset(start);
 			message.setLength(length);
 
@@ -436,7 +557,7 @@
 				int start = documentRegion.getStartOffset(prefixValueRegion);
 				int length = prefixValueRegion.getTextLength();
 				int lineNo = sDoc.getLineOfOffset(start);
-				message.setLineNo(lineNo);
+				message.setLineNo(lineNo + 1);
 				message.setOffset(start);
 				message.setLength(length);
 
@@ -449,7 +570,7 @@
 				int start = documentRegion.getStartOffset(prefixValueRegion);
 				int length = prefixValueRegion.getTextLength();
 				int lineNo = sDoc.getLineOfOffset(start);
-				message.setLineNo(lineNo);
+				message.setLineNo(lineNo + 1);
 				message.setOffset(start);
 				message.setLength(length);
 
@@ -463,7 +584,7 @@
 			int start = documentRegion.getStartOffset();
 			int length = documentRegion.getTextLength();
 			int lineNo = sDoc.getLineOfOffset(start);
-			message.setLineNo(lineNo);
+			message.setLineNo(lineNo + 1);
 			message.setOffset(start);
 			message.setLength(length);
 
@@ -507,24 +628,26 @@
 					}
 				}
 
-				String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_2, prefixes[prefixNumber]); //$NON-NLS-2$ //$NON-NLS-1$
+				if (severity != ValidationMessage.IGNORE) {
+					String msgText = NLS.bind(JSPCoreMessages.JSPDirectiveValidator_2, prefixes[prefixNumber]); //$NON-NLS-2$ //$NON-NLS-1$
 
-				// Report an error in all directives using this prefix
-				for (int regionNumber = 0; regionNumber < valueRegions.size(); regionNumber++) {
+					// Report an error in all directives using this prefix
+					for (int regionNumber = 0; regionNumber < valueRegions.size(); regionNumber++) {
 
-					ITextRegion valueRegion = (ITextRegion) valueRegions.get(regionNumber);
-					IStructuredDocumentRegion documentRegion = (IStructuredDocumentRegion) fPrefixValueRegionToDocumentRegionMap.get(valueRegion);
-					LocalizedMessage message = (file == null ? new LocalizedMessage(severity, msgText) : new LocalizedMessage(severity, msgText, file));
+						ITextRegion valueRegion = (ITextRegion) valueRegions.get(regionNumber);
+						IStructuredDocumentRegion documentRegion = (IStructuredDocumentRegion) fPrefixValueRegionToDocumentRegionMap.get(valueRegion);
+						LocalizedMessage message = (file == null ? new LocalizedMessage(severity, msgText) : new LocalizedMessage(severity, msgText, file));
 
-					// if there's a message, there was an error found
-					int start = documentRegion.getStartOffset(valueRegion);
-					int length = valueRegion.getTextLength();
-					int lineNo = document.getLineOfOffset(start);
-					message.setLineNo(lineNo);
-					message.setOffset(start);
-					message.setLength(length);
+						// if there's a message, there was an error found
+						int start = documentRegion.getStartOffset(valueRegion);
+						int length = valueRegion.getTextLength();
+						int lineNo = document.getLineOfOffset(start);
+						message.setLineNo(lineNo + 1);
+						message.setOffset(start);
+						message.setLength(length);
 
-					reporter.addMessage(fMessageOriginator, message);
+						reporter.addMessage(fMessageOriginator, message);
+					}
 				}
 			}
 		}
@@ -553,6 +676,14 @@
 		fPreferencesService = null;
 		fScopes = null;
 	}
+	
+	/**
+	 * True if container has nested regions, meaning container is probably too
+	 * complicated (like JSP expressions or EL) to validate with this validator.
+	 */
+	private boolean hasNestedRegion(ITextRegion container) {
+		return (container instanceof ITextRegionContainer && ((ITextRegionContainer) container).getRegions() != null);
+	}
 
 	/**
 	 * batch validation call
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPELValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPELValidator.java
index 8fb17de..cf84532 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPELValidator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPELValidator.java
@@ -46,7 +46,8 @@
 public class JSPELValidator extends JSPValidator {
 	private static final boolean DEBUG = Boolean.valueOf(Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspvalidator")).booleanValue(); //$NON-NLS-1$		
 	private static final String PREFERENCE_NODE_QUALIFIER = JSPCorePlugin.getDefault().getBundle().getSymbolicName();
-
+	private static final int MAX_REGIONS = 1000;
+	
 	private IValidator fMessageOriginator;
 
 	public JSPELValidator() {
@@ -137,12 +138,55 @@
 				Iterator childRegions = parentRegion.getRegions().iterator();
 				while (childRegions.hasNext() && !reporter.isCancelled()) {
 					ITextRegion childRegion = (ITextRegion) childRegions.next();
-					if (childRegion.getType() == DOMJSPRegionContexts.JSP_EL_CONTENT)
-						validateXMLNode(parentRegion, childRegion, reporter, file);
+					/* [136795] Validate everything in the EL container, not just JSP_EL_CONTENT */
+					if (childRegion.getType() == DOMJSPRegionContexts.JSP_EL_OPEN)
+						validateELContent(parentRegion, childRegion, childRegions, reporter, file);
 				}
 			}
 		}
 	}
+	
+	protected void validateELContent(ITextRegionCollection container, ITextRegion elOpenRegion, Iterator elRegions, IReporter reporter, IFile file) {
+		int contentStart = elOpenRegion.getEnd();
+		int contentDocStart = container.getEndOffset(elOpenRegion);
+		int contentLength = container.getLength();
+		int regionCount = 0;
+		ITextRegion elRegion = null;
+		/* Find the EL closing region, otherwise the last region will be used to calculate the EL content text */
+		while (elRegions != null && elRegions.hasNext() && (regionCount++ < MAX_REGIONS)) {
+			elRegion = (ITextRegion) elRegions.next();
+			if (elRegion.getType() == DOMJSPRegionContexts.JSP_EL_CLOSE)
+				break;
+		}
+		
+		String elText = container.getFullText().substring(contentStart, (elRegion != null) ? elRegion.getStart() : (contentLength - 1));
+		JSPELParser elParser = JSPELParser.createParser(elText);
+		try {
+			elParser.Expression();
+		}
+		catch (ParseException e) {
+			int sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_EL_SYNTAX);
+			if (sev != ValidationMessage.IGNORE) {
+				Token curTok = e.currentToken;
+				int problemStartOffset = contentDocStart + curTok.beginColumn;
+				Message message = new LocalizedMessage(sev, JSPCoreMessages.JSPEL_Syntax);
+				message.setOffset(problemStartOffset);
+				message.setLength(curTok.endColumn - curTok.beginColumn + 1);
+				message.setTargetObject(file);
+				reporter.addMessage(fMessageOriginator, message);
+			}
+		}
+		catch (TokenMgrError te) {
+			int sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_EL_LEXER);
+			if (sev != ValidationMessage.IGNORE) {
+				Message message = new LocalizedMessage(IMessage.NORMAL_SEVERITY, JSPCoreMessages.JSPEL_Token);
+				message.setOffset(contentDocStart);
+				message.setLength(contentLength);
+				message.setTargetObject(file);
+				reporter.addMessage(fMessageOriginator, message);
+			}
+		}
+	}
 
 	protected void validateXMLNode(ITextRegionCollection container, ITextRegion region, IReporter reporter, IFile file) {
 		String elText = container.getText(region);
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPJavaValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPJavaValidator.java
index 9972e34..d8ffbff 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPJavaValidator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPJavaValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,6 +15,8 @@
 import java.util.List;
 
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.ProjectScope;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.Platform;
@@ -51,9 +53,13 @@
 	private static final boolean DEBUG = Boolean.valueOf(Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspvalidator")).booleanValue(); //$NON-NLS-1$
 	private IValidator fMessageOriginator;
 
-	private IPreferencesService fPreferencesService = null;
+	private IPreferencesService fPreferencesService = Platform.getPreferencesService();
 	private static final String PREFERENCE_NODE_QUALIFIER = JSPCorePlugin.getDefault().getBundle().getSymbolicName();
 	private IScopeContext[] fScopes = null;
+	
+	private static final boolean UPDATE_JAVA_TASKS = true;
+	private static final String JAVA_TASK_MARKER_TYPE = "org.eclipse.jdt.core.task"; //$NON-NLS-1$
+	private static final String[] DEPEND_ONs = new String[]{".classpath", ".project", ".settings/org.eclipse.jdt.core.prefs", ".settings/org.eclipse.jst.jsp.core.prefs", ".settings/org.eclipse.wst.common.project.facet.core.xml", ".settings/org.eclipse.wst.common.component"};
 
 	public JSPJavaValidator() {
 		this.fMessageOriginator = this;
@@ -83,7 +89,6 @@
 		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$
@@ -96,6 +101,11 @@
 						m.setOffset(region.getStartOffset());
 						m.setLength(region.getTextLength());
 					}
+					/**
+					 * Bug 219761 - Syntax error reported at wrong location
+					 * (don't forget to adjust the line number, too)
+					 */
+					m.setLineNo(sDoc.getLineOfOffset(m.getOffset()) + 1);
 					break;
 				}
 			}
@@ -103,7 +113,7 @@
 	}
 
 	/**
-	 * Creates an IMessage from an IProblem
+	 * Creates an IMessage from asn IProblem
 	 * 
 	 * @param problem
 	 * @param f
@@ -155,33 +165,42 @@
 			sourceEnd = translation.getJspOffset(problem.getSourceEnd());
 			switch (problem.getID()) {
 				case IProblem.LocalVariableIsNeverUsed : {
-					sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_LOCAL_VARIABLE_NEVER_USED);
+					sev = getSourceSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_LOCAL_VARIABLE_NEVER_USED, sourceStart, sourceEnd);
 				}
 					break;
 				case IProblem.NullLocalVariableReference : {
-					sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_NULL_LOCAL_VARIABLE_REFERENCE);
+					sev = getSourceSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_NULL_LOCAL_VARIABLE_REFERENCE, sourceStart, sourceEnd);
 				}
 					break;
 				case IProblem.ArgumentIsNeverUsed : {
-					sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_ARGUMENT_IS_NEVER_USED);
+					sev = getSourceSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_ARGUMENT_IS_NEVER_USED, sourceStart, sourceEnd);
 				}
 					break;
 				case IProblem.PotentialNullLocalVariableReference : {
-					sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_POTENTIAL_NULL_LOCAL_VARIABLE_REFERENCE);
+					sev = getSourceSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_POTENTIAL_NULL_LOCAL_VARIABLE_REFERENCE, sourceStart, sourceEnd);
 				}
 					break;
 				case IProblem.UnusedImport : {
-					sev = getMessageSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_UNUSED_IMPORT);
+					sev = getSourceSeverity(JSPCorePreferenceNames.VALIDATION_JAVA_UNUSED_IMPORT, sourceStart, sourceEnd);
 				}
 					break;
+				case IProblem.UnusedPrivateField:
+				case IProblem.MissingSerialVersion : {
+					// JSP files don't get serialized...right?
+					sev = ValidationMessage.IGNORE;
+				}
+				break;
 
 				default : {
 					if (problem.isError()) {
 						sev = IMessage.HIGH_SEVERITY;
 					}
-					else {
+					else if (problem.isWarning()) {
 						sev = IMessage.NORMAL_SEVERITY;
 					}
+					else {
+						sev = IMessage.LOW_SEVERITY;
+					}
 				}
 					if (sev == ValidationMessage.IGNORE) {
 						return null;
@@ -240,6 +259,17 @@
 		return m;
 	}
 
+	/**
+	 * Provides the severity for the given message key only when it's within the source range of the JSP (i.e., not boilerplate code).
+	 * @param key the key to get the severity of
+	 * @param start start within the JSP source
+	 * @param end end wtihin the JSP source
+	 * @return The message severity for the key if it is part of the JSP's source. IGNORE if it's boilerplate code.
+	 */
+	private int getSourceSeverity(String key, int start, int end) {
+		return (start >= 0 && end >= 0 ) ? getMessageSeverity(key) : ValidationMessage.IGNORE;
+	}
+
 	int getMessageSeverity(String key) {
 		int sev = fPreferencesService.getInt(PREFERENCE_NODE_QUALIFIER, key, IMessage.NORMAL_SEVERITY, fScopes);
 		switch (sev) {
@@ -258,7 +288,6 @@
 	private void loadPreferences(IFile file) {
 		fScopes = new IScopeContext[]{new InstanceScope(), new DefaultScope()};
 
-		fPreferencesService = Platform.getPreferencesService();
 		if (file != null && file.isAccessible()) {
 			ProjectScope projectScope = new ProjectScope(file.getProject());
 			if (projectScope.getNode(PREFERENCE_NODE_QUALIFIER).getBoolean(JSPCorePreferenceNames.VALIDATION_USE_PROJECT_SETTINGS, false)) {
@@ -268,6 +297,9 @@
 	}
 
 	void performValidation(IFile f, IReporter reporter, IStructuredModel model) {
+		for (int i = 0; i < DEPEND_ONs.length; i++) {
+			addDependsOn(f.getProject().getFile(DEPEND_ONs[i]));	
+		}
 		if (model instanceof IDOMModel) {
 			IDOMModel domModel = (IDOMModel) model;
 			ModelHandlerForJSP.ensureTranslationAdapterFactory(domModel);
@@ -279,14 +311,66 @@
 			if (!reporter.isCancelled()) {
 				loadPreferences(f);
 
+				// only update task markers if the model is the same as what's on disk
+				boolean updateJavaTasks = UPDATE_JAVA_TASKS && !domModel.isDirty() && f != null && f.isAccessible();
+				if (updateJavaTasks) {
+					// remove old Java task markers
+					try {
+						IMarker[] foundMarkers = f.findMarkers(JAVA_TASK_MARKER_TYPE, true, IResource.DEPTH_ONE);
+						for (int i = 0; i < foundMarkers.length; i++) {
+							foundMarkers[i].delete();
+						}
+					}
+					catch (CoreException e) {
+						Logger.logException(e);
+					}
+				}
+
 				translation.setProblemCollectingActive(true);
 				translation.reconcileCompilationUnit();
 				List problems = translation.getProblems();
 				// add new messages
 				for (int i = 0; i < problems.size() && !reporter.isCancelled(); i++) {
-					IMessage m = createMessageFromProblem((IProblem) problems.get(i), f, translation, domModel.getStructuredDocument());
-					if (m != null)
-						reporter.addMessage(fMessageOriginator, m);
+					IProblem problem = (IProblem) problems.get(i);
+					IMessage m = createMessageFromProblem(problem, f, translation, domModel.getStructuredDocument());
+					if (m != null) {
+						if (problem.getID() == IProblem.Task) {
+							if (updateJavaTasks) {
+								// add new Java task marker
+								try {
+									IMarker task = f.createMarker(JAVA_TASK_MARKER_TYPE);
+									task.setAttribute(IMarker.LINE_NUMBER, new Integer(m.getLineNumber()));
+									task.setAttribute(IMarker.CHAR_START, new Integer(m.getOffset()));
+									task.setAttribute(IMarker.CHAR_END, new Integer(m.getOffset() + m.getLength()));
+									task.setAttribute(IMarker.MESSAGE, m.getText());
+									task.setAttribute(IMarker.USER_EDITABLE, Boolean.FALSE);
+
+									switch (m.getSeverity()) {
+										case IMessage.HIGH_SEVERITY: {
+											task.setAttribute(IMarker.PRIORITY, new Integer(IMarker.PRIORITY_HIGH));
+											task.setAttribute(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_ERROR));
+										}
+											break;
+										case IMessage.LOW_SEVERITY : {
+											task.setAttribute(IMarker.PRIORITY, new Integer(IMarker.PRIORITY_LOW));
+											task.setAttribute(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_INFO));
+										}
+											break;
+										default : {
+											task.setAttribute(IMarker.PRIORITY, new Integer(IMarker.PRIORITY_NORMAL));
+											task.setAttribute(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_WARNING));
+										}
+									}
+								}
+								catch (CoreException e) {
+									Logger.logException(e);
+								}
+							}
+						}
+						else {
+							reporter.addMessage(fMessageOriginator, m);
+						}
+					}
 				}
 			}
 		}
@@ -294,7 +378,6 @@
 	}
 
 	private void unloadPreferences() {
-		fPreferencesService = null;
 		fScopes = null;
 	}
 
@@ -314,6 +397,9 @@
 			// get jsp model, get tranlsation
 			model = StructuredModelManager.getModelManager().getModelForRead(f);
 			if (!reporter.isCancelled() && model != null) {
+				for (int i = 0; i < DEPEND_ONs.length; i++) {
+					addDependsOn(f.getProject().getFile(DEPEND_ONs[i]));	
+				}
 				// get jsp model, get translation
 				if (model instanceof IDOMModel) {
 					reporter.removeAllMessages(fMessageOriginator, f);
@@ -332,4 +418,17 @@
 				model.releaseFromRead();
 		}
 	}
+
+	/**
+	 * Record that the currently validating resource depends on the given
+	 * file. Only possible during batch (not source) validation.
+	 * 
+	 * @param file
+	 */
+	private void addDependsOn(IFile file) {
+		if (fMessageOriginator instanceof JSPBatchValidator) {
+			((JSPBatchValidator) fMessageOriginator).addDependsOn(file);
+		}
+	}
+
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java
index 89aa25c..a6b20c1 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java
@@ -24,6 +24,7 @@
 import org.eclipse.core.resources.IWorkspaceRoot;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
@@ -36,9 +37,12 @@
 import org.eclipse.jst.jsp.core.internal.contentproperties.JSPFContentProperties;
 import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.validation.AbstractValidator;
+import org.eclipse.wst.validation.ValidationResult;
+import org.eclipse.wst.validation.ValidationState;
 import org.eclipse.wst.validation.internal.core.Message;
 import org.eclipse.wst.validation.internal.core.ValidationException;
 import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
@@ -51,7 +55,7 @@
 /**
  * Performs some common JSP validation tasks
  */
-public class JSPValidator implements IValidatorJob {
+public class JSPValidator extends AbstractValidator implements IValidatorJob {
 
 	private static final String PLUGIN_ID_JSP_CORE = "org.eclipse.jst.jsp.core"; //$NON-NLS-1$
 	private IContentType fJSPFContentType = null;
@@ -237,18 +241,27 @@
 		// subclasses should implement (for batch validation)
 	}
 
+	public ValidationResult validate(final IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
+		if (resource.getType() != IResource.FILE)
+			return null;
+		ValidationResult result = new ValidationResult();
+		final IReporter reporter = result.getReporter(monitor);
+		validateFile((IFile) resource, reporter);
+		return result;
+	}
+
 	/**
 	 * 
-	 * @param sdr
+	 * @param collection
 	 * @return the jsp directive name
 	 */
-	protected String getDirectiveName(IStructuredDocumentRegion sdr) {
+	protected String getDirectiveName(ITextRegionCollection collection) {
 		String name = ""; //$NON-NLS-1$
-		ITextRegionList subRegions = sdr.getRegions();
+		ITextRegionList subRegions = collection.getRegions();
 		for (int j = 0; j < subRegions.size(); j++) {
 			ITextRegion subRegion = subRegions.get(j);
 			if (subRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
-				name = sdr.getText(subRegion);
+				name = collection.getText(subRegion);
 				break;
 			}
 		}
@@ -262,7 +275,7 @@
 	 * @return the ITextRegion for the attribute value of the given attribute
 	 *         name, case sensitive, null if no matching attribute is found
 	 */
-	protected ITextRegion getAttributeValueRegion(IStructuredDocumentRegion sdr, String attrName) {
+	protected ITextRegion getAttributeValueRegion(ITextRegionCollection sdr, String attrName) {
 		ITextRegion valueRegion = null;
 		ITextRegionList subRegions = sdr.getRegions();
 		for (int i = 0; i < subRegions.size(); i++) {
@@ -281,7 +294,7 @@
 		return valueRegion;
 	}
 
-	protected String getAttributeValue(IStructuredDocumentRegion sdr, String attrName) {
+	protected String getAttributeValue(ITextRegionCollection sdr, String attrName) {
 		ITextRegion r = getAttributeValueRegion(sdr, attrName);
 		if (r != null)
 			return sdr.getText(r).trim();
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/TLDValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/TLDValidator.java
new file mode 100644
index 0000000..ae70a60
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/TLDValidator.java
@@ -0,0 +1,219 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.jst.jsp.core.internal.validation;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IPreferencesService;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jst.jsp.core.internal.Assert;
+import org.eclipse.jst.jsp.core.internal.JSPCoreMessages;
+import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
+import org.eclipse.jst.jsp.core.internal.Logger;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP11TLDNames;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP12TLDNames;
+import org.eclipse.jst.jsp.core.internal.preferences.JSPCorePreferenceNames;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
+import org.eclipse.wst.validation.AbstractValidator;
+import org.eclipse.wst.validation.ValidationResult;
+import org.eclipse.wst.validation.ValidationState;
+import org.eclipse.wst.validation.ValidatorMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * A miniature validator for .tld files. Checks for valid class names.
+ */
+public class TLDValidator extends AbstractValidator {
+	private static final String MARKER_TYPE = "org.eclipse.jst.jsp.core.validationMarker"; //$NON-NLS-1$
+	private static final String PREFERENCE_NODE_QUALIFIER = JSPCorePlugin.getDefault().getBundle().getSymbolicName();
+
+	private IPreferencesService fPreferencesService = Platform.getPreferencesService();
+
+	private static final String[] classElementNames = new String[]{JSP11TLDNames.TAGCLASS, JSP12TLDNames.TAG_CLASS, JSP11TLDNames.TEICLASS, JSP12TLDNames.TEI_CLASS, JSP12TLDNames.VALIDATOR_CLASS, JSP12TLDNames.VARIABLE_CLASS, JSP12TLDNames.LISTENER_CLASS};
+	private static final String[] missingClassMessages = new String[]{JSPCoreMessages.TaglibHelper_3, JSPCoreMessages.TaglibHelper_3, JSPCoreMessages.TaglibHelper_0, JSPCoreMessages.TaglibHelper_0, JSPCoreMessages.TLDValidator_MissingValidator, JSPCoreMessages.TLDValidator_MissingVariable, JSPCoreMessages.TLDValidator_MissingListener};
+	private static final String[] missingClassSeverityPreferenceKeys = new String[]{JSPCorePreferenceNames.VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_CLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_CLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND};
+
+	public TLDValidator() {
+		super();
+
+		Assert.isTrue(classElementNames.length == missingClassMessages.length, "mismanaged arrays"); //$NON-NLS-1$
+		Assert.isTrue(classElementNames.length == missingClassSeverityPreferenceKeys.length, "mismanaged arrays"); //$NON-NLS-1$
+		Assert.isTrue(missingClassMessages.length == missingClassSeverityPreferenceKeys.length, "mismanaged arrays"); //$NON-NLS-1$
+	}
+
+	private Map checkClass(IJavaProject javaProject, Node classSpecifier, IScopeContext[] preferenceScopes, String preferenceKey, String errorMessage) {
+		String className = getTextContents(classSpecifier);
+		if (className != null && className.length() > 2) {
+			IType type = null;
+			try {
+				type = javaProject.findType(className);
+			}
+			catch (JavaModelException e) {
+				return null;
+			}
+
+			if (type == null || !type.exists()) {
+				Object severity = getMessageSeverity(preferenceScopes, preferenceKey);
+				if (severity == null)
+					return null;
+
+				IDOMNode classElement = (IDOMNode) classSpecifier;
+				Map markerValues = new HashMap();
+				markerValues.put(IMarker.SEVERITY, severity);
+				int start = classElement.getStartOffset();
+				if (classElement.getStartStructuredDocumentRegion() != null && classElement.getEndStructuredDocumentRegion() != null)
+					start = classElement.getStartStructuredDocumentRegion().getEndOffset();
+				markerValues.put(IMarker.CHAR_START, new Integer(start));
+				int end = classElement.getEndOffset();
+				if (classElement.getStartStructuredDocumentRegion() != null && classElement.getEndStructuredDocumentRegion() != null)
+					end = classElement.getEndStructuredDocumentRegion().getStartOffset();
+				markerValues.put(IMarker.CHAR_END, new Integer(end));
+				int line = classElement.getStructuredDocument().getLineOfOffset(start);
+				markerValues.put(IMarker.LINE_NUMBER, new Integer(line + 1));
+				markerValues.put(IMarker.MESSAGE, NLS.bind(errorMessage, (errorMessage.indexOf("{1}") >= 0) ? new String[]{getTagName(classSpecifier), className} : new String[]{className})); //$NON-NLS-1$
+				return markerValues;
+			}
+		}
+		return null;
+	}
+
+	private Map[] detectProblems(IJavaProject javaProject, IFile tld, IScopeContext[] preferenceScopes) throws CoreException {
+		List problems = new ArrayList();
+
+		IStructuredModel m = null;
+		try {
+			m = StructuredModelManager.getModelManager().getModelForRead(tld);
+			if (m != null && m instanceof IDOMModel) {
+				IDOMDocument document = ((IDOMModel) m).getDocument();
+
+				for (int i = 0; i < classElementNames.length; i++) {
+					NodeList classes = document.getElementsByTagName(classElementNames[i]);
+					for (int j = 0; j < classes.getLength(); j++) {
+						Map problem = checkClass(javaProject, classes.item(j), preferenceScopes, missingClassSeverityPreferenceKeys[i], missingClassMessages[i]);
+						if (problem != null)
+							problems.add(problem);
+					}
+				}
+
+			}
+		}
+		catch (IOException e) {
+			Logger.logException(e);
+		}
+		finally {
+			if (m != null)
+				m.releaseFromRead();
+		}
+
+		return (Map[]) problems.toArray(new Map[problems.size()]);
+	}
+
+	Integer getMessageSeverity(IScopeContext[] preferenceScopes, String key) {
+		int sev = fPreferencesService.getInt(PREFERENCE_NODE_QUALIFIER, key, IMessage.NORMAL_SEVERITY, preferenceScopes);
+		switch (sev) {
+			case ValidationMessage.ERROR :
+				return new Integer(IMarker.SEVERITY_ERROR);
+			case ValidationMessage.WARNING :
+				return new Integer(IMarker.SEVERITY_WARNING);
+			case ValidationMessage.INFORMATION :
+				return new Integer(IMarker.SEVERITY_INFO);
+			case ValidationMessage.IGNORE :
+				return null;
+		}
+		return new Integer(IMarker.SEVERITY_WARNING);
+	}
+
+	private String getTagName(Node classSpecifier) {
+		Node tagElement = classSpecifier.getParentNode();
+		Node child = tagElement.getFirstChild();
+		while (child != null) {
+			if (child.getNodeType() == Node.ELEMENT_NODE) {
+				String name = child.getNodeName();
+				if (JSP11TLDNames.NAME.equals(name))
+					return getTextContents(child);
+			}
+			child = child.getNextSibling();
+		}
+		return "";
+	}
+
+	private String getTextContents(Node parent) {
+		NodeList children = parent.getChildNodes();
+		if (children.getLength() == 1) {
+			return children.item(0).getNodeValue().trim();
+		}
+		StringBuffer s = new StringBuffer();
+		Node child = parent.getFirstChild();
+		while (child != null) {
+			s.append(child.getNodeValue().trim());
+			child = child.getNextSibling();
+		}
+		return s.toString().trim();
+	}
+
+	public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
+		if (resource.getType() != IResource.FILE)
+			return null;
+		ValidationResult result = new ValidationResult();
+
+		IFile tld = (IFile) resource;
+		if (tld.isAccessible()) {
+			try {
+				final IJavaProject javaProject = JavaCore.create(tld.getProject());
+				if (javaProject.exists()) {
+					IScopeContext[] scopes = new IScopeContext[]{new InstanceScope(), new DefaultScope()};
+					ProjectScope projectScope = new ProjectScope(tld.getProject());
+					if (projectScope.getNode(PREFERENCE_NODE_QUALIFIER).getBoolean(JSPCorePreferenceNames.VALIDATION_USE_PROJECT_SETTINGS, false)) {
+						scopes = new IScopeContext[]{projectScope, new InstanceScope(), new DefaultScope()};
+					}
+					Map[] problems = detectProblems(javaProject, tld, scopes);
+					for (int i = 0; i < problems.length; i++) {
+						ValidatorMessage message = ValidatorMessage.create(problems[i].get(IMarker.MESSAGE).toString(), resource);
+						message.setType(MARKER_TYPE);
+						message.setAttributes(problems[i]);
+						result.add(message);
+					}
+				}
+			}
+			catch (Exception e) {
+				Logger.logException(e);
+			}
+		}
+
+		return result;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/jspel/ELProblem.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/jspel/ELProblem.java
index cb548c0..ef95d18 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/jspel/ELProblem.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/jspel/ELProblem.java
@@ -13,22 +13,78 @@
 package org.eclipse.jst.jsp.core.jspel;
 
 import org.eclipse.jface.text.Position;
+import org.eclipse.jst.jsp.core.internal.java.IJSPProblem;
 
-public class ELProblem {
+/**
+ * All ELProblems are currently assumed to be errors.
+ */
+public class ELProblem implements IJSPProblem {
 	private Position fPos;
 	private String fMessage;
-	
+	private int fId = IJSPProblem.ELProblem;
+
+	/**
+	 * @param pos should be relative to the JSP document the error is to be reported on
+	 * @param message
+	 */
 	public ELProblem(Position pos, String message)	{
 		fPos = pos;
 		fMessage = message;
 	}
+
+	public ELProblem(Position pos, String message, int id)	{
+		fPos = pos;
+		fMessage = message;
+		fId = id;
+	}
 	
 	public String getMessage() {
 		return fMessage;
 	}
 	
-
 	public Position getPosition() {
 		return fPos;
 	}
+
+	public String[] getArguments() {
+		return null;
+	}
+
+	public int getID() {
+		return fId;
+	}
+	
+	public int getEID() {
+		return fId;
+	}
+
+	public char[] getOriginatingFileName() {
+		return null;
+	}
+
+	public int getSourceEnd() {
+		return fPos.getOffset() + fPos.getLength();
+	}
+
+	public int getSourceLineNumber() {
+		return 0;
+	}
+
+	public int getSourceStart() {
+		return fPos.getOffset();
+	}
+
+	public boolean isError() {
+		return true;
+	}
+
+	public boolean isWarning() {
+		return false;
+	}
+
+	public void setSourceEnd(int sourceEnd) {}
+
+	public void setSourceLineNumber(int lineNumber) {}
+
+	public void setSourceStart(int sourceStart) {}
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibIndexDelta.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibIndexDelta.java
index 14b3bb8..c1a611b 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibIndexDelta.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibIndexDelta.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,7 +16,7 @@
 /**
  * Describes changes to the known records within the TaglibIndex.
  * <p>
- * This interface is not intended to be implemented by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
  * </p>
  * 
  * @since 1.2
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibIndexListener.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibIndexListener.java
index b81027e..e4e404c 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibIndexListener.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibIndexListener.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,11 +13,6 @@
 
 /**
  * A listener for changes in the index's records.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * 
- * @since 1.2
  */
 public interface ITaglibIndexListener {
 
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibRecordEvent.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibRecordEvent.java
index c1d17ca..b316511 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibRecordEvent.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ITaglibRecordEvent.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,7 +17,7 @@
  * Describes changes to the known records within the TaglibIndex.
  * 
  * <p>
- * This interface is not intended to be implemented by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
  * </p>
  */
 public interface ITaglibRecordEvent {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java
index 6c24aca..a7f8939 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -25,7 +25,6 @@
 import java.io.Writer;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.net.URLConnection;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Enumeration;
@@ -40,6 +39,7 @@
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipException;
 import java.util.zip.ZipFile;
+import java.util.zip.ZipInputStream;
 
 import org.eclipse.core.filebuffers.FileBuffers;
 import org.eclipse.core.resources.IContainer;
@@ -55,8 +55,11 @@
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.ILock;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jdt.core.IClasspathContainer;
@@ -73,10 +76,12 @@
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP11TLDNames;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP12TLDNames;
 import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache;
+import org.eclipse.jst.jsp.core.internal.java.ArrayMap;
 import org.eclipse.jst.jsp.core.internal.util.DocumentProvider;
 import org.eclipse.jst.jsp.core.internal.util.FacetModuleCoreSupport;
 import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
 import org.eclipse.wst.sse.core.internal.util.JarUtilities;
+import org.eclipse.wst.sse.core.internal.util.Sorter;
 import org.eclipse.wst.sse.core.utils.StringUtils;
 import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
@@ -87,9 +92,76 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
+import com.ibm.icu.text.Collator;
 import com.ibm.icu.util.StringTokenizer;
 
+/**
+ * Contains the tag library information for a single project.
+ * 
+ *  * <p>
+ * This class is neither intended to be instantiated nor accessed by clients.
+ * </p>
+ *
+ */
 class ProjectDescription {
+	class BuildPathJob extends Job {
+		public BuildPathJob() {
+			super("Updating Tag Library Index");
+			setSystem(true);
+			setUser(false);
+		}
+
+		protected IStatus run(IProgressMonitor monitor) {
+			try {
+				LOCK.acquire();
+
+				PackageFragmentRootDelta[] removes = (PackageFragmentRootDelta[]) fPackageFragmentRootsRemoved.values().toArray(new PackageFragmentRootDelta[fPackageFragmentRootsRemoved.size()]);
+				for (int i = 0; i < removes.length; i++) {
+					handleElementChanged(removes[i].elementPath, removes[i].deltaKind, removes[i].isExported);
+				}
+				fPackageFragmentRootsRemoved.clear();
+				if (monitor.isCanceled())
+					return Status.OK_STATUS;
+				
+				PackageFragmentRootDelta[] changes = (PackageFragmentRootDelta[]) fPackageFragmentRootsChanged.values().toArray(new PackageFragmentRootDelta[fPackageFragmentRootsChanged.size()]);
+				for (int i = 0; i < changes.length; i++) {
+					handleElementChanged(changes[i].elementPath, changes[i].deltaKind, changes[i].isExported);
+				}
+				fPackageFragmentRootsChanged.clear();
+				if (monitor.isCanceled())
+					return Status.OK_STATUS;
+				
+				PackageFragmentRootDelta[] adds = (PackageFragmentRootDelta[]) fPackageFragmentRootsAdded.values().toArray(new PackageFragmentRootDelta[fPackageFragmentRootsAdded.size()]);
+				for (int i = 0; i < adds.length; i++) {
+					handleElementChanged(adds[i].elementPath, adds[i].deltaKind, adds[i].isExported);
+				}
+				fPackageFragmentRootsAdded.clear();
+			}
+			finally {
+				LOCK.release();
+			}
+			TaglibIndex.getInstance().fireCurrentDelta(BuildPathJob.this);
+			return Status.OK_STATUS;
+		}
+	}
+	
+	class PackageFragmentRootDelta {
+		PackageFragmentRootDelta(IPath path, int kind, boolean exported) {
+			super();
+			elementPath = path;
+			deltaKind = kind;
+			isExported = exported;
+		}
+
+		/*
+			IJavaElementDelta.F_ADDED_TO_CLASSPATH
+			IJavaElementDelta.F_ARCHIVE_CONTENT_CHANGED
+			IJavaElementDelta.F_REMOVED_FROM_CLASSPATH
+		*/ 
+		int deltaKind;
+		IPath elementPath;
+		boolean isExported;
+	}
 
 	class DeltaVisitor implements IResourceDeltaVisitor {
 		public boolean visit(IResourceDelta delta) throws CoreException {
@@ -324,7 +396,7 @@
 		}
 
 		public String toString() {
-			return "TaglibInfo|" + shortName + "|" + tlibVersion + "|" + smallIcon + "|" + largeIcon + "|" + jspVersion + "|" + uri + "|" + description; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
+			return "TaglibInfo|" + uri + "|" + shortName + "|" + tlibVersion + "|" + smallIcon + "|" + largeIcon + "|" + jspVersion + "|" + description; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
 		}
 	}
 
@@ -475,6 +547,36 @@
 			return s.toString();
 		}
 	}
+	
+	private class TaglibSorter extends Sorter {
+		Collator collator = Collator.getInstance();
+
+		public boolean compare(Object elementOne, Object elementTwo) {
+			/**
+			 * Returns true if elementTwo is 'greater than' elementOne This is
+			 * the 'ordering' method of the sort operation. Each subclass
+			 * overides this method with the particular implementation of the
+			 * 'greater than' concept for the objects being sorted.
+			 */
+			
+			return (collator.compare(getTaglibPath((ITaglibRecord) elementOne), getTaglibPath((ITaglibRecord) elementTwo))) < 0;
+		}
+		
+		private String getTaglibPath(ITaglibRecord record) {
+			switch(record.getRecordType()) {
+				case ITaglibRecord.JAR:
+					return ((JarRecord) record).getLocation().toString();
+				case ITaglibRecord.TAGDIR:
+					return ((TagDirRecord) record).getPath().toString();
+				case ITaglibRecord.TLD:
+					return ((TLDRecord) record).getPath().toString();
+				case ITaglibRecord.URL:
+					return ((URLRecord) record).getBaseLocation();
+				default:
+					return ""; //$NON-NLS-1$
+			}
+		}
+	}
 
 	static boolean _debugIndexCreation = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/taglib/indexcreation")); //$NON-NLS-1$ //$NON-NLS-2$
 	static boolean _debugIndexTime = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/taglib/indextime")); //$NON-NLS-1$ //$NON-NLS-2$
@@ -482,7 +584,7 @@
 	private static final String BUILDPATH_DIRTY = "BUILDPATH_DIRTY"; //$NON-NLS-1$
 	private static final String BUILDPATH_ENTRIES = "BUILDPATH_ENTRIES"; //$NON-NLS-1$
 	private static final String BUILDPATH_PROJECT = "BUILDPATH_PROJECT"; //$NON-NLS-1$
-	private static final String SAVE_FORMAT_VERSION = "Tag Library Index 1.0.3"; //$NON-NLS-1$
+	private static final String SAVE_FORMAT_VERSION = "Tag Library Index 1.1.0"; //$NON-NLS-1$
 	private static final String WEB_INF = "WEB-INF"; //$NON-NLS-1$
 	private static final IPath WEB_INF_PATH = new Path(WEB_INF);
 	private static final String WEB_XML = "web.xml"; //$NON-NLS-1$
@@ -539,10 +641,17 @@
 
 	IResourceDeltaVisitor fVisitor;
 	Hashtable fWebXMLReferences;
+	
+	private Map fPackageFragmentRootsAdded = new HashMap();
+	private Map fPackageFragmentRootsChanged = new HashMap();
+	private Map fPackageFragmentRootsRemoved = new HashMap();
 
 	ILock LOCK = Job.getJobManager().newLock();
 
 	private long time0;
+	
+	private TaglibSorter fTaglibSorter = new TaglibSorter();
+	private BuildPathJob fBuildPathJob = new BuildPathJob();
 
 	ProjectDescription(IProject project, String saveStateFile) {
 		super();
@@ -625,7 +734,7 @@
 					Iterator implicitRecords = rootReferences[j].values().iterator();
 					while (implicitRecords.hasNext()) {
 						ITaglibRecord record = (ITaglibRecord) implicitRecords.next();
-						if (record.getRecordType() == ITaglibRecord.TLD && ((ITLDRecord) record).getURI() != null) {
+						if (record.getRecordType() == ITaglibRecord.TLD && ((ITLDRecord) record).getURI() != null && ((ITLDRecord) record).getURI().length() > 0) {
 							references.put(((ITLDRecord) record).getURI(), record);
 						}
 					}
@@ -688,6 +797,7 @@
 			}
 			catch (MalformedURLException e) {
 				// not worth reporting
+				Logger.log(Logger.ERROR_DEBUG, null, e);
 			}
 			if (fileLocation != null) {
 				JarRecord jarRecord = createJARRecord(fileLocation);
@@ -711,6 +821,7 @@
 								contents.close();
 							}
 							catch (IOException e) {
+								Logger.log(Logger.ERROR_DEBUG, null, e);
 							}
 						}
 					}
@@ -726,42 +837,18 @@
 		// The rest are URLs into a plug-in...somewhere
 		else {
 			URL url = null;
-			ByteArrayInputStream cachedContents = null;
 			InputStream tldStream = null;
 			try {
 				url = new URL(urlString);
-				URLConnection connection = url.openConnection();
-				connection.setDefaultUseCaches(false);
-				tldStream = connection.getInputStream();
+				tldStream = JarUtilities.getInputStream(url);
 			}
 			catch (Exception e1) {
 				Logger.logException("Exception reading TLD contributed to the XML Catalog", e1);
 			}
 
 			if (tldStream != null) {
-				int c;
-				ByteArrayOutputStream buffer = new ByteArrayOutputStream();
-				// array dim restriction?
-				byte bytes[] = new byte[2048];
-				try {
-					while ((c = tldStream.read(bytes)) >= 0) {
-						buffer.write(bytes, 0, c);
-					}
-					cachedContents = new ByteArrayInputStream(buffer.toByteArray());
-				}
-				catch (IOException ioe) {
-					// no cleanup can be done
-				}
-				finally {
-					try {
-						tldStream.close();
-					}
-					catch (IOException e) {
-					}
-				}
-
 				URLRecord urlRecord = null;
-				TaglibInfo info = extractInfo(urlString, cachedContents);
+				TaglibInfo info = extractInfo(urlString, tldStream);
 				if (info != null) {
 					/*
 					 * the record's reported URI should match the catalog
@@ -774,9 +861,10 @@
 					urlRecord.url = url; //$NON-NLS-1$ //$NON-NLS-2$
 				}
 				try {
-					cachedContents.close();
+					tldStream.close();
 				}
 				catch (IOException e) {
+					Logger.log(Logger.ERROR_DEBUG, null, e);
 				}
 				record = urlRecord;
 			}
@@ -804,7 +892,7 @@
 		JarRecord record = new JarRecord();
 		record.info = new TaglibInfo();
 		record.location = new Path(fileLocation);
-		record.urlRecords = new ArrayList(0);
+		record.urlRecords = new ArrayList();
 		return record;
 	}
 
@@ -869,7 +957,7 @@
 		InputStream contents = null;
 		try {
 			if (tld.isAccessible()) {
-				contents = ((IFile) tld).getContents(true);
+				contents = ((IFile) tld).getContents();
 				String basePath = tld.getFullPath().toString();
 				TaglibInfo info = extractInfo(basePath, contents);
 				if (info != null) {
@@ -878,7 +966,7 @@
 			}
 		}
 		catch (CoreException e) {
-			Logger.logException(e);
+			// out of sync
 		}
 		finally {
 			try {
@@ -888,40 +976,63 @@
 			}
 			catch (IOException e) {
 				// ignore
+				Logger.log(Logger.ERROR_DEBUG, null, e);
 			}
 		}
 		return record;
 	}
 
 	private void ensureUpTodate() {
-		try {
-			LOCK.acquire();
-
-			if (!fBuildPathIsDirty) {
+		IClasspathEntry[] entries = null;
+			try {
+				/*
+				 * If the Java nature isn't present (or something else is
+				 * wrong), don't check the build path.
+				 */
+				IJavaProject jproject = JavaCore.create(fProject);
+				if (jproject != null && jproject.exists()) {
+					entries = jproject.getResolvedClasspath(true);
+				}
+			}
+			catch (JavaModelException e) {
+				Logger.logException(e);
+			}
+		if (entries != null) {
+			try {
+				LOCK.acquire();
 				/*
 				 * Double-check that the number of build path entries has not
 				 * changed. This should cover most cases such as when a
 				 * library is added into or removed from a container.
 				 */
-				try {
-					IJavaProject jproject = JavaCore.create(fProject);
-					if (jproject != null && jproject.exists()) {
-						IClasspathEntry[] entries = jproject.getResolvedClasspath(true);
-						fBuildPathIsDirty = (fBuildPathEntryCount != entries.length);
+				fBuildPathIsDirty = fBuildPathIsDirty || (fBuildPathEntryCount != entries.length);
+
+				if (fBuildPathIsDirty) {
+					indexClasspath(entries);
+					fBuildPathIsDirty = false;
+				}
+				else {
+					PackageFragmentRootDelta[] removes = (PackageFragmentRootDelta[]) fPackageFragmentRootsRemoved.values().toArray(new PackageFragmentRootDelta[fPackageFragmentRootsRemoved.size()]);
+					for (int i = 0; i < removes.length; i++) {
+						handleElementChanged(removes[i].elementPath, removes[i].deltaKind, removes[i].isExported);
 					}
-				}
-				catch (JavaModelException e) {
-					Logger.logException(e);
+					PackageFragmentRootDelta[] changes = (PackageFragmentRootDelta[]) fPackageFragmentRootsChanged.values().toArray(new PackageFragmentRootDelta[fPackageFragmentRootsChanged.size()]);
+					for (int i = 0; i < changes.length; i++) {
+						handleElementChanged(changes[i].elementPath, changes[i].deltaKind, changes[i].isExported);
+					}
+					PackageFragmentRootDelta[] adds = (PackageFragmentRootDelta[]) fPackageFragmentRootsAdded.values().toArray(new PackageFragmentRootDelta[fPackageFragmentRootsAdded.size()]);
+					for (int i = 0; i < adds.length; i++) {
+						handleElementChanged(adds[i].elementPath, adds[i].deltaKind, adds[i].isExported);
+					}
+					fPackageFragmentRootsRemoved.clear();
+					fPackageFragmentRootsChanged.clear();
+					fPackageFragmentRootsAdded.clear();
 				}
 			}
-			if (fBuildPathIsDirty) {
-				indexClasspath();
-				fBuildPathIsDirty = false;
+			finally {
+				LOCK.release();
 			}
 		}
-		finally {
-			LOCK.release();
-		}
 	}
 
 	private TaglibInfo extractInfo(String basePath, InputStream tldContents) {
@@ -978,7 +1089,7 @@
 			LOCK.acquire();
 
 			Collection implicitReferences = new HashSet(getImplicitReferences(path.toString()).values());
-			records = new ArrayList(fTLDReferences.size() + fTagDirReferences.size() + fJARReferences.size() + fWebXMLReferences.size());
+			records = new HashSet(fTLDReferences.size() + fTagDirReferences.size() + fJARReferences.size() + fWebXMLReferences.size());
 			records.addAll(fTLDReferences.values());
 			if (jspVersion >= 1.1) {
 				records.addAll(_getJSP11AndWebXMLJarReferences(fJARReferences.values()));
@@ -992,10 +1103,19 @@
 				projectsProcessed.add(fProject);
 				addBuildPathReferences(buildPathReferences, projectsProcessed, false);
 				records.addAll(buildPathReferences.values());
+				
+				if(path.segmentCount() > 1) {
+					records.addAll(new HashSet(getImplicitReferences(fProject.getFullPath().toString()).values()));
+				}
 			}
 			if (jspVersion >= 2.0) {
 				records.addAll(fTagDirReferences.values());
 			}
+			
+			IPath localWebXML = new Path(getLocalRoot(path.toString())).append("/WEB-INF/web.xml"); //$NON-NLS-1$ 
+			WebXMLRecord webxmlRecord = (WebXMLRecord) fWebXMLReferences.get(localWebXML.toString());
+			if(webxmlRecord != null)
+				records.addAll(webxmlRecord.getTLDRecords());
 
 			records.addAll(getCatalogRecords());
 		}
@@ -1039,12 +1159,14 @@
 					}
 					catch (IOException ioe) {
 						// no cleanup can be done
+						Logger.log(Logger.ERROR_DEBUG, null, ioe);
 					}
 					finally {
 						try {
 							entryInputStream.close();
 						}
 						catch (IOException e) {
+							Logger.log(Logger.ERROR_DEBUG, null, e);
 						}
 					}
 				}
@@ -1097,7 +1219,7 @@
 		String localRoot = getLocalRoot(path);
 		Hashtable implicitReferences = (Hashtable) fImplicitReferences.get(localRoot);
 		if (implicitReferences == null) {
-			implicitReferences = new Hashtable(1);
+			implicitReferences = new ArrayMap(1);
 			fImplicitReferences.put(localRoot, implicitReferences);
 		}
 		return implicitReferences;
@@ -1207,6 +1329,16 @@
 		return fVisitor;
 	}
 
+	void handleElementChanged(IPath libraryPath, int deltaKind, boolean exported) {
+		IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(libraryPath);
+		String libraryLocation = null;
+		if (file.isAccessible() && file.getLocation() != null)
+			libraryLocation = file.getLocation().toString();
+		else
+			libraryLocation = libraryPath.toString();
+		updateClasspathLibrary(libraryLocation, deltaKind, exported);
+	}
+	
 	void handleElementChanged(IJavaElementDelta delta) {
 		if (fBuildPathIsDirty) {
 			return;
@@ -1214,6 +1346,12 @@
 
 		// Logger.log(Logger.INFO_DEBUG, "IJavaElementDelta: " + delta);
 		IJavaElement element = delta.getElement();
+		if (element.getElementType() == IJavaElement.JAVA_PROJECT) {
+			IJavaElementDelta[] affectedChildren = delta.getAffectedChildren();
+			for (int i = 0; i < affectedChildren.length; i++) {
+				handleElementChanged(affectedChildren[i]);
+			}
+		}
 		if (element.getElementType() == IJavaElement.PACKAGE_FRAGMENT_ROOT && ((IPackageFragmentRoot) element).isArchive()) {
 			time0 = System.currentTimeMillis();
 			if (element.getElementType() == IJavaElement.PACKAGE_FRAGMENT_ROOT && ((IPackageFragmentRoot) element).isExternal()) {
@@ -1221,7 +1359,16 @@
 			String libLocation = null;
 			int taglibRecordEventKind = -1;
 			if ((delta.getFlags() & IJavaElementDelta.F_ADDED_TO_CLASSPATH) > 0 || (delta.getFlags() & IJavaElementDelta.F_ARCHIVE_CONTENT_CHANGED) > 0 || (delta.getFlags() & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) > 0) {
-				taglibRecordEventKind = ITaglibIndexDelta.ADDED;
+				taglibRecordEventKind = ITaglibIndexDelta.CHANGED;
+				if ((delta.getFlags() & IJavaElementDelta.F_ADDED_TO_CLASSPATH) > 0) {
+					taglibRecordEventKind = ITaglibIndexDelta.ADDED;
+				}
+				else if ((delta.getFlags() & IJavaElementDelta.F_ARCHIVE_CONTENT_CHANGED) > 0) {
+					taglibRecordEventKind = ITaglibIndexDelta.CHANGED;
+				}
+				else if ((delta.getFlags() & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) > 0) {
+					taglibRecordEventKind = ITaglibIndexDelta.REMOVED;
+				}
 				IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(element.getPath());
 				if (file.isAccessible() && file.getLocation() != null)
 					libLocation = file.getLocation().toString();
@@ -1243,7 +1390,7 @@
 					}
 				}
 				catch (JavaModelException e) {
-					Logger.logException("Problem handling build path entry for " + element.getPath(), e); //$NON-NLS-1$
+					// IPackageFragmentRoot not part of the build path
 				}
 				if ((delta.getFlags() & IJavaElementDelta.F_ADDED_TO_CLASSPATH) > 0) {
 					fBuildPathEntryCount++;
@@ -1277,6 +1424,9 @@
 			Logger.log(Logger.INFO, "indexed " + fProject.getName() + " contents in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 	}
 
+	/**
+	 * @deprecated
+	 */
 	void indexClasspath() {
 		if (_debugIndexTime)
 			time0 = System.currentTimeMillis();
@@ -1302,6 +1452,22 @@
 			Logger.log(Logger.INFO, "indexed " + fProject.getName() + " classpath in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 	}
 
+	void indexClasspath(IClasspathEntry[] entries) {
+		if (_debugIndexTime)
+			time0 = System.currentTimeMillis();
+		fClasspathProjects.clear();
+		fClasspathReferences.clear();
+		fClasspathJars.clear();
+
+		fBuildPathEntryCount = entries.length;
+		for (int i = 0; i < entries.length; i++) {
+			indexClasspath(entries[i]);
+		}
+
+		if (_debugIndexTime)
+			Logger.log(Logger.INFO, "indexed " + fProject.getName() + " classpath in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+	}
+
 	/**
 	 * @param entry
 	 */
@@ -1331,9 +1497,21 @@
 						 * table that will e returned to
 						 * getAvailableTaglibRecords().
 						 */
-						IFile libFile = ResourcesPlugin.getWorkspace().getRoot().getFile(libPath);
-						if (libFile != null && libFile.exists()) {
-							updateClasspathLibrary(libFile.getLocation().toString(), ITaglibIndexDelta.ADDED, entry.isExported());
+						IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(libPath);
+						if (resource != null && resource.isAccessible()) {
+							if (resource.getType() == IResource.FILE) {
+								if (resource.getLocation() != null) {
+									updateClasspathLibrary(resource.getLocation().toString(), ITaglibIndexDelta.ADDED, entry.isExported());
+								}
+							}
+							else if (resource.getType() == IResource.FOLDER) {
+								try {
+									resource.accept(new Indexer(), 0);
+								}
+								catch (CoreException e) {
+									Logger.logException(e);
+								}
+							}
 						}
 					}
 				}
@@ -1350,7 +1528,19 @@
 				}
 			}
 				break;
-			case IClasspathEntry.CPE_SOURCE :
+			case IClasspathEntry.CPE_SOURCE : {
+				IPath path = entry.getPath();
+				try {
+					IResource sourceFolder = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
+					// could be a bad .classpath file
+					if(sourceFolder != null) {
+						sourceFolder.accept(new Indexer(), 0);
+					}
+				}
+				catch (CoreException e) {
+					Logger.logException(e);
+				}
+			}
 				break;
 			case IClasspathEntry.CPE_VARIABLE : {
 				IPath libPath = JavaCore.getResolvedVariablePath(entry.getPath());
@@ -1387,7 +1577,7 @@
 	 */
 
 	/**
-	 * @param javaProject
+	 * @deprecated
 	 */
 	private void indexClasspath(IJavaProject javaProject) {
 		if (javaProject == null)
@@ -1407,6 +1597,61 @@
 			}
 		}
 	}
+	
+	void queueElementChanged(IJavaElementDelta delta) {
+		try {
+			LOCK.acquire();
+			IJavaElement element = delta.getElement();
+			if (element.getElementType() == IJavaElement.JAVA_PROJECT) {
+				IJavaElementDelta[] affectedChildren = delta.getAffectedChildren();
+				for (int i = 0; i < affectedChildren.length; i++) {
+					queueElementChanged(affectedChildren[i]);
+				}
+			}
+			if (element.getElementType() == IJavaElement.PACKAGE_FRAGMENT_ROOT && ((IPackageFragmentRoot) element).isArchive()) {
+				IPath path = element.getPath();
+				boolean fragmentisExported = true;
+				try {
+					IClasspathEntry rawClasspathEntry = ((IPackageFragmentRoot) element).getRawClasspathEntry();
+					/*
+					 * null may also be returned for deletions depending on
+					 * resource/build path notification order. If it's null,
+					 * it's been deleted and whether it's exported won't
+					 * really matter
+					 */
+					if (rawClasspathEntry != null) {
+						fragmentisExported = rawClasspathEntry.isExported();
+					}
+				}
+				catch (JavaModelException e) {
+					// IPackageFragmentRoot not part of the build path
+				}
+				String key = path.toString();
+				if ((delta.getFlags() & IJavaElementDelta.F_ADDED_TO_CLASSPATH) > 0) {
+					fPackageFragmentRootsAdded.put(key, new PackageFragmentRootDelta(path, ITaglibIndexDelta.ADDED, fragmentisExported));
+					fPackageFragmentRootsChanged.remove(key);
+					fPackageFragmentRootsRemoved.remove(key);
+					fBuildPathEntryCount++;
+				}
+				else if ((delta.getFlags() & IJavaElementDelta.F_ARCHIVE_CONTENT_CHANGED) > 0) {
+					fPackageFragmentRootsChanged.put(key, new PackageFragmentRootDelta(path, ITaglibIndexDelta.CHANGED, fragmentisExported));
+				}
+				else if ((delta.getFlags() & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) > 0) {
+					fPackageFragmentRootsAdded.remove(key);
+					fPackageFragmentRootsChanged.remove(key);
+					fPackageFragmentRootsRemoved.put(key, new PackageFragmentRootDelta(path, ITaglibIndexDelta.REMOVED, fragmentisExported));
+					fBuildPathEntryCount--;
+				}
+			}
+		}
+		finally {
+			LOCK.release();
+		}
+
+		fBuildPathJob.cancel();
+		fBuildPathJob.schedule(2000);
+	}
+
 
 	private String readTextofChild(Node node, String childName) {
 		NodeList children = node.getChildNodes();
@@ -1427,7 +1672,7 @@
 			URLRecord[] records = (URLRecord[]) record.getURLRecords().toArray(new URLRecord[0]);
 			for (int i = 0; i < records.length; i++) {
 				TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, records[i], ITaglibIndexDelta.REMOVED));
-				getImplicitReferences(jar.getFullPath().toString()).remove(records[i].getURI());
+				((ArrayMap) getImplicitReferences(jar.getFullPath().toString())).remove(records[i].getURI(), records[i]);
 			}
 			if (record.has11TLD) {
 				TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, record, ITaglibIndexDelta.REMOVED));
@@ -1459,7 +1704,7 @@
 		TLDRecord record = (TLDRecord) fTLDReferences.remove(tld.getFullPath().toString());
 		if (record != null) {
 			if (record.getURI() != null) {
-				getImplicitReferences(tld.getFullPath().toString()).remove(record.getURI());
+				((ArrayMap) getImplicitReferences(tld.getFullPath().toString())).remove(record.getURI(), record);
 			}
 			TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, record, ITaglibIndexDelta.REMOVED));
 		}
@@ -1474,11 +1719,20 @@
 			for (int i = 0; i < records.length; i++) {
 				if (_debugIndexCreation)
 					Logger.log(Logger.INFO, "removed record for " + records[i].getURI() + "@" + records[i].path); //$NON-NLS-1$ //$NON-NLS-2$
-				getImplicitReferences(webxml.getFullPath().toString()).remove(records[i].getURI());
+				((ArrayMap) getImplicitReferences(webxml.getFullPath().toString())).remove(records[i].getURI(), records[i]);
 				TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, records[i], ITaglibIndexDelta.REMOVED));
 			}
 		}
 	}
+	
+	private boolean requestedRefresh() {
+		boolean requested = false;
+		String[] commandLineArgs = Platform.getCommandLineArgs();
+		for (int i = 0; i < commandLineArgs.length; i++) {
+			requested = requested || "-refresh".equals(commandLineArgs[i]); //$NON-NLS-1$ 
+		}
+		return requested;
+	}
 
 	/**
 	 * @param basePath
@@ -1515,31 +1769,52 @@
 
 			LOCK.acquire();
 
+			String localRoot = getLocalRoot(basePath);
 			/**
 			 * Workaround for problem in URIHelper; uris starting with '/' are
 			 * returned as-is.
 			 */
 			if (path == null) {
 				if (reference.startsWith("/")) { //$NON-NLS-1$
-					path = getLocalRoot(basePath) + reference;
+					path = localRoot + reference;
 				}
 				else {
-					path = URIHelper.normalize(reference, basePath, getLocalRoot(basePath));
+					path = URIHelper.normalize(reference, basePath, localRoot);
 				}
 			}
 
-			// order dictated by JSP spec 2.0 section 7.2.3
-			record = (ITaglibRecord) fJARReferences.get(path);
-
-			// only if 1.1 TLD was found
-			if (jspVersion < 1.1 || (record instanceof JarRecord && !((JarRecord) record).has11TLD)) {
-				record = null;
+			IPath localWebXML = new Path(localRoot).append("/WEB-INF/web.xml"); //$NON-NLS-1$ 
+			WebXMLRecord webxmlRecord = (WebXMLRecord) fWebXMLReferences.get(localWebXML.toString());
+			if (webxmlRecord != null) {
+				for (int i = 0; i < webxmlRecord.tldRecords.size(); i++) {
+					ITaglibRecord record2 = (ITaglibRecord) webxmlRecord.tldRecords.get(i);
+					ITaglibDescriptor descriptor = record2.getDescriptor();
+					if (reference.equals(descriptor.getURI())) {
+						record = record2;
+					}
+				}
 			}
+
+			if (record == null) {
+				// order dictated by JSP spec 2.0 section 7.2.3
+				record = (ITaglibRecord) fJARReferences.get(path);
+
+				// only if 1.1 TLD was found
+				if (jspVersion < 1.1 || (record instanceof JarRecord && !((JarRecord) record).has11TLD)) {
+					record = null;
+				}
+			}
+			
 			if (record == null) {
 				record = (ITaglibRecord) fTLDReferences.get(path);
 			}
 			if (record == null && jspVersion >= 1.2) {
-				record = (ITaglibRecord) getImplicitReferences(basePath).get(reference);
+				Object[] records = (Object[]) getImplicitReferences(basePath).get(reference);
+				if (records != null && records.length > 0) {
+					if (records.length > 1)
+						records = fTaglibSorter.sort(records);
+					record =  (ITaglibRecord) records[records.length - 1];
+				}
 			}
 
 
@@ -1557,7 +1832,7 @@
 				addBuildPathReferences(buildPathReferences, projectsProcessed, false);
 				record = (ITaglibRecord) buildPathReferences.get(reference);
 			}
-
+			
 			// Check the XML Catalog
 			if (record == null) {
 				ICatalog catalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
@@ -1583,19 +1858,36 @@
 					}
 				}
 			}
-
+			
 			/*
 			 * If no records were found and no local-root applies, check ALL
 			 * of the web.xml files as a fallback
 			 */
-			if (record == null && fProject.getFullPath().toString().equals(getLocalRoot(basePath))) {
+			if (record == null && fProject.getFullPath().toString().equals(localRoot)) {
 				WebXMLRecord[] webxmls = (WebXMLRecord[]) fWebXMLReferences.values().toArray(new WebXMLRecord[0]);
 				for (int i = 0; i < webxmls.length; i++) {
 					if (record != null)
 						continue;
-					record = (ITaglibRecord) getImplicitReferences(webxmls[i].path.toString()).get(reference);
+					Object[] records = (Object[]) getImplicitReferences(webxmls[i].path.toString()).get(reference);
+					if (records != null && records.length > 0) {
+						if (records.length > 1)
+							records = fTaglibSorter.sort(records);
+						record =  (ITaglibRecord) records[records.length - 1];
+					}
 				}
 			}
+			/*
+			 * If no records were found, check the implicit references on the project itself as a fallback
+			 */
+			if (record == null && jspVersion >= 1.2) {
+				Object[] records = (Object[]) getImplicitReferences(fProject.getFullPath().toString()).get(reference);
+				if (records != null && records.length > 0) {
+					if (records.length > 1)
+						records = fTaglibSorter.sort(records);
+					record =  (ITaglibRecord) records[records.length - 1];
+				}
+			}
+
 		}
 		finally {
 			LOCK.release();
@@ -1617,7 +1909,7 @@
 			// ================ test reload time ========================
 			boolean restored = false;
 			File savedState = new File(fSaveStateFilename);
-			if (savedState.exists()) {
+			if (savedState.exists() && !requestedRefresh()) {
 				Reader reader = null;
 				try {
 					time0 = System.currentTimeMillis();
@@ -1696,6 +1988,7 @@
 													contents.close();
 												}
 												catch (IOException e) {
+													Logger.log(Logger.ERROR_DEBUG, null, e);
 												}
 											}
 										}
@@ -1703,8 +1996,7 @@
 										fClasspathJars.put(libraryLocation, libraryRecord);
 									}
 									else if ("URL".equalsIgnoreCase(tokenType) && libraryRecord != null) { //$NON-NLS-1$
-										// relies on a previously declared JAR
-										// record
+										// relies on a previously declared JAR record
 										boolean exported = Boolean.valueOf(toker.nextToken()).booleanValue();
 										// make the rest the URL
 										String urlString = toker.nextToken();
@@ -1714,53 +2006,27 @@
 										urlString = urlString.trim();
 										// Append a URLrecord
 										URLRecord urlRecord = new URLRecord();
-										urlRecord.url = new URL(urlString); //$NON-NLS-1$ //$NON-NLS-2$
+										urlRecord.url = new URL(urlString);
 										urlRecord.isExported = exported;
 										urlRecord.baseLocation = libraryRecord.location.toString();
-										libraryRecord.urlRecords.add(urlRecord);
 
-										ByteArrayInputStream cachedContents = null;
-										InputStream tldStream = null;
-										try {
-											URLConnection connection = urlRecord.url.openConnection();
-											connection.setDefaultUseCaches(false);
-											tldStream = connection.getInputStream();
-										}
-										catch (IOException e1) {
-											Logger.logException(e1);
-										}
-
-										int c;
-										ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream();
-										// array dim restriction?
-										byte bytes[] = new byte[2048];
-										try {
-											while ((c = tldStream.read(bytes)) >= 0) {
-												byteArrayOutput.write(bytes, 0, c);
+										InputStream tldStream = JarUtilities.getInputStream(urlRecord.url);
+										if(tldStream != null) {
+											libraryRecord.urlRecords.add(urlRecord);
+											TaglibInfo info = extractInfo(urlRecord.url.toString(), tldStream);
+											if (info != null) {
+												urlRecord.info = info;
 											}
-											cachedContents = new ByteArrayInputStream(byteArrayOutput.toByteArray());
-										}
-										catch (IOException ioe) {
-											// no cleanup can be done
-										}
-										finally {
 											try {
 												tldStream.close();
 											}
 											catch (IOException e) {
+												Logger.log(Logger.ERROR_DEBUG, null, e);
+											}
+											if (urlRecord.getURI() != null && urlRecord.getURI().length() > 0) {
+												fClasspathReferences.put(urlRecord.getURI(), urlRecord);
 											}
 										}
-
-										TaglibInfo info = extractInfo(urlRecord.url.toString(), cachedContents);
-										if (info != null) {
-											urlRecord.info = info;
-										}
-										try {
-											cachedContents.close();
-										}
-										catch (IOException e) {
-										}
-										fClasspathReferences.put(urlRecord.getURI(), urlRecord);
 									}
 									else if (BUILDPATH_PROJECT.equalsIgnoreCase(tokenType)) {
 										String projectName = toker.nextToken();
@@ -1787,7 +2053,7 @@
 							restored = true;
 						}
 						else {
-							Logger.log(Logger.INFO, "Tag Library Index: different cache format found, was \"" + lineText + "\", supports \"" + SAVE_FORMAT_VERSION + "\", reindexing build path"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+							Logger.log(Logger.INFO_DEBUG, "Tag Library Index: different cache format found, was \"" + lineText + "\", supports \"" + SAVE_FORMAT_VERSION + "\", reindexing build path"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 						}
 					}
 					if (_debugIndexTime)
@@ -1804,6 +2070,7 @@
 							reader.close();
 						}
 						catch (IOException e) {
+							Logger.log(Logger.ERROR_DEBUG, null, e);
 						}
 					}
 				}
@@ -1829,7 +2096,7 @@
 
 		/**
 		 * <pre>
-		 *                     		 1.0.1
+		 *                     		 1.1.0
 		 *                     		 Save classpath information (| is field delimiter)
 		 *                     		 Jars are saved as &quot;JAR:&quot;+ has11TLD + jar path 
 		 *                     		 URLRecords as &quot;URL:&quot;+URL
@@ -1875,6 +2142,7 @@
 			}
 		}
 		catch (IOException e) {
+			Logger.log(Logger.ERROR_DEBUG, null, e);
 		}
 		finally {
 			try {
@@ -1883,6 +2151,7 @@
 				}
 			}
 			catch (Exception e) {
+				Logger.log(Logger.ERROR_DEBUG, null, e);
 			}
 		}
 
@@ -1911,6 +2180,7 @@
 			}
 		}
 		if (deltaKind == ITaglibIndexDelta.ADDED || deltaKind == ITaglibIndexDelta.CHANGED) {
+			// XXX: runs on folders as well?!
 			libraryRecord = createJARRecord(libraryLocation);
 			libraryRecord.isExported = isExported;
 			fClasspathJars.put(libraryLocation, libraryRecord);
@@ -1938,8 +2208,14 @@
 										urlRecord.isExported = isExported;
 										urlRecord.url = new URL("jar:file:" + libraryLocation + "!/" + z.getName()); //$NON-NLS-1$ //$NON-NLS-2$
 										libraryRecord.urlRecords.add(urlRecord);
-										TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, urlRecord, deltaKind));
+										int urlDeltaKind = ITaglibIndexDelta.ADDED;
+										if (fClasspathReferences.containsKey(urlRecord.getURI())) {
+											// TODO: not minimized enough
+											urlDeltaKind = ITaglibIndexDelta.CHANGED;
+										}
 										fClasspathReferences.put(urlRecord.getURI(), urlRecord);
+										TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, urlRecord, urlDeltaKind));
+										fClasspathReferences.put(info.uri, urlRecord);
 										if (_debugIndexCreation)
 											Logger.log(Logger.INFO, "created record for " + urlRecord.getURI() + "@" + urlRecord.getURL()); //$NON-NLS-1$ //$NON-NLS-2$
 									}
@@ -1952,6 +2228,7 @@
 									contents.close();
 								}
 								catch (IOException e) {
+									Logger.log(Logger.ERROR_DEBUG, null, e);
 								}
 							}
 						}
@@ -1982,51 +2259,60 @@
 			jarLocationString = jar.getLocation().toString();
 		else
 			jarLocationString = jar.getLocationURI().toString();
-		String[] entries = JarUtilities.getEntryNames(jar);
 		JarRecord jarRecord = createJARRecord(jar);
 		fJARReferences.put(jar.getFullPath().toString(), jarRecord);
-		for (int i = 0; i < entries.length; i++) {
-			if (entries[i].endsWith(".tld")) { //$NON-NLS-1$
-				if (entries[i].equals(JarUtilities.JSP11_TAGLIB)) {
-					jarRecord.has11TLD = true;
-				}
-				InputStream contents = JarUtilities.getInputStream(jar, entries[i]);
-				if (contents != null) {
-					TaglibInfo info = extractInfo(jarLocationString, contents);
-
-					if (info != null && info.uri != null && info.uri.length() > 0) {
-						URLRecord record = new URLRecord();
-						record.info = info;
-						record.baseLocation = jarLocationString;
-						try {
-							record.url = new URL("jar:file:" + jarLocationString + "!/" + entries[i]); //$NON-NLS-1$ //$NON-NLS-2$
-							jarRecord.urlRecords.add(record);
-
-							int taglibDeltaKind = ITaglibIndexDelta.ADDED;
-							Hashtable table = getImplicitReferences(jar.getFullPath().toString());
-							if (table != null && table.get(record.getURI()) != null) {
-								taglibDeltaKind = ITaglibIndexDelta.CHANGED;
+		ZipInputStream zip = getZipInputStream(jar);
+		if(zip != null) {
+			try {
+				ZipEntry entry;
+				while ((entry = zip.getNextEntry()) != null) {
+					if (entry.getName().endsWith(".tld")) { //$NON-NLS-1$
+						if (entry.getName().equals(JarUtilities.JSP11_TAGLIB)) {
+							jarRecord.has11TLD = true;
+						}
+						InputStream contents = copyZipEntry(zip);
+						if (contents != null) {
+							TaglibInfo info = extractInfo(jarLocationString, contents);
+		
+							if (info != null && info.uri != null && info.uri.length() > 0) {
+								URLRecord record = new URLRecord();
+								record.info = info;
+								record.baseLocation = jarLocationString;
+								try {
+									record.url = new URL("jar:file:" + jarLocationString + "!/" + entry.getName()); //$NON-NLS-1$ //$NON-NLS-2$
+									jarRecord.urlRecords.add(record);
+		
+									int taglibDeltaKind = ITaglibIndexDelta.ADDED;
+									Hashtable table = getImplicitReferences(jar.getFullPath().toString());
+									if (table != null && table.get(record.getURI()) != null) {
+										taglibDeltaKind = ITaglibIndexDelta.CHANGED;
+									}
+		
+									getImplicitReferences(jar.getFullPath().toString()).put(info.uri, record);
+									TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, record, taglibDeltaKind));
+									if (_debugIndexCreation)
+										Logger.log(Logger.INFO, "created record for " + record.getURI() + "@" + record.getURL()); //$NON-NLS-1$ //$NON-NLS-2$
+								}
+								catch (MalformedURLException e) {
+									// don't record this URI
+									Logger.logException(e);
+								}
 							}
-
-							getImplicitReferences(jar.getFullPath().toString()).put(record.getURI(), record);
-							TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, record, taglibDeltaKind));
-							if (_debugIndexCreation)
-								Logger.log(Logger.INFO, "created record for " + record.getURI() + "@" + record.getURL()); //$NON-NLS-1$ //$NON-NLS-2$
+							try {
+								contents.close();
+							}
+							catch (IOException e) {
+								Logger.log(Logger.ERROR_DEBUG, null, e);
+							}
 						}
-						catch (MalformedURLException e) {
-							// don't record this URI
-							Logger.logException(e);
+						else {
+							Logger.log(Logger.ERROR_DEBUG, getClass().getName() + "could not read resource " + jar.getFullPath()); //$NON-NLS-1$
 						}
 					}
-					try {
-						contents.close();
-					}
-					catch (IOException e) {
-					}
 				}
-				else {
-					Logger.log(Logger.ERROR_DEBUG, getClass().getName() + "could not read resource " + jar.getFullPath()); //$NON-NLS-1$
-				}
+			} catch (IOException e) { }
+			finally {
+				closeInputStream(zip);
 			}
 		}
 		if (jarRecord.has11TLD) {
@@ -2034,6 +2320,58 @@
 		}
 	}
 
+	private InputStream copyZipEntry(ZipInputStream stream) {
+		ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+		InputStream copy = null;
+
+		if (stream != null) {
+			int c;
+			// array dim restriction?
+			byte bytes[] = new byte[2048];
+			try {
+				while ((c = stream.read(bytes)) >= 0) {
+					buffer.write(bytes, 0, c);
+				}
+				copy = new ByteArrayInputStream(buffer.toByteArray());
+				closeZipEntry(stream);
+			}
+			catch (IOException ioe) {
+				// no cleanup can be done
+			}
+		}
+		return copy;
+	}
+
+	private ZipInputStream getZipInputStream(IResource jar) {
+		if (jar == null || jar.getType() != IResource.FILE || !jar.isAccessible())
+			return null;
+
+		try {
+			InputStream zipStream = ((IFile) jar).getContents();
+			return new ZipInputStream(zipStream);
+		} catch (CoreException e) { }
+		return null;
+	}
+
+	private void closeInputStream(InputStream stream) {
+		if (stream != null) {
+			try {
+				stream.close();
+			} catch (IOException e) { }
+		}
+			
+	}
+
+	private void closeZipEntry(ZipInputStream zis) {
+		if (zis != null) {
+			try {
+				zis.closeEntry();
+			} catch (IOException e) {
+				System.out.println("Error");
+			}
+		}
+			
+	}
 
 	void updateTag(IResource resource, int kind) {
 		TagDirRecord record = (TagDirRecord) fTagDirReferences.get(resource.getParent().getFullPath().toString());
@@ -2076,12 +2414,17 @@
 		}
 	}
 
+	/**
+	 * 
+	 * @param tld
+	 * @param deltaKind
+	 */
 	void updateTLD(IResource tld, int deltaKind) {
 		if (_debugIndexCreation)
 			Logger.log(Logger.INFO, "creating record for " + tld.getFullPath()); //$NON-NLS-1$
 		TLDRecord record = createTLDRecord(tld);
 		fTLDReferences.put(tld.getFullPath().toString(), record);
-		if (record.getURI() != null) {
+		if (record.getURI() != null && record.getURI().length() > 0) {
 			getImplicitReferences(tld.getFullPath().toString()).put(record.getURI(), record);
 		}
 		TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, record, deltaKind));
@@ -2093,7 +2436,7 @@
 		InputStream webxmlContents = null;
 		Document document = null;
 		try {
-			webxmlContents = ((IFile) webxml).getContents(true);
+			webxmlContents = ((IFile) webxml).getContents(false);
 			DocumentProvider provider = new DocumentProvider();
 			provider.setInputStream(webxmlContents);
 			provider.setValidating(false);
@@ -2111,6 +2454,7 @@
 				}
 				catch (IOException e1) {
 					// ignore
+					Logger.log(Logger.ERROR_DEBUG, null, e1);
 				}
 		}
 		if (document == null)
@@ -2124,7 +2468,7 @@
 		NodeList taglibs = document.getElementsByTagName(JSP12TLDNames.TAGLIB);
 		for (int iTaglib = 0; iTaglib < taglibs.getLength(); iTaglib++) {
 			String taglibUri = readTextofChild(taglibs.item(iTaglib), "taglib-uri").trim(); //$NON-NLS-1$
-			// specified location is relative to root of the webapp
+			// specified location is relative to root of the web-app
 			String taglibLocation = readTextofChild(taglibs.item(iTaglib), "taglib-location").trim(); //$NON-NLS-1$
 			IPath path = null;
 			if (taglibLocation.startsWith("/")) { //$NON-NLS-1$
@@ -2157,6 +2501,7 @@
 											contents.close();
 										}
 										catch (IOException e) {
+											Logger.log(Logger.ERROR_DEBUG, null, e);
 										}
 									}
 								}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/TaglibIndex.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/TaglibIndex.java
index 4836346..02930ea 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/TaglibIndex.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/TaglibIndex.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,8 +15,8 @@
 import java.lang.ref.Reference;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Hashtable;
 import java.util.Iterator;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.zip.CRC32;
@@ -46,7 +46,9 @@
 import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
 import org.eclipse.jst.jsp.core.internal.Logger;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
+import org.eclipse.wst.sse.core.internal.util.AbstractMemoryListener;
 import org.osgi.framework.Bundle;
+import org.osgi.service.event.Event;
 
 /**
  * A non-extendable index manager for taglibs similar to the previous J2EE
@@ -97,7 +99,7 @@
 			else if (element.getElementType() == IJavaElement.JAVA_PROJECT) {
 				if ((delta.getFlags() & IJavaElementDelta.F_CLASSPATH_CHANGED) != 0) {
 					IJavaElement proj = element;
-					handleClasspathChange((IJavaProject) proj, forceUpdate);
+					handleClasspathChange((IJavaProject) proj, delta, forceUpdate);
 				}
 				else {
 					IJavaElementDelta[] deltas = delta.getAffectedChildren();
@@ -116,7 +118,7 @@
 								// removing the index file ensures that we
 								// don't get stale data if the project is
 								// reopened
-								removeIndex(proj.getProject());
+								removeIndexFile(proj.getProject());
 							}
 						}
 					}
@@ -158,7 +160,7 @@
 			}
 		}
 
-		private void handleClasspathChange(IJavaProject project, boolean forceUpdate) {
+		private void handleClasspathChange(IJavaProject project, IJavaElementDelta delta, boolean forceUpdate) {
 			if (frameworkIsShuttingDown())
 				return;
 
@@ -179,7 +181,7 @@
 					}
 					if (description != null && !frameworkIsShuttingDown()) {
 						projectsIndexed.add(resource);
-						description.setBuildPathIsDirty();
+						description.queueElementChanged(delta);
 					}
 				}
 			}
@@ -289,8 +291,6 @@
 									}
 								}
 								for (int i = 0; i < projects.length; i++) {
-									if (deltas[i].getKind() == IResourceDelta.CHANGED && (deltas[i].getFlags() == IResourceDelta.ENCODING || deltas[i].getFlags() == IResourceDelta.MARKERS))
-										continue;
 									try {
 										if (deltas[i] != null && deltas[i].getKind() != IResourceDelta.REMOVED && projects[i].isAccessible()) {
 											ProjectDescription description = getDescription(projects[i]);
@@ -331,6 +331,79 @@
 		}
 	}
 
+	/**
+	 * An implementation of {@link Map} that has a limit to the number
+	 * of {@link Map.Entry}s it can store.  If the limit is reached then the
+	 * oldest {@link Map.Entry}s are automatically removed.
+	 */
+	private class LimitedHashMap extends LinkedHashMap {
+		/**
+		 * Default
+		 */
+		private static final long serialVersionUID = 1L;
+
+		/**
+		 * the maximum number of {@link Map.Entry}s this map can store
+		 */
+		private int fLimit;
+
+		LimitedHashMap(int limit) {
+			super(limit, .75f, true);
+			fLimit = limit;
+		}
+
+		/**
+		 * If the size of this map has increased passed the limit then return
+		 * <code>true</code>, <code>false</code> otherwise.
+		 * 
+		 * @see java.util.LinkedHashMap#removeEldestEntry(java.util.Map.Entry)
+		 */
+		protected boolean removeEldestEntry(Map.Entry eldest) {
+			boolean willRemove = this.size() > fLimit;
+			if (willRemove) {
+				// save its references to disk before it gets bumped
+				((ProjectDescription) eldest.getValue()).saveReferences();
+			}
+			return willRemove;
+		}
+	}
+
+	/**
+	 * <p>A {@link AbstractMemoryListener} that clears the {@link ProjectDescription} cache
+	 * whenever specific memory events are received.</p>
+	 * 
+	 * <p>Events:
+	 * <ul>
+	 * <li>{@link AbstractMemoryListener#SEV_SERIOUS}</li>
+	 * <li>{@link AbstractMemoryListener#SEV_CRITICAL}</li>
+	 * </ul>
+	 * </p>
+	 */
+	private class MemoryListener extends AbstractMemoryListener {
+		/**
+		 * <p>Constructor causes this listener to listen for specific memory events.</p>
+		 * <p>Events:
+		 * <ul>
+		 * <li>{@link AbstractMemoryListener#SEV_SERIOUS}</li>
+		 * <li>{@link AbstractMemoryListener#SEV_CRITICAL}</li>
+		 * </ul>
+		 * </p>
+		 */
+		MemoryListener() {
+			super(new String[] { SEV_SERIOUS, SEV_CRITICAL });
+		}
+		
+		/**
+		 * On any memory event we handle clear out the project descriptions
+		 * 
+		 * @see org.eclipse.jst.jsp.core.internal.util.AbstractMemoryListener#handleMemoryEvent(org.osgi.service.event.Event)
+		 */
+		protected void handleMemoryEvent(Event event) {
+			clearProjectDescriptions();
+		}
+		
+	}
+	
 	static final boolean _debugChangeListener = false;
 
 	static boolean _debugEvents = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/taglib/events")); //$NON-NLS-1$ //$NON-NLS-2$
@@ -349,7 +422,12 @@
 	private static final String DIRTY = "DIRTY";
 	static boolean ENABLED = false;
 
-	static ILock LOCK = Job.getJobManager().newLock();
+	/**
+	 * The minimum limitation on the number of project descriptions to keep cached.
+	 */
+	private static final int MINIMUM_LIMIT_FOR_PROJECT_DESCRIPTIONS_CACHE = 3;
+	
+	static final ILock LOCK = Job.getJobManager().newLock();
 
 	/**
 	 * NOT API.
@@ -413,6 +491,7 @@
 	 * Finds all of the visible ITaglibRecords for the given path in the
 	 * workspace. Taglib mappings from web.xml files are only visible to paths
 	 * within the web.xml's corresponding web content folder.
+	 * This method will almost certainly require a workspace lock to complete.
 	 * 
 	 * @param fullPath -
 	 *            a path within the workspace
@@ -476,16 +555,17 @@
 
 	/**
 	 * Finds a matching ITaglibRecord given the reference. Typically the
-	 * result will have to be cast to a subiinterface of ITaglibRecord.
+	 * result will have to be cast to a subinterface of ITaglibRecord. This
+	 * method will almost certainly require a workspace lock to complete.
 	 * 
-	 * @param basePath -
-	 *            the workspace-relative path for IResources, full filesystem
-	 *            path otherwise
-	 * @param reference -
-	 *            the URI to lookup, for example the uri value from a taglib
+	 * @param basePath
+	 *            - the workspace-relative path for IResources, full
+	 *            filesystem path otherwise
+	 * @param reference
+	 *            - the URI to lookup, for example the uri value from a taglib
 	 *            directive
-	 * @param crossProjects -
-	 *            whether to search across projects (currently ignored)
+	 * @param crossProjects
+	 *            - whether to search across projects (currently ignored)
 	 * 
 	 * @return a visible ITaglibRecord or null if the reference points to no
 	 *         known tag library descriptor
@@ -537,8 +617,8 @@
 	public static void shutdown() {
 		try {
 			LOCK.acquire();
-			if (_instance.isInitialized()) {
-				_instance.stop();
+			if (getInstance().isInitialized()) {
+				getInstance().stop();
 			}
 		}
 		finally {
@@ -573,6 +653,11 @@
 	private ResourceChangeListener fResourceChangeListener;
 
 	private ITaglibIndexListener[] fTaglibIndexListeners = null;
+	
+	/**
+	 * Used to keep the {@link ProjectDescription} cache clean when memory is low
+	 */
+	private MemoryListener fMemoryListener;
 
 	/** symbolic name for OSGI framework */
 	private final static String OSGI_FRAMEWORK_ID = "org.eclipse.osgi"; //$NON-NLS-1$
@@ -592,6 +677,7 @@
 			 * while we were waiting for the lock
 			 */
 			if (!isInitialized()) {
+				getWorkingLocation();
 				/*
 				 * Only consider a crash if a value exists and is DIRTY (not a
 				 * new workspace)
@@ -601,12 +687,16 @@
 					removeIndexes(false);
 				}
 
-				fProjectDescriptions = new Hashtable();
+				fProjectDescriptions = new LimitedHashMap(calculateCacheLimit());
 				fResourceChangeListener = new ResourceChangeListener();
 				fClasspathChangeListener = new ClasspathChangeListener();
+				fMemoryListener = new MemoryListener();
+
 				if (ENABLED) {
 					ResourcesPlugin.getWorkspace().addResourceChangeListener(fResourceChangeListener, IResourceChangeEvent.POST_CHANGE);
 					JavaCore.addElementChangedListener(fClasspathChangeListener);
+					//register the memory listener
+					fMemoryListener.connect();
 				}
 				setIntialized(true);
 			}
@@ -629,7 +719,7 @@
 	 * Based on org.eclipse.jdt.internal.core.search.indexing.IndexManager
 	 * 
 	 * @param containerPath
-	 * @return
+	 * @return the index file location for the given workspace path
 	 */
 	String computeIndexLocation(IPath containerPath) {
 		String fileName = computeIndexName(containerPath);
@@ -649,9 +739,12 @@
 
 	/**
 	 * @param project
-	 * @return
+	 * @return the ProjectDescription representing the given project
 	 */
 	ProjectDescription createDescription(IProject project) {
+		if (fProjectDescriptions == null)
+			return null;
+
 		ProjectDescription description = null;
 		try {
 			LOCK.acquire();
@@ -856,7 +949,7 @@
 	/**
 	 * Removes index file for the given project.
 	 */
-	private void removeIndex(IProject project) {
+	void removeIndexFile(IProject project) {
 		File indexFile = new File(computeIndexLocation(project.getFullPath()));
 		if (indexFile.exists()) {
 			indexFile.delete();
@@ -873,15 +966,7 @@
 	 *            indexes
 	 */
 	private void removeIndexes(boolean staleOnly) {
-		String osPath = getTaglibIndexStateLocation().toOSString();
-		File folder = new File(osPath);
-		if (!folder.isDirectory()) {
-			try {
-				folder.mkdir();
-			}
-			catch (SecurityException e) {
-			}
-		}
+		File folder = getWorkingLocation();
 
 		// remove any extraneous index files
 		IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
@@ -912,8 +997,12 @@
 
 	private void stop() {
 		if (isInitialized()) {
+			setIntialized(false);
+
 			ResourcesPlugin.getWorkspace().removeResourceChangeListener(fResourceChangeListener);
 			JavaCore.removeElementChangedListener(fClasspathChangeListener);
+			//unregister the memory listener
+			fMemoryListener.disconnect();
 
 			/*
 			 * Clearing the existing saved states helps prune dead data from
@@ -921,6 +1010,39 @@
 			 */
 			removeIndexes(true);
 
+			clearProjectDescriptions();
+
+			setState(CLEAN);
+			fProjectDescriptions = null;
+			fResourceChangeListener = null;
+			fClasspathChangeListener = null;
+			fMemoryListener = null;
+		}
+	}
+
+	/**
+	 * Get the working location for the taglib index
+	 * @return The File representing the taglib index's working location
+	 */
+	private File getWorkingLocation() {
+		File folder = new File(getTaglibIndexStateLocation().toOSString());
+		if (!folder.isDirectory()) {
+			try {
+				folder.mkdir();
+			}
+			catch (SecurityException e) {
+			}
+		}
+		return folder;
+	}
+
+	/**
+	 * Have all of the ProjectDescriptions write their information to disk and
+	 * then clear our map of them
+	 */
+	void clearProjectDescriptions() {
+		try {
+			LOCK.acquire();
 			Iterator i = fProjectDescriptions.values().iterator();
 			while (i.hasNext()) {
 				ProjectDescription description = (ProjectDescription) i.next();
@@ -928,12 +1050,8 @@
 			}
 
 			fProjectDescriptions.clear();
-
-			setState(CLEAN);
-			fProjectDescriptions = null;
-			fResourceChangeListener = null;
-			fClasspathChangeListener = null;
-			setIntialized(false);
+		} finally {
+			LOCK.release();
 		}
 	}
 
@@ -944,4 +1062,22 @@
 	private void setIntialized(boolean intialized) {
 		this.initialized = intialized;
 	}
+	
+	/**
+	 * <p>Calculate the maximum number of project descriptions to keep cached.</p>
+	 * <p>Calculated as:<br />
+	 * <code>MINIMUM_LIMIT_FOR_PROJECT_DESCRIPTIONS_CACHE + log(currentWorkspaceProjectCount)</code></p>
+	 * 
+	 * @return the maximum number of project descriptions to keep cached
+	 */
+	private int calculateCacheLimit() {
+		int limit = MINIMUM_LIMIT_FOR_PROJECT_DESCRIPTIONS_CACHE;
+		
+		int projectCount = ResourcesPlugin.getWorkspace().getRoot().getProjects().length;
+		if(projectCount > 0) {
+			limit += Math.log(projectCount);
+		}
+		
+		return limit;
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/css/core/internal/parser/JSPedCSSTokenizer.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/css/core/internal/parser/JSPedCSSTokenizer.java
index cdb75fd..ddb22e7 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/css/core/internal/parser/JSPedCSSTokenizer.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/css/core/internal/parser/JSPedCSSTokenizer.java
@@ -1,7 +1,7 @@
-/* The following code was generated by JFlex 1.4.1 on 06/04/30 15:49 */
+/* The following code was generated by JFlex 1.4.1 on 7/22/08 10:30 AM */
 
 /*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -28,7 +28,8 @@
 /**
  * This class is a scanner generated by 
  * <a href="http://www.jflex.de/">JFlex</a> 1.4.1
- * on 06/04/30 15:49 from the specification file
+ * on 7/22/08 10:30 AM from the specification file
+ * <tt>D:/workspaces/wtp301/workspace/org.eclipse.jst.jsp.core/DevTimeSupport/CSSJSPParser/JSPedCSSTokenizer.flex</tt>
  */
 public class JSPedCSSTokenizer implements JSPedCSSRegionContexts, ICSSTokenizer {
 
@@ -1290,7 +1291,9 @@
 						break;
 					}
 				}
-				if (context == CSS_JSP_SCRIPTLET){
+				// [236008] - Should not try and consider the token a
+				// comment unless  a comment was started
+				if (context == CSS_JSP_SCRIPTLET && nextTokenType == CSS_JSP_COMMENT){
 					while (nextTokenType != CSS_JSP_COMMENT_END) {
 //						text.append(yytext());
 						textLength += yylength();
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 c09e0ee..aa7bc77 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.1.300.qualifier
+Bundle-Version: 1.1.501.qualifier
 Bundle-Activator: org.eclipse.jst.jsp.ui.internal.JSPUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
@@ -25,7 +25,6 @@
  org.eclipse.jst.jsp.ui.internal.java.search.ui;x-internal:=true,
  org.eclipse.jst.jsp.ui.internal.preferences;x-internal:=true,
  org.eclipse.jst.jsp.ui.internal.preferences.ui;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.projection;x-internal:=true,
  org.eclipse.jst.jsp.ui.internal.registry;x-internal:=true,
  org.eclipse.jst.jsp.ui.internal.style;x-internal:=true,
  org.eclipse.jst.jsp.ui.internal.style.java;x-internal:=true,
@@ -36,31 +35,32 @@
  org.eclipse.jst.jsp.ui.internal.validation;x-internal:=true,
  org.eclipse.jst.jsp.ui.internal.wizard;x-internal:=true,
  org.eclipse.jst.jsp.ui.views.contentoutline
-Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.forms;bundle-version="[3.3.100,3.4.0]",
- org.eclipse.wst.sse.ui;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.html.ui;bundle-version="[1.0.300,1.1.0)",
- org.eclipse.wst.css.ui;bundle-version="[1.0.300,1.1.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.0.400,1.1.0)",
- org.eclipse.jst.jsp.core;bundle-version="[1.2.100,1.3.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.200,1.2.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.200,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.jdt.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.debug.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.debug;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.search;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ltk.core.refactoring;bundle-version="[3.4.0,4.0.0)",
+Import-Package: com.ibm.icu.util; version="3.8",
+ com.ibm.icu.text; version="3.8"
+Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.forms;bundle-version="[3.4.0,4.0.0]",
+ org.eclipse.wst.sse.ui;bundle-version="[1.2.0,1.3.0)",
+ org.eclipse.wst.html.ui;bundle-version="[1.0.500,1.1.0)",
+ org.eclipse.wst.css.ui;bundle-version="[1.0.500,1.1.0)",
+ org.eclipse.wst.xml.ui;bundle-version="[1.1.100,1.2.0)",
+ org.eclipse.jst.jsp.core;bundle-version="[1.2.300,1.3.0)",
+ org.eclipse.wst.html.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.wst.css.core;bundle-version="[1.1.300,1.2.0)",
+ org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.jdt.ui;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.jdt.core;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.debug.core;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.jdt.debug;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.search;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ltk.core.refactoring;bundle-version="[3.5.0,4.0.0)",
  org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
- org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.views;bundle-version="[3.3.0,4.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.0,1.3.0)",
- com.ibm.icu;bundle-version="[3.8.1,4.0.0)"
+ org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.views;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.wst.validation;bundle-version="[1.2.100,1.3.0)"
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.jst.jsp.ui/about.html b/bundles/org.eclipse.jst.jsp.ui/about.html
index 73db36e..2199df3 100644
--- a/bundles/org.eclipse.jst.jsp.ui/about.html
+++ b/bundles/org.eclipse.jst.jsp.ui/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/bundles/org.eclipse.jst.jsp.ui/build.properties b/bundles/org.eclipse.jst.jsp.ui/build.properties
index f70f87f..a5bbc9e 100644
--- a/bundles/org.eclipse.jst.jsp.ui/build.properties
+++ b/bundles/org.eclipse.jst.jsp.ui/build.properties
@@ -18,5 +18,4 @@
                about.html
 bin.excludes = @dot/**,\
                temp.folder/**
-src.includes = build.properties
 additional.bundles = org.eclipse.jdt.core.manipulation
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/elcl16/javaassist_co.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/elcl16/javaassist_co.gif
new file mode 100644
index 0000000..e9a6bd9
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/icons/full/elcl16/javaassist_co.gif
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/plugin.properties b/bundles/org.eclipse.jst.jsp.ui/plugin.properties
index 0e63e44..35aa393 100644
--- a/bundles/org.eclipse.jst.jsp.ui/plugin.properties
+++ b/bundles/org.eclipse.jst.jsp.ui/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2008 IBM Corporation and others.
+# Copyright (c) 2004, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -9,16 +9,17 @@
 #     IBM Corporation - initial API and implementation
 #     Matthias Fuessel, mat.fuessel@gmx.net - [177387] use base hyperlinking extension points
 ###############################################################################
-providerName=Eclipse.org
+providerName=Eclipse Web Tools Platform
 pluginName=SSE JSP Source Editor
 JSP_Source_Page_Editor.name=JSP Editor
 CSS_JSP_Source_Page_Editor.name=CSS JSP Editor
 JSP_Files.name=JSP Files
 JSP_Source.name=Editor
+JSP_Content_Assist.name=Content Assist
 JSP_Templates.name=Templates
 JSP_Styles.name=Styles
 JSP_Syntax_Coloring=Syntax Coloring
-JSP_Source_target_name=JSP Source
+JSP_Source_target_name=JSP Editors
 JSP_Validation=Validation
 JSP_Property_validation=JSP Syntax
 JSP_Typing=Typing
@@ -41,6 +42,7 @@
 jsp_taglib_directive_uri=URI to the containing JAR file or taglib descriptor (.tld)
 jsp_taglib_directive_prefix=Namespace prefix for tags from this library
 JSPFragmentContentSettings.name=JSP Fragment
+JSP_Property_tag_contentSettings=Tag Content
 command.jsp.refactor.rename.name=Rename
 command.jsp.refactor.rename.description=Rename a Java Element
 command.jsp.refactor.move.name=Move
@@ -62,10 +64,10 @@
 JSP_Query_Participant_Extension_Element.name=JSP Query Participant
 JSP_Extension_Element.label=JSP
 #org.eclipse.ui.newWizards extension point
-_UI_WIZARD_NAME = JSP
-_UI_WIZARD_CREATE_NEW_FILE = Create a new JavaServer Page
-_UI_WIZARD_TAG_NAME = Tag
-_UI_WIZARD_TAG_CREATE_NEW_FILE = Create a new Tag file
+_UI_WIZARD_NAME = JSP File
+_UI_WIZARD_CREATE_NEW_FILE = Create a new JSP file
+_UI_WIZARD_TAG_NAME = JSP Tag
+_UI_WIZARD_TAG_CREATE_NEW_FILE = Create a new JSP Tag file
 ##
 AddTask.label=Add &Task...
 AddTask.tooltip=Add Task...
@@ -95,11 +97,17 @@
 StructureSelectHistory_tooltip=Restore last selection
 ##
 preferenceKeywords.files=editor jsp creating saving files suffix specified encoding iana validating validate fragments
+preferenceKeywords.contentassist=jsp editor content code assist complete completion insert overwrite single proposal common prefix automatically import fill argument name guess alphabetical hide auto activation trigger category categories separate specific
 preferenceKeywords.templates=editor jsp templates snippet macros
 preferenceKeywords.styles=editor jsp style customize syntax highlighting type text content foreground background bold color
 preferenceKeywords.fragments=editor jsp fragment language content type validate
 preferenceKeywords.severities=jsp errors warnings ignore options severity severities suppress project specific projectspecific
 
 ##
-JSPJava_hyperlink=Java Content In JSP
-Taglib_hyperlink=Taglib Directive
+Java_Element_hyperlink=Java Element
+Taglib_hyperlink=Tag Library Descriptor
+
+##
+proposalCategory.jspTemplates=JSP Template Proposals
+proposalCategory.jsp=JSP Proposals
+proposalCategory.jspJava=JSP Java Proposals
diff --git a/bundles/org.eclipse.jst.jsp.ui/plugin.xml b/bundles/org.eclipse.jst.jsp.ui/plugin.xml
index df4a017..bb02d00 100644
--- a/bundles/org.eclipse.jst.jsp.ui/plugin.xml
+++ b/bundles/org.eclipse.jst.jsp.ui/plugin.xml
@@ -35,6 +35,9 @@
 		<contentOutlineConfiguration
 			class="org.eclipse.jst.jsp.ui.views.contentoutline.JSPContentOutlineConfiguration"
 			target="org.eclipse.jst.jsp.core.jspsource" />
+		<quickOutlineConfiguration
+			class="org.eclipse.wst.xml.ui.internal.quickoutline.XMLQuickOutlineConfiguration"
+			target="org.eclipse.jst.jsp.core.jspsource" />
 		<propertySheetConfiguration
 			class="org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration"
 			target="org.eclipse.jst.jsp.core.jspsource" />
@@ -55,12 +58,12 @@
 			class="org.eclipse.jst.jsp.ui.internal.text.JSPDocumentRegionEdgeMatcher"
 			target="org.eclipse.jst.jsp.core.jspsource" />
 		<provisionalConfiguration
-			type="structuredtextfoldingprovider"
-			class="org.eclipse.jst.jsp.ui.internal.projection.StructuredTextFoldingProviderJSP"
+			type="foldingstrategy"
+			class="org.eclipse.wst.xml.ui.internal.projection.XMLFoldingStrategy"
 			target="org.eclipse.jst.jsp.core.jspsource" />
 		<provisionalDefinition
 			type="preferencepages"
-			value="org.eclipse.jst.jsp.ui.preferences.jsp, org.eclipse.wst.sse.ui.preferences.jsp.source, org.eclipse.wst.sse.ui.preferences.jsp.templates, org.eclipse.wst.sse.ui.preferences.jsp.styles,,org.eclipse.jst.jsp.ui.preferences.validation"
+			value="org.eclipse.jst.jsp.ui.preferences.jsp, org.eclipse.wst.sse.ui.preferences.jsp.source, org.eclipse.wst.sse.ui.preferences.jsp.templates, org.eclipse.wst.sse.ui.preferences.jsp.styles,,org.eclipse.jst.jsp.ui.preferences.validation, org.eclipse.wst.sse.ui.preferences.jsp.contentassist"
 			target="org.eclipse.jst.jsp.core.jspsource" />
 		<provisionalDefinition
 			type="showintarget"
@@ -74,6 +77,13 @@
 			type="activecontexts"
 			value="org.eclipse.jst.jsp.core.jspsource, org.eclipse.jst.jsp.ui.structured.text.editor.jsp.scope, org.eclipse.wst.html.core.htmlsource, org.eclipse.core.runtime.xml, org.eclipse.wst.xml.navigation, org.eclipse.wst.xml.comments, org.eclipse.wst.xml.selection"
         	target="org.eclipse.jst.jsp.core.jspsource" />
+
+		<contentOutlineConfiguration
+			class="org.eclipse.jst.jsp.ui.internal.views.contentoutline.TLDContentOutlineConfiguration"
+			target="org.eclipse.jst.jsp.core.tldsource" />
+		<documentationTextHover
+        	class="org.eclipse.jst.jsp.ui.internal.taginfo.XMLJavadocHoverProcessor"
+        	target="org.eclipse.wst.xml.XML_DEFAULT"/>
 	</extension>
 
 	<!--======================================================================================-->
@@ -132,7 +142,7 @@
 	<!--======================================================================================-->
 	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
 		<validator
-			scope="partial"
+			scope="total"
 			class="org.eclipse.jst.jsp.ui.internal.validation.JSPActionSourceValidator"
 			id="org.eclipse.jst.jsp.ui.internal.validation.jspactionvalidator">
 			<contentTypeIdentifier
@@ -144,34 +154,22 @@
 			</contentTypeIdentifier>
 		</validator>
 	</extension>
-	<!--======================================================================================-->
-	<!-- custom XML source (as you type) validation					   						  -->
-	<!--======================================================================================-->
-	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
-		<validator
-			scope="partial"
-			class="org.eclipse.wst.xml.ui.internal.validation.MarkupValidator"
-			id="org.eclipse.jst.jsp.ui.internal.validation.markupvalidator">
-			<contentTypeIdentifier
-				id="org.eclipse.jst.jsp.core.jspsource">
-				<partitionType id="org.eclipse.jst.jsp.JSP_DIRECTIVE"/>
-				<partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
-				<partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
-			</contentTypeIdentifier>
-		</validator>
-	</extension>
+
 	<!--======================================================================================-->
 	<!-- HTML (as you type) validation					   						  			  -->
 	<!--======================================================================================-->
 	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
 		<validator
-			scope="partial"
+			scope="total"
 			class="org.eclipse.jst.jsp.ui.internal.validation.JSPContentSourceValidator"
 			id="org.eclipse.jst.jsp.ui.internal.validation.htmlsyntaxvalidator">
 			<contentTypeIdentifier
 				id="org.eclipse.jst.jsp.core.jspsource">
 				<partitionType id="org.eclipse.jst.jsp.JSP_DIRECTIVE"/>
+				<partitionType id="org.eclipse.jst.jsp.JSP_COMMENT"/>
 				<partitionType id="org.eclipse.wst.html.HTML_DEFAULT"/>
+				<partitionType id="org.eclipse.wst.html.HTML_DECLARATION"/>
+				<partitionType id="org.eclipse.wst.html.HTML_COMMENT"/>
 				<partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
 				<partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
 			</contentTypeIdentifier>
@@ -214,6 +212,15 @@
 			class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPSourcePreferencePage"
 			id="org.eclipse.wst.sse.ui.preferences.jsp.source">
 		</page>
+  <page
+        category="org.eclipse.wst.sse.ui.preferences.jsp.source"
+        class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPContentAssistPreferencePage"
+        id="org.eclipse.wst.sse.ui.preferences.jsp.contentassist"
+        name="%JSP_Content_Assist.name">
+     <keywordReference
+           id="org.eclipse.jst.jsp.ui.contentassist">
+     </keywordReference>
+  </page>
 		<page
 			name="%JSP_Templates.name"
 			category="org.eclipse.wst.sse.ui.preferences.jsp.source"
@@ -249,6 +256,9 @@
 			label="%preferenceKeywords.files"
 			id="org.eclipse.jst.jsp.ui.files"/>
 		<keyword
+			label="%preferenceKeywords.contentassist"
+			id="org.eclipse.jst.jsp.ui.contentassist"/>
+		<keyword
 			label="%preferenceKeywords.templates"
 			id="org.eclipse.jst.jsp.ui.templates"/>
 		<keyword
@@ -844,6 +854,11 @@
        </handler>
 	</extension>
 	
+	<extension point="org.eclipse.ui.perspectiveExtensions">
+        <perspectiveExtension targetID="org.eclipse.wst.web.ui.webDevPerspective">
+            <newWizardShortcut id="org.eclipse.jst.jsp.ui.internal.wizard.NewJSPWizard"/>
+        </perspectiveExtension> 
+	</extension>
 	
 	<!-- JSP Fragment Property Page -->
 	<extension point="org.eclipse.ui.propertyPages">
@@ -900,6 +915,24 @@
 			</enabledWhen>
 			<keywordReference id="org.eclipse.jst.jsp.ui.severities"/>
 		</page>
+		<page
+			name="%JSP_Property_tag_contentSettings"
+			class="org.eclipse.jst.jsp.ui.internal.contentproperties.ui.TagContentSettingsPropertyPage"
+			id="org.eclipse.jst.jsp.ui.propertyPage.project.tag.content.settings"
+			category="org.eclipse.ui.propertypages.info.file">
+         	<enabledWhen>
+               	<and>
+					<adapt type="org.eclipse.core.resources.IFile">
+						<or> 
+							<test 
+								forcePluginActivation="true"
+								property="org.eclipse.core.resources.contentTypeId"
+								value="org.eclipse.jst.jsp.core.tagsource" />
+						</or>
+					</adapt>
+				</and> 
+			</enabledWhen>
+		</page>
 	</extension>	
 	<!--  jsp-for-css editor configurations -->		
 	<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
@@ -917,8 +950,8 @@
 			class="org.eclipse.wst.css.ui.internal.text.CSSDocumentRegionEdgeMatcher"
 			target="org.eclipse.jst.jsp.core.cssjspsource" />
 		<provisionalConfiguration
-			type="structuredtextfoldingprovider"
-			class="org.eclipse.wst.css.ui.internal.projection.StructuredTextFoldingProviderCSS"
+			type="foldingstrategy"
+			class="org.eclipse.wst.css.ui.internal.projection.CSSFoldingStrategy"
 			target="org.eclipse.jst.jsp.core.cssjspsource" />
 		<provisionalDefinition
 			type="preferencepages"
@@ -944,7 +977,7 @@
 		<hyperlinkDetector
 			class="org.eclipse.jst.jsp.ui.internal.hyperlink.JSPJavaHyperlinkDetector"
 			id="org.eclipse.jst.jsp.ui.internal.hyperlink.JSPJavaHyperlinkDetector"
-			name="%JSPJava_hyperlink"
+			name="%Java_Element_hyperlink"
 			targetId="org.eclipse.jst.jsp.core.jspsource">
 		</hyperlinkDetector>
 		<hyperlinkDetector
@@ -953,6 +986,12 @@
 			name="%Taglib_hyperlink"
 			targetId="org.eclipse.jst.jsp.core.jspsource">
 		</hyperlinkDetector>
+		<hyperlinkDetector
+			class="org.eclipse.jst.jsp.ui.internal.hyperlink.XMLJavaHyperlinkDetector"
+			id="org.eclipse.jst.jsp.ui.internal.hyperlink.XMLJavaHyperlinkDetector"
+			name="%Java_Element_hyperlink"
+			targetId="org.eclipse.core.runtime.xml">
+		</hyperlinkDetector>
    </extension>
    
    <extension point="org.eclipse.core.expressions.definitions">
@@ -981,4 +1020,281 @@
 	       <separator name="jspRefactorBegin" visible="false"></separator>
 		</menuContribution>
 	</extension>
+	
+	<!-- Enable the FormatHandler for JSP Content Type -->
+	<extension point="org.eclipse.ui.handlers">
+		<handler 
+			class="org.eclipse.wst.sse.ui.internal.handlers.FormatHandler"
+			commandId="org.eclipse.wst.sse.ui.format">
+			<activeWhen>
+				<reference definitionId="org.eclipse.wst.jsp.ui.jspContentType.definition"></reference>
+			</activeWhen>
+			<enabledWhen>
+				<reference definitionId="org.eclipse.wst.jsp.ui.jspContentType.definition"></reference>
+			</enabledWhen>
+		</handler>
+	</extension>
+	
+	<!-- Set up a definition for JSP Content Types -->
+	<extension point="org.eclipse.core.expressions.definitions">
+		<definition id="org.eclipse.wst.jsp.ui.jspContentType.definition">
+			<iterate ifEmpty="false">
+				<adapt type="org.eclipse.core.resources.IFile">
+					<!-- Force property tester to load, should not cause entire plug-in to start -->
+					<test property="org.eclipse.wst.sse.core.resources.contentTypeId"
+						value="org.eclipse.jst.jsp.core.jspsource" forcePluginActivation="true"/>
+				</adapt>
+			</iterate>
+		</definition>
+	</extension>
+	<extension point="org.eclipse.wst.sse.ui.characterPairing">
+		<inserter class="org.eclipse.wst.html.ui.internal.text.CharacterPairInserter" id="org.eclipse.wst.jsp.ui.inserter">
+			<contentTypeIdentifier
+				id="org.eclipse.jst.jsp.core.jspsource"
+				partitions="org.eclipse.jst.jsp.JSP_DIRECTIVE,org.eclipse.wst.html.HTML_DEFAULT,org.eclipse.wst.html.HTML_DECLARATION">
+			</contentTypeIdentifier>
+		</inserter>
+	</extension>
+	<extension point="org.eclipse.wst.sse.ui.characterPairing">
+		<inserter class="org.eclipse.jst.jsp.ui.internal.text.JavaCharacterPairInserter" id="org.eclipse.wst.jsp.java.ui.inserter">
+			<contentTypeIdentifier
+				id="org.eclipse.jst.jsp.core.jspsource"
+				partitions="org.eclipse.jst.jsp.SCRIPT.JAVA">
+			</contentTypeIdentifier>
+		</inserter>
+	</extension>
+	<extension point="org.eclipse.wst.sse.ui.characterPairing">
+		<inserter class="org.eclipse.wst.css.ui.internal.text.CSSCharacterPairInserter" id="org.eclipse.jst.jsp.css.ui.inserter">
+			<contentTypeIdentifier
+				id="org.eclipse.jst.jsp.core.jspsource"
+				partitions="org.eclipse.wst.css.STYLE">
+			</contentTypeIdentifier>
+		</inserter>
+	</extension>
+ <extension
+       point="org.eclipse.wst.sse.ui.completionProposal">
+    <proposalCategory
+          icon="icons/full/obj16/tag-template.gif"
+          id="org.eclipse.jst.jsp.ui.proposalCategory.jspTemplates"
+          name="%proposalCategory.jspTemplates">
+    </proposalCategory>
+    <proposalCategory
+          icon="icons/full/obj16/tag-jsp.gif"
+          id="org.eclipse.jst.jsp.ui.proposalCategory.jsp"
+          name="%proposalCategory.jsp">
+    </proposalCategory>
+    <proposalCategory
+          icon="icons/full/elcl16/javaassist_co.gif"
+          id="org.eclipse.jst.jsp.ui.proposalCategory.jspJava"
+          name="%proposalCategory.jspJava">
+    </proposalCategory>
+    <proposalComputerExtendedActivation
+          id="org.eclipse.wst.html.ui.proposalComputer.htmlTags">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.wst.html.HTML_DEFAULT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.wst.html.HTML_COMMENT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.wst.sse.ST_DEFAULT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.jst.jsp.JSP_COMMENT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
+          </partitionType>
+       </contentType>
+    </proposalComputerExtendedActivation>
+    <proposalComputerExtendedActivation
+          id="org.eclipse.wst.html.ui.proposalComputer.htmlTemplates">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.wst.html.HTML_DEFAULT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.wst.html.HTML_COMMENT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.wst.sse.ST_DEFAULT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.jst.jsp.JSP_COMMENT">
+          </partitionType>
+       </contentType>
+    </proposalComputerExtendedActivation>
+    <proposalComputerExtendedActivation
+          id="org.eclipse.wst.xml.ui.proposalComputer.xmlTags">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.wst.xml.XML_DEFAULT">
+          </partitionType>
+       </contentType>
+    </proposalComputerExtendedActivation>
+    <proposalComputerExtendedActivation
+          id="org.eclipse.wst.xml.ui.proposalComputer.xmlTemplates">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.wst.xml.XML_DEFAULT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
+          </partitionType>
+       </contentType>
+    </proposalComputerExtendedActivation>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jspTemplates"
+          class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPTemplatesCompletionProposalComputer"
+          id="org.eclipse.jst.jsp.ui.proposalComputer.jspTemplates">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.wst.html.HTML_DEFAULT">
+          </partitionType>
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jsp"
+          class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPCompletionProposalComputer"
+          id="org.eclipse.jst.jsp.ui.proposalComputer.jsp">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jsp"
+          class="org.eclipse.jst.jsp.ui.internal.contentassist.LibraryTagsCompletionProposalComputer"
+          id="org.eclipse.jst.jsp.ui.proposalComputer.libraryTags">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.wst.html.HTML_DEFAULT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.wst.html.HTML_COMMENT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.wst.sse.ST_DEFAULT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.jst.jsp.JSP_COMMENT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
+          </partitionType>
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jspJava"
+          class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPJavaCompletionProposalComputer"
+          id="org.eclipse.jst.jsp.ui.proposalComputer.jspJava">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.jst.jsp.SCRIPT.JAVA">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.wst.xml.XML_CDATA">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.jst.jsp.DEFAULT_JSP">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.jst.jsp.SCRIPT.DELIMITER">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.jst.jsp.SCRIPT.JAVASCRIPT">
+          </partitionType>
+          <partitionType
+                id="org.eclipse.wst.html.SCRIPT">
+          </partitionType>
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jspJava"
+          class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPELCompletionProposalComputer"
+          id="org.eclipse.jst.jsp.ui.proposalComputer.jspEL">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.jst.jsp.SCRIPT.JSP_EL">
+          </partitionType>
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jspJava"
+          class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPImportCompletionProposalComputer"
+          id="org.eclipse.jst.jsp.ui.proposalComputer.jspImport">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
+          </partitionType>
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jsp"
+          class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPPropertyCompletionProposalComputer"
+          id="org.eclipse.jst.jsp.ui.proposalComputer.jspProperty">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jsp"
+          class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPUseBeanCompletionProposalComputer"
+          id="org.eclipse.jst.jsp.ui.proposalComputer.jspUseBean">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.jst.jsp.ui.proposalCategory.jsp"
+          class="org.eclipse.jst.jsp.ui.internal.contentassist.JSPTaglibCompletionProposalComputer"
+          id="org.eclipse.jst.jsp.ui.proposalComputer.jspTaglib">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+       </contentType>
+    </proposalComputer>
+    <proposalComputerExtendedActivation
+          id="org.eclipse.wst.css.ui.proposalComputer.css">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.wst.css.STYLE">
+          </partitionType>
+       </contentType>
+    </proposalComputerExtendedActivation>
+    <proposalComputerExtendedActivation
+          id="org.eclipse.wst.css.ui.proposalComputer.cssTemplates">
+       <contentType
+             id="org.eclipse.jst.jsp.core.jspsource">
+          <partitionType
+                id="org.eclipse.wst.css.STYLE">
+          </partitionType>
+       </contentType>
+    </proposalComputerExtendedActivation>
+ </extension>
+  <extension
+       point="org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration">
+    <categoriesConfiguration
+          class="org.eclipse.jst.jsp.ui.internal.preferences.JSPCompletionProposalCategoriesConfiguration"
+          contentTypeID="org.eclipse.jst.jsp.core.jspsource">
+    </categoriesConfiguration>
+ </extension>
 </plugin>
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java
index bc4158f..7c17b85 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -24,7 +24,6 @@
 import org.eclipse.jface.text.IAutoEditStrategy;
 import org.eclipse.jface.text.ITextDoubleClickStrategy;
 import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
 import org.eclipse.jface.text.formatter.IContentFormatter;
 import org.eclipse.jface.text.formatter.MultiPassContentFormatter;
 import org.eclipse.jface.text.source.ISourceViewer;
@@ -34,10 +33,8 @@
 import org.eclipse.jst.jsp.core.text.IJSPPartitions;
 import org.eclipse.jst.jsp.ui.internal.autoedit.AutoEditStrategyForTabs;
 import org.eclipse.jst.jsp.ui.internal.autoedit.StructuredAutoEditStrategyJSP;
-import org.eclipse.jst.jsp.ui.internal.contentassist.JSPContentAssistProcessor;
-import org.eclipse.jst.jsp.ui.internal.contentassist.JSPELContentAssistProcessor;
-import org.eclipse.jst.jsp.ui.internal.contentassist.JSPJavaContentAssistProcessor;
-import org.eclipse.jst.jsp.ui.internal.contentassist.NoRegionContentAssistProcessorForJSP;
+import org.eclipse.jst.jsp.ui.internal.autoedit.StructuredAutoEditStrategyJSPJava;
+import org.eclipse.jst.jsp.ui.internal.contentassist.JSPStructuredContentAssistProcessor;
 import org.eclipse.jst.jsp.ui.internal.format.FormattingStrategyJSPJava;
 import org.eclipse.jst.jsp.ui.internal.style.LineStyleProviderForJSP;
 import org.eclipse.jst.jsp.ui.internal.style.java.LineStyleProviderForJava;
@@ -47,7 +44,6 @@
 import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
 import org.eclipse.wst.html.core.text.IHTMLPartitions;
 import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
 import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
 import org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy;
 import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
@@ -55,6 +51,7 @@
 import org.eclipse.wst.xml.core.text.IXMLPartitions;
 import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
 import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
+import org.w3c.dom.Attr;
 import org.w3c.dom.Node;
 
 /**
@@ -115,6 +112,9 @@
 			// jsp java autoedit strategies
 			List allStrategies = new ArrayList(0);
 
+			// add the scritplet autoedit strategy first
+			allStrategies.add(new StructuredAutoEditStrategyJSPJava());
+			
 			IAutoEditStrategy[] javaStrategies = getJavaSourceViewerConfiguration().getAutoEditStrategies(sourceViewer, IJavaPartitions.JAVA_PARTITIONING);
 			for (int i = 0; i < javaStrategies.length; i++) {
 				allStrategies.add(javaStrategies[i]);
@@ -126,7 +126,7 @@
 
 			strategies = (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[allStrategies.size()]);
 		}
-		else if (contentType == IHTMLPartitions.HTML_DEFAULT || contentType == IHTMLPartitions.HTML_DECLARATION) {
+		else if (contentType == IHTMLPartitions.HTML_DEFAULT || contentType == IHTMLPartitions.HTML_DECLARATION || contentType == IJSPPartitions.JSP_DIRECTIVE) {
 			// html and jsp autoedit strategies
 			List allStrategies = new ArrayList(0);
 
@@ -178,46 +178,17 @@
 
 		return fConfiguredContentTypes;
 	}
-
-	protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
-		IContentAssistProcessor[] processors = null;
-
-		if (partitionType == IHTMLPartitions.SCRIPT) {
-			// HTML JavaScript
-			IContentAssistant htmlContentAssistant = getHTMLSourceViewerConfiguration().getContentAssistant(sourceViewer);
-			IContentAssistProcessor processor = htmlContentAssistant.getContentAssistProcessor(IHTMLPartitions.SCRIPT);
-			processors = new IContentAssistProcessor[]{processor};
-		}
-		else if (partitionType == ICSSPartitions.STYLE) {
-			// HTML CSS
-			IContentAssistant htmlContentAssistant = getHTMLSourceViewerConfiguration().getContentAssistant(sourceViewer);
-			IContentAssistProcessor processor = htmlContentAssistant.getContentAssistProcessor(ICSSPartitions.STYLE);
-			processors = new IContentAssistProcessor[]{processor};
-		}
-		// // jspcontentassistprocessor handles this?
-		// else if ((partitionType == IHTMLPartitionTypes.HTML_DEFAULT) ||
-		// (partitionType == IHTMLPartitionTypes.HTML_COMMENT)) {
-		// processors = new IContentAssistProcessor[]{new
-		// HTMLContentAssistProcessor()};
-		// }
-		else if ((partitionType == IXMLPartitions.XML_DEFAULT) || (partitionType == IHTMLPartitions.HTML_DEFAULT) || (partitionType == IHTMLPartitions.HTML_COMMENT) || (partitionType == IJSPPartitions.JSP_DEFAULT) || (partitionType == IJSPPartitions.JSP_DIRECTIVE) || (partitionType == IJSPPartitions.JSP_CONTENT_DELIMITER) || (partitionType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT) || (partitionType == IJSPPartitions.JSP_COMMENT)) {
-			// jsp
-			processors = new IContentAssistProcessor[]{new JSPContentAssistProcessor()};
-		}
-		else if ((partitionType == IXMLPartitions.XML_CDATA) || (partitionType == IJSPPartitions.JSP_CONTENT_JAVA)) {
-			// jsp java
-			processors = new IContentAssistProcessor[]{new JSPJavaContentAssistProcessor()};
-		}
-		else if (partitionType == IJSPPartitions.JSP_DEFAULT_EL) {
-			// jsp el
-			processors = new IContentAssistProcessor[]{new JSPELContentAssistProcessor()};
-		}
-		else if (partitionType == IStructuredPartitions.UNKNOWN_PARTITION) {
-			// unknown
-			processors = new IContentAssistProcessor[]{new NoRegionContentAssistProcessorForJSP()};
-		}
-
-		return processors;
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration#getContentAssistProcessors(
+	 * 	org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
+	 */
+	protected IContentAssistProcessor[] getContentAssistProcessors(
+			ISourceViewer sourceViewer, String partitionType) {
+		
+		IContentAssistProcessor processor = new JSPStructuredContentAssistProcessor(
+				this.getContentAssistant(), partitionType, sourceViewer);
+		return new IContentAssistProcessor[]{processor};
 	}
 
 	public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
@@ -295,7 +266,7 @@
 		else if (partitionType == IHTMLPartitions.SCRIPT || partitionType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT) {
 			providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, IHTMLPartitions.SCRIPT);
 		}
-		else if (partitionType == ICSSPartitions.STYLE) {
+		else if (partitionType == ICSSPartitions.STYLE || partitionType == ICSSPartitions.COMMENT) {
 			providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, ICSSPartitions.STYLE);
 		}
 		else if (partitionType == IXMLPartitions.XML_DEFAULT || partitionType == IXMLPartitions.XML_CDATA || partitionType == IXMLPartitions.XML_COMMENT || partitionType == IXMLPartitions.XML_DECLARATION || partitionType == IXMLPartitions.XML_PI) {
@@ -339,7 +310,6 @@
 		if (fStatusLineLabelProvider == null) {
 			fStatusLineLabelProvider = new JFaceNodeLabelProvider() {
 				public String getText(Object element) {
-
 					if (element == null)
 						return null;
 
@@ -349,7 +319,12 @@
 						if (node.getNodeType() != Node.DOCUMENT_NODE) {
 							s.insert(0, super.getText(node));
 						}
-						node = node.getParentNode();
+
+						if (node.getNodeType() == Node.ATTRIBUTE_NODE)
+							node = ((Attr) node).getOwnerElement();
+						else
+							node = node.getParentNode();
+					
 						if (node != null && node.getNodeType() != Node.DOCUMENT_NODE) {
 							s.insert(0, IPath.SEPARATOR);
 						}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIMessages.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIMessages.java
index 0c8ba64..2f70c20 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIMessages.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIMessages.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -76,6 +76,7 @@
 	public static String NewJSPTemplatesWizardPage_4;
 	public static String NewJSPTemplatesWizardPage_5;
 	public static String NewJSPTemplatesWizardPage_6;
+	public static String NewJSPTemplatesWizardPage_7;
 	public static String NewTagTemplatesWizardPage_0;
 	public static String NewTagTemplatesWizardPage_1;
 	public static String NewTagTemplatesWizardPage_2;
@@ -83,6 +84,7 @@
 	public static String NewTagTemplatesWizardPage_4;
 	public static String NewTagTemplatesWizardPage_5;
 	public static String NewTagTemplatesWizardPage_6;
+	public static String NewTagTemplatesWizardPage_7;
 	public static String ToggleComment_label; // resource bundle
 	public static String ToggleComment_tooltip; // resource bundle
 	public static String ToggleComment_description; // resource bundle
@@ -114,6 +116,7 @@
 	public static String JSPFContentSettingsPropertyPage_3;
 	public static String JSPFContentSettingsPropertyPage_4;
 	public static String ProjectJSPFContentSettingsPropertyPage_0;
+	public static String TagPropertyPage_desc;
 	public static String Title_InvalidValue;
 	public static String Message_InvalidValue;
 	public static String SyntaxColoringPage_0;
@@ -127,6 +130,10 @@
 	public static String JSPTyping_Auto_Complete;
 	public static String JSPTyping_Complete_Scriptlets;
 	public static String JSPTyping_Complete_Braces;
+	public static String JSPTyping_Complete_Comments;
+	public static String JSPTyping_Java_Code;
+	public static String JSPTyping_Close_Strings;
+	public static String JSPTyping_Close_Brackets;
 	public static String JSPValidationPreferencePage_0;
 
 	// below are the strings for the validation page
@@ -160,6 +167,7 @@
 	public static String VALIDATION_HEADER_CUSTOM_ACTIONS;
 	public static String VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE;
 	public static String VALIDATION_ACTIONS_SEVERITY_UNKNOWN_ATTRIBUTE;
+	public static String VALIDATION_ACTIONS_SEVERITY_UNEXPECTED_RTEXPRVALUE;
 	public static String VALIDATION_ACTIONS_SEVERITY_NON_EMPTY_INLINE_TAG;
 	public static String VALIDATION_TRANSLATION_TEI_VALIDATION_MESSAGE;
 	public static String VALIDATION_TRANSLATION_TEI_CLASS_NOT_FOUND;
@@ -171,4 +179,12 @@
 	public static String VALIDATION_TRANSLATION_USEBEAN_INVALID_ID;
 	public static String VALIDATION_TRANSLATION_USBEAN_MISSING_TYPE_INFO;
 	public static String VALIDATION_TRANSLATION_USEBEAN_AMBIGUOUS_TYPE_INFO;
+
+	public static String Open;
+	public static String TLDHyperlink_hyperlinkText;
+	public static String CustomTagHyperlink_hyperlinkText;
+	public static String TLDContentOutlineConfiguration_0;
+
+	public static String JSPFilesPreferencePage_Search_group;
+	public static String JSPFilesPreferencePage_Supply_JSP_search_to_Java_search;
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties
index d8ca7a2..a5d31eb 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2008 IBM Corporation and others.
+# Copyright (c) 2004, 2009 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -34,9 +34,9 @@
 BasicRefactorSearchRequestor_5=Rename Package ''{0}'' to ''{1}''
 BasicRefactorSearchRequestor_6=JSP Rename Change
 #
-_UI_WIZARD_NEW_TITLE = New JavaServer Page
-_UI_WIZARD_NEW_HEADING = JavaServer Page
-_UI_WIZARD_NEW_DESCRIPTION = Create a new JavaServer Page.
+_UI_WIZARD_NEW_TITLE = New JSP File
+_UI_WIZARD_NEW_HEADING = JSP
+_UI_WIZARD_NEW_DESCRIPTION = Create a new JSP file.
 _UI_WIZARD_TAG_NEW_TITLE = New Tag File
 _UI_WIZARD_TAG_NEW_HEADING = Tag File
 _UI_WIZARD_TAG_NEW_DESCRIPTION = Create a new Tag.
@@ -48,16 +48,18 @@
 NewJSPTemplatesWizardPage_1=Select a template as initial content in the JSP page.
 NewJSPTemplatesWizardPage_2=Name
 NewJSPTemplatesWizardPage_3=Description
-NewJSPTemplatesWizardPage_4=Use JSP Template
-NewJSPTemplatesWizardPage_5=Preview
+NewJSPTemplatesWizardPage_4=&Use JSP Template
+NewJSPTemplatesWizardPage_5=&Preview:
 NewJSPTemplatesWizardPage_6=Templates are 'New JSP' templates found in the <a>JSP Templates</a> preference page.
+NewJSPTemplatesWizardPage_7=&Templates:
 NewTagTemplatesWizardPage_0=Select Tag file Template
 NewTagTemplatesWizardPage_1=Select a template as initial content in the Tag file.
 NewTagTemplatesWizardPage_2=Name
 NewTagTemplatesWizardPage_3=Description
-NewTagTemplatesWizardPage_4=Use Tag file Template
-NewTagTemplatesWizardPage_5=Preview
+NewTagTemplatesWizardPage_4=&Use Tag file Template
+NewTagTemplatesWizardPage_5=&Preview:
 NewTagTemplatesWizardPage_6=Templates are 'New Tag' templates found in the <a>JSP Templates</a> preference page.
+NewTagTemplatesWizardPage_7=&Templates:
 # Copied from sse.ui
 CleanupDocument_label=Cleanup Document...
 CleanupDocument_tooltip=Cleanup Document
@@ -109,6 +111,10 @@
 JSPTyping_Auto_Complete=Automatically close
 JSPTyping_Complete_Scriptlets=&Scriptlet regions
 JSPTyping_Complete_Braces=&Braces in EL expressions
+JSPTyping_Complete_Comments=&JSP comments
+JSPTyping_Java_Code=Java
+JSPTyping_Close_Strings=Automatically close "s&trings"
+JSPTyping_Close_Brackets=Automatically close (parentheses), [square] and <angle> brac&kets
 # Validation page strings
 Validation_description=Select the severity level for the following validation problems:
 Validation_Warning=Warning
@@ -141,6 +147,7 @@
 VALIDATION_HEADER_CUSTOM_ACTIONS=Custom actions
 VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE=Missing required attribute:
 VALIDATION_ACTIONS_SEVERITY_UNKNOWN_ATTRIBUTE=Unknown attribute:
+VALIDATION_ACTIONS_SEVERITY_UNEXPECTED_RTEXPRVALUE=Attribute does not support runtime expressions:
 VALIDATION_ACTIONS_SEVERITY_NON_EMPTY_INLINE_TAG=Tag declared with empty content has content:
 VALIDATION_TRANSLATION_TEI_VALIDATION_MESSAGE=TagExtraInfo validation message:
 VALIDATION_TRANSLATION_TEI_CLASS_NOT_FOUND=TagExtraInfo class not on Java Build Path:
@@ -152,3 +159,12 @@
 VALIDATION_TRANSLATION_USEBEAN_INVALID_ID=Invalid 'id' specified for jsp:useBean:
 VALIDATION_TRANSLATION_USBEAN_MISSING_TYPE_INFO=Missing type information for jsp:useBean:
 VALIDATION_TRANSLATION_USEBEAN_AMBIGUOUS_TYPE_INFO=Ambiguous type information for jsp:useBean:
+
+Open=Open ''{0}''
+TLDHyperlink_hyperlinkText=Open Descriptor
+CustomTagHyperlink_hyperlinkText=Open Declaration
+TLDContentOutlineConfiguration_0=Show Content Values
+TagPropertyPage_desc=Specify the surrounding language used in this tag file:
+
+JSPFilesPreferencePage_Search_group=Search
+JSPFilesPreferencePage_Supply_JSP_search_to_Java_search=&Include JSP matches in Java searches
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/actions/JSPNodeActionManager.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/actions/JSPNodeActionManager.java
new file mode 100644
index 0000000..ba58b98
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/actions/JSPNodeActionManager.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.actions;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
+import org.eclipse.wst.html.ui.internal.contentoutline.HTMLNodeActionManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.w3c.dom.Node;
+
+public class JSPNodeActionManager extends HTMLNodeActionManager {
+
+	public JSPNodeActionManager(IStructuredModel model, Viewer viewer) {
+		super(model, viewer);
+	}
+	
+	protected boolean canContributeChildActions(Node node){
+		String nodeName = node.getNodeName().toLowerCase();
+		return !(nodeName.equals(JSP11Namespace.ElementName.SCRIPTLET) || nodeName.equals(JSP11Namespace.ElementName.DECLARATION) || nodeName.equals(JSP11Namespace.ElementName.EXPRESSION));
+	}
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSP.java
index 82a8f9f..d0c7abd 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSP.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSP.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,9 +23,14 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.texteditor.ITextEditor;
 import org.eclipse.ui.texteditor.ITextEditorExtension3;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.w3c.dom.Node;
 
 public class StructuredAutoEditStrategyJSP implements IAutoEditStrategy {
 	public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
@@ -39,10 +44,12 @@
 
 			if (model != null) {
 				if (command.text != null) {
+					smartInsertForEndTag(command, document, model);
+
 					if (command.text.equals("%") && isPreferenceEnabled(JSPUIPreferenceNames.TYPING_COMPLETE_SCRIPTLETS)) { //$NON-NLS-1$
 						// scriptlet - add end %>
 						IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset);
-						if (prefixedWith(document, command.offset, "<") && !node.getSource().endsWith("%>")) { //$NON-NLS-1$ //$NON-NLS-2$
+						if (node != null && prefixedWith(document, command.offset, "<") && !node.getSource().endsWith("%>")) { //$NON-NLS-1$ //$NON-NLS-2$
 							command.text += " %>"; //$NON-NLS-1$
 							command.shiftsCaret = false;
 							command.caretOffset = command.offset + 1;
@@ -51,7 +58,7 @@
 					}
 					if (command.text.equals("{") && isPreferenceEnabled(JSPUIPreferenceNames.TYPING_COMPLETE_EL_BRACES)) { //$NON-NLS-1$
 						IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset);
-						if ((prefixedWith(document, command.offset, "$") || prefixedWith(document, command.offset, "#")) && //$NON-NLS-1$ //$NON-NLS-2$
+						if (node != null && (prefixedWith(document, command.offset, "$") || prefixedWith(document, command.offset, "#")) && //$NON-NLS-1$ //$NON-NLS-2$
 									!node.getSource().endsWith("}")) { //$NON-NLS-1$ //$NON-NLS-2$
 							command.text += " }"; //$NON-NLS-1$
 							command.shiftsCaret = false;
@@ -107,4 +114,56 @@
 			return false;
 		}
 	}
+	
+	private boolean isCommentNode(IDOMNode node) {
+		return ((node != null) && (node instanceof IDOMElement) && ((IDOMElement) node).isCommentTag());
+	}
+
+	private boolean isDocumentNode(IDOMNode node) {
+		return ((node != null) && (node.getNodeType() == Node.DOCUMENT_NODE));
+	}
+	
+	private void smartInsertForEndTag(DocumentCommand command, IDocument document, IStructuredModel model) {
+		try {
+			if (command.text.equals("/") && (document.getLength() >= 1) && document.get(command.offset - 1, 1).equals("<") && HTMLUIPlugin.getDefault().getPreferenceStore().getBoolean(HTMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS)) { //$NON-NLS-1$ //$NON-NLS-2$
+				IDOMNode parentNode = (IDOMNode) ((IDOMNode) model.getIndexedRegion(command.offset - 1)).getParentNode();
+				if (isCommentNode(parentNode)) {
+					// loop and find non comment node parent
+					while ((parentNode != null) && isCommentNode(parentNode)) {
+						parentNode = (IDOMNode) parentNode.getParentNode();
+					}
+				}
+
+				if (!isDocumentNode(parentNode)) {
+					// only add end tag if one does not already exist or if
+					// add '/' does not create one already
+					IStructuredDocumentRegion endTagStructuredDocumentRegion = parentNode.getEndStructuredDocumentRegion();
+					IDOMNode ancestor = parentNode;
+					boolean smartInsertForEnd = false;
+					if(endTagStructuredDocumentRegion != null) {
+						// Look for ancestors by the same name that are missing end tags
+						while((ancestor = (IDOMNode) ancestor.getParentNode()) != null) {
+							if(ancestor.getEndStructuredDocumentRegion() == null && parentNode.getNodeName().equals(ancestor.getNodeName())) {
+								smartInsertForEnd = true;
+								break;
+							}
+						}
+					}
+					if (endTagStructuredDocumentRegion == null || smartInsertForEnd) {
+						StringBuffer toAdd = new StringBuffer(parentNode.getNodeName());
+						if (toAdd.length() > 0) {
+							toAdd.append(">"); //$NON-NLS-1$
+							String suffix = toAdd.toString();
+							if ((document.getLength() < command.offset + suffix.length()) || (!suffix.equals(document.get(command.offset, suffix.length())))) {
+								command.text += suffix;
+							}
+						}
+					}
+				}
+			}
+		}
+		catch (BadLocationException e) {
+			Logger.logException(e);
+		}
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSPJava.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSPJava.java
new file mode 100644
index 0000000..dfd0a26
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSPJava.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.autoedit;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.DocumentCommand;
+import org.eclipse.jface.text.IAutoEditStrategy;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorExtension3;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+
+public class StructuredAutoEditStrategyJSPJava implements IAutoEditStrategy {
+
+	public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
+		Object textEditor = getActiveTextEditor();
+		if (!(textEditor instanceof ITextEditorExtension3 && ((ITextEditorExtension3) textEditor).getInsertMode() == ITextEditorExtension3.SMART_INSERT))
+			return;
+		
+		IStructuredModel model = null;
+		try {
+			// Auto edit for JSP Comments
+			if ("-".equals(command.text) && isPreferenceEnabled(JSPUIPreferenceNames.TYPING_COMPLETE_COMMENTS)) { //$NON-NLS-1$
+				if (prefixedWith(document, command.offset, "<%-")) { //$NON-NLS-1$
+					
+					model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+					if (model != null) {
+						IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset);
+						IDOMNode parent = (node != null) ? (IDOMNode) node.getParentNode() : null;
+						// Parent is the scriptlet tag
+						if (parent != null && !parent.getSource().endsWith("--%>")) { //$NON-NLS-1$
+							IStructuredDocumentRegion end = parent.getEndStructuredDocumentRegion();
+							if (end != null) {
+								try {
+									document.replace(end.getStartOffset(), 0, "--"); //$NON-NLS-1$
+								} catch (BadLocationException e) {
+									Logger.logException(e);
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+		finally {
+			if (model != null)
+				model.releaseFromRead();
+		}
+	}
+	
+	private boolean isPreferenceEnabled(String key) {
+		return (key != null && JSPUIPlugin.getDefault().getPreferenceStore().getBoolean(key));
+	}
+	
+	/**
+	 * Return the active text editor if possible, otherwise the active editor
+	 * part.
+	 * 
+	 * @return
+	 */
+	private Object getActiveTextEditor() {
+		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+		if (window != null) {
+			IWorkbenchPage page = window.getActivePage();
+			if (page != null) {
+				IEditorPart editor = page.getActiveEditor();
+				if (editor != null) {
+					if (editor instanceof ITextEditor)
+						return editor;
+					ITextEditor textEditor = (ITextEditor) editor.getAdapter(ITextEditor.class);
+					if (textEditor != null)
+						return textEditor;
+					return editor;
+				}
+			}
+		}
+		return null;
+	}
+
+	private boolean prefixedWith(IDocument document, int offset, String string) {
+
+		try {
+			return document.getLength() >= string.length() && document.get(offset - string.length(), string.length()).equals(string);
+		}
+		catch (BadLocationException e) {
+			Logger.logException(e);
+			return false;
+		}
+	}
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java
index f897fe2..ec9081e 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -192,7 +192,8 @@
 						// custom
 						// tags,
 						// return that position
-						if (type == IJSPPartitions.JSP_CONTENT_JAVA || type == IJSPPartitions.JSP_DIRECTIVE) {
+						if (type == IJSPPartitions.JSP_CONTENT_JAVA || type == IJSPPartitions.JSP_DIRECTIVE ||
+								type == IJSPPartitions.JSP_DEFAULT_EL || type == IJSPPartitions.JSP_DEFAULT_EL2) {
 							result = partitions[i].getOffset();
 						}
 					}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/AutoImportProposal.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/AutoImportProposal.java
index a3e5a62..07256dd 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/AutoImportProposal.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/AutoImportProposal.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,11 +13,14 @@
 
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jdt.core.IImportContainer;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.TextUtilities;
 import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP20TLDNames;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
 import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
 import org.eclipse.jst.jsp.ui.internal.Logger;
 import org.eclipse.swt.graphics.Image;
@@ -27,33 +30,58 @@
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 public class AutoImportProposal extends JSPCompletionProposal {
 	
 	// the import string, no quotes or colons
 	String fImportDeclaration;
-	
+	IImportContainer fImportContainer;
+
 	public AutoImportProposal(String importDeclaration, String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, IContextInformation contextInformation, String additionalProposalInfo, int relevance, boolean updateReplacementLengthOnValidate) {
 		super(replacementString, replacementOffset, replacementLength, cursorPosition, image, displayString, contextInformation, additionalProposalInfo, relevance, updateReplacementLengthOnValidate);
 		setImportDeclaration(importDeclaration);
 	}
-	
+
+	public AutoImportProposal(String importDeclaration, IImportContainer importContainer ,String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, IContextInformation contextInformation, String additionalProposalInfo, int relevance, boolean updateReplacementLengthOnValidate) {
+		this(importDeclaration, replacementString, replacementOffset, replacementLength, cursorPosition, image, displayString, contextInformation, additionalProposalInfo, relevance, updateReplacementLengthOnValidate);
+		fImportContainer = importContainer;
+	}
+
 	public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
 		super.apply(viewer, trigger, stateMask, offset);
-		addImportDeclaration(viewer);
+		// if the import doesn't exist, add it
+		String importDecl = getImportDeclaration().replaceAll(";", "");  //$NON-NLS-1$//$NON-NLS-2$
+		if (fImportContainer == null || !(fImportContainer.getImport(importDecl).exists() || isImportPageDirective(viewer, offset)))
+			addImportDeclaration(viewer);
+	}
+	
+	private boolean isImportPageDirective(ITextViewer viewer, int offset){
+		Node node = (Node) ContentAssistUtils.getNodeAt(viewer, offset);
+		
+		while ((node != null) && (node.getNodeType() == Node.TEXT_NODE) && (node.getParentNode() != null)) {
+			node = node.getParentNode();
+		}
+		if (node.getNodeName().equalsIgnoreCase(JSP11Namespace.ElementName.DIRECTIVE_PAGE)){
+			NamedNodeMap nodeMap = node.getAttributes();
+			if (nodeMap != null)
+				return nodeMap.getNamedItem(JSP20TLDNames.IMPORT) != null;
+		}
+		
+		return false ;
 	}
 	/**
 	 * adds the import declaration to the document in the viewer in the appropriate position
 	 * @param viewer
 	 */
 	private void addImportDeclaration(ITextViewer viewer) {
-		
 		IDocument doc = viewer.getDocument();
 		
 		// calculate once and pass along
@@ -75,6 +103,16 @@
 		// make sure the cursor position after is correct
 		setCursorPosition(getCursorPosition() + insertText.length());
 	}
+	
+ 	private Node getInsertNode(IDOMDocument documentNode) {
+		NodeList childNodes = documentNode.getChildNodes();
+		for (int i = 0; i < childNodes.getLength(); i++) {
+			if (childNodes.item(i).getNodeType() == Node.ELEMENT_NODE)
+				return childNodes.item(i);
+		}
+		return documentNode.getFirstChild();
+	}
+	
 	/**
 	 * 
 	 * @param doc
@@ -88,18 +126,41 @@
 			if (sModel != null) {
 				if (sModel instanceof IDOMModel) {
 					IDOMDocument documentNode = ((IDOMModel) sModel).getDocument();
-					Node docElement = documentNode.getDocumentElement();
-					if (docElement != null && docElement instanceof IDOMElement) {
-						IStructuredDocumentRegion sdRegion = ((IDOMElement) docElement).getFirstStructuredDocumentRegion();
+					/*
+					 * document element must be sole Element child of Document
+					 * to remain valid
+					 */
+					Node targetElement = null;
+					if (isXml) {
+						targetElement = documentNode.getDocumentElement();
+					}
+					if (targetElement == null)
+						targetElement = getInsertNode(documentNode);
+					if (targetElement != null) {
+						IStructuredDocumentRegion sdRegion = ((IDOMNode) targetElement).getFirstStructuredDocumentRegion();
 						if (isXml) {
-							// insert right after document element
+							/*
+							 * document Element must be sole Element child of
+							 * Document to remain valid, so insert after
+							 */
 							pos = sdRegion.getEndOffset();
+							try {
+								while (pos < doc.getLength() && (doc.getChar(pos) == '\r' || doc.getChar(pos) == '\n')) {
+									pos++;
+								}
+							}
+							catch (BadLocationException e) {
+								// not important, use pos as determined earlier
+							}
 						}
 						else {
-							// insert before document element
+							// insert before target element
 							pos = sdRegion.getStartOffset();
 						}
 					}
+					else {
+						pos = 0;
+					}
 				}
 			}
 		}
@@ -110,7 +171,7 @@
 		return pos;
 	}
 	
- 	// Genuitec bug #6227,
+	// Genuitec bug #6227,
 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203303
 	private boolean isCustomTagDocument(IDocument doc) {
 		boolean isTag = false;
@@ -190,7 +251,7 @@
 				closing = "\"%>"; //$NON-NLS-1$
 			}
 		}
-		return delim + opening + getImportDeclaration() + closing;
+		return opening + getImportDeclaration() + closing + delim;
 	}
 
 	public String getImportDeclaration() {
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java
index d23d28e..eded388 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.WorkingCopyOwner;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.Position;
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
@@ -34,6 +35,7 @@
 
 /**
  * @plannedfor 1.0
+ * @deprecated This class is no longer used locally and will be removed in the future
  */
 public class JSPCompletionProcessor implements IContentAssistProcessor, IReleasable {
 	// for debugging
@@ -49,6 +51,8 @@
 	protected String fErrorMessage = null;
 	protected StructuredTextViewer fViewer = null;
 	private JSPTranslationAdapter fTranslationAdapter = null;
+	// translation adapter may be stale, check the model id
+	private String fModelId = null;
 
 	/**
 	 * Returns a list of completion proposals based on the specified location
@@ -64,6 +68,24 @@
 	 *         proposals are possible
 	 */
 	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int pos) {
+		return computeCompletionProposals(viewer, pos, 0);
+	}
+	
+	/**
+	 * The same as the normal <code>computeCompeltaionProposals</code> except the calculated
+	 * java position is offset by the given extra offset.
+	 * 
+	 * @param viewer
+	 *            the viewer whose document is used to compute the proposals
+	 * @param documentPosition
+	 *            an offset within the document for which completions should
+	 *            be computed
+	 * @param javaPositionExtraOffset
+	 * 				the extra offset for the java position
+	 * @return an array of completion proposals or <code>null</code> if no
+	 *         proposals are possible
+	 */
+	protected ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int pos, int javaPositionExtraOffset) {
 		initialize(pos);
 
 		JSPProposalCollector collector = null;
@@ -76,12 +98,14 @@
 			xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(fViewer.getDocument());
 
 			IDOMDocument xmlDoc = xmlModel.getDocument();
-			if (fTranslationAdapter == null)
+			if (fTranslationAdapter == null || xmlModel.getId() != fModelId) {
 				fTranslationAdapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
+				fModelId = xmlModel.getId();
+			}
 			if (fTranslationAdapter != null) {
 
 				JSPTranslation translation = fTranslationAdapter.getJSPTranslation();
-				fJavaPosition = translation.getJavaOffset(getDocumentPosition());
+				fJavaPosition = translation.getJavaOffset(getDocumentPosition())+javaPositionExtraOffset;
 
 				if (DEBUG)
 					System.out.println(debug(translation));
@@ -97,7 +121,7 @@
 					
 					collector = getProposalCollector(cu, translation);
 					synchronized (cu) {
-						cu.codeComplete(fJavaPosition, collector, null);
+						cu.codeComplete(fJavaPosition, collector, (WorkingCopyOwner) null);
 					}
 				}
 				catch (CoreException coreEx) {
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposal.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposal.java
index 075eadc..c4a6036 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposal.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposal.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,9 +10,14 @@
  *******************************************************************************/
 package org.eclipse.jst.jsp.ui.internal.contentassist;
 
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IInformationControlCreator;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.ICompletionProposalExtension3;
+import org.eclipse.jface.text.contentassist.ICompletionProposalExtension5;
 import org.eclipse.jface.text.contentassist.IContextInformation;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
@@ -22,8 +27,9 @@
  *
  * @plannedfor 1.0
  */
-public class JSPCompletionProposal extends CustomCompletionProposal implements IJavaCompletionProposal  {
+public class JSPCompletionProposal extends CustomCompletionProposal implements IJavaCompletionProposal, ICompletionProposalExtension3, ICompletionProposalExtension5 {
 
+	private static final char[] TRIGGERS = new char[] { '.', '[' };
 	/*
 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=124483
 	 * 
@@ -42,7 +48,14 @@
 	 * Sets cursor position after applying.
 	 */
 	public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
+		if (trigger != (char) 0 ) {
+			setReplacementString(getReplacementString() + trigger);
+			setCursorPosition(getCursorPosition() + 1);
+		}
 		super.apply(viewer, trigger, stateMask, offset);
+		//move the caret to the end of the change
+		int endOffsetOfChanges = getReplacementString().length() + getReplacementOffset();
+		viewer.getTextWidget().setCaretOffset(endOffsetOfChanges);
 	}
 
 	final public ICompletionProposal getJavaCompletionProposal() {
@@ -54,7 +67,6 @@
 	}
 	
 	public String getAdditionalProposalInfo() {
-		
 		String additionalInfo = super.getAdditionalProposalInfo();
 		ICompletionProposal javaProposal = getJavaCompletionProposal();
 		if(javaProposal != null)
@@ -62,4 +74,72 @@
 		
 		return additionalInfo;
 	}
+
+	/**
+	 * use the java proposals image if there is one for this proposals image
+	 */                                                                     
+	public Image getImage() {                                               
+		if(this.fJavaCompletionProposal != null) {                          
+			return this.fJavaCompletionProposal.getImage();                 
+		} else {                                                            
+			return super.getImage();                                        
+		}                                                                   
+	}                                                                       
+
+	/* 
+	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension5#getAdditionalProposalInfo(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
+		Object additionalInfo = super.getAdditionalProposalInfo();
+		ICompletionProposal javaProposal = getJavaCompletionProposal();
+		if (javaProposal != null) {
+			if (javaProposal instanceof ICompletionProposalExtension5)
+				// https://bugs.eclipse.org/bugs/show_bug.cgi?id=260951
+				additionalInfo = ((ICompletionProposalExtension5) javaProposal).getAdditionalProposalInfo(monitor);
+			else
+				additionalInfo = javaProposal.getAdditionalProposalInfo();
+		}
+
+		return additionalInfo;
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getInformationControlCreator()
+	 */
+	public IInformationControlCreator getInformationControlCreator() {
+		// [277530] Use the java proposal's information control creator
+		ICompletionProposal javaProposal = getJavaCompletionProposal();
+		IInformationControlCreator informationControlCreator = null;
+
+		if (javaProposal instanceof ICompletionProposalExtension3)
+			informationControlCreator = ((ICompletionProposalExtension3) javaProposal).getInformationControlCreator();
+
+		return informationControlCreator;
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getPrefixCompletionStart(org.eclipse.jface.text.IDocument, int)
+	 */
+	public int getPrefixCompletionStart(IDocument document, int completionOffset) {
+		ICompletionProposal javaProposal = getJavaCompletionProposal();
+		if (javaProposal instanceof ICompletionProposalExtension3)
+			return ((ICompletionProposalExtension3) javaProposal).getPrefixCompletionStart(document, completionOffset);
+
+		return getReplacementOffset();
+	}
+
+	public char[] getTriggerCharacters() {
+		return TRIGGERS;
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getPrefixCompletionText(org.eclipse.jface.text.IDocument, int)
+	 */
+	public CharSequence getPrefixCompletionText(IDocument document, int completionOffset) {
+		ICompletionProposal javaProposal = getJavaCompletionProposal();
+		if (javaProposal instanceof ICompletionProposalExtension3)
+			return ((ICompletionProposalExtension3) javaProposal).getPrefixCompletionText(document, completionOffset);
+
+		return getReplacementString();
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposalComputer.java
new file mode 100644
index 0000000..99161fb
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposalComputer.java
@@ -0,0 +1,226 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.Iterator;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImages;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * <p>Computes JSP specific proposals</p>
+ * 
+ * @base org.eclipse.jst.jsp.ui.internal.contentassist.JSPContentAssistProcessor
+ */
+public class JSPCompletionProposalComputer extends DefaultXMLCompletionProposalComputer {
+	/**
+	 * <p>Create the computer</p>
+	 */
+	public JSPCompletionProposalComputer() {
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeCompletionProposals(java.lang.String, org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion, org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode, org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected ContentAssistRequest computeCompletionProposals(String matchString, ITextRegion completionRegion,
+			IDOMNode treeNode, IDOMNode xmlnode, CompletionProposalInvocationContext context) {
+
+		//be sure to get the super proposals
+		ContentAssistRequest request = super.computeCompletionProposals(matchString, completionRegion, treeNode, xmlnode, context);
+		
+		//calculate JSP specific proposals
+		int documentPosition = context.getInvocationOffset();
+		IStructuredDocumentRegion sdRegion = ContentAssistUtils.getStructuredDocumentRegion(
+				context.getViewer(), documentPosition);
+
+		Document doc = null;
+		if (xmlnode != null) {
+			if (xmlnode.getNodeType() == Node.DOCUMENT_NODE) {
+				doc = (Document) xmlnode;
+			} else {
+				doc = xmlnode.getOwnerDocument();
+			}
+		}
+		String[] directiveNames = {"page", "include", "taglib"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		
+		ITextRegion prevTextRegion = null;
+		try {
+			int offset = sdRegion.getStartOffset(completionRegion);
+			if(offset > 0) {
+				offset--;
+			}
+			ITypedRegion prevRegion = context.getDocument().getPartition(offset);
+			prevTextRegion = sdRegion.getRegionAtCharacterOffset(prevRegion.getOffset());
+		} catch(BadLocationException e) {
+			//this should never happen
+			Logger.logException(e);
+		}
+		
+		// suggest JSP Expression inside of XML comments
+		if (completionRegion.getType() == DOMRegionContext.XML_COMMENT_TEXT && !isXMLFormat(doc)) {
+			if (request == null) {
+				request = new ContentAssistRequest(treeNode, xmlnode, sdRegion,
+						completionRegion, documentPosition, 0, ""); //$NON-NLS-1$
+			}
+			request.addProposal(new CustomCompletionProposal("<%=  %>",//$NON-NLS-1$
+					documentPosition, 0, 4,
+					JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP),
+					"jsp:expression", null, "&lt;%= %&gt;", XMLRelevanceConstants.R_JSP)); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+		/* handle proposals in and around JSP_DIRECTIVE_OPEN,
+		 * JSP_DIRECTIVE_CLOSE (preceded by OPEN) and JSP_DIRECTIVE_NAME
+		 */
+		else if ((completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN &&
+				documentPosition >= sdRegion.getTextEndOffset(completionRegion)) ||
+				(completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME &&
+						documentPosition <= sdRegion.getTextEndOffset(completionRegion)) ||
+				(completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE &&
+						prevTextRegion != null &&
+						prevTextRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN &&
+						documentPosition <= sdRegion.getTextEndOffset(completionRegion))) {
+
+			if (completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN ||
+					completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE) {
+				
+				if (request == null) {
+					request = new ContentAssistRequest(xmlnode, xmlnode, sdRegion,
+							completionRegion, documentPosition, 0, matchString);
+				}
+				
+				//determine if there is any part of a directive name already existing
+				Iterator regions = sdRegion.getRegions().iterator();
+				String nameString = null;
+				int begin = request.getReplacementBeginPosition();
+				int length = request.getReplacementLength();
+				while (regions.hasNext()) {
+					ITextRegion region = (ITextRegion) regions.next();
+					if (region.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
+						nameString = sdRegion.getText(region);
+						begin = sdRegion.getStartOffset(region);
+						length = region.getTextLength();
+						break;
+					}
+				}
+				if (nameString == null) {
+					nameString = ""; //$NON-NLS-1$
+				}
+				
+				/* Suggest the directive names that have been determined to be
+				 * appropriate based on existing content
+				 */
+				for (int i = 0; i < directiveNames.length; i++) {
+					if (directiveNames[i].startsWith(nameString) || documentPosition <= begin) {
+						request.addProposal(new CustomCompletionProposal(directiveNames[i], begin,
+								length, directiveNames[i].length(),
+								JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP),
+								directiveNames[i], null, null, XMLRelevanceConstants.R_JSP));
+					}
+				}
+			}
+			// by default, JSP_DIRECTIVE_NAME
+			else { 
+				if (request == null) {
+					request = new ContentAssistRequest(xmlnode, xmlnode, sdRegion,
+							completionRegion, sdRegion.getStartOffset(completionRegion),
+							completionRegion.getTextLength(), matchString);
+				}
+				//add each of the directive names as a proposal
+				for (int i = 0; i < directiveNames.length; i++) {
+					if (directiveNames[i].startsWith(matchString)) {
+						request.addProposal(new CustomCompletionProposal(
+								directiveNames[i], request.getReplacementBeginPosition(),
+								request.getReplacementLength(), directiveNames[i].length(),
+								JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP),
+								directiveNames[i], null, null, XMLRelevanceConstants.R_JSP));
+					}
+				}
+			}
+		}
+		else if ((completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME &&
+				documentPosition > sdRegion.getTextEndOffset(completionRegion)) ||
+				(completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE &&
+						documentPosition <= sdRegion.getStartOffset(completionRegion))) {
+			
+			if (request == null) {
+				request = computeAttributeProposals(matchString, completionRegion,
+						treeNode, xmlnode, context);
+			}
+		}
+		// no name?: <%@ %>
+		else if (completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE &&
+				documentPosition <= sdRegion.getStartOffset(completionRegion)) {
+			if (request != null) {
+				request = computeAttributeProposals(matchString, completionRegion, treeNode,
+						xmlnode, context);
+			}
+			Iterator regions = sdRegion.getRegions().iterator();
+			String nameString = null;
+			while (regions.hasNext()) {
+				ITextRegion region = (ITextRegion) regions.next();
+				if (region.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
+					nameString = sdRegion.getText(region);
+					break;
+				}
+			}
+			if (nameString == null) {
+				for (int i = 0; i < directiveNames.length; i++) {
+					request.addProposal(new CustomCompletionProposal(
+							directiveNames[i], request.getReplacementBeginPosition(),
+							request.getReplacementLength(), directiveNames[i].length(),
+							JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP),
+							directiveNames[i], null, null, XMLRelevanceConstants.R_JSP));
+				}
+			}
+		}
+
+		return request;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeValueProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		//nothing to suggest here
+	}
+
+	/**
+	 * @param doc determine if this doc is XML format
+	 * @return <code>true</code> if the given doc is of XML format, <code>false</code> otherwise.
+	 */
+	private boolean isXMLFormat(Document doc) {
+		if (doc == null)
+			return false;
+		Element docElement = doc.getDocumentElement();
+		return docElement != null && ((docElement.getNodeName().equals("jsp:root")) ||
+				((((IDOMNode) docElement).getStartStructuredDocumentRegion() == null &&
+						((IDOMNode) docElement).getEndStructuredDocumentRegion() == null))); //$NON-NLS-1$
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistHelper.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistHelper.java
new file mode 100644
index 0000000..1bbb4c4
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistHelper.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+
+/**
+ * <p>Helpful utility methods for JSP content assist</p>
+ */
+public class JSPContentAssistHelper {
+	/**
+	 * Returns project request is in
+	 * 
+	 * @param request
+	 * @return {@link IResource} representing the project the given request was made in
+	 */
+	public static IResource getResource(ContentAssistRequest request) {
+		IResource resource = null;
+		String baselocation = null;
+
+		if (request != null) {
+			IStructuredDocumentRegion region = request.getDocumentRegion();
+			if (region != null) {
+				IDocument document = region.getParentDocument();
+				IStructuredModel model = null;
+				try {
+					model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+					if (model != null) {
+						baselocation = model.getBaseLocation();
+					}
+				} finally {
+					if (model != null)
+						model.releaseFromRead();
+				}
+			}
+		}
+
+		if (baselocation != null) {
+			// copied from JSPTranslationAdapter#getJavaProject
+			IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+			IPath filePath = new Path(baselocation);
+			IFile file = null;
+
+			if (filePath.segmentCount() > 1) {
+				file = root.getFile(filePath);
+			}
+			if (file != null) {
+				resource = file.getProject();
+			}
+		}
+		return resource;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java
index 5f7c509..892f559 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,17 +11,18 @@
 package org.eclipse.jst.jsp.ui.internal.contentassist;
 
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
 import java.util.Vector;
 
 import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.ITextViewerExtension5;
 import org.eclipse.jface.text.TextUtilities;
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
 import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
@@ -35,7 +36,6 @@
 import org.eclipse.jst.jsp.core.internal.document.PageDirectiveAdapterFactory;
 import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
 import org.eclipse.jst.jsp.core.internal.provisional.JSP12Namespace;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP20Namespace;
 import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
 import org.eclipse.jst.jsp.core.text.IJSPPartitions;
@@ -45,9 +45,7 @@
 import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImages;
 import org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeIdsJSP;
 import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
 import org.eclipse.wst.html.core.internal.contentmodel.JSPCMDocument;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
 import org.eclipse.wst.html.core.text.IHTMLPartitions;
 import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
 import org.eclipse.wst.html.ui.internal.contentassist.HTMLContentAssistProcessor;
@@ -66,7 +64,6 @@
 import org.eclipse.wst.sse.core.text.IStructuredPartitions;
 import org.eclipse.wst.sse.core.utils.StringUtils;
 import org.eclipse.wst.sse.ui.internal.IReleasable;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
 import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
 import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
 import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
@@ -75,9 +72,7 @@
 import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistry;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAction;
 import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
 import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
 import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
@@ -86,14 +81,13 @@
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
 import org.eclipse.wst.xml.core.text.IXMLPartitions;
 import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
 import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-import org.eclipse.wst.xml.ui.internal.contentassist.NonValidatingModelQueryAction;
 import org.eclipse.wst.xml.ui.internal.contentassist.ProposalComparator;
 import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistProcessor;
 import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistUtilities;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
 import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
@@ -105,7 +99,8 @@
  * Adds proposals not normally covered by the generic behavior with the
  * content model
  * 
- * @plannedfor 1.0
+ * @deprecated This class is no longer used locally and will be removed in the future
+ * @see JSPStructuredContentAssistProcessor
  */
 public class JSPContentAssistProcessor extends AbstractContentAssistProcessor {
 
@@ -255,45 +250,33 @@
 			if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
 				break;
 		}
-
-		String attributeName = null;
-		if (nameRegion != null)
-			attributeName = open.getText(nameRegion);
-		String currentValue = null;
-		if (attributeName != null)
-			currentValue = node.getAttributes().getNamedItem(attributeName).getNodeValue();
-
+		
 		// on an empty value, add all the JSP and taglib tags
-		if ((contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS && contentAssistRequest.getReplacementLength() == 0) || (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE && (currentValue == null || currentValue.length() == 0))) {
-			List rejectElements = new ArrayList();
-			rejectElements.add(JSP12Namespace.ElementName.SCRIPTLET);
-			rejectElements.add(JSP12Namespace.ElementName.EXPRESSION);
-			rejectElements.add(JSP12Namespace.ElementName.DECLARATION);
-			rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_INCLUDE);
-			rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_PAGE);
-			rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_TAGLIB);
-			rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
-			rejectElements.add(JSP12Namespace.ElementName.USEBEAN);
-			rejectElements.add(JSP12Namespace.ElementName.SETPROPERTY);
-			rejectElements.add(JSP12Namespace.ElementName.FORWARD);
-			rejectElements.add(JSP12Namespace.ElementName.PLUGIN);
-			rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
-			rejectElements.add(JSP12Namespace.ElementName.PARAMS);
-
-			List additionalElements = getAdditionalChildren(new ArrayList(), node, -1);
-			for (i = 0; i < additionalElements.size(); i++) {
-				CMElementDeclaration ed = (CMElementDeclaration) additionalElements.get(i);
-				if (rejectElements.contains(ed.getNodeName()))
-					continue;
-				String tagname = getContentGenerator().getRequiredName(node, ed);
-				StringBuffer contents = new StringBuffer("\""); //$NON-NLS-1$
-				getContentGenerator().generateTag(node, ed, contents);
-				contents.append('"');
-				CustomCompletionProposal proposal = new CustomCompletionProposal(contents.toString(), contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), contents.length(), JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_GENERIC), tagname, null, null, XMLRelevanceConstants.R_JSP_ATTRIBUTE_VALUE);
-				contentAssistRequest.addProposal(proposal);
+		CMElementDeclaration elementDecl = getCMElementDeclaration(node);
+		if (nameRegion != null && elementDecl != null) {
+			String attributeName = open.getText(nameRegion);
+			if (attributeName != null) {
+				String currentValue = node.getAttributes().getNamedItem(attributeName).getNodeValue();
+				
+				if(currentValue == null || currentValue.length() == 0) { //$NON-NLS-1$
+					List additionalElements = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent((Element) node, elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
+					for (i = 0; i < additionalElements.size(); i++) {
+						Object additionalElement = additionalElements.get(i);
+						if(additionalElement instanceof CMElementDeclaration) {
+							CMElementDeclaration ed = (CMElementDeclaration) additionalElement;
+	
+							String tagname = getContentGenerator().getRequiredName(node, ed);
+							StringBuffer contents = new StringBuffer("\""); //$NON-NLS-1$
+							getContentGenerator().generateTag(node, ed, contents);
+							contents.append('"'); //$NON-NLS-1$
+							CustomCompletionProposal proposal = new CustomCompletionProposal(contents.toString(), contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), contents.length(), JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_GENERIC), tagname, null, null, XMLRelevanceConstants.R_JSP_ATTRIBUTE_VALUE);
+							contentAssistRequest.addProposal(proposal);
+						}
+					}
+				
+				}
 			}
 		}
-
 		else if (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
 			try {
 				// Create a new model for Content Assist to operate on. This
@@ -422,127 +405,6 @@
 
 	}
 
-	private List getAdditionalChildren(List elementDecls, Node node, int childIndex) {
-		if (node instanceof IDOMNode) {
-			/*
-			 * find the location of the intended insertion as it will give us
-			 * the correct offset for checking position dependent CMDocuments
-			 */
-			int textInsertionOffset = 0;
-			NodeList children = node.getChildNodes();
-			if (children.getLength() >= childIndex && childIndex >= 0) {
-				Node nodeAlreadyAtIndex = children.item(childIndex);
-				if (nodeAlreadyAtIndex instanceof IDOMNode)
-					textInsertionOffset = ((IDOMNode) nodeAlreadyAtIndex).getEndOffset();
-			}
-			else {
-				textInsertionOffset = ((IDOMNode) node).getStartOffset();
-			}
-			TLDCMDocumentManager mgr = TaglibController.getTLDCMDocumentManager(((IDOMNode) node).getStructuredDocument());
-			if (mgr != null) {
-				List moreCMDocuments = mgr.getCMDocumentTrackers(textInsertionOffset);
-				if (moreCMDocuments != null) {
-					for (int i = 0; i < moreCMDocuments.size(); i++) {
-						CMDocument doc = (CMDocument) moreCMDocuments.get(i);
-						CMNamedNodeMap elements = doc.getElements();
-						if (elements != null) {
-							for (int j = 0; j < elements.getLength(); j++) {
-								CMElementDeclaration ed = (CMElementDeclaration) elements.item(j);
-								elementDecls.add(ed);
-							}
-						}
-					}
-				}
-			}
-
-			// get position dependent CMDocuments and insert their tags as
-			// proposals
-
-			ModelQueryAdapter mqAdapter = null;
-			if (node.getNodeType() == Node.DOCUMENT_NODE)
-				mqAdapter = (ModelQueryAdapter) ((IDOMNode) node).getAdapterFor(ModelQueryAdapter.class);
-			else
-				mqAdapter = (ModelQueryAdapter) ((IDOMNode) node.getOwnerDocument()).getAdapterFor(ModelQueryAdapter.class);
-
-			if (mqAdapter != null) {
-				CMDocument doc = mqAdapter.getModelQuery().getCorrespondingCMDocument(node);
-				if (doc != null) {
-					CMDocument jcmdoc = getDefaultJSPCMDocument((IDOMNode) node);
-					CMNamedNodeMap jspelements = jcmdoc.getElements();
-
-					/*
-					 * For a built-in JSP action the content model is properly
-					 * set up, so don't just blindly add the rest--unless this
-					 * will be a direct child of the document
-					 */
-					if (jspelements != null && (!(doc instanceof JSPCMDocument) || node.getNodeType() == Node.DOCUMENT_NODE)) {
-						List rejectElements = new ArrayList();
-
-						// determine if the document is in XML form
-						Document domDoc = null;
-						if (node.getNodeType() == Node.DOCUMENT_NODE)
-							domDoc = (Document) node;
-						else
-							domDoc = node.getOwnerDocument();
-
-						// Show XML tag forms of JSP markers if jsp:root is
-						// the document element OR it's HTML but
-						// isn't really in the text.
-						// If the document isn't strictly XML, pull out the
-						// XML tag forms it is xml format
-						rejectElements.add(JSP12Namespace.ElementName.SCRIPTLET);
-						rejectElements.add(JSP12Namespace.ElementName.EXPRESSION);
-						rejectElements.add(JSP12Namespace.ElementName.DECLARATION);
-						rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_INCLUDE);
-						rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_PAGE);
-						rejectElements.add(JSP12Namespace.ElementName.TEXT);
-						rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_TAGLIB);
-						rejectElements.add(JSP20Namespace.ElementName.DIRECTIVE_TAG);
-						rejectElements.add(JSP20Namespace.ElementName.DIRECTIVE_ATTRIBUTE);
-						rejectElements.add(JSP20Namespace.ElementName.DIRECTIVE_VARIABLE);
-						if (isXMLFormat(domDoc)) {
-							// jsp actions
-							rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
-							rejectElements.add(JSP12Namespace.ElementName.USEBEAN);
-							rejectElements.add(JSP12Namespace.ElementName.GETPROPERTY);
-							rejectElements.add(JSP12Namespace.ElementName.SETPROPERTY);
-							rejectElements.add(JSP12Namespace.ElementName.INCLUDE);
-							rejectElements.add(JSP12Namespace.ElementName.FORWARD);
-							rejectElements.add(JSP12Namespace.ElementName.PLUGIN);
-							rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
-							rejectElements.add(JSP12Namespace.ElementName.PARAM);
-							rejectElements.add(JSP12Namespace.ElementName.PARAMS);
-						}
-
-
-						// don't show jsp:root if a document element already
-						// exists
-						Element docElement = domDoc.getDocumentElement();
-						if (docElement != null && ((docElement.getNodeName().equals("jsp:root")) || ((((IDOMNode) docElement).getStartStructuredDocumentRegion() != null || ((IDOMNode) docElement).getEndStructuredDocumentRegion() != null)))) //$NON-NLS-1$
-							rejectElements.add(JSP12Namespace.ElementName.ROOT);
-
-						for (int j = 0; j < jspelements.getLength(); j++) {
-							CMElementDeclaration ed = (CMElementDeclaration) jspelements.item(j);
-							if (rejectElements.contains(ed.getNodeName()))
-								continue;
-							elementDecls.add(ed);
-						}
-
-					}
-				}
-				// No cm document (such as for the Document (a non-Element) node itself)
-				else {
-					CMNamedNodeMap jspElements = getDefaultJSPCMDocument((IDOMNode) node).getElements();
-					int length = jspElements.getLength();
-					for (int i = 0; i < length; i++) {
-						elementDecls.add(jspElements.item(i));
-					}
-				}
-			}
-		}
-		return elementDecls;
-	}
-
 	/**
 	 * For JSP files and segments, this is just the JSP
 	 *         document, but when editing tag files and their fragments, it
@@ -572,56 +434,6 @@
 		return jcmdoc;
 	}
 
-	protected List getAvailableChildrenAtIndex(Element parent, int index, int validityChecking) {
-		List list = new ArrayList();
-		List additionalElements = getAdditionalChildren(new ArrayList(), parent, index);
-		for (int i = 0; i < additionalElements.size(); i++) {
-			ModelQueryAction insertAction = new NonValidatingModelQueryAction((CMElementDeclaration) additionalElements.get(i), ModelQueryAction.INSERT, 0, parent.getChildNodes().getLength(), null);
-			list.add(insertAction);
-		}
-
-		// add allowed children of implicit tags that don't already exist
-		NodeList children = parent.getChildNodes();
-		List childNames = new ArrayList();
-		if (children != null) {
-			for (int i = 0; i < children.getLength(); i++) {
-				Node child = children.item(i);
-				if (child.getNodeType() == Node.ELEMENT_NODE)
-					childNames.add(child.getNodeName().toLowerCase());
-			}
-		}
-		List allActions = new ArrayList();
-		Iterator iterator = list.iterator();
-		ModelQuery modelQuery = ModelQueryUtil.getModelQuery(parent.getOwnerDocument());
-		while (iterator.hasNext()) {
-			ModelQueryAction action = (ModelQueryAction) iterator.next();
-			allActions.add(action);
-			if (action.getCMNode() instanceof HTMLElementDeclaration) {
-				HTMLElementDeclaration ed = (HTMLElementDeclaration) action.getCMNode();
-				String ommission = (String) ed.getProperty(HTMLCMProperties.OMIT_TYPE);
-				if (!childNames.contains(ed.getNodeName().toLowerCase()) && ((ommission != null) && (ommission.equals(HTMLCMProperties.Values.OMIT_BOTH)))) {
-					List implicitValidActions = new ArrayList();
-					modelQuery.getInsertActions(parent, ed, 0, ModelQuery.INCLUDE_CHILD_NODES, ModelQuery.VALIDITY_NONE, implicitValidActions);
-					if (implicitValidActions != null) {
-						Iterator implicitValidActionsIterator = implicitValidActions.iterator();
-						while (implicitValidActionsIterator.hasNext()) {
-							ModelQueryAction insertAction = new NonValidatingModelQueryAction(((ModelQueryAction) implicitValidActionsIterator.next()).getCMNode(), ModelQueryAction.INSERT, 0, parent.getChildNodes().getLength(), null);
-							allActions.add(insertAction);
-						}
-					}
-				}
-			}
-		}
-		return allActions;
-	}
-
-	protected List getAvailableRootChildren(Document document, int childIndex) {
-		List list = new ArrayList();
-		if (!isXMLFormat(document))
-			getAdditionalChildren(list, document, childIndex);
-		return list;
-	}
-
 	protected void init() {
 		super.init();
 	}
@@ -649,7 +461,7 @@
 		ICompletionProposal[] embeddedResults = EMPTY_PROPOSAL_SET;
 
 		// check the actual partition type
-		String partitionType = getPartitionType((StructuredTextViewer) viewer, documentPosition);
+		String partitionType = getPartitionType(viewer, documentPosition);
 		IStructuredDocument structuredDocument = (IStructuredDocument) viewer.getDocument();
 
 		IStructuredDocumentRegion fn = structuredDocument.getRegionAtCharacterOffset(documentPosition);
@@ -747,7 +559,7 @@
 								// well get those proposals from the embedded
 								// adapter
 								if (documentPosition > 0) {
-									partitionType = getPartitionType((StructuredTextViewer) viewer, documentPosition - 1);
+									partitionType = getPartitionType(viewer, documentPosition - 1);
 									break;
 								}
 							}
@@ -778,7 +590,7 @@
 					// if it is, we're just gonna let the embedded JAVASCRIPT
 					// adapter get the proposals
 					if (documentPosition > 0) {
-						String checkType = getPartitionType((StructuredTextViewer) viewer, documentPosition - 1);
+						String checkType = getPartitionType(viewer, documentPosition - 1);
 						if (checkType != IJSPPartitions.JSP_CONTENT_JAVASCRIPT) { // this
 							// check
 							// is
@@ -808,7 +620,7 @@
 						// if it is, we're just gonna let the embedded
 						// JAVASCRIPT adapter get the proposals
 						if (documentPosition > 0) {
-							String checkType = getPartitionType((StructuredTextViewer) viewer, documentPosition - 1);
+							String checkType = getPartitionType(viewer, documentPosition - 1);
 							if (checkType != IJSPPartitions.JSP_CONTENT_JAVASCRIPT) {
 								return getJSPJavaCompletionProposals(viewer, documentPosition);
 							}
@@ -910,21 +722,10 @@
 			fTemplateContexts.clear();
 			jspResults = super.computeCompletionProposals(viewer, documentPosition);
 		}
-		if (useEmbeddedResults) {
-			if (embeddedResults != null && embeddedResults.length > 0) {
-				List results = new ArrayList();
-				for (int i = 0; i < embeddedResults.length; i++)
-					results.add(embeddedResults[i]);
-				if (jspResults != null) {
-					for (int i = 0; i < jspResults.length; i++)
-						results.add(jspResults[i]);
-				}
-				jspResults = new ICompletionProposal[results.size()];
-				Collections.sort(results, new ProposalComparator());
-				for (int i = 0; i < results.size(); i++)
-					jspResults[i] = (ICompletionProposal) results.get(i);
-
-			}
+		
+		//merge the embedded results
+		if (useEmbeddedResults && embeddedResults != null && embeddedResults.length > 0) {
+			jspResults = merge(jspResults, embeddedResults);
 		}
 		if (jspResults == null)
 			jspResults = EMPTY_PROPOSAL_SET;
@@ -973,7 +774,8 @@
 		importProposal.setDisplayString(newDisplay);
 
 		int newReplacementLength = importProposal.getReplacementLength() - 1;
-		importProposal.setReplacementLength(newReplacementLength);
+		if (newReplacementLength >= 0)
+			importProposal.setReplacementLength(newReplacementLength);
 
 		int newCursorPosition = importProposal.getCursorPosition() - 1;
 		importProposal.setCursorPosition(newCursorPosition);
@@ -982,22 +784,27 @@
 	}
 
 	/**
-	 * Adds 2 arrays of ICompletionProposals and sorts them with a
-	 * ProposalComparator.
+	 * Adds 2 arrays of {@link ICompletionProposal}s to a {@link TreeSet}
+	 * eliminating duplicates and sorting with a {@link ProposalComparator}
+	 * then returning the new merged, filtered, sorted, array of {@link ICompletionProposal}s.
 	 * 
-	 * @param jspResults
-	 * @param htmlResults
-	 * @return
+	 * @param proposalsOne
+	 * @param proposalsTwo
+	 * @return a new merged, filtered, sorted array of {@link ICompletionProposal}s created from
+	 * the two given arrays of {@link ICompletionProposal}s.
 	 */
-	private ICompletionProposal[] merge(ICompletionProposal[] jspResults, ICompletionProposal[] htmlResults) {
-		List results = new ArrayList();
-		List jsps = Arrays.asList(jspResults);
-		List htmls = Arrays.asList(htmlResults);
+	private ICompletionProposal[] merge(ICompletionProposal[] proposalsOne, ICompletionProposal[] proposalsTwo) {
+		Set results = new TreeSet(new ProposalComparator());
 
-		results.addAll(jsps);
-		results.addAll(htmls);
+		if (proposalsOne != null) {
+			for (int i = 0; i < proposalsOne.length; i++)
+				results.add(proposalsOne[i]);
+		}
+		if (proposalsTwo != null) {
+			for (int i = 0; i < proposalsTwo.length; i++)
+				results.add(proposalsTwo[i]);
+		}
 
-		Collections.sort(results, new ProposalComparator());
 		return (ICompletionProposal[]) results.toArray(new ICompletionProposal[results.size()]);
 	}
 
@@ -1081,10 +888,13 @@
 	 * @param documentPosition
 	 * @return String
 	 */
-	protected String getPartitionType(StructuredTextViewer viewer, int documentPosition) {
+	protected String getPartitionType(ITextViewer viewer, int documentPosition) {
 		String partitionType = null;
 		try {
-			partitionType = TextUtilities.getContentType(viewer.getDocument(), IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, viewer.modelOffset2WidgetOffset(documentPosition), false);
+			if (viewer instanceof ITextViewerExtension5)
+				partitionType = TextUtilities.getContentType(viewer.getDocument(), IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, ((ITextViewerExtension5) viewer).modelOffset2WidgetOffset(documentPosition), false);
+			else
+				partitionType = TextUtilities.getContentType(viewer.getDocument(), IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, documentPosition, false);
 		}
 		catch (BadLocationException e) {
 			partitionType = IDocument.DEFAULT_CONTENT_TYPE;
@@ -1322,9 +1132,18 @@
 
 	protected void addTagInsertionProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
 		addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.TAG);
+		//don't need to call super here because otherwise we duplicate what the HTMLCOntentAssistProcessor that is running is already doing
+	}
 
-		super.addTagInsertionProposals(contentAssistRequest, childPosition);
-		if (isInternalAdapter)
-			useEmbeddedResults = false;
+	/**
+	 * Use the embedded content assist processor to determine the content generator
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor#getContentGenerator()
+	 */
+	public XMLContentModelGenerator getContentGenerator() {
+		if (fGenerator == null) {
+			fGenerator = ((AbstractContentAssistProcessor) fPartitionToProcessorMap.get(IHTMLPartitions.HTML_DEFAULT)).getContentGenerator();
+		}
+		return fGenerator;
 	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java
index 4664973..2b14ece 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -28,6 +28,7 @@
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
 import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
 import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -36,7 +37,8 @@
 /**
  * This class is a "null" version of AbstractContentAssistProcessor
  * 
- * @plannedfor 1.0
+ * @deprecated This class is no longer used locally and will be removed in the future
+ * @see DefaultXMLCompletionProposalComputer
  */
 public class JSPDummyContentAssistProcessor extends AbstractContentAssistProcessor {
 	protected void addAttributeNameProposals(ContentAssistRequest contentAssistRequest) {
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProcessor.java
index 0ef4b79..fc32b3c 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProcessor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProcessor.java
@@ -1,10 +1,24 @@
 package org.eclipse.jst.jsp.ui.internal.contentassist;
 
 import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
 import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
 
+/**
+ * @deprecated This class is no longer used locally and will be removed in the future
+ */
 public class JSPELCompletionProcessor extends JSPCompletionProcessor {
 	protected JSPProposalCollector getProposalCollector(ICompilationUnit cu, JSPTranslation translation) {
 		return new JSPELProposalCollector(cu, translation);
 	}
+	
+	/**
+	 * The java position offset needs to be shifted 3 for the "get" in the java
+	 * proposal mapped to a given JSP EL proposal
+	 */
+	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int pos) {
+		//3 for the "get" at the beginning of the java proposal
+		return computeCompletionProposals(viewer, pos, 3);
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProposalComputer.java
new file mode 100644
index 0000000..709baa0
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProposalComputer.java
@@ -0,0 +1,156 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDocumentImpl;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDFunction;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParserConstants;
+import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParserTokenManager;
+import org.eclipse.jst.jsp.core.internal.java.jspel.SimpleCharStream;
+import org.eclipse.jst.jsp.core.internal.java.jspel.Token;
+import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+
+/**
+ * <p>Compute JSP EL completion proposals</p>
+ */
+public class JSPELCompletionProposalComputer extends
+		JSPJavaCompletionProposalComputer {
+	
+	/**
+	 * @see org.eclipse.jst.jsp.ui.internal.contentassist.JSPJavaCompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeCompletionProposals(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		ITextViewer viewer = context.getViewer();
+		int documentPosition = context.getInvocationOffset();
+
+		// get results from JSP completion processor
+		//3 for the "get" at the beginning of the java proposal
+		List results = new ArrayList(computeJavaCompletionProposals(viewer, documentPosition, 3));
+
+		//get the function proposals for syntax like: ${ fn:| }
+		IStructuredDocumentRegion flat = ContentAssistUtils.getStructuredDocumentRegion(viewer, documentPosition);
+		if (flat != null) {
+			ITextRegion cursorRegion = flat.getRegionAtCharacterOffset(documentPosition);
+			String elText;
+			int startOffset;
+			//if container then need to get inner region
+			//else can use flat region
+			if (cursorRegion instanceof ITextRegionContainer) {
+				ITextRegionContainer container = (ITextRegionContainer) cursorRegion;
+				cursorRegion = container.getRegionAtCharacterOffset(documentPosition);
+				elText = container.getText(cursorRegion);
+				startOffset = container.getStartOffset(cursorRegion);
+			} else {
+				elText = flat.getText(cursorRegion);
+				startOffset = flat.getStartOffset(cursorRegion);
+			}
+			
+			//sanity check that we are actually in EL region
+			if (cursorRegion.getType() == DOMJSPRegionContexts.JSP_EL_CONTENT) {
+				String prefix = getPrefix(documentPosition - startOffset, elText);
+				if (null != prefix) {
+					List proposals = getFunctionProposals(prefix, viewer, documentPosition);
+					results.addAll(proposals);
+				}
+			}
+		}
+
+		return results;
+	}
+	
+	/**
+	 * @see org.eclipse.jst.jsp.ui.internal.contentassist.JSPJavaCompletionProposalComputer#getProposalCollector(
+	 * 		org.eclipse.jdt.core.ICompilationUnit, org.eclipse.jst.jsp.core.internal.java.JSPTranslation)
+	 */
+	protected JSPProposalCollector getProposalCollector(ICompilationUnit cu,
+			JSPTranslation translation) {
+		
+		return new JSPELProposalCollector(cu, translation);
+	}
+
+	/**
+	 * <p>Gets the EL prefix from the relative position and the given EL text</p>
+	 * 
+	 * @param relativePosition
+	 * @param elText
+	 * @return
+	 */
+	private String getPrefix(int relativePosition, String elText) {
+		java.io.StringReader reader = new java.io.StringReader(elText);
+		JSPELParserTokenManager scanner = new JSPELParserTokenManager(new SimpleCharStream(reader, 1, 1));
+		Token curToken = null, lastIdentifier = null;
+		while (JSPELParserConstants.EOF != (curToken = scanner.getNextToken()).kind) {
+			if (JSPELParserConstants.COLON == curToken.kind && curToken.endColumn == relativePosition && null != lastIdentifier) {
+				return (lastIdentifier.image);
+			}
+
+			if (JSPELParserConstants.IDENTIFIER == curToken.kind) {
+				lastIdentifier = curToken;
+			}
+			else {
+				lastIdentifier = null;
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * <p>Get the EL function proposals, ex: ${fn:| }</p>
+	 * @param prefix
+	 * @param viewer
+	 * @param offset
+	 * @return
+	 */
+	private List getFunctionProposals(String prefix, ITextViewer viewer, int offset) {
+		TLDCMDocumentManager docMgr = TaglibController.getTLDCMDocumentManager(viewer.getDocument());
+		ArrayList completionList = new ArrayList();
+		if (docMgr == null)
+			return null;
+
+		Iterator taglibs = docMgr.getCMDocumentTrackers(offset).iterator();
+		while (taglibs.hasNext()) {
+			TaglibTracker tracker = (TaglibTracker) taglibs.next();
+			if (tracker.getPrefix().equals(prefix)) {
+				CMDocumentImpl doc = (CMDocumentImpl) tracker.getDocument();
+
+				List functions = doc.getFunctions();
+				for (Iterator it = functions.iterator(); it.hasNext();) {
+					TLDFunction function = (TLDFunction) it.next();
+					CustomCompletionProposal proposal = new CustomCompletionProposal(function.getName() + "()", //$NON-NLS-1$
+								offset, 0, function.getName().length() + 1, null, function.getName() + " - " + function.getSignature(), null, null, 1); //$NON-NLS-1$
+
+					completionList.add(proposal);
+				}
+			}
+		}
+		return completionList;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELContentAssistProcessor.java
index ad5ce00..dbc6c55 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELContentAssistProcessor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELContentAssistProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -39,6 +39,9 @@
 import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 
+/**
+ * @deprecated This class is no longer used locally and will be removed in the future
+ */
 public class JSPELContentAssistProcessor extends JSPJavaContentAssistProcessor {
 	protected char elCompletionProposalAutoActivationCharacters[] = new char[]{'.', ':'};
 
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java
index 5aa3eb8..5c7a039 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -40,10 +40,11 @@
 			}
 			
 			// java offset
-			int offset = proposal.getReplaceStart() + 1;
+			int offset = proposal.getReplaceStart();
 			
 			// replacement length
-			int length = proposal.getReplaceEnd() - offset + 1;
+			//-3 for "get" pre text on the java proposal
+			int length = proposal.getReplaceEnd() - offset - 3;
 			
 			// translate offset from Java > JSP
 			offset = getTranslation().getJspOffset(offset);
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPImportCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPImportCompletionProposalComputer.java
new file mode 100644
index 0000000..c0bfb7f
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPImportCompletionProposalComputer.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+
+/**
+ * <p>Generates JSP import completion proposals</p>
+ */
+public class JSPImportCompletionProposalComputer extends
+		JSPJavaCompletionProposalComputer {
+
+	/**
+	 * @see org.eclipse.jst.jsp.ui.internal.contentassist.JSPJavaCompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeCompletionProposals(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		List proposals = computeJavaCompletionProposals(context.getViewer(), context.getInvocationOffset(), 0);
+		List importProposals = new ArrayList(proposals.size());
+		for (int i = 0; i < proposals.size(); i++) {
+			if (proposals.get(i) instanceof JSPCompletionProposal) {
+
+				ICompletionProposal importProposal = adjustImportProposal((JSPCompletionProposal) proposals.get(i));
+				importProposals.add(importProposal);
+			}
+		}
+		return importProposals;
+		
+	}
+
+	/**
+	 * <p>JSP import proposals need to be adjusted, this does that</p>
+	 * 
+	 * @param importProposal {@link JSPCompletionProposal} to adjust
+	 * @return adjusted {@link ICompletionProposal}
+	 */
+	private ICompletionProposal adjustImportProposal(JSPCompletionProposal importProposal) {
+		// just need to remove the ";"
+		// and adjust offsets for the change
+		String newReplace;
+		if (importProposal instanceof AutoImportProposal){
+			newReplace =((AutoImportProposal)importProposal).getImportDeclaration() .replaceAll(";", ""); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+		else{
+			 newReplace = importProposal.getReplacementString().replaceAll(";", ""); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+		importProposal.setReplacementString(newReplace);
+
+		String newDisplay = importProposal.getDisplayString().replaceAll(";", ""); //$NON-NLS-1$ //$NON-NLS-2$
+		importProposal.setDisplayString(newDisplay);
+
+		int newReplacementLength = importProposal.getReplacementLength() - 1;
+		if (newReplacementLength >= 0) {
+			importProposal.setReplacementLength(newReplacementLength);
+		}
+
+		int newCursorPosition = importProposal.getCursorPosition() - 1;
+		importProposal.setCursorPosition(newCursorPosition);
+
+		return importProposal;
+	}
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaCompletionProposalComputer.java
new file mode 100644
index 0000000..27364a4
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaCompletionProposalComputer.java
@@ -0,0 +1,583 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.WorkingCopyOwner;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentExtension3;
+import org.eclipse.jface.text.IDocumentPartitioner;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.ITextViewerExtension5;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
+import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
+import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
+import org.eclipse.jst.jsp.core.text.IJSPPartitions;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.wst.html.core.text.IHTMLPartitions;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistUtilities;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
+import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
+import org.osgi.framework.Bundle;
+
+/**
+ * <p>Generates Java proposals for JSP documents</p>
+ * 
+ * @base org.eclipse.jst.jsp.ui.internal.contentassist.JSPJavaContentAssistProcessor
+ */
+public class JSPJavaCompletionProposalComputer extends DefaultXMLCompletionProposalComputer {
+	private static final String JDT_CORE_PLUGIN_ID = "org.eclipse.jdt.core"; //$NON-NLS-1$
+
+	/** The translation adapter used to create the Java proposals */
+	private JSPTranslationAdapter fTranslationAdapter = null;
+	
+	/** translation adapter may be stale, check the model id */
+	private String fModelId = null;
+
+	/**
+	 * Create the computer
+	 */
+	public JSPJavaCompletionProposalComputer() {
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#sessionEnded()
+	 */
+	public void sessionEnded() {
+		fTranslationAdapter = null;
+	}
+
+	/**
+	 * <p>Return a list of proposed code completions based on the specified
+	 * location within the document that corresponds to the current cursor
+	 * position within the text-editor control.</p>
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeCompletionProposals(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		List results = new ArrayList(0);
+		if(isValidContext(context)) {
+			ITextViewer viewer = context.getViewer();
+			int documentPosition = context.getInvocationOffset();
+			IndexedRegion treeNode = ContentAssistUtils.getNodeAt(viewer, documentPosition);
+			
+			// get results from JSP completion processor
+			results = computeJavaCompletionProposals(viewer, documentPosition, 0);
+
+			IDOMNode xNode = null;
+			IStructuredDocumentRegion flat = null;
+			if (treeNode instanceof IDOMNode) {
+				xNode = (IDOMNode) treeNode;
+				flat = xNode.getFirstStructuredDocumentRegion();
+				if (flat != null && flat.getType() == DOMJSPRegionContexts.JSP_CONTENT) {
+					flat = flat.getPrevious();
+				}
+			}
+
+			// this is in case it's a <%@, it will be a region container...
+			ITextRegion openRegion = null;
+			if (flat != null && flat instanceof ITextRegionContainer) {
+				ITextRegionList v = ((ITextRegionContainer) flat).getRegions();
+				if (v.size() > 0)
+					openRegion = v.get(0);
+			}
+
+			// ADD CDATA PROPOSAL IF IT'S AN XML-JSP TAG
+			if (flat != null && flat.getType() != DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN &&
+					flat.getType() != DOMJSPRegionContexts.JSP_DECLARATION_OPEN &&
+					flat.getType() != DOMJSPRegionContexts.JSP_EXPRESSION_OPEN &&
+					flat.getType() != DOMRegionContext.BLOCK_TEXT &&
+					(openRegion != null &&
+							openRegion.getType() != DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN) &&
+							!inAttributeRegion(flat, documentPosition)) {
+				
+				// determine if cursor is before or after selected range
+				int adjustedDocPosition = documentPosition;
+				int realCaretPosition = viewer.getTextWidget().getCaretOffset();
+				int selectionLength = viewer.getSelectedRange().y;
+				if (documentPosition > realCaretPosition) {
+					adjustedDocPosition -= selectionLength;
+				}
+
+				CustomCompletionProposal cdataProposal = createCDATAProposal(adjustedDocPosition, selectionLength);
+				results.add(cdataProposal);
+			}
+		}
+
+		return results;
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeContextInformation(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeContextInformation(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+	
+		ITextViewer viewer = context.getViewer();
+		int documentOffset = context.getInvocationOffset();
+		
+		List results = new ArrayList();
+		// need to compute context info here, if it's JSP, call java computer
+		IDocument doc = viewer.getDocument();
+		IDocumentPartitioner dp = null;
+		if (doc instanceof IDocumentExtension3) {
+			dp = ((IDocumentExtension3) doc).getDocumentPartitioner(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING);
+		}
+		if (dp != null) {
+			//IDocumentPartitioner dp = viewer.getDocument().getDocumentPartitioner();
+			String type = dp.getPartition(documentOffset).getType();
+			if (type == IJSPPartitions.JSP_DEFAULT || type == IJSPPartitions.JSP_CONTENT_JAVA) {
+				// get context info from completion results...
+				List proposals = computeCompletionProposals(context,monitor);
+				for (int i = 0; i < proposals.size(); i++) {
+					IContextInformation ci = ((ICompletionProposal)proposals.get(i)).getContextInformation();
+					if (ci != null)
+						results.add(ci);
+				}
+			}
+		}
+		return results;
+	}
+	
+	/**
+	 * The same as the normal <code>computeCompeltaionProposals</code> except the calculated
+	 * java position is offset by the given extra offset.
+	 * 
+	 * @param viewer
+	 *            the viewer whose document is used to compute the proposals
+	 * @param documentPosition
+	 *            an offset within the document for which completions should
+	 *            be computed
+	 * @param javaPositionExtraOffset
+	 * 				the extra offset for the java position
+	 * @return an array of completion proposals or <code>null</code> if no
+	 *         proposals are possible
+	 */
+	protected List computeJavaCompletionProposals(ITextViewer viewer,
+			int pos, int javaPositionExtraOffset) {
+		
+		initializeJavaPlugins();
+
+		JSPProposalCollector collector = null;
+		
+		IDOMModel xmlModel = null;
+		try {
+			xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(viewer.getDocument());
+
+			IDOMDocument xmlDoc = xmlModel.getDocument();
+			if (fTranslationAdapter == null || xmlModel.getId() != fModelId) {
+				fTranslationAdapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
+				fModelId = xmlModel.getId();
+			}
+			if (fTranslationAdapter != null) {
+
+				JSPTranslation translation = fTranslationAdapter.getJSPTranslation();
+				int javaPosition = translation.getJavaOffset(pos) + javaPositionExtraOffset;
+
+				try {
+
+					ICompilationUnit cu = translation.getCompilationUnit();
+
+					// can't get java proposals w/out a compilation unit
+					// or without a valid position
+					if (cu == null || -1 == javaPosition)
+						return new ArrayList(0);
+					
+					collector = getProposalCollector(cu, translation);
+					synchronized (cu) {
+						cu.codeComplete(javaPosition, collector, (WorkingCopyOwner) null);
+					}
+				}
+				catch (CoreException coreEx) {
+					// a possible Java Model Exception due to not being a Web
+					// (Java) Project
+					coreEx.printStackTrace();
+				}
+			}
+		}
+		catch (Exception exc) {
+			exc.printStackTrace();
+			// throw out exceptions on code assist.
+		}
+		finally {
+			if (xmlModel != null) {
+				xmlModel.releaseFromRead();
+			}
+		}
+		ICompletionProposal[] results = new ICompletionProposal[0];
+		if(collector != null) {
+			results = collector.getJSPCompletionProposals();
+			if (results == null || results.length < 1)
+				this.setErrorMessage(JSPUIMessages.Java_Content_Assist_is_not_UI_);
+		}
+		
+		return Arrays.asList(results);
+	}
+	
+	protected JSPProposalCollector getProposalCollector(ICompilationUnit cu, JSPTranslation translation) {
+		return new JSPProposalCollector(cu, translation);
+	}
+	
+	private CustomCompletionProposal createCDATAProposal(int adjustedDocPosition, int selectionLength) {
+		return new CustomCompletionProposal("<![CDATA[]]>", //$NON-NLS-1$
+					adjustedDocPosition, selectionLength, // should be the selection length
+					9, SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_CDATASECTION), 
+					"CDATA Section", //$NON-NLS-1$
+					null, null, XMLRelevanceConstants.R_CDATA);
+	}
+
+	private boolean inAttributeRegion(IStructuredDocumentRegion flat, int documentPosition) {
+		ITextRegion attrContainer = flat.getRegionAtCharacterOffset(documentPosition);
+		if (attrContainer != null && attrContainer instanceof ITextRegionContainer) {
+			if (attrContainer.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+				return true;
+			}
+		}
+		return false;
+	}
+	
+	/**
+	 * Initialize the Java Plugins that the JSP processor requires.
+	 * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=143765
+	 * We should not call "start", because that will cause that 
+	 * state to be remembered, and re-started automatically during 
+	 * the next boot up sequence. 
+	 * 
+	 * ISSUE: we may be able to get rid of this all together, in future, 
+	 * since 99% we probably have already used some JDT class by the time 
+	 * we need JDT to be active ... but ... this is the safest fix for 
+	 * this point in 1.5 stream. Next release, let's just remove this, 
+	 * re-discover what ever bug this was fixing (if any) and if there is 
+	 * one, then we'll either put back in, as is, or come up with a 
+	 * more appropriate fix. 
+	 * 
+	 */
+	private void initializeJavaPlugins() {
+		try {
+			Bundle bundle = Platform.getBundle(JDT_CORE_PLUGIN_ID);
+			bundle.loadClass("dummyClassNameThatShouldNeverExist"); //$NON-NLS-1$
+		}
+		catch (ClassNotFoundException e) {
+			// this is the expected result, we just want to 
+			// nudge the bundle to be sure its activated. 
+		}
+	}
+	
+	/**
+	 * @param viewer
+	 * @param documentPosition
+	 * @return String
+	 */
+	private String getPartitionType(ITextViewer viewer, int documentPosition) {
+		String partitionType = null;
+		try {
+			if (viewer instanceof ITextViewerExtension5)
+				partitionType = TextUtilities.getContentType(viewer.getDocument(), IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, ((ITextViewerExtension5) viewer).modelOffset2WidgetOffset(documentPosition), false);
+			else
+				partitionType = TextUtilities.getContentType(viewer.getDocument(), IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, documentPosition, false);
+		}
+		catch (BadLocationException e) {
+			partitionType = IDocument.DEFAULT_CONTENT_TYPE;
+		}
+		return partitionType;
+	}
+	
+	/**
+	 * <p>Determines if the context is a valid one for JSP Java proposals.
+	 * The default result is <code>true</code></p>
+	 * 
+	 * @param context check this context to see if it is valid for JSP
+	 * Java proposals
+	 * @return <code>true</code> if the given context is a valid one for
+	 * JSP Java proposals, <code>false</code> otherwise.  <code>true</code>
+	 * is the default response if a specific case for <code>false</code> is
+	 * not found.
+	 */
+	private boolean isValidContext(CompletionProposalInvocationContext context) {
+		ITextViewer viewer = context.getViewer();
+		int documentPosition = context.getInvocationOffset();
+		
+		String partitionType = getPartitionType(viewer, documentPosition);
+		IStructuredDocument structuredDocument = (IStructuredDocument) viewer.getDocument();
+		IStructuredDocumentRegion fn = structuredDocument.getRegionAtCharacterOffset(documentPosition);
+		IStructuredDocumentRegion sdRegion = ContentAssistUtils.getStructuredDocumentRegion(viewer, documentPosition);
+		// ////////////////////////////////////////////////////////////////////////////
+		// ANOTHER WORKAROUND UNTIL PARTITIONING TAKES CARE OF THIS
+		// check for xml-jsp tags...
+		if (partitionType == IJSPPartitions.JSP_DIRECTIVE && fn != null) {
+			IStructuredDocumentRegion possibleXMLJSP = ((fn.getType() == DOMRegionContext.XML_CONTENT) && fn.getPrevious() != null) ? fn.getPrevious() : fn;
+			ITextRegionList regions = possibleXMLJSP.getRegions();
+			if (regions.size() > 1) {
+				// check bounds cases
+				ITextRegion xmlOpenOrClose = regions.get(0);
+				if (xmlOpenOrClose.getType() != DOMRegionContext.XML_TAG_OPEN &&
+						documentPosition != possibleXMLJSP.getStartOffset() &&
+						xmlOpenOrClose.getType() != DOMRegionContext.XML_END_TAG_OPEN &&
+						documentPosition <= possibleXMLJSP.getStartOffset()) {
+					
+					// possible xml-jsp
+					ITextRegion nameRegion = regions.get(1);
+					String name = possibleXMLJSP.getText(nameRegion);
+					if (name.equals("jsp:scriptlet") || name.equals("jsp:expression") || name.equals("jsp:declaration")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+						return true;
+					}
+				}
+			}
+		}
+
+		// ////////////////////////////////////////////////////////////////////////////
+		// ** THIS IS A TEMP FIX UNTIL PARTITIONING TAKES CARE OF THIS...
+		// check for XML-JSP in a <script> region
+		if (partitionType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT || partitionType == IHTMLPartitions.SCRIPT) {
+			// fn should be block text
+			IStructuredDocumentRegion decodedSDRegion = decodeScriptBlock(fn.getFullText());
+			// System.out.println("decoded > " +
+			// blockOfText.substring(decodedSDRegion.getStartOffset(),
+			// decodedSDRegion.getEndOffset()));
+			if (decodedSDRegion != null) {
+				IStructuredDocumentRegion sdr = decodedSDRegion;
+				while (sdr != null) {
+					// System.out.println("sdr " + sdr.getType());
+					// System.out.println("sdr > " +
+					// blockOfText.substring(sdr.getStartOffset(),
+					// sdr.getEndOffset()));
+					if (sdr.getType() == DOMJSPRegionContexts.JSP_CONTENT) {
+						if (documentPosition >= fn.getStartOffset() + sdr.getStartOffset() && documentPosition <= fn.getStartOffset() + sdr.getEndOffset()) {
+							return true;
+						}
+					}
+					else if (sdr.getType() == DOMRegionContext.XML_TAG_NAME) {
+						if (documentPosition > fn.getStartOffset() + sdr.getStartOffset() && documentPosition < fn.getStartOffset() + sdr.getEndOffset()) {
+							return false;
+						}
+						else if (documentPosition == fn.getStartOffset() + sdr.getEndOffset() && sdr.getNext() != null && sdr.getNext().getType() == DOMJSPRegionContexts.JSP_CONTENT) {
+							// the end of an open tag <script>
+							// <jsp:scriptlet>| blah </jsp:scriptlet>
+							return true;
+						}
+						else if (documentPosition == fn.getStartOffset() + sdr.getStartOffset() && sdr.getPrevious() != null && sdr.getPrevious().getType() == DOMRegionContext.XML_TAG_NAME) {
+							return true;
+						}
+					}
+					sdr = sdr.getNext();
+				}
+			}
+		}
+		// /////////////////////////////////////////////////////////////////////////
+		// check special JSP delimiter cases
+		if (fn != null && partitionType == IJSPPartitions.JSP_CONTENT_DELIMITER) {
+			IStructuredDocumentRegion fnDelim = fn;
+
+			// if it's a nested JSP region, need to get the correct
+			// StructuredDocumentRegion
+			// not sure why this check was there...
+			// if (fnDelim.getType() == XMLRegionContext.BLOCK_TEXT) {
+			Iterator blockRegions = fnDelim.getRegions().iterator();
+			ITextRegion temp = null;
+			ITextRegionContainer trc;
+			while (blockRegions.hasNext()) {
+				temp = (ITextRegion) blockRegions.next();
+				// we hit a nested
+				if (temp instanceof ITextRegionContainer) {
+					trc = (ITextRegionContainer) temp;
+					// it's in this region
+					if (documentPosition >= trc.getStartOffset() && documentPosition < trc.getEndOffset()) {
+						Iterator nestedJSPRegions = trc.getRegions().iterator();
+						while (nestedJSPRegions.hasNext()) {
+							temp = (ITextRegion) nestedJSPRegions.next();
+							if (XMLContentAssistUtilities.isJSPOpenDelimiter(temp.getType()) && documentPosition == trc.getStartOffset(temp)) {
+								// HTML content assist
+								// we actually want content assist for the
+								// previous type of region,
+								// well get those proposals from the embedded
+								// adapter
+								if (documentPosition > 0) {
+									partitionType = getPartitionType(viewer, documentPosition - 1);
+									break;
+								}
+							}
+							else if (XMLContentAssistUtilities.isJSPCloseDelimiter(temp.getType()) && documentPosition == trc.getStartOffset(temp)) {
+								// JSP content assist
+								return true;
+							}
+						}
+					}
+				}
+				// }
+			}
+
+			// take care of XML-JSP delimter cases
+			if (XMLContentAssistUtilities.isXMLJSPDelimiter(fnDelim)) {
+				// since it's a delimiter, we know it's a ITextRegionContainer
+				ITextRegion firstRegion = fnDelim.getRegions().get(0);
+				if (fnDelim.getStartOffset() == documentPosition && (firstRegion.getType() == DOMRegionContext.XML_TAG_OPEN)) {
+					// |<jsp:scriptlet> </jsp:scriptlet>
+					// (pa) commented out so that we get regular behavior JSP
+					// macros etc...
+					// return getHTMLCompletionProposals(viewer,
+					// documentPosition);
+				}
+				else if (fnDelim.getStartOffset() == documentPosition && (firstRegion.getType() == DOMRegionContext.XML_END_TAG_OPEN)) {
+					// <jsp:scriptlet> |</jsp:scriptlet>
+					// check previous partition type to see if it's JAVASCRIPT
+					// if it is, we're just gonna let the embedded JAVASCRIPT
+					// adapter get the proposals
+					if (documentPosition > 0) {
+						String checkType = getPartitionType(viewer, documentPosition - 1);
+						if (checkType != IJSPPartitions.JSP_CONTENT_JAVASCRIPT) { // this
+							// check is failing for XML-JSP (region is not javascript...)
+							return true;
+						}
+						partitionType = IJSPPartitions.JSP_CONTENT_JAVASCRIPT;
+					}
+				}
+				else if ((firstRegion.getType() == DOMRegionContext.XML_TAG_OPEN) && documentPosition >= fnDelim.getEndOffset()) {
+					// anything else inbetween
+					return true;
+				}
+			}
+			else if (XMLContentAssistUtilities.isJSPDelimiter(fnDelim)) {
+				// the delimiter <%, <%=, <%!, ...
+				if (XMLContentAssistUtilities.isJSPCloseDelimiter(fnDelim)) {
+					if (documentPosition == fnDelim.getStartOffset()) {
+						// check previous partition type to see if it's
+						// JAVASCRIPT
+						// if it is, we're just gonna let the embedded
+						// JAVASCRIPT adapter get the proposals
+						if (documentPosition > 0) {
+							String checkType = getPartitionType(viewer, documentPosition - 1);
+							if (checkType != IJSPPartitions.JSP_CONTENT_JAVASCRIPT) {
+								return true;
+							}
+							partitionType = IJSPPartitions.JSP_CONTENT_JAVASCRIPT;
+						}
+					}
+				}
+				else if (XMLContentAssistUtilities.isJSPOpenDelimiter(fnDelim)) {
+					// if it's the first position of open delimiter
+					// use embedded HTML results
+					if (documentPosition == fnDelim.getEndOffset()) {
+						// it's at the EOF <%|
+						return true;
+					}
+				}
+			}
+		}
+
+		// need to check if it's JSP region inside of CDATA w/ no region
+		// <![CDATA[ <%|%> ]]>
+		// or a comment region
+		// <!-- <% |%> -->
+		if (fn != null && (fn.getType() == DOMRegionContext.XML_CDATA_TEXT || fn.getType() == DOMRegionContext.XML_COMMENT_TEXT)) {
+			if (fn instanceof ITextRegionContainer) {
+				Object[] cdataRegions = fn.getRegions().toArray();
+				ITextRegion r = null;
+				ITextRegion jspRegion = null;
+				for (int i = 0; i < cdataRegions.length; i++) {
+					r = (ITextRegion) cdataRegions[i];
+					if (r instanceof ITextRegionContainer) {
+						// CDATA embedded container, or comment container
+						Object[] jspRegions = ((ITextRegionContainer) r).getRegions().toArray();
+						for (int j = 0; j < jspRegions.length; j++) {
+							jspRegion = (ITextRegion) jspRegions[j];
+							if (jspRegion.getType() == DOMJSPRegionContexts.JSP_CLOSE) {
+								if (sdRegion.getStartOffset(jspRegion) == documentPosition) {
+									return true;
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+
+		// check if it's in an attribute value, if so, don't add CDATA
+		// proposal
+		ITextRegion attrContainer = (fn != null) ? fn.getRegionAtCharacterOffset(documentPosition) : null;
+		if (attrContainer != null && attrContainer instanceof ITextRegionContainer) {
+			if (attrContainer.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+				// test location of the cursor
+				// return null if it's in the middle of an open/close delimiter
+				Iterator attrRegions = ((ITextRegionContainer) attrContainer).getRegions().iterator();
+				ITextRegion testRegion = null;
+				while (attrRegions.hasNext()) {
+					testRegion = (ITextRegion) attrRegions.next();
+					// need to check for other valid attribute regions
+					if (XMLContentAssistUtilities.isJSPOpenDelimiter(testRegion.getType())) {
+						if (!(((ITextRegionContainer) attrContainer).getEndOffset(testRegion) <= documentPosition))
+							return false;
+					}
+					else if (XMLContentAssistUtilities.isJSPCloseDelimiter(testRegion.getType())) {
+						if (!(((ITextRegionContainer) attrContainer).getStartOffset(testRegion) >= documentPosition))
+							return false;
+					}
+				}
+				// TODO: handle non-Java code such as nested tags
+				if (testRegion.getType().equals(DOMJSPRegionContexts.JSP_CONTENT)) {
+					return true;
+				}
+				return false;
+			}
+		}
+		
+		return true;
+	}
+	
+	/**
+	 * ** TEMP WORKAROUND FOR CMVC 241882 Takes a String and blocks out
+	 * jsp:scriptlet, jsp:expression, and jsp:declaration @param blockText
+	 * @return
+	 */
+	private IStructuredDocumentRegion decodeScriptBlock(String blockText) {
+		XMLSourceParser parser = new XMLSourceParser();
+		// use JSP_CONTENT for region type
+		parser.addBlockMarker(new BlockMarker("jsp:scriptlet", null, DOMJSPRegionContexts.JSP_CONTENT, false, false)); //$NON-NLS-1$
+		parser.addBlockMarker(new BlockMarker("jsp:expression", null, DOMJSPRegionContexts.JSP_CONTENT, false, false)); //$NON-NLS-1$
+		parser.addBlockMarker(new BlockMarker("jsp:declaration", null, DOMJSPRegionContexts.JSP_CONTENT, false, false)); //$NON-NLS-1$
+		parser.reset(blockText);
+		return parser.getDocumentRegions();
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java
index 1e4b398..91ff803 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -44,6 +44,7 @@
 
 /**
  * @plannedfor 1.0
+ * @deprecated This class is no longer used locally and will be removed in the future
  */
 public class JSPJavaContentAssistProcessor implements IContentAssistProcessor, IReleasable {
 	/**
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyCompletionProposalComputer.java
new file mode 100644
index 0000000..1018f8e
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyCompletionProposalComputer.java
@@ -0,0 +1,249 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImages;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
+import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * <p>This class computes attribute value completion proposals
+ * for <code>&lt;jsp:[gs]etProperty&gt;</code> tags.</p>
+ */
+public class JSPPropertyCompletionProposalComputer extends
+		DefaultXMLCompletionProposalComputer {
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeValueProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
+
+		//only add attribute value proposals for specific elements
+		if(node.getNodeName().equals(JSP11Namespace.ElementName.SETPROPERTY) ||
+				node.getNodeName().equals(JSP11Namespace.ElementName.GETPROPERTY)) {
+		
+			// Find the attribute name for which this position should have a value
+			IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
+			ITextRegionList openRegions = open.getRegions();
+			int i = openRegions.indexOf(contentAssistRequest.getRegion());
+			if (i < 0)
+				return;
+	
+			// get the attribute in question (first attr name to the left of the cursor)
+			ITextRegion attrNameRegion = null;
+			String attributeName = null;
+			while (i >= 0) {
+				attrNameRegion = openRegions.get(i--);
+				if (attrNameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
+					break;
+			}
+			if (attrNameRegion != null)
+				attributeName = open.getText(attrNameRegion);
+	
+			// determine get or set
+			ITextRegion tagNameRegion = null;
+			boolean isGetProperty = true;
+			for (int j = 0; j < openRegions.size(); j++) {
+				tagNameRegion = openRegions.get(j);
+				if (tagNameRegion.getType() == DOMRegionContext.XML_TAG_NAME &&
+						open.getText(tagNameRegion).trim().equals("jsp:setProperty")) { //$NON-NLS-1$
+					isGetProperty = false;
+					break;
+				}
+			}
+	
+			String currentValue = null;
+			if (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
+				currentValue = contentAssistRequest.getText();
+			else
+				currentValue = ""; //$NON-NLS-1$
+			String matchString = null;
+			// fixups since the matchString computations don't care if there are quotes around the value
+			if (currentValue.length() > StringUtils.strip(currentValue).length() &&
+					(currentValue.startsWith("\"") || currentValue.startsWith("'")) && //$NON-NLS-1$ //$NON-NLS-2$
+					contentAssistRequest.getMatchString().length() > 0) {
+				matchString = currentValue.substring(1, contentAssistRequest.getMatchString().length());
+			} else {
+				matchString = currentValue.substring(0, contentAssistRequest.getMatchString().length());
+			}
+			// for now we ignore complicated values such as jsp embedded in an attribute
+			boolean existingComplicatedValue =
+				contentAssistRequest.getRegion() != null &&
+				contentAssistRequest.getRegion() instanceof ITextRegionContainer;
+			if (existingComplicatedValue) {
+				contentAssistRequest.getProposals().clear();
+				contentAssistRequest.getMacros().clear();
+			}
+			else {
+				if (attributeName.equals(JSP11Namespace.ATTR_NAME_NAME)) {
+					addBeanNameProposals(contentAssistRequest, node, matchString);
+				}
+				else if (attributeName.equals(JSP11Namespace.ATTR_NAME_PROPERTY)) {
+					addBeanPropertyProposals(contentAssistRequest, node, isGetProperty, matchString);
+				}
+			}
+		}
+	}
+	
+	/**
+	 * <p>Add bean property proposals to the given {@link ContentAssistRequest}</p>
+	 * 
+	 * @param contentAssistRequest
+	 * @param node
+	 * @param isGetProperty
+	 * @param matchString
+	 */
+	private void addBeanPropertyProposals(ContentAssistRequest contentAssistRequest,
+			IDOMNode node, boolean isGetProperty, String matchString) {
+		
+		if (((Element) node).hasAttribute(JSP11Namespace.ATTR_NAME_NAME)) {
+			// assumes that the node is the [gs]etProperty tag
+			String useBeanName = ((Element) node).getAttribute(JSP11Namespace.ATTR_NAME_NAME);
+			// properties can only be provided if a class/type/beanName has been declared
+			if (useBeanName.length() > 0) {
+				NodeList useBeans = node.getOwnerDocument().getElementsByTagName(JSP11Namespace.ElementName.USEBEAN);
+				if (useBeans != null) {
+					String typeName = null;
+					for (int j = 0; j < useBeans.getLength(); j++) {
+						if (useBeans.item(j).getNodeType() != Node.ELEMENT_NODE)
+							continue;
+						Element useBean = (Element) useBeans.item(j);
+						if (useBean instanceof IndexedRegion && ((IndexedRegion) useBean).getStartOffset() < node.getStartOffset()) {
+							if (useBeanName.equals(useBean.getAttribute(JSP11Namespace.ATTR_NAME_ID))) {
+								typeName = useBean.getAttribute(JSP11Namespace.ATTR_NAME_CLASS);
+								if (!useBean.hasAttribute(JSP11Namespace.ATTR_NAME_CLASS) || typeName.length() < 1) {
+									typeName = useBean.getAttribute(JSP11Namespace.ATTR_NAME_TYPE);
+								}
+								if (!useBean.hasAttribute(JSP11Namespace.ATTR_NAME_TYPE) || typeName.length() < 1) {
+									typeName = useBean.getAttribute(JSP11Namespace.ATTR_NAME_BEAN_NAME);
+								}
+							}
+						}
+					}
+					if (typeName != null && typeName.length() > 0) {
+						// find the class/type/beanName definition and obtain the list of properties
+						IBeanInfoProvider provider = new BeanInfoProvider();
+						IResource resource = JSPContentAssistHelper.getResource(contentAssistRequest);
+						IJavaPropertyDescriptor[] descriptors = provider.getRuntimeProperties(resource, typeName);
+						CustomCompletionProposal proposal = null;
+						String displayString = ""; //$NON-NLS-1$
+						for (int j = 0; j < descriptors.length; j++) {
+							IJavaPropertyDescriptor pd = descriptors[j];
+							// check whether it's get or set kinda property
+							if (pd.getReadable() && isGetProperty || pd.getWriteable() && !isGetProperty) {
+								// filter attr value name
+								if (matchString.length() == 0 || pd.getName().toLowerCase().startsWith(matchString.toLowerCase())) {
+									displayString = pd.getDisplayName();
+									if (pd.getDeclaredType() != null && pd.getDeclaredType().length() > 0)
+										displayString += " - " + pd.getDeclaredType(); //$NON-NLS-1$
+									proposal = new CustomCompletionProposal("\"" + pd.getName() + "\"", //$NON-NLS-1$ //$NON-NLS-2$
+												contentAssistRequest.getReplacementBeginPosition(),
+												contentAssistRequest.getReplacementLength(),
+												pd.getName().length() + 2,
+												SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ATTRIBUTE),
+												displayString, null, pd.getDeclaredType(), XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
+									contentAssistRequest.addProposal(proposal);
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+
+	/**
+	 * <p>Add bean name propoasals to the given {@link ContentAssistRequest}</p>
+	 * 
+	 * @param contentAssistRequest
+	 * @param node
+	 * @param matchString
+	 */
+	private void addBeanNameProposals(ContentAssistRequest contentAssistRequest, IDOMNode node, String matchString) {
+		// will not catch useBeans specified using other than actual DOM Nodes
+		NodeList useBeans = node.getOwnerDocument().getElementsByTagName(JSP11Namespace.ElementName.USEBEAN);
+		if (useBeans != null) {
+			String id = ""; //$NON-NLS-1$
+			String displayString = null;
+			String classOrType = null;
+			String imageName = JSPEditorPluginImages.IMG_OBJ_CLASS_OBJ;
+			for (int j = 0; j < useBeans.getLength(); j++) {
+				if (useBeans.item(j).getNodeType() != Node.ELEMENT_NODE) {
+					continue;
+				}
+				Element useBean = (Element) useBeans.item(j);
+				if (useBean instanceof IndexedRegion &&
+						((IndexedRegion) useBean).getStartOffset() < node.getStartOffset() &&
+						useBean.hasAttribute(JSP11Namespace.ATTR_NAME_ID)) {
+					
+					id = useBean.hasAttribute(JSP11Namespace.ATTR_NAME_ID) ?
+							StringUtils.strip(useBean.getAttribute(JSP11Namespace.ATTR_NAME_ID)) : null;
+					displayString = null;
+					classOrType = null;
+					imageName = JSPEditorPluginImages.IMG_OBJ_CLASS_OBJ;
+					// set the Image based on whether the class, type, or beanName attribute is present
+					if (useBean.hasAttribute(JSP11Namespace.ATTR_NAME_CLASS))
+						classOrType = useBean.getAttribute(JSP11Namespace.ATTR_NAME_CLASS);
+					if ((classOrType == null || classOrType.length() < 1) && useBean.hasAttribute(JSP11Namespace.ATTR_NAME_TYPE)) {
+						classOrType = useBean.getAttribute(JSP11Namespace.ATTR_NAME_TYPE);
+						imageName = JSPEditorPluginImages.IMG_OBJ_PUBLIC;
+					}
+					if ((classOrType == null || classOrType.length() < 1) && useBean.hasAttribute(JSP11Namespace.ATTR_NAME_BEAN_NAME)) {
+						classOrType = useBean.getAttribute(JSP11Namespace.ATTR_NAME_BEAN_NAME);
+						imageName = JSPEditorPluginImages.IMG_OBJ_PUBLIC;
+					}
+					if (classOrType != null && classOrType.length() > 0) {
+						displayString = id + " - " + classOrType; //$NON-NLS-1$
+					} else {
+						displayString = id;
+					}
+
+					// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=2341
+					if(id != null) {
+					    // filter
+						if (matchString.length() == 0 || id.startsWith(matchString)) {
+							CustomCompletionProposal proposal = new CustomCompletionProposal("\"" + id + "\"", //$NON-NLS-1$ //$NON-NLS-2$
+										contentAssistRequest.getReplacementBeginPosition(), 
+                                        contentAssistRequest.getReplacementLength(), 
+                                        id.length() + 2, 
+                                        JSPEditorPluginImageHelper.getInstance().getImage(imageName), 
+                                        displayString, null, null, 
+                                        XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
+							contentAssistRequest.addProposal(proposal);
+						}
+					}
+				}
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyContentAssistProcessor.java
index 007744d..c8b5dcc 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyContentAssistProcessor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyContentAssistProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,250 +10,23 @@
  *******************************************************************************/
 package org.eclipse.jst.jsp.ui.internal.contentassist;
 
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
-import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImages;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
-import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
 
 /**
  * This class computes attribute value completion proposals for &lt;jsp:[gs]etProperty&gt; tags.
- * @plannedfor 1.0
+ * 
+ * @deprecated This class is no longer used locally and will be removed in the future
+ * @see JSPPropertyCompletionProposalComputer
  */
 public class JSPPropertyContentAssistProcessor extends JSPDummyContentAssistProcessor {
+	private JSPPropertyCompletionProposalComputer fComputer;
+	
 	public JSPPropertyContentAssistProcessor() {
 		super();
+		fComputer = new JSPPropertyCompletionProposalComputer();
 	}
 
 	protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
-		IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
-
-		// Find the attribute name for which this position should have a value
-		IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
-		ITextRegionList openRegions = open.getRegions();
-		int i = openRegions.indexOf(contentAssistRequest.getRegion());
-		if (i < 0)
-			return;
-
-		// get the attribute in question (first attr name to the left of the cursor)
-		ITextRegion attrNameRegion = null;
-		String attributeName = null;
-		while (i >= 0) {
-			attrNameRegion = openRegions.get(i--);
-			if (attrNameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
-				break;
-		}
-		if (attrNameRegion != null)
-			attributeName = open.getText(attrNameRegion);
-
-		// determine get or set
-		ITextRegion tagNameRegion = null;
-		boolean isGetProperty = true;
-		for (int j = 0; j < openRegions.size(); j++) {
-			tagNameRegion = openRegions.get(j);
-			if (tagNameRegion.getType() == DOMRegionContext.XML_TAG_NAME && open.getText(tagNameRegion).trim().equals("jsp:setProperty")) { //$NON-NLS-1$
-				isGetProperty = false;
-				break;
-			}
-		}
-
-		String currentValue = null;
-		if (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
-			currentValue = contentAssistRequest.getText();
-		else
-			currentValue = ""; //$NON-NLS-1$
-		String matchString = null;
-		// fixups since the matchString computations don't care if there are quotes around the value
-		if (currentValue.length() > StringUtils.strip(currentValue).length() && (currentValue.startsWith("\"") || currentValue.startsWith("'")) && contentAssistRequest.getMatchString().length() > 0) //$NON-NLS-1$ //$NON-NLS-2$
-			matchString = currentValue.substring(1, contentAssistRequest.getMatchString().length());
-		else
-			matchString = currentValue.substring(0, contentAssistRequest.getMatchString().length());
-
-		// for now we ignore complicated values such as jsp embedded in an attribute
-		boolean existingComplicatedValue = contentAssistRequest.getRegion() != null && contentAssistRequest.getRegion() instanceof ITextRegionContainer;
-		if (existingComplicatedValue) {
-			contentAssistRequest.getProposals().clear();
-			contentAssistRequest.getMacros().clear();
-		}
-		else {
-			if (attributeName.equals(JSP11Namespace.ATTR_NAME_NAME)) {
-				addBeanNameProposals(contentAssistRequest, node, matchString);
-			}
-			else if (attributeName.equals(JSP11Namespace.ATTR_NAME_PROPERTY)) {
-				addBeanPropertyProposals(contentAssistRequest, node, isGetProperty, matchString);
-			}
-		}
+		fComputer.addAttributeValueProposals(contentAssistRequest, null);
 	}
-
-	private void addBeanPropertyProposals(ContentAssistRequest contentAssistRequest, IDOMNode node, boolean isGetProperty, String matchString) {
-		// assumes that the node is the [gs]etProperty tag
-		String useBeanName = ((Element) node).getAttribute(JSP11Namespace.ATTR_NAME_NAME);
-		// properties can only be provided if a class/type/beanName has been declared
-		if (useBeanName != null && useBeanName.length() > 0) {
-			NodeList useBeans = node.getOwnerDocument().getElementsByTagName(JSP11Namespace.ElementName.USEBEAN);
-			if (useBeans != null) {
-				String typeName = null;
-				for (int j = 0; j < useBeans.getLength(); j++) {
-					if (useBeans.item(j).getNodeType() != Node.ELEMENT_NODE)
-						continue;
-					Element useBean = (Element) useBeans.item(j);
-					if (useBean instanceof IndexedRegion && ((IndexedRegion) useBean).getStartOffset() < node.getStartOffset()) {
-						if (useBean.getAttribute(JSP11Namespace.ATTR_NAME_ID).equals(useBeanName)) {
-							typeName = useBean.getAttribute(JSP11Namespace.ATTR_NAME_CLASS);
-							if (typeName == null || typeName.length() < 1) {
-								typeName = useBean.getAttribute(JSP11Namespace.ATTR_NAME_TYPE);
-							}
-							if (typeName == null || typeName.length() < 1) {
-								typeName = useBean.getAttribute(JSP11Namespace.ATTR_NAME_BEAN_NAME);
-							}
-						}
-					}
-				}
-				if (typeName != null && typeName.length() > 0) {
-					// find the class/type/beanName definition and obtain the list of properties
-					IBeanInfoProvider provider = new BeanInfoProvider();
-					IResource resource = getResource(contentAssistRequest);
-					IJavaPropertyDescriptor[] descriptors = provider.getRuntimeProperties(resource, typeName);
-					CustomCompletionProposal proposal = null;
-					String displayString = ""; //$NON-NLS-1$
-					for (int j = 0; j < descriptors.length; j++) {
-						IJavaPropertyDescriptor pd = descriptors[j];
-						// check whether it's get or set kinda property
-						if (pd.getReadable() && isGetProperty || pd.getWriteable() && !isGetProperty) {
-							// filter attr value name
-							if (matchString.length() == 0 || pd.getName().toLowerCase().startsWith(matchString.toLowerCase())) {
-								displayString = pd.getDisplayName();
-								if (pd.getDeclaredType() != null && pd.getDeclaredType().length() > 0)
-									displayString += " - " + pd.getDeclaredType(); //$NON-NLS-1$
-								proposal = new CustomCompletionProposal("\"" + pd.getName() + "\"", //$NON-NLS-1$ //$NON-NLS-2$
-											contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), pd.getName().length() + 2, SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ATTRIBUTE),
-											displayString, null, pd.getDeclaredType(), XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
-								contentAssistRequest.addProposal(proposal);
-							}
-						}
-					}
-				}
-			}
-		}
-	}
-
-	private void addBeanNameProposals(ContentAssistRequest contentAssistRequest, IDOMNode node, String matchString) {
-		// will not catch useBeans specified using other than actual DOM Nodes
-		NodeList useBeans = node.getOwnerDocument().getElementsByTagName(JSP11Namespace.ElementName.USEBEAN);
-		if (useBeans != null) {
-			String id = ""; //$NON-NLS-1$
-			String displayString = null;
-			String classOrType = null;
-			String imageName = JSPEditorPluginImages.IMG_OBJ_CLASS_OBJ;
-			for (int j = 0; j < useBeans.getLength(); j++) {
-				if (useBeans.item(j).getNodeType() != Node.ELEMENT_NODE)
-					continue;
-				Element useBean = (Element) useBeans.item(j);
-				if (useBean instanceof IndexedRegion && ((IndexedRegion) useBean).getStartOffset() < node.getStartOffset()) {
-					id = StringUtils.strip(useBean.getAttribute(JSP11Namespace.ATTR_NAME_ID));
-					displayString = null;
-					classOrType = null;
-					imageName = JSPEditorPluginImages.IMG_OBJ_CLASS_OBJ;
-					// set the Image based on whether the class, type, or beanName attribute is present
-					classOrType = useBean.getAttribute(JSP11Namespace.ATTR_NAME_CLASS);
-					if (classOrType == null || classOrType.length() < 1) {
-						classOrType = useBean.getAttribute(JSP11Namespace.ATTR_NAME_TYPE);
-						imageName = JSPEditorPluginImages.IMG_OBJ_PUBLIC;
-					}
-					if (classOrType == null || classOrType.length() < 1) {
-						classOrType = useBean.getAttribute(JSP11Namespace.ATTR_NAME_BEAN_NAME);
-						imageName = JSPEditorPluginImages.IMG_OBJ_PUBLIC;
-					}
-					if (classOrType != null && classOrType.length() > 0)
-						displayString = id + " - " + classOrType; //$NON-NLS-1$
-					else
-						displayString = id;
-
-					// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=2341
-					if(id != null) {
-					    // filter
-						if (matchString.length() == 0 || id.startsWith(matchString)) {
-							CustomCompletionProposal proposal = new CustomCompletionProposal("\"" + id + "\"", //$NON-NLS-1$ //$NON-NLS-2$
-										contentAssistRequest.getReplacementBeginPosition(), 
-                                        contentAssistRequest.getReplacementLength(), 
-                                        id.length() + 2, 
-                                        JSPEditorPluginImageHelper.getInstance().getImage(imageName), 
-                                        displayString, 
-                                        null, 
-                                        null, 
-                                        XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
-							contentAssistRequest.addProposal(proposal);
-						}
-					}
-				}
-			}
-		}
-	}
-	
-	/**
-	 * Returns project request is in
-	 * 
-	 * @param request
-	 * @return
-	 */
-	private IResource getResource(ContentAssistRequest request) {
-		IResource resource = null;
-		String baselocation = null;
-
-		if (request != null) {
-			IStructuredDocumentRegion region = request.getDocumentRegion();
-			if (region != null) {
-				IDocument document = region.getParentDocument();
-				IStructuredModel model = null;
-				try {
-					model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
-					if (model != null) {
-						baselocation = model.getBaseLocation();
-					}
-				} finally {
-					if (model != null)
-						model.releaseFromRead();
-				}
-			}
-		}
-
-		if (baselocation != null) {
-			// copied from JSPTranslationAdapter#getJavaProject
-			IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
-			IPath filePath = new Path(baselocation);
-			IFile file = null;
-
-			if (filePath.segmentCount() > 1) {
-				file = root.getFile(filePath);
-			}
-			if (file != null) {
-				resource = file.getProject();
-			}
-		}
-		return resource;
-	}
-}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java
index 61e9ceb..321e274 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,7 +17,9 @@
 
 import org.eclipse.jdt.core.CompletionProposal;
 import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IImportContainer;
 import org.eclipse.jdt.core.Signature;
+import org.eclipse.jdt.internal.ui.text.java.ProposalContextInformation;
 import org.eclipse.jdt.ui.text.java.CompletionProposalCollector;
 import org.eclipse.jdt.ui.text.java.CompletionProposalComparator;
 import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
@@ -39,7 +41,8 @@
 
 	private JSPTranslation fTranslation;
 	private Comparator fComparator;
-	
+	private IImportContainer fImportContainer;
+
 	public JSPProposalCollector(ICompilationUnit cu, JSPTranslation translation) {
 		super(cu);
 	
@@ -47,6 +50,7 @@
 			throw new IllegalArgumentException("JSPTranslation cannot be null"); //$NON-NLS-1$
 		
 		fTranslation = translation;
+		fImportContainer = cu.getImportContainer();
 	}
 
 	/**
@@ -89,7 +93,7 @@
 			if(proposal.getKind() == CompletionProposal.TYPE_REF) {
 				String signature = String.valueOf(proposal.getDeclarationSignature());
 				String completion = String.valueOf(proposal.getCompletion());
-				if(completion.indexOf(signature) != -1) {
+				if(completion.indexOf(signature + ".") != -1) { //$NON-NLS-1$
 					jspProposal = createAutoImportProposal(proposal);			
 				}
 			}
@@ -101,19 +105,26 @@
 		return jspProposal;
 	}
 
-	
-	
+	/**
+	 * Retrieves the type name from the string <code>fullName</code>
+	 * @param fullName the fully qualified Java name
+	 * @return the type name
+	 */
+	private String getTypeName(String fullName) {
+		int index = fullName.lastIndexOf('.');
+		return (index != -1) ? fullName.substring(index + 1) : fullName;
+	}
+
 	private JSPCompletionProposal createAutoImportProposal(CompletionProposal proposal) {
 		
 		JSPCompletionProposal jspProposal = null;
 
-		String signature = new String(proposal.getDeclarationSignature());
 		String completion = new String(proposal.getCompletion());
 		
 		// it's fully qualified so we should
 		// add an import statement
 		// create an autoimport proposal
-		String newCompletion = completion.replaceAll(signature + ".", ""); //$NON-NLS-1$ //$NON-NLS-2$
+		String newCompletion = getTypeName(completion);
 		
 		// java offset
 		int offset = proposal.getReplaceStart();
@@ -137,7 +148,7 @@
 		
 		boolean updateLengthOnValidate = true;
 		
-		jspProposal = new AutoImportProposal(completion, newCompletion, offset, length, positionAfter, image, displayString, contextInformation, null, relevance, updateLengthOnValidate);
+		jspProposal = new AutoImportProposal(completion, fImportContainer, newCompletion, offset, length, positionAfter, image, displayString, contextInformation, null, relevance, updateLengthOnValidate);
 		
 		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=124483
 		// set wrapped java proposal so additional info can be calculated on demand
@@ -167,6 +178,16 @@
 		displayString = getTranslation().fixupMangledName(displayString);
 		IContextInformation contextInformation = javaProposal.getContextInformation();
 		// String additionalInfo = javaProposal.getAdditionalProposalInfo();
+		
+		/* the context information is calculated with respect to the java document
+		 * thus it needs to be updated in respect of the JSP document.
+		 */
+		if(contextInformation instanceof ProposalContextInformation) {
+			ProposalContextInformation proposalInfo = (ProposalContextInformation)contextInformation;
+			int contextInfoJSPOffset = fTranslation.getJspOffset(proposalInfo.getContextInformationPosition());
+			proposalInfo.setContextInformationPosition(contextInfoJSPOffset);
+		}
+		
 		int relevance = javaProposal.getRelevance();
 		
 		boolean updateLengthOnValidate = true;
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPStructuredContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPStructuredContentAssistProcessor.java
new file mode 100644
index 0000000..aa2b995
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPStructuredContentAssistProcessor.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.jdt.ui.PreferenceConstants;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jst.jsp.core.text.IJSPPartitions;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
+import org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor;
+import org.eclipse.wst.xml.ui.internal.contentassist.AttributeContextInformationPresenter;
+
+/**
+ * <p>Implementation of {@link StructuredContentAssistProcessor} for JSP documents</p>
+ * 
+ * <p>Currently this implementation still uses the HTML preferences for auto
+ * activation characters, but in the future this should probably change</p>
+ */
+public class JSPStructuredContentAssistProcessor extends StructuredContentAssistProcessor {
+
+	/** auto activation characters */
+	private char[] fCompletionPropoaslAutoActivationCharacters;
+	
+	/** property key for determining if auto activation is enabled */
+	private String fAutoActivationEnabledPropertyKey;
+	
+	/** property key for determining what the auto activation characters are */
+	private String fAutoActivationCharactersPropertyKey;
+	
+	/** the context information validator for this processor */
+	private IContextInformationValidator fContextInformationValidator;
+	
+	/**
+	 * <p>Constructor</p>
+	 * 
+	 * @param assistant {@link ContentAssistant} to use
+	 * @param partitionTypeID the partition type this processor is for
+	 * @param viewer {@link ITextViewer} this processor is acting in
+	 */
+	public JSPStructuredContentAssistProcessor(ContentAssistant assistant,
+			String partitionTypeID, ITextViewer viewer) {
+		
+		super(assistant, partitionTypeID, viewer, isJavaPartitionType(partitionTypeID) ?
+				PreferenceConstants.getPreferenceStore() : HTMLUIPlugin.getDefault().getPreferenceStore());
+
+		//determine which property keys to used based on weather this processor is for Java or HTML syntax
+		if(isJavaPartitionType(partitionTypeID)) {
+			fAutoActivationEnabledPropertyKey = PreferenceConstants.CODEASSIST_AUTOACTIVATION;
+			fAutoActivationCharactersPropertyKey = PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA;
+		} else {
+			fAutoActivationEnabledPropertyKey = HTMLUIPreferenceNames.AUTO_PROPOSE;
+			fAutoActivationCharactersPropertyKey = HTMLUIPreferenceNames.AUTO_PROPOSE_CODE;
+		}
+		
+		//get the current user preference
+		getAutoActivationCharacterPreferences();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#getContextInformationValidator()
+	 */
+	public IContextInformationValidator getContextInformationValidator() {
+		if (this.fContextInformationValidator == null) {
+			this.fContextInformationValidator = new AttributeContextInformationPresenter();
+		}
+		return this.fContextInformationValidator;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.html.ui.internal.contentassist.HTMLStructuredContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
+	 */
+	public char[] getCompletionProposalAutoActivationCharacters() {
+		return fCompletionPropoaslAutoActivationCharacters;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#propertyChange(
+	 * 	org.eclipse.jface.util.PropertyChangeEvent)
+	 */
+	public void propertyChange(PropertyChangeEvent event) {
+		String property = event.getProperty();
+		if(property.equals(fAutoActivationEnabledPropertyKey) ||
+				property.equals(fAutoActivationCharactersPropertyKey)) {
+			
+			getAutoActivationCharacterPreferences();
+		}
+	}
+	
+	/**
+	 * <p>Gets the auto activation character user preferences for Java and stores them for later use</p>
+	 */
+	private void getAutoActivationCharacterPreferences() {
+		IPreferenceStore store = getPreferenceStore();
+		
+		boolean doAuto = store.getBoolean(fAutoActivationEnabledPropertyKey);
+		if (doAuto) {
+			fCompletionPropoaslAutoActivationCharacters =
+				store.getString(fAutoActivationCharactersPropertyKey).toCharArray();
+		} else {
+			fCompletionPropoaslAutoActivationCharacters = null;
+		}
+	}
+	
+	/**
+	 * @param partitionTypeID check to see if this partition type ID is for a Java partition type
+	 * @return <code>true</code> if the given partiton type is a Java partition type,
+	 * <code>false</code> otherwise
+	 */
+	private static boolean isJavaPartitionType(String partitionTypeID) {
+		return IJSPPartitions.JSP_CONTENT_JAVA.equals(partitionTypeID) || IJSPPartitions.JSP_DEFAULT_EL.equals(partitionTypeID) || IJSPPartitions.JSP_DEFAULT_EL2.equals(partitionTypeID);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibCompletionProposalComputer.java
new file mode 100644
index 0000000..a51b8c6
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibCompletionProposalComputer.java
@@ -0,0 +1,418 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
+import org.eclipse.jst.jsp.core.internal.util.FacetModuleCoreSupport;
+import org.eclipse.jst.jsp.core.taglib.IJarRecord;
+import org.eclipse.jst.jsp.core.taglib.ITLDRecord;
+import org.eclipse.jst.jsp.core.taglib.ITagDirRecord;
+import org.eclipse.jst.jsp.core.taglib.ITaglibDescriptor;
+import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
+import org.eclipse.jst.jsp.core.taglib.IURLRecord;
+import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
+import org.eclipse.wst.html.core.internal.contentmodel.JSP20Namespace;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceConstants;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
+import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
+import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
+import org.w3c.dom.Node;
+
+/**
+ * <p>Compute JSP taglib completion proposals</p>
+ */
+public class JSPTaglibCompletionProposalComputer extends
+		DefaultXMLCompletionProposalComputer {
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeValueProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		IPath basePath = getBasePath(contentAssistRequest);
+		if (basePath != null) {
+			IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
+	
+			//only add attribute value proposals for specific elements
+			if(node.getNodeName().equals(JSP11Namespace.ElementName.DIRECTIVE_TAGLIB)) {
+				// Find the attribute name for which this position should have a value
+				IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
+				ITextRegionList openRegions = open.getRegions();
+				int i = openRegions.indexOf(contentAssistRequest.getRegion());
+				if (i < 0)
+					return;
+				ITextRegion nameRegion = null;
+				while (i >= 0) {
+					nameRegion = openRegions.get(i--);
+					if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
+						break;
+				}
+		
+				String attributeName = null;
+				if (nameRegion != null)
+					attributeName = open.getText(nameRegion);
+		
+				String currentValue = null;
+				if (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
+					currentValue = contentAssistRequest.getText();
+				else
+					currentValue = ""; //$NON-NLS-1$
+				String matchString = null;
+				// fixups
+				int start = contentAssistRequest.getReplacementBeginPosition();
+				int length = contentAssistRequest.getReplacementLength();
+				if (currentValue.length() > StringUtils.strip(currentValue).length() &&
+						(currentValue.startsWith("\"") || currentValue.startsWith("'")) && //$NON-NLS-1$ //$NON-NLS-2$
+						contentAssistRequest.getMatchString().length() > 0) {
+					
+					matchString = currentValue.substring(1, contentAssistRequest.getMatchString().length());
+				}
+				else {
+					matchString = currentValue.substring(0, contentAssistRequest.getMatchString().length());
+				}
+				boolean existingComplicatedValue = contentAssistRequest.getRegion() != null &&
+						contentAssistRequest.getRegion() instanceof ITextRegionContainer;
+				if (existingComplicatedValue) {
+					contentAssistRequest.getProposals().clear();
+					contentAssistRequest.getMacros().clear();
+				}
+				else {
+					String lowerCaseMatch = matchString.toLowerCase(Locale.US);
+					if (attributeName.equals(JSP11Namespace.ATTR_NAME_URI)) {
+						ITaglibRecord[] availableTaglibRecords = TaglibIndex.getAvailableTaglibRecords(basePath);
+						/*
+						 * a simple enough way to remove duplicates (resolution at
+						 * runtime would be nondeterministic anyway)
+						 */
+						Map uriToRecords = new HashMap();
+						for (int taglibRecordNumber = 0; taglibRecordNumber < availableTaglibRecords.length; taglibRecordNumber++) {
+							ITaglibRecord taglibRecord = availableTaglibRecords[taglibRecordNumber];
+							ITaglibDescriptor descriptor = taglibRecord.getDescriptor();
+							String uri = null;
+							switch (taglibRecord.getRecordType()) {
+								case ITaglibRecord.URL :
+									uri = descriptor.getURI();
+									uriToRecords.put(uri, taglibRecord);
+									break;
+								case ITaglibRecord.JAR : {
+									IPath location = ((IJarRecord) taglibRecord).getLocation();
+									IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(location);
+									IPath localContextRoot = FacetModuleCoreSupport.computeWebContentRootPath(basePath);
+									for (int fileNumber = 0; fileNumber < files.length; fileNumber++) {
+										if (localContextRoot.isPrefixOf(files[fileNumber].getFullPath())) {
+											uri = IPath.SEPARATOR +
+													files[fileNumber].getFullPath().removeFirstSegments(localContextRoot.segmentCount()).toString();
+											uriToRecords.put(uri, taglibRecord);
+										}
+										else {
+											uri = FacetModuleCoreSupport.getRuntimePath(files[fileNumber].getFullPath()).toString();
+											uriToRecords.put(uri, taglibRecord);
+										}
+									}
+									break;
+								}
+								case ITaglibRecord.TLD : {
+									IPath path = ((ITLDRecord) taglibRecord).getPath();
+									IPath localContextRoot = FacetModuleCoreSupport.computeWebContentRootPath(basePath);
+									if (localContextRoot.isPrefixOf(path)) {
+										uri = IPath.SEPARATOR + path.removeFirstSegments(localContextRoot.segmentCount()).toString();
+										uriToRecords.put(uri, taglibRecord);
+									}
+									else {
+										uri = FacetModuleCoreSupport.getRuntimePath(path).toString();
+										uriToRecords.put(uri, taglibRecord);
+									}
+									break;
+								}
+							}
+						}
+						/*
+						 * use the records and their descriptors to construct
+						 * proposals
+						 */
+						Object[] uris = uriToRecords.keySet().toArray();
+						for (int uriNumber = 0; uriNumber < uris.length; uriNumber++) {
+							String uri = uris[uriNumber].toString();
+							ITaglibRecord taglibRecord = (ITaglibRecord) uriToRecords.get(uri);
+							ITaglibDescriptor descriptor = (taglibRecord).getDescriptor();
+							if (uri != null && uri.length() > 0 && (matchString.length() == 0 ||
+									uri.toLowerCase(Locale.US).startsWith(lowerCaseMatch))) {
+								
+								String url = getSmallImageURL(taglibRecord);
+								ImageDescriptor imageDescriptor = JSPUIPlugin.getInstance().getImageRegistry().getDescriptor(url);
+								if (imageDescriptor == null && url != null) {
+									URL imageURL;
+									try {
+										imageURL = new URL(url);
+										imageDescriptor = ImageDescriptor.createFromURL(imageURL);
+										JSPUIPlugin.getInstance().getImageRegistry().put(url, imageDescriptor);
+									}
+									catch (MalformedURLException e) {
+										Logger.logException(e);
+									}
+								}
+								String additionalInfo = descriptor.getDisplayName() + "<br/>" + //$NON-NLS-1$
+										descriptor.getDescription() + "<br/>" + descriptor.getTlibVersion(); //$NON-NLS-1$
+								Image image = null;
+								try {
+									image = JSPUIPlugin.getInstance().getImageRegistry().get(url);
+								}
+								catch (Exception e) {
+									Logger.logException(e);
+								}
+								if (image == null) {
+									image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
+								}
+								CustomCompletionProposal proposal = new CustomCompletionProposal(
+										"\"" + uri + "\"", start, length, uri.length() + 2, //$NON-NLS-1$ //$NON-NLS-2$
+										image, uri, null, additionalInfo, IRelevanceConstants.R_NONE);
+								contentAssistRequest.addProposal(proposal);
+							}
+						}
+					}
+					else if (attributeName.equals(JSP20Namespace.ATTR_NAME_TAGDIR)) {
+						ITaglibRecord[] availableTaglibRecords = TaglibIndex.getAvailableTaglibRecords(basePath);
+						/*
+						 * a simple enough way to remove duplicates (resolution at
+						 * runtime would be nondeterministic anyway)
+						 */
+						Map uriToRecords = new HashMap();
+						for (int taglibRecordNumber = 0; taglibRecordNumber < availableTaglibRecords.length; taglibRecordNumber++) {
+							ITaglibRecord taglibRecord = availableTaglibRecords[taglibRecordNumber];
+							String uri = null;
+							if (taglibRecord.getRecordType() == ITaglibRecord.TAGDIR) {
+								IPath path = ((ITagDirRecord) taglibRecord).getPath();
+								IPath localContextRoot = TaglibIndex.getContextRoot(basePath);
+								if (localContextRoot.isPrefixOf(path)) {
+									uri = IPath.SEPARATOR + path.removeFirstSegments(localContextRoot.segmentCount()).toString();
+									uriToRecords.put(uri, taglibRecord);
+								}
+							}
+						}
+						/*
+						 * use the records and their descriptors to construct
+						 * proposals
+						 */
+						Object[] uris = uriToRecords.keySet().toArray();
+						for (int uriNumber = 0; uriNumber < uris.length; uriNumber++) {
+							String uri = uris[uriNumber].toString();
+							ITaglibRecord taglibRecord = (ITaglibRecord) uriToRecords.get(uri);
+							ITaglibDescriptor descriptor = (taglibRecord).getDescriptor();
+							if (uri != null && uri.length() > 0 && (matchString.length() == 0 ||
+									uri.toLowerCase(Locale.US).startsWith(lowerCaseMatch))) {
+								
+								String url = getSmallImageURL(taglibRecord);
+								ImageDescriptor imageDescriptor = null;
+								if (url != null) {
+									imageDescriptor = JSPUIPlugin.getInstance().getImageRegistry().getDescriptor(url);
+								}
+								if (imageDescriptor == null && url != null) {
+									URL imageURL;
+									try {
+										imageURL = new URL(url);
+										imageDescriptor = ImageDescriptor.createFromURL(imageURL);
+										JSPUIPlugin.getInstance().getImageRegistry().put(url, imageDescriptor);
+									}
+									catch (MalformedURLException e) {
+										Logger.logException(e);
+									}
+								}
+								String additionalInfo = descriptor.getDescription() + "<br/>" + descriptor.getTlibVersion(); //$NON-NLS-1$
+								Image image = null;
+								try {
+									image = JSPUIPlugin.getInstance().getImageRegistry().get(url);
+								}
+								catch (Exception e) {
+									Logger.logException(e);
+								}
+								if (image == null) {
+									image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
+								}
+								CustomCompletionProposal proposal = new CustomCompletionProposal(
+										"\"" + uri + "\"", start, length, uri.length() + 2, image, uri, //$NON-NLS-1$ //$NON-NLS-2$
+										null, additionalInfo, IRelevanceConstants.R_NONE);
+								contentAssistRequest.addProposal(proposal);
+							}
+						}
+					}
+					else if (attributeName.equals(JSP11Namespace.ATTR_NAME_PREFIX)) {
+						Node uriAttr = node.getAttributes().getNamedItem(JSP11Namespace.ATTR_NAME_URI);
+						String uri = null;
+						if (uriAttr != null) {
+							uri = uriAttr.getNodeValue();
+							ITaglibRecord[] availableTaglibRecords = TaglibIndex.getAvailableTaglibRecords(basePath);
+							Map prefixMap = new HashMap();
+							for (int taglibrecordNumber = 0; taglibrecordNumber < availableTaglibRecords.length; taglibrecordNumber++) {
+								ITaglibDescriptor descriptor = availableTaglibRecords[taglibrecordNumber].getDescriptor();
+								if (descriptor != null && descriptor.getURI() != null &&
+										descriptor.getURI().toLowerCase(Locale.US).equals(uri.toLowerCase(Locale.US))) {
+									String shortName = descriptor.getShortName().trim();
+									if (shortName.length() > 0) {
+										boolean valid = true;
+										for (int character = 0; character < shortName.length(); character++) {
+											valid = valid && !Character.isWhitespace(shortName.charAt(character));
+										}
+										if (valid) {
+											prefixMap.put(shortName, descriptor);
+										}
+									}
+								}
+							}
+							Object prefixes[] = prefixMap.keySet().toArray();
+							for (int j = 0; j < prefixes.length; j++) {
+								String prefix = (String) prefixes[j];
+								ITaglibDescriptor descriptor = (ITaglibDescriptor) prefixMap.get(prefix);
+								Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
+								CustomCompletionProposal proposal = new CustomCompletionProposal(
+										"\"" + prefix + "\"", start, length, prefix.length() + 2, image, //$NON-NLS-1$ //$NON-NLS-2$
+										prefix, null, descriptor.getDescription(), IRelevanceConstants.R_NONE);
+								contentAssistRequest.addProposal(proposal);
+							}
+						}
+						else {
+							Node dirAttr = node.getAttributes().getNamedItem(JSP20Namespace.ATTR_NAME_TAGDIR);
+							if (dirAttr != null) {
+								String dir = dirAttr.getNodeValue();
+								if (dir != null) {
+									ITaglibRecord record = TaglibIndex.resolve(basePath.toString(), dir, false);
+									if (record != null) {
+										ITaglibDescriptor descriptor = record.getDescriptor();
+										if (descriptor != null) {
+											String shortName = descriptor.getShortName();
+		
+											Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
+											CustomCompletionProposal proposal = new CustomCompletionProposal(
+													"\"" + shortName + "\"", start, length, shortName.length() + 2, //$NON-NLS-1$ //$NON-NLS-2$
+													image, shortName, null, descriptor.getDescription(),
+													IRelevanceConstants.R_NONE);
+											contentAssistRequest.addProposal(proposal);
+										}
+										else {
+											if (dir.startsWith("/WEB-INF/")) { //$NON-NLS-1$
+												dir = dir.substring(9);
+											}
+											String prefix = StringUtils.replace(dir, "/", "-"); //$NON-NLS-1$ //$NON-NLS-2$
+		
+											Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
+											CustomCompletionProposal proposal = new CustomCompletionProposal(
+													"\"" + prefix + "\"", start, length, prefix.length() + 2, //$NON-NLS-1$ //$NON-NLS-2$
+													image, prefix, null, null, IRelevanceConstants.R_NONE);
+											contentAssistRequest.addProposal(proposal);
+										}
+									}
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+	
+	private String getSmallImageURL(ITaglibRecord taglibRecord) {
+		String url = null;
+		switch (taglibRecord.getRecordType()) {
+			case (ITaglibRecord.TLD) : {
+				ITLDRecord record = (ITLDRecord) taglibRecord;
+				IResource file = ResourcesPlugin.getWorkspace().getRoot().getFile(record.getPath());
+				if (file.getLocation() != null && record.getDescriptor().getSmallIcon().length() > 0) {
+					url = "platform:/resource/" + //$NON-NLS-1$
+					FacetModuleCoreSupport.resolve(file.getFullPath(),
+							record.getDescriptor().getSmallIcon());
+				}
+			}
+				break;
+			case (ITaglibRecord.JAR) : {
+				IJarRecord record = (IJarRecord) taglibRecord;
+				if (record.getDescriptor().getSmallIcon().length() > 0) {
+					// url = "file:" +
+					// URIHelper.normalize(record.getDescriptor().getSmallIcon(),
+					// record.getLocation().toString(), "/"); //$NON-NLS-1$
+				}
+			}
+				break;
+			case (ITaglibRecord.TAGDIR) : {
+			}
+				break;
+			case (ITaglibRecord.URL) : {
+				IURLRecord record = (IURLRecord) taglibRecord;
+				if (record.getDescriptor().getSmallIcon().length() > 0) {
+					url = URIHelper.normalize(record.getDescriptor().getSmallIcon(), record.getURL().toString(), "/"); //$NON-NLS-1$
+				}
+			}
+				break;
+		}
+		return url;
+	}
+	
+	/**
+	 * Returns project request is in
+	 * 
+	 * @param request
+	 * @return
+	 */
+	private IPath getBasePath(ContentAssistRequest request) {
+		IPath baselocation = null;
+
+		if (request != null) {
+			IStructuredDocumentRegion region = request.getDocumentRegion();
+			if (region != null) {
+				IDocument document = region.getParentDocument();
+				IStructuredModel model = null;
+				try {
+					model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+					if (model != null) {
+						String location = model.getBaseLocation();
+						if (location != null) {
+							baselocation = new Path(location);
+						}
+					}
+				}
+				finally {
+					if (model != null)
+						model.releaseFromRead();
+				}
+			}
+		}
+		return baselocation;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibDirectiveContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibDirectiveContentAssistProcessor.java
index b2f7d08..9374f8f 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibDirectiveContentAssistProcessor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibDirectiveContentAssistProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,380 +10,22 @@
  *******************************************************************************/
 package org.eclipse.jst.jsp.ui.internal.contentassist;
 
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.jst.jsp.core.internal.util.FacetModuleCoreSupport;
-import org.eclipse.jst.jsp.core.taglib.IJarRecord;
-import org.eclipse.jst.jsp.core.taglib.ITLDRecord;
-import org.eclipse.jst.jsp.core.taglib.ITagDirRecord;
-import org.eclipse.jst.jsp.core.taglib.ITaglibDescriptor;
-import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
-import org.eclipse.jst.jsp.core.taglib.IURLRecord;
-import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.html.core.internal.contentmodel.JSP20Namespace;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceConstants;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.w3c.dom.Node;
 
 /**
- * @plannedfor 1.0
+ * @deprecated This class is no longer used locally and will be removed in the future
+ * @see JSPTaglibCompletionProposalComputer
  */
 public class JSPTaglibDirectiveContentAssistProcessor extends JSPDummyContentAssistProcessor {
 
+	private JSPTaglibCompletionProposalComputer fComputer;
+	
 	public JSPTaglibDirectiveContentAssistProcessor() {
 		super();
+		fComputer = new JSPTaglibCompletionProposalComputer();
 	}
 
-	String getSmallImageURL(ITaglibRecord taglibRecord) {
-		String url = null;
-		switch (taglibRecord.getRecordType()) {
-			case (ITaglibRecord.TLD) : {
-				ITLDRecord record = (ITLDRecord) taglibRecord;
-				IResource file = ResourcesPlugin.getWorkspace().getRoot().getFile(record.getPath());
-				if (file.getLocation() != null && record.getDescriptor().getSmallIcon().length() > 0) {
-					url = "file:" + FacetModuleCoreSupport.resolve(file.getFullPath(), record.getDescriptor().getSmallIcon()); //$NON-NLS-1$
-				}
-			}
-				break;
-			case (ITaglibRecord.JAR) : {
-				IJarRecord record = (IJarRecord) taglibRecord;
-				if (record.getDescriptor().getSmallIcon().length() > 0) {
-					// url = "file:" +
-					// URIHelper.normalize(record.getDescriptor().getSmallIcon(),
-					// record.getLocation().toString(), "/"); //$NON-NLS-1$
-				}
-			}
-				break;
-			case (ITaglibRecord.TAGDIR) : {
-			}
-				break;
-			case (ITaglibRecord.URL) : {
-				IURLRecord record = (IURLRecord) taglibRecord;
-				if (record.getDescriptor().getSmallIcon().length() > 0) {
-					url = URIHelper.normalize(record.getDescriptor().getSmallIcon(), record.getURL().toString(), "/"); //$NON-NLS-1$
-				}
-			}
-				break;
-		}
-		return url;
-	}
-
-
 	protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
-		IPath basePath = getBasePath(contentAssistRequest);
-		if (basePath == null)
-			return;
-
-		IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
-
-		// Find the attribute name for which this position should have a value
-		IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
-		ITextRegionList openRegions = open.getRegions();
-		int i = openRegions.indexOf(contentAssistRequest.getRegion());
-		if (i < 0)
-			return;
-		ITextRegion nameRegion = null;
-		while (i >= 0) {
-			nameRegion = openRegions.get(i--);
-			if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
-				break;
-		}
-
-		String attributeName = null;
-		if (nameRegion != null)
-			attributeName = open.getText(nameRegion);
-
-		String currentValue = null;
-		if (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
-			currentValue = contentAssistRequest.getText();
-		else
-			currentValue = ""; //$NON-NLS-1$
-		String matchString = null;
-		// fixups
-		int start = contentAssistRequest.getReplacementBeginPosition();
-		int length = contentAssistRequest.getReplacementLength();
-		if (currentValue.length() > StringUtils.strip(currentValue).length() && (currentValue.startsWith("\"") || currentValue.startsWith("'")) //$NON-NLS-1$ //$NON-NLS-2$
-					&& contentAssistRequest.getMatchString().length() > 0) {
-			matchString = currentValue.substring(1, contentAssistRequest.getMatchString().length());
-		}
-		else
-			matchString = currentValue.substring(0, contentAssistRequest.getMatchString().length());
-		boolean existingComplicatedValue = contentAssistRequest.getRegion() != null && contentAssistRequest.getRegion() instanceof ITextRegionContainer;
-		if (existingComplicatedValue) {
-			contentAssistRequest.getProposals().clear();
-			contentAssistRequest.getMacros().clear();
-		}
-		else {
-			String lowerCaseMatch = matchString.toLowerCase(Locale.US);
-			if (attributeName.equals(JSP11Namespace.ATTR_NAME_URI)) {
-				ITaglibRecord[] availableTaglibRecords = TaglibIndex.getAvailableTaglibRecords(basePath);
-				/*
-				 * a simple enough way to remove duplicates (resolution at
-				 * runtime would be nondeterministic anyway)
-				 */
-				Map uriToRecords = new HashMap();
-				for (int taglibRecordNumber = 0; taglibRecordNumber < availableTaglibRecords.length; taglibRecordNumber++) {
-					ITaglibRecord taglibRecord = availableTaglibRecords[taglibRecordNumber];
-					ITaglibDescriptor descriptor = taglibRecord.getDescriptor();
-					String uri = null;
-					switch (taglibRecord.getRecordType()) {
-						case ITaglibRecord.URL :
-							uri = descriptor.getURI();
-							uriToRecords.put(uri, taglibRecord);
-							break;
-						case ITaglibRecord.JAR : {
-							IPath location = ((IJarRecord) taglibRecord).getLocation();
-							IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(location);
-							IPath localContextRoot = FacetModuleCoreSupport.computeWebContentRootPath(basePath);
-							for (int fileNumber = 0; fileNumber < files.length; fileNumber++) {
-								if (localContextRoot.isPrefixOf(files[fileNumber].getFullPath())) {
-									uri = IPath.SEPARATOR + files[fileNumber].getFullPath().removeFirstSegments(localContextRoot.segmentCount()).toString();
-									uriToRecords.put(uri, taglibRecord);
-								}
-								else {
-									uri = FacetModuleCoreSupport.getRuntimePath(files[fileNumber].getFullPath()).toString();
-									uriToRecords.put(uri, taglibRecord);
-								}
-							}
-							break;
-						}
-						case ITaglibRecord.TLD : {
-							IPath path = ((ITLDRecord) taglibRecord).getPath();
-							IPath localContextRoot = FacetModuleCoreSupport.computeWebContentRootPath(basePath);
-							if (localContextRoot.isPrefixOf(path)) {
-								uri = IPath.SEPARATOR + path.removeFirstSegments(localContextRoot.segmentCount()).toString();
-								uriToRecords.put(uri, taglibRecord);
-							}
-							else {
-								uri = FacetModuleCoreSupport.getRuntimePath(path).toString();
-								uriToRecords.put(uri, taglibRecord);
-							}
-							break;
-						}
-					}
-				}
-				/*
-				 * use the records and their descriptors to construct
-				 * proposals
-				 */
-				Object[] uris = uriToRecords.keySet().toArray();
-				for (int uriNumber = 0; uriNumber < uris.length; uriNumber++) {
-					String uri = uris[uriNumber].toString();
-					ITaglibRecord taglibRecord = (ITaglibRecord) uriToRecords.get(uri);
-					ITaglibDescriptor descriptor = (taglibRecord).getDescriptor();
-					if (uri != null && uri.length() > 0 && (matchString.length() == 0 || uri.toLowerCase(Locale.US).startsWith(lowerCaseMatch))) {
-						String url = getSmallImageURL(taglibRecord);
-						ImageDescriptor imageDescriptor = JSPUIPlugin.getInstance().getImageRegistry().getDescriptor(url);
-						if (imageDescriptor == null && url != null) {
-							URL imageURL;
-							try {
-								imageURL = new URL(url);
-								imageDescriptor = ImageDescriptor.createFromURL(imageURL);
-								JSPUIPlugin.getInstance().getImageRegistry().put(url, imageDescriptor);
-							}
-							catch (MalformedURLException e) {
-								Logger.logException(e);
-							}
-						}
-						String additionalInfo = descriptor.getDescription() + "<br/>" + descriptor.getTlibVersion();
-						Image image = null;
-						try {
-							image = JSPUIPlugin.getInstance().getImageRegistry().get(url);
-						}
-						catch (Exception e) {
-							Logger.logException(e);
-						}
-						if (image == null) {
-							image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
-						}
-						CustomCompletionProposal proposal = new CustomCompletionProposal("\"" + uri + "\"", start, length, uri.length() + 2, image, uri, null, additionalInfo, IRelevanceConstants.R_NONE);
-						contentAssistRequest.addProposal(proposal);
-					}
-				}
-			}
-			else if (attributeName.equals(JSP20Namespace.ATTR_NAME_TAGDIR)) {
-				ITaglibRecord[] availableTaglibRecords = TaglibIndex.getAvailableTaglibRecords(basePath);
-				/*
-				 * a simple enough way to remove duplicates (resolution at
-				 * runtime would be nondeterministic anyway)
-				 */
-				Map uriToRecords = new HashMap();
-				for (int taglibRecordNumber = 0; taglibRecordNumber < availableTaglibRecords.length; taglibRecordNumber++) {
-					ITaglibRecord taglibRecord = availableTaglibRecords[taglibRecordNumber];
-					String uri = null;
-					if (taglibRecord.getRecordType() == ITaglibRecord.TAGDIR) {
-						IPath path = ((ITagDirRecord) taglibRecord).getPath();
-						IPath localContextRoot = TaglibIndex.getContextRoot(basePath);
-						if (localContextRoot.isPrefixOf(path)) {
-							uri = IPath.SEPARATOR + path.removeFirstSegments(localContextRoot.segmentCount()).toString();
-							uriToRecords.put(uri, taglibRecord);
-						}
-					}
-				}
-				/*
-				 * use the records and their descriptors to construct
-				 * proposals
-				 */
-				Object[] uris = uriToRecords.keySet().toArray();
-				for (int uriNumber = 0; uriNumber < uris.length; uriNumber++) {
-					String uri = uris[uriNumber].toString();
-					ITaglibRecord taglibRecord = (ITaglibRecord) uriToRecords.get(uri);
-					ITaglibDescriptor descriptor = (taglibRecord).getDescriptor();
-					if (uri != null && uri.length() > 0 && (matchString.length() == 0 || uri.toLowerCase(Locale.US).startsWith(lowerCaseMatch))) {
-						String url = getSmallImageURL(taglibRecord);
-						ImageDescriptor imageDescriptor = null;
-						if (url != null) {
-							imageDescriptor = JSPUIPlugin.getInstance().getImageRegistry().getDescriptor(url);
-						}
-						if (imageDescriptor == null && url != null) {
-							URL imageURL;
-							try {
-								imageURL = new URL(url);
-								imageDescriptor = ImageDescriptor.createFromURL(imageURL);
-								JSPUIPlugin.getInstance().getImageRegistry().put(url, imageDescriptor);
-							}
-							catch (MalformedURLException e) {
-								Logger.logException(e);
-							}
-						}
-						String additionalInfo = descriptor.getDescription() + "<br/>" + descriptor.getTlibVersion();
-						Image image = null;
-						try {
-							image = JSPUIPlugin.getInstance().getImageRegistry().get(url);
-						}
-						catch (Exception e) {
-							Logger.logException(e);
-						}
-						if (image == null) {
-							image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
-						}
-						CustomCompletionProposal proposal = new CustomCompletionProposal("\"" + uri + "\"", start, length, uri.length() + 2, image, uri, null, additionalInfo, IRelevanceConstants.R_NONE);
-						contentAssistRequest.addProposal(proposal);
-					}
-				}
-			}
-			else if (attributeName.equals(JSP11Namespace.ATTR_NAME_PREFIX)) {
-				Node uriAttr = node.getAttributes().getNamedItem(JSP11Namespace.ATTR_NAME_URI);
-				String uri = null;
-				if (uriAttr != null) {
-					uri = uriAttr.getNodeValue();
-					ITaglibRecord[] availableTaglibRecords = TaglibIndex.getAvailableTaglibRecords(basePath);
-					Map prefixMap = new HashMap();
-					for (int taglibrecordNumber = 0; taglibrecordNumber < availableTaglibRecords.length; taglibrecordNumber++) {
-						ITaglibDescriptor descriptor = availableTaglibRecords[taglibrecordNumber].getDescriptor();
-						if (descriptor != null && descriptor.getURI() != null && descriptor.getURI().toLowerCase(Locale.US).equals(uri.toLowerCase(Locale.US))) {
-							String shortName = descriptor.getShortName().trim();
-							if (shortName.length() > 0) {
-								boolean valid = true;
-								for (int character = 0; character < shortName.length(); character++) {
-									valid = valid && !Character.isWhitespace(shortName.charAt(character));
-								}
-								if (valid) {
-									prefixMap.put(shortName, descriptor);
-								}
-							}
-						}
-					}
-					Object prefixes[] = prefixMap.keySet().toArray();
-					for (int j = 0; j < prefixes.length; j++) {
-						String prefix = (String) prefixes[j];
-						ITaglibDescriptor descriptor = (ITaglibDescriptor) prefixMap.get(prefix);
-						Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
-						CustomCompletionProposal proposal = new CustomCompletionProposal("\"" + prefix + "\"", start, length, prefix.length() + 2, image, prefix, null, descriptor.getDescription(), IRelevanceConstants.R_NONE);
-						contentAssistRequest.addProposal(proposal);
-					}
-				}
-				else {
-					Node dirAttr = node.getAttributes().getNamedItem(JSP20Namespace.ATTR_NAME_TAGDIR);
-					if (dirAttr != null) {
-						String dir = dirAttr.getNodeValue();
-						if (dir != null) {
-							ITaglibRecord record = TaglibIndex.resolve(basePath.toString(), dir, false);
-							if (record != null) {
-								ITaglibDescriptor descriptor = record.getDescriptor();
-								if (descriptor != null) {
-									String shortName = descriptor.getShortName();
-
-									Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
-									CustomCompletionProposal proposal = new CustomCompletionProposal("\"" + shortName + "\"", start, length, shortName.length() + 2, image, shortName, null, descriptor.getDescription(), IRelevanceConstants.R_NONE);
-									contentAssistRequest.addProposal(proposal);
-								}
-								else {
-									if (dir.startsWith("/WEB-INF/")) {
-										dir = dir.substring(9);
-									}
-									String prefix = StringUtils.replace(dir, "/", "-");
-
-									Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
-									CustomCompletionProposal proposal = new CustomCompletionProposal("\"" + prefix + "\"", start, length, prefix.length() + 2, image, prefix, null, null, IRelevanceConstants.R_NONE);
-									contentAssistRequest.addProposal(proposal);
-								}
-							}
-						}
-					}
-				}
-			}
-		}
+		fComputer.addAttributeValueProposals(contentAssistRequest, null);
 	}
-
-	/**
-	 * Returns project request is in
-	 * 
-	 * @param request
-	 * @return
-	 */
-	private IPath getBasePath(ContentAssistRequest request) {
-		IPath baselocation = null;
-
-		if (request != null) {
-			IStructuredDocumentRegion region = request.getDocumentRegion();
-			if (region != null) {
-				IDocument document = region.getParentDocument();
-				IStructuredModel model = null;
-				try {
-					model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
-					if (model != null) {
-						String location = model.getBaseLocation();
-						if (location != null) {
-							baselocation = new Path(location);
-						}
-					}
-				}
-				finally {
-					if (model != null)
-						model.releaseFromRead();
-				}
-			}
-		}
-		return baselocation;
-	}
-
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTemplateCompletionProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTemplateCompletionProcessor.java
index 753a206..8ab20eb 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, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -136,8 +136,7 @@
 	}
 
 	protected Image getImage(Template template) {
-		// just return the same image for now
-		return JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP);
+		return JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_TEMPLATE);
 	}
 
 	private ContextTypeRegistry getTemplateContextRegistry() {
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTemplatesCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTemplatesCompletionProposalComputer.java
new file mode 100644
index 0000000..beb0589
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTemplatesCompletionProposalComputer.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeIdsJSP;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
+
+/**
+ * <p>Computes JSP template completion proposals</p>
+ */
+public class JSPTemplatesCompletionProposalComputer extends
+		DefaultXMLCompletionProposalComputer {
+
+	/** Template completion processor used to create template proposals */
+	private JSPTemplateCompletionProcessor fTemplateProcessor = null;
+	
+	/**
+	 * Create the computer
+	 */
+	public JSPTemplatesCompletionProposalComputer() {
+		this.fTemplateProcessor = new JSPTemplateCompletionProcessor();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeCompletionProposals(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		//get the templates specific to the context
+		List proposals = new ArrayList(super.computeCompletionProposals(context, monitor));
+		
+		//get templates not specific to the context
+		proposals.addAll(this.getTemplateProposals(TemplateContextTypeIdsJSP.ALL, context));
+	
+		return proposals;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeNameProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.ATTRIBUTE, context);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeValueProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.ATTRIBUTE_VALUE, context);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addTagInsertionProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addTagInsertionProposals(
+			ContentAssistRequest contentAssistRequest, int childPosition,
+			CompletionProposalInvocationContext context) {
+		
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.TAG, context);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addEmptyDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addEmptyDocumentProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		if (ContentTypeIdForJSP.ContentTypeID_JSPTAG.equals(
+				((IDOMNode) contentAssistRequest.getNode()).getModel().getContentTypeIdentifier())) {
+			
+			addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.NEW_TAG, context);
+		} else {
+			addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.NEW, context);
+		}
+	}
+	
+	/**
+	 * <p>Get the template proposals from the template processor</p>
+	 * 
+	 * @param templateContext
+	 * @param context
+	 * @return
+	 */
+	private List getTemplateProposals(String templateContext,
+			CompletionProposalInvocationContext context) {
+		
+		List templateProposals = new ArrayList();
+		
+		if (fTemplateProcessor != null) {
+			fTemplateProcessor.setContextType(templateContext);
+			ICompletionProposal[] proposals =
+				fTemplateProcessor.computeCompletionProposals(context.getViewer(), context.getInvocationOffset());
+		
+			templateProposals.addAll(Arrays.asList(proposals));
+		}
+		
+		return templateProposals;
+	}
+	
+	/**
+	 * <p>Adds templates to the list of proposals</p>
+	 * 
+	 * @param contentAssistRequest
+	 * @param templateContext
+	 * @param context
+	 */
+	private void addTemplates(ContentAssistRequest contentAssistRequest, String templateContext,
+			CompletionProposalInvocationContext context) {
+		
+		if (contentAssistRequest != null) {
+			boolean useProposalList = !contentAssistRequest.shouldSeparate();
+			List proposals = this.getTemplateProposals(templateContext, context);
+	
+			for (int i = 0; i < proposals.size(); ++i) {
+				if (useProposalList) {
+					contentAssistRequest.addProposal((ICompletionProposal)proposals.get(i));
+				}
+				else {
+					contentAssistRequest.addMacro((ICompletionProposal)proposals.get(i));
+				}
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanCompletionProposalComputer.java
new file mode 100644
index 0000000..a603359
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanCompletionProposalComputer.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
+
+/**
+ * <p>Compute JSP use bean completion proposals</p>
+ */
+public class JSPUseBeanCompletionProposalComputer extends
+		DefaultXMLCompletionProposalComputer {
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeValueProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
+
+		//only add attribute value proposals for specific elements
+		if(node.getNodeName().equals(JSP11Namespace.ElementName.USEBEAN)) {
+			// Find the attribute name for which this position should have a value
+			IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
+			ITextRegionList openRegions = open.getRegions();
+			int i = openRegions.indexOf(contentAssistRequest.getRegion());
+			if (i < 0)
+				return;
+			ITextRegion nameRegion = null;
+			while (i >= 0) {
+				nameRegion = openRegions.get(i--);
+				if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
+					break;
+			}
+	
+			String attributeName = null;
+			if (nameRegion != null)
+				attributeName = open.getText(nameRegion);
+	
+			String currentValue = null;
+			if (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
+				currentValue = contentAssistRequest.getText();
+			else
+				currentValue = ""; //$NON-NLS-1$
+			String matchString = null;
+			// fixups
+			int start = contentAssistRequest.getReplacementBeginPosition();
+			int length = contentAssistRequest.getReplacementLength();
+			if (currentValue.length() > StringUtils.strip(currentValue).length() && (currentValue.startsWith("\"") || currentValue.startsWith("'")) //$NON-NLS-1$ //$NON-NLS-2$
+						&& contentAssistRequest.getMatchString().length() > 0) {
+				matchString = currentValue.substring(1, contentAssistRequest.getMatchString().length());
+				start++;
+				length = matchString.length();
+			} else
+				matchString = currentValue.substring(0, contentAssistRequest.getMatchString().length());
+			boolean existingComplicatedValue = contentAssistRequest.getRegion() != null && contentAssistRequest.getRegion() instanceof ITextRegionContainer;
+			if (existingComplicatedValue) {
+				contentAssistRequest.getProposals().clear();
+				contentAssistRequest.getMacros().clear();
+			} else {
+				if (attributeName.equals(JSP11Namespace.ATTR_NAME_CLASS)) {
+					// class is the concrete implementation class
+					IResource resource = JSPContentAssistHelper.getResource(contentAssistRequest);
+					ICompletionProposal[] classProposals = JavaTypeFinder.getClassProposals(resource, start, length);
+					if (classProposals != null) {
+						for (int j = 0; j < classProposals.length; j++) {
+							JavaTypeCompletionProposal proposal = (JavaTypeCompletionProposal) classProposals[j];
+							if (matchString.length() == 0 || proposal.getQualifiedName().toLowerCase().startsWith(matchString.toLowerCase()) || proposal.getShortName().toLowerCase().startsWith(matchString.toLowerCase()))
+								contentAssistRequest.addProposal(proposal);
+						}
+					}
+				} else if (attributeName.equals(JSP11Namespace.ATTR_NAME_TYPE)) {
+					// type is the more general type for the bean
+					// which means it may be an interface
+					IResource resource = JSPContentAssistHelper.getResource(contentAssistRequest);
+					ICompletionProposal[] typeProposals = JavaTypeFinder.getTypeProposals(resource, start, length);
+					if (typeProposals != null) {
+						for (int j = 0; j < typeProposals.length; j++) {
+							JavaTypeCompletionProposal proposal = (JavaTypeCompletionProposal) typeProposals[j];
+							if (matchString.length() == 0 || proposal.getQualifiedName().toLowerCase().startsWith(matchString.toLowerCase()) || proposal.getShortName().toLowerCase().startsWith(matchString.toLowerCase()))
+								contentAssistRequest.addProposal(proposal);
+						}
+					}
+				} else if (attributeName.equals(JSP11Namespace.ATTR_NAME_BEAN_NAME)) {
+					IResource resource = JSPContentAssistHelper.getResource(contentAssistRequest);
+					ICompletionProposal[] beanNameProposals = JavaTypeFinder.getBeanProposals(resource, start, length);
+					if (beanNameProposals != null) {
+						for (int j = 0; j < beanNameProposals.length; j++) {
+							if (beanNameProposals[j] instanceof CustomCompletionProposal) {
+								JavaTypeCompletionProposal proposal = (JavaTypeCompletionProposal) beanNameProposals[j];
+								if (matchString.length() == 0 || proposal.getDisplayString().toLowerCase().startsWith(matchString.toLowerCase()))
+									contentAssistRequest.addProposal(proposal);
+							} else if (beanNameProposals[j] instanceof JavaTypeCompletionProposal) {
+								JavaTypeCompletionProposal proposal = (JavaTypeCompletionProposal) beanNameProposals[j];
+								if (matchString.length() == 0 || proposal.getQualifiedName().toLowerCase().startsWith(matchString.toLowerCase()) || proposal.getShortName().toLowerCase().startsWith(matchString.toLowerCase()))
+									contentAssistRequest.addProposal(proposal);
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanContentAssistProcessor.java
index 120986d..3ab7f8f 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanContentAssistProcessor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanContentAssistProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,164 +10,22 @@
  *******************************************************************************/
 package org.eclipse.jst.jsp.ui.internal.contentassist;
 
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
 
 /**
- * @plannedfor 1.0
+ * @deprecated This class is no longer used locally and will be removed in the future
+ * @see JSPUseBeanCompletionProposalComputer
  */
 public class JSPUseBeanContentAssistProcessor extends JSPDummyContentAssistProcessor {
 
+	private JSPUseBeanCompletionProposalComputer fComputer;
+	
 	public JSPUseBeanContentAssistProcessor() {
 		super();
+		fComputer = new JSPUseBeanCompletionProposalComputer();
 	}
 
 	protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
-
-		IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
-
-		// Find the attribute name for which this position should have a value
-		IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
-		ITextRegionList openRegions = open.getRegions();
-		int i = openRegions.indexOf(contentAssistRequest.getRegion());
-		if (i < 0)
-			return;
-		ITextRegion nameRegion = null;
-		while (i >= 0) {
-			nameRegion = openRegions.get(i--);
-			if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
-				break;
-		}
-
-		String attributeName = null;
-		if (nameRegion != null)
-			attributeName = open.getText(nameRegion);
-
-		String currentValue = null;
-		if (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
-			currentValue = contentAssistRequest.getText();
-		else
-			currentValue = ""; //$NON-NLS-1$
-		String matchString = null;
-		// fixups
-		int start = contentAssistRequest.getReplacementBeginPosition();
-		int length = contentAssistRequest.getReplacementLength();
-		if (currentValue.length() > StringUtils.strip(currentValue).length() && (currentValue.startsWith("\"") || currentValue.startsWith("'")) //$NON-NLS-1$ //$NON-NLS-2$
-					&& contentAssistRequest.getMatchString().length() > 0) {
-			matchString = currentValue.substring(1, contentAssistRequest.getMatchString().length());
-			start++;
-			length = matchString.length();
-		} else
-			matchString = currentValue.substring(0, contentAssistRequest.getMatchString().length());
-		boolean existingComplicatedValue = contentAssistRequest.getRegion() != null && contentAssistRequest.getRegion() instanceof ITextRegionContainer;
-		if (existingComplicatedValue) {
-			contentAssistRequest.getProposals().clear();
-			contentAssistRequest.getMacros().clear();
-		} else {
-			if (attributeName.equals(JSP11Namespace.ATTR_NAME_CLASS)) {
-				// class is the concrete implementation class
-				IResource resource = getResource(contentAssistRequest);
-				ICompletionProposal[] classProposals = JavaTypeFinder.getClassProposals(resource, start, length);
-				if (classProposals != null) {
-					for (int j = 0; j < classProposals.length; j++) {
-						JavaTypeCompletionProposal proposal = (JavaTypeCompletionProposal) classProposals[j];
-						if (matchString.length() == 0 || proposal.getQualifiedName().toLowerCase().startsWith(matchString.toLowerCase()) || proposal.getShortName().toLowerCase().startsWith(matchString.toLowerCase()))
-							contentAssistRequest.addProposal(proposal);
-					}
-				}
-			} else if (attributeName.equals(JSP11Namespace.ATTR_NAME_TYPE)) {
-				// type is the more general type for the bean
-				// which means it may be an interface
-				IResource resource = getResource(contentAssistRequest);
-				ICompletionProposal[] typeProposals = JavaTypeFinder.getTypeProposals(resource, start, length);
-				if (typeProposals != null) {
-					for (int j = 0; j < typeProposals.length; j++) {
-						JavaTypeCompletionProposal proposal = (JavaTypeCompletionProposal) typeProposals[j];
-						if (matchString.length() == 0 || proposal.getQualifiedName().toLowerCase().startsWith(matchString.toLowerCase()) || proposal.getShortName().toLowerCase().startsWith(matchString.toLowerCase()))
-							contentAssistRequest.addProposal(proposal);
-					}
-				}
-			} else if (attributeName.equals(JSP11Namespace.ATTR_NAME_BEAN_NAME)) {
-				IResource resource = getResource(contentAssistRequest);
-				ICompletionProposal[] beanNameProposals = JavaTypeFinder.getBeanProposals(resource, start, length);
-				if (beanNameProposals != null) {
-					for (int j = 0; j < beanNameProposals.length; j++) {
-						if (beanNameProposals[j] instanceof CustomCompletionProposal) {
-							JavaTypeCompletionProposal proposal = (JavaTypeCompletionProposal) beanNameProposals[j];
-							if (matchString.length() == 0 || proposal.getDisplayString().toLowerCase().startsWith(matchString.toLowerCase()))
-								contentAssistRequest.addProposal(proposal);
-						} else if (beanNameProposals[j] instanceof JavaTypeCompletionProposal) {
-							JavaTypeCompletionProposal proposal = (JavaTypeCompletionProposal) beanNameProposals[j];
-							if (matchString.length() == 0 || proposal.getQualifiedName().toLowerCase().startsWith(matchString.toLowerCase()) || proposal.getShortName().toLowerCase().startsWith(matchString.toLowerCase()))
-								contentAssistRequest.addProposal(proposal);
-						}
-					}
-				}
-			}
-		}
+		fComputer.addAttributeValueProposals(contentAssistRequest, null);
 	}
-
-	/**
-	 * Returns project request is in
-	 * 
-	 * @param request
-	 * @return
-	 */
-	private IResource getResource(ContentAssistRequest request) {
-		IResource resource = null;
-		String baselocation = null;
-
-		if (request != null) {
-			IStructuredDocumentRegion region = request.getDocumentRegion();
-			if (region != null) {
-				IDocument document = region.getParentDocument();
-				IStructuredModel model = null;
-				try {
-					model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
-					if (model != null) {
-						baselocation = model.getBaseLocation();
-					}
-				} finally {
-					if (model != null)
-						model.releaseFromRead();
-				}
-			}
-		}
-
-		if (baselocation != null) {
-			// copied from JSPTranslationAdapter#getJavaProject
-			IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
-			IPath filePath = new Path(baselocation);
-			IFile file = null;
-
-			if (filePath.segmentCount() > 1) {
-				file = root.getFile(filePath);
-			}
-			if (file != null) {
-				resource = file.getProject();
-			}
-		}
-		return resource;
-	}
-
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/LibraryTagsCompletionProposalComputer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/LibraryTagsCompletionProposalComputer.java
new file mode 100644
index 0000000..92cd295
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/LibraryTagsCompletionProposalComputer.java
@@ -0,0 +1,516 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jst.jsp.core.internal.contentmodel.JSPCMDocumentFactory;
+import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
+import org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP12Namespace;
+import org.eclipse.jst.jsp.core.internal.provisional.JSP20Namespace;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
+import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImages;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.html.core.internal.contentmodel.HTMLPropertyDeclaration;
+import org.eclipse.wst.html.core.internal.contentmodel.JSPCMDocument;
+import org.eclipse.wst.html.ui.internal.contentassist.HTMLTagsCompletionProposalComputer;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
+import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
+import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
+import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMNodeWrapper;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
+import org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
+import org.eclipse.wst.xml.ui.internal.editor.CMImageUtil;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * <p>Computes tags provided by tag libraries completion proposals.</p>
+ * 
+ * <p>Extends the {@link HTMLTagsCompletionProposalComputer} to benefit from
+ * its work for determining the correct {@link XMLContentModelGenerator} to use</p>
+ */
+public class LibraryTagsCompletionProposalComputer extends
+	HTMLTagsCompletionProposalComputer {
+	
+	private int fDepthCount;
+
+	/**
+	 * @see org.eclipse.wst.html.ui.internal.contentassist.HTMLTagsCompletionProposalComputer#computeContextInformation(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeContextInformation(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		return Collections.EMPTY_LIST;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.html.ui.internal.contentassist.HTMLTagsCompletionProposalComputer#validModelQueryNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode)
+	 */
+	protected boolean validModelQueryNode(CMNode node) {
+		boolean isValid = false;
+		
+		//unwrap
+		if(node instanceof CMNodeWrapper) {
+			node = ((CMNodeWrapper)node).getOriginNode();
+		}
+		
+		//determine if is valid
+		if(node instanceof HTMLPropertyDeclaration) {
+			HTMLPropertyDeclaration propDec = (HTMLPropertyDeclaration)node;
+			isValid = propDec.isJSP();
+		} else if(node.supports(TLDElementDeclaration.IS_LIBRARY_TAG)){
+			Boolean isLibraryTag = (Boolean)node.getProperty(TLDElementDeclaration.IS_LIBRARY_TAG);
+			isValid = isLibraryTag != null && isLibraryTag.booleanValue();
+		}
+		
+		return isValid;
+	}
+	
+	/**
+	 * <p>JSP has none.  This overrides the default behavior to add in doctype proposals which
+	 * should really be contributed by the HTML tag computer</p>
+	 * 
+	 * @see org.eclipse.wst.html.ui.internal.contentassist.HTMLTagsCompletionProposalComputer#addStartDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addStartDocumentProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		//jsp has none
+	}
+	
+	/**
+	 * @see org.eclipse.wst.html.ui.internal.contentassist.HTMLTagsCompletionProposalComputer#addEmptyDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addEmptyDocumentProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		//jsp has none
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#addTagCloseProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addTagCloseProposals(ContentAssistRequest contentAssistRequest, CompletionProposalInvocationContext context) {
+		//do nothing, html computer will take care of adding the > and /> suggestions
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeValueProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+
+		if(!this.isXHTML) {
+			IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
+	
+			ModelQuery mq = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
+			if (mq != null) {
+				CMDocument doc = mq.getCorrespondingCMDocument(node);
+				// this shouldn't have to have the prefix coded in
+				if (doc instanceof JSPCMDocument || doc instanceof CMNodeWrapper ||
+						node.getNodeName().startsWith("jsp:")) { //$NON-NLS-1$
+					return;
+				}
+			}
+	
+			// Find the attribute name for which this position should have a value
+			IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
+			ITextRegionList openRegions = open.getRegions();
+			int i = openRegions.indexOf(contentAssistRequest.getRegion());
+			if (i < 0) {
+				return;
+			}
+			ITextRegion nameRegion = null;
+			while (i >= 0) {
+				nameRegion = openRegions.get(i--);
+				if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
+					break;
+				}
+			}
+			
+			// on an empty value, add all the JSP and taglib tags
+			CMElementDeclaration elementDecl =
+				AbstractXMLModelQueryCompletionProposalComputer.getCMElementDeclaration(node);
+			if (nameRegion != null && elementDecl != null) {
+				String attributeName = open.getText(nameRegion);
+				if (attributeName != null) {
+					Node parent = contentAssistRequest.getParent();
+					
+					//ignore start quote in match string
+					String matchString = contentAssistRequest.getMatchString().trim();
+					if(matchString.startsWith("'") || matchString.startsWith("\"")) { //$NON-NLS-1$ //$NON-NLS-2$
+						matchString = matchString.substring(1);
+					}
+					
+					//get all the proposals
+					List additionalElements = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent(
+							(Element) node, elementDecl, ModelQuery.INCLUDE_ALL);
+					Iterator nodeIterator = additionalElements.iterator();
+					
+					//check each suggestion
+					while (nodeIterator.hasNext()) {
+						CMNode additionalElementDecl = (CMNode) nodeIterator.next();
+						if (additionalElementDecl != null && additionalElementDecl instanceof CMElementDeclaration &&
+								validModelQueryNode(additionalElementDecl)) {
+							CMElementDeclaration ed = (CMElementDeclaration) additionalElementDecl;
+							// https://bugs.eclipse.org/bugs/show_bug.cgi?id=89811
+							StringBuffer sb = new StringBuffer();
+							getContentGenerator().generateTag(parent, ed, sb);
+	
+							String proposedText = sb.toString();
+	
+							//filter out any proposals that dont match matchString
+							if (beginsWith(proposedText, matchString)) {
+								//wrap with ' because JSP attributes are warped with "
+								proposedText = "'" + proposedText; //$NON-NLS-1$
+								
+								//if its a container its possible the closing quote is already there
+								//don't want to risk injecting an extra
+								if(!(contentAssistRequest.getRegion() instanceof ITextRegionContainer)) {
+									proposedText += "'"; //$NON-NLS-1$
+								}
+								
+								//get the image
+								Image image = CMImageUtil.getImage(elementDecl);
+								if (image == null) {
+									image = this.getGenericTagImage();
+								}
+								
+								//create the proposal
+								int cursorAdjustment = getCursorPositionForProposedText(proposedText);
+								String proposedInfo = AbstractXMLModelQueryCompletionProposalComputer.getAdditionalInfo(
+										AbstractXMLModelQueryCompletionProposalComputer.getCMElementDeclaration(parent), elementDecl);
+								String tagname = getContentGenerator().getRequiredName(node, ed);
+								CustomCompletionProposal proposal = new CustomCompletionProposal(
+										proposedText, contentAssistRequest.getReplacementBeginPosition(),
+										contentAssistRequest.getReplacementLength(), cursorAdjustment, image, tagname, null, proposedInfo,
+										XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
+								contentAssistRequest.addProposal(proposal);
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#setErrorMessage(java.lang.String)
+	 */
+	public void setErrorMessage(String errorMessage) {
+		if (fDepthCount == 0) {
+			super.setErrorMessage(errorMessage);
+		}
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#getGenericTagImage()
+	 */
+	protected Image getGenericTagImage() {
+		return JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#getDeemphasizedTagImage()
+	 */
+	protected Image getDeemphasizedTagImage() {
+		return JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#getEmphasizedTagImage()
+	 */
+	protected Image getEmphasizedTagImage() {
+		return JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP);
+	}
+	
+	//----------------------BELOW HERE SHOULD BE REMOVED ONCE BUG 211961 IS FIXED ---------------------
+	
+	/**
+	 * <p><b>NOTE: </b>This should be removed as soon as Bug 311961 is fixed</p>
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#addTagInsertionProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addTagInsertionProposals(
+			ContentAssistRequest contentAssistRequest, int childPosition,
+			CompletionProposalInvocationContext context) {
+		
+		//get the default proposals
+		super.addTagInsertionProposals(contentAssistRequest, childPosition, context);
+		
+		/**
+		 * TODO: REMOVE THIS HACK - Bug 311961
+		 */
+		if(contentAssistRequest.getParent().getNodeType() == Node.DOCUMENT_NODE) {
+			this.forciblyAddTagLibAndJSPPropsoals((Document)contentAssistRequest.getParent(),
+					contentAssistRequest, childPosition);
+		}
+	}
+	
+	/**
+	 * <p><b>NOTE: </b>This should be removed as soon as Bug 311961 is fixed</p>
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#addTagNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addTagNameProposals(
+			ContentAssistRequest contentAssistRequest, int childPosition,
+			CompletionProposalInvocationContext context) {
+		
+		//get the default proposals
+		super.addTagNameProposals(contentAssistRequest, childPosition, context);
+		
+		/**
+		 * TODO: REMOVE THIS HACK - Bug 311961
+		 */
+		if(contentAssistRequest.getParent().getNodeType() == Node.DOCUMENT_NODE) {
+			this.forciblyAddTagLibAndJSPPropsoals((Document)contentAssistRequest.getParent(),
+					contentAssistRequest, childPosition);
+		}
+	}
+	
+	/**
+	 * <p><b>NOTE: </b>This should be removed as soon as Bug 311961 is fixed</p>
+	 * <p>This is bad because it does not use the ModelQuery framework</p>
+	 * 
+	 * @param document
+	 * @param contentAssistRequest
+	 * @param childPosition
+	 */
+	private void forciblyAddTagLibAndJSPPropsoals(Document document, ContentAssistRequest contentAssistRequest, int childPosition) {
+		if (!isXMLFormat(document)) {
+			List additionalElements = forciblyGetTagLibAndJSPElements(new ArrayList(), document, childPosition);
+			
+			//convert CMElementDeclartions to proposals
+			for (int i = 0; i < additionalElements.size(); i++) {
+				CMElementDeclaration ed = (CMElementDeclaration) additionalElements.get(i);
+				if (ed != null) {
+					Image image = CMImageUtil.getImage(ed);
+					if (image == null) {
+						image = this.getGenericTagImage();
+					}
+					String proposedText = getRequiredText(document, ed);
+					String tagname = getRequiredName(document, ed);
+					// account for the &lt; and &gt;
+					int markupAdjustment = getContentGenerator().getMinimalStartTagLength(document, ed);
+					String proposedInfo = getAdditionalInfo(null, ed);
+					CustomCompletionProposal proposal = new CustomCompletionProposal(
+							proposedText, contentAssistRequest.getReplacementBeginPosition(),
+							contentAssistRequest.getReplacementLength(), markupAdjustment, image,
+							tagname, null, proposedInfo, XMLRelevanceConstants.R_TAG_INSERTION);
+					contentAssistRequest.addProposal(proposal);
+				}
+			}
+		}
+	}
+	
+	/**
+	 * <p><b>NOTE: </b>This should be removed as soon as Bug 311961 is fixed</p>
+	 * <p>This is bad because it does not use the ModelQuery framework, it
+	 * access the TLDCMDocumentManager directly</p>
+	 * <p>This is essentially a combination of the {@link TaglibModelQueryExtension} and
+	 * the {@link JSPModelQueryExtension} but it means any other extensions get left
+	 * out when creating content assist suggestion at the document root level</p>
+	 * 
+	 * @param elementDecls
+	 * @param node
+	 * @param childIndex
+	 * @return
+	 */
+	private List forciblyGetTagLibAndJSPElements(List elementDecls, Node node, int childIndex) {
+		if (node instanceof IDOMNode) {
+			/*
+			 * find the location of the intended insertion as it will give us
+			 * the correct offset for checking position dependent CMDocuments
+			 */
+			int textInsertionOffset = 0;
+			NodeList children = node.getChildNodes();
+			if (children.getLength() >= childIndex && childIndex >= 0) {
+				Node nodeAlreadyAtIndex = children.item(childIndex);
+				if (nodeAlreadyAtIndex instanceof IDOMNode)
+					textInsertionOffset = ((IDOMNode) nodeAlreadyAtIndex).getEndOffset();
+			}
+			else {
+				textInsertionOffset = ((IDOMNode) node).getStartOffset();
+			}
+			TLDCMDocumentManager mgr = TaglibController.getTLDCMDocumentManager(((IDOMNode) node).getStructuredDocument());
+			if (mgr != null) {
+				List moreCMDocuments = mgr.getCMDocumentTrackers(textInsertionOffset);
+				if (moreCMDocuments != null) {
+					for (int i = 0; i < moreCMDocuments.size(); i++) {
+						CMDocument doc = (CMDocument) moreCMDocuments.get(i);
+						CMNamedNodeMap elements = doc.getElements();
+						if (elements != null) {
+							for (int j = 0; j < elements.getLength(); j++) {
+								CMElementDeclaration ed = (CMElementDeclaration) elements.item(j);
+								elementDecls.add(ed);
+							}
+						}
+					}
+				}
+			}
+
+			// get position dependent CMDocuments and insert their tags as
+			// proposals
+
+			ModelQueryAdapter mqAdapter = null;
+			if (node.getNodeType() == Node.DOCUMENT_NODE)
+				mqAdapter = (ModelQueryAdapter) ((IDOMNode) node).getAdapterFor(ModelQueryAdapter.class);
+			else
+				mqAdapter = (ModelQueryAdapter) ((IDOMNode) node.getOwnerDocument()).getAdapterFor(ModelQueryAdapter.class);
+
+			if (mqAdapter != null) {
+				CMDocument doc = mqAdapter.getModelQuery().getCorrespondingCMDocument(node);
+				if (doc != null) {
+					CMDocument jcmdoc = getDefaultJSPCMDocument((IDOMNode) node);
+					CMNamedNodeMap jspelements = jcmdoc.getElements();
+
+					/*
+					 * For a built-in JSP action the content model is properly
+					 * set up, so don't just blindly add the rest--unless this
+					 * will be a direct child of the document
+					 */
+					if (jspelements != null && (!(doc instanceof JSPCMDocument) || node.getNodeType() == Node.DOCUMENT_NODE)) {
+						List rejectElements = new ArrayList();
+
+						// determine if the document is in XML form
+						Document domDoc = null;
+						if (node.getNodeType() == Node.DOCUMENT_NODE)
+							domDoc = (Document) node;
+						else
+							domDoc = node.getOwnerDocument();
+
+						// Show XML tag forms of JSP markers if jsp:root is
+						// the document element OR it's HTML but
+						// isn't really in the text.
+						// If the document isn't strictly XML, pull out the
+						// XML tag forms it is xml format
+						rejectElements.add(JSP12Namespace.ElementName.SCRIPTLET);
+						rejectElements.add(JSP12Namespace.ElementName.EXPRESSION);
+						rejectElements.add(JSP12Namespace.ElementName.DECLARATION);
+						rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_INCLUDE);
+						rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_PAGE);
+						rejectElements.add(JSP12Namespace.ElementName.TEXT);
+						rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_TAGLIB);
+						rejectElements.add(JSP20Namespace.ElementName.DIRECTIVE_TAG);
+						rejectElements.add(JSP20Namespace.ElementName.DIRECTIVE_ATTRIBUTE);
+						rejectElements.add(JSP20Namespace.ElementName.DIRECTIVE_VARIABLE);
+						if (isXMLFormat(domDoc)) {
+							// jsp actions
+							rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
+							rejectElements.add(JSP12Namespace.ElementName.USEBEAN);
+							rejectElements.add(JSP12Namespace.ElementName.GETPROPERTY);
+							rejectElements.add(JSP12Namespace.ElementName.SETPROPERTY);
+							rejectElements.add(JSP12Namespace.ElementName.INCLUDE);
+							rejectElements.add(JSP12Namespace.ElementName.FORWARD);
+							rejectElements.add(JSP12Namespace.ElementName.PLUGIN);
+							rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
+							rejectElements.add(JSP12Namespace.ElementName.PARAM);
+							rejectElements.add(JSP12Namespace.ElementName.PARAMS);
+						}
+
+
+						// don't show jsp:root if a document element already
+						// exists
+						Element docElement = domDoc.getDocumentElement();
+						if (docElement != null && ((docElement.getNodeName().equals("jsp:root")) || ((((IDOMNode) docElement).getStartStructuredDocumentRegion() != null || ((IDOMNode) docElement).getEndStructuredDocumentRegion() != null)))) //$NON-NLS-1$
+							rejectElements.add(JSP12Namespace.ElementName.ROOT);
+
+						for (int j = 0; j < jspelements.getLength(); j++) {
+							CMElementDeclaration ed = (CMElementDeclaration) jspelements.item(j);
+							if (rejectElements.contains(ed.getNodeName()))
+								continue;
+							elementDecls.add(ed);
+						}
+
+					}
+				}
+				// No cm document (such as for the Document (a non-Element) node itself)
+				else {
+					CMNamedNodeMap jspElements = getDefaultJSPCMDocument((IDOMNode) node).getElements();
+					int length = jspElements.getLength();
+					for (int i = 0; i < length; i++) {
+						elementDecls.add(jspElements.item(i));
+					}
+				}
+			}
+		}
+		return elementDecls;
+	}
+	
+	/**
+	 * <p><b>NOTE: </b>This should be removed as soon as Bug 311961 is fixed</p>
+	 * 
+	 * For JSP files and segments, this is just the JSP document, but when
+	 * editing tag files and their fragments, it should be the tag document.
+	 * 
+	 * It may also vary based on the model being edited in the future.
+	 * 
+	 * @return the default non-embedded CMDocument for the document being
+	 *         edited.
+	 */
+	private CMDocument getDefaultJSPCMDocument(IDOMNode node) {
+		// handle tag files here
+		String contentType = node.getModel().getContentTypeIdentifier();
+		if (ContentTypeIdForJSP.ContentTypeID_JSPTAG.equals(contentType))
+			return JSPCMDocumentFactory.getCMDocument(CMDocType.TAG20_DOC_TYPE);
+
+		CMDocument jcmdoc = null;
+		String modelPath = node.getModel().getBaseLocation();
+		if (modelPath != null && !IModelManager.UNMANAGED_MODEL.equals(modelPath)) {
+			float version = DeploymentDescriptorPropertyCache.getInstance().getJSPVersion(new Path(modelPath));
+			jcmdoc = JSPCMDocumentFactory.getCMDocument(version);
+		}
+		if (jcmdoc == null) {
+			jcmdoc = JSPCMDocumentFactory.getCMDocument();
+		}
+
+		return jcmdoc;
+	}
+	
+	private boolean isXMLFormat(Document doc) {
+		if (doc == null)
+			return false;
+		Element docElement = doc.getDocumentElement();
+		return docElement != null && ((docElement.getNodeName().equals("jsp:root")) ||
+				((((IDOMNode) docElement).getStartStructuredDocumentRegion() == null &&
+						((IDOMNode) docElement).getEndStructuredDocumentRegion() == null))); //$NON-NLS-1$
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/ReplaceNameTemplateContext.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/ReplaceNameTemplateContext.java
index 1f4e9d1..0e06e6a 100644
--- 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@
 import org.eclipse.jface.text.templates.TemplateBuffer;
 import org.eclipse.jface.text.templates.TemplateContextType;
 import org.eclipse.jface.text.templates.TemplateException;
+import org.eclipse.jface.text.templates.TemplateVariable;
 
 /**
  * Just like DocumentTemplateContext except if an insert offset is passed in,
@@ -95,7 +96,15 @@
 				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());
+					int prefixSize = prefix.length();
+					TemplateVariable[] newTemplateVar = buffer.getVariables();
+					for (int i =0; i < newTemplateVar.length; i++ ){
+						int[] offsets = newTemplateVar[i].getOffsets();
+						for (int j=0; j<offsets.length ;j++){
+							offsets[j] += prefixSize;
+						}
+					}
+					buffer = new TemplateBuffer(prefix + buffer.getString(), newTemplateVar);
 				}
 			}
 		}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/JSPFContentSettingsPropertyPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/JSPFContentSettingsPropertyPage.java
index bb61592..3ae0798 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/JSPFContentSettingsPropertyPage.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/JSPFContentSettingsPropertyPage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -20,16 +20,11 @@
 import org.eclipse.jst.jsp.ui.internal.Logger;
 import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.dialogs.PropertyPage;
@@ -49,18 +44,9 @@
 				"text/xml",  //$NON-NLS-1$
 				"text/css"}; //$NON-NLS-1$
 
-	private class ButtonListener extends SelectionAdapter {
-		public void widgetSelected(SelectionEvent e) {
-			boolean specific = fSpecificSetting.getSelection();
-			updateButtons(specific);
-		}
-	}
 
 	private Combo fLanguageCombo;
 	private Combo fContentTypeCombo;
-	private Button fValidateFragments;
-	Button fSpecificSetting;
-	private SelectionListener fSpecificListener;
 
 	public JSPFContentSettingsPropertyPage() {
 		super();
@@ -104,32 +90,6 @@
 		fContentTypeCombo.setLayoutData(data);
 		fContentTypeCombo.setItems(fContentTypes);
 
-		// create separator
-		Label label = new Label(propertyPage, SWT.SEPARATOR | SWT.HORIZONTAL);
-		data = new GridData();
-		data.horizontalAlignment = GridData.FILL;
-		data.horizontalSpan = 2;
-		data.verticalSpan = 8;
-		label.setLayoutData(data);
-
-		// specific setting
-		fSpecificSetting = new Button(propertyPage, SWT.CHECK | SWT.LEFT);
-		fSpecificSetting.setText(JSPUIMessages.JSPFContentSettingsPropertyPage_4);
-		data = new GridData(GridData.FILL, GridData.FILL, true, false);
-		data.horizontalSpan = 2;
-		fSpecificSetting.setLayoutData(data);
-
-		fSpecificListener = new ButtonListener();
-		fSpecificSetting.addSelectionListener(fSpecificListener);
-
-		// validate file
-		fValidateFragments = new Button(propertyPage, SWT.CHECK | SWT.LEFT);
-		fValidateFragments.setText(JSPUIMessages.JSPFilesPreferencePage_1);
-		data = new GridData(GridData.FILL, GridData.FILL, true, false);
-		data.horizontalSpan = 2;
-		data.horizontalIndent = 5;
-		fValidateFragments.setLayoutData(data);
-
 		initializeValues();
 
 		PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.JSP_FRAGMENT_HELPID);
@@ -137,11 +97,6 @@
 		return propertyPage;
 	}
 
-	void updateButtons(boolean enabled) {
-		fSpecificSetting.setSelection(enabled);
-		fValidateFragments.setEnabled(enabled);
-	}
-
 	/**
 	 * Get the resource this properties page is for
 	 * 
@@ -192,17 +147,6 @@
 			fContentTypeCombo.select(index);
 		else
 			fContentTypeCombo.setText(contentType);
-
-		String validate = JSPFContentProperties.getProperty(JSPFContentProperties.VALIDATE_FRAGMENTS, getResource(), false);
-		String validate2 = JSPFContentProperties.getProperty(JSPFContentProperties.VALIDATE_FRAGMENTS, getResource(), true);
-		if (validate == null || validate.length() == 0) {
-			updateButtons(false);
-			fValidateFragments.setSelection(Boolean.valueOf(validate2).booleanValue());
-		}
-		else {
-			updateButtons(true);
-			fValidateFragments.setSelection(Boolean.valueOf(validate).booleanValue());
-		}
 	}
 
 	protected void performDefaults() {
@@ -214,9 +158,6 @@
 		if (index > -1)
 			fContentTypeCombo.select(index);
 
-		updateButtons(false);
-		fValidateFragments.setSelection(true);
-
 		super.performDefaults();
 	}
 
@@ -237,12 +178,6 @@
 				contentType = null;
 			}
 			JSPFContentProperties.setProperty(JSPFContentProperties.JSPCONTENTTYPE, getResource(), contentType);
-
-			String validate = null;
-			if (fSpecificSetting.getSelection()) {
-				validate = Boolean.toString(fValidateFragments.getSelection());
-			}
-			JSPFContentProperties.setProperty(JSPFContentProperties.VALIDATE_FRAGMENTS, getResource(), validate);
 		}
 		catch (CoreException e) {
 			// maybe in future, let user know there was a problem saving file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/TagContentSettingsPropertyPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/TagContentSettingsPropertyPage.java
new file mode 100644
index 0000000..b637ba2
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/TagContentSettingsPropertyPage.java
@@ -0,0 +1,68 @@
+package org.eclipse.jst.jsp.ui.internal.contentproperties.ui;

+

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

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

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

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

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

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

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

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

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

+import org.eclipse.swt.SWT;

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

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

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

+import org.eclipse.ui.IWorkbenchPropertyPage;

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

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

+

+public class TagContentSettingsPropertyPage extends PropertyPage implements IWorkbenchPropertyPage {

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

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

+	private ComboFieldEditor fComboFieldEditor;

+

+	public TagContentSettingsPropertyPage() {

+		super();

+		noDefaultAndApplyButton();

+		setDescription(JSPUIMessages.TagPropertyPage_desc);

+	}

+

+	protected Control createContents(Composite parent) {

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

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

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

+

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

+		if (adapter == null) {

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

+		}

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

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

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

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

+

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

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

+			fComboFieldEditor.fillIntoGrid(composite, 2);

+			fComboFieldEditor.setPreferenceStore(store);

+			fComboFieldEditor.load();

+

+			// let the page save for us if needed

+			setPreferenceStore(store);

+		}

+		return composite;

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

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

+	 */

+	public boolean performOk() {

+		if (fComboFieldEditor != null) {

+			fComboFieldEditor.store();

+		}

+		return super.performOk();

+	}

+}

diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPSourceEditingTextTools.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPSourceEditingTextTools.java
index ec15d5c..db26843 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPSourceEditingTextTools.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPSourceEditingTextTools.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -47,10 +47,9 @@
 				NodeList pageDirectives = doc.getElementsByTagName(JSP12Namespace.ElementName.DIRECTIVE_PAGE);
 				for (int i = 0; i < pageDirectives.getLength(); i++) {
 					Element pageDirective = (Element) pageDirectives.item(i);
-					String langValue = pageDirective.getAttribute(JSP11Namespace.ATTR_NAME_LANGUAGE);
 					// last one to declare a language wins
-					if (langValue != null)
-						language = langValue;
+					if (pageDirective.hasAttribute(JSP11Namespace.ATTR_NAME_LANGUAGE))
+						language = pageDirective.getAttribute(JSP11Namespace.ATTR_NAME_LANGUAGE);
 				}
 			}
 		}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/handlers/JSPFindOccurrencesHandler.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/handlers/JSPFindOccurrencesHandler.java
index c3467da..207266c 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/handlers/JSPFindOccurrencesHandler.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/handlers/JSPFindOccurrencesHandler.java
@@ -13,6 +13,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import org.eclipse.jst.jsp.ui.internal.java.search.JSPFindOccurrencesProcessor;
 import org.eclipse.wst.html.ui.internal.search.HTMLFindOccurrencesProcessor;
 import org.eclipse.wst.sse.ui.internal.handlers.FindOccurrencesHandler;
 
@@ -24,11 +25,8 @@
 			fProcessors = new ArrayList();
 			HTMLFindOccurrencesProcessor htmlProcessor = new HTMLFindOccurrencesProcessor();
 			fProcessors.add(htmlProcessor);
-//			 temporary, workaround to disable function, since using the function 
-//			 can easily cause deadlock to occur.
-//					 See https://bugs.eclipse.org/bugs/show_bug.cgi?id=103662
-//			JSPFindOccurrencesProcessor jspProcessor = new JSPFindOccurrencesProcessor();
-//			fProcessors.add(jspProcessor);
+			JSPFindOccurrencesProcessor jspProcessor = new JSPFindOccurrencesProcessor();
+			fProcessors.add(jspProcessor);
 		}
 		return fProcessors;
 	}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileHyperlink.java
index f25d937..8784305 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileHyperlink.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileHyperlink.java
@@ -4,7 +4,9 @@
 
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
 import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.ui.IEditorDescriptor;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IWorkbenchPage;
@@ -38,7 +40,11 @@
 	}
 
 	public String getHyperlinkText() {
-		return null;
+		String path = fHyperlinkFile.getPath();
+		if (path.length() > 60) {
+			path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
+		}
+		return NLS.bind(JSPUIMessages.Open, path);
 	}
 
 	public void open() {
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlink.java
index 539f959..aaeaeae 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlink.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlink.java
@@ -1,10 +1,13 @@
 package org.eclipse.jst.jsp.ui.internal.hyperlink;
 
 import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.ui.JavaElementLabels;
 import org.eclipse.jdt.ui.JavaUI;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
 import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.ui.IEditorPart;
 
 /**
@@ -34,7 +37,6 @@
 	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
 	 */
 	public String getTypeLabel() {
-		// TODO Auto-generated method stub
 		return null;
 	}
 
@@ -44,8 +46,7 @@
 	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
 	 */
 	public String getHyperlinkText() {
-		// TODO Auto-generated method stub
-		return null;
+		return NLS.bind(JSPUIMessages.Open, JavaElementLabels.getElementLabel(fElement, JavaElementLabels.ALL_POST_QUALIFIED));
 	}
 
 	/*
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TLDFileHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TLDFileHyperlink.java
index 30b3c8e..012b0f5 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TLDFileHyperlink.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TLDFileHyperlink.java
@@ -18,8 +18,10 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
 import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
 import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PartInitException;
@@ -58,11 +60,11 @@
 	}
 
 	public String getHyperlinkText() {
-		return fSearchName;
+		return NLS.bind(JSPUIMessages.Open, fResource.getFullPath().toString());
 	}
 
 	public String getTypeLabel() {
-		return "TLDFileHyperlink label";
+		return null;
 	}
 
 	public void open() {
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java
index a75a7b4..66d7b43 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java
@@ -41,6 +41,7 @@
 import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
 import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
 import org.eclipse.jst.jsp.core.text.IJSPPartitions;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
 import org.eclipse.jst.jsp.ui.internal.Logger;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
@@ -148,56 +149,21 @@
 					// check if jsp tag/directive first
 					ITypedRegion partition = TextUtilities.getPartition(doc, IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, region.getOffset(), false);
 					if (partition != null && partition.getType() == IJSPPartitions.JSP_DIRECTIVE) {
-						// check if jsp taglib directive
-						Node currentNode = getCurrentNode(doc, region.getOffset());
-						if (currentNode != null && currentNode.getNodeType() == Node.ELEMENT_NODE) {
-							if (JSP11Namespace.ElementName.DIRECTIVE_TAGLIB.equalsIgnoreCase(currentNode.getNodeName())) {
-								/**
-								 * The taglib directive itself
-								 */
-								// get the uri attribute
-								Attr taglibURINode = ((Element) currentNode).getAttributeNode(JSP11Namespace.ATTR_NAME_URI);
-								if (taglibURINode != null) {
-									ITaglibRecord reference = TaglibIndex.resolve(getBaseLocationForTaglib(doc), taglibURINode.getValue(), false);
-									// when using a tagdir
-									// (ITaglibRecord.TAGDIR),
-									// there's nothing to link to
-									if (reference != null) {
-										// handle taglibs
-										switch (reference.getRecordType()) {
-											case (ITaglibRecord.TLD) : {
-												ITLDRecord record = (ITLDRecord) reference;
-												String uriString = record.getPath().toString();
-												IRegion hyperlinkRegion = getHyperlinkRegion(taglibURINode, region);
-												if (hyperlinkRegion != null) {
-													hyperlink = createHyperlink(uriString, hyperlinkRegion, doc, null);
-												}
-											}
-												break;
-											case (ITaglibRecord.JAR) :
-											case (ITaglibRecord.URL) : {
-												IRegion hyperlinkRegion = getHyperlinkRegion(taglibURINode, region);
-												if (hyperlinkRegion != null) {
-													hyperlink = new TaglibJarUriHyperlink(hyperlinkRegion, reference);
-												}
-											}
-										}
-									}
-								}
-							}
-							else if (JSP12Namespace.ElementName.ROOT.equalsIgnoreCase(currentNode.getNodeName())) {
-								/**
-								 * The jsp:root element
-								 */
-								NamedNodeMap attrs = currentNode.getAttributes();
-								for (int i = 0; i < attrs.getLength(); i++) {
-									Attr attr = (Attr) attrs.item(i);
-									if (attr.getNodeName().startsWith(XMLNS)) {
-										String uri = StringUtils.strip(attr.getNodeValue());
-										if (uri.startsWith(URN_TLD)) {
-											uri = uri.substring(URN_TLD.length());
-										}
-										ITaglibRecord reference = TaglibIndex.resolve(getBaseLocationForTaglib(doc), uri, false);
+						IStructuredModel sModel = null;
+						try {
+							sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
+							// check if jsp taglib directive
+							Node currentNode = getCurrentNode(sModel, region.getOffset());
+							if (currentNode != null && currentNode.getNodeType() == Node.ELEMENT_NODE) {
+								String baseLocationForTaglib = getBaseLocationForTaglib(doc);
+								if (baseLocationForTaglib != null && JSP11Namespace.ElementName.DIRECTIVE_TAGLIB.equalsIgnoreCase(currentNode.getNodeName())) {
+									/**
+									 * The taglib directive itself
+									 */
+									// get the uri attribute
+									Attr taglibURINode = ((Element) currentNode).getAttributeNode(JSP11Namespace.ATTR_NAME_URI);
+									if (taglibURINode != null) {
+										ITaglibRecord reference = TaglibIndex.resolve(baseLocationForTaglib, taglibURINode.getValue(), false);
 										// when using a tagdir
 										// (ITaglibRecord.TAGDIR),
 										// there's nothing to link to
@@ -207,7 +173,7 @@
 												case (ITaglibRecord.TLD) : {
 													ITLDRecord record = (ITLDRecord) reference;
 													String uriString = record.getPath().toString();
-													IRegion hyperlinkRegion = getHyperlinkRegion(attr, region);
+													IRegion hyperlinkRegion = getHyperlinkRegion(taglibURINode, region);
 													if (hyperlinkRegion != null) {
 														hyperlink = createHyperlink(uriString, hyperlinkRegion, doc, null);
 													}
@@ -215,7 +181,7 @@
 													break;
 												case (ITaglibRecord.JAR) :
 												case (ITaglibRecord.URL) : {
-													IRegion hyperlinkRegion = getHyperlinkRegion(attr, region);
+													IRegion hyperlinkRegion = getHyperlinkRegion(taglibURINode, region);
 													if (hyperlinkRegion != null) {
 														hyperlink = new TaglibJarUriHyperlink(hyperlinkRegion, reference);
 													}
@@ -224,24 +190,64 @@
 										}
 									}
 								}
-							}
-							else {
-								/**
-								 * Hyperlink custom tag to its TLD or tag file
-								 */
-								TLDCMDocumentManager documentManager = TaglibController.getTLDCMDocumentManager(doc);
-								if (documentManager != null) {
-									List documentTrackers = documentManager.getCMDocumentTrackers(currentNode.getPrefix(), region.getOffset());
-									for (int i = 0; i < documentTrackers.size(); i++) {
-										TaglibTracker tracker = (TaglibTracker) documentTrackers.get(i);
-										CMElementDeclaration decl = (CMElementDeclaration) tracker.getElements().getNamedItem(currentNode.getNodeName());
-										if (decl != null) {
-											decl = (CMElementDeclaration) ((CMNodeWrapper) decl).getOriginNode();
-											if (decl instanceof CMElementDeclarationImpl) {
-												String base = ((CMElementDeclarationImpl) decl).getLocationString();
-												IRegion hyperlinkRegion = getHyperlinkRegion(currentNode, region);
-												if (hyperlinkRegion != null) {
-													hyperlink = createHyperlink(base, hyperlinkRegion, doc, currentNode);
+								else if (baseLocationForTaglib != null && JSP12Namespace.ElementName.ROOT.equalsIgnoreCase(currentNode.getNodeName())) {
+									/**
+									 * The jsp:root element
+									 */
+									NamedNodeMap attrs = currentNode.getAttributes();
+									for (int i = 0; i < attrs.getLength(); i++) {
+										Attr attr = (Attr) attrs.item(i);
+										if (attr.getNodeName().startsWith(XMLNS)) {
+											String uri = StringUtils.strip(attr.getNodeValue());
+											if (uri.startsWith(URN_TLD)) {
+												uri = uri.substring(URN_TLD.length());
+											}
+											ITaglibRecord reference = TaglibIndex.resolve(baseLocationForTaglib, uri, false);
+											// when using a tagdir
+											// (ITaglibRecord.TAGDIR),
+											// there's nothing to link to
+											if (reference != null) {
+												// handle taglibs
+												switch (reference.getRecordType()) {
+													case (ITaglibRecord.TLD) : {
+														ITLDRecord record = (ITLDRecord) reference;
+														String uriString = record.getPath().toString();
+														IRegion hyperlinkRegion = getHyperlinkRegion(attr, region);
+														if (hyperlinkRegion != null) {
+															hyperlink = createHyperlink(uriString, hyperlinkRegion, doc, null);
+														}
+													}
+														break;
+													case (ITaglibRecord.JAR) :
+													case (ITaglibRecord.URL) : {
+														IRegion hyperlinkRegion = getHyperlinkRegion(attr, region);
+														if (hyperlinkRegion != null) {
+															hyperlink = new TaglibJarUriHyperlink(hyperlinkRegion, reference);
+														}
+													}
+												}
+											}
+										}
+									}
+								}
+								else {
+									/**
+									 * Hyperlink custom tag to its TLD or tag file
+									 */
+									TLDCMDocumentManager documentManager = TaglibController.getTLDCMDocumentManager(doc);
+									if (documentManager != null) {
+										List documentTrackers = documentManager.getCMDocumentTrackers(currentNode.getPrefix(), region.getOffset());
+										for (int i = 0; i < documentTrackers.size(); i++) {
+											TaglibTracker tracker = (TaglibTracker) documentTrackers.get(i);
+											CMElementDeclaration decl = (CMElementDeclaration) tracker.getElements().getNamedItem(currentNode.getNodeName());
+											if (decl != null) {
+												decl = (CMElementDeclaration) ((CMNodeWrapper) decl).getOriginNode();
+												if (decl instanceof CMElementDeclarationImpl) {
+													String base = ((CMElementDeclarationImpl) decl).getLocationString();
+													IRegion hyperlinkRegion = getHyperlinkRegion(currentNode, region);
+													if (hyperlinkRegion != null) {
+														hyperlink = createHyperlink(base, hyperlinkRegion, doc, currentNode);
+													}
 												}
 											}
 										}
@@ -249,6 +255,10 @@
 								}
 							}
 						}
+						finally {
+							if (sModel != null)
+								sModel.releaseFromRead();
+						}							
 					}
 				}
 				catch (BadLocationException e) {
@@ -335,22 +345,7 @@
 		int hyperLinkEnd = hyperlinkRegion.getOffset() + hyperlinkRegion.getLength();
 		int detectionStart = detectionRegion.getOffset();
 		int detectionEnd = detectionRegion.getOffset() + detectionRegion.getLength();
-		return (hyperLinkStart <= detectionStart && detectionStart < hyperLinkEnd) || (hyperLinkStart <= detectionEnd && detectionEnd < hyperLinkEnd);// ||
-		// (startOffset2
-		// <=
-		// startOffset1
-		// &&
-		// startOffset1
-		// <=
-		// endOffset2)
-		// ||
-		// (startOffset2
-		// <=
-		// endOffset2
-		// &&
-		// endOffset2
-		// <=
-		// endOffset2);
+		return (hyperLinkStart <= detectionStart && detectionStart < hyperLinkEnd) || (hyperLinkStart <= detectionEnd && detectionEnd <= hyperLinkEnd);// ||
 	}
 
 	private IRegion getNameRegion(ITextRegionCollection containerRegion) {
@@ -387,7 +382,11 @@
 			else if (temp.startsWith(JAR_PROTOCOL)) {
 				// this is a URLFileHyperlink since this is a local address
 				try {
-					link = new URLFileRegionHyperlink(hyperlinkRegion, TAG, node.getLocalName(), new URL(uriString));
+					link = new URLFileRegionHyperlink(hyperlinkRegion, TAG, node.getLocalName(), new URL(uriString)) {
+						public String getHyperlinkText() {
+							return JSPUIMessages.CustomTagHyperlink_hyperlinkText;
+						}
+					};
 				}
 				catch (MalformedURLException e) {
 					Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
@@ -400,7 +399,11 @@
 					IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
 					if (file.getType() == IResource.FILE && file.isAccessible()) {
 						if (node != null) {
-							link = new TLDFileHyperlink(file, TAG, node.getLocalName(), hyperlinkRegion);
+							link = new TLDFileHyperlink(file, TAG, node.getLocalName(), hyperlinkRegion) {
+								public String getHyperlinkText() {
+									return JSPUIMessages.CustomTagHyperlink_hyperlinkText;
+								}
+							};
 						}
 						else {
 							link = new WorkspaceFileHyperlink(hyperlinkRegion, file);
@@ -419,27 +422,15 @@
 		return link;
 	}
 
-	/**
-	 * Returns the node the cursor is currently on in the document. null if no
-	 * node is selected
-	 * 
-	 * @param offset
-	 * @return Node either element, doctype, text, or null
-	 */
-	private Node getCurrentNode(IDocument document, int offset) {
+	private Node getCurrentNode(IStructuredModel model, int offset) {
 		// get the current node at the offset (returns either: element,
 		// doctype, text)
 		IndexedRegion inode = null;
-		IStructuredModel sModel = null;
-		try {
-			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
-			inode = sModel.getIndexedRegion(offset);
-			if (inode == null)
-				inode = sModel.getIndexedRegion(offset - 1);
-		}
-		finally {
-			if (sModel != null)
-				sModel.releaseFromRead();
+		if (model != null) {
+			inode = model.getIndexedRegion(offset);
+			if (inode == null) {
+				inode = model.getIndexedRegion(offset - 1);
+			}
 		}
 
 		if (inode instanceof Node) {
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarHyperlink.java
index 6762926..3652adc 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarHyperlink.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarHyperlink.java
@@ -13,6 +13,7 @@
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
 import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
 import org.eclipse.jst.jsp.ui.internal.Logger;
 import org.eclipse.ui.IEditorDescriptor;
@@ -83,7 +84,6 @@
 	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
 	 */
 	public String getTypeLabel() {
-		// TODO Auto-generated method stub
 		return null;
 	}
 
@@ -93,8 +93,7 @@
 	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
 	 */
 	public String getHyperlinkText() {
-		// TODO Auto-generated method stub
-		return null;
+		return JSPUIMessages.TLDHyperlink_hyperlinkText;
 	}
 
 	public void open() {
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarUriHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarUriHyperlink.java
index 1cf7086..ff4072e 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarUriHyperlink.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarUriHyperlink.java
@@ -5,6 +5,7 @@
 import org.eclipse.jst.jsp.core.taglib.IJarRecord;
 import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
 import org.eclipse.jst.jsp.core.taglib.IURLRecord;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
 
 /**
  * Hyperlink for taglib files in jars or specified by urls.
@@ -52,7 +53,6 @@
 	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
 	 */
 	public String getTypeLabel() {
-		// TODO Auto-generated method stub
 		return null;
 	}
 
@@ -62,8 +62,7 @@
 	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
 	 */
 	public String getHyperlinkText() {
-		// TODO Auto-generated method stub
-		return null;
+		return JSPUIMessages.TLDHyperlink_hyperlinkText;
 	}
 
 	public void open() {
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java
index c7e08be..df8d5a9 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java
@@ -12,8 +12,10 @@
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
 import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
 import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.ui.IEditorDescriptor;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IPersistableElement;
@@ -22,6 +24,7 @@
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.sse.core.internal.util.JarUtilities;
 
 /**
  * Hyperlink for URLs (opens in read-only mode)
@@ -92,7 +95,7 @@
 		public InputStream getContents() throws CoreException {
 			InputStream stream = null;
 			try {
-				stream = fURL.openStream();
+				stream = JarUtilities.getInputStream(fURL);
 			}
 			catch (Exception e) {
 				throw new CoreException(new Status(IStatus.ERROR, JSPUIPlugin.getDefault().getBundle().getSymbolicName(), IStatus.ERROR, fURL.toString(), e));
@@ -136,7 +139,6 @@
 	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
 	 */
 	public String getTypeLabel() {
-		// TODO Auto-generated method stub
 		return null;
 	}
 
@@ -146,8 +148,10 @@
 	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
 	 */
 	public String getHyperlinkText() {
-		// TODO Auto-generated method stub
-		return null;
+		String path = fURL.getPath();
+		if (path.length() > 0)
+			return NLS.bind(JSPUIMessages.Open, new Path(path).lastSegment());
+		return NLS.bind(JSPUIMessages.TLDHyperlink_hyperlinkText, fURL.toString());
 	}
 
 	/*
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileRegionHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileRegionHyperlink.java
index 211d325..2b383c9 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileRegionHyperlink.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileRegionHyperlink.java
@@ -23,8 +23,10 @@
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.TextSelection;
 import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
 import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
 import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.ui.IEditorDescriptor;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
@@ -155,7 +157,6 @@
 	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
 	 */
 	public String getTypeLabel() {
-		// TODO Auto-generated method stub
 		return null;
 	}
 
@@ -165,7 +166,7 @@
 	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
 	 */
 	public String getHyperlinkText() {
-		return fSearchName;
+		return NLS.bind(JSPUIMessages.Open, fURL.toString());
 	}
 
 	/*
@@ -178,7 +179,7 @@
 			IEditorInput input = new StorageEditorInput(new URLStorage(fURL));
 			IEditorDescriptor descriptor;
 			try {
-				descriptor = IDE.getEditorDescriptor(input.getName());
+				descriptor = IDE.getEditorDescriptor(input.getName(), true);
 				if (descriptor != null) {
 					IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
 					IEditorPart openedEditor = IDE.openEditor(page, input, descriptor.getId(), true);
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java
index 17aaa0a..20b2579 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java
@@ -3,7 +3,9 @@
 import org.eclipse.core.resources.IFile;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
 import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PartInitException;
@@ -46,7 +48,6 @@
 	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
 	 */
 	public String getTypeLabel() {
-		// TODO Auto-generated method stub
 		return null;
 	}
 
@@ -56,8 +57,11 @@
 	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
 	 */
 	public String getHyperlinkText() {
-		// TODO Auto-generated method stub
-		return null;
+		String path = fFile.getFullPath().toString();
+		if (path.length() > 60) {
+			path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
+		}
+		return NLS.bind(JSPUIMessages.Open, path);
 	}
 
 	public void open() {
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLJavaHyperlinkDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLJavaHyperlinkDetector.java
new file mode 100644
index 0000000..e690dfe
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLJavaHyperlinkDetector.java
@@ -0,0 +1,241 @@
+/*******************************************************************************

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

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

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

+ * which accompanies this distribution, and is available at

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

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

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

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

+

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

+import org.eclipse.ui.PartInitException;

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

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

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

+

+/**

+ * Detects hyper-links in Tag Library Descriptors

+ */

+public class XMLJavaHyperlinkDetector extends AbstractHyperlinkDetector {

+

+	/**

+	 * 

+	 */

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

+

+	/**

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

+	 */

+	static class JavaElementHyperlink implements IHyperlink {

+

+		private final IJavaElement fElement;

+		private final IRegion fRegion;

+

+

+		/**

+		 * Creates a new Java element hyperlink.

+		 * 

+		 * @param region

+		 *            the region of the link

+		 * @param element

+		 *            the java element to open

+		 * @param qualify

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

+		 *            qualified name for element.

+		 */

+		JavaElementHyperlink(IRegion region, IJavaElement element) {

+			fRegion = region;

+			fElement = element;

+		}

+

+		public IRegion getHyperlinkRegion() {

+			return fRegion;

+		}

+

+		public String getHyperlinkText() {

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

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

+		}

+

+		public String getTypeLabel() {

+			return null;

+		}

+

+		public void open() {

+			try {

+				JavaUI.openInEditor(fElement);

+			}

+			catch (PartInitException e) {

+			}

+			catch (JavaModelException e) {

+			}

+		}

+	}

+

+

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

+		IStructuredModel model = null;

+		try {

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

+			if (model != null) {

+				String baseLocation = model.getBaseLocation();

+				// URL fixup from the taglib index record

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

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

+				}

+				/*

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

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

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

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

+				 */

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

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

+					IPath basePath = new Path(baseFile);

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

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

+						try {

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

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

+								if (javaProject.exists()) {

+									IPackageFragmentRoot root = javaProject.findPackageFragmentRoot(basePath);

+									if (root != null) {

+										return createJavaElementHyperlink(javaProject, elementName, region);

+									}

+								}

+							}

+						}

+						catch (CoreException e) {

+							Logger.logException(e);

+						}

+					}

+				}

+				else {

+					IPath basePath = new Path(baseLocation);

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

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

+					}

+				}

+			}

+

+		}

+		finally {

+			if (model != null)

+				model.releaseFromRead();

+		}

+		return null;

+	}

+

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

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

+			try {

+				IJavaElement element = javaProject.findType(elementName);

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

+					return new JavaElementHyperlink(region, element);

+				}

+			}

+			catch (JavaModelException e) {

+				// bad name, no link

+			}

+		}

+		return null;

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see

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

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

+	 * boolean)

+	 */

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

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

+			IDocument document = textViewer.getDocument();

+			// find hyperlink range for Java element

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

+			String name = null;

+			try {

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

+			}

+			catch (BadLocationException e) {

+			}

+			if (name != null) {

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

+				if (link != null)

+					return new IHyperlink[]{link};

+			}

+		}

+

+		return null;

+	}

+

+	/**

+	 * Java always selects word when defining region

+	 * 

+	 * @param document

+	 * @param anchor

+	 * @return IRegion

+	 */

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

+

+		try {

+			int offset = anchor;

+			char c;

+

+			while (offset >= 0) {

+				c = document.getChar(offset);

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

+					break;

+				--offset;

+			}

+

+			int start = offset;

+

+			offset = anchor;

+			int length = document.getLength();

+

+			while (offset < length) {

+				c = document.getChar(offset);

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

+					break;

+				++offset;

+			}

+

+			int end = offset;

+

+			if (start == end)

+				return new Region(start, 0);

+

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

+

+		}

+		catch (BadLocationException x) {

+			return null;

+		}

+	}

+}

diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java
index fbeae08..a057ed5 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,235 +10,40 @@
  *******************************************************************************/
 package org.eclipse.jst.jsp.ui.internal.java.refactoring;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 
-import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jdt.core.IJavaElement;
 import org.eclipse.jdt.core.IType;
 import org.eclipse.jdt.core.search.SearchDocument;
 import org.eclipse.jdt.core.search.SearchMatch;
 import org.eclipse.jdt.core.search.SearchRequestor;
 import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
 import org.eclipse.jst.jsp.core.internal.java.search.JavaSearchDocumentDelegate;
 import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
 import org.eclipse.jst.jsp.ui.internal.Logger;
 import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.DocumentChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextChange;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.text.edits.MalformedTreeException;
 import org.eclipse.text.edits.MultiTextEdit;
 import org.eclipse.text.edits.ReplaceEdit;
 import org.eclipse.text.edits.TextEdit;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.core.internal.document.DocumentReader;
-import org.eclipse.wst.sse.core.internal.encoding.CodedStreamCreator;
+import org.eclipse.text.edits.TextEditGroup;
 
 /**
- * Creates document change(s) for an IJavaElement rename.
- * Changes are created for every type "match" in the workspace
- * @author pavery
+ * <p>After a search is run with this {@link SearchRequestor} {@link #getChanges(RefactoringParticipant)}
+ * can be called to get any new {@link Change}s that need to be created as a result of the search.  If
+ * {@link Change}s are already existing for the documents found then new {@link Change}s will not be
+ * created for them, but the needed {@link TextEdit}s will be added to the existing {@link Change}s.</p>
  */
 public class BasicRefactorSearchRequestor extends SearchRequestor {
-	
-	/**
-	 * Workspace operation to perform save on model for updated documents.
-	 * Should only be done on models not open in an editor.
-	 */
-	private class SaveJspFileOp extends WorkspaceModifyOperation {
-		
-		private IDocument fJSPDoc = null;
-		private IFile fJSPFile = null;
-		
-		public SaveJspFileOp(IFile jspFile, IDocument jspDoc) {
-			this.fJSPDoc = jspDoc;
-			this.fJSPFile = jspFile;
-		}
-		
-		protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
-			
-			// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3765
-			// save file w/ no intermediate model creation
-			
-			CodedStreamCreator codedStreamCreator = new CodedStreamCreator();
-			Reader reader = new DocumentReader(this.fJSPDoc);
-			codedStreamCreator.set(this.fJSPFile, reader);
-			
-			ByteArrayOutputStream codedByteStream = null;
-			InputStream codedStream = null;
-			try {
-				codedByteStream = codedStreamCreator.getCodedByteArrayOutputStream();
-				codedStream = new ByteArrayInputStream(codedByteStream.toByteArray());
-				if (this.fJSPFile.exists())
-					this.fJSPFile.setContents(codedStream, true, true, null);
-				else
-					this.fJSPFile.create(codedStream, false, null);
-				
-			} catch (CoreException e) {
-				Logger.logException(e);
-			} catch (IOException e) {
-				Logger.logException(e);
-			}
-			finally {
-				try {
-					if(codedByteStream != null)
-						codedByteStream.close();
-					if(codedStream != null)
-						codedStream.close();
-				}
-				catch (IOException e){
-					// unlikely
-				}
-			}
-		}
-	}
-	// end inner class SaveJspFileOp
-	
-	/**
-	 * Change class that wraps a text edit on the jsp document
-	 */
-	private class RenameChange extends DocumentChange {
-
-		private TextEdit fEdit = null;
-		private IFile fJSPFile = null;
-		private IDocument fJSPDoc = null;
-		private String fDescription = JSPUIMessages.BasicRefactorSearchRequestor_0;
-		
-		public RenameChange(IFile jspFile, IDocument jspDoc, TextEdit edit, String description) {
-			super(JSPUIMessages.BasicRefactorSearchRequestor_6, jspDoc);
-			this.fEdit = edit;
-			this.fJSPFile = jspFile;
-			this.fJSPDoc = jspDoc;
-			this.fDescription = description;
-		}
-		
-		public RefactoringStatus isValid(IProgressMonitor pm)throws CoreException {
-			return new RefactoringStatus();
-		}
-		
-		public IDocument getPreviewDocument(IProgressMonitor pm) throws CoreException {
-			IDocument copyDoc = new Document(fJSPDoc.get());
-			try {
-				fEdit.apply(copyDoc);
-			}
-			catch (MalformedTreeException e) {
-				// ignore
-			}
-			catch (BadLocationException e) {
-				// ignore
-			}
-			return copyDoc;
-		}
-		
-		public Change perform(IProgressMonitor pm) throws CoreException {
-			RenameChange undoChange = null;
-			try {
-				
-				if(!isOpenInEditor(this.fJSPDoc)) {
-					// apply edit to JSP doc AND save model
-					undoChange = new RenameChange(this.fJSPFile, this.fJSPDoc, this.fEdit.apply(fJSPDoc), this.fDescription);
-					saveFile(this.fJSPFile, this.fJSPDoc);
-				}
-				else {
-					// just apply edit to JSP document
-					undoChange = new RenameChange(this.fJSPFile, this.fJSPDoc, this.fEdit.apply(fJSPDoc), this.fDescription);
-				}
-				
-			} catch (MalformedTreeException e) {
-				Logger.logException(e);
-			} catch (BadLocationException e) {
-				Logger.logException(e);
-			}
-			return undoChange;
-		}
-		
-		/**
-		 * Performed in an operation since it modifies resources in the workspace
-		 * @param jspDoc
-		 * @throws CoreException
-		 */
-		private void saveFile(IFile jspFile, IDocument jspDoc) {
-			
-			SaveJspFileOp op  = new SaveJspFileOp(jspFile, jspDoc);
-			
-			try {
-				op.run(JSPSearchSupport.getInstance().getProgressMonitor());
-			} catch (InvocationTargetException e) {
-				Logger.logException(e);
-			} catch (InterruptedException e) {
-				Logger.logException(e);
-			}
-		}
-
-		/**
-		 * Checks if a document is open in an editor
-		 * @param jspDoc
-		 * @return
-		 */
-		private boolean isOpenInEditor(IDocument jspDoc) {
-			IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
-			IWorkbenchWindow w = null;
-			for (int i = 0; i < windows.length; i++) {
-
-				w = windows[i];
-				IWorkbenchPage page = w.getActivePage();
-				if (page != null) {
-
-					IEditorReference[] references = page.getEditorReferences();
-					IEditorPart editor = null;
-					Object o = null;
-					IDocument doc = null;
-					for (int j = 0; j < references.length; j++) {
-
-						editor = references[j].getEditor(true);
-						// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3764
-						// use adapter to get ITextEditor (for things like
-						// page designer)
-						o = editor.getAdapter(ITextEditor.class);
-						if (o != null && o instanceof ITextEditor) {
-
-							doc = ((ITextEditor) o).getDocumentProvider().getDocument(editor.getEditorInput());
-							if (doc != null && doc.equals(jspDoc)) {
-								return true;
-							}
-						}
-					}
-				}
-			}
-			return false;
-		}
-
-		public String getName() {
-			return this.fDescription;
-		}
-		
-		public Object getModifiedElement() {
-			return getElement();
-		}
-	}
-	// end inner class RenameChange
-	
-	
 	/** The type being renamed (the old type)*/
 	IJavaElement fElement = null;
 	/** The new name of the type being renamed*/
@@ -275,14 +80,18 @@
 	
 			String renameText = getRenameText((JavaSearchDocumentDelegate)searchDoc, javaMatch);
 			
-			// add it for the correct document
-			addJavaEdit(searchDoc.getPath(), new ReplaceEdit(javaMatch.getOffset(), javaMatch.getLength(), renameText));
+			//if rename text is null then don't create an edit for it
+			if(renameText != null) {
+				// add it for the correct document
+				addJavaEdit(searchDoc.getPath(), new ReplaceEdit(javaMatch.getOffset(), javaMatch.getLength(), renameText));
+			}
 		}
 	}
 	
 	/**
 	 * @param searchDoc
-	 * @return
+	 * @return the rename text or <code>null</code> if no edit should be created for the given match.
+	 * Such a case would be a match where nothing needs to be edited.
 	 */
 	protected String getRenameText(JavaSearchDocumentDelegate searchDoc, SearchMatch javaMatch) {
 		return getNewName();
@@ -311,8 +120,17 @@
 	}
 	
 	/**
+	 * <p>This function is not safe because it does not check for existing {@link Change}s that
+	 * new {@link Change}s created by this method may conflict with.  These conflicts can
+	 * cause indeterminate results when applied to documents.  Long story short, don't
+	 * use this method any more.</p>
 	 * 
-	 * @return all JSP changes for the search matches for the given Type
+	 * @return all JSP changes for the search matches for the given Type, they may conflict
+	 * with already existing {@link Change}s
+	 * 
+	 * @see #getChanges(RefactoringParticipant)
+	 * 
+	 * @deprecated
 	 */
 	public Change[] getChanges() {
 		
@@ -336,6 +154,53 @@
 		return (Change[])changes.toArray(new Change[changes.size()]);
 	}
 	
+	/**
+	 * Gets new {@link Change}s created as a result of this {@link SearchRequestor}.
+	 * Any existing {@link TextChange}s that had new edits added to them will not be
+	 * returned.
+	 * 
+	 * @param participant {@link RefactoringParticipant} to determine if there are already existing
+	 * {@link TextChange}s for the documents that this {@link SearchRequestor} found.
+	 * If existing
+	 * {@link TextChange}s are found then they will be used for any new edits, else new {@link TextChange}s
+	 * will be created.
+	 * 
+	 * @return Any new {@link TextChange}s created by this {@link SearchRequestor}.  If edits were
+	 * added to existing {@link TextChange}s then those existing {@link TextChange}s will not be
+	 * returned in this array.
+	 */
+	public Change[] getChanges(RefactoringParticipant participant) {
+		
+		JSPSearchSupport support = JSPSearchSupport.getInstance();
+		List changes = new ArrayList();
+		Iterator keys = fSearchDocPath2JavaEditMap.keySet().iterator();
+		String searchDocPath = null;
+		SearchDocument delegate = null;
+		
+		while(keys.hasNext()) {
+			// create on the fly
+			searchDocPath = (String)keys.next();
+			MultiTextEdit javaEdit = (MultiTextEdit)fSearchDocPath2JavaEditMap.get(searchDocPath);
+			delegate = support.getSearchDocument(searchDocPath);
+			
+			if(delegate != null && delegate instanceof JavaSearchDocumentDelegate) {
+				JavaSearchDocumentDelegate javaDelegate = (JavaSearchDocumentDelegate)delegate;
+				Change change = createChange(javaDelegate, javaDelegate.getJspTranslation().getJspEdit(javaEdit), participant);
+				changes.add(change);
+			}
+		}
+		return (Change[])changes.toArray(new Change[changes.size()]);
+	}
+	
+	/**
+	 * <p>This method is not safe because it does not take into consideration already existing
+	 * {@link Change}s and thus conflicts could occur that when applied create indeterminate
+	 * results in the target documents</p>
+	 * 
+	 * @see #createChange(JavaSearchDocumentDelegate, TextEdit, RefactoringParticipant)
+	 * 
+	 * @deprecated
+	 */
 	private Change createChange(JavaSearchDocumentDelegate searchDoc, TextEdit edit) {
 		
 		IDocument doc = searchDoc.getJspTranslation().getJspDocument();
@@ -349,7 +214,44 @@
 		catch (BadLocationException e) {
 			Logger.logException(e);
 		}
-		return new RenameChange(searchDoc.getFile(), doc, edit, description);
+		return new JSPRenameChange(searchDoc.getFile(), doc, edit, description);
+	}
+	
+	/**
+	 * </p>If a {@link TextChange} does not already exist for the given {@link JavaSearchDocumentDelegate}
+	 * then a new one will be created with the given {@link TextEdit}.  Otherwise the given {@link TextEdit}
+	 * will be added to a new group and added to the existing change and <code>null</code> will be returned.</p>
+	 * 
+	 * @param searchDoc the {@link JavaSearchDocumentDelegate} that the <code>edit</code> will be applied to
+	 * @param edit the {@link TextEdit} that needs to be added to a new {@link TextChange} or appended to an
+	 * existing one
+	 * @param participant the {@link RefactoringParticipant} that knows about the existing {@link TextChange}s
+	 * @return a new {@link Change} if there was not one already existing for the document in question,
+	 * else <code>null</code>
+	 */
+	private Change createChange(JavaSearchDocumentDelegate searchDoc, TextEdit edit, RefactoringParticipant participant) {
+		IDocument doc = searchDoc.getJspTranslation().getJspDocument();
+		String description = getDescription();
+		
+		TextChange existingChange = participant.getTextChange(searchDoc.getFile());
+		TextChange change = null;
+		if(existingChange != null) {
+			try {
+				existingChange.addEdit(edit);
+			}catch (MalformedTreeException e) {
+				Logger.logException("MalformedTreeException while adding edit " + //$NON-NLS-1$
+						edit + " to existing change " + change, e); //$NON-NLS-1$
+			}
+			
+			TextEditGroup group = new TextEditGroup(description, edit);
+			existingChange.addTextEditGroup(group);
+		} else {
+			change = new JSPRenameChange(searchDoc.getFile(), doc, edit, searchDoc.getFile().getName());
+			TextEditGroup group = new TextEditGroup(description, edit);
+			change.addTextEditGroup(group);
+		}
+		
+		return change; 
 	}
 	
 	// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3205
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameChange.java
index eea4cac..a9a7097 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameChange.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameChange.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -20,10 +20,16 @@
 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
 
 /**
- * @author pavery
+ * <p><b>Note:</b> This class is not used internally any longer and will
+ * be removed at some point.</p>
+ * 
+ * @deprecated
  */
 public class JSPMethodRenameChange extends Change {
 
+	/**
+	 * @deprecated
+	 */
 	public static Change[] createChangesFor(IMethod method, String newName) {
 		JSPSearchSupport support = JSPSearchSupport.getInstance();
 		
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameParticipant.java
index 0e23bef..f422113 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameParticipant.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameParticipant.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,65 +10,54 @@
  *******************************************************************************/
 package org.eclipse.jst.jsp.ui.internal.java.refactoring;
 
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
 import org.eclipse.jdt.core.IMethod;
 import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
 import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.CompositeChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
 
 /**
- * @author pavery
+ * {@link JSPRenameParticipant} used to update JSP documents when a Java method is renamed
  */
-public class JSPMethodRenameParticipant extends RenameParticipant {
-	
-	private IMethod fMethod = null;
-	
+public class JSPMethodRenameParticipant extends JSPRenameParticipant {
 	/**
+	 * Initializes the name of this participant to the source of the given {@link IMethod}
+	 * 
 	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
 	 */
 	protected boolean initialize(Object element) {
-		if(element instanceof IMethod) {
-			this.fMethod = (IMethod) element;
-			return true;
-		}
-		return false;
-	}
-	
-	/**
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
-	 */
-	public String getName() {
-		String name = ""; //$NON-NLS-1$
-		if(this.fMethod != null) {
-			try {
-				name = this.fMethod.getSource();
-			} catch (JavaModelException e) {
-				Logger.logException(e);
+		boolean success = false;
+		try {
+			if(element instanceof IMethod) {
+				super.fName = ((IMethod) element).getSource();
+				success = true;
 			}
+		} catch (JavaModelException e) {
+			Logger.logException(e);
 		}
-		return name;
+		return success;
 	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+
+	/**
+	 * @return a {@link JSPMethodRenameRequestor}
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#getSearchRequestor(org.eclipse.jdt.core.IJavaElement, java.lang.String)
 	 */
-	public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
-		// TODO Auto-generated method stub
-		return null;
+	protected BasicRefactorSearchRequestor getSearchRequestor(IJavaElement element, String newName) {
+		BasicRefactorSearchRequestor searchRequestor = null;
+		
+		if(isLegalElementType(element)) {
+			searchRequestor = new JSPMethodRenameRequestor(element, newName);
+		}
+		
+		return searchRequestor;
 	}
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
+
+	/**
+	 * <p>Legal types are: 
+	 * <ul><li>{@link IMethod}</li></ul></p>
+	 * 
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#isLegalElementType(org.eclipse.jdt.core.IJavaElement)
 	 */
-	public Change createChange(IProgressMonitor pm) throws CoreException {
-		Change[] changes = JSPMethodRenameChange.createChangesFor(this.fMethod, getArguments().getNewName());
-		CompositeChange multiChange = null; 
-			if(changes.length > 0)
-				multiChange  = new CompositeChange(JSPUIMessages.JSP_changes, changes); //$NON-NLS-1$
-		return multiChange;
+	protected boolean isLegalElementType(IJavaElement element) {
+		return (element instanceof IMethod);
 	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveParticipant.java
new file mode 100644
index 0000000..e7e94e5
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveParticipant.java
@@ -0,0 +1,253 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.search.SearchRequestor;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextChange;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.ISharableParticipant;
+import org.eclipse.ltk.core.refactoring.participants.MoveArguments;
+import org.eclipse.ltk.core.refactoring.participants.MoveParticipant;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringArguments;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
+import org.eclipse.text.edits.TextEdit;
+
+/**
+ * Abstract {@link ISharableParticipant} {@link MoveParticipant} for editing JSP documents
+ */
+public abstract class JSPMoveParticipant extends MoveParticipant implements ISharableParticipant {
+	
+	/**
+	 * The name of this participant.
+	 * Should be initialized by implementers in {@link #initialize(Object)}
+	 */
+	protected String fName;
+	
+	/**
+	 * A map of {@link IJavaElement} names to pairs of {@link IJavaElement}s
+	 * and their associated {@link MoveArguments} that have been added to
+	 * this {@link ISharableParticipant}.
+	 * 
+	 * key: {@link String} - Element name<br/>
+	 * value: {@link ElementAndArgumentsPair}
+	 */
+	private Map fElementAndArgumentPairs;
+	
+	/**
+	 * When new changes are being safely created {@link #getTextChange(Object)}
+	 * is called first to check for existing {@link TextChange}s, but those
+	 * results do not usually include the changes that have been created thus far
+	 * locally by this {@link MoveParticipant}.  This is to keep track of those
+	 * changes so the overridden version of {@link #getTextChange(Object)}s will take
+	 * these local {@link TextChange}s into account.
+	 */
+	private Map fLocalTextChanges;
+	
+	/**
+	 * Groups an {@link IJavaElement} with its associated {@link MoveArguments}
+	 * that have been added to this {@link ISharableParticipant}
+	 */
+	private class ElementAndArgumentsPair {
+		protected IJavaElement fElement;
+		protected MoveArguments fArgs;
+		
+		public ElementAndArgumentsPair(IJavaElement element, MoveArguments args) {
+			this.fElement = element;
+			this.fArgs = args;
+		}
+	}
+
+	/**
+	 * <p>Do local initialization. This is done here instead of in an implementation of
+	 * {@link RefactoringParticipant#initialize(java.lang.Object)} because implementers
+	 * of this class are not expected to have to call super when they implement
+	 * {@link RefactoringParticipant#initialize(java.lang.Object)}</p>
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(
+	 * 	org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor, java.lang.Object,
+	 * 	org.eclipse.ltk.core.refactoring.participants.RefactoringArguments)
+	 */
+	public boolean initialize(RefactoringProcessor processor, Object element,
+			RefactoringArguments arguments) {
+		
+		this.fElementAndArgumentPairs = new HashMap();
+		this.addElement(element, arguments);
+		this.fLocalTextChanges = new HashMap();
+		this.fName = ""; //$NON-NLS-1$
+		
+		return super.initialize(processor, element, arguments);
+	}
+
+	/**
+	 * <p>When an element is added to this {@link ISharableParticipant} it must be
+	 * a {@link IJavaElement} and be a legal element type ({@link #isLegalElementType(IJavaElement)}
+	 * and the given arguments must be {@link MoveArguments}.  Also the new <code>element</code>
+	 * will not be added if and {@link IJavaElement} of that name has already been added to
+	 * this {@link ISharableParticipant}.  This protects against elements being added more
+	 * then once.</p>
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.ISharableParticipant#addElement(java.lang.Object,
+	 * 	org.eclipse.ltk.core.refactoring.participants.RefactoringArguments)
+	 */
+	public void addElement(Object element, RefactoringArguments arguments) {
+		if(element instanceof IJavaElement &&
+				isLegalElementType((IJavaElement)element) &&
+				arguments instanceof MoveArguments) {
+			
+			//don't add elements that have already been added
+			String elementName = ((IJavaElement)element).getElementName();
+			if(!this.fElementAndArgumentPairs.containsKey(elementName)) {
+				this.fElementAndArgumentPairs.put(elementName,
+						new ElementAndArgumentsPair((IJavaElement)element, (MoveArguments)arguments));
+			}
+		}
+	}
+	
+	/**
+	 * <p>As of now the conditions are always {@link RefactoringStatus#OK}</p>
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(
+	 * 	org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+	 */
+	public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
+		return new RefactoringStatus();
+	}
+	
+	/**
+	 * 
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(
+	 * 	org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public Change createChange(IProgressMonitor pm) throws CoreException {
+		this.getTextChange(""); //$NON-NLS-1$
+		
+		//create one multi change to contain all new created changes
+		CompositeChange multiChange = new CompositeChange(JSPUIMessages.JSP_changes);
+		
+		//for each element get the changes for it and add it to the multi change
+		Iterator iter = fElementAndArgumentPairs.values().iterator();
+		while(iter.hasNext()) {
+			ElementAndArgumentsPair elemArgsPair = (ElementAndArgumentsPair)iter.next();
+			
+			Object dest = elemArgsPair.fArgs.getDestination();
+			
+			if(dest instanceof IPackageFragment) {	
+				Change[] changes = createChangesFor(elemArgsPair.fElement, ((IPackageFragment)dest).getElementName());
+				
+				/* add all new text changes to the local list of text changes so that
+				 * future iterations through the while loop will be aware of already
+				 * existing changes
+				 */
+				for(int i = 0; i < changes.length; ++i) {
+					if(changes[i] instanceof TextChange) {
+						fLocalTextChanges.put(((TextChange)changes[i]).getModifiedElement(), changes[i]);
+					}
+				}
+				
+				if(changes.length > 0) {
+					multiChange.addAll(changes);
+				}
+			}
+		}
+
+		//unless there are actually new changes return null
+		Change result = null;
+		if(multiChange.getChildren().length > 0) {
+			result = multiChange;
+		}
+		
+		return result;
+	}
+	
+	/**
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
+	 */
+	public String getName() {
+		return fName;
+	}
+	
+	/**
+	 * <p>Overridden to include locally created {@link TextChange}s that have not yet be returned by
+	 * {@link #createChange(IProgressMonitor)}.</p>
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getTextChange(java.lang.Object)
+	 */
+	public TextChange getTextChange(Object element) {
+		TextChange existingChange = (TextChange)fLocalTextChanges.get(element);
+		if(existingChange == null) {
+			existingChange = super.getTextChange(element);
+		}
+		
+		return existingChange;
+	}
+	
+	/**
+	 * Using a {@link SearchRequestor} create new changes.
+	 * 
+	 * @param element the {@link IJavaElement} to create new changes for
+	 * @param newName the new name of the given {@link IJavaElement}
+	 * 
+	 * @return any newly created {@link Change}s.  It is important to note
+	 * that while no NEW {@link Change}s maybe returned it is possible that
+	 * new {@link TextEdit}s will still added to existing {@link Change}s.
+	 */
+	protected Change[] createChangesFor(IJavaElement element, String newName) {
+		Change[] changes;
+		BasicRefactorSearchRequestor requestor = getSearchRequestor(element, newName);
+		if(requestor != null) {
+			JSPSearchSupport support = JSPSearchSupport.getInstance();
+			support.searchRunnable(element, new JSPSearchScope(), requestor);
+			changes = requestor.getChanges(this);
+		} else {
+			changes = new Change[0];
+		}
+		
+		return changes;
+	}
+	
+	/**
+	 * <p>Should be implemented to return the {@link BasicRefactorSearchRequestor} associated
+	 * with the implementers {@link JSPMoveParticipant}.</p>
+	 * 
+	 * @param element the {@link IJavaElement} to create the {@link BasicRefactorSearchRequestor} from
+	 * @param newName the new name of the {@link IJavaElement} to use when
+	 * creating the {@link BasicRefactorSearchRequestor}
+	 * 
+	 * @return a new {@link BasicRefactorSearchRequestor} based on the given parameters
+	 */
+	protected abstract BasicRefactorSearchRequestor getSearchRequestor(IJavaElement element, String newName);
+	
+	/**
+	 * @param element check that this {@link IJavaElement} is of the type the
+	 * implementers {@link JSPMoveParticipant} is configured to deal with.
+	 * 
+	 * @return <code>true</code> if the given {@link IJavaElement} is of a type
+	 * the implementers {@link JSPMoveParticipant} is configured to deal with,
+	 * <code>false</code> otherwise.
+	 */
+	protected abstract boolean isLegalElementType(IJavaElement element);
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameChange.java
index c6b9d03..bd96a25 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameChange.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameChange.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -20,10 +20,16 @@
 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
 
 /**
- * @author pavery
+ * <p><b>Note:</b> This class is not used internally any longer and will
+ * be removed at some point.</p>
+ * 
+ * @deprecated
  */
 public class JSPPackageRenameChange extends Change {
 
+	/**
+	 * @deprecated
+	 */
 	public static Change[] createChangesFor(IPackageFragment pkg, String newName) {
 		JSPSearchSupport support = JSPSearchSupport.getInstance();
 		
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameParticipant.java
index 6aed5ec..e322ba4 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameParticipant.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameParticipant.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,65 +10,48 @@
  *******************************************************************************/
 package org.eclipse.jst.jsp.ui.internal.java.refactoring;
 
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
 import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.CompositeChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
 
 /**
- * Remember to change the plugin.xml file if the name of this class changes.
- * 
- * @author pavery
+ * {@link JSPRenameParticipant} used to update JSP documents when a Java package is renamed
  */
-public class JSPPackageRenameParticipant extends RenameParticipant {
-
-	private IPackageFragment fPkg = null;
-	
+public class JSPPackageRenameParticipant extends JSPRenameParticipant {
 	/**
+	 *  Initializes the name of this participant to the name of the {@link IPackageFragment}
+	 * 
 	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
 	 */
 	protected boolean initialize(Object element) {
+		boolean success = false;
 		if(element instanceof IPackageFragment) {
-			this.fPkg = (IPackageFragment) element;
-			return true;
+			super.fName = ((IPackageFragment)element).getElementName();
+			success = true;
 		}
-		return false;
+		return success;
 	}
 	
 	/**
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
+	 * @return a {@link JSPPackageRenameRequestor}
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#getSearchRequestor(org.eclipse.jdt.core.IJavaElement, java.lang.String)
 	 */
-	public String getName() {
-		String name = ""; //$NON-NLS-1$
-		if(this.fPkg != null) {
-			name = this.fPkg.getElementName();
+	protected BasicRefactorSearchRequestor getSearchRequestor(IJavaElement element, String newName) {
+		BasicRefactorSearchRequestor searchRequestor = null;
+		
+		if(isLegalElementType(element)) {
+			searchRequestor = new JSPPackageRenameRequestor(element, newName);
 		}
-		return name;
-	}
-
-	/**
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
-	 */
-	public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	/**
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public Change createChange(IProgressMonitor pm) throws CoreException {
-		 Change[] changes = JSPPackageRenameChange.createChangesFor(this.fPkg, getArguments().getNewName());
-		 CompositeChange multiChange = null;
-		 if(changes.length > 0)
-			multiChange = new CompositeChange(JSPUIMessages.JSP_changes, changes); //$NON-NLS-1$
-	     return multiChange;
+		
+		return searchRequestor;
 	}
 	
-	
+	/**
+	 * <p>Legal types are: 
+	 * <ul><li>{@link IPackageFragment}</li></ul></p>
+	 * 
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#isLegalElementType(java.lang.Object)
+	 */
+	protected boolean isLegalElementType(IJavaElement element) {
+		return (element instanceof IPackageFragment);
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameChange.java
new file mode 100644
index 0000000..7032c21
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameChange.java
@@ -0,0 +1,298 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.Logger;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.DocumentChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.text.edits.MalformedTreeException;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.TextEdit;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.sse.core.internal.document.DocumentReader;
+import org.eclipse.wst.sse.core.internal.encoding.CodedStreamCreator;
+
+/**
+ * {@link DocumentChange} implementation for JSP Documents
+ */
+public class JSPRenameChange extends DocumentChange {
+
+	/**
+	 * The JSP file this {@link Change} will change
+	 */
+	protected IFile fJSPFile = null;
+	
+	/**
+	 * The description of this change
+	 */
+	private String fDescription;
+	
+	/**
+	 * Create a new {@link JSPRenameChange}
+	 * 
+	 * @param jspFile
+	 * @param jspDoc
+	 * @param edit
+	 * @param description
+	 */
+	public JSPRenameChange(IFile jspFile, IDocument jspDoc, TextEdit edit, String description) {
+		super(JSPUIMessages.BasicRefactorSearchRequestor_6, jspDoc);
+		MultiTextEdit parentEdit = new MultiTextEdit();
+		parentEdit.addChild(edit);
+		super.setEdit(parentEdit);
+		this.fJSPFile = jspFile;
+		this.fDescription = description;
+	}
+	
+	/**
+	 * Create a new {@link JSPRenameChange} by shallow copying the given
+	 * original {@link JSPRenameChange}.
+	 * 
+	 * @param originalChange the {@link JSPRenameChange} to shallow copy to create
+	 * a new {@link JSPRenameChange}
+	 */
+	public JSPRenameChange(JSPRenameChange originalChange) {
+		super(JSPUIMessages.BasicRefactorSearchRequestor_6, originalChange.getJSPDoc());
+		super.setEdit(originalChange.getEdit());
+		this.fJSPFile = originalChange.fJSPFile;
+		this.fDescription = originalChange.fDescription;
+	}
+	
+	/**
+	 * <p>Currently will always be {@link RefactoringStatus#OK}</p>
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.DocumentChange#isValid(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public RefactoringStatus isValid(IProgressMonitor pm)throws CoreException {
+		return new RefactoringStatus();
+	}
+	
+	/**
+	 * @see org.eclipse.ltk.core.refactoring.TextChange#getPreviewDocument(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public IDocument getPreviewDocument(IProgressMonitor pm) throws CoreException {
+		IDocument copyDoc = new Document(this.getJSPDoc().get());
+		try {
+			super.getEdit().apply(copyDoc);
+		}
+		catch (MalformedTreeException e) {
+			// ignore
+		}
+		catch (BadLocationException e) {
+			// ignore
+		}
+		return copyDoc;
+	}
+	
+	/**
+	 * Performs this change and returns a {@link JSPRenameUndoChange} to undo the change.
+	 * 
+	 * @return a {@link JSPRenameUndoChange} to undo this performed {@link Change}
+	 * @see org.eclipse.ltk.core.refactoring.TextChange#perform(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public Change perform(IProgressMonitor pm) throws CoreException {
+		Change undoChange = null;
+		try {
+			//apply edit
+			undoChange = super.perform(pm);
+			undoChange = new JSPRenameUndoChange(this, undoChange);
+			
+			//save the model
+			saveJSPFile(this.fJSPFile, this.getJSPDoc());
+			
+		} catch (MalformedTreeException e) {
+			Logger.logException(e);
+		}
+		return undoChange;
+	}
+
+	/**
+	 * @see org.eclipse.ltk.core.refactoring.TextEditBasedChange#getName()
+	 */
+	public String getName() {
+		return this.fDescription;
+	}
+	
+	/**
+	 * <p>The modified element is the JSP {@link IFile} that this {@link Change}
+	 * changes.</p>
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.DocumentChange#getModifiedElement()
+	 */
+	public Object getModifiedElement() {
+		return this.fJSPFile;
+	}
+	
+	/**
+	 * <p>Convenience method to get the JSP {@link IDocument} that this {@link Change}
+	 * edits.</p>
+	 * 
+	 * @return the JSP {@link IDocument} that this {@link Change} edits
+	 */
+	protected IDocument getJSPDoc() {
+		IDocument doc = null;
+		try {
+			doc = this.acquireDocument(null);
+		} catch(CoreException e) {
+			//ignore, DocumentChange.acquireDocument will never throw it
+		}
+		
+		return doc;
+	}
+	
+	/**
+	 * <p>Saves a JSP file.  If the file is not open in an editor then modifies the file directly, else
+	 * if the file is open an editor then run the save method on the open editor.</p>
+	 * 
+	 * @param jspFile the {@link IFile} to save
+	 * @param jspDoc the {@link IDocument} with the new content for the given {@link IFile}
+	 */
+	protected static void saveJSPFile(IFile jspFile, IDocument jspDoc) {
+		//if not open then save model
+		final ITextEditor editor = findOpenEditor(jspDoc);
+		try {
+			/* if no open editor then save the document to the file
+			 * else save the open editor
+			 */
+			if(editor == null) {
+				SaveJspFileOp op  = new SaveJspFileOp(jspFile, jspDoc);
+				op.run(JSPSearchSupport.getInstance().getProgressMonitor());
+			} else {
+				//editor save must be done on UI thread
+				IRunnableWithProgress runnable= new IRunnableWithProgress() {
+					public void run(IProgressMonitor pm) throws InterruptedException {
+						editor.doSave(pm);
+					}
+				};
+				PlatformUI.getWorkbench().getProgressService().runInUI(editor.getSite().getWorkbenchWindow(), runnable, null);
+			}
+		} catch (InvocationTargetException e) {
+			Logger.logException(e);
+		} catch (InterruptedException e) {
+			Logger.logException(e);
+		}
+	}
+	
+	/**
+	 * <p>Checks if a document is open in an editor and returns it if it is</p>
+	 * 
+	 * @param jspDoc check to see if this {@link IDocument} is currently open in an editor
+	 * @return the open {@link ITextEditor} associated with the given {@link IDocument} or
+	 * <code>null</code> if none can be found.
+	 */
+	private static ITextEditor findOpenEditor(IDocument jspDoc) {
+		IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
+		IWorkbenchWindow w = null;
+		for (int i = 0; i < windows.length; i++) {
+
+			w = windows[i];
+			IWorkbenchPage page = w.getActivePage();
+			if (page != null) {
+
+				IEditorReference[] references = page.getEditorReferences();
+				IEditorPart editor = null;
+				Object o = null;
+				IDocument doc = null;
+				for (int j = 0; j < references.length; j++) {
+
+					editor = references[j].getEditor(false);
+					// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3764
+					// use adapter to get ITextEditor (for things like
+					// page designer)
+					o = editor.getAdapter(ITextEditor.class);
+					if (o != null && o instanceof ITextEditor) {
+
+						doc = ((ITextEditor) o).getDocumentProvider().getDocument(editor.getEditorInput());
+						if (doc != null && doc.equals(jspDoc)) {
+							return (ITextEditor) o;
+						}
+					}
+				}
+			}
+		}
+		return null;
+	}
+	
+	/**
+	 * Workspace operation to perform save on model for updated documents.
+	 * Should only be done on models not open in an editor.
+	 */
+	private static class SaveJspFileOp extends WorkspaceModifyOperation {
+		
+		private IDocument fJSPDoc = null;
+		private IFile fJSPFile = null;
+		
+		public SaveJspFileOp(IFile jspFile, IDocument jspDoc) {
+			this.fJSPDoc = jspDoc;
+			this.fJSPFile = jspFile;
+		}
+		
+		protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
+			
+			// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3765
+			// save file w/ no intermediate model creation
+			
+			CodedStreamCreator codedStreamCreator = new CodedStreamCreator();
+			Reader reader = new DocumentReader(this.fJSPDoc);
+			codedStreamCreator.set(this.fJSPFile, reader);
+			
+			ByteArrayOutputStream codedByteStream = null;
+			InputStream codedStream = null;
+			try {
+				codedByteStream = codedStreamCreator.getCodedByteArrayOutputStream();
+				codedStream = new ByteArrayInputStream(codedByteStream.toByteArray());
+				if (this.fJSPFile.exists())
+					this.fJSPFile.setContents(codedStream, true, true, null);
+				else
+					this.fJSPFile.create(codedStream, false, null);
+				
+			} catch (CoreException e) {
+				Logger.logException(e);
+			} catch (IOException e) {
+				Logger.logException(e);
+			}
+			finally {
+				try {
+					if(codedByteStream != null)
+						codedByteStream.close();
+					if(codedStream != null)
+						codedStream.close();
+				}
+				catch (IOException e){
+					// unlikely
+				}
+			}
+		}
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameParticipant.java
new file mode 100644
index 0000000..d11ec67
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameParticipant.java
@@ -0,0 +1,245 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope;
+import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextChange;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.ISharableParticipant;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringArguments;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
+import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
+import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
+import org.eclipse.text.edits.TextEdit;
+
+/**
+ * Abstract {@link ISharableParticipant} {@link RenameParticipant} for editing JSP documents
+ */
+public abstract class JSPRenameParticipant extends RenameParticipant implements ISharableParticipant {
+	/**
+	 * The name of this participant.
+	 * Should be initialized by implementers in {@link #initialize(Object)}
+	 */
+	protected String fName;
+	
+	/**
+	 * A map of {@link IJavaElement} names to pairs of {@link IJavaElement}s
+	 * and their associated {@link RenameArguments} that have been added to
+	 * this {@link ISharableParticipant}.
+	 * 
+	 * key: {@link String} - Element name<br/>
+	 * value: {@link ElementAndArgumentsPair}
+	 */
+	private Map fElementAndArgumentPairs;
+	
+	/**
+	 * When new changes are being safely created {@link #getTextChange(Object)}
+	 * is called first to check for existing {@link TextChange}s, but those
+	 * results do not usually include the changes that have been created thus far
+	 * locally by this {@link RenameParticipant}.  This is to keep track of those
+	 * changes so the overridden version of {@link #getTextChange(Object)}s will take
+	 * these local {@link TextChange}s into account.
+	 */
+	private Map fLocalTextChanges;
+	
+	/**
+	 * Groups an {@link IJavaElement} with its associated {@link RenameArguments}
+	 * that have been added to this {@link ISharableParticipant}
+	 */
+	private class ElementAndArgumentsPair {
+		protected IJavaElement fElement;
+		protected RenameArguments fArgs;
+		
+		public ElementAndArgumentsPair(IJavaElement element, RenameArguments args) {
+			this.fElement = element;
+			this.fArgs = args;
+		}
+	}
+
+	/**
+	 * <p>Do local initialization. This is done here instead of in an implementation of
+	 * {@link RefactoringParticipant#initialize(java.lang.Object)} because implementers
+	 * of this class are not expected to have to call super when they implement
+	 * {@link RefactoringParticipant#initialize(java.lang.Object)}</p>
+	 * 
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(
+	 * 	org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor, java.lang.Object,
+	 * 	org.eclipse.ltk.core.refactoring.participants.RefactoringArguments)
+	 */
+	public boolean initialize(RefactoringProcessor processor, Object element,
+			RefactoringArguments arguments) {
+		
+		this.fElementAndArgumentPairs = new HashMap();
+		this.addElement(element, arguments);
+		this.fLocalTextChanges = new HashMap();
+		this.fName = ""; //$NON-NLS-1$
+		
+		return super.initialize(processor, element, arguments);
+	}
+
+	/**
+	 * <p>When an element is added to this {@link ISharableParticipant} it must be
+	 * a {@link IJavaElement} and be a legal element type ({@link #isLegalElementType(IJavaElement)}
+	 * and the given arguments must be {@link RenameArguments}.  Also the new <code>element</code>
+	 * will not be added if and {@link IJavaElement} of that name has already been added to
+	 * this {@link ISharableParticipant}.  This protects against elements being added more
+	 * then once.</p>
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.ISharableParticipant#addElement(java.lang.Object,
+	 * 	org.eclipse.ltk.core.refactoring.participants.RefactoringArguments)
+	 */
+	public void addElement(Object element, RefactoringArguments arguments) {
+		if(element instanceof IJavaElement &&
+				isLegalElementType((IJavaElement)element) &&
+				arguments instanceof RenameArguments) {
+			
+			//don't add elements that have already been added
+			String elementName = ((IJavaElement)element).getElementName();
+			if(!this.fElementAndArgumentPairs.containsKey(elementName)) {
+				this.fElementAndArgumentPairs.put(elementName,
+						new ElementAndArgumentsPair((IJavaElement)element, (RenameArguments)arguments));
+			}
+		}
+	}
+	
+	/**
+	 * <p>As of now the conditions are always {@link RefactoringStatus#OK}</p>
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(
+	 * 	org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+	 */
+	public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
+		return new RefactoringStatus();
+	}
+	
+	/**
+	 * 
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(
+	 * 	org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public Change createChange(IProgressMonitor pm) throws CoreException {
+		this.getTextChange(""); //$NON-NLS-1$
+		
+		//create one multi change to contain all new created changes
+		CompositeChange multiChange = new CompositeChange(JSPUIMessages.JSP_changes);
+		
+		//for each element get the changes for it and add it to the multi change
+		Iterator iter = fElementAndArgumentPairs.values().iterator();
+		while(iter.hasNext()) {
+			ElementAndArgumentsPair elemArgsPair = (ElementAndArgumentsPair)iter.next();
+			Change[] changes = createChangesFor(elemArgsPair.fElement, elemArgsPair.fArgs.getNewName());
+			
+			/* add all new text changes to the local list of text changes so that
+			 * future iterations through the while loop will be aware of already
+			 * existing changes
+			 */
+			for(int i = 0; i < changes.length; ++i) {
+				if(changes[i] instanceof TextChange) {
+					fLocalTextChanges.put(((TextChange)changes[i]).getModifiedElement(), changes[i]);
+				}
+			}
+			
+			if(changes.length > 0) {
+				multiChange.addAll(changes);
+			}
+		}
+
+		//unless there are actually new changes return null
+		Change result = null;
+		if(multiChange.getChildren().length > 0) {
+			result = multiChange;
+		}
+		
+		return result;
+	}
+	
+	/**
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
+	 */
+	public String getName() {
+		return fName;
+	}
+	
+	/**
+	 * <p>Overridden to include locally created {@link TextChange}s that have not yet be returned by
+	 * {@link #createChange(IProgressMonitor)}.</p>
+	 * 
+	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getTextChange(java.lang.Object)
+	 */
+	public TextChange getTextChange(Object element) {
+		TextChange existingChange = (TextChange)fLocalTextChanges.get(element);
+		if(existingChange == null) {
+			existingChange = super.getTextChange(element);
+		}
+		
+		return existingChange;
+	}
+	
+	/**
+	 * 
+	 * @param element the {@link IJavaElement} to create new changes for
+	 * @param newName the new name of the given {@link IJavaElement}
+	 * 
+	 * @return any newly created {@link Change}s.  It is important to note
+	 * that while no NEW {@link Change}s maybe returned it is possible that
+	 * new {@link TextEdit}s will still added to existing {@link Change}s.
+	 */
+	protected Change[] createChangesFor(IJavaElement element, String newName) {
+		Change[] changes;
+		BasicRefactorSearchRequestor requestor = getSearchRequestor(element, newName);
+		if(requestor != null) {
+			JSPSearchSupport support = JSPSearchSupport.getInstance();
+			support.searchRunnable(element, new JSPSearchScope(), requestor);
+			changes = requestor.getChanges(this);
+		} else {
+			changes = new Change[0];
+		}
+		
+		return changes;
+	}
+	
+	/**
+	 * <p>Should be implemented to return the {@link BasicRefactorSearchRequestor} associated
+	 * with the implementers {@link JSPRenameParticipantParticipant}.</p>
+	 * 
+	 * @param element the {@link IJavaElement} to create the {@link BasicRefactorSearchRequestor} from
+	 * @param newName the new name of the {@link IJavaElement} to use when
+	 * creating the {@link BasicRefactorSearchRequestor}
+	 * 
+	 * @return a new {@link BasicRefactorSearchRequestor} based on the given parameters
+	 */
+	protected abstract BasicRefactorSearchRequestor getSearchRequestor(IJavaElement element, String newName);
+	
+	/**
+	 * @param element check that this {@link IJavaElement} is of the type the
+	 * implementers {@link JSPRenameParticipant} is configured to deal with.
+	 * 
+	 * @return <code>true</code> if the given {@link IJavaElement} is of a type
+	 * the implementers {@link JSPRenameParticipant} is configured to deal with,
+	 * <code>false</code> otherwise.
+	 */
+	protected abstract boolean isLegalElementType(IJavaElement element);
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameUndoChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameUndoChange.java
new file mode 100644
index 0000000..a34e67d
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameUndoChange.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.java.refactoring;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+/**
+ * <p>When undoing {@link JSPRenameChange}s need to be sure not only to perform
+ * the UndoDocumentChange but to also save the JSP file otherwise one of two
+ * unwanted things could happen:
+ * <ul><li>an open editor with the file could be marked dirty</li>
+ * <li>or if the changed file is not open in an editor then the changes will
+ * not be saved to the file and thus not persist.</li></ul></p>
+ * 
+ * <p>Therefore a {@link JSPRenameUndoChange} wraps another {@link Change} which
+ * is considered the "undo change".  When a perform is called on {@link JSPRenameUndoChange}
+ * the perform is called on the wrapped "undo change", another {@link JSPRenameUndoChange}
+ * is created as the "redo change" from the return of the perform on the "undo change"
+ * and then most importantly the updated {@link IDocument} is saved to the {@link IFile}
+ * if the JSP file is not open in an editor, or a save is called on the open {@link ITextEditor}
+ * that is editing the changed JSP file.</p>
+ */
+public class JSPRenameUndoChange extends JSPRenameChange {
+	/**
+	 * The "undo change" being wrapped
+	 */
+	private Change fUndoChange;
+	
+	/**
+	 * <p>Create the {@link JSPRenameUndoChange} from the {@link JSPRenameChange}
+	 * that created the undo change and the undo change itself.</p>
+	 * 
+	 * @param originalChange the {@link JSPRenameChange} that created the <code>undoChange</code>
+	 * @param undoChange the undo change to be wrapped by this {@link JSPRenameUndoChange}
+	 */
+	public JSPRenameUndoChange(JSPRenameChange originalChange, Change undoChange) {
+		super(originalChange);
+		fUndoChange = undoChange;
+	}
+	
+	/**
+	 * <p>See {@link JSPRenameUndoChange} class description for more details.</p>
+	 * 
+	 * @return a {@link JSPRenameUndoChange} wrapping the "redo change" returned by the
+	 * call to {@link Change#perform(IProgressMonitor)} on the wrapped "undo change".
+	 * 
+	 * @see JSPRenameUndoChange
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameChange#perform(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public Change perform(IProgressMonitor pm) throws CoreException {
+		//apply edit
+		Change redoChange = fUndoChange.perform(pm);
+		redoChange = new JSPRenameUndoChange(this, redoChange);
+		
+		//save the file
+		saveJSPFile(this.fJSPFile, this.getJSPDoc());
+		
+		return redoChange;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveChange.java
index 0448544..b60baad 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveChange.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveChange.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -20,10 +20,16 @@
 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
 
 /**
- * @author pavery
+ * <p><b>Note:</b> This class is not used internally any longer and will
+ * be removed at some point.</p>
+ * 
+ * @deprecated
  */
 public class JSPTypeMoveChange extends Change {
 
+	/**
+	 * @deprecated
+	 */
 	public static Change[] createChangesFor(IType type, String newName) {
 		
 		JSPSearchSupport support = JSPSearchSupport.getInstance();
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveParticipant.java
index 312efe3..4ac0bb0 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveParticipant.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveParticipant.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,73 +10,52 @@
  *******************************************************************************/
 package org.eclipse.jst.jsp.ui.internal.java.refactoring;
 
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IJavaElement;
 import org.eclipse.jdt.core.IType;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.CompositeChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.MoveParticipant;
 
 /**
- * @author pavery
+ * {@link JSPMoveParticipant} used to update JSP documents when a Java type is moved.
  */
-public class JSPTypeMoveParticipant extends MoveParticipant {
+public class JSPTypeMoveParticipant extends JSPMoveParticipant {
 	
-	IType fType = null;
-	
-	/* (non-Javadoc)
+	/**
+	 * Initializes the name of this participant to the name of the {@link IType}
+	 * 
 	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
 	 */
 	protected boolean initialize(Object element) {
-		
+		boolean success = false;
 		if(element instanceof IType) {
-			this.fType = (IType)element;
-			return true;
+			super.fName =((IType)element).getElementName();
+			success = true;
 		}
-		return false;
+		return success;
 	}
 
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
+	/**
+	 * @return a {@link JSPTypeMoveRequestor}
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPMoveParticipant#getSearchRequestor(org.eclipse.jdt.core.IJavaElement, java.lang.String)
 	 */
-	public String getName() {
+	protected BasicRefactorSearchRequestor getSearchRequestor(
+			IJavaElement element, String newName) {
 		
-		String name = ""; //$NON-NLS-1$
-		if(this.fType != null)
-			name = this.fType.getElementName();
-		return name;
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
-	 */
-	public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public Change createChange(IProgressMonitor pm) throws CoreException {
+		BasicRefactorSearchRequestor searchRequestor = null;
 		
-		if(pm != null && pm.isCanceled())
-			return null;
-		
-		CompositeChange multiChange = null; 
-		Object dest = getArguments().getDestination();
-		
-		if(dest instanceof IPackageFragment) {		
-			Change[] changes = JSPTypeMoveChange.createChangesFor(fType, ((IPackageFragment)dest).getElementName());
-			if(changes.length > 0)
-				multiChange = new CompositeChange(JSPUIMessages.JSP_changes, changes); //$NON-NLS-1$
+		if(isLegalElementType(element)) {
+			searchRequestor = new JSPTypeMoveRequestor(element, newName);
 		}
-		return multiChange;
+		
+		return searchRequestor;
 	}
-	
+
+	/**
+	 * <p>Legal types are: 
+	 * <ul><li>{@link IType}</li></ul></p>
+	 * 
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#isLegalElementType(org.eclipse.jdt.core.IJavaElement)
+	 */
+	protected boolean isLegalElementType(IJavaElement element) {
+		return (element instanceof IType);
+	}
 	
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveRequestor.java
index 4953031..bd9c8c0 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveRequestor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveRequestor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -31,6 +31,9 @@
 		super(element, newPackage);
 	}
 	
+	/**
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getRenameText(org.eclipse.jst.jsp.core.internal.java.search.JavaSearchDocumentDelegate, org.eclipse.jdt.core.search.SearchMatch)
+	 */
 	protected String getRenameText(JavaSearchDocumentDelegate searchDoc, SearchMatch javaMatch) {
 		
 		String renameText = getElement().getElementName();
@@ -44,6 +47,12 @@
 				// getNewName() is the pkg name
 				renameText = getNewName() + "." + renameText; //$NON-NLS-1$
 		}
+
+		//if the rename text is the same as the match text then, don't want to bother renaming anything
+		if(renameText.equals(matchText)) {
+			renameText = null;
+		} 
+
 		return renameText;
 	}
 	
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameChange.java
index e59baf5..e5ea96c 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameChange.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameChange.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -19,12 +19,17 @@
 import org.eclipse.ltk.core.refactoring.Change;
 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
 
-
 /**
- * @author pavery
+ * <p><b>Note:</b> This class is not used internally any longer and will
+ * be removed at some point.</p>
+ * 
+ * @deprecated
  */
 public class JSPTypeRenameChange extends Change {
 
+	/**
+	 * @deprecated
+	 */
 	public static Change[] createChangesFor(IType type, String newName) {
 		JSPSearchSupport support = JSPSearchSupport.getInstance();
 		
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameParticipant.java
index 2332069..db2e95b 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameParticipant.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameParticipant.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,71 +10,51 @@
  *******************************************************************************/
 package org.eclipse.jst.jsp.ui.internal.java.refactoring;
 
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
 import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.CompositeChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
 
 /**
- * Remember to change the plugin.xml file if the name of this class changes.
- * 
- * @author pavery
+ * {@link JSPRenameParticipant} used to update JSP documents when a Java type is renamed
  */
-public class JSPTypeRenameParticipant extends RenameParticipant {
+public class JSPTypeRenameParticipant extends JSPRenameParticipant {
 
-	private IType fType = null;
 	
 	/**
+	 * Initializes the name of this participant to the name of the {@link IType}
+	 * 
 	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
 	 */
 	protected boolean initialize(Object element) {
+		boolean success = false;
 		if(element instanceof IType) {
-			this.fType = (IType) element;
-			return true;
+			super.fName = ((IType)element).getElementName();
+			success = true;
 		}
-		return false;
-	}
-	
-	/**
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
-	 */
-	public String getName() {
-		String name = ""; //$NON-NLS-1$
-		if(this.fType != null) {
-			try {
-				name = this.fType.getSource();
-			} catch (JavaModelException e) {
-				Logger.logException(e);
-			}
-		}
-		return name;
+		return success;
 	}
 
 	/**
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+	 * @return a {@link JSPTypeRenameRequestor}
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#getSearchRequestor(org.eclipse.jdt.core.IJavaElement, java.lang.String)
 	 */
-	public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
-		// TODO Auto-generated method stub
-		return null;
+	protected BasicRefactorSearchRequestor getSearchRequestor(IJavaElement element, String newName) {
+		
+		BasicRefactorSearchRequestor searchRequestor = null;
+		
+		if(isLegalElementType(element)) {
+			searchRequestor = new JSPTypeRenameRequestor((IType)element, newName);
+		}
+		
+		return searchRequestor;
 	}
 
 	/**
-	 * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
+	 * <p>Legal types are: 
+	 * <ul><li>{@link IType}</li></ul></p>
+
+	 * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameParticipant#isLegalElementType(org.eclipse.jdt.core.IJavaElement)
 	 */
-	public Change createChange(IProgressMonitor pm) throws CoreException {
-		Change[] changes =  JSPTypeRenameChange.createChangesFor(fType, getArguments().getNewName());
-		CompositeChange multiChange = null;
-		if(changes.length > 0)
-			multiChange = new CompositeChange(JSPUIMessages.JSP_changes, changes); //$NON-NLS-1$
-		return multiChange;
+	protected boolean isLegalElementType(IJavaElement element) {
+		return (element instanceof IType);
 	}
-	
-	
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameRequestor.java
index cff180c..a341753 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameRequestor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameRequestor.java
@@ -12,6 +12,7 @@
 
 import java.text.MessageFormat;
 
+import org.eclipse.jdt.core.IJavaElement;
 import org.eclipse.jdt.core.IType;
 import org.eclipse.jdt.core.search.SearchMatch;
 import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
@@ -38,13 +39,18 @@
 		String renameText = getNewName();
 		
 		String pkg = getType().getPackageFragment().getElementName();
+		IJavaElement parent = getType().getParent();
+		String parentName = (parent != null) ? parent.getElementName() : null;
 		JSPTranslation trans = searchDoc.getJspTranslation();
 		String matchText = trans.getJavaText().substring(javaMatch.getOffset(), javaMatch.getOffset() + javaMatch.getLength());
 		
 		// if it's an import or jsp:useBean or fully qualified type, we need to add the package name as well
-		if(trans.isImport(javaMatch.getOffset()) || /*trans.isUseBean(javaMatch.getOffset()) ||*/ isFullyQualified(matchText)) {
+		// else if starts with parent name such as "MyClass.Enum" then need to add the parent name as well
+		if(trans.isImport(javaMatch.getOffset()) || isFullyQualified(matchText)) {
 			if(!pkg.equals("")) //$NON-NLS-1$
 				renameText = pkg + "." + renameText; //$NON-NLS-1$
+		} else if(parentName != null && matchText.startsWith(parentName)) {
+			renameText = parentName + "." + renameText; //$NON-NLS-1$
 		}
 		return renameText;
 	}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/RenameElementHandler.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/RenameElementHandler.java
index 7d054c2..1c1b962 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/RenameElementHandler.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/RenameElementHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -67,10 +67,13 @@
 	
 	private IJavaElement getSelectedElement() {
 		IJavaElement element = null;
-		if (fEditor instanceof ITextEditor) {
-			IJavaElement[] elements = JSPJavaSelectionProvider.getSelection((ITextEditor)fEditor);
-			if (elements.length == 1)
-				element = elements[0];
+		if (fEditor != null) {
+			ITextEditor editor = (ITextEditor) ((fEditor instanceof ITextEditor) ? fEditor : fEditor.getAdapter(ITextEditor.class));
+			if (editor != null) {
+				IJavaElement[] elements = JSPJavaSelectionProvider.getSelection(editor);
+				if (elements.length == 1)
+					element = elements[0];
+			}
 		}
 		return element;
 	}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesActionDelegate.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesActionDelegate.java
index 2eaeec0..8897deb 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesActionDelegate.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesActionDelegate.java
@@ -29,11 +29,8 @@
 			fProcessors = new ArrayList();
 			HTMLFindOccurrencesProcessor htmlProcessor = new HTMLFindOccurrencesProcessor();
 			fProcessors.add(htmlProcessor);
-//			 temporary, workaround to disable function, since using the function 
-//			 can easily cause deadlock to occur.
-//					 See https://bugs.eclipse.org/bugs/show_bug.cgi?id=103662
-//			JSPFindOccurrencesProcessor jspProcessor = new JSPFindOccurrencesProcessor();
-//			fProcessors.add(jspProcessor);
+			JSPFindOccurrencesProcessor jspProcessor = new JSPFindOccurrencesProcessor();
+			fProcessors.add(jspProcessor);
 		}
 		return fProcessors;
 	}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java
index 1de8c3d..50fff8f 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java
@@ -22,9 +22,12 @@
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
 import org.eclipse.jst.jsp.core.text.IJSPPartitions;
 import org.eclipse.search.ui.ISearchQuery;
+import org.eclipse.search.ui.NewSearchUI;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
@@ -35,6 +38,45 @@
  */
 public class JSPFindOccurrencesProcessor extends FindOccurrencesProcessor {
 
+	public boolean findOccurrences(IDocument document, ITextSelection textSelection, IFile file) {
+		boolean findOccurrences = false;
+
+		// determine if action should be enabled or not
+		if (document instanceof IStructuredDocument) {
+			IStructuredDocument structuredDocument = (IStructuredDocument) document;
+			IStructuredDocumentRegion sdRegion = structuredDocument.getRegionAtCharacterOffset(textSelection.getOffset());
+			if (sdRegion != null) {
+				ITextRegion r = sdRegion.getRegionAtCharacterOffset(textSelection.getOffset());
+				if (r != null) {
+					String type = r.getType();
+					if (enabledForRegionType(type)) {
+						String matchText = sdRegion.getText(r);
+
+						if (matchText != null && type != null) {
+							JSPSearchQuery searchQuery = (JSPSearchQuery) getSearchQuery(file, structuredDocument, matchText, type, textSelection);
+							findOccurrences = true;
+							if (searchQuery != null) {
+								if(searchQuery.getSearchText() == null || searchQuery.getSearchText().length() == 0)
+									findOccurrences = false;
+								else
+								{
+									// first of all activate the view
+									NewSearchUI.activateSearchResultView();
+									
+									if (searchQuery.canRunInBackground())
+										NewSearchUI.runQueryInBackground(searchQuery);
+									else
+										NewSearchUI.runQueryInForeground(null, searchQuery);
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+		return findOccurrences;
+	}
+	
 	protected String[] getPartitionTypes() {
 		return new String[]{IJSPPartitions.JSP_DEFAULT, IJSPPartitions.JSP_CONTENT_JAVA};
 	}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPOccurrencesSearchResult.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPOccurrencesSearchResult.java
index f1d4f8e..e39e4be 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPOccurrencesSearchResult.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPOccurrencesSearchResult.java
@@ -24,6 +24,6 @@
 	}
 	
 	public Match[] getMatches() {
-		return ((JSPSearchQuery)getQuery()).getMatches();
+		return super.getMatches();
 	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchQuery.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchQuery.java
index af8ca11..15ef838 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchQuery.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchQuery.java
@@ -10,6 +10,8 @@
  *******************************************************************************/
 package org.eclipse.jst.jsp.ui.internal.java.search;
 
+import java.text.MessageFormat;
+
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
@@ -18,8 +20,6 @@
 import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope;
 import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
 import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.search.ui.ISearchResult;
 import org.eclipse.wst.sse.ui.internal.search.BasicSearchQuery;
 
 /**
@@ -34,6 +34,7 @@
 	
 	public JSPSearchQuery(IFile file, IJavaElement element) {
 		super(file);
+		super.setResult(new JSPOccurrencesSearchResult(this));
 		this.fElement = element;
 	}
 	
@@ -47,9 +48,6 @@
 	}
 	
 	protected IStatus doQuery() {
-		
-		clearMatches();
-		
 		IStatus status = Status.OK_STATUS;
 		try {
 			JSPSearchSupport support = JSPSearchSupport.getInstance();
@@ -73,8 +71,9 @@
 	 * @see org.eclipse.search.ui.ISearchQuery#getLabel()
 	 */
 	public String getLabel() {
-		String[] args = {getSearchText(), getOccurrencesCountText(), getFilename()};
-		return NLS.bind(JSPUIMessages.OccurrencesSearchQuery_0, args);
+		String label = JSPUIMessages.OccurrencesSearchQuery_0; //$NON-NLS-1$
+		String[] args = {getSearchText(), "" + super.getMatchCount(), getFilename()};
+		return MessageFormat.format(label, args);
 	}
 
 	private String getFilename() {
@@ -83,15 +82,11 @@
 			filename = getFile().getName();
 		return filename;
 	}
-	
-	private String getOccurrencesCountText() {
-		String count = ""; //$NON-NLS-1$
-		// pa_TODO make dynamic
-		return count;
-	}
 
 	protected String getSearchText() {
-		return fElement.getElementName();
+		if(fElement != null)
+			return fElement.getElementName();
+		return "";
 	}
 	
 	public boolean canRerun() {
@@ -105,13 +100,4 @@
 	public boolean canRunInBackground() {
 		return true;
 	}
-
-	/**
-	 * @see org.eclipse.search.ui.ISearchQuery#getSearchResult()
-	 */
-	public ISearchResult getSearchResult() {
-		
-		return new JSPOccurrencesSearchResult(this);
-	}
-
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPQueryParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPQueryParticipant.java
index c257ee9..399f27a 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPQueryParticipant.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPQueryParticipant.java
@@ -24,7 +24,9 @@
 import org.eclipse.jdt.ui.search.QuerySpecification;
 import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope;
 import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
 import org.eclipse.jst.jsp.ui.internal.java.search.JSPSearchRequestor;
+import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
 
 /**
  * @author pavery 
@@ -42,41 +44,43 @@
 	 */
 	public void search(ISearchRequestor requestor, QuerySpecification querySpecification, IProgressMonitor monitor) throws CoreException {
 		
-		//indexIfNeeded();
-		
-		// do search based on the particular Java query
-		if(querySpecification instanceof ElementQuerySpecification) {
-			// element search (eg. from global find references in Java file)
-			ElementQuerySpecification elementQuery = (ElementQuerySpecification)querySpecification;
-			IJavaElement element = elementQuery.getElement();
+		if(shouldSupplyJSPSearchResultsToJavaSearch()) {
+			//indexIfNeeded();
 			
-			if(DEBUG)
-				System.out.println("JSP Query Participant searching on ELEMENT: " + element); //$NON-NLS-1$
-			
-			SearchRequestor jspRequestor = new JSPSearchRequestor(requestor);
-			
-			// pa_TODO need to adapt JavaSearchScope to a JSPSearchScope
-			JSPSearchSupport.getInstance().search(element, new JSPSearchScope(), jspRequestor);
-			
-		}
-		else if(querySpecification instanceof PatternQuerySpecification) {
-			
-			// pattern search (eg. from Java search page)
-			PatternQuerySpecification patternQuery = (PatternQuerySpecification)querySpecification;
-			String pattern = patternQuery.getPattern();
-			
-			if(DEBUG)
-				System.out.println("JSP Query Participant searching on PATTERN: " + pattern); //$NON-NLS-1$
-			
-			SearchRequestor jspRequestor = new JSPSearchRequestor(requestor);
-			
-			JSPSearchSupport.getInstance().search(pattern, 
-													new JSPSearchScope(), 
-													patternQuery.getSearchFor(), 
-													patternQuery.getLimitTo(), 
-													SearchPattern.R_PATTERN_MATCH, 
-													false, 
-													jspRequestor);
+			// do search based on the particular Java query
+			if(querySpecification instanceof ElementQuerySpecification) {
+				// element search (eg. from global find references in Java file)
+				ElementQuerySpecification elementQuery = (ElementQuerySpecification)querySpecification;
+				IJavaElement element = elementQuery.getElement();
+				
+				if(DEBUG)
+					System.out.println("JSP Query Participant searching on ELEMENT: " + element); //$NON-NLS-1$
+				
+				SearchRequestor jspRequestor = new JSPSearchRequestor(requestor);
+				
+				// pa_TODO need to adapt JavaSearchScope to a JSPSearchScope
+				JSPSearchSupport.getInstance().search(element, new JSPSearchScope(), jspRequestor);
+				
+			}
+			else if(querySpecification instanceof PatternQuerySpecification) {
+				
+				// pattern search (eg. from Java search page)
+				PatternQuerySpecification patternQuery = (PatternQuerySpecification)querySpecification;
+				String pattern = patternQuery.getPattern();
+				
+				if(DEBUG)
+					System.out.println("JSP Query Participant searching on PATTERN: " + pattern); //$NON-NLS-1$
+				
+				SearchRequestor jspRequestor = new JSPSearchRequestor(requestor);
+				
+				JSPSearchSupport.getInstance().search(pattern, 
+														new JSPSearchScope(), 
+														patternQuery.getSearchFor(), 
+														patternQuery.getLimitTo(), 
+														SearchPattern.R_PATTERN_MATCH, 
+														false, 
+														jspRequestor);
+			}
 		}
 	}
 
@@ -94,5 +98,9 @@
 	public IMatchPresentation getUIParticipant() {
 		return new JSPMatchPresentation();
 	}
+	
+	private boolean shouldSupplyJSPSearchResultsToJavaSearch() {
+		return JSPUIPlugin.getDefault().getPreferenceStore().getBoolean(JSPUIPreferenceNames.SUPPLY_JSP_SEARCH_RESULTS_TO_JAVA_SEARCH);
+	}
 
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPCompletionProposalCategoriesConfiguration.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPCompletionProposalCategoriesConfiguration.java
new file mode 100644
index 0000000..24b57c4
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPCompletionProposalCategoriesConfiguration.java
@@ -0,0 +1,78 @@
+package org.eclipse.jst.jsp.ui.internal.preferences;
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration;
+
+/**
+ * <p>The readable and writable completion proposal categories configuration
+ * for the JSP content type</p>
+ */
+public class JSPCompletionProposalCategoriesConfiguration extends AbstractCompletionProposalCategoriesConfiguration {
+
+	/** the ID of the preference page where users can change the preferences */
+	private static final String PREFERENCES_PAGE_ID = "org.eclipse.wst.sse.ui.preferences.jsp.contentassist"; //$NON-NLS-1$
+	
+	/**
+	 * <p>Creates the configuration</p>
+	 */
+	public JSPCompletionProposalCategoriesConfiguration() {
+		//nothing to do.
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getPreferenceStore()
+	 */
+	protected IPreferenceStore getPreferenceStore() {
+		return JSPUIPlugin.getDefault().getPreferenceStore();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#hasAssociatedPropertiesPage()
+	 */
+	public boolean hasAssociatedPropertiesPage() {
+		return true;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#getPropertiesPageID()
+	 */
+	public String getPropertiesPageID() {
+		return PREFERENCES_PAGE_ID;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnDefaultPagePrefKey()
+	 */
+	protected String getShouldNotDisplayOnDefaultPagePrefKey() {
+		return JSPUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnOwnPagePrefKey()
+	 */
+	protected String getShouldNotDisplayOnOwnPagePrefKey() {
+		return JSPUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE;
+	}
+
+	protected String getPageSortOrderPrefKey() {
+		return JSPUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getDefaultPageSortOrderPrefKey()
+	 */
+	protected String getDefaultPageSortOrderPrefKey() {
+		return JSPUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceInitializer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceInitializer.java
index 447efb3..e3c663d 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceInitializer.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceInitializer.java
@@ -2,9 +2,10 @@
 
 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
 import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.resource.ColorRegistry;
 import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
 import org.eclipse.jst.jsp.ui.internal.style.IStyleConstantsJSP;
+import org.eclipse.ui.PlatformUI;
 import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
 import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
 import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
@@ -21,6 +22,7 @@
 	 */
 	public void initializeDefaultPreferences() {
 		IPreferenceStore store = JSPUIPlugin.getDefault().getPreferenceStore();
+		ColorRegistry registry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
 
 		// setting the same as HTML
 		store.setDefault(JSPUIPreferenceNames.AUTO_PROPOSE, true);
@@ -29,10 +31,10 @@
 		// JSP Style Preferences
 		String NOBACKGROUNDBOLD = " | null | false"; //$NON-NLS-1$
 		String JUSTITALIC = " | null | false | true"; //$NON-NLS-1$
-		String styleValue = ColorHelper.getColorString(127, 0, 127) + NOBACKGROUNDBOLD;
+		String styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_ATTRIBUTE_NAME, 127, 0, 127) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, styleValue);
 
-		styleValue = ColorHelper.getColorString(42, 0, 255) + JUSTITALIC;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, 42, 0, 255) + JUSTITALIC;
 		store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, styleValue);
 
 		styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
@@ -40,17 +42,18 @@
 		// specified value is black; leaving as widget default
 		store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS, styleValue);
 
-		styleValue = ColorHelper.getColorString(63, 95, 191) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.COMMENT_BORDER, 63, 95, 191) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.COMMENT_BORDER, styleValue);
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.COMMENT_TEXT, 63, 95, 191) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.COMMENT_TEXT, styleValue);
 
-		styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.TAG_BORDER, styleValue);
 
-		styleValue = ColorHelper.getColorString(63, 127, 127) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_NAME, 63, 127, 127) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.TAG_NAME, styleValue);
 
-		styleValue = ColorHelper.getColorString(191, 95, 63) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsHTML.SCRIPT_AREA_BORDER, 191, 95, 63) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsHTML.SCRIPT_AREA_BORDER, styleValue);
 
 		styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
@@ -59,16 +62,43 @@
 		// set default new jsp file template to use in new file wizard
 		/*
 		 * Need to find template name that goes with default template id (name
-		 * may change for differnt language)
+		 * may change for different language)
 		 */
-		String templateName = ""; //$NON-NLS-1$
-		Template template = JSPUIPlugin.getDefault().getTemplateStore().findTemplateById("org.eclipse.jst.jsp.ui.templates.jsphtml"); //$NON-NLS-1$
-		if (template != null)
-			templateName = template.getName();
-		store.setDefault(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
+		store.setDefault(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_ID, "org.eclipse.jst.jsp.ui.templates.jsphtml"); //$NON-NLS-1$
+		
+		// set default new jsp tag file template to use in new tag file wizard
+		store.setDefault(JSPUIPreferenceNames.NEW_TAG_FILE_TEMPLATE_ID, "org.eclipse.jst.jsp.ui.templates.simpletag"); //$NON-NLS-1$
 		
 		store.setDefault(JSPUIPreferenceNames.TYPING_COMPLETE_EL_BRACES, true);
 		store.setDefault(JSPUIPreferenceNames.TYPING_COMPLETE_SCRIPTLETS, true);
+		store.setDefault(JSPUIPreferenceNames.TYPING_COMPLETE_COMMENTS, true);
+		store.setDefault(JSPUIPreferenceNames.SUPPLY_JSP_SEARCH_RESULTS_TO_JAVA_SEARCH, true);
+		store.setDefault(JSPUIPreferenceNames.TYPING_CLOSE_STRINGS, true);
+		store.setDefault(JSPUIPreferenceNames.TYPING_CLOSE_BRACKETS, true);
+		
+		// Defaults for Content Assist preference page
+		store.setDefault(JSPUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE, "");
+		store.setDefault(JSPUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE, "");
+		store.setDefault(JSPUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER,
+				"org.eclipse.wst.html.ui.proposalCategory.htmlTags\0" +
+				"org.eclipse.wst.xml.ui.proposalCategory.xmlTags\0" +
+				"org.eclipse.wst.css.ui.proposalCategory.css\0" +
+				"org.eclipse.jst.jsp.ui.proposalCategory.jsp\0" +
+				"org.eclipse.jst.jsp.ui.proposalCategory.jspJava\0" +
+				"org.eclipse.jst.jsp.ui.proposalCategory.jspTemplates\0" +
+				"org.eclipse.wst.html.ui.proposalCategory.htmlTemplates\0" +
+				"org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates\0" +
+				"org.eclipse.wst.css.ui.proposalCategory.cssTemplates");
+		store.setDefault(JSPUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER,
+				"org.eclipse.jst.jsp.ui.proposalCategory.jspTemplates\0" +
+				"org.eclipse.wst.html.ui.proposalCategory.htmlTemplates\0" +
+				"org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates\0" +
+				"org.eclipse.wst.css.ui.proposalCategory.cssTemplates\0" +
+				"org.eclipse.wst.html.ui.proposalCategory.htmlTags\0" +
+				"org.eclipse.wst.xml.ui.proposalCategory.xmlTags\0" +
+				"org.eclipse.jst.jsp.ui.proposalCategory.jsp\0" +
+				"org.eclipse.jst.jsp.ui.proposalCategory.jspJava\0" +
+				"org.eclipse.wst.css.ui.proposalCategory.css");
 	}
 
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceNames.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceNames.java
index fb67d1a..f0c1788 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceNames.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceNames.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -62,7 +62,29 @@
 	 * </p>
 	 */
 	public static final String NEW_FILE_TEMPLATE_NAME = "newFileTemplateName"; //$NON-NLS-1$
-	
+
+	/**
+	 * The initial template ID to be used in the new JSP file wizard. In the absence
+	 * of {@link NEW_FILE_TEMPLATE_NAME}, this ID is used to find a template name
+	 */
+	public static final String NEW_FILE_TEMPLATE_ID = "newFileTemplateId"; //$NON-NLS-1$
+
+	/**
+	 * The key to store the last template name used in new JSP Tag file wizard.
+	 * Template name is stored instead of template id because user-created
+	 * templates do not have template ids.
+	 * <p>
+	 * Value is of type <code>String</code>.
+	 * </p>
+	 */
+	public static final String NEW_TAG_FILE_TEMPLATE_NAME = "newTagFileTemplateName"; //$NON-NLS-1$
+
+	/**
+	 * The initial template ID to be used in the new JSP file wizard. In the absence
+	 * of {@link NEW_FILE_TEMPLATE_NAME}, this ID is used to find a template name
+	 */
+	public static final String NEW_TAG_FILE_TEMPLATE_ID = "newTagFileTemplateId"; //$NON-NLS-1$
+
 	/**
 	 * The key to store the option for auto-completing EL braces after entering
 	 * <code>${</code>
@@ -80,4 +102,69 @@
 	 * </p>
 	 */
 	public static final String TYPING_COMPLETE_SCRIPTLETS = "typingCompleteScriptlets"; //$NON-NLS-1$
+	
+	/**
+	 * The key to store the option for auto-completing JSP comments after entering
+	 * <code>&lt;%--</code>
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_COMPLETE_COMMENTS = "typingCompleteComments"; //$NON-NLS-1$
+
+	/**
+	 * The key to store the option for auto-completing strings (" and ') while
+	 * typing.
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_CLOSE_STRINGS = "closeStrings"; //$NON-NLS-1$
+
+	/**
+	 * The key to store the option for auto-completing brackets ([ and () while
+	 * typing.
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_CLOSE_BRACKETS = "closeBrackets"; //$NON-NLS-1$
+
+	public static final String SUPPLY_JSP_SEARCH_RESULTS_TO_JAVA_SEARCH = "supplyJSPSearchResultsToJavaSearch"; //$NON-NLS-1$
+
+	/**
+	 * <p>preference key used for saving which categories should not display on the default page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>), ordered is ignored</p>
+	 */
+	public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE = "jsp_content_assist_display_on_default_page"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key used for saving which categories should not display on their own page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>), order is ignored</p>
+	 */
+	public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE = "jsp_content_assist_display_on_own_page"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key for saving the sort order of the categories when displaying them on their own page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>) in the desired sort order.</p>
+	 */
+	public static final String CONTENT_ASSIST_OWN_PAGE_SORT_ORDER= "jsp_content_assist_own_page_sort_order"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key for saving the sort order of the categories when displaying them on the default page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>) in the desired sort order.</p>
+	 */
+	public static final String CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER= "jsp_content_assist_default_page_sort_order"; //$NON-NLS-1$
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractPropertyPreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractPropertyPreferencePage.java
index 25b9311..3d9615b 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractPropertyPreferencePage.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractPropertyPreferencePage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -46,7 +46,6 @@
 import org.eclipse.ui.dialogs.PropertyPage;
 import org.eclipse.ui.model.WorkbenchLabelProvider;
 import org.eclipse.ui.views.navigator.ResourceSorter;
-import org.eclipse.wst.sse.core.internal.tasks.TaskTagPreferenceKeys;
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
 import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
 
@@ -99,7 +98,7 @@
 
 		if (getProject() != null) {
 			fEnableProjectSettings = new Button(checkLinkComposite, SWT.CHECK);
-			fEnableProjectSettings.setText(SSEUIMessages.EnableProjectSettings); //$NON-NLS-1$//$NON-NLS-2$
+			fEnableProjectSettings.setText(SSEUIMessages.EnableProjectSettings);
 			fEnableProjectSettings.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
 			boolean enabledForProject = createPreferenceScopes()[0].getNode(getPreferenceNodeQualifier()).getBoolean(getProjectSettingsKey(), false);
 			fEnableProjectSettings.setSelection(enabledForProject);
@@ -250,13 +249,13 @@
 		if (getProject() != null) {
 			if (isElementSettingsEnabled()) {
 				if (_debugPreferences) {
-					System.out.println(getClass().getName() + " setting " + TaskTagPreferenceKeys.TASK_TAG_PER_PROJECT + " (" + true + ") in scope " + preferenceScopes[0].getName() + ":" + preferenceScopes[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$  
+					System.out.println(getClass().getName() + " setting " + getProjectSettingsKey() + " (" + true + ") in scope " + preferenceScopes[0].getName() + ":" + preferenceScopes[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$  
 				}
 				preferenceScopes[0].getNode(getPreferenceNodeQualifier()).putBoolean(getProjectSettingsKey(), fEnableProjectSettings.getSelection());
 			}
 			else {
 				if (_debugPreferences) {
-					System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_PER_PROJECT + " from scope " + preferenceScopes[0].getName() + ":" + preferenceScopes[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+					System.out.println(getClass().getName() + " removing " + getProjectSettingsKey() + " from scope " + preferenceScopes[0].getName() + ":" + preferenceScopes[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 				}
 				preferenceScopes[0].getNode(getPreferenceNodeQualifier()).remove(getProjectSettingsKey());
 			}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractValidationSettingsPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractValidationSettingsPage.java
index b6aa10f..3d7d962 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractValidationSettingsPage.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractValidationSettingsPage.java
@@ -56,38 +56,39 @@
 
 	private List fCombos;
 	private List fExpandables;
-	
+
 	private SelectionListener fSelectionListener;
-	
+
 	private IPreferencesService fPreferencesService = null;
-	
+
 	private static final String SETTINGS_EXPANDED = "expanded"; //$NON-NLS-1$
-	
+
 	private ValidationFramework fValidation;
-	
+
 	private class ComboData {
 		private String fKey;
 		private int[] fSeverities;
 		private int fIndex;
-		
+		int originalSeverity = -2;
+
 		public ComboData(String key, int[] severities, int index) {
 			fKey = key;
 			fSeverities = severities;
 			fIndex = index;
 		}
-		
+
 		public String getKey() {
 			return fKey;
 		}
-		
+
 		public void setIndex(int index) {
 			fIndex = index;
 		}
-		
+
 		public int getIndex() {
 			return fIndex;
 		}
-		
+
 		/**
 		 * Sets the severity index based on <code>severity</code>.
 		 * If the severity doesn't exist, the index is set to -1.
@@ -95,22 +96,25 @@
 		 * @param severity the severity level
 		 */
 		public void setSeverity(int severity) {
-			for(int i = 0; fSeverities != null && i < fSeverities.length; i++) {
-				if(fSeverities[i] == severity) {
-					fIndex = i;
+			for (int i = 0; fSeverities != null && i < fSeverities.length; i++) {
+				if (fSeverities[i] == severity) {
+					setIndex(i);
 					return;
 				}
 			}
-			
-			fIndex = -1;
+
+			setIndex(-1);
 		}
-		
+
 		public int getSeverity() {
 			return (fIndex >= 0 && fSeverities != null && fIndex < fSeverities.length) ? fSeverities[fIndex] : -1;
 		}
-		
+
+		boolean isChanged() {
+			return fSeverities[fIndex] != originalSeverity;
+		}
 	}
-	
+
 	public AbstractValidationSettingsPage() {
 		super();
 		fCombos = new ArrayList();
@@ -118,7 +122,7 @@
 		fPreferencesService = Platform.getPreferencesService();
 		fValidation = ValidationFramework.getDefault();
 	}
-	
+
 	/**
 	 * Creates a Combo widget in the composite <code>parent</code>. The data
 	 * in the Combo is associated with <code>key</code>. The Combo data is
@@ -135,20 +139,20 @@
 	 * @return the generated combo box
 	 */
 	protected Combo addComboBox(Composite parent, String label, String key, int[] values, String[] valueLabels, int indent) {
-		GridData gd= new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1);
-		gd.horizontalIndent= indent;
-				
-		Label labelControl= new Label(parent, SWT.LEFT);
+		GridData gd = new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1);
+		gd.horizontalIndent = indent;
+
+		Label labelControl = new Label(parent, SWT.LEFT);
 		labelControl.setFont(JFaceResources.getDialogFont());
 		labelControl.setText(label);
 		labelControl.setLayoutData(gd);
-				
-		Combo comboBox= newComboControl(parent, key, values, valueLabels);
+
+		Combo comboBox = newComboControl(parent, key, values, valueLabels);
 		comboBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
 
 		return comboBox;
 	}
-	
+
 	/**
 	 * Creates a combo box and associates the combo data with the
 	 * combo box.
@@ -162,32 +166,34 @@
 	 */
 	protected Combo newComboControl(Composite composite, String key, int[] values, String[] valueLabels) {
 		ComboData data = new ComboData(key, values, -1);
-		
-		Combo comboBox= new Combo(composite, SWT.READ_ONLY);
+
+		Combo comboBox = new Combo(composite, SWT.READ_ONLY);
 		comboBox.setItems(valueLabels);
 		comboBox.setData(data);
 		comboBox.addSelectionListener(getSelectionListener());
 		comboBox.setFont(JFaceResources.getDialogFont());
-			
+
 		makeScrollableCompositeAware(comboBox);
-		
+
 		int severity = -1;
-		if(key != null)
+		if (key != null)
 			severity = fPreferencesService.getInt(getPreferenceNodeQualifier(), key, ValidationMessage.WARNING, createPreferenceScopes());
 
-		if(severity == ValidationMessage.ERROR || severity == ValidationMessage.WARNING || severity == ValidationMessage.IGNORE)
+		if (severity == ValidationMessage.ERROR || severity == ValidationMessage.WARNING || severity == ValidationMessage.IGNORE) {
 			data.setSeverity(severity);
-		
-		if(data.getIndex() >= 0)
+			data.originalSeverity = severity;
+		}
+
+		if (data.getIndex() >= 0)
 			comboBox.select(data.getIndex());
-		
+
 		fCombos.add(comboBox);
 		return comboBox;
 	}
-	
+
 	protected SelectionListener getSelectionListener() {
 		if (fSelectionListener == null) {
-			fSelectionListener= new SelectionListener() {
+			fSelectionListener = new SelectionListener() {
 				public void widgetDefaultSelected(SelectionEvent e) {}
 	
 				public void widgetSelected(SelectionEvent e) {
@@ -197,58 +203,60 @@
 		}
 		return fSelectionListener;
 	}
-	
+
 	protected void controlChanged(Widget widget) {
-		ComboData data= (ComboData) widget.getData();
+		ComboData data = (ComboData) widget.getData();
 		if (widget instanceof Combo) {
-			data.setIndex(((Combo)widget).getSelectionIndex());
-		} else {
+			data.setIndex(((Combo) widget).getSelectionIndex());
+		}
+		else {
 			return;
 		}
 	}
 
 	/*
 	 * (non-Javadoc)
+	 * 
 	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractSettingsPage#storeValues()
 	 */
 	protected void storeValues() {
-		if(fCombos == null || fCombos.size() == 0)
+		if (fCombos == null || fCombos.size() == 0)
 			return;
-		
+
 		Iterator it = fCombos.iterator();
-		
+
 		IScopeContext[] contexts = createPreferenceScopes();
 
-		while(it.hasNext()) {
-			ComboData data = (ComboData) ((Combo)it.next()).getData();
-			if(data.getKey() != null) {
+		while (it.hasNext()) {
+			ComboData data = (ComboData) ((Combo) it.next()).getData();
+			if (data.getKey() != null) {
 				contexts[0].getNode(getPreferenceNodeQualifier()).putInt(data.getKey(), data.getSeverity());
 			}
 		}
-		
-		for(int i = 0; i < contexts.length; i++) {
+
+		for (int i = 0; i < contexts.length; i++) {
 			try {
 				contexts[i].getNode(getPreferenceNodeQualifier()).flush();
 			}
 			catch (BackingStoreException e) {
-				
+
 			}
 		}
 	}
-	
+
 	protected ExpandableComposite getParentExpandableComposite(Control control) {
-		Control parent= control.getParent();
+		Control parent = control.getParent();
 		while (!(parent instanceof ExpandableComposite) && parent != null) {
-			parent= parent.getParent();
+			parent = parent.getParent();
 		}
 		if (parent instanceof ExpandableComposite) {
 			return (ExpandableComposite) parent;
 		}
 		return null;
 	}
-	
+
 	protected ExpandableComposite createStyleSection(Composite parent, String label, int nColumns) {
-		ExpandableComposite excomposite= new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
+		ExpandableComposite excomposite = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
 		excomposite.setText(label);
 		excomposite.setExpanded(false);
 		excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
@@ -262,7 +270,7 @@
 		makeScrollableCompositeAware(excomposite);
 		return excomposite;
 	}
-	
+
 	protected Composite createStyleSectionWithContentComposite(Composite parent, String label, int nColumns) {
 		ExpandableComposite excomposite = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
 		excomposite.setText(label);
@@ -283,39 +291,39 @@
 		excomposite.setClient(inner);
 		return inner;
 	}
-	
+
 	protected final void expandedStateChanged(ExpandableComposite expandable) {
-		ScrolledPageContent parentScrolledComposite= getParentScrolledComposite(expandable);
+		ScrolledPageContent parentScrolledComposite = getParentScrolledComposite(expandable);
 		if (parentScrolledComposite != null) {
 			parentScrolledComposite.reflow(true);
 		}
 	}
-	
+
 	private void makeScrollableCompositeAware(Control control) {
-		ScrolledPageContent parentScrolledComposite= getParentScrolledComposite(control);
+		ScrolledPageContent parentScrolledComposite = getParentScrolledComposite(control);
 		if (parentScrolledComposite != null) {
 			parentScrolledComposite.adaptChild(control);
 		}
 	}
-	
+
 	protected ScrolledPageContent getParentScrolledComposite(Control control) {
-		Control parent= control.getParent();
+		Control parent = control.getParent();
 		while (!(parent instanceof ScrolledPageContent) && parent != null) {
-			parent= parent.getParent();
+			parent = parent.getParent();
 		}
 		if (parent instanceof ScrolledPageContent) {
 			return (ScrolledPageContent) parent;
 		}
 		return null;
 	}
-	
+
 	protected void storeSectionExpansionStates(IDialogSettings section) {
-		for(int i = 0; i < fExpandables.size(); i++) {
+		for (int i = 0; i < fExpandables.size(); i++) {
 			ExpandableComposite comp = (ExpandableComposite) fExpandables.get(i);
 			section.put(SETTINGS_EXPANDED + String.valueOf(i), comp.isExpanded());
 		}
 	}
-	
+
 	protected void restoreSectionExpansionStates(IDialogSettings settings) {
 		for (int i= 0; i < fExpandables.size(); i++) {
 			ExpandableComposite excomposite= (ExpandableComposite) fExpandables.get(i);
@@ -326,19 +334,28 @@
 			}
 		}
 	}
-	
+
 	protected void resetSeverities() {
 		IEclipsePreferences defaultContext = new DefaultScope().getNode(getPreferenceNodeQualifier());
-		for(int i = 0; i < fCombos.size(); i++) {
-			ComboData data = (ComboData)((Combo)fCombos.get(i)).getData();
+		for (int i = 0; i < fCombos.size(); i++) {
+			ComboData data = (ComboData) ((Combo) fCombos.get(i)).getData();
 			int severity = defaultContext.getInt(data.getKey(), ValidationMessage.WARNING);
 			data.setSeverity(severity);
-			((Combo)fCombos.get(i)).select(data.getIndex());
+			((Combo) fCombos.get(i)).select(data.getIndex());
 		}
 	}
-	
-	protected abstract boolean shouldRevalidateOnSettingsChange();
-	
+
+	protected boolean shouldRevalidateOnSettingsChange() {
+		Iterator it = fCombos.iterator();
+
+		while (it.hasNext()) {
+			ComboData data = (ComboData) ((Combo) it.next()).getData();
+			if (data.isChanged())
+				return true;
+		}
+		return false;
+	}
+
 	public boolean performOk() {
 		if(super.performOk() && shouldRevalidateOnSettingsChange()) {
 			MessageBox mb = new MessageBox(this.getShell(), SWT.APPLICATION_MODAL | SWT.YES | SWT.NO | SWT.CANCEL | SWT.ICON_INFORMATION | SWT.RIGHT);
@@ -350,21 +367,23 @@
 				case SWT.CANCEL:
 					return false;
 				case SWT.YES:
+					storeValues();
 					ValidateJob job = new ValidateJob(HTMLUIMessages.Validation_jobName);
 					job.schedule();
 				case SWT.NO:
+					storeValues();
 				default:
 					return true;
 			}
 		}
-		return false;
+		return true;
 	}
-	
+
 	/**
 	 * Performs validation after validation preferences have been modified.
 	 */
 	private class ValidateJob extends Job {
-		
+
 		public ValidateJob(String name) {
 			super(name);
 		}
@@ -374,19 +393,19 @@
 			try {
 				IProject[] projects = null;
 				/* Changed preferences for a single project, only validate it */
-				if(getProject() != null)
-					projects = new IProject[] {getProject()};
+				if (getProject() != null)
+					projects = new IProject[]{getProject()};
 				/* Workspace-wide preferences changed */
 				else {
 					/* Get all of the projects in the workspace */
 					projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
 					IEclipsePreferences prefs = null;
 					List projectList = new ArrayList();
-					
+
 					/* Filter out projects that use project-specific settings or have been closed */
-					for(int i = 0; i < projects.length; i++) {
+					for (int i = 0; i < projects.length; i++) {
 						prefs = new ProjectScope(projects[i]).getNode(getPreferenceNodeQualifier());
-						if(projects[i].isAccessible() && !prefs.getBoolean(getProjectSettingsKey(), false))
+						if (projects[i].isAccessible() && !prefs.getBoolean(getProjectSettingsKey(), false))
 							projectList.add(projects[i]);
 					}
 					projects = (IProject[]) projectList.toArray(new IProject[projectList.size()]);
@@ -396,10 +415,10 @@
 			catch (CoreException ce) {
 				status = Status.CANCEL_STATUS;
 			}
-			
+
 			return status;
 		}
-		
+
 	}
-	
+
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPContentAssistPreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPContentAssistPreferencePage.java
new file mode 100644
index 0000000..a4d2dcf
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPContentAssistPreferencePage.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.preferences.ui;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.wst.sse.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposoalCatigoriesConfigurationRegistry;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
+import org.eclipse.wst.sse.ui.preferences.CodeAssistCyclingConfigurationBlock;
+import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter;
+
+/**
+ * <p>Defines the preference page for allowing the user to change the content
+ * assist preferences</p>
+ */
+public class JSPContentAssistPreferencePage extends AbstractPreferencePage implements
+		IWorkbenchPreferencePage {
+
+	private static final String JSP_CONTENT_TYPE_ID = "org.eclipse.jst.jsp.core.jspsource"; //$NON-NLS-1$
+	
+	/** configuration block for changing preference having to do with the content assist categories */
+	private CodeAssistCyclingConfigurationBlock fConfigurationBlock;
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+	 */
+	protected Control createContents(Composite parent) {
+		final Composite composite = super.createComposite(parent, 1);
+		
+		createContentsForCyclingGroup(composite);
+		
+		setSize(composite);
+		loadPreferences();
+		
+		return composite;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#performDefaults()
+	 */
+	protected void performDefaults() {
+		performDefaultsForCyclingGroup();
+
+		validateValues();
+		enableValues();
+
+		super.performDefaults();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#initializeValues()
+	 */
+	protected void initializeValues() {
+		initializeValuesForCyclingGroup();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#storeValues()
+	 */
+	protected void storeValues() {
+		storeValuesForCyclingGroup();
+	}
+	
+	/**
+	 * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
+	 */
+	protected IPreferenceStore doGetPreferenceStore() {
+		return JSPUIPlugin.getDefault().getPreferenceStore();
+	}
+	
+	/**
+	 * <p>Create the contents for the content assist cycling preference group</p>
+	 * @param parent {@link Composite} parent of the group
+	 */
+	private void createContentsForCyclingGroup(Composite parent) {
+		ICompletionProposalCategoriesConfigurationWriter configurationWriter = CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getWritableConfiguration(JSP_CONTENT_TYPE_ID);
+		
+		if(configurationWriter != null) {
+			fConfigurationBlock = new CodeAssistCyclingConfigurationBlock(JSP_CONTENT_TYPE_ID, configurationWriter);
+			fConfigurationBlock.createContents(parent, null);
+		} else {
+			Logger.log(Logger.ERROR, "There should be an ICompletionProposalCategoriesConfigurationWriter" + //$NON-NLS-1$
+					" specified for the JSP content type, but can't fine it, thus can't create user" + //$NON-NLS-1$
+					" preference block for editing proposal categories preferences."); //$NON-NLS-1$
+		}
+	}
+	
+	/**
+	 * <p>Store the values for the cycling group</p>
+	 */
+	private void storeValuesForCyclingGroup() {
+		if (fConfigurationBlock != null) {
+			fConfigurationBlock.storeValues();
+		}
+	}
+	
+	/**
+	 * <p>Initialize the values for the cycling group</p>
+	 */
+	private void initializeValuesForCyclingGroup() {
+		if(fConfigurationBlock != null) {
+			fConfigurationBlock.initializeValues();
+		}
+	}
+	
+	/**
+	 * <p>Load the defaults of the cycling group</p>
+	 */
+	private void performDefaultsForCyclingGroup() {
+		if(fConfigurationBlock != null) {
+			fConfigurationBlock.performDefaults();
+		}
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java
index f8abc65..1dd0425 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java
@@ -16,65 +16,97 @@
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
 import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
 import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;
+import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
+import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.html.ui.internal.preferences.ui.HTMLFilesPreferencePage;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage;
 
-public class JSPFilesPreferencePage extends HTMLFilesPreferencePage {
-	/*
-	 * (non-Javadoc)
+public class JSPFilesPreferencePage extends XMLFilesPreferencePage {
+	private Button fJSPSearchToJavaSearchButton;
+	
+	/**
+	 * <p><b>NOTE: </b>originally copied from {@link XMLFilesPreferencePage#createControl(Composite)}</p>
 	 * 
-	 * @see org.eclipse.wst.html.ui.preferences.ui.HTMLFilesPreferencePage#createContentsForLoadingGroup(org.eclipse.swt.widgets.Composite)
+	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
 	 */
-	protected void createContentsForLoadingGroup(Composite parent) {
-		// no loading preferences
+	protected Control createContents(Composite parent) {
+		Composite scrolledComposite = createScrolledComposite(parent);
+		createContentsForCreatingGroup(scrolledComposite);
+		createContentsForSearchGroup(scrolledComposite);
+
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(scrolledComposite, IHelpContextIds.JSP_PREFWEBX_FILES_HELPID);
+
+		setSize(scrolledComposite);
+		loadPreferences();
+
+		return scrolledComposite;
+	}
+	
+	/**
+	 * @param parent
+	 */
+	private void createContentsForSearchGroup(Composite parent) {
+		Group group = createGroup(parent, 1);
+		group.setText(JSPUIMessages.JSPFilesPreferencePage_Search_group);
+		fJSPSearchToJavaSearchButton = createCheckBox(group, JSPUIMessages.JSPFilesPreferencePage_Supply_JSP_search_to_Java_search);
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage#initializeValues()
+	 */
+	protected void initializeValues() {
+		super.initializeValues();
+		initCheckbox(fJSPSearchToJavaSearchButton, JSPUIPreferenceNames.SUPPLY_JSP_SEARCH_RESULTS_TO_JAVA_SEARCH);
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage#performDefaults()
+	 */
+	protected void performDefaults() {
+		super.performDefaults();
+		defaultCheckbox(fJSPSearchToJavaSearchButton, JSPUIPreferenceNames.SUPPLY_JSP_SEARCH_RESULTS_TO_JAVA_SEARCH);
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage#storeValues()
+	 */
+	protected void storeValues() {
+		super.storeValues();
+		getPreferenceStore().setValue(JSPUIPreferenceNames.SUPPLY_JSP_SEARCH_RESULTS_TO_JAVA_SEARCH,
+				(fJSPSearchToJavaSearchButton != null) ? fJSPSearchToJavaSearchButton.getSelection() : false);
+	}
+
+	/**
 	 * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
 	 */
 	protected IPreferenceStore doGetPreferenceStore() {
 		return JSPUIPlugin.getDefault().getPreferenceStore();
 	}
 
-	protected void doSavePreferenceStore() {
-		JSPCorePlugin.getDefault().savePluginPreferences(); // model
-	}
-
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage#getContentType()
+	 */
 	protected IContentType getContentType() {
 		return Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
 	}
 
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage#doSavePreferenceStore()
+	 */
+	protected void doSavePreferenceStore() {
+		JSPCorePlugin.getDefault().savePluginPreferences(); // model
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage#getModelPreferences()
+	 */
 	protected Preferences getModelPreferences() {
 		return JSPCorePlugin.getDefault().getPluginPreferences();
 	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.html.ui.preferences.ui.HTMLFilesPreferencePage#initializeValuesForLoadingGroup()
-	 */
-	protected void initializeValuesForLoadingGroup() {
-		// no loading preferences
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.html.ui.preferences.ui.HTMLFilesPreferencePage#performDefaultsForLoadingGroup()
-	 */
-	protected void performDefaultsForLoadingGroup() {
-		// no loading preferences
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.html.ui.preferences.ui.HTMLFilesPreferencePage#storeValuesForLoadingGroup()
-	 */
-	protected void storeValuesForLoadingGroup() {
-		// no loading preferences
-	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSyntaxColoringPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSyntaxColoringPage.java
index d7d8138..f2d7556 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSyntaxColoringPage.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSyntaxColoringPage.java
@@ -669,6 +669,7 @@
 			styles.add(IStyleConstantsXML.TAG_BORDER);
 			styles.add(IStyleConstantsXML.TAG_NAME);
 			styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
+			styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
 			styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
 			styles.add(IStyleConstantsXML.COMMENT_BORDER);
 			styles.add(IStyleConstantsXML.COMMENT_TEXT);
@@ -769,6 +770,7 @@
 		fContextToStyleMap.put(DOMRegionContext.XML_END_TAG_OPEN, IStyleConstantsXML.TAG_BORDER);
 		fContextToStyleMap.put(DOMRegionContext.XML_TAG_NAME, IStyleConstantsXML.TAG_NAME);
 		fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
+		fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS, IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
 		fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
 		fContextToStyleMap.put(DOMRegionContext.XML_TAG_CLOSE, IStyleConstantsXML.TAG_BORDER);
 		fContextToStyleMap.put(DOMRegionContext.XML_EMPTY_TAG_CLOSE, IStyleConstantsXML.TAG_BORDER);
@@ -802,6 +804,7 @@
 		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_BORDER, XMLUIMessages.Tag_Delimiters_UI_); // =
 		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_NAME, XMLUIMessages.Tag_Names_UI_); // =
 		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, XMLUIMessages.Attribute_Names_UI_); // =
+		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS, XMLUIMessages.Attribute_Equals_UI_);
 		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, XMLUIMessages.Attribute_Values_UI_); // =
 		fStyleToDescriptionMap.put(IStyleConstantsXML.ENTITY_REFERENCE, XMLUIMessages.Entity_Reference_UI_); //$NON-NLS-1$ = "Entity References"
 		fStyleToDescriptionMap.put(IStyleConstantsHTML.SCRIPT_AREA_BORDER, JSPUIMessages.JSP_Delimiters_UI_); //$NON-NLS-1$ = "JSP Delimiters"
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTemplatePreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTemplatePreferencePage.java
index 9d637a9..e5537ee 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTemplatePreferencePage.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTemplatePreferencePage.java
@@ -133,7 +133,7 @@
 		SourceViewer viewer = null;
 		String contentTypeID = ContentTypeIdForJSP.ContentTypeID_JSP;
 		viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
-		((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+		viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
 		IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(contentTypeID);
 		IDocument document = scratchModel.getStructuredDocument();
 		viewer.configure(viewerConfiguration);
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTypingPreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTypingPreferencePage.java
index 9db2d84..4605944 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTypingPreferencePage.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTypingPreferencePage.java
@@ -26,12 +26,16 @@
 
 	private Button fCloseBraces;
 	private Button fCloseScriptlets;
+	private Button fCloseComments;
+	private Button fCloseStrings;
+	private Button fCloseBrackets;
 	
 	protected Control createContents(Composite parent) {
 		Composite composite = super.createComposite(parent, 1);
 		
 		createAutoComplete(composite);
-		
+		createJavaGroup(composite);
+
 		setSize(composite);
 		loadPreferences();
 		
@@ -46,11 +50,25 @@
 		fCloseBraces = createCheckBox(group, JSPUIMessages.JSPTyping_Complete_Braces);
 		((GridData) fCloseBraces.getLayoutData()).horizontalSpan = 2;
 		
+		fCloseComments = createCheckBox(group, JSPUIMessages.JSPTyping_Complete_Comments);
+		((GridData) fCloseComments.getLayoutData()).horizontalSpan = 2;
+		
 		fCloseScriptlets = createCheckBox(group, JSPUIMessages.JSPTyping_Complete_Scriptlets);
 		((GridData) fCloseScriptlets.getLayoutData()).horizontalSpan = 2;
-		
 	}
-	
+
+	private void createJavaGroup(Composite parent) {
+		Group group = createGroup(parent, 2);
+
+		group.setText(JSPUIMessages.JSPTyping_Java_Code);
+
+		fCloseStrings = createCheckBox(group, JSPUIMessages.JSPTyping_Close_Strings);
+		((GridData) fCloseStrings.getLayoutData()).horizontalSpan = 2;
+
+		fCloseBrackets = createCheckBox(group, JSPUIMessages.JSPTyping_Close_Brackets);
+		((GridData) fCloseBrackets.getLayoutData()).horizontalSpan = 2;
+	}
+
 	public boolean performOk() {
 		boolean result = super.performOk();
 		
@@ -62,26 +80,25 @@
 	protected void initializeValues() {
 		initCheckbox(fCloseBraces, JSPUIPreferenceNames.TYPING_COMPLETE_EL_BRACES);
 		initCheckbox(fCloseScriptlets, JSPUIPreferenceNames.TYPING_COMPLETE_SCRIPTLETS);
+		initCheckbox(fCloseComments, JSPUIPreferenceNames.TYPING_COMPLETE_COMMENTS);
+		initCheckbox(fCloseStrings, JSPUIPreferenceNames.TYPING_CLOSE_STRINGS);
+		initCheckbox(fCloseBrackets, JSPUIPreferenceNames.TYPING_CLOSE_BRACKETS);
 	}
 	
 	protected void performDefaults() {
 		defaultCheckbox(fCloseBraces, JSPUIPreferenceNames.TYPING_COMPLETE_EL_BRACES);
 		defaultCheckbox(fCloseScriptlets, JSPUIPreferenceNames.TYPING_COMPLETE_SCRIPTLETS);
-	}
-	
-	private void initCheckbox(Button box, String key) {
-		if(box != null && key != null)
-			box.setSelection(getPreferenceStore().getBoolean(key));
-	}
-	
-	private void defaultCheckbox(Button box, String key) {
-		if(box != null && key != null)
-			box.setSelection(getPreferenceStore().getDefaultBoolean(key));
+		defaultCheckbox(fCloseComments, JSPUIPreferenceNames.TYPING_COMPLETE_COMMENTS);
+		defaultCheckbox(fCloseStrings, JSPUIPreferenceNames.TYPING_CLOSE_STRINGS);
+		defaultCheckbox(fCloseBrackets, JSPUIPreferenceNames.TYPING_CLOSE_BRACKETS);
 	}
 	
 	protected void storeValues() {
 		getPreferenceStore().setValue(JSPUIPreferenceNames.TYPING_COMPLETE_EL_BRACES, (fCloseBraces != null) ? fCloseBraces.getSelection() : false);
 		getPreferenceStore().setValue(JSPUIPreferenceNames.TYPING_COMPLETE_SCRIPTLETS, (fCloseScriptlets != null) ? fCloseScriptlets.getSelection() : false);
+		getPreferenceStore().setValue(JSPUIPreferenceNames.TYPING_COMPLETE_COMMENTS, (fCloseComments != null) ? fCloseComments.getSelection() : false);
+		getPreferenceStore().setValue(JSPUIPreferenceNames.TYPING_CLOSE_STRINGS, (fCloseStrings != null) ? fCloseStrings.getSelection() : false);
+		getPreferenceStore().setValue(JSPUIPreferenceNames.TYPING_CLOSE_BRACKETS, (fCloseBrackets != null) ? fCloseBrackets.getSelection() : false);
 	}
 	
 	protected IPreferenceStore doGetPreferenceStore() {
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPValidationPreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPValidationPreferencePage.java
index ba17159..01a27c9 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPValidationPreferencePage.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPValidationPreferencePage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@
 import org.eclipse.core.runtime.preferences.IScopeContext;
 import org.eclipse.jface.dialogs.IDialogSettings;
 import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.PixelConverter;
 import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
 import org.eclipse.jst.jsp.core.internal.preferences.JSPCorePreferenceNames;
 import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
@@ -37,7 +38,6 @@
 import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
 import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
 import org.eclipse.wst.sse.ui.internal.preferences.ui.ScrolledPageContent;
-import org.eclipse.wst.sse.ui.internal.util.PixelConverter;
 
 public class JSPValidationPreferencePage extends AbstractValidationSettingsPage {
 
@@ -60,6 +60,8 @@
 	private PixelConverter fPixelConverter;
 	private Button fValidateFragments;
 
+	private boolean fOriginalValidateFragments;
+
 	public JSPValidationPreferencePage() {
 		super();
 	}
@@ -115,7 +117,8 @@
 		fValidateFragments = createCheckBox(fragmentGroup, JSPUIMessages.JSPFilesPreferencePage_1);
 		PlatformUI.getWorkbench().getHelpSystem().setHelp(fValidateFragments, IHelpContextIds.JSP_PREFWEBX_FILES_HELPID);
 		IScopeContext[] contexts = createPreferenceScopes();
-		fValidateFragments.setSelection(contexts[0].getNode(getPreferenceNodeQualifier()).getBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, contexts[1].getNode(getPreferenceNodeQualifier()).getBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, true)));
+		fOriginalValidateFragments = contexts[0].getNode(getPreferenceNodeQualifier()).getBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, contexts[1].getNode(getPreferenceNodeQualifier()).getBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, true));
+		fValidateFragments.setSelection(fOriginalValidateFragments);
 	}
 
 	private Composite createValidationSection(Composite page) {
@@ -153,6 +156,7 @@
 		section = createStyleSectionWithContentComposite(composite, JSPUIMessages.VALIDATION_HEADER_CUSTOM_ACTIONS, nColumns);
 		addComboBox(section, JSPUIMessages.VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE, JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE, SEVERITIES, errorWarningIgnoreLabels, 0);
 		addComboBox(section, JSPUIMessages.VALIDATION_ACTIONS_SEVERITY_UNKNOWN_ATTRIBUTE, JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_UNKNOWN_ATTRIBUTE, SEVERITIES, errorWarningIgnoreLabels, 0);
+		addComboBox(section, JSPUIMessages.VALIDATION_ACTIONS_SEVERITY_UNEXPECTED_RTEXPRVALUE, JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_UNEXPECTED_RTEXPRVALUE, SEVERITIES, errorWarningIgnoreLabels, 0);
 		addComboBox(section, JSPUIMessages.VALIDATION_ACTIONS_SEVERITY_NON_EMPTY_INLINE_TAG, JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_NON_EMPTY_INLINE_TAG, SEVERITIES, errorWarningIgnoreLabels, 0);
 		addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_TEI_VALIDATION_MESSAGE, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_VALIDATION_MESSAGE, SEVERITIES, errorWarningIgnoreLabels, 0);
 		addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_TEI_CLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_CLASS_NOT_FOUND, SEVERITIES, errorWarningIgnoreLabels, 0);
@@ -247,19 +251,8 @@
 		super.performDefaults();
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractSettingsPage#performOk()
-	 */
-	public boolean performOk() {
-		boolean result = super.performOk();
-		storeValues();
-		return result;
-	}
-
 	protected boolean shouldRevalidateOnSettingsChange() {
-		return true;
+		return fOriginalValidateFragments != fValidateFragments.getSelection() || super.shouldRevalidateOnSettingsChange();
 	}
 
 	/*
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionAnnotationModelChanges.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionAnnotationModelChanges.java
deleted file mode 100644
index f1a58f1..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionAnnotationModelChanges.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.projection;
-
-import java.util.Map;
-
-import org.eclipse.jface.text.source.Annotation;
-import org.w3c.dom.Node;
-
-/**
- * Contains a set of projection model additions/deletions/modifications
- */
-class ProjectionAnnotationModelChanges {
-	// copies of this class located in:
-	// org.eclipse.wst.xml.ui.internal.projection
-	// org.eclipse.wst.css.ui.internal.projection
-	// org.eclipse.wst.html.ui.internal.projection
-	// org.eclipse.jst.jsp.ui.internal.projection
-	private Node fNode;
-	private Annotation[] fDeletions;
-	private Map fAdditions;
-	private Annotation[] fModifications;
-
-	public ProjectionAnnotationModelChanges(Node node, Annotation[] deletions, Map additions, Annotation[] modifications) {
-		fNode = node;
-		fDeletions = deletions;
-		fAdditions = additions;
-		fModifications = modifications;
-	}
-
-	public Map getAdditions() {
-		return fAdditions;
-	}
-
-	public Annotation[] getDeletions() {
-		return fDeletions;
-	}
-
-	public Annotation[] getModifications() {
-		return fModifications;
-	}
-
-	public Node getNode() {
-		return fNode;
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java
deleted file mode 100644
index d632a89..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Tom Turrell-Croft, left@ultrasis.com - [174307] Enable folding for div tags in JSP and HTML files
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.projection;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Node;
-
-public class ProjectionModelNodeAdapterFactoryHTML extends AbstractAdapterFactory {
-	// copies of this class located in:
-	// org.eclipse.wst.html.ui.internal.projection
-	// org.eclipse.jst.jsp.ui.internal.projection
-
-	/**
-	 * List of projection viewers currently associated with this projection
-	 * model node adapter factory.
-	 */
-	private HashMap fProjectionViewers;
-
-	public ProjectionModelNodeAdapterFactoryHTML(Object adapterKey, boolean registerAdapters) {
-		super(adapterKey, registerAdapters);
-	}
-
-	public ProjectionModelNodeAdapterFactoryHTML(Object adapterKey) {
-		super(adapterKey);
-	}
-
-	public ProjectionModelNodeAdapterFactoryHTML() {
-		this(ProjectionModelNodeAdapterHTML.class);
-	}
-
-	/**
-	 * Actually creates an adapter for the parent of target if target is the
-	 * "adapt-able" node
-	 */
-	protected INodeAdapter createAdapter(INodeNotifier target) {
-		if ((isActive()) && (target instanceof Node) && ((Node) target).getNodeType() == Node.ELEMENT_NODE) {
-			Node node = (Node) target;
-			if (isNodeProjectable(node)) {
-
-				// actually work with the parent node to listen for add,
-				// delete events
-				Node parent = node.getParentNode();
-				if (parent instanceof INodeNotifier) {
-					INodeNotifier parentNotifier = (INodeNotifier) parent;
-					ProjectionModelNodeAdapterHTML parentAdapter = (ProjectionModelNodeAdapterHTML) parentNotifier.getExistingAdapter(ProjectionModelNodeAdapterHTML.class);
-					if (parentAdapter == null) {
-						// create a new adapter for parent
-						parentAdapter = new ProjectionModelNodeAdapterHTML(this);
-						parentNotifier.addAdapter(parentAdapter);
-					}
-					// call update on parent because a new node has just been
-					// added
-					parentAdapter.updateAdapter(parent);
-				}
-			}
-		}
-
-		return null;
-	}
-
-	/**
-	 * Returns true if node is a node type able to fold
-	 * 
-	 * @param node
-	 * @return boolean true if node is projectable, false otherwise
-	 */
-	boolean isNodeProjectable(Node node) {
-		if (node.getNodeType() == Node.ELEMENT_NODE) {
-			String tagName = node.getNodeName();
-			// node is only projectable if it is head, body, script, style,
-			// table, ul, ol and div tags
-			if (HTML40Namespace.ElementName.HEAD.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.BODY.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.SCRIPT.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.STYLE.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.TABLE.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.UL.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.OL.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.DIV.equalsIgnoreCase(tagName))
-				return true;
-		}
-		return false;
-	}
-
-	/**
-	 * Return true if this factory is currently actively managing projection
-	 * 
-	 * @return
-	 */
-	boolean isActive() {
-		return (fProjectionViewers != null && !fProjectionViewers.isEmpty());
-	}
-
-	/**
-	 * Updates projection annotation model if document is not in flux.
-	 * Otherwise, queues up the changes to be applied when document is ready.
-	 * 
-	 * @param node
-	 * @param deletions
-	 * @param additions
-	 * @param modifications
-	 */
-	void queueAnnotationModelChanges(Node node, Annotation[] deletions, Map additions, Annotation[] modifications) {
-		queueAnnotationModelChanges(node, deletions, additions, modifications, null);
-	}
-
-	/**
-	 * Updates projection annotation model for a specific projection viewer if
-	 * document is not in flux. Otherwise, queues up the changes to be applied
-	 * when document is ready.
-	 * 
-	 * @param node
-	 * @param deletions
-	 * @param additions
-	 * @param modifications
-	 * @param viewer
-	 */
-	void queueAnnotationModelChanges(Node node, Annotation[] deletions, Map additions, Annotation[] modifications, ProjectionViewer viewer) {
-		// create a change object for latest change and add to queue
-		ProjectionAnnotationModelChanges newChange = new ProjectionAnnotationModelChanges(node, deletions, additions, modifications);
-		if (fProjectionViewers != null) {
-			if (viewer != null) {
-				ProjectionViewerInformation info = (ProjectionViewerInformation) fProjectionViewers.get(viewer);
-				if (info != null) {
-					info.queueAnnotationModelChanges(newChange);
-				}
-			}
-			else {
-				Iterator infos = fProjectionViewers.values().iterator();
-				while (infos.hasNext()) {
-					ProjectionViewerInformation info = (ProjectionViewerInformation) infos.next();
-					info.queueAnnotationModelChanges(newChange);
-				}
-			}
-		}
-	}
-
-	public void release() {
-		// go through every projectionviewer and call
-		// removeProjectionViewer(viewer);
-		if (fProjectionViewers != null) {
-			Iterator infos = fProjectionViewers.values().iterator();
-			while (infos.hasNext()) {
-				ProjectionViewerInformation info = (ProjectionViewerInformation) infos.next();
-				info.dispose();
-				infos.remove();
-			}
-			fProjectionViewers = null;
-		}
-		super.release();
-	}
-
-	/**
-	 * Adds viewer to list of projection viewers this factory is associated
-	 * with
-	 * 
-	 * @param viewer -
-	 *            assumes viewer's document and projection annotation model
-	 *            are not null
-	 */
-	void addProjectionViewer(ProjectionViewer viewer) {
-		// remove old entry if it exists
-		removeProjectionViewer(viewer);
-
-		if (fProjectionViewers == null) {
-			fProjectionViewers = new HashMap();
-		}
-
-		// create new object containing projection viewer and its info
-		ProjectionViewerInformation info = new ProjectionViewerInformation(viewer);
-		fProjectionViewers.put(viewer, info);
-		info.initialize();
-	}
-
-	/**
-	 * Removes the given viewer from the list of projection viewers this
-	 * factor is associated with
-	 * 
-	 * @param viewer
-	 */
-	void removeProjectionViewer(ProjectionViewer viewer) {
-		if (fProjectionViewers != null) {
-			// remove entry from list of viewers
-			ProjectionViewerInformation info = (ProjectionViewerInformation) fProjectionViewers.remove(viewer);
-			if (info != null) {
-				info.dispose();
-			}
-			// if removing last projection viewer, clear out everything
-			if (fProjectionViewers.isEmpty()) {
-				fProjectionViewers = null;
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryJSP.java
deleted file mode 100644
index 322f89a..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryJSP.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.projection;
-
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Node;
-
-public class ProjectionModelNodeAdapterFactoryJSP extends ProjectionModelNodeAdapterFactoryHTML {
-	public ProjectionModelNodeAdapterFactoryJSP() {
-		this(ProjectionModelNodeAdapterJSP.class);
-	}
-
-	public ProjectionModelNodeAdapterFactoryJSP(Object adapterKey, boolean registerAdapters) {
-		super(adapterKey, registerAdapters);
-	}
-
-	public ProjectionModelNodeAdapterFactoryJSP(Object adapterKey) {
-		super(adapterKey);
-	}
-
-	/**
-	 * Actually creates an adapter for the parent of target if target is the
-	 * "adapt-able" node
-	 */
-	protected INodeAdapter createAdapter(INodeNotifier target) {
-		if ((isActive()) && (target instanceof Node) && ((Node) target).getNodeType() == Node.ELEMENT_NODE) {
-			Node node = (Node) target;
-			if (isNodeProjectable(node)) {
-
-				// actually work with the parent node to listen for add,
-				// delete events
-				Node parent = node.getParentNode();
-				if (parent instanceof INodeNotifier) {
-					INodeNotifier parentNotifier = (INodeNotifier) parent;
-					ProjectionModelNodeAdapterJSP parentAdapter = (ProjectionModelNodeAdapterJSP) parentNotifier.getExistingAdapter(ProjectionModelNodeAdapterJSP.class);
-					if (parentAdapter == null) {
-						// create a new adapter for parent
-						parentAdapter = new ProjectionModelNodeAdapterJSP(this);
-						parentNotifier.addAdapter(parentAdapter);
-					}
-					// call update on parent because a new node has just been
-					// added
-					parentAdapter.updateAdapter(parent);
-				}
-			}
-		}
-
-		return null;
-	}
-
-	/**
-	 * Returns true if node is a node type able to fold
-	 * 
-	 * @param node
-	 * @return boolean true if node is projectable, false otherwise
-	 */
-	boolean isNodeProjectable(Node node) {
-		if (node.getNodeType() == Node.ELEMENT_NODE) {
-			String tagName = node.getNodeName();
-			// node is only projectable if it is jsp scriptlet tag
-			if (JSP11Namespace.ElementName.SCRIPTLET.equalsIgnoreCase(tagName))
-				return true;
-		}
-		return false;
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterHTML.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterHTML.java
deleted file mode 100644
index 8cf43ad..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterHTML.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.projection;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.w3c.dom.Node;
-
-/**
- * Updates projection annotation model with projection annotations for this
- * adapter node's children
- */
-public class ProjectionModelNodeAdapterHTML implements INodeAdapter {
-	// copies of this class located in:
-	// org.eclipse.wst.html.ui.internal.projection
-	// org.eclipse.jst.jsp.ui.internal.projection
-	private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.html.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	private class TagProjectionAnnotation extends ProjectionAnnotation {
-		private boolean fIsVisible = false; /* workaround for BUG85874 */
-		private Node fNode;
-
-		public TagProjectionAnnotation(Node node, boolean isCollapsed) {
-			super(isCollapsed);
-			fNode = node;
-		}
-
-		public Node getNode() {
-			return fNode;
-		}
-
-		public void setNode(Node node) {
-			fNode = node;
-		}
-
-		/**
-		 * Does not paint hidden annotations. Annotations are hidden when they
-		 * only span one line.
-		 * 
-		 * @see ProjectionAnnotation#paint(org.eclipse.swt.graphics.GC,
-		 *      org.eclipse.swt.widgets.Canvas,
-		 *      org.eclipse.swt.graphics.Rectangle)
-		 */
-		public void paint(GC gc, Canvas canvas, Rectangle rectangle) {
-			/* workaround for BUG85874 */
-			/*
-			 * only need to check annotations that are expanded because hidden
-			 * annotations should never have been given the chance to
-			 * collapse.
-			 */
-			if (!isCollapsed()) {
-				// working with rectangle, so line height
-				FontMetrics metrics = gc.getFontMetrics();
-				if (metrics != null) {
-					// do not draw annotations that only span one line and
-					// mark them as not visible
-					if ((rectangle.height / metrics.getHeight()) <= 1) {
-						fIsVisible = false;
-						return;
-					}
-				}
-			}
-			fIsVisible = true;
-			super.paint(gc, canvas, rectangle);
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.jface.text.source.projection.ProjectionAnnotation#markCollapsed()
-		 */
-		public void markCollapsed() {
-			/* workaround for BUG85874 */
-			// do not mark collapsed if annotation is not visible
-			if (fIsVisible)
-				super.markCollapsed();
-		}
-	}
-
-	// copies of this class located in:
-	// org.eclipse.wst.html.ui.internal.projection
-	// org.eclipse.jst.jsp.ui.internal.projection
-
-	ProjectionModelNodeAdapterFactoryHTML fAdapterFactory;
-	private Map fTagAnnotations = new HashMap();
-
-	public ProjectionModelNodeAdapterHTML(ProjectionModelNodeAdapterFactoryHTML factory) {
-		fAdapterFactory = factory;
-	}
-
-	/**
-	 * Create a projection position from the given node. Able to get
-	 * projection position if node isNodeProjectable.
-	 * 
-	 * @param node
-	 * @return null if no projection position possible, a Position otherwise
-	 */
-	private Position createProjectionPosition(Node node) {
-		Position pos = null;
-		if (fAdapterFactory.isNodeProjectable(node) && node instanceof IndexedRegion) {
-			// IDocument document =
-			// fAdapterFactory.getProjectionViewer().getDocument();
-			// if (document != null) {
-			IndexedRegion inode = (IndexedRegion) node;
-			int start = inode.getStartOffset();
-			int end = inode.getEndOffset();
-			if (start >= 0 && start < end) {
-				// region-based
-				// extra line when collapsed, but no region
-				// increase when add newline
-				pos = new Position(start, end - start);
-				// try {
-				// // line-based
-				// // extra line when collapsed, but no region
-				// // increase when add newline
-				// IRegion startLineRegion =
-				// document.getLineInformationOfOffset(start);
-				// IRegion endLineRegion =
-				// document.getLineInformationOfOffset(end);
-				// int startOffset = startLineRegion.getOffset();
-				// int endOffset = endLineRegion.getOffset() +
-				// endLineRegion.getLength();
-				// if (endOffset > startOffset) {
-				// pos = new Position(startOffset, endOffset -
-				// startOffset);
-				// }
-				//
-				// // line-based
-				// // no extra line when collapsed, but region increase
-				// // when add newline
-				// int startLine = document.getLineOfOffset(start);
-				// int endLine = document.getLineOfOffset(end);
-				// if (endLine + 1 < document.getNumberOfLines()) {
-				// int offset = document.getLineOffset(startLine);
-				// int endOffset = document.getLineOffset(endLine + 1);
-				// pos = new Position(offset, endOffset - offset);
-				// }
-				// }
-				// catch (BadLocationException x) {
-				// Logger.log(Logger.WARNING_DEBUG, null, x);
-				// }
-			}
-		}
-		// }
-		return pos;
-	}
-
-	/**
-	 * Find TagProjectionAnnotation for node in the current list of projection
-	 * annotations for this adapter
-	 * 
-	 * @param node
-	 * @return TagProjectionAnnotation
-	 */
-	private TagProjectionAnnotation getExistingAnnotation(Node node) {
-		TagProjectionAnnotation anno = null;
-
-		if ((node != null) && (!fTagAnnotations.isEmpty())) {
-			Iterator it = fTagAnnotations.keySet().iterator();
-			while (it.hasNext() && anno == null) {
-				TagProjectionAnnotation a = (TagProjectionAnnotation) it.next();
-				Node n = a.getNode();
-				if (node.equals(n)) {
-					anno = a;
-				}
-			}
-		}
-		return anno;
-	}
-
-	public boolean isAdapterForType(Object type) {
-		return type == ProjectionModelNodeAdapterHTML.class;
-	}
-
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		// check if folding is even enabled, if not, just ignore notifyChanged
-		// events
-		if (!fAdapterFactory.isActive()) {
-			return;
-		}
-
-		if ((eventType == INodeNotifier.STRUCTURE_CHANGED) && (notifier instanceof Node)) {
-			updateAdapter((Node) notifier);
-		}
-	}
-
-	/**
-	 * Update the projection annotation of all the nodes that are children of
-	 * node
-	 * 
-	 * @param node
-	 */
-	void updateAdapter(Node node) {
-		updateAdapter(node, null);
-	}
-
-	/**
-	 * Update the projection annotation of all the nodes that are children of
-	 * node and adds all projection annotations to viewer (for newly added
-	 * viewers)
-	 * 
-	 * @param node
-	 * @param viewer
-	 */
-	void updateAdapter(Node node, ProjectionViewer viewer) {
-		long start = System.currentTimeMillis();
-
-		Map additions = new HashMap();
-		Map projectionAnnotations = new HashMap();
-
-		// go through immediate child nodes and figure out projection
-		// model annotations
-		if (node != null) {
-			Node childNode = node.getFirstChild();
-			while (childNode != null) {
-				Position newPos = createProjectionPosition(childNode);
-				if (newPos != null) {
-					TagProjectionAnnotation newAnnotation = new TagProjectionAnnotation(childNode, false);
-					TagProjectionAnnotation existing = getExistingAnnotation(childNode);
-					if (existing == null) {
-						// add to map containing all annotations for this
-						// adapter
-						projectionAnnotations.put(newAnnotation, newPos);
-						// add to map containing annotations to add
-						additions.put(newAnnotation, newPos);
-					}
-					else {
-						// add to map containing all annotations for this
-						// adapter
-						projectionAnnotations.put(existing, newPos);
-						// remove from map containing annotations to delete
-						fTagAnnotations.remove(existing);
-					}
-				}
-				childNode = childNode.getNextSibling();
-			}
-
-			// in the end, want to delete anything leftover in old list, add
-			// everything in additions, and update everything in
-			// projectionAnnotations
-			ProjectionAnnotation[] oldList = null;
-			if (!fTagAnnotations.isEmpty()) {
-				oldList = (ProjectionAnnotation[]) fTagAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
-			}
-			ProjectionAnnotation[] modifyList = null;
-			if (!projectionAnnotations.isEmpty()) {
-				modifyList = (ProjectionAnnotation[]) projectionAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
-			}
-
-			// specifically add all annotations to viewer
-			if (viewer != null && !projectionAnnotations.isEmpty()) {
-				fAdapterFactory.queueAnnotationModelChanges(node, null, projectionAnnotations, null, viewer);
-			}
-
-			// only update when there is something to update
-			if ((oldList != null && oldList.length > 0) || (!additions.isEmpty()) || (modifyList != null && modifyList.length > 0))
-				fAdapterFactory.queueAnnotationModelChanges(node, oldList, additions, modifyList);
-		}
-
-		// save new list of annotations
-		fTagAnnotations = projectionAnnotations;
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			String nodeName = node != null ? node.getNodeName() : "null"; //$NON-NLS-1$
-			System.out.println("ProjectionModelNodeAdapterHTML.updateAdapter (" + nodeName + "):" + (end - start)); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterJSP.java
deleted file mode 100644
index a195368..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterJSP.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.projection;
-
-/**
- * Updates projection annotation model with projection annotations for this
- * adapter node's children
- */
-public class ProjectionModelNodeAdapterJSP extends ProjectionModelNodeAdapterHTML {
-	public ProjectionModelNodeAdapterJSP(ProjectionModelNodeAdapterFactoryJSP factory) {
-		super(factory);
-	}
-
-	public boolean isAdapterForType(Object type) {
-		return type == ProjectionModelNodeAdapterJSP.class;
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionViewerInformation.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionViewerInformation.java
deleted file mode 100644
index 5f84d1c..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionViewerInformation.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.projection;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-
-/**
- * Contains information about a projection viewer and also manages updating
- * the viewer's projection annotation model
- */
-class ProjectionViewerInformation {
-	// copies of this class located in:
-	// org.eclipse.wst.xml.ui.internal.projection
-	// org.eclipse.wst.css.ui.internal.projection
-	// org.eclipse.wst.html.ui.internal.projection
-	// org.eclipse.jst.jsp.ui.internal.projection
-
-	/**
-	 * Listens to document to be aware of when to update the projection
-	 * annotation model.
-	 */
-	private class DocumentListener implements IDocumentListener {
-		private ProjectionViewerInformation fInfo;
-
-		public DocumentListener(ProjectionViewerInformation info) {
-			fInfo = info;
-		}
-
-		public void documentAboutToBeChanged(DocumentEvent event) {
-			IDocument document = event.getDocument();
-			if (fInfo.getDocument() == document) {
-				fInfo.setIsDocumentChanging(true);
-			}
-		}
-
-		public void documentChanged(DocumentEvent event) {
-			// register a post notification replace so that projection
-			// annotation model will be updated after all documentChanged
-			// listeners have been notified
-			IDocument document = event.getDocument();
-			if (document instanceof IDocumentExtension && fInfo.getDocument() == document) {
-				if (fInfo.hasChangesQueued())
-					((IDocumentExtension) document).registerPostNotificationReplace(this, new PostDocumentChangedListener(fInfo));
-			}
-		}
-	}
-
-	/**
-	 * Essentially a post document changed listener because it is called after
-	 * documentchanged has been fired.
-	 */
-	private class PostDocumentChangedListener implements IDocumentExtension.IReplace {
-		private ProjectionViewerInformation fInfo;
-
-		public PostDocumentChangedListener(ProjectionViewerInformation info) {
-			fInfo = info;
-		}
-
-		public void perform(IDocument document, IDocumentListener owner) {
-			fInfo.applyAnnotationModelChanges();
-			fInfo.setIsDocumentChanging(false);
-		}
-	}
-
-	/**
-	 * Projection annotation model current associated with this projection
-	 * viewer
-	 */
-	private ProjectionAnnotationModel fProjectionAnnotationModel;
-	/**
-	 * Document currently associated with this projection viewer
-	 */
-	private IDocument fDocument;
-	/**
-	 * Listener to fProjectionViewer's document
-	 */
-	private IDocumentListener fDocumentListener;
-	/**
-	 * Indicates whether or not document is in the middle of changing
-	 */
-	private boolean fIsDocumentChanging = false;
-	/**
-	 * List of projection annotation model changes that need to be applied
-	 */
-	private List fQueuedAnnotationChanges;
-
-	public ProjectionViewerInformation(ProjectionViewer viewer) {
-		fDocument = viewer.getDocument();
-		fProjectionAnnotationModel = viewer.getProjectionAnnotationModel();
-	}
-
-	IDocument getDocument() {
-		return fDocument;
-	}
-
-	private List getQueuedAnnotationChanges() {
-		if (fQueuedAnnotationChanges == null) {
-			fQueuedAnnotationChanges = new ArrayList();
-		}
-		return fQueuedAnnotationChanges;
-	}
-
-	void setIsDocumentChanging(boolean changing) {
-		fIsDocumentChanging = changing;
-	}
-
-	private boolean isDocumentChanging() {
-		return fIsDocumentChanging;
-	}
-
-	/**
-	 * Applies the pending projection annotation model changes to the
-	 * projection annotation model.
-	 */
-	void applyAnnotationModelChanges() {
-		List queuedChanges = getQueuedAnnotationChanges();
-		// go through all the pending annotation changes and apply
-		// them to
-		// the projection annotation model
-		while (!queuedChanges.isEmpty()) {
-			ProjectionAnnotationModelChanges changes = (ProjectionAnnotationModelChanges) queuedChanges.remove(0);
-			try {
-				fProjectionAnnotationModel.modifyAnnotations(changes.getDeletions(), changes.getAdditions(), changes.getModifications());
-			}
-			catch (Exception e) {
-				// if anything goes wrong, log it be continue
-				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-			}
-		}
-	}
-
-	/**
-	 * Returns true if there are annotation changes queued up, false otherwise
-	 * 
-	 * @return boolean
-	 */
-	boolean hasChangesQueued() {
-		return !getQueuedAnnotationChanges().isEmpty();
-	}
-
-	/**
-	 * Updates projection annotation model if document is not in flux.
-	 * Otherwise, queues up the changes to be applied when document is ready.
-	 */
-	public void queueAnnotationModelChanges(ProjectionAnnotationModelChanges newChange) {
-		/*
-		 * future_TODO: maybe improve by checking if annotation projection
-		 * model change already exists for node. if so, throw out old change.
-		 */
-		getQueuedAnnotationChanges().add(newChange);
-
-		// if document isn't changing, go ahead and apply it
-		if (!isDocumentChanging()) {
-			applyAnnotationModelChanges();
-		}
-	}
-
-	public void initialize() {
-		// add document listener
-		if (fDocumentListener == null) {
-			fDocumentListener = new DocumentListener(this);
-		}
-		getDocument().addDocumentListener(fDocumentListener);
-	}
-
-	public void dispose() {
-		// remove document listener
-		if (fDocumentListener != null) {
-			getDocument().removeDocumentListener(fDocumentListener);
-		}
-
-		// clear out list of queued changes since it may no longer
-		// be accurate
-		if (fQueuedAnnotationChanges != null) {
-			fQueuedAnnotationChanges.clear();
-			fQueuedAnnotationChanges = null;
-		}
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/StructuredTextFoldingProviderJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/StructuredTextFoldingProviderJSP.java
deleted file mode 100644
index d4208c3..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/StructuredTextFoldingProviderJSP.java
+++ /dev/null
@@ -1,423 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.projection;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.jface.text.source.projection.IProjectionListener;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Updates the projection model of a structured model for JSP.
- */
-public class StructuredTextFoldingProviderJSP implements IStructuredTextFoldingProvider, IProjectionListener, ITextInputListener {
-	private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	private IDocument fDocument;
-	private ProjectionViewer fViewer;
-	private boolean fProjectionNeedsToBeEnabled = false;
-	/**
-	 * Maximum number of child nodes to add adapters to (limit for performance
-	 * sake)
-	 */
-	private final int MAX_CHILDREN = 10;
-	/**
-	 * Maximum number of sibling nodes to add adapters to (limit for
-	 * performance sake)
-	 */
-	private final int MAX_SIBLINGS = 1000;
-
-	/**
-	 * Adds an adapter to node and its children
-	 * 
-	 * @param node
-	 * @param childLevel
-	 */
-	private void addAdapterToNodeAndChildren(Node node, int childLevel) {
-		// stop adding initial adapters MAX_CHILDREN levels deep for
-		// performance sake
-		if (node instanceof INodeNotifier && childLevel < MAX_CHILDREN) {
-			INodeNotifier notifier = (INodeNotifier) node;
-
-			// try and get the adapter for the current node and update the
-			// adapter with projection information
-			ProjectionModelNodeAdapterJSP adapter = (ProjectionModelNodeAdapterJSP) notifier.getExistingAdapter(ProjectionModelNodeAdapterJSP.class);
-			if (adapter != null) {
-				adapter.updateAdapter(node, fViewer);
-			}
-			else {
-				// just call getadapter so the adapter is created and
-				// automatically initialized
-				notifier.getAdapterFor(ProjectionModelNodeAdapterJSP.class);
-			}
-			ProjectionModelNodeAdapterHTML adapter2 = (ProjectionModelNodeAdapterHTML) notifier.getExistingAdapter(ProjectionModelNodeAdapterHTML.class);
-			if (adapter2 != null) {
-				adapter2.updateAdapter(node);
-			}
-			else {
-				// just call getadapter so the adapter is created and
-				// automatically initialized
-				notifier.getAdapterFor(ProjectionModelNodeAdapterHTML.class);
-			}
-			int siblingLevel = 0;
-			Node nextChild = node.getFirstChild();
-			while (nextChild != null && siblingLevel < MAX_SIBLINGS) {
-				Node childNode = nextChild;
-				nextChild = childNode.getNextSibling();
-
-				addAdapterToNodeAndChildren(childNode, childLevel + 1);
-				++siblingLevel;
-			}
-		}
-	}
-
-	/**
-	 * Goes through every node and adds an adapter onto each for tracking
-	 * purposes
-	 */
-	private void addAllAdapters() {
-		long start = System.currentTimeMillis();
-
-		if (fDocument != null) {
-			IStructuredModel sModel = null;
-			try {
-				sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-				if (sModel != null) {
-					int startOffset = 0;
-					IndexedRegion startNode = sModel.getIndexedRegion(startOffset);
-					if (startNode instanceof Node) {
-						int siblingLevel = 0;
-						Node nextSibling = (Node) startNode;
-						while (nextSibling != null && siblingLevel < MAX_SIBLINGS) {
-							Node currentNode = nextSibling;
-							nextSibling = currentNode.getNextSibling();
-
-							addAdapterToNodeAndChildren(currentNode, 0);
-							++siblingLevel;
-						}
-					}
-				}
-			}
-			finally {
-				if (sModel != null) {
-					sModel.releaseFromRead();
-				}
-			}
-		}
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderJSP.addAllAdapters: " + (end - start)); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Get the ProjectionModelNodeAdapterFactoryHTML to use with this
-	 * provider.
-	 * 
-	 * @return ProjectionModelNodeAdapterFactoryHTML
-	 */
-	private ProjectionModelNodeAdapterFactoryHTML getAdapterFactoryHTML(boolean createIfNeeded) {
-		long start = System.currentTimeMillis();
-
-		ProjectionModelNodeAdapterFactoryHTML factory = null;
-		if (fDocument != null) {
-			IStructuredModel sModel = null;
-			try {
-				sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-				if (sModel != null) {
-					FactoryRegistry factoryRegistry = sModel.getFactoryRegistry();
-
-					// getting the projectionmodelnodeadapter for the first
-					// time
-					// so do some initializing
-					if (!factoryRegistry.contains(ProjectionModelNodeAdapterHTML.class) && createIfNeeded) {
-						ProjectionModelNodeAdapterFactoryHTML newFactory = new ProjectionModelNodeAdapterFactoryHTML();
-
-						// add factory to factory registry
-						factoryRegistry.addFactory(newFactory);
-
-						// add factory to propogating adapter
-						IDOMModel domModel = (IDOMModel) sModel;
-						Document document = domModel.getDocument();
-						PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class);
-						if (propagatingAdapter != null) {
-							propagatingAdapter.addAdaptOnCreateFactory(newFactory);
-						}
-					}
-
-					// try and get the factory
-					factory = (ProjectionModelNodeAdapterFactoryHTML) factoryRegistry.getFactoryFor(ProjectionModelNodeAdapterHTML.class);
-				}
-			}
-			finally {
-				if (sModel != null)
-					sModel.releaseFromRead();
-			}
-		}
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderJSP.getAdapterFactoryHTML: " + (end - start)); //$NON-NLS-1$
-		}
-		return factory;
-	}
-
-	/**
-	 * Get the ProjectionModelNodeAdapterFactoryJSP to use with this provider.
-	 * 
-	 * @return ProjectionModelNodeAdapterFactoryJSP
-	 */
-	private ProjectionModelNodeAdapterFactoryJSP getAdapterFactoryJSP(boolean createIfNeeded) {
-		long start = System.currentTimeMillis();
-
-		ProjectionModelNodeAdapterFactoryJSP factory = null;
-		if (fDocument != null) {
-			IStructuredModel sModel = null;
-			try {
-				sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-				if (sModel != null) {
-					FactoryRegistry factoryRegistry = sModel.getFactoryRegistry();
-
-					// getting the projectionmodelnodeadapter for the first
-					// time
-					// so do some initializing
-					if (!factoryRegistry.contains(ProjectionModelNodeAdapterJSP.class) && createIfNeeded) {
-						ProjectionModelNodeAdapterFactoryJSP newFactory = new ProjectionModelNodeAdapterFactoryJSP();
-
-						// add factory to factory registry
-						factoryRegistry.addFactory(newFactory);
-
-						// add factory to propogating adapter
-						IDOMModel domModel = (IDOMModel) sModel;
-						Document document = domModel.getDocument();
-						PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class);
-						if (propagatingAdapter != null) {
-							propagatingAdapter.addAdaptOnCreateFactory(newFactory);
-						}
-					}
-
-					// try and get the factory
-					factory = (ProjectionModelNodeAdapterFactoryJSP) factoryRegistry.getFactoryFor(ProjectionModelNodeAdapterJSP.class);
-				}
-			}
-			finally {
-				if (sModel != null)
-					sModel.releaseFromRead();
-			}
-		}
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderJSP.getAdapterFactoryJSP: " + (end - start)); //$NON-NLS-1$
-		}
-		return factory;
-	}
-
-	/**
-	 * Initialize this provider with the correct document. Assumes projection
-	 * is enabled. (otherwise, only install would have been called)
-	 */
-	public void initialize() {
-		if (!isInstalled())
-			return;
-
-		long start = System.currentTimeMillis();
-		// clear out old info
-		projectionDisabled();
-
-		fDocument = fViewer.getDocument();
-
-		// set projection viewer on new document's adapter factory
-		if (fViewer.getProjectionAnnotationModel() != null) {
-			ProjectionModelNodeAdapterFactoryJSP factory = getAdapterFactoryJSP(true);
-			if (factory != null) {
-				factory.addProjectionViewer(fViewer);
-			}
-			ProjectionModelNodeAdapterFactoryHTML factory2 = getAdapterFactoryHTML(true);
-			if (factory2 != null) {
-				factory2.addProjectionViewer(fViewer);
-			}
-
-			try {
-				// https://bugs.eclipse.org/bugs/show_bug.cgi?id=198304
-				// disable redraw while adding all adapters
-				fViewer.setRedraw(false);
-				addAllAdapters();
-			}
-			finally {
-				fViewer.setRedraw(true);
-			}
-		}
-		fProjectionNeedsToBeEnabled = false;
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderJSP.initialize: " + (end - start)); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Associate a ProjectionViewer with this IStructuredTextFoldingProvider
-	 * 
-	 * @param viewer -
-	 *            assumes not null
-	 */
-	public void install(ProjectionViewer viewer) {
-		// uninstall before trying to install new viewer
-		if (isInstalled()) {
-			uninstall();
-		}
-		fViewer = viewer;
-		fViewer.addProjectionListener(this);
-		fViewer.addTextInputListener(this);
-	}
-
-	private boolean isInstalled() {
-		return fViewer != null;
-	}
-
-	public void projectionDisabled() {
-		ProjectionModelNodeAdapterFactoryJSP factory = getAdapterFactoryJSP(false);
-		if (factory != null) {
-			factory.removeProjectionViewer(fViewer);
-		}
-		ProjectionModelNodeAdapterFactoryHTML factory2 = getAdapterFactoryHTML(false);
-		if (factory2 != null) {
-			factory2.removeProjectionViewer(fViewer);
-		}
-
-		// clear out all annotations
-		if (fViewer.getProjectionAnnotationModel() != null)
-			fViewer.getProjectionAnnotationModel().removeAllAnnotations();
-
-		removeAllAdapters();
-
-		fDocument = null;
-		fProjectionNeedsToBeEnabled = false;
-	}
-
-	public void projectionEnabled() {
-		initialize();
-	}
-
-	/**
-	 * Removes an adapter from node and its children
-	 * 
-	 * @param node
-	 * @param level
-	 */
-	private void removeAdapterFromNodeAndChildren(Node node, int level) {
-		if (node instanceof INodeNotifier) {
-			INodeNotifier notifier = (INodeNotifier) node;
-
-			// try and get the adapter for the current node and remove it
-			INodeAdapter adapter = notifier.getExistingAdapter(ProjectionModelNodeAdapterJSP.class);
-			if (adapter != null) {
-				notifier.removeAdapter(adapter);
-			}
-
-			INodeAdapter adapter2 = notifier.getExistingAdapter(ProjectionModelNodeAdapterHTML.class);
-			if (adapter2 != null) {
-				notifier.removeAdapter(adapter2);
-			}
-
-			Node nextChild = node.getFirstChild();
-			while (nextChild != null) {
-				Node childNode = nextChild;
-				nextChild = childNode.getNextSibling();
-
-				removeAdapterFromNodeAndChildren(childNode, level + 1);
-			}
-		}
-	}
-
-	/**
-	 * Goes through every node and removes adapter from each for cleanup
-	 * purposes
-	 */
-	private void removeAllAdapters() {
-		long start = System.currentTimeMillis();
-
-		if (fDocument != null) {
-			IStructuredModel sModel = null;
-			try {
-				sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-				if (sModel != null) {
-					int startOffset = 0;
-					IndexedRegion startNode = sModel.getIndexedRegion(startOffset);
-					if (startNode instanceof Node) {
-						Node nextSibling = (Node) startNode;
-						while (nextSibling != null) {
-							Node currentNode = nextSibling;
-							nextSibling = currentNode.getNextSibling();
-
-							removeAdapterFromNodeAndChildren(currentNode, 0);
-						}
-					}
-				}
-			}
-			finally {
-				if (sModel != null) {
-					sModel.releaseFromRead();
-				}
-			}
-		}
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderJSP.addAllAdapters: " + (end - start)); //$NON-NLS-1$
-		}
-	}
-
-	public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
-		// if folding is enabled and new document is going to be a totally
-		// different document, disable projection
-		if (fDocument != null && fDocument != newInput) {
-			// disable projection and disconnect everything
-			projectionDisabled();
-			fProjectionNeedsToBeEnabled = true;
-		}
-	}
-
-	public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
-		// if projection was previously enabled before input document changed
-		// and new document is different than old document
-		if (fProjectionNeedsToBeEnabled && fDocument == null && newInput != null) {
-			projectionEnabled();
-			fProjectionNeedsToBeEnabled = false;
-		}
-	}
-
-	/**
-	 * Disconnect this IStructuredTextFoldingProvider from projection viewer
-	 */
-	public void uninstall() {
-		if (isInstalled()) {
-			projectionDisabled();
-
-			fViewer.removeProjectionListener(this);
-			fViewer.removeTextInputListener(this);
-			fViewer = null;
-		}
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/LineStyleProviderForJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/LineStyleProviderForJSP.java
index d0418cf..d3c52ad 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/LineStyleProviderForJSP.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/LineStyleProviderForJSP.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Frits Jalvingh - contributions for bug 150794
  *******************************************************************************/
 package org.eclipse.jst.jsp.ui.internal.style;
 
@@ -81,7 +82,7 @@
 				else if (type == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
 					result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
 				}
-				else if ((type == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) || (type == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_DQUOTE) || (type == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_SQUOTE)) {
+				else if ((type == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) || (type == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_DQUOTE) || (type == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_SQUOTE)|| (type == DOMJSPRegionContexts.JSP_TAG_ATTRIBUTE_VALUE_DQUOTE) || (type == DOMJSPRegionContexts.JSP_TAG_ATTRIBUTE_VALUE_SQUOTE)) {
 					result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
 				}
 				else if (type == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
@@ -101,6 +102,8 @@
 					result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
 				else if (type == DOMRegionContext.BLOCK_TEXT)
 					result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.CDATA_TEXT);
+				else if (type == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_DQUOTE||type == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_SQUOTE)
+					result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
 			}
 		}
 		// default, return null to signal "not handled"
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/DoubleQuotedStringRule.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/DoubleQuotedStringRule.java
new file mode 100644
index 0000000..eabb960
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/DoubleQuotedStringRule.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Frits Jalvingh and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Frits Jalvingh - initial version (bugfix for 150794)
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.style.java;
+
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IPredicateRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.Token;
+
+/**
+ * This rule matches the double-quoted strings present in JSP tag attributes. A double-quoted
+ * strings starts with \" (two characters!) and ends with \" (two characters!) too. The sequence
+ * \" is escaped by the horror \\\" (4 chars!?) as per the JSP spec.
+ *
+ * @author <a href="mailto:jal@etc.to">Frits Jalvingh</a>
+ * Created on Aug 5, 2007
+ */
+public class DoubleQuotedStringRule implements IPredicateRule {
+	private IToken	fToken;
+	private int		m_qc;
+
+	public DoubleQuotedStringRule(IToken tok) {
+		fToken = tok;
+	}
+	public IToken evaluate(ICharacterScanner scanner, boolean resume) {
+		if(resume) {
+			if(findEnd(scanner, m_qc))
+				return fToken;
+		} else {
+			int c= scanner.read();
+			if(c == '\\') {
+				c = scanner.read();
+				if(c == '"' || c == '\'') {
+					if(findEnd(scanner, c))
+						return fToken;
+				}
+				scanner.unread();
+			}
+			scanner.unread();
+		}
+		return Token.UNDEFINED;
+	}
+
+	private boolean findEnd(ICharacterScanner scanner, int qc) {
+		m_qc = qc;
+		int count = 0;
+		int c;
+		int nsl = 0;
+		while((c= scanner.read()) != ICharacterScanner.EOF) {
+			count++;
+			if(c == '\\') {
+				nsl++;
+				if(nsl >= 4)
+					nsl = 0;
+			} else if(c == qc) {
+				if(nsl == 1)
+					return true;
+				nsl = 0;
+			} else
+				nsl= 0;
+		}
+		while(--count >= 0)
+			scanner.unread();
+		return false;
+	}
+
+	public IToken getSuccessToken() {
+		return fToken;
+	}
+
+	public IToken evaluate(ICharacterScanner scanner) {
+		return evaluate(scanner, false);
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaCodeScanner.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaCodeScanner.java
index 6c95b13..4e05aef 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaCodeScanner.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaCodeScanner.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Frits Jalvingh - contributions for bug 150794
  *******************************************************************************/
 package org.eclipse.jst.jsp.ui.internal.style.java;
 
@@ -85,6 +86,8 @@
 			wordRule.addWord(fgConstants[i], fTypeToken);
 		rules.add(wordRule);
 
+		// Add the double-quoted string rule
+		rules.add(new DoubleQuotedStringRule(fStringToken));
 
 		IRule[] result = new IRule[rules.size()];
 		rules.toArray(result);
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/LineStyleProviderForJava.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/LineStyleProviderForJava.java
index b7e63a7..853af7c 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/LineStyleProviderForJava.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/LineStyleProviderForJava.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,23 +7,19 @@
  * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Frits Jalvingh - contributions for bug 150794
  *******************************************************************************/
 package org.eclipse.jst.jsp.ui.internal.style.java;
 
 import java.util.Collection;
-import java.util.HashMap;
 
 import org.eclipse.jdt.ui.PreferenceConstants;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.ITypedRegion;
 import org.eclipse.jface.text.TextAttribute;
 import org.eclipse.jface.text.rules.IToken;
 import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.util.IPropertyChangeListener;
 import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
 import org.eclipse.jst.jsp.ui.internal.style.IStyleConstantsJSP;
@@ -32,40 +28,22 @@
 import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.RGB;
 import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider;
 import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
 import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
 
 // Note: many of the methods in this class were based on (or copied from) those
 // found in the example Java Editor
-public class LineStyleProviderForJava implements LineStyleProvider{
-	private class PropertyChangeListener implements IPropertyChangeListener {
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
-		 */
-		public void propertyChange(PropertyChangeEvent event) {
-			// have to do it this way so others can override the method
-			handlePropertyChange(event);
-		}
-	}
+public class LineStyleProviderForJava extends AbstractLineStyleProvider implements LineStyleProvider{
 
-	private IDocument fDocument;
-	private Highlighter fHighlighter;
-	private boolean fIsInitialized = false;
-	private PropertyChangeListener fPreferenceListener = new PropertyChangeListener();
 	/** The scanner it uses */
 	private JavaCodeScanner fScanner;
-	/** Contains all text attributes pretaining to this line style provider */
-	private HashMap fTextAttributes = null;
 
 	public LineStyleProviderForJava() {
 		super();
 		fScanner = new JavaCodeScanner();
+		loadColors();		// Make sure we have rules before we start parsing
 	}
 
 	/**
@@ -98,43 +76,6 @@
 	 * 
 	 * @param colorKey
 	 */
-	private void addTextAttribute(String colorKey) {
-		if (getColorPreferences() != null) {
-			String prefString = getColorPreferences().getString(colorKey);
-			String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
-			if (stylePrefs != null) {
-				RGB foreground = ColorHelper.toRGB(stylePrefs[0]);
-				RGB background = ColorHelper.toRGB(stylePrefs[1]);
-				boolean bold = Boolean.valueOf(stylePrefs[2]).booleanValue();
-				boolean italic = Boolean.valueOf(stylePrefs[3]).booleanValue();
-				boolean strikethrough = Boolean.valueOf(stylePrefs[4]).booleanValue();
-				boolean underline = Boolean.valueOf(stylePrefs[5]).booleanValue();
-				int style = SWT.NORMAL;
-				if (bold) {
-					style = style | SWT.BOLD;
-				}
-				if (italic) {
-					style = style | SWT.ITALIC;
-				}
-				if (strikethrough) {
-					style = style | TextAttribute.STRIKETHROUGH;
-				}
-				if (underline) {
-					style = style | TextAttribute.UNDERLINE;
-				}
-
-				TextAttribute createTextAttribute = createTextAttribute(foreground, background, style);
-				getTextAttributes().put(colorKey, createTextAttribute);
-			}
-		}
-	}
-	
-	/**
-	 * Looks up the colorKey in the preference store and adds the style
-	 * information to list of TextAttributes
-	 * 
-	 * @param colorKey
-	 */
 	private void addJavaTextAttribute(String colorKey) {
 		IPreferenceStore store = getJavaColorPreferences();
 		if (store != null && colorKey != null) { 
@@ -235,25 +176,6 @@
 		}
 	}
 	
-	private TextAttribute createTextAttribute(RGB foreground, RGB background, int style) {
-		return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, style);
-	}
-	
-	/**
-	 * Returns the hashtable containing all the text attributes for this line
-	 * style provider. Lazily creates a hashtable if one has not already been
-	 * created.
-	 * 
-	 * @return
-	 */
-	private HashMap getTextAttributes() {
-		if (fTextAttributes == null) {
-			fTextAttributes = new HashMap();
-			loadColors();
-		}
-		return fTextAttributes;
-	}
-	
 	/**
 	 * Returns a text attribute encoded in the given token. If the token's
 	 * data is not <code>null</code> and a text attribute it is assumed that
@@ -275,19 +197,7 @@
 		return ta; 
 	}
 	
-	public void init(IStructuredDocument document, Highlighter highlighter) {
-		fDocument = document;
-		fHighlighter = highlighter;
-		
-		if (fIsInitialized)
-			return;
-
-		registerPreferenceListener();
-
-		fIsInitialized = true;
-	}
-
-	private void loadColors() {
+	protected void loadColors() {
 		addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
 		addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
 		addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
@@ -340,89 +250,75 @@
 		}
 		if (styleKey != null || javaStyleKey != null) {
 			// force a full update of the text viewer
-			fHighlighter.refreshDisplay();
+			fRecHighlighter.refreshDisplay();
 		}
 	}
 
 	public boolean prepareRegions(ITypedRegion typedRegion, int ssssrequestedStart, int ssssrequestedLength, Collection holdResults) {
 		boolean result = true;
+		/* Initialize the text attributes. Also load the colors and initialize the rules of the scanner */
+		getTextAttributes();
 		try {
-			// ideally, eventually, we'll have a "virtualDocument" we can 
+			// ideally, eventually, we'll have a "virtualDocument" we can
 			// refer to, but for now ... we'll simple rescan the one region.
 			// use simple adjustment (since "sub-content" starts at 0
-			int offsetAdjustment = typedRegion.getOffset();
-			String content = fDocument.get(typedRegion.getOffset(), typedRegion.getLength());
-			IDocument document = new Document(content);
-
-			int lastStart = 0;
+			int lastStart = typedRegion.getOffset();
 			int length = 0;
 			IToken lastToken = Token.UNDEFINED;
-
-			int remainingLength = typedRegion.getLength();
-			fScanner.setRange(document, lastStart, remainingLength);
-
+			fScanner.setRange(getDocument(), lastStart, typedRegion.getLength());
 			while (true) {
 				IToken token = fScanner.nextToken();
-
 				if (token.isEOF()) {
-					if (!lastToken.isUndefined() && length != 0)
-						addRange(holdResults, lastStart + offsetAdjustment, length, getTokenTextAttribute(lastToken));
+					if (!lastToken.isUndefined() && length != 0) {
+						addRange(holdResults, lastStart, length, getTokenTextAttribute(lastToken));
+					}
 					break;
 				}
-
 				if (token.isWhitespace()) {
 					length += fScanner.getTokenLength();
 					continue;
 				}
-
 				if (lastToken.isUndefined()) {
 					lastToken = token;
 					length += fScanner.getTokenLength();
 					continue;
 				}
-
 				if (token != lastToken) {
-					addRange(holdResults, lastStart + offsetAdjustment, length, getTokenTextAttribute(lastToken));
+					addRange(holdResults, lastStart, length, getTokenTextAttribute(lastToken));
 					lastToken = token;
 					lastStart = fScanner.getTokenOffset();
 					length = fScanner.getTokenLength();
 					continue;
 				}
-
 				length += fScanner.getTokenLength();
 			}
-		}
-		catch (BadLocationException e) {
-			// shouldn't happen, but we don't want it to stop other highlighting, if it does.
+		} catch (Exception e) {
+			// shouldn't happen, but we don't want it to stop other
+			// highlighting, if it does.
 			result = false;
 		}
 		return result;
 	}
 	
-	private void registerPreferenceListener() {
-		getColorPreferences().addPropertyChangeListener(fPreferenceListener);
-		getJavaColorPreferences().addPropertyChangeListener(fPreferenceListener);
-	}
-	
-	public void release() {
-		unregisterPreferenceManager();
-		if (fTextAttributes != null) {
-			fTextAttributes.clear();
-			fTextAttributes = null;
-		}
-		fIsInitialized = false;
-	}
-
-	private void unregisterPreferenceManager() {
-		getColorPreferences().removePropertyChangeListener(fPreferenceListener);
-		getJavaColorPreferences().removePropertyChangeListener(fPreferenceListener);
-	}
-	
-	private IPreferenceStore getColorPreferences() {
+	protected IPreferenceStore getColorPreferences() {
 		return JSPUIPlugin.getDefault().getPreferenceStore();
 	}
 	
 	private IPreferenceStore getJavaColorPreferences() {
 		return PreferenceConstants.getPreferenceStore();
 	}
+	
+	protected void registerPreferenceManager() {
+		getColorPreferences().addPropertyChangeListener(fPreferenceListener);
+		getJavaColorPreferences().addPropertyChangeListener(fPreferenceListener);
+	}
+	
+	protected void unRegisterPreferenceManager() {
+		getColorPreferences().removePropertyChangeListener(fPreferenceListener);
+		getJavaColorPreferences().removePropertyChangeListener(fPreferenceListener);
+	}
+
+	protected TextAttribute getAttributeFor(ITextRegion region) {
+		return null;
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/LineStyleProviderForJSPEL.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/LineStyleProviderForJSPEL.java
index 4acabe5..3be6356 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/LineStyleProviderForJSPEL.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/LineStyleProviderForJSPEL.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,7 +11,6 @@
 package org.eclipse.jst.jsp.ui.internal.style.jspel;
 
 import java.util.Collection;
-import java.util.HashMap;
 
 import org.eclipse.jdt.ui.PreferenceConstants;
 import org.eclipse.jface.preference.IPreferenceStore;
@@ -23,7 +22,6 @@
 import org.eclipse.jface.text.TextAttribute;
 import org.eclipse.jface.text.rules.IToken;
 import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.util.IPropertyChangeListener;
 import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
 import org.eclipse.jst.jsp.ui.internal.style.IStyleConstantsJSP;
@@ -34,37 +32,19 @@
 import org.eclipse.swt.graphics.RGB;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter;
+import org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider;
 import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
 import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
 
 // Note: many of the methods in this class were based on (or copied from)
 // those
 // found in the example Java Editor
-public class LineStyleProviderForJSPEL implements LineStyleProvider {
-	private class PropertyChangeListener implements IPropertyChangeListener {
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
-		 */
-		public void propertyChange(PropertyChangeEvent event) {
-			// have to do it this way so others can override the method
-			handlePropertyChange(event);
-		}
-	}
+public class LineStyleProviderForJSPEL extends AbstractLineStyleProvider implements LineStyleProvider {
 
-	private IDocument fDocument;
-	private Highlighter fHighlighter;
-	private boolean fIsInitialized = false;
-	private PropertyChangeListener fPreferenceListener = new PropertyChangeListener();
 	/** The scanner it uses */
 	private JSPELCodeScanner fScanner;
-	/** Contains all text attributes pretaining to this line style provider */
-	private HashMap fTextAttributes = null;
 
 	public LineStyleProviderForJSPEL() {
 		super();
@@ -99,43 +79,6 @@
 	 * 
 	 * @param colorKey
 	 */
-	private void addTextAttribute(String colorKey) {
-		if (getColorPreferences() != null) {
-			String prefString = getColorPreferences().getString(colorKey);
-			String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
-			if (stylePrefs != null) {
-				RGB foreground = ColorHelper.toRGB(stylePrefs[0]);
-				RGB background = ColorHelper.toRGB(stylePrefs[1]);
-				boolean bold = Boolean.valueOf(stylePrefs[2]).booleanValue();
-				boolean italic = Boolean.valueOf(stylePrefs[3]).booleanValue();
-				boolean strikethrough = Boolean.valueOf(stylePrefs[4]).booleanValue();
-				boolean underline = Boolean.valueOf(stylePrefs[5]).booleanValue();
-				int style = SWT.NORMAL;
-				if (bold) {
-					style = style | SWT.BOLD;
-				}
-				if (italic) {
-					style = style | SWT.ITALIC;
-				}
-				if (strikethrough) {
-					style = style | TextAttribute.STRIKETHROUGH;
-				}
-				if (underline) {
-					style = style | TextAttribute.UNDERLINE;
-				}
-
-				TextAttribute createTextAttribute = createTextAttribute(foreground, background, style);
-				getTextAttributes().put(colorKey, createTextAttribute);
-			}
-		}
-	}
-
-	/**
-	 * Looks up the colorKey in the preference store and adds the style
-	 * information to list of TextAttributes
-	 * 
-	 * @param colorKey
-	 */
 	private void addJavaTextAttribute(String colorKey) {
 		IPreferenceStore store = getJavaColorPreferences();
 		if (store != null && colorKey != null) {
@@ -191,25 +134,6 @@
 			}
 		}
 	}
-	
-	private TextAttribute createTextAttribute(RGB foreground, RGB background, int style) {
-		return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, style);
-	}
-
-	/**
-	 * Returns the hashtable containing all the text attributes for this line
-	 * style provider. Lazily creates a hashtable if one has not already been
-	 * created.
-	 * 
-	 * @return
-	 */
-	private HashMap getTextAttributes() {
-		if (fTextAttributes == null) {
-			fTextAttributes = new HashMap();
-			loadColors();
-		}
-		return fTextAttributes;
-	}
 
 	/**
 	 * Returns a text attribute encoded in the given token. If the token's
@@ -233,19 +157,7 @@
 		return ta;
 	}
 
-	public void init(IStructuredDocument document, Highlighter highlighter) {
-		fDocument = document;
-		fHighlighter = highlighter;
-
-		if (fIsInitialized)
-			return;
-
-		registerPreferenceListener();
-
-		fIsInitialized = true;
-	}
-
-	private void loadColors() {
+	protected void loadColors() {
 		addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
 		addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
 		addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
@@ -287,7 +199,7 @@
 		}
 		if (styleKey != null || javaStyleKey != null) {
 			// force a full update of the text viewer
-			fHighlighter.refreshDisplay();
+			fRecHighlighter.refreshDisplay();
 		}
 	}
 
@@ -347,30 +259,25 @@
 		return result;
 	}
 	
-	private void registerPreferenceListener() {
-		getColorPreferences().addPropertyChangeListener(fPreferenceListener);
-		getJavaColorPreferences().addPropertyChangeListener(fPreferenceListener);
-	}
-	
-	public void release() {
-		unRegisterPreferenceManager();
-		if (fTextAttributes != null) {
-			fTextAttributes.clear();
-			fTextAttributes = null;
-		}
-		fIsInitialized = false;
-	}
-
-	private void unRegisterPreferenceManager() {
-		getColorPreferences().removePropertyChangeListener(fPreferenceListener);
-		getJavaColorPreferences().removePropertyChangeListener(fPreferenceListener);
-	}
-
-	private IPreferenceStore getColorPreferences() {
+	protected IPreferenceStore getColorPreferences() {
 		return JSPUIPlugin.getDefault().getPreferenceStore();
 	}
 	
 	private IPreferenceStore getJavaColorPreferences() {
 		return PreferenceConstants.getPreferenceStore();
 	}
+	
+	protected void registerPreferenceManager() {
+		getColorPreferences().addPropertyChangeListener(fPreferenceListener);
+		getJavaColorPreferences().addPropertyChangeListener(fPreferenceListener);
+	}
+	
+	protected void unRegisterPreferenceManager() {
+		getColorPreferences().removePropertyChangeListener(fPreferenceListener);
+		getJavaColorPreferences().removePropertyChangeListener(fPreferenceListener);
+	}
+
+	protected TextAttribute getAttributeFor(ITextRegion region) {
+		return null;
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/HTMLPrinter.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/HTMLPrinter.java
deleted file mode 100644
index a450396..0000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/HTMLPrinter.java
+++ /dev/null
@@ -1,216 +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.jst.jsp.ui.internal.taginfo;
-
-
-import java.io.IOException;
-import java.io.Reader;
-import java.net.URL;
-
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTError;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-
-/**
- * Provides a set of convenience methods for creating HTML pages.
- * 
- * Based on org.eclipse.jdt.internal.ui.text.HTMLPrinter
- */
-class HTMLPrinter {
-
-	static RGB BG_COLOR_RGB = null;
-
-	static {
-		final Display display = Display.getDefault();
-		if (display != null && !display.isDisposed()) {
-			try {
-				display.asyncExec(new Runnable() {
-					/*
-					 * @see java.lang.Runnable#run()
-					 */
-					public void run() {
-						BG_COLOR_RGB = display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB();
-					}
-				});
-			}
-			catch (SWTError err) {
-				// see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=45294
-				if (err.code != SWT.ERROR_DEVICE_DISPOSED)
-					throw err;
-			}
-		}
-	}
-
-	private HTMLPrinter() {
-		// nothing
-	}
-
-	private static String replace(String text, char c, String s) {
-
-		int previous = 0;
-		int current = text.indexOf(c, previous);
-
-		if (current == -1)
-			return text;
-
-		StringBuffer buffer = new StringBuffer();
-		while (current > -1) {
-			buffer.append(text.substring(previous, current));
-			buffer.append(s);
-			previous = current + 1;
-			current = text.indexOf(c, previous);
-		}
-		buffer.append(text.substring(previous));
-
-		return buffer.toString();
-	}
-
-	public static String convertToHTMLContent(String content) {
-		content = replace(content, '&', "&amp;"); //$NON-NLS-1$
-		content = replace(content, '"', "&quot;"); //$NON-NLS-1$
-		content = replace(content, '<', "&lt;"); //$NON-NLS-1$
-		return replace(content, '>', "&gt;"); //$NON-NLS-1$
-	}
-
-	static String read(Reader rd) {
-
-		StringBuffer buffer = new StringBuffer();
-		char[] readBuffer = new char[2048];
-
-		try {
-			int n = rd.read(readBuffer);
-			while (n > 0) {
-				buffer.append(readBuffer, 0, n);
-				n = rd.read(readBuffer);
-			}
-			return buffer.toString();
-		}
-		catch (IOException x) {
-			// never expected
-			Logger.log(Logger.WARNING_DEBUG, x.getMessage(), x);
-		}
-
-		return null;
-	}
-
-	public static void insertPageProlog(StringBuffer buffer, int position, RGB bgRGB, URL styleSheetURL) {
-
-		if (bgRGB == null)
-			insertPageProlog(buffer, position, styleSheetURL);
-		else {
-			StringBuffer pageProlog = new StringBuffer(300);
-
-			pageProlog.append("<html>"); //$NON-NLS-1$
-
-			appendStyleSheetLink(pageProlog, styleSheetURL);
-
-			pageProlog.append("<body text=\"#000000\" bgcolor=\""); //$NON-NLS-1$
-			appendColor(pageProlog, bgRGB);
-			pageProlog.append("\"><font size=-1>"); //$NON-NLS-1$
-
-			buffer.insert(position, pageProlog.toString());
-		}
-	}
-
-	public static void insertPageProlog(StringBuffer buffer, int position, RGB bgRGB) {
-		if (bgRGB == null)
-			insertPageProlog(buffer, position);
-		else {
-			StringBuffer pageProlog = new StringBuffer(60);
-			pageProlog.append("<html><body text=\"#000000\" bgcolor=\""); //$NON-NLS-1$
-			appendColor(pageProlog, bgRGB);
-			pageProlog.append("\"><font size=-1>"); //$NON-NLS-1$
-			buffer.insert(position, pageProlog.toString());
-		}
-	}
-
-	private static void appendStyleSheetLink(StringBuffer buffer, URL styleSheetURL) {
-		if (styleSheetURL == null)
-			return;
-
-		buffer.append("<head>"); //$NON-NLS-1$
-
-		buffer.append("<LINK REL=\"stylesheet\" HREF= \""); //$NON-NLS-1$
-		buffer.append(styleSheetURL);
-		buffer.append("\" CHARSET=\"ISO-8859-1\" TYPE=\"text/css\">"); //$NON-NLS-1$
-
-		buffer.append("</head>"); //$NON-NLS-1$
-	}
-
-	private static void appendColor(StringBuffer buffer, RGB rgb) {
-		buffer.append('#');
-		buffer.append(Integer.toHexString(rgb.red));
-		buffer.append(Integer.toHexString(rgb.green));
-		buffer.append(Integer.toHexString(rgb.blue));
-	}
-
-	public static void insertPageProlog(StringBuffer buffer, int position) {
-		insertPageProlog(buffer, position, getBgColor());
-	}
-
-	public static void insertPageProlog(StringBuffer buffer, int position, URL styleSheetURL) {
-		insertPageProlog(buffer, position, getBgColor(), styleSheetURL);
-	}
-
-	private static RGB getBgColor() {
-		if (BG_COLOR_RGB != null)
-			return BG_COLOR_RGB;
-		// RGB value of info bg color on WindowsXP
-		return new RGB(255, 255, 225);
-	}
-
-	public static void addPageProlog(StringBuffer buffer) {
-		insertPageProlog(buffer, buffer.length());
-	}
-
-	public static void addPageEpilog(StringBuffer buffer) {
-		buffer.append("</font></body></html>"); //$NON-NLS-1$
-	}
-
-	public static void startBulletList(StringBuffer buffer) {
-		buffer.append("<ul>"); //$NON-NLS-1$
-	}
-
-	public static void endBulletList(StringBuffer buffer) {
-		buffer.append("</ul>"); //$NON-NLS-1$
-	}
-
-	public static void addBullet(StringBuffer buffer, String bullet) {
-		if (bullet != null) {
-			buffer.append("<li>"); //$NON-NLS-1$
-			buffer.append(bullet);
-			buffer.append("</li>"); //$NON-NLS-1$
-		}
-	}
-
-	public static void addSmallHeader(StringBuffer buffer, String header) {
-		if (header != null) {
-			buffer.append("<h5>"); //$NON-NLS-1$
-			buffer.append(header);
-			buffer.append("</h5>"); //$NON-NLS-1$
-		}
-	}
-
-	public static void addParagraph(StringBuffer buffer, String paragraph) {
-		if (paragraph != null) {
-			buffer.append("<p>"); //$NON-NLS-1$
-			buffer.append(paragraph);
-		}
-	}
-
-	public static void addParagraph(StringBuffer buffer, Reader paragraphReader) {
-		if (paragraphReader != null)
-			addParagraph(buffer, read(paragraphReader));
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java
index 88c6093..117ade2 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,6 +17,7 @@
 import org.eclipse.jdt.core.JavaModelException;
 import org.eclipse.jdt.ui.JavaElementLabels;
 import org.eclipse.jdt.ui.JavadocContentAccess;
+import org.eclipse.jface.internal.text.html.HTMLPrinter;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
@@ -38,7 +39,7 @@
 	private final long LABEL_FLAGS = JavaElementLabels.ALL_FULLY_QUALIFIED | JavaElementLabels.M_PRE_RETURNTYPE | JavaElementLabels.M_PARAMETER_TYPES | JavaElementLabels.M_PARAMETER_NAMES | JavaElementLabels.M_EXCEPTIONS | JavaElementLabels.F_PRE_TYPE_SIGNATURE | JavaElementLabels.M_PRE_TYPE_PARAMETERS | JavaElementLabels.T_TYPE_PARAMETERS | JavaElementLabels.USE_RESOLVED;
 	private final long LOCAL_VARIABLE_FLAGS = LABEL_FLAGS & ~JavaElementLabels.F_FULLY_QUALIFIED | JavaElementLabels.F_POST_QUALIFIED;
 
-	private String getHoverInfo(IJavaElement[] result) {
+	protected String getHoverInfo(IJavaElement[] result) {
 		StringBuffer buffer = new StringBuffer();
 		int nResults = result.length;
 		if (nResults == 0)
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JavaWordFinder.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JavaWordFinder.java
index 5b5109e..2acc579 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JavaWordFinder.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JavaWordFinder.java
@@ -19,8 +19,10 @@
  * Copied from org.eclipse.jdt.internal.ui.text.JavaWordFinder
  */
 class JavaWordFinder {
-	
 	public static IRegion findWord(IDocument document, int offset) {
+		return findWord(document, offset, false);
+	}
+	public static IRegion findWord(IDocument document, int offset, boolean searchQualified) {
 		
 		int start= -1;
 		int end= -1;
@@ -33,7 +35,7 @@
 			
 			while (pos >= 0) {
 				c= document.getChar(pos);
-				if (!Character.isJavaIdentifierPart(c))
+				if (searchQualified ? !Character.isJavaIdentifierPart(c) && c != '.' : !Character.isJavaIdentifierPart(c))
 					break;
 				--pos;
 			}
@@ -45,7 +47,7 @@
 			
 			while (pos < length) {
 				c= document.getChar(pos);
-				if (!Character.isJavaIdentifierPart(c))
+				if (searchQualified ? !Character.isJavaIdentifierPart(c) && c != '.' : !Character.isJavaIdentifierPart(c))
 					break;
 				++pos;
 			}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/XMLJavadocHoverProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/XMLJavadocHoverProcessor.java
new file mode 100644
index 0000000..75d6212
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/XMLJavadocHoverProcessor.java
@@ -0,0 +1,137 @@
+/*******************************************************************************

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

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

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

+ * which accompanies this distribution, and is available at

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

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *     Jens Lukowski/Innoopract - initial renaming/restructuring

+ *     

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

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

+

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

+

+

+

+/**

+ * Provides hover help documentation for xml tags

+ * 

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

+ */

+public class XMLJavadocHoverProcessor extends JSPJavaJavadocHoverProcessor {

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see

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

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

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

+	 */

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

+		String elementName = null;

+		try {

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

+		}

+		catch (BadLocationException e) {

+			return null;

+		}

+

+		IStructuredModel model = null;

+		try {

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

+			if (model != null) {

+				String baseLocation = model.getBaseLocation();

+				// URL fixup from the taglib index record

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

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

+				}

+				/*

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

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

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

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

+				 */

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

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

+					IPath basePath = new Path(baseFile);

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

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

+						try {

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

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

+								if (javaProject.exists()) {

+									IPackageFragmentRoot root = javaProject.findPackageFragmentRoot(basePath);

+									if (root != null) {

+										// TLDs don't reference method names

+										IType type = javaProject.findType(elementName);

+										if (type != null) {

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

+										}

+									}

+								}

+							}

+						}

+						catch (CoreException e) {

+							Logger.logException(e);

+						}

+					}

+				}

+				else {

+					IPath basePath = new Path(baseLocation);

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

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

+						if (javaProject.exists()) {

+							try {

+								// TLDs don't reference method names

+								IType type = javaProject.findType(elementName);

+								if (type != null) {

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

+								}

+							}

+							catch (JavaModelException e) {

+								Logger.logException(e);

+							}

+						}

+					}

+				}

+			}

+

+		}

+		finally {

+			if (model != null)

+				model.releaseFromRead();

+		}

+		return null;

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see

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

+	 * text.ITextViewer, int)

+	 */

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

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

+	}

+}

diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaCharacterPairInserter.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaCharacterPairInserter.java
new file mode 100644
index 0000000..0ce823e
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaCharacterPairInserter.java
@@ -0,0 +1,158 @@
+/*******************************************************************************

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

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

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

+ * which accompanies this distribution, and is available at

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

+ *

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

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

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

+

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

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

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

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

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

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

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

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

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

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

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

+

+public class JavaCharacterPairInserter extends AbstractCharacterPairInserter implements IPropertyChangeListener {

+

+	private boolean fCloseBrackets = true;

+	private boolean fCloseStrings = true;

+

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

+		IDocument document = viewer.getDocument();

+		final Point selection = viewer.getSelectedRange();

+		final int offset = selection.x;

+		final int length = selection.y;

+

+		try {

+			IRegion startLine= document.getLineInformationOfOffset(offset);

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

+	

+			JavaHeuristicScanner scanner = new JavaHeuristicScanner(document);

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

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

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

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

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

+			

+			switch (c) {

+				case '(':

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

+						return false;

+					break;

+	

+				case '<':

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

+							|| 		   prevToken != Symbols.TokenLBRACE

+									&& prevToken != Symbols.TokenRBRACE

+									&& prevToken != Symbols.TokenSEMICOLON

+									&& prevToken != Symbols.TokenSYNCHRONIZED

+									&& prevToken != Symbols.TokenSTATIC

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

+									&& prevToken != Symbols.TokenEOF)

+						return false;

+					break;

+	

+				case '[':

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

+						return false;

+					break;

+	

+				case '\'':

+				case '"':

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

+							|| prevToken == Symbols.TokenIDENT

+							|| prevToken == Symbols.TokenSQUOTE

+							|| nextToken == Symbols.TokenSQUOTE

+							|| prevToken == Symbols.TokenDQUOTE

+							|| nextToken == Symbols.TokenDQUOTE

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

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

+						return false;

+					break;

+	

+				default:

+					return false;

+			}

+		} catch (BadLocationException e) {

+			return false;

+		}

+		return true;

+	}

+

+	private boolean isAngularIntroducer(String identifier) {

+		return identifier.length() > 0

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

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

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

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

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

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

+	}

+

+	protected char getPair(char c) {

+		switch (c) {

+			case '\'':

+			case '"':

+				return c;

+			case '(':

+				return ')';

+			case '[':

+				return ']';

+			case '<':

+				return '>';

+			default:

+				throw new IllegalArgumentException();

+		}

+	}

+

+	protected char getEscapeChar(char c) {

+		switch (c) {

+			case '\'':

+			case '"':

+				return '\\';

+			default:

+				return 0;

+		}

+	}

+

+	public boolean hasPair(char c) {

+		switch (c) {

+			case '"':

+			case '\'':

+			case '[':

+			case '(':

+			case '<':

+				return true;

+			default:

+				return false;

+		}

+	}

+

+	public void initialize() {

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

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

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

+		store.addPropertyChangeListener(this);

+	}

+

+	public void dispose() {

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

+	}

+

+	public void propertyChange(PropertyChangeEvent event) {

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

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

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

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

+	}

+}

diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaHeuristicScanner.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaHeuristicScanner.java
new file mode 100644
index 0000000..e113c38
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaHeuristicScanner.java
@@ -0,0 +1,956 @@
+/*******************************************************************************

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

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

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

+ * which accompanies this distribution, and is available at

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

+ *

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

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

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

+

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

+

+import java.util.Arrays;

+

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

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

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

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

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

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

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

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

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

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

+

+class JavaHeuristicScanner implements Symbols {

+	/**

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

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

+	 */

+	public static final int NOT_FOUND= -1;

+

+	/**

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

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

+	 */

+	public static final int UNBOUND= -2;

+

+

+	/* character constants */

+	private static final char LBRACE= '{';

+	private static final char RBRACE= '}';

+	private static final char LPAREN= '(';

+	private static final char RPAREN= ')';

+	private static final char SEMICOLON= ';';

+	private static final char COLON= ':';

+	private static final char COMMA= ',';

+	private static final char LBRACKET= '[';

+	private static final char RBRACKET= ']';

+	private static final char QUESTIONMARK= '?';

+	private static final char EQUAL= '=';

+	private static final char LANGLE= '<';

+	private static final char RANGLE= '>';

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

+	private static final char DQUOTE = '"';

+

+	/**

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

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

+	 */

+	private static abstract class StopCondition {

+		/**

+		 * Instructs the scanner to return the current position.

+		 *

+		 * @param ch the char at the current position

+		 * @param position the current position

+		 * @param forward the iteration direction

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

+		 */

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

+

+		/**

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

+		 * is to return the next/previous position.

+		 * 

+		 * @param position the position 

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

+		 * @return the next position to scan

+		 */

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

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

+		}

+	}

+

+	/**

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

+	 */

+	private static class NonWhitespace extends StopCondition {

+		/*

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

+		 */

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

+			return !Character.isWhitespace(ch);

+		}

+	}

+

+	/**

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

+	 *

+	 * @see JavaHeuristicScanner.NonWhitespace

+	 */

+	private final class NonWhitespaceDefaultPartition extends NonWhitespace {

+		/*

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

+		 */

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

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

+		}

+

+		/*

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

+		 */

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

+			ITypedRegion partition= getPartition(position);

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

+				return super.nextPosition(position, forward);

+

+			if (forward) {

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

+				if (position < end)

+					return end;

+			} else {

+				int offset= partition.getOffset();

+				if (position > offset)

+					return offset - 1;

+			}

+			return super.nextPosition(position, forward);

+		}

+	}

+

+	/**

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

+	 */

+	private static class NonJavaIdentifierPart extends StopCondition {

+		/*

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

+		 */

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

+			return !Character.isJavaIdentifierPart(ch);

+		}

+	}

+

+	/**

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

+	 *

+	 * @see JavaHeuristicScanner.NonJavaIdentifierPart

+	 */

+	private final class NonJavaIdentifierPartDefaultPartition extends NonJavaIdentifierPart {

+		/*

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

+		 */

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

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

+		}

+

+		/*

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

+		 */

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

+			ITypedRegion partition= getPartition(position);

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

+				return super.nextPosition(position, forward);

+

+			if (forward) {

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

+				if (position < end)

+					return end;

+			} else {

+				int offset= partition.getOffset();

+				if (position > offset)

+					return offset - 1;

+			}

+			return super.nextPosition(position, forward);

+		}

+	}

+

+	/**

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

+	 */

+	private final class CharacterMatch extends StopCondition {

+		private final char[] fChars;

+

+		/**

+		 * Creates a new instance.

+		 * @param ch the single character to match

+		 */

+		public CharacterMatch(char ch) {

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

+		}

+

+		/**

+		 * Creates a new instance.

+		 * @param chars the chars to match.

+		 */

+		public CharacterMatch(char[] chars) {

+			Assert.isNotNull(chars);

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

+			fChars= chars;

+			Arrays.sort(chars);

+		}

+

+		/*

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

+		 */

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

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

+		}

+

+		/*

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

+		 */

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

+			ITypedRegion partition= getPartition(position);

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

+				return super.nextPosition(position, forward);

+

+			if (forward) {

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

+				if (position < end)

+					return end;

+			} else {

+				int offset= partition.getOffset();

+				if (position > offset)

+					return offset - 1;

+			}

+			return super.nextPosition(position, forward);

+		}

+	}

+

+	/** The document being scanned. */

+	private final IDocument fDocument;

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

+	private final String fPartitioning;

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

+	private final String fPartition;

+

+	/* internal scan state */

+

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

+	private char fChar;

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

+	private int fPos;

+	/**

+	 * The most recently used partition.

+	 * @since 3.2

+	 */

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

+

+	/* preset stop conditions */

+	private final StopCondition fNonWSDefaultPart= new NonWhitespaceDefaultPartition();

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

+	private final StopCondition fNonIdent= new NonJavaIdentifierPartDefaultPartition();

+

+	/**

+	 * Creates a new instance.

+	 *

+	 * @param document the document to scan

+	 * @param partitioning the partitioning to use for scanning

+	 * @param partition the partition to scan in

+	 */

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

+		Assert.isLegal(document != null);

+		Assert.isLegal(partitioning != null);

+		Assert.isLegal(partition != null);

+		fDocument= document;

+		fPartitioning= partitioning;

+		fPartition= partition;

+	}

+

+	/**

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

+	 *

+	 * @param document the document to scan.

+	 */

+	public JavaHeuristicScanner(IDocument document) {

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

+	}

+

+	/**

+	 * Returns the most recent internal scan position.

+	 *

+	 * @return the most recent internal scan position.

+	 */

+	public int getPosition() {

+		return fPos;

+	}

+

+	/**

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

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

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

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

+	 *

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

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

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

+	 */

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

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

+		if (pos == NOT_FOUND)

+			return TokenEOF;

+

+		fPos++;

+

+		switch (fChar) {

+			case LBRACE:

+				return TokenLBRACE;

+			case RBRACE:

+				return TokenRBRACE;

+			case LBRACKET:

+				return TokenLBRACKET;

+			case RBRACKET:

+				return TokenRBRACKET;

+			case LPAREN:

+				return TokenLPAREN;

+			case RPAREN:

+				return TokenRPAREN;

+			case SEMICOLON:

+				return TokenSEMICOLON;

+			case COMMA:

+				return TokenCOMMA;

+			case QUESTIONMARK:

+				return TokenQUESTIONMARK;

+			case EQUAL:

+				return TokenEQUAL;

+			case LANGLE:

+				return TokenLESSTHAN;

+			case RANGLE:

+				return TokenGREATERTHAN;

+			case SQUOTE:

+				return TokenSQUOTE;

+			case DQUOTE:

+				return TokenDQUOTE;

+		}

+

+		// else

+		if (Character.isJavaIdentifierPart(fChar)) {

+			// assume an identifier or keyword

+			int from= pos, to;

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

+			if (pos == NOT_FOUND)

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

+			else

+				to= pos;

+

+			String identOrKeyword;

+			try {

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

+			} catch (BadLocationException e) {

+				return TokenEOF;

+			}

+

+			return getToken(identOrKeyword);

+

+

+		} else {

+			// operators, number literals etc

+			return TokenOTHER;

+		}

+	}

+

+	/**

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

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

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

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

+	 *

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

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

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

+	 */

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

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

+		if (pos == NOT_FOUND)

+			return TokenEOF;

+

+		fPos--;

+

+		switch (fChar) {

+			case LBRACE:

+				return TokenLBRACE;

+			case RBRACE:

+				return TokenRBRACE;

+			case LBRACKET:

+				return TokenLBRACKET;

+			case RBRACKET:

+				return TokenRBRACKET;

+			case LPAREN:

+				return TokenLPAREN;

+			case RPAREN:

+				return TokenRPAREN;

+			case SEMICOLON:

+				return TokenSEMICOLON;

+			case COLON:

+				return TokenCOLON;

+			case COMMA:

+				return TokenCOMMA;

+			case QUESTIONMARK:

+				return TokenQUESTIONMARK;

+			case EQUAL:

+				return TokenEQUAL;

+			case LANGLE:

+				return TokenLESSTHAN;

+			case RANGLE:

+				return TokenGREATERTHAN;

+			case SQUOTE:

+				return TokenSQUOTE;

+			case DQUOTE:

+				return TokenDQUOTE;

+		}

+

+		// else

+		if (Character.isJavaIdentifierPart(fChar)) {

+			// assume an ident or keyword

+			int from, to= pos + 1;

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

+			if (pos == NOT_FOUND)

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

+			else

+				from= pos + 1;

+

+			String identOrKeyword;

+			try {

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

+			} catch (BadLocationException e) {

+				return TokenEOF;

+			}

+

+			return getToken(identOrKeyword);

+

+

+		} else {

+			// operators, number literals etc

+			return TokenOTHER;

+		}

+

+	}

+

+	/**

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

+	 *

+	 * @param s a scanned identifier

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

+	 */

+	private int getToken(String s) {

+		Assert.isNotNull(s);

+

+		switch (s.length()) {

+			case 2:

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

+					return TokenIF;

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

+					return TokenDO;

+				break;

+			case 3:

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

+					return TokenFOR;

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

+					return TokenTRY;

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

+					return TokenNEW;

+				break;

+			case 4:

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

+					return TokenCASE;

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

+					return TokenELSE;

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

+					return TokenENUM;

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

+					return TokenGOTO;

+				break;

+			case 5:

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

+					return TokenBREAK;

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

+					return TokenCATCH;

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

+					return TokenCLASS;

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

+					return TokenWHILE;

+				break;

+			case 6:

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

+					return TokenRETURN;

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

+					return TokenSTATIC;

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

+					return TokenSWITCH;

+				break;

+			case 7:

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

+					return TokenDEFAULT;

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

+					return TokenFINALLY;

+				break;

+			case 9:

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

+					return TokenINTERFACE;

+				break;

+			case 12:

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

+					return TokenSYNCHRONIZED;

+				break;

+		}

+		return TokenIDENT;

+	}

+

+	/**

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

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

+	 *

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

+	 * character being searched.</p>

+	 *

+	 * @param start the start position

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

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

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

+	 */

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

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

+	}

+

+	/**

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

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

+	 *

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

+	 * character being searched.</p>

+	 *

+	 * @param start the start position

+	 * @param bound the bound

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

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

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

+	 */

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

+		Assert.isLegal(start >= 0);

+

+		try {

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

+			int depth= 1;

+			start -= 1;

+			while (true) {

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

+				if (start == NOT_FOUND)

+					return NOT_FOUND;

+

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

+					depth++;

+				else

+					depth--;

+

+				if (depth == 0)

+					return start;

+			}

+

+		} catch (BadLocationException e) {

+			return NOT_FOUND;

+		}

+	}

+

+	/**

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

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

+	 *

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

+	 * character being searched.</p>

+	 *

+	 * @param start the start position

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

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

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

+	 */

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

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

+	}

+

+	/**

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

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

+	 *

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

+	 * character being searched.</p>

+	 *

+	 * @param start the start position

+	 * @param bound the bound

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

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

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

+	 */

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

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

+

+		try {

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

+			int depth= 1;

+			start += 1;

+			while (true) {

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

+				if (start == NOT_FOUND)

+					return NOT_FOUND;

+

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

+					depth++;

+				else

+					depth--;

+

+				if (depth == 0)

+					return start;

+			}

+

+		} catch (BadLocationException e) {

+			return NOT_FOUND;

+		}

+	}

+

+	/**

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

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

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

+	 *

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

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

+	 */

+	public IRegion findSurroundingBlock(int offset) {

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

+			return null;

+

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

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

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

+			return null;

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

+	}

+

+	/**

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

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

+	 * and the position is in the default partition.

+	 *

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

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

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

+	 */

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

+		return scanForward(position, bound, fNonWSDefaultPart);

+	}

+

+	/**

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

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

+	 *

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

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

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

+	 */

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

+		return scanForward(position, bound, fNonWS);

+	}

+

+	/**

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

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

+	 * and the position is in the default partition.

+	 *

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

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

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

+	 */

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

+		return scanBackward(position, bound, fNonWSDefaultPart);

+	}

+

+	/**

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

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

+	 *

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

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

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

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

+	 */

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

+		Assert.isLegal(start >= 0);

+

+		if (bound == UNBOUND)

+			bound= fDocument.getLength();

+

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

+

+		try {

+			fPos= start;

+			while (fPos < bound) {

+

+				fChar= fDocument.getChar(fPos);

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

+					return fPos;

+

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

+			}

+		} catch (BadLocationException e) {

+		}

+		return NOT_FOUND;

+	}

+

+

+	/**

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

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

+	 * and the position is in the default partition.

+	 *

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

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

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

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

+	 */

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

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

+	}

+

+	/**

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

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

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

+	 *

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

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

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

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

+	 */

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

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

+	}

+

+	/**

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

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

+	 *

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

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

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

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

+	 */

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

+		if (bound == UNBOUND)

+			bound= -1;

+

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

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

+

+		try {

+			fPos= start;

+			while (fPos > bound) {

+

+				fChar= fDocument.getChar(fPos);

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

+					return fPos;

+

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

+			}

+		} catch (BadLocationException e) {

+		}

+		return NOT_FOUND;

+	}

+

+	/**

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

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

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

+	 *

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

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

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

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

+	 */

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

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

+	}

+

+	/**

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

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

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

+	 *

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

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

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

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

+	 */

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

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

+	}

+

+	/**

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

+	 *

+	 * @param position the position to be checked

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

+	 */

+	public boolean isDefaultPartition(int position) {

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

+	}

+

+	/**

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

+	 *

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

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

+	 *         partition if accessing the document fails

+	 */

+	private ITypedRegion getPartition(int position) {

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

+			Assert.isTrue(position >= 0);

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

+

+			try {

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

+			} catch (BadLocationException e) {

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

+			}

+		}

+

+		return fCachedPartition;

+	}

+

+	/**

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

+	 *

+	 * @param region a region

+	 * @param position an offset

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

+	 * @since 3.2

+	 */

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

+		int offset= region.getOffset();

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

+	}

+

+	/**

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

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

+	 *

+	 * <pre>

+	 * if (condition)

+	 *     doStuff();

+	 * </pre>

+	 *

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

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

+	 *

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

+	 * @param bound the lowest position to consider

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

+	 */

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

+		if (position < 1)

+			return false;

+

+		switch (previousToken(position, bound)) {

+			case TokenDO:

+			case TokenELSE:

+				return true;

+			case TokenRPAREN:

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

+				if (position > 0) {

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

+						case TokenIF:

+						case TokenFOR:

+						case TokenWHILE:

+							return true;

+					}

+				}

+		}

+

+		return false;

+	}

+

+	/**

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

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

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

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

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

+	 *

+	 * <pre>

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

+	 *  new ArrayList |(10)

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

+	 * </pre>

+	 *

+	 * but not the following:

+	 *

+	 * <pre>

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

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

+	 *  new ArrayList (10)|

+	 *  ArrayList |(10)

+	 * </pre>

+	 *

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

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

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

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

+	 *         instance creation

+	 * @since 3.2

+	 */

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

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

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

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

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

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

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

+					return false;

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

+			}

+			return token == Symbols.TokenNEW;

+		}

+		return false;

+	}

+

+	/**

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

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

+	 * This is a heuristic.

+	 *

+	 * @param identifier the identifier to check

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

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

+	 * @since 3.2

+	 */

+	public static boolean isGenericStarter(CharSequence identifier) {

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

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

+		 *

+		 * if (MAX > foo)

+		 *

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

+		 *

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

+		 */

+		int length= identifier.length();

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

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

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

+					return false;

+			}

+			return true;

+		}

+		return false;

+	}

+}

diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/Symbols.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/Symbols.java
new file mode 100644
index 0000000..171e99c
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/Symbols.java
@@ -0,0 +1,54 @@
+/*******************************************************************************

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

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

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

+ * which accompanies this distribution, and is available at

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

+ *

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

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

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

+

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

+

+interface Symbols {

+	int TokenEOF = -1;

+	int TokenLBRACE = 1;

+	int TokenRBRACE = 2;

+	int TokenLBRACKET = 3;

+	int TokenRBRACKET = 4;

+	int TokenLPAREN = 5;

+	int TokenRPAREN = 6;

+	int TokenSEMICOLON = 7;

+	int TokenOTHER = 8;

+	int TokenCOLON = 9;

+	int TokenQUESTIONMARK = 10;

+	int TokenCOMMA = 11;

+	int TokenEQUAL = 12;

+	int TokenLESSTHAN = 13;

+	int TokenGREATERTHAN = 14;

+	int TokenSQUOTE = 15;

+	int TokenDQUOTE = 16;

+	int TokenIF = 109;

+	int TokenDO = 1010;

+	int TokenFOR = 1011;

+	int TokenTRY = 1012;

+	int TokenCASE = 1013;

+	int TokenELSE = 1014;

+	int TokenBREAK = 1015;

+	int TokenCATCH = 1016;

+	int TokenWHILE = 1017;

+	int TokenRETURN = 1018;

+	int TokenSTATIC = 1019;

+	int TokenSWITCH = 1020;

+	int TokenFINALLY = 1021;

+	int TokenSYNCHRONIZED = 1022;

+	int TokenGOTO = 1023;

+	int TokenDEFAULT = 1024;

+	int TokenNEW = 1025;

+	int TokenCLASS = 1026;

+	int TokenINTERFACE = 1027;

+	int TokenENUM = 1028;

+	int TokenIDENT = 2000;

+}

diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/views/contentoutline/TLDContentOutlineConfiguration.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/views/contentoutline/TLDContentOutlineConfiguration.java
new file mode 100644
index 0000000..4444f59
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/views/contentoutline/TLDContentOutlineConfiguration.java
@@ -0,0 +1,349 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.views.contentoutline;
+
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP11TLDNames;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP12TLDNames;
+import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateAction;
+import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateActionContributionItem;
+import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImageHelper;
+import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImages;
+import org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration;
+import org.w3c.dom.Element;
+import org.w3c.dom.EntityReference;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class TLDContentOutlineConfiguration extends XMLContentOutlineConfiguration {
+
+	private class ContentLabelProvider implements ILabelProvider {
+		ILabelProvider fParentProvider = null;
+
+		ContentLabelProvider(ILabelProvider parent) {
+			super();
+			fParentProvider = parent;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see
+		 * org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse
+		 * .jface.viewers.ILabelProviderListener)
+		 */
+		public void addListener(ILabelProviderListener listener) {
+			fParentProvider.addListener(listener);
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
+		 */
+		public void dispose() {
+			fParentProvider.dispose();
+		}
+
+		private String firstLineOf(String text) {
+			if (text == null || text.length() < 1 || (text.indexOf('\r') < 0 && text.indexOf('\n') < 0)) {
+				return text;
+			}
+
+			int start = 0;
+			int maxLength = text.length();
+			while (start < maxLength && text.charAt(start) == '\r' || text.charAt(start) == '\n')
+				start++;
+			int endN = text.indexOf('\n', start);
+			int endR = text.indexOf('\r', start);
+			// no more line delimiters
+			if (endN < 0 && endR < 0) {
+				if (start == 0) {
+					// no leading line delimiters, return as-is
+					return text;
+				}
+				else {
+					// cut leading line delimiters
+					return text.substring(start);
+				}
+			}
+			if (endN < 0) {
+				/* no \r cut leading line delimiters up to first \r */
+				return text.substring(start, endR);
+			}
+			if (endR < 0) {
+				/* no \r cut leading line delimiters up to first \n */
+				return text.substring(start, endN);
+			}
+
+			/*
+			 * Both \n and \r, cut leading line delimiters up to whichever is
+			 * first
+			 */
+			return text.substring(start, Math.min(endN, endR));
+		}
+
+		private String getContainedText(Node parent) {
+			NodeList children = parent.getChildNodes();
+			if (children.getLength() == 1) {
+				return getValue(children.item(0));
+			}
+			StringBuffer s = new StringBuffer();
+			Node child = parent.getFirstChild();
+			while (child != null) {
+				if (child.getNodeType() == Node.ENTITY_REFERENCE_NODE) {
+					String reference = ((EntityReference) child).getNodeValue();
+					if (reference == null && child.getNodeName() != null) {
+						reference = "&" + child.getNodeName() + ";"; //$NON-NLS-1$ //$NON-NLS-2$
+					}
+					if (reference != null) {
+						s.append(reference.trim());
+					}
+				}
+				else {
+					s.append(getValue(child));
+				}
+				child = child.getNextSibling();
+			}
+			return s.toString().trim();
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see
+		 * org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
+		 */
+		public Image getImage(Object element) {
+			return fParentProvider.getImage(element);
+		}
+
+		/**
+		 * @param domElement
+		 * @return
+		 */
+		private String getNameValue(Element domElement) {
+			NodeList names = domElement.getElementsByTagName(JSP11TLDNames.NAME);
+			String name = null;
+			for (int i = 0; i < names.getLength() && (name == null || name.length() == 0); i++) {
+				name = getContainedText(names.item(i));
+			}
+			return name;
+		}
+
+		/**
+		 * @param domElement
+		 * @return
+		 */
+		private String getShortNameValue(Element domElement) {
+			NodeList names = domElement.getElementsByTagName(JSP12TLDNames.SHORT_NAME);
+			String name = null;
+			for (int i = 0; i < names.getLength() && (name == null || name.length() == 0); i++) {
+				name = getContainedText(names.item(i));
+			}
+			names = domElement.getElementsByTagName(JSP11TLDNames.SHORTNAME);
+			for (int i = 0; i < names.getLength() && (name == null || name.length() == 0); i++) {
+				name = getContainedText(names.item(i));
+			}
+			return name;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see
+		 * org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+		 */
+		public String getText(Object element) {
+			if (fShowContentValues && element instanceof Element) {
+				Element domElement = (Element) element;
+				String name = domElement.getNodeName();
+				boolean showName = JSP11TLDNames.TAG.equals(name);
+				showName = showName || JSP11TLDNames.ATTRIBUTE.equals(name);
+				if (showName) {
+					String value = getNameValue(domElement);
+					if (value != null && value.length() > 0) {
+						/**
+						 * Currently not externalized since it's analagous to
+						 * a decorator.
+						 */
+						return fParentProvider.getText(domElement) + " [" + firstLineOf(value) + "]"; //$NON-NLS-1$
+					}
+				}
+
+				boolean showContents = JSP11TLDNames.NAME.equals(name);
+				showContents = showContents || JSP11TLDNames.BODYCONTENT.equals(name);
+				showContents = showContents || JSP12TLDNames.BODY_CONTENT.equals(name);
+				showContents = showContents || JSP11TLDNames.TAGCLASS.equals(name);
+				showContents = showContents || JSP12TLDNames.TAG_CLASS.equals(name);
+				showContents = showContents || JSP11TLDNames.TEICLASS.equals(name);
+				showContents = showContents || JSP12TLDNames.TEI_CLASS.equals(name);
+				showContents = showContents || JSP11TLDNames.REQUIRED.equals(name);
+				showContents = showContents || JSP11TLDNames.RTEXPRVALUE.equals(name);
+				showContents = showContents || JSP11TLDNames.URI.equals(name);
+				showContents = showContents || JSP11TLDNames.SHORTNAME.equals(name);
+				showContents = showContents || JSP12TLDNames.SHORT_NAME.equals(name);
+				showContents = showContents || JSP12TLDNames.DISPLAY_NAME.equals(name);
+				showContents = showContents || JSP11TLDNames.JSPVERSION.equals(name);
+				showContents = showContents || JSP12TLDNames.JSP_VERSION.equals(name);
+				showContents = showContents || JSP11TLDNames.TLIBVERSION.equals(name);
+				showContents = showContents || JSP12TLDNames.TLIB_VERSION.equals(name);
+				showContents = showContents || JSP12TLDNames.LISTENER_CLASS.equals(name);
+				showContents = showContents || JSP12TLDNames.VARIABLE_SCOPE.equals(name);
+				showContents = showContents || JSP12TLDNames.VARIABLE_CLASS.equals(name);
+				showContents = showContents || JSP12TLDNames.VARIABLE_DECLARE.equals(name);
+				showContents = showContents || JSP12TLDNames.VARIABLE_NAME_FROM_ATTRIBUTE.equals(name);
+				showContents = showContents || JSP12TLDNames.VARIABLE_NAME_GIVEN.equals(name);
+				showContents = showContents || JSP12TLDNames.VALIDATOR_CLASS.equals(name);
+				showContents = showContents || JSP12TLDNames.SMALL_ICON.equals(name);
+				showContents = showContents || JSP12TLDNames.LARGE_ICON.equals(name);
+
+				if (showContents) {
+					return fParentProvider.getText(domElement) + ": " + getContainedText(domElement); //$NON-NLS-1$
+				}
+
+				if (JSP11TLDNames.TAGLIB.equals(name)) {
+					String value = getShortNameValue(domElement);
+					if (value != null && value.length() > 0) {
+						/**
+						 * Currently not externalized since it's analagous to
+						 * a decorator.
+						 */
+						return fParentProvider.getText(domElement) + " [" + value + "]"; //$NON-NLS-1$
+					}
+				}
+			}
+			return fParentProvider.getText(element);
+		}
+
+		private String getValue(Node n) {
+			if (n == null)
+				return ""; //$NON-NLS-1$
+			String value = n.getNodeValue();
+			if (value == null)
+				return ""; //$NON-NLS-1$
+			return value.trim();
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see
+		 * org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java
+		 * .lang.Object, java.lang.String)
+		 */
+		public boolean isLabelProperty(Object element, String property) {
+			return fParentProvider.isLabelProperty(element, property);
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see
+		 * org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org
+		 * .eclipse.jface.viewers.ILabelProviderListener)
+		 */
+		public void removeListener(ILabelProviderListener listener) {
+			fParentProvider.removeListener(listener);
+		}
+	}
+
+	/**
+	 * Toggle action for whether or not to display element's first attribute
+	 */
+	private class ToggleShowValueAction extends PropertyChangeUpdateAction {
+		private TreeViewer fTreeViewer;
+
+		public ToggleShowValueAction(IPreferenceStore store, String preference, TreeViewer treeViewer) {
+			super(JSPUIMessages.TLDContentOutlineConfiguration_0, store, preference, true);
+			setToolTipText(getText());
+			// TODO: image needed
+			setImageDescriptor(EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_OBJ_PROP_PS));
+			fTreeViewer = treeViewer;
+			update();
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.eclipse.ui.texteditor.IUpdate#update()
+		 */
+		public void update() {
+			super.update();
+			fShowContentValues = isChecked();
+
+			// refresh the outline view
+			fTreeViewer.refresh(true);
+		}
+	}
+
+	/*
+	 * Preference key for Show Attributes
+	 */
+	private final String OUTLINE_SHOW_VALUE_PREF = "outline-show-value"; //$NON-NLS-1$
+
+	boolean fShowContentValues = true;
+	ILabelProvider fLabelProvider = null;
+
+	public TLDContentOutlineConfiguration() {
+		super();
+	}
+
+	protected IContributionItem[] createMenuContributions(TreeViewer viewer) {
+		IContributionItem[] items;
+		IContributionItem showValueItem = new PropertyChangeUpdateActionContributionItem(new ToggleShowValueAction(getPreferenceStore(), OUTLINE_SHOW_VALUE_PREF, viewer));
+
+		items = super.createMenuContributions(viewer);
+		if (items == null) {
+			items = new IContributionItem[]{showValueItem};
+		}
+		else {
+			IContributionItem[] combinedItems = new IContributionItem[items.length + 1];
+			System.arraycopy(items, 0, combinedItems, 0, items.length);
+			combinedItems[items.length] = showValueItem;
+			items = combinedItems;
+		}
+		return items;
+	}
+
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration
+	 * #getLabelProvider(org.eclipse.jface.viewers.TreeViewer)
+	 */
+	public ILabelProvider getLabelProvider(TreeViewer viewer) {
+		if (fLabelProvider == null) {
+			fLabelProvider = new ContentLabelProvider(super.getLabelProvider(viewer));
+		}
+		return fLabelProvider;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
+	 * #getPreferenceStore()
+	 */
+	protected IPreferenceStore getPreferenceStore() {
+		return JSPUIPlugin.getDefault().getPreferenceStore();
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java
index edde79b..e1b5b83 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -230,16 +230,10 @@
 		GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
 		innerParent.setLayoutData(gd);
 
-		// Create linked text to just to templates preference page
-		Link link = new Link(innerParent, SWT.NONE);
-		link.setText(JSPUIMessages.NewJSPTemplatesWizardPage_6);
+		Label label = new Label(innerParent, SWT.NONE);
+		label.setText(JSPUIMessages.NewJSPTemplatesWizardPage_7);
 		data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
-		link.setLayoutData(data);
-		link.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				linkClicked();
-			}
-		});
+		label.setLayoutData(data);
 
 		// create table that displays templates
 		Table table = new Table(innerParent, SWT.BORDER | SWT.FULL_SELECTION);
@@ -294,6 +288,18 @@
 		fTemplateStore = JSPUIPlugin.getDefault().getTemplateStore();
 		fTableViewer.setInput(fTemplateStore);
 
+		// Create linked text to just to templates preference page
+		Link link = new Link(parent, SWT.NONE);
+		link.setText(JSPUIMessages.NewJSPTemplatesWizardPage_6);
+		data = new GridData(SWT.END, SWT.FILL, true, false, 2, 1);
+		link.setLayoutData(data);
+		link.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				linkClicked();
+			}
+		});
+
+
 		configureTableResizing(innerParent, table, column1, column2);
 		loadLastSavedPreferences();
 
@@ -324,7 +330,7 @@
 			}
 		};
 		SourceViewer viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
-		((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+		viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
 		IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForJSP.ContentTypeID_JSP);
 		IDocument document = scratchModel.getStructuredDocument();
 		viewer.configure(sourceViewerConfiguration);
@@ -346,6 +352,8 @@
 		data = new GridData(GridData.FILL_BOTH);
 		data.horizontalSpan = 2;
 		data.heightHint = convertHeightInCharsToPixels(5);
+		// [261274] - source viewer was growing to fit the max line width of the template
+		data.widthHint = convertWidthInCharsToPixels(2);
 		control.setLayoutData(data);
 
 		return viewer;
@@ -436,15 +444,24 @@
 	 * Load the last template name used in New JSP File wizard.
 	 */
 	private void loadLastSavedPreferences() {
+		fLastSelectedTemplateName = ""; //$NON-NLS-1$
+		boolean setSelection = false;
 		String templateName = JSPUIPlugin.getDefault().getPreferenceStore().getString(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
 		if (templateName == null || templateName.length() == 0) {
-			fLastSelectedTemplateName = ""; //$NON-NLS-1$
-			fUseTemplateButton.setSelection(false);
+			templateName = JSPUIPlugin.getDefault().getPreferenceStore().getString(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_ID);
+			if (templateName != null && templateName.length() > 0) {
+				Template template = fTemplateStore.findTemplateById(templateName);
+				if (template != null) {
+					fLastSelectedTemplateName = template.getName();
+					setSelection = true;
+				}
+			}
 		}
 		else {
 			fLastSelectedTemplateName = templateName;
-			fUseTemplateButton.setSelection(true);
+			setSelection = true;
 		}
+		fUseTemplateButton.setSelection(setSelection);
 		enableTemplates();
 	}
 
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPWizard.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPWizard.java
index 1fd2a2b..f4a929a 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPWizard.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPWizard.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -29,6 +29,8 @@
 import org.eclipse.jst.jsp.ui.internal.Logger;
 import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
 import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImages;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.INewWizard;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPage;
@@ -42,7 +44,20 @@
 	private NewJSPFileWizardPage fNewFilePage;
 	private NewJSPTemplatesWizardPage fNewFileTemplatesPage;
 	private IStructuredSelection fSelection;
+	private Display fDisplay;
 
+	private boolean fShouldOpenEditorOnFinish = true;
+	
+	public void createPageControls(Composite pageContainer) {
+		fDisplay = pageContainer.getDisplay();
+		super.createPageControls(pageContainer);
+	}
+
+	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=248424
+	public void setOpenEditorOnFinish(boolean openEditor) {
+		this.fShouldOpenEditorOnFinish = openEditor;
+	}
+	
 	public void addPages() {
 		fNewFilePage = new NewJSPFileWizardPage("JSPWizardNewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))); //$NON-NLS-1$ 
 		fNewFilePage.setTitle(JSPUIMessages._UI_WIZARD_NEW_HEADING);
@@ -71,8 +86,10 @@
 
 	private void openEditor(final IFile file) {
 		if (file != null) {
-			getShell().getDisplay().asyncExec(new Runnable() {
+			fDisplay.asyncExec(new Runnable() {
 				public void run() {
+					if (!PlatformUI.isWorkbenchRunning())
+						return;
 					try {
 						IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
 						IDE.openEditor(page, file, true);
@@ -135,7 +152,8 @@
 			}
 
 			// open the file in editor
-			openEditor(file);
+			if (fShouldOpenEditorOnFinish)
+				openEditor(file);
 
 			// everything's fine
 			performedOK = true;
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagTemplatesWizardPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagTemplatesWizardPage.java
index 0accc33..f5d01c8 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagTemplatesWizardPage.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagTemplatesWizardPage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -230,16 +230,10 @@
 		GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
 		innerParent.setLayoutData(gd);
 
-		// Create linked text to just to templates preference page
-		Link link = new Link(innerParent, SWT.NONE);
-		link.setText(JSPUIMessages.NewTagTemplatesWizardPage_6);
+		Label label = new Label(innerParent, SWT.NONE);
+		label.setText(JSPUIMessages.NewTagTemplatesWizardPage_7);
 		data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
-		link.setLayoutData(data);
-		link.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				linkClicked();
-			}
-		});
+		label.setLayoutData(data);
 
 		// create table that displays templates
 		Table table = new Table(innerParent, SWT.BORDER | SWT.FULL_SELECTION);
@@ -294,6 +288,17 @@
 		fTemplateStore = JSPUIPlugin.getDefault().getTemplateStore();
 		fTableViewer.setInput(fTemplateStore);
 
+		// Create linked text to just to templates preference page
+		Link link = new Link(parent, SWT.NONE);
+		link.setText(JSPUIMessages.NewTagTemplatesWizardPage_6);
+		data = new GridData(SWT.END, SWT.FILL, true, false, 2, 1);
+		link.setLayoutData(data);
+		link.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				linkClicked();
+			}
+		});
+
 		configureTableResizing(innerParent, table, column1, column2);
 		loadLastSavedPreferences();
 
@@ -324,7 +329,7 @@
 			}
 		};
 		SourceViewer viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
-		((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+		viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
 		IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForJSP.ContentTypeID_JSPTAG);
 		IDocument document = scratchModel.getStructuredDocument();
 		viewer.configure(sourceViewerConfiguration);
@@ -346,6 +351,8 @@
 		data = new GridData(GridData.FILL_BOTH);
 		data.horizontalSpan = 2;
 		data.heightHint = convertHeightInCharsToPixels(5);
+		// [261274] - source viewer was growing to fit the max line width of the template
+		data.widthHint = convertWidthInCharsToPixels(2);
 		control.setLayoutData(data);
 
 		return viewer;
@@ -410,7 +417,7 @@
 
 		Template template = getSelectedTemplate();
 		if (template != null) {
-			TemplateContextType contextType = JSPUIPlugin.getDefault().getTemplateContextRegistry().getContextType(TemplateContextTypeIdsJSP.NEW);
+			TemplateContextType contextType = JSPUIPlugin.getDefault().getTemplateContextRegistry().getContextType(TemplateContextTypeIdsJSP.NEW_TAG);
 			IDocument document = new Document();
 			TemplateContext context = new DocumentTemplateContext(contextType, document, 0, 0);
 			try {
@@ -418,7 +425,7 @@
 				templateString = buffer.getString();
 			}
 			catch (Exception e) {
-				Logger.log(Logger.WARNING_DEBUG, "Could not create template for new jsp", e); //$NON-NLS-1$
+				Logger.log(Logger.WARNING_DEBUG, "Could not create template for new jsp tag", e); //$NON-NLS-1$
 			}
 		}
 
@@ -436,15 +443,24 @@
 	 * Load the last template name used in New JSP File wizard.
 	 */
 	private void loadLastSavedPreferences() {
-		String templateName = JSPUIPlugin.getDefault().getPreferenceStore().getString(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
+		fLastSelectedTemplateName = ""; //$NON-NLS-1$
+		boolean setSelection = false;
+		String templateName = JSPUIPlugin.getDefault().getPreferenceStore().getString(JSPUIPreferenceNames.NEW_TAG_FILE_TEMPLATE_NAME);
 		if (templateName == null || templateName.length() == 0) {
-			fLastSelectedTemplateName = ""; //$NON-NLS-1$
-			fUseTemplateButton.setSelection(false);
+			templateName = JSPUIPlugin.getDefault().getPreferenceStore().getString(JSPUIPreferenceNames.NEW_TAG_FILE_TEMPLATE_ID);
+			if (templateName != null && templateName.length() > 0) {
+				Template template = fTemplateStore.findTemplateById(templateName);
+				if (template != null) {
+					fLastSelectedTemplateName = template.getName();
+					setSelection = true;
+				}
+			}
 		}
 		else {
 			fLastSelectedTemplateName = templateName;
-			fUseTemplateButton.setSelection(true);
+			setSelection = true;
 		}
+		fUseTemplateButton.setSelection(setSelection);
 		enableTemplates();
 	}
 
@@ -459,7 +475,7 @@
 			templateName = template.getName();
 		}
 
-		JSPUIPlugin.getDefault().getPreferenceStore().setValue(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
+		JSPUIPlugin.getDefault().getPreferenceStore().setValue(JSPUIPreferenceNames.NEW_TAG_FILE_TEMPLATE_NAME, templateName);
 		JSPUIPlugin.getDefault().savePluginPreferences();
 	}
 
@@ -475,7 +491,7 @@
 
 		if (templateName != null && templateName.length() > 0) {
 			// pick the last used template
-			template = fTemplateStore.findTemplate(templateName, TemplateContextTypeIdsJSP.NEW);
+			template = fTemplateStore.findTemplate(templateName, TemplateContextTypeIdsJSP.NEW_TAG);
 		}
 
 		// no record of last used template so just pick first element
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/views/contentoutline/JSPContentOutlineConfiguration.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/views/contentoutline/JSPContentOutlineConfiguration.java
index f9a1570..aaee92b 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/views/contentoutline/JSPContentOutlineConfiguration.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/views/contentoutline/JSPContentOutlineConfiguration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,8 +11,12 @@
 package org.eclipse.jst.jsp.ui.views.contentoutline;
 
 import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+import org.eclipse.jst.jsp.ui.internal.actions.JSPNodeActionManager;
 import org.eclipse.wst.html.ui.views.contentoutline.HTMLContentOutlineConfiguration;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
 
 /**
  * Configuration for outline view page which shows JSP content.
@@ -48,4 +52,8 @@
 	protected IPreferenceStore getPreferenceStore() {
 		return JSPUIPlugin.getDefault().getPreferenceStore();
 	}
+	
+	protected XMLNodeActionManager createNodeActionManager(TreeViewer treeViewer) {
+		return new JSPNodeActionManager((IStructuredModel) treeViewer.getInput(), treeViewer);
+	}
 }
diff --git a/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.properties b/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.properties
index 3146f83..c629a8b 100644
--- a/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.properties
+++ b/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.properties
@@ -57,4 +57,4 @@
 
 Templates.simpletagx.name=New TagX File
 Templates.simpletagx.desc=New JSP TagX File
-Templates.simpletagx.content=<jsp:directive.tag language="java" pageEncoding="${encoding}">\n
+Templates.simpletagx.content=<jsp:directive.tag language="java" pageEncoding="${encoding}"/>\n
diff --git a/bundles/org.eclipse.jst.standard.schemas/.classpath b/bundles/org.eclipse.jst.standard.schemas/.classpath
deleted file mode 100644
index d9b8811..0000000
--- a/bundles/org.eclipse.jst.standard.schemas/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry exported="true" kind="lib" path=""/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="output" path=""/>
-</classpath>
diff --git a/bundles/org.eclipse.jst.standard.schemas/.project b/bundles/org.eclipse.jst.standard.schemas/.project
index 1bce4bd..07974e9 100644
--- a/bundles/org.eclipse.jst.standard.schemas/.project
+++ b/bundles/org.eclipse.jst.standard.schemas/.project
@@ -6,11 +6,6 @@
 	</projects>
 	<buildSpec>
 		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
 			<name>org.eclipse.pde.ManifestBuilder</name>
 			<arguments>
 			</arguments>
@@ -23,6 +18,5 @@
 	</buildSpec>
 	<natures>
 		<nature>org.eclipse.pde.PluginNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
 	</natures>
 </projectDescription>
diff --git a/bundles/org.eclipse.jst.standard.schemas/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.jst.standard.schemas/.settings/org.eclipse.core.resources.prefs
index 79ae132..7b5c092 100644
--- a/bundles/org.eclipse.jst.standard.schemas/.settings/org.eclipse.core.resources.prefs
+++ b/bundles/org.eclipse.jst.standard.schemas/.settings/org.eclipse.core.resources.prefs
@@ -1,3 +1,4 @@
-#Sat Apr 28 03:39:56 EDT 2007
-eclipse.preferences.version=1
+#Tue Feb 09 17:53:02 EST 2010
 encoding/<project>=ISO-8859-1
+eclipse.preferences.version=1
+encoding//dtdsAndSchemas/web-facelettaglibrary_2_0.xsd=UTF8
diff --git a/bundles/org.eclipse.jst.standard.schemas/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.standard.schemas/META-INF/MANIFEST.MF
index 8e3eddb..49ab122 100644
--- a/bundles/org.eclipse.jst.standard.schemas/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jst.standard.schemas/META-INF/MANIFEST.MF
@@ -2,8 +2,6 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name.0
 Bundle-SymbolicName: org.eclipse.jst.standard.schemas;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.1.0.qualifier
 Bundle-Vendor: %Bundle-Vendor.0
-Require-Bundle: org.eclipse.wst.xml.core
 Bundle-Localization: plugin
-Bundle-ClassPath: .
diff --git a/bundles/org.eclipse.jst.standard.schemas/about.html b/bundles/org.eclipse.jst.standard.schemas/about.html
index 56376da..bd6b308 100644
--- a/bundles/org.eclipse.jst.standard.schemas/about.html
+++ b/bundles/org.eclipse.jst.standard.schemas/about.html
@@ -2,22 +2,95 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-<title>Untitled Document</title>
+<title>About</title>
 </head>
 
 <body>
-<p>June 21, 2007</p>
+<p>January, 2010</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/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</a>.   For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-<p>If you did not receive this Content directly from the Eclipse Foundation, the   Content is being redistributed by another party (&quot;Redistributor&quot;) and different   terms and conditions may apply to your use of any object code in the Content.   Check the Redistributor's license that was provided with the Content. If no such   license exists, contact the Redistributor. Unless otherwise indicated below, the   terms and conditions of the EPL still apply to any source code in the Content   and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org/</a>.</p>
+<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/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+<p>If you did not receive this Content directly from the Eclipse
+Foundation, the Content is being redistributed by another party
+(&quot;Redistributor&quot;) and different terms and conditions may apply
+to your use of any object code in the Content. Check the Redistributor's
+license that was provided with the Content. If no such license exists,
+contact the Redistributor. Unless otherwise indicated below, the terms
+and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a
+	href="http://www.eclipse.org/">http://www.eclipse.org/</a>.</p>
 <h3>Third Party Content</h3>
-<p>The Content includes items that have been sourced from third parties as set out below. If you   did not receive this Content directly from the Eclipse Foundation, the following is provided   for informational purposes only, and you should look to the Redistributor's license for   terms and conditions of use.</p>
-<h4>Appserv Commons schemas and DTDs v2_b33 (Subset) </h4>
-<p>Your use of the Appserv Commons schemas and DTDs is subject to the terms and  conditions of the Common Development and Distribution License v1.0. A  copy of the license is contained  in the file <a href="about_files/CDDLv1.0.txt">LICENSE.txt</a> and is also available at <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">https://glassfish.dev.java.net/public/CDDLv1.0.html</a>. </p>
-<p>The source for the schemas and DTDs is available on the Glassfish community website at <a href="https://glassfish.dev.java.net/public/downloadsindex.html">https://glassfish.dev.java.net/</a>. </p>
+<p>The Content includes items that have been sourced from third
+parties as set out below. If you did not receive this Content directly
+from the Eclipse Foundation, the following is provided for informational
+purposes only, and you should look to the Redistributor's license for
+terms and conditions of use.</p>
+<h4>Appserv Commons schemas and DTDs v2_b33 (Subset)</h4>
+<p>Your use of the Appserv Commons schemas and DTDs is subject to
+the terms and conditions of the Common Development and Distribution
+License v1.0. A copy of the license is contained in the file <a
+	href="about_files/CDDLv1.0.txt">LICENSE.txt</a> and is also available
+at <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">https://glassfish.dev.java.net/public/CDDLv1.0.html</a>.
+</p>
+<p>The source for the schemas and DTDs is available on the Glassfish
+community website at <a
+	href="https://glassfish.dev.java.net/public/downloadsindex.html">https://glassfish.dev.java.net/</a>.
+</p>
 
-<h4>Java Server Faces 1.2 schema and DTDs (Subset) </h4>
-<p>Your use of the Java Server Faces schemas and DTDs is subject to the terms and  conditions of the Common Development and Distribution License v1.0. A  copy of the license is contained  in the file <a href="about_files/CDDLv1.0.txt">LICENSE.txt</a> and is also available at <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">https://glassfish.dev.java.net/public/CDDLv1.0.html</a>. </p>
-<p>The source for the schemas and DTDs is available on the Java Server Faces project page on the Glassfish community website at <a href="https://javaserverfaces.dev.java.net">https://javaserverfaces.dev.java.net/</a>. </p>
+<h4>Java Server Faces 1.2 Schema and DTDs (Subset)</h4>
+<p>Your use of the Java Server Faces schemas and DTDs is subject to
+the terms and conditions of the Common Development and Distribution
+License v1.0. A copy of the license is contained in the file <a
+	href="about_files/CDDLv1.0.txt">LICENSE.txt</a> and is also available
+at <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">https://glassfish.dev.java.net/public/CDDLv1.0.html</a>.
+</p>
+<p>The source for the schemas and DTDs is available on the Java
+Server Faces project page on the Glassfish community website at <a
+	href="https://javaserverfaces.dev.java.net">https://javaserverfaces.dev.java.net/</a>.
+</p>
+
+<h4>Java Persistence API XML Schemas</h4>
+<p>Your use of the Java Persistence API XML Schemas (orm_1_0.xsd,
+persistence_1_0.xsd) is subject to the terms and conditions of the
+Common Development and Distribution License v1.0. A copy of the license
+is contained in the file <a href="about_files/CDDLv1.0.txt">LICENSE.txt</a>
+and is also available at <a
+	href="https://glassfish.dev.java.net/public/CDDLv1.0.html">https://glassfish.dev.java.net/public/CDDLv1.0.html</a>.
+</p>
+<p>The original source for the schemas is available on <a
+	href="http://java.sun.com/xml/ns/persistence/">http://java.sun.com/xml/ns/persistence/</a>.
+</p>
+
+<h4>Java EE 6 XML Schemas</h4>
+<p>Your use of the Java EE 6 XML Schemas (application_6.xsd,
+application-client-6.xsd, connector_1_6.xsd, ejb-jar_3_1.xsd,
+javaee_6.xsd, javaee_web_services_1_3.xsd,
+javaee_web_services_client_1_3.xsd, jsp_2_2.xsd, web-app_3_0.xsd,
+web-common_3_0.xsd, web-fragment_3_0.xsd) is subject to the terms and
+conditions of the Common Development and Distribution License v1.0. A
+copy of the license is contained in the file <a
+	href="about_files/CDDLv1.0.txt">LICENSE.txt</a> and is also available
+at <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">https://glassfish.dev.java.net/public/CDDLv1.0.html</a>.
+</p>
+<p>The original source for the schemas is available on <a
+	href="http://java.sun.com/xml/ns/javaee/">http://java.sun.com/xml/ns/javaee/</a>.
+</p>
+
+<h4>Java Server Faces 2.0 Schema</h4>
+<p>Your use of the Java Server Faces 2.0 schemas is subject to the
+terms and conditions of the Common Development and Distribution License
+v1.0. A copy of the license is contained in the file <a
+	href="about_files/CDDLv1.0.txt">LICENSE.txt</a> and is also available
+at <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">https://glassfish.dev.java.net/public/CDDLv1.0.html</a>.
+</p>
+<p>The source for the schema is available on the Java Server Faces
+project page on the Glassfish community website at <a
+	href="https://javaserverfaces.dev.java.net">https://javaserverfaces.dev.java.net/</a>.
+</p>
+
 </body>
 </html>
diff --git a/bundles/org.eclipse.jst.standard.schemas/build.properties b/bundles/org.eclipse.jst.standard.schemas/build.properties
index 0d3a900..bb81a90 100644
--- a/bundles/org.eclipse.jst.standard.schemas/build.properties
+++ b/bundles/org.eclipse.jst.standard.schemas/build.properties
@@ -6,8 +6,6 @@
                about.html,\
                about_files/
 src.includes = dtdsAndSchemas/,\
-               plugin.xml,\
-               META-INF/,\
-               plugin.properties,\
                about.html,\
                about_files/
+generateSourceBundle=false
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_6.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_6.xsd
new file mode 100644
index 0000000..4a8e5e9
--- /dev/null
+++ b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application-client_6.xsd
@@ -0,0 +1,311 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://java.sun.com/xml/ns/javaee"
+            xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified"
+            version="6">
+  <xsd:annotation>
+    <xsd:documentation>
+
+      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+      
+      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
+      
+      The contents of this file are subject to the terms of either the
+      GNU General Public License Version 2 only ("GPL") or the Common
+      Development and Distribution License("CDDL") (collectively, the
+      "License").  You may not use this file except in compliance with
+      the License. You can obtain a copy of the License at
+      https://glassfish.dev.java.net/public/CDDL+GPL.html or
+      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
+      specific language governing permissions and limitations under the
+      License.
+      
+      When distributing the software, include this License Header
+      Notice in each file and include the License file at
+      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
+      particular file as subject to the "Classpath" exception as
+      provided by Sun in the GPL Version 2 section of the License file
+      that accompanied this code.  If applicable, add the following
+      below the License Header, with the fields enclosed by brackets []
+      replaced by your own identifying information:
+      "Portions Copyrighted [year] [name of copyright owner]"
+      
+      Contributor(s):
+      
+      If you wish your version of this file to be governed by only the
+      CDDL or only the GPL Version 2, indicate your decision by adding
+      "[Contributor] elects to include this software in this
+      distribution under the [CDDL or GPL Version 2] license."  If you
+      don't indicate a single choice of license, a recipient has the
+      option to distribute your version of this file under either the
+      CDDL, the GPL Version 2 or to extend the choice of license to its
+      licensees as provided above.  However, if you add GPL Version 2
+      code and therefore, elected the GPL Version 2 license, then the
+      option applies only if the new code is made subject to such
+      option by the copyright holder.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+      <![CDATA[[
+      This is the XML Schema for the application client 6
+      deployment descriptor.  The deployment descriptor must
+      be named "META-INF/application-client.xml" in the
+      application client's jar file.  All application client
+      deployment descriptors must indicate the application
+      client schema by using the Java EE namespace:
+      
+      http://java.sun.com/xml/ns/javaee
+      
+      and indicate the version of the schema by
+      using the version element as shown below:
+      
+      <application-client xmlns="http://java.sun.com/xml/ns/javaee"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
+      	http://java.sun.com/xml/ns/javaee/application-client_6.xsd"
+      version="6">
+      ...
+      </application-client>
+      
+      The instance documents may indicate the published version of
+      the schema using the xsi:schemaLocation attribute for Java EE
+      namespace with the following location:
+      
+      http://java.sun.com/xml/ns/javaee/application-client_6.xsd
+      
+      ]]>
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      The following conventions apply to all Java EE
+      deployment descriptor elements unless indicated otherwise.
+      
+      - In elements that specify a pathname to a file within the
+      same JAR file, relative filenames (i.e., those not
+      starting with "/") are considered relative to the root of
+      the JAR file's namespace.  Absolute filenames (i.e., those
+      starting with "/") also specify names in the root of the
+      JAR file's namespace.  In general, relative names are
+      preferred.  The exception is .war files where absolute
+      names are preferred for consistency with the Servlet API.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:include schemaLocation="javaee_6.xsd"/>
+
+
+<!-- **************************************************** -->
+
+  <xsd:element name="application-client"
+               type="javaee:application-clientType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The application-client element is the root element of an
+        application client deployment descriptor.  The application
+        client deployment descriptor describes the EJB components
+        and external resources referenced by the application
+        client.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:unique name="env-entry-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The env-entry-name element contains the name of an
+          application client's environment entry.  The name is a JNDI
+          name relative to the java:comp/env context.  The name must
+          be unique within an application client.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:env-entry"/>
+      <xsd:field xpath="javaee:env-entry-name"/>
+    </xsd:unique>
+    <xsd:unique name="ejb-ref-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The ejb-ref-name element contains the name of an EJB
+          reference. The EJB reference is an entry in the application
+          client's environment and is relative to the
+          java:comp/env context. The name must be unique within the
+          application client.
+          
+          It is recommended that name is prefixed with "ejb/".
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:ejb-ref"/>
+      <xsd:field xpath="javaee:ejb-ref-name"/>
+    </xsd:unique>
+    <xsd:unique name="res-ref-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The res-ref-name element specifies the name of a
+          resource manager connection factory reference.The name
+          is a JNDI name relative to the java:comp/env context.
+          The name must be unique within an application client.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:resource-ref"/>
+      <xsd:field xpath="javaee:res-ref-name"/>
+    </xsd:unique>
+    <xsd:unique name="resource-env-ref-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The resource-env-ref-name element specifies the name of
+          a resource environment reference; its value is the
+          environment entry name used in the application client
+          code. The name is a JNDI name relative to the
+          java:comp/env context and must be unique within an
+          application client.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:resource-env-ref"/>
+      <xsd:field xpath="javaee:resource-env-ref-name"/>
+    </xsd:unique>
+    <xsd:unique name="message-destination-ref-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The message-destination-ref-name element specifies the
+          name of a message destination reference; its value is
+          the message destination reference name used in the
+          application client code. The name is a JNDI name
+          relative to the java:comp/env context and must be unique
+          within an application client.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:message-destination-ref"/>
+      <xsd:field xpath="javaee:message-destination-ref-name"/>
+    </xsd:unique>
+  </xsd:element>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="application-clientType">
+    <xsd:sequence>
+      <xsd:element name="module-name"
+                   type="javaee:string"
+                   minOccurs="0"/>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="env-entry"
+                   type="javaee:env-entryType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="ejb-ref"
+                   type="javaee:ejb-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:group ref="javaee:service-refGroup"/>
+      <xsd:element name="resource-ref"
+                   type="javaee:resource-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="resource-env-ref"
+                   type="javaee:resource-env-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="message-destination-ref"
+                   type="javaee:message-destination-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="persistence-unit-ref"
+                   type="javaee:persistence-unit-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="post-construct"
+                   type="javaee:lifecycle-callbackType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="pre-destroy"
+                   type="javaee:lifecycle-callbackType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="callback-handler"
+                   type="javaee:fully-qualified-classType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The callback-handler element names a class provided by
+            the application.  The class must have a no args
+            constructor and must implement the
+            javax.security.auth.callback.CallbackHandler
+            interface.  The class will be instantiated by the
+            application client container and used by the container
+            to collect authentication information from the user.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="message-destination"
+                   type="javaee:message-destinationType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="data-source"
+                   type="javaee:data-sourceType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="version"
+                   type="javaee:dewey-versionType"
+                   fixed="6"
+                   use="required">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The required value for the version is 6.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="metadata-complete"
+                   type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The metadata-complete attribute defines whether this
+          deployment descriptor and other related deployment
+          descriptors for this module (e.g., web service
+          descriptors) are complete, or whether the class
+          files available to this module and packaged with
+          this application should be examined for annotations
+          that specify deployment information.
+          
+          If metadata-complete is set to "true", the deployment
+          tool must ignore any annotations that specify deployment
+          information, which might be present in the class files
+          of the application.
+          
+          If metadata-complete is not specified or is set to
+          "false", the deployment tool must examine the class
+          files of the application for annotations, as
+          specified by the specifications.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_6.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_6.xsd
new file mode 100644
index 0000000..26111c6
--- /dev/null
+++ b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/application_6.xsd
@@ -0,0 +1,394 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://java.sun.com/xml/ns/javaee"
+            xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified"
+            version="6">
+  <xsd:annotation>
+    <xsd:documentation>
+
+      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+      
+      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
+      
+      The contents of this file are subject to the terms of either the
+      GNU General Public License Version 2 only ("GPL") or the Common
+      Development and Distribution License("CDDL") (collectively, the
+      "License").  You may not use this file except in compliance with
+      the License. You can obtain a copy of the License at
+      https://glassfish.dev.java.net/public/CDDL+GPL.html or
+      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
+      specific language governing permissions and limitations under the
+      License.
+      
+      When distributing the software, include this License Header
+      Notice in each file and include the License file at
+      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
+      particular file as subject to the "Classpath" exception as
+      provided by Sun in the GPL Version 2 section of the License file
+      that accompanied this code.  If applicable, add the following
+      below the License Header, with the fields enclosed by brackets []
+      replaced by your own identifying information:
+      "Portions Copyrighted [year] [name of copyright owner]"
+      
+      Contributor(s):
+      
+      If you wish your version of this file to be governed by only the
+      CDDL or only the GPL Version 2, indicate your decision by adding
+      "[Contributor] elects to include this software in this
+      distribution under the [CDDL or GPL Version 2] license."  If you
+      don't indicate a single choice of license, a recipient has the
+      option to distribute your version of this file under either the
+      CDDL, the GPL Version 2 or to extend the choice of license to its
+      licensees as provided above.  However, if you add GPL Version 2
+      code and therefore, elected the GPL Version 2 license, then the
+      option applies only if the new code is made subject to such
+      option by the copyright holder.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+      <![CDATA[[
+      This is the XML Schema for the application 6 deployment
+      descriptor.  The deployment descriptor must be named
+      "META-INF/application.xml" in the application's ear file.
+      All application deployment descriptors must indicate
+      the application schema by using the Java EE namespace:
+      
+      http://java.sun.com/xml/ns/javaee
+      
+      and indicate the version of the schema by
+      using the version element as shown below:
+      
+      <application xmlns="http://java.sun.com/xml/ns/javaee"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
+      	http://java.sun.com/xml/ns/javaee/application_6.xsd"
+      version="6">
+      ...
+      </application>
+      
+      The instance documents may indicate the published version of
+      the schema using the xsi:schemaLocation attribute for Java EE
+      namespace with the following location:
+      
+      http://java.sun.com/xml/ns/javaee/application_6.xsd
+      
+      ]]>
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      The following conventions apply to all Java EE
+      deployment descriptor elements unless indicated otherwise.
+      
+      - In elements that specify a pathname to a file within the
+      same JAR file, relative filenames (i.e., those not
+      starting with "/") are considered relative to the root of
+      the JAR file's namespace.  Absolute filenames (i.e., those
+      starting with "/") also specify names in the root of the
+      JAR file's namespace.  In general, relative names are
+      preferred.  The exception is .war files where absolute
+      names are preferred for consistency with the Servlet API.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:include schemaLocation="javaee_6.xsd"/>
+
+
+<!-- **************************************************** -->
+
+  <xsd:element name="application"
+               type="javaee:applicationType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The application element is the root element of a Java EE
+        application deployment descriptor.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:unique name="context-root-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The context-root element content must be unique
+          in the ear. 
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:module/javaee:web"/>
+      <xsd:field xpath="javaee:context-root"/>
+    </xsd:unique>
+    <xsd:unique name="security-role-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The security-role-name element content
+          must be unique in the ear.  
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:security-role"/>
+      <xsd:field xpath="javaee:role-name"/>
+    </xsd:unique>
+  </xsd:element>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="applicationType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The applicationType defines the structure of the
+        application. 
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="application-name"
+                   type="javaee:string"
+                   minOccurs="0"/>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="initialize-in-order"
+                   type="javaee:generic-booleanType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            If initialize-in-order is true, modules must be initialized
+            in the order they're listed in this deployment descriptor,
+            with the exception of application client modules, which can
+            be initialized in any order.
+            If initialize-in-order is not set or set to false, the order
+            of initialization is unspecified and may be product-dependent.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="module"
+                   type="javaee:moduleType"
+                   maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The application deployment descriptor must have one
+            module element for each Java EE module in the
+            application package. A module element is defined 
+            by moduleType definition. 
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="security-role"
+                   type="javaee:security-roleType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="library-directory"
+                   type="javaee:pathType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The library-directory element specifies the pathname
+            of a directory within the application package, relative
+            to the top level of the application package.  All files
+            named "*.jar" in this directory must be made available
+            in the class path of all components included in this
+            application package.  If this element isn't specified,
+            the directory named "lib" is searched.  An empty element
+            may be used to disable searching.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="env-entry"
+                   type="javaee:env-entryType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="ejb-ref"
+                   type="javaee:ejb-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="ejb-local-ref"
+                   type="javaee:ejb-local-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:group ref="javaee:service-refGroup"/>
+      <xsd:element name="resource-ref"
+                   type="javaee:resource-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="resource-env-ref"
+                   type="javaee:resource-env-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="message-destination-ref"
+                   type="javaee:message-destination-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="persistence-context-ref"
+                   type="javaee:persistence-context-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="persistence-unit-ref"
+                   type="javaee:persistence-unit-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="message-destination"
+                   type="javaee:message-destinationType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="data-source"
+                   type="javaee:data-sourceType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="version"
+                   type="javaee:dewey-versionType"
+                   fixed="6"
+                   use="required">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The required value for the version is 6.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="moduleType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The moduleType defines a single Java EE module and contains a
+        connector, ejb, java, or web element, which indicates the
+        module type and contains a path to the module file, and an
+        optional alt-dd element, which specifies an optional URI to
+        the post-assembly version of the deployment descriptor.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice>
+        <xsd:element name="connector"
+                     type="javaee:pathType">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The connector element specifies the URI of a
+              resource adapter archive file, relative to the
+              top level of the application package.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="ejb"
+                     type="javaee:pathType">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The ejb element specifies the URI of an ejb-jar,
+              relative to the top level of the application
+              package.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="java"
+                     type="javaee:pathType">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The java element specifies the URI of a java
+              application client module, relative to the top
+              level of the application package.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="web"
+                     type="javaee:webType"/>
+      </xsd:choice>
+      <xsd:element name="alt-dd"
+                   type="javaee:pathType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The alt-dd element specifies an optional URI to the
+            post-assembly version of the deployment descriptor
+            file for a particular Java EE module.  The URI must
+            specify the full pathname of the deployment
+            descriptor file relative to the application's root
+            directory. If alt-dd is not specified, the deployer
+            must read the deployment descriptor from the default
+            location and file name required by the respective
+            component specification.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="webType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The webType defines the web-uri and context-root of
+        a web application module.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="web-uri"
+                   type="javaee:pathType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The web-uri element specifies the URI of a web
+            application file, relative to the top level of the
+            application package.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="context-root"
+                   type="javaee:string">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The context-root element specifies the context root
+            of a web application.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/connector_1_6.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/connector_1_6.xsd
new file mode 100644
index 0000000..45d875c
--- /dev/null
+++ b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/connector_1_6.xsd
@@ -0,0 +1,1261 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://java.sun.com/xml/ns/javaee"
+            xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified"
+            version="1.6">
+  <xsd:annotation>
+    <xsd:documentation>
+
+      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+      
+      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
+      
+      The contents of this file are subject to the terms of either the
+      GNU General Public License Version 2 only ("GPL") or the Common
+      Development and Distribution License("CDDL") (collectively, the
+      "License").  You may not use this file except in compliance with
+      the License. You can obtain a copy of the License at
+      https://glassfish.dev.java.net/public/CDDL+GPL.html or
+      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
+      specific language governing permissions and limitations under the
+      License.
+      
+      When distributing the software, include this License Header
+      Notice in each file and include the License file at
+      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
+      particular file as subject to the "Classpath" exception as
+      provided by Sun in the GPL Version 2 section of the License file
+      that accompanied this code.  If applicable, add the following
+      below the License Header, with the fields enclosed by brackets []
+      replaced by your own identifying information:
+      "Portions Copyrighted [year] [name of copyright owner]"
+      
+      Contributor(s):
+      
+      If you wish your version of this file to be governed by only the
+      CDDL or only the GPL Version 2, indicate your decision by adding
+      "[Contributor] elects to include this software in this
+      distribution under the [CDDL or GPL Version 2] license."  If you
+      don't indicate a single choice of license, a recipient has the
+      option to distribute your version of this file under either the
+      CDDL, the GPL Version 2 or to extend the choice of license to its
+      licensees as provided above.  However, if you add GPL Version 2
+      code and therefore, elected the GPL Version 2 license, then the
+      option applies only if the new code is made subject to such
+      option by the copyright holder.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+      
+      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
+      
+      The contents of this file are subject to the terms of either the
+      GNU General Public License Version 2 only ("GPL") or the Common
+      Development and Distribution License("CDDL") (collectively, the
+      "License").  You may not use this file except in compliance with
+      the License. You can obtain a copy of the License at
+      https://glassfish.dev.java.net/public/CDDL+GPL.html or
+      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
+      specific language governing permissions and limitations under the
+      License.
+      
+      When distributing the software, include this License Header
+      Notice in each file and include the License file at
+      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
+      particular file as subject to the "Classpath" exception as
+      provided by Sun in the GPL Version 2 section of the License file
+      that accompanied this code.  If applicable, add the following
+      below the License Header, with the fields enclosed by brackets []
+      replaced by your own identifying information:
+      "Portions Copyrighted [year] [name of copyright owner]"
+      
+      Contributor(s):
+      
+      If you wish your version of this file to be governed by only the
+      CDDL or only the GPL Version 2, indicate your decision by adding
+      "[Contributor] elects to include this software in this
+      distribution under the [CDDL or GPL Version 2] license."  If you
+      don't indicate a single choice of license, a recipient has the
+      option to distribute your version of this file under either the
+      CDDL, the GPL Version 2 or to extend the choice of license to its
+      licensees as provided above.  However, if you add GPL Version 2
+      code and therefore, elected the GPL Version 2 license, then the
+      option applies only if the new code is made subject to such
+      option by the copyright holder.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+      <![CDATA[[
+      This is the XML Schema for the Connector 1.6 deployment
+      descriptor.  The deployment descriptor must be named
+      "META-INF/ra.xml" in the connector's rar file.  All Connector
+      deployment descriptors must indicate the connector resource
+      adapter schema by using the Java EE namespace:
+      
+      http://java.sun.com/xml/ns/javaee
+      
+      and by indicating the version of the schema by
+      using the version element as shown below:
+      
+      <connector xmlns="http://java.sun.com/xml/ns/javaee"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+      	 http://java.sun.com/xml/ns/javaee/connector_1_6.xsd"
+      version="1.6">
+      ...
+      </connector>
+      
+      The instance documents may indicate the published version of
+      the schema using the xsi:schemaLocation attribute for Java EE
+      namespace with the following location:
+      
+      http://java.sun.com/xml/ns/javaee/connector_1_6.xsd
+      
+      ]]>
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      The following conventions apply to all Java EE
+      deployment descriptor elements unless indicated otherwise.
+      
+      - In elements that specify a pathname to a file within the
+      same JAR file, relative filenames (i.e., those not
+      starting with "/") are considered relative to the root of
+      the JAR file's namespace.  Absolute filenames (i.e., those
+      starting with "/") also specify names in the root of the
+      JAR file's namespace.  In general, relative names are
+      preferred.  The exception is .war files where absolute
+      names are preferred for consistency with the Servlet API.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:include schemaLocation="javaee_6.xsd"/>
+
+
+<!-- **************************************************** -->
+
+  <xsd:element name="connector"
+               type="javaee:connectorType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The connector element is the root element of the deployment
+        descriptor for the resource adapter. This element includes
+        general information - vendor name, resource adapter version,
+        icon - about the resource adapter module. It also includes
+        information specific to the implementation of the resource
+        adapter library as specified through the element
+        resourceadapter.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+  </xsd:element>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="activationspecType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The activationspecType specifies an activation
+        specification.  The information includes fully qualified
+        Java class name of an activation specification and a set of
+        required configuration property names.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="activationspec-class"
+                   type="javaee:fully-qualified-classType">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            The element activationspec-class specifies the fully
+            qualified Java class name of the activation
+            specification class. This class must implement the
+            javax.resource.spi.ActivationSpec interface. The
+            implementation of this class is required to be a
+            JavaBean.
+            
+            Example:
+            	  <activationspec-class>com.wombat.ActivationSpecImpl
+            	  </activationspec-class>
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="required-config-property"
+                   type="javaee:required-config-propertyType"
+                   minOccurs="0"
+                   maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The required-config-property element is deprecated since
+            Connectors 1.6 specification. The resource adapter 
+            implementation is recommended to use the @NotNull
+            Bean Validation annotation or its XML validation
+            descriptor equivalent to indicate that a configuration
+            property is required to be specified by the deployer.
+            See the Connectors specification for more information. 
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="config-property"
+                   type="javaee:config-propertyType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="adminobjectType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The adminobjectType specifies information about an
+        administered object.  Administered objects are specific to a
+        messaging style or message provider.  This contains
+        information on the Java type of the interface implemented by
+        an administered object, its Java class name and its
+        configuration properties.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="adminobject-interface"
+                   type="javaee:fully-qualified-classType">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            The element adminobject-interface specifies the
+            fully qualified name of the Java type of the
+            interface implemented by an administered object.
+            
+            Example:
+            	<adminobject-interface>javax.jms.Destination
+            	</adminobject-interface>
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="adminobject-class"
+                   type="javaee:fully-qualified-classType">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            The element adminobject-class specifies the fully
+            qualified Java class name of an administered object.
+            
+            Example:
+            	  <adminobject-class>com.wombat.DestinationImpl
+            	  </adminobject-class>
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="config-property"
+                   type="javaee:config-propertyType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="authentication-mechanismType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The authentication-mechanismType specifies an authentication
+        mechanism supported by the resource adapter. Note that this
+        support is for the resource adapter and not for the
+        underlying EIS instance. The optional description specifies
+        any resource adapter specific requirement for the support of
+        security contract and authentication mechanism.
+        
+        Note that BasicPassword mechanism type should support the
+        javax.resource.spi.security.PasswordCredential interface.
+        The Kerbv5 mechanism type should support the
+        org.ietf.jgss.GSSCredential interface or the deprecated
+        javax.resource.spi.security.GenericCredential interface.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="authentication-mechanism-type"
+                   type="javaee:xsdStringType">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            The element authentication-mechanism-type specifies
+            type of an authentication mechanism.
+            
+            The example values are:
+            
+            <authentication-mechanism-type>BasicPassword
+            </authentication-mechanism-type>
+            
+            <authentication-mechanism-type>Kerbv5
+            </authentication-mechanism-type>
+            
+            Any additional security mechanisms are outside the
+            scope of the Connector architecture specification.
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="credential-interface"
+                   type="javaee:credential-interfaceType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="config-property-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The config-property-nameType contains the name of a
+        configuration property.
+        
+        The connector architecture defines a set of well-defined
+        properties all of type java.lang.String. These are as
+        follows.
+        
+        ServerName
+        PortNumber
+        UserName
+        Password
+        ConnectionURL
+        
+        A resource adapter provider can extend this property set to
+        include properties specific to the resource adapter and its
+        underlying EIS.
+        
+        Possible values include
+        	  ServerName
+        	  PortNumber
+        	  UserName
+        	  Password
+        	  ConnectionURL
+        
+        Example: <config-property-name>ServerName</config-property-name>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:xsdStringType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="config-property-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The config-property-typeType contains the fully
+        qualified Java type of a configuration property.
+        
+        The following are the legal values:
+        java.lang.Boolean, java.lang.String, java.lang.Integer,
+        java.lang.Double, java.lang.Byte, java.lang.Short,
+        java.lang.Long, java.lang.Float, java.lang.Character
+        
+        Used in: config-property
+        
+        Example:
+        <config-property-type>java.lang.String</config-property-type>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="java.lang.Boolean"/>
+        <xsd:enumeration value="java.lang.String"/>
+        <xsd:enumeration value="java.lang.Integer"/>
+        <xsd:enumeration value="java.lang.Double"/>
+        <xsd:enumeration value="java.lang.Byte"/>
+        <xsd:enumeration value="java.lang.Short"/>
+        <xsd:enumeration value="java.lang.Long"/>
+        <xsd:enumeration value="java.lang.Float"/>
+        <xsd:enumeration value="java.lang.Character"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="config-propertyType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The config-propertyType contains a declaration of a single
+        configuration property that may be used for providing
+        configuration information.
+        
+        The declaration consists of an optional description, name,
+        type and an optional value of the configuration property. If
+        the resource adapter provider does not specify a value than
+        the deployer is responsible for providing a valid value for
+        a configuration property.
+        
+        Any bounds or well-defined values of properties should be
+        described in the description element.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="config-property-name"
+                   type="javaee:config-property-nameType"/>
+      <xsd:element name="config-property-type"
+                   type="javaee:config-property-typeType"/>
+      <xsd:element name="config-property-value"
+                   type="javaee:xsdStringType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            The element config-property-value contains the value
+            of a configuration entry. Note, it is possible for a
+            resource adapter deployer to override this
+            configuration information during deployment.
+            
+            Example:
+            <config-property-value>WombatServer</config-property-value>
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="config-property-ignore"
+                   type="javaee:true-falseType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The element config-property-ignore is used to specify 
+            whether the configuration tools must ignore considering the 
+            configuration property during auto-discovery of
+            Configuration properties. See the Connector specification for
+            more details. If unspecified, the container must not ignore
+            the configuration property during auto-discovery.
+            This element must be one of the following, "true" or "false".
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="config-property-supports-dynamic-updates"
+                   type="javaee:true-falseType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The element config-property-supports-dynamic-updates is used to specify 
+            whether the configuration property allows its value to be updated, by
+            application server's configuration tools, during the lifetime of
+            the JavaBean instance. See the Connector specification for
+            more details. If unspecified, the container must not dynamically
+            reconfigure the property.
+            This element must be one of the following, "true" or "false".
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="config-property-confidential"
+                   type="javaee:true-falseType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The element config-property-confidential is used to specify 
+            whether the configuration property is confidential and
+            recommends application server's configuration tools to use special 
+            visual aids for editing them. See the Connector specification for
+            more details. If unspecified, the container must not treat the
+            property as confidential.
+            This element must be one of the following, "true" or "false".
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="connection-definitionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The connection-definitionType defines a set of connection
+        interfaces and classes pertaining to a particular connection
+        type. This also includes configurable properties for
+        ManagedConnectionFactory instances that may be produced out
+        of this set.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="managedconnectionfactory-class"
+                   type="javaee:fully-qualified-classType">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            The element managedconnectionfactory-class specifies
+            the fully qualified name of the Java class that
+            implements the
+            javax.resource.spi.ManagedConnectionFactory interface.
+            This Java class is provided as part of resource
+            adapter's implementation of connector architecture
+            specified contracts. The implementation of this
+            class is required to be a JavaBean.
+            
+            Example:
+            <managedconnectionfactory-class>
+            	  com.wombat.ManagedConnectionFactoryImpl
+            </managedconnectionfactory-class>
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="config-property"
+                   type="javaee:config-propertyType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="connectionfactory-interface"
+                   type="javaee:fully-qualified-classType">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            The element connectionfactory-interface specifies
+            the fully qualified name of the ConnectionFactory
+            interface supported by the resource adapter.
+            
+            Example:
+            <connectionfactory-interface>com.wombat.ConnectionFactory
+            </connectionfactory-interface>
+            
+            OR
+            
+            <connectionfactory-interface>javax.resource.cci.ConnectionFactory
+            </connectionfactory-interface>
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="connectionfactory-impl-class"
+                   type="javaee:fully-qualified-classType">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            The element connectionfactory-impl-class specifies
+            the fully qualified name of the ConnectionFactory
+            class that implements resource adapter
+            specific ConnectionFactory interface.
+            
+            Example:
+            
+            <connectionfactory-impl-class>com.wombat.ConnectionFactoryImpl
+            </connectionfactory-impl-class>
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="connection-interface"
+                   type="javaee:fully-qualified-classType">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            The connection-interface element specifies the fully
+            qualified name of the Connection interface supported
+            by the resource adapter.
+            
+            Example:
+            
+            	  <connection-interface>javax.resource.cci.Connection
+            	  </connection-interface>
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="connection-impl-class"
+                   type="javaee:fully-qualified-classType">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            The connection-impl-classType specifies the fully
+            qualified name of the Connection class that
+            implements resource adapter specific Connection
+            interface.  It is used by the connection-impl-class
+            elements.
+            
+            Example:
+            
+            	  <connection-impl-class>com.wombat.ConnectionImpl
+            	  </connection-impl-class>
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="connectorType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The connectorType defines a resource adapter.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="module-name"
+                   type="javaee:string"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The element module-name specifies the name of the
+            resource adapter.
+            
+            If there is no module-name specified, the module-name
+            is determined as defined in Section EE.8.1.1 and EE.8.1.2 
+            of the Java Platform, Enterprise Edition (Java EE) 
+            Specification, version 6.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="vendor-name"
+                   type="javaee:xsdStringType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The element vendor-name specifies the name of
+            resource adapter provider vendor.
+            
+            If there is no vendor-name specified, the application 
+            server must consider the default "" (empty string) as
+            the name of the resource adapter provider vendor.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="eis-type"
+                   type="javaee:xsdStringType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The element eis-type contains information about the
+            type of the EIS. For example, the type of an EIS can
+            be product name of EIS independent of any version
+            info.
+            
+            This helps in identifying EIS instances that can be
+            used with this resource adapter.
+            
+            If there is no eis-type specified, the application 
+            server must consider the default "" (empty string) as
+            the type of the EIS.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="resourceadapter-version"
+                   type="javaee:xsdStringType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The element resourceadapter-version specifies a string-based version
+            of the resource adapter from the resource adapter
+            provider.
+            
+            If there is no resourceadapter-version specified, the application 
+            server must consider the default "" (empty string) as
+            the version of the resource adapter.
+            	
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="license"
+                   type="javaee:licenseType"
+                   minOccurs="0"/>
+      <xsd:element name="resourceadapter"
+                   type="javaee:resourceadapterType"/>
+      <xsd:element name="required-work-context"
+                   type="javaee:fully-qualified-classType"
+                   minOccurs="0"
+                   maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The element required-work-context specifies a fully qualified class 
+            name that implements WorkContext interface, that the resource adapter 
+            requires the application server to support.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="version"
+                   type="javaee:dewey-versionType"
+                   fixed="1.6"
+                   use="required">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The version indicates the version of the schema to be used by the
+          deployment tool. This element doesn't have a default, and the resource adapter 
+          developer/deployer is required to specify it. The element allows the deployment 
+          tool to choose which schema to validate the descriptor against.
+          	  
+          
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="metadata-complete"
+                   type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The metadata-complete attribute defines whether the deployment 
+          descriptor for the resource adapter module is complete, or whether
+          the class files available to the module and packaged with the resource 
+          adapter should be examined for annotations that specify deployment 
+          information.
+          
+          If metadata-complete is set to "true", the deployment tool of the 
+          application server must ignore any annotations that specify deployment 
+          information, which might be present in the class files of the 
+          application.If metadata-complete is not specified or is set to "false", 
+          the deployment tool must examine the class files of the application for 
+          annotations, as specified by this specification. If the 
+          deployment descriptor is not included or is included but not marked 
+          metadata-complete, the deployment tool will process annotations.
+          
+          Application servers must assume that metadata-complete is true for 
+          resource adapter modules with deployment descriptor version 
+          lower than 1.6.
+          		
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="credential-interfaceType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The credential-interfaceType specifies the
+        interface that the resource adapter implementation
+        supports for the representation of the
+        credentials. This element(s) that use this type,
+        i.e. credential-interface,  should be used by
+        application server to find out the Credential
+        interface it should use as part of the security
+        contract.
+        
+        The possible values are:
+        
+        javax.resource.spi.security.PasswordCredential
+        org.ietf.jgss.GSSCredential
+        javax.resource.spi.security.GenericCredential
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:fully-qualified-classType">
+        <xsd:enumeration value="javax.resource.spi.security.PasswordCredential"/>
+        <xsd:enumeration value="org.ietf.jgss.GSSCredential"/>
+        <xsd:enumeration value="javax.resource.spi.security.GenericCredential"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="inbound-resourceadapterType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The inbound-resourceadapterType specifies information
+        about an inbound resource adapter. This contains information
+        specific to the implementation of the resource adapter
+        library as specified through the messageadapter element.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="messageadapter"
+                   type="javaee:messageadapterType"
+                   minOccurs="0">
+        <xsd:unique name="messagelistener-type-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The messagelistener-type element content must be
+              unique in the messageadapter. Several messagelisteners
+              can not use the same messagelistener-type.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:messagelistener"/>
+          <xsd:field xpath="javaee:messagelistener-type"/>
+        </xsd:unique>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="licenseType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The licenseType specifies licensing requirements for the
+        resource adapter module. This type specifies whether a
+        license is required to deploy and use this resource adapter,
+        and an optional description of the licensing terms
+        (examples: duration of license, number of connection
+        restrictions). It is used by the license element.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="license-required"
+                   type="javaee:true-falseType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The element license-required specifies whether a
+            license is required to deploy and use the
+            resource adapter. This element must be one of
+            the following, "true" or "false".
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="messageadapterType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The messageadapterType specifies information about the
+        messaging capabilities of the resource adapter. This
+        contains information specific to the implementation of the
+        resource adapter library as specified through the
+        messagelistener element.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="messagelistener"
+                   type="javaee:messagelistenerType"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="messagelistenerType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The messagelistenerType specifies information about a
+        specific message listener supported by the messaging
+        resource adapter. It contains information on the Java type
+        of the message listener interface and an activation
+        specification.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="messagelistener-type"
+                   type="javaee:fully-qualified-classType">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            The element messagelistener-type specifies the fully
+            qualified name of the Java type of a message
+            listener interface.
+            
+            Example:
+            
+            	<messagelistener-type>javax.jms.MessageListener
+            	</messagelistener-type>
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="activationspec"
+                   type="javaee:activationspecType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="outbound-resourceadapterType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The outbound-resourceadapterType specifies information about
+        an outbound resource adapter. The information includes fully
+        qualified names of classes/interfaces required as part of
+        the connector architecture specified contracts for
+        connection management, level of transaction support
+        provided, one or more authentication mechanisms supported
+        and additional required security permissions.
+        
+        If any of the outbound resource adapter elements (transaction-support,
+        authentication-mechanism, reauthentication-support) is specified through
+        this element or metadata annotations, and no  connection-definition is 
+        specified as part of this element or through annotations, the 
+        application server must consider this an error and fail deployment. 
+        
+        If there is no authentication-mechanism specified as part of
+        this element or metadata annotations, then the resource adapter does 
+        not support any standard security authentication mechanisms as 
+        part of security contract. The application server ignores the security 
+        part of the system contracts in this case.
+        
+        If there is no transaction-support specified as part of this element 
+        or metadata annotation, then the application server must consider that 
+        the resource adapter does not support either the resource manager local 
+        or JTA transactions and must consider the transaction support as 
+        NoTransaction. Note that resource adapters may specify the level of 
+        transaction support to be used at runtime for a ManagedConnectionFactory 
+        through the TransactionSupport interface.
+        
+        If there is no reauthentication-support specified as part of
+        this element or metadata annotation, then the application server must consider 
+        that the resource adapter does not support re-authentication of 
+        ManagedConnections.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="connection-definition"
+                   type="javaee:connection-definitionType"
+                   maxOccurs="unbounded"
+                   minOccurs="0"/>
+      <xsd:element name="transaction-support"
+                   type="javaee:transaction-supportType"
+                   minOccurs="0"/>
+      <xsd:element name="authentication-mechanism"
+                   type="javaee:authentication-mechanismType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="reauthentication-support"
+                   type="javaee:true-falseType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            	    The element reauthentication-support specifies
+            	    whether the resource adapter implementation supports
+            	    re-authentication of existing Managed- Connection
+            	    instance. Note that this information is for the
+            	    resource adapter implementation and not for the
+            	    underlying EIS instance. This element must have
+            	    either a "true" or "false" value.
+            
+            	  
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="required-config-propertyType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The required-config-propertyType contains a declaration
+        of a single configuration property used for specifying a
+        required configuration property name. It is used
+        by required-config-property elements.
+        
+        Usage of this type is deprecated from Connectors 1.6 specification. 
+        Refer to required-config-property element for more information.
+        
+        Example:
+        
+        <required-config-property>
+        <config-property-name>Destination</config-property-name>
+        </required-config-property>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="config-property-name"
+                   type="javaee:config-property-nameType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="resourceadapterType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The resourceadapterType specifies information about the
+        resource adapter. The information includes fully qualified
+        resource adapter Java class name, configuration properties,
+        information specific to the implementation of the resource
+        adapter library as specified through the
+        outbound-resourceadapter and inbound-resourceadapter
+        elements, and an optional set of administered objects.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="resourceadapter-class"
+                   type="javaee:fully-qualified-classType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The element resourceadapter-class specifies the
+            fully qualified name of a Java class that implements
+            the javax.resource.spi.ResourceAdapter
+            interface. This Java class is provided as part of
+            resource adapter's implementation of connector
+            architecture specified contracts. The implementation
+            of this class is required to be a JavaBean.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="config-property"
+                   type="javaee:config-propertyType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="outbound-resourceadapter"
+                   type="javaee:outbound-resourceadapterType"
+                   minOccurs="0">
+        <xsd:unique name="connectionfactory-interface-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The connectionfactory-interface element content
+              must be unique in the outbound-resourceadapter.
+              Multiple connection-definitions can not use the
+              same connectionfactory-type.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:connection-definition"/>
+          <xsd:field xpath="javaee:connectionfactory-interface"/>
+        </xsd:unique>
+      </xsd:element>
+      <xsd:element name="inbound-resourceadapter"
+                   type="javaee:inbound-resourceadapterType"
+                   minOccurs="0"/>
+      <xsd:element name="adminobject"
+                   type="javaee:adminobjectType"
+                   minOccurs="0"
+                   maxOccurs="unbounded">
+        <xsd:unique name="adminobject-type-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The adminobject-interface and adminobject-class element content must be
+              unique in the resourceadapterType. Several admin objects
+              can not use the same adminobject-interface and adminobject-class.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:adminobject"/>
+          <xsd:field xpath="javaee:adminobject-interface"/>
+          <xsd:field xpath="javaee:adminobject-class"/>
+        </xsd:unique>
+      </xsd:element>
+      <xsd:element name="security-permission"
+                   type="javaee:security-permissionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="security-permissionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The security-permissionType specifies a security
+        permission that is required by the resource adapter code.
+        
+        The security permission listed in the deployment descriptor
+        are ones that are different from those required by the
+        default permission set as specified in the connector
+        specification. The optional description can mention specific
+        reason that resource adapter requires a given security
+        permission.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="security-permission-spec"
+                   type="javaee:xsdStringType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The element security-permission-spec specifies a security
+            permission based on the Security policy file
+            syntax. Refer to the following URL for Sun's
+            implementation of the security permission
+            specification:
+            
+            http://java.sun.com/javase/6/docs/technotes/guides/security/PolicyFiles.html
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="transaction-supportType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The transaction-supportType specifies the level of
+        transaction support provided by the resource adapter. It is
+        used by transaction-support elements.
+        
+        The value must be one of the following:
+        
+        NoTransaction
+        LocalTransaction
+        XATransaction
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="NoTransaction"/>
+        <xsd:enumeration value="LocalTransaction"/>
+        <xsd:enumeration value="XATransaction"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_3_1.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_3_1.xsd
new file mode 100644
index 0000000..8c09762
--- /dev/null
+++ b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/ejb-jar_3_1.xsd
@@ -0,0 +1,3247 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://java.sun.com/xml/ns/javaee"
+            xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified"
+            version="3.1">
+  <xsd:annotation>
+    <xsd:documentation>
+
+      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+      
+      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
+      
+      The contents of this file are subject to the terms of either the
+      GNU General Public License Version 2 only ("GPL") or the Common
+      Development and Distribution License("CDDL") (collectively, the
+      "License").  You may not use this file except in compliance with
+      the License. You can obtain a copy of the License at
+      https://glassfish.dev.java.net/public/CDDL+GPL.html or
+      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
+      specific language governing permissions and limitations under the
+      License.
+      
+      When distributing the software, include this License Header
+      Notice in each file and include the License file at
+      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
+      particular file as subject to the "Classpath" exception as
+      provided by Sun in the GPL Version 2 section of the License file
+      that accompanied this code.  If applicable, add the following
+      below the License Header, with the fields enclosed by brackets []
+      replaced by your own identifying information:
+      "Portions Copyrighted [year] [name of copyright owner]"
+      
+      Contributor(s):
+      
+      If you wish your version of this file to be governed by only the
+      CDDL or only the GPL Version 2, indicate your decision by adding
+      "[Contributor] elects to include this software in this
+      distribution under the [CDDL or GPL Version 2] license."  If you
+      don't indicate a single choice of license, a recipient has the
+      option to distribute your version of this file under either the
+      CDDL, the GPL Version 2 or to extend the choice of license to its
+      licensees as provided above.  However, if you add GPL Version 2
+      code and therefore, elected the GPL Version 2 license, then the
+      option applies only if the new code is made subject to such
+      option by the copyright holder.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+      <![CDATA[[
+      This is the XML Schema for the EJB 3.1 deployment descriptor.
+      
+      All EJB deployment descriptors must indicate
+      the schema by using the Java EE namespace:
+      
+      http://java.sun.com/xml/ns/javaee
+      
+      and by indicating the version of the schema by
+      using the version element as shown below:
+      
+      <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+      	  http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"
+      version="3.1">
+      ...
+      </ejb-jar>
+      
+      The instance documents may indicate the published version of
+      the schema using the xsi:schemaLocation attribute for the
+      Java EE namespace with the following location:
+      
+      http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd
+      
+      ]]>
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      The following conventions apply to all Java EE
+      deployment descriptor elements unless indicated otherwise.
+      
+      - In elements that specify a pathname to a file within the
+      same JAR file, relative filenames (i.e., those not
+      starting with "/") are considered relative to the root of
+      the JAR file's namespace.  Absolute filenames (i.e., those
+      starting with "/") also specify names in the root of the
+      JAR file's namespace.  In general, relative names are
+      preferred.  The exception is .war files where absolute
+      names are preferred for consistency with the Servlet API.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:include schemaLocation="javaee_6.xsd"/>
+
+
+<!-- **************************************************** -->
+
+  <xsd:element name="ejb-jar"
+               type="javaee:ejb-jarType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This is the root of the ejb-jar deployment descriptor.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:key name="ejb-name-key">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The ejb-name element contains the name of an enterprise
+          bean. The name must be unique within the ejb-jar or
+          .war file.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:enterprise-beans/*"/>
+      <xsd:field xpath="javaee:ejb-name"/>
+    </xsd:key>
+    <xsd:keyref name="ejb-name-references"
+                refer="javaee:ejb-name-key">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The keyref indicates the references from
+          relationship-role-source must be to a specific ejb-name
+          defined within the scope of enterprise-beans element. 
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath=".//javaee:ejb-relationship-role/javaee:relationship-role-source"/>
+      <xsd:field xpath="javaee:ejb-name"/>
+    </xsd:keyref>
+    <xsd:key name="role-name-key">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          A role-name-key is specified to allow the references
+          from the security-role-refs.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:assembly-descriptor/javaee:security-role"/>
+      <xsd:field xpath="javaee:role-name"/>
+    </xsd:key>
+    <xsd:keyref name="role-name-references"
+                refer="javaee:role-name-key">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The keyref indicates the references from
+          security-role-ref to a specified role-name.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:enterprise-beans/*/javaee:security-role-ref"/>
+      <xsd:field xpath="javaee:role-link"/>
+    </xsd:keyref>
+  </xsd:element>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="access-timeoutType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The access-timeoutType represents the maximum amount of
+        time (in a given time unit) that the container should wait for
+        a concurrency lock before throwing a timeout exception to the
+        client.
+        
+        A timeout value of 0 means concurrent access is not permitted.
+        
+        A timeout value of -1 means wait indefinitely to acquire a lock.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="timeout"
+                   type="javaee:xsdIntegerType"/>
+      <xsd:element name="unit"
+                   type="javaee:time-unit-typeType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="async-methodType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The async-methodType element specifies that a session
+        bean method has asynchronous invocation semantics.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="method-name"
+                   type="javaee:string"/>
+      <xsd:element name="method-params"
+                   type="javaee:method-paramsType"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="activation-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The activation-configType defines information about the
+        expected configuration properties of the message-driven bean
+        in its operational environment. This may include information
+        about message acknowledgement, message selector, expected
+        destination type, etc.
+        
+        The configuration information is expressed in terms of
+        name/value configuration properties.
+        
+        The properties that are recognized for a particular
+        message-driven bean are determined by the messaging type.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="activation-config-property"
+                   type="javaee:activation-config-propertyType"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="activation-config-propertyType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The activation-config-propertyType contains a name/value
+        configuration property pair for a message-driven bean.
+        
+        The properties that are recognized for a particular
+        message-driven bean are determined by the messaging type.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="activation-config-property-name"
+                   type="javaee:xsdStringType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The activation-config-property-name element contains
+            the name for an activation configuration property of
+            a message-driven bean.
+            
+            For JMS message-driven beans, the following property
+            names are recognized: acknowledgeMode,
+            messageSelector, destinationType, subscriptionDurability
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="activation-config-property-value"
+                   type="javaee:xsdStringType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The activation-config-property-value element
+            contains the value for an activation configuration
+            property of a message-driven bean.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="around-invokeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The around-invoke type specifies a method on a
+        class to be called during the around invoke portion of an 
+        ejb invocation.  Note that each class may have only one
+        around invoke method and that the method may not be
+        overloaded.
+        
+        If the class element is missing then
+        the class defining the callback is assumed to be the
+        interceptor class or component class in scope at the
+        location in the descriptor in which the around invoke
+        definition appears.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="class"
+                   type="javaee:fully-qualified-classType"
+                   minOccurs="0"/>
+      <xsd:element name="method-name"
+                   type="javaee:java-identifierType"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="around-timeoutType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The around-timeout type specifies a method on a
+        class to be called during the around-timeout portion of
+        a timer timeout callback.  Note that each class may have 
+        only one around-timeout method and that the method may not 
+        be overloaded.
+        
+        If the class element is missing then
+        the class defining the callback is assumed to be the
+        interceptor class or component class in scope at the
+        location in the descriptor in which the around-timeout
+        definition appears.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="class"
+                   type="javaee:fully-qualified-classType"
+                   minOccurs="0"/>
+      <xsd:element name="method-name"
+                   type="javaee:java-identifierType"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="assembly-descriptorType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The assembly-descriptorType defines
+        application-assembly information.
+        
+        The application-assembly information consists of the
+        following parts: the definition of security roles, the
+        definition of method permissions, the definition of
+        transaction attributes for enterprise beans with
+        container-managed transaction demarcation, the definition
+        of interceptor bindings, a list of
+        methods to be excluded from being invoked, and a list of
+        exception types that should be treated as application exceptions.
+        
+        All the parts are optional in the sense that they are
+        omitted if the lists represented by them are empty.
+        
+        Providing an assembly-descriptor in the deployment
+        descriptor is optional for the ejb-jar or .war file producer.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="security-role"
+                   type="javaee:security-roleType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="method-permission"
+                   type="javaee:method-permissionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="container-transaction"
+                   type="javaee:container-transactionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="interceptor-binding"
+                   type="javaee:interceptor-bindingType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="message-destination"
+                   type="javaee:message-destinationType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="exclude-list"
+                   type="javaee:exclude-listType"
+                   minOccurs="0"/>
+      <xsd:element name="application-exception"
+                   type="javaee:application-exceptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="cmp-fieldType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The cmp-fieldType describes a container-managed field. The
+        cmp-fieldType contains an optional description of the field,
+        and the name of the field.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="field-name"
+                   type="javaee:java-identifierType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The field-name element specifies the name of a
+            container managed field.
+            
+            The name of the cmp-field of an entity bean with
+            cmp-version 2.x must begin with a lowercase
+            letter. This field is accessed by methods whose
+            names consists of the name of the field specified by
+            field-name in which the first letter is uppercased,
+            prefixed by "get" or "set".
+            
+            The name of the cmp-field of an entity bean with
+            cmp-version 1.x must denote a public field of the
+            enterprise bean class or one of its superclasses.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="cmp-versionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The cmp-versionType specifies the version of an entity bean
+        with container-managed persistence. It is used by
+        cmp-version elements.
+        
+        The value must be one of the two following:
+        
+        1.x
+        2.x
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="1.x"/>
+        <xsd:enumeration value="2.x"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="cmr-fieldType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The cmr-fieldType describes the bean provider's view of
+        a relationship. It consists of an optional description, and
+        the name and the class type of a field in the source of a
+        role of a relationship. The cmr-field-name element
+        corresponds to the name used for the get and set accessor
+        methods for the relationship. The cmr-field-type element is
+        used only for collection-valued cmr-fields. It specifies the
+        type of the collection that is used.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="cmr-field-name"
+                   type="javaee:string">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The cmr-field-name element specifies the name of a
+            logical relationship field in the entity bean
+            class. The name of the cmr-field must begin with a
+            lowercase letter. This field is accessed by methods
+            whose names consist of the name of the field
+            specified by cmr-field-name in which the first
+            letter is uppercased, prefixed by "get" or "set".
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="cmr-field-type"
+                   type="javaee:cmr-field-typeType"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="cmr-field-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The cmr-field-type element specifies the class of a
+        collection-valued logical relationship field in the entity
+        bean class. The value of an element using cmr-field-typeType
+        must be either: java.util.Collection or java.util.Set.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="java.util.Collection"/>
+        <xsd:enumeration value="java.util.Set"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="concurrency-management-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The concurrency-management-typeType specifies the way concurrency
+        is managed for a singleton or stateful session bean.  
+        
+        The concurrency management type must be one of the following:
+        
+        Bean
+        Container
+        
+        Bean managed concurrency can only be specified for a singleton bean.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="Bean"/>
+        <xsd:enumeration value="Container"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="concurrent-lock-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The concurrent-lock-typeType specifies how the container must
+        manage concurrent access to a method of a Singleton bean 
+        with container-managed concurrency.
+        
+        The container managed concurrency lock type must be one 
+        of the following :
+        
+        Read
+        Write
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="Read"/>
+        <xsd:enumeration value="Write"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="concurrent-methodType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The concurrent-methodType specifies information about a method
+        of a bean with container managed concurrency.
+        
+        The optional lock element specifies the kind of concurrency 
+        lock asssociated with the method.
+        
+        The optional access-timeout element specifies the amount of
+        time (in a given time unit) the container should wait for a
+        concurrency lock before throwing an exception to the client.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="method"
+                   type="javaee:named-methodType"/>
+      <xsd:element name="lock"
+                   type="javaee:concurrent-lock-typeType"
+                   minOccurs="0"/>
+      <xsd:element name="access-timeout"
+                   type="javaee:access-timeoutType"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="container-transactionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The container-transactionType specifies how the container
+        must manage transaction scopes for the enterprise bean's
+        method invocations. It defines an optional description, a
+        list of method elements, and a transaction attribute. The
+        transaction attribute is to be applied to all the specified
+        methods.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="method"
+                   type="javaee:methodType"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="trans-attribute"
+                   type="javaee:trans-attributeType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="depends-onType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The depends-onType is used to express initialization 
+        ordering dependencies between Singleton components.
+        The depends-onType specifies the names of one or more
+        Singleton beans in the same application as the referring
+        Singleton, each of which must be initialized before
+        the referring bean.  
+        
+        Each dependent bean is expressed using ejb-link syntax.
+        The order in which dependent beans are initialized at 
+        runtime is not guaranteed to match the order in which
+        they are listed.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="ejb-name"
+                   type="javaee:ejb-linkType"
+                   minOccurs="1"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-classType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The ejb-classType contains the fully-qualified name of the
+        enterprise bean's class. It is used by ejb-class elements. 
+        
+        Example:
+        
+        <ejb-class>com.wombat.empl.EmployeeServiceBean</ejb-class>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:fully-qualified-classType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-jarType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The ejb-jarType defines the root element of the EJB
+        deployment descriptor. It contains
+        
+        - an optional description of the ejb-jar file
+        - an optional display name
+        - an optional icon that contains a small and a large
+        icon file name
+        - an optional module name. Only applicable to
+        stand-alone ejb-jars or ejb-jars packaged in an ear.
+        Ignored if specified for an ejb-jar.xml within a .war.
+        In that case, standard .war module-name rules apply.
+        - structural information about all included
+        enterprise beans that is not specified through
+        annotations
+        - structural information about interceptor classes
+        - a descriptor for container managed relationships, 
+        if any. 
+        - an optional application-assembly descriptor
+        - an optional name of an ejb-client-jar file for the 
+        ejb-jar.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="module-name"
+                   type="javaee:string"
+                   minOccurs="0"/>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="enterprise-beans"
+                   type="javaee:enterprise-beansType"
+                   minOccurs="0"/>
+      <xsd:element name="interceptors"
+                   type="javaee:interceptorsType"
+                   minOccurs="0"/>
+      <xsd:element name="relationships"
+                   type="javaee:relationshipsType"
+                   minOccurs="0">
+        <xsd:unique name="relationship-name-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The ejb-relation-name contains the name of a
+              relation. The name must be unique within
+              relationships.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:ejb-relation"/>
+          <xsd:field xpath="javaee:ejb-relation-name"/>
+        </xsd:unique>
+      </xsd:element>
+      <xsd:element name="assembly-descriptor"
+                   type="javaee:assembly-descriptorType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Providing an assembly-descriptor in the deployment
+            descriptor is optional for the ejb-jar or .war file
+            producer.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="ejb-client-jar"
+                   type="javaee:pathType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            The optional ejb-client-jar element specifies a JAR
+            file that contains the class files necessary for a
+            client program to access the
+            enterprise beans in the ejb-jar file.
+            
+            Example:
+            
+            	  <ejb-client-jar>employee_service_client.jar
+            	  </ejb-client-jar>
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="version"
+                   type="javaee:dewey-versionType"
+                   fixed="3.1"
+                   use="required">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The version specifies the version of the
+          EJB specification that the instance document must 
+          comply with. This information enables deployment tools
+          to validate a particular EJB Deployment
+          Descriptor with respect to a specific version of the EJB
+          schema. 
+          
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="metadata-complete"
+                   type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The metadata-complete attribute defines whether this
+          deployment descriptor and other related deployment
+          descriptors for this module (e.g., web service
+          descriptors) are complete, or whether the class
+          files available to this module and packaged with
+          this application should be examined for annotations
+          that specify deployment information.
+          
+          If metadata-complete is set to "true", the deployment
+          tool must ignore any annotations that specify deployment
+          information, which might be present in the class files
+          of the application.
+          
+          If metadata-complete is not specified or is set to
+          "false", the deployment tool must examine the class
+          files of the application for annotations, as
+          specified by the specifications.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The ejb-nameType specifies an enterprise bean's name. It is
+        used by ejb-name elements. This name is assigned by the
+        file producer to name the enterprise bean in the
+        ejb-jar or .war file's deployment descriptor. The name must be
+        unique among the names of the enterprise beans in the same
+        ejb-jar or .war file.
+        
+        There is no architected relationship between the used
+        ejb-name in the deployment descriptor and the JNDI name that
+        the Deployer will assign to the enterprise bean's home.
+        
+        The name for an entity bean must conform to the lexical
+        rules for an NMTOKEN.
+        
+        Example:
+        
+        <ejb-name>EmployeeService</ejb-name>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:xsdNMTOKENType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-relationType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The ejb-relationType describes a relationship between two
+        entity beans with container-managed persistence.  It is used
+        by ejb-relation elements. It contains a description; an
+        optional ejb-relation-name element; and exactly two
+        relationship role declarations, defined by the
+        ejb-relationship-role elements. The name of the
+        relationship, if specified, is unique within the ejb-jar
+        file.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="ejb-relation-name"
+                   type="javaee:string"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The ejb-relation-name element provides a unique name
+            within the ejb-jar file for a relationship.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="ejb-relationship-role"
+                   type="javaee:ejb-relationship-roleType"/>
+      <xsd:element name="ejb-relationship-role"
+                   type="javaee:ejb-relationship-roleType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-relationship-roleType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The ejb-relationship-roleType describes a role within a
+        relationship. There are two roles in each relationship.
+        
+        The ejb-relationship-roleType contains an optional
+        description; an optional name for the relationship role; a
+        specification of the multiplicity of the role; an optional
+        specification of cascade-delete functionality for the role;
+        the role source; and a declaration of the cmr-field, if any,
+        by means of which the other side of the relationship is
+        accessed from the perspective of the role source.
+        
+        The multiplicity and role-source element are mandatory.
+        
+        The relationship-role-source element designates an entity
+        bean by means of an ejb-name element. For bidirectional
+        relationships, both roles of a relationship must declare a
+        relationship-role-source element that specifies a cmr-field
+        in terms of which the relationship is accessed. The lack of
+        a cmr-field element in an ejb-relationship-role specifies
+        that the relationship is unidirectional in navigability and
+        the entity bean that participates in the relationship is
+        "not aware" of the relationship.
+        
+        Example:
+        
+        <ejb-relation>
+        <ejb-relation-name>Product-LineItem</ejb-relation-name>
+        <ejb-relationship-role>
+        	  <ejb-relationship-role-name>product-has-lineitems
+        	  </ejb-relationship-role-name>
+        	  <multiplicity>One</multiplicity>
+        	  <relationship-role-source>
+        	  <ejb-name>ProductEJB</ejb-name>
+        	  </relationship-role-source>
+        </ejb-relationship-role>
+        </ejb-relation>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="ejb-relationship-role-name"
+                   type="javaee:string"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The ejb-relationship-role-name element defines a
+            name for a role that is unique within an
+            ejb-relation. Different relationships can use the
+            same name for a role.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="multiplicity"
+                   type="javaee:multiplicityType"/>
+      <xsd:element name="cascade-delete"
+                   type="javaee:emptyType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The cascade-delete element specifies that, within a
+            particular relationship, the lifetime of one or more
+            entity beans is dependent upon the lifetime of
+            another entity bean. The cascade-delete element can
+            only be specified for an ejb-relationship-role
+            element contained in an ejb-relation element in
+            which the other ejb-relationship-role
+            element specifies a multiplicity of One.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="relationship-role-source"
+                   type="javaee:relationship-role-sourceType"/>
+      <xsd:element name="cmr-field"
+                   type="javaee:cmr-fieldType"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="enterprise-beansType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The enterprise-beansType declares one or more enterprise
+        beans. Each bean can be a session, entity or message-driven
+        bean.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:choice maxOccurs="unbounded">
+      <xsd:element name="session"
+                   type="javaee:session-beanType">
+        <xsd:unique name="session-ejb-local-ref-name-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The ejb-ref-name element contains the name of
+              an EJB reference. The EJB reference is an entry in
+              the component's environment and is relative to the
+              java:comp/env context.  The name must be unique within
+              the component.
+              
+              It is recommended that name be prefixed with "ejb/".
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:ejb-local-ref"/>
+          <xsd:field xpath="javaee:ejb-ref-name"/>
+        </xsd:unique>
+        <xsd:unique name="session-ejb-ref-name-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The ejb-ref-name element contains the name of an EJB
+              reference. The EJB reference is an entry in the
+              component's environment and is relative to the
+              java:comp/env context. The name must be unique
+              within the component.
+              
+              It is recommended that name is prefixed with "ejb/".
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:ejb-ref"/>
+          <xsd:field xpath="javaee:ejb-ref-name"/>
+        </xsd:unique>
+        <xsd:unique name="session-resource-env-ref-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The resource-env-ref-name element specifies the name
+              of a resource environment reference; its value is
+              the environment entry name used in the component
+              code. The name is a JNDI name relative to the
+              java:comp/env context and must be unique within an
+              component.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:resource-env-ref"/>
+          <xsd:field xpath="javaee:resource-env-ref-name"/>
+        </xsd:unique>
+        <xsd:unique name="session-message-destination-ref-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The message-destination-ref-name element specifies the name
+              of a message destination reference; its value is
+              the message destination reference name used in the component
+              code. The name is a JNDI name relative to the
+              java:comp/env context and must be unique within an
+              component.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:message-destination-ref"/>
+          <xsd:field xpath="javaee:message-destination-ref-name"/>
+        </xsd:unique>
+        <xsd:unique name="session-res-ref-name-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The res-ref-name element specifies the name of a
+              resource manager connection factory reference.  The name
+              is a JNDI name relative to the java:comp/env context.
+              The name must be unique within an component.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:resource-ref"/>
+          <xsd:field xpath="javaee:res-ref-name"/>
+        </xsd:unique>
+        <xsd:unique name="session-env-entry-name-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The env-entry-name element contains the name of a
+              component's environment entry.  The name is a JNDI
+              name relative to the java:comp/env context.  The
+              name must be unique within an component.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:env-entry"/>
+          <xsd:field xpath="javaee:env-entry-name"/>
+        </xsd:unique>
+      </xsd:element>
+      <xsd:element name="entity"
+                   type="javaee:entity-beanType">
+        <xsd:unique name="entity-ejb-local-ref-name-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The ejb-ref-name element contains the name of
+              an EJB reference. The EJB reference is an entry in
+              the component's environment and is relative to the
+              java:comp/env context.  The name must be unique within
+              the component.
+              
+              It is recommended that name be prefixed with "ejb/".
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:ejb-local-ref"/>
+          <xsd:field xpath="javaee:ejb-ref-name"/>
+        </xsd:unique>
+        <xsd:unique name="entity-ejb-ref-name-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The ejb-ref-name element contains the name of an EJB
+              reference. The EJB reference is an entry in the
+              component's environment and is relative to the
+              java:comp/env context. The name must be unique
+              within the component.
+              
+              It is recommended that name is prefixed with "ejb/".
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:ejb-ref"/>
+          <xsd:field xpath="javaee:ejb-ref-name"/>
+        </xsd:unique>
+        <xsd:unique name="entity-resource-env-ref-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The resource-env-ref-name element specifies the name
+              of a resource environment reference; its value is
+              the environment entry name used in the component
+              code. The name is a JNDI name relative to the
+              java:comp/env context and must be unique within an
+              component.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:resource-env-ref"/>
+          <xsd:field xpath="javaee:resource-env-ref-name"/>
+        </xsd:unique>
+        <xsd:unique name="entity-message-destination-ref-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The message-destination-ref-name element specifies the name
+              of a message destination reference; its value is
+              the message destination reference name used in the component
+              code. The name is a JNDI name relative to the
+              java:comp/env context and must be unique within an
+              component.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:message-destination-ref"/>
+          <xsd:field xpath="javaee:message-destination-ref-name"/>
+        </xsd:unique>
+        <xsd:unique name="entity-res-ref-name-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The res-ref-name element specifies the name of a
+              resource manager connection factory reference.  The name
+              is a JNDI name relative to the java:comp/env context.
+              The name must be unique within an component.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:resource-ref"/>
+          <xsd:field xpath="javaee:res-ref-name"/>
+        </xsd:unique>
+        <xsd:unique name="entity-env-entry-name-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The env-entry-name element contains the name of a
+              component's environment entry.  The name is a JNDI
+              name relative to the java:comp/env context.  The
+              name must be unique within an component.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:env-entry"/>
+          <xsd:field xpath="javaee:env-entry-name"/>
+        </xsd:unique>
+      </xsd:element>
+      <xsd:element name="message-driven"
+                   type="javaee:message-driven-beanType">
+        <xsd:unique name="messaged-ejb-local-ref-name-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The ejb-ref-name element contains the name of
+              an EJB reference. The EJB reference is an entry in
+              the component's environment and is relative to the
+              java:comp/env context.  The name must be unique within
+              the component.
+              
+              It is recommended that name be prefixed with "ejb/".
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:ejb-local-ref"/>
+          <xsd:field xpath="javaee:ejb-ref-name"/>
+        </xsd:unique>
+        <xsd:unique name="messaged-ejb-ref-name-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The ejb-ref-name element contains the name of an EJB
+              reference. The EJB reference is an entry in the
+              component's environment and is relative to the
+              java:comp/env context. The name must be unique
+              within the component.
+              
+              It is recommended that name is prefixed with "ejb/".
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:ejb-ref"/>
+          <xsd:field xpath="javaee:ejb-ref-name"/>
+        </xsd:unique>
+        <xsd:unique name="messaged-resource-env-ref-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The resource-env-ref-name element specifies the name
+              of a resource environment reference; its value is
+              the environment entry name used in the component
+              code. The name is a JNDI name relative to the
+              java:comp/env context and must be unique within an
+              component.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:resource-env-ref"/>
+          <xsd:field xpath="javaee:resource-env-ref-name"/>
+        </xsd:unique>
+        <xsd:unique name="messaged-message-destination-ref-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The message-destination-ref-name element specifies the name
+              of a message destination reference; its value is
+              the message destination reference name used in the component
+              code. The name is a JNDI name relative to the
+              java:comp/env context and must be unique within an
+              component.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:message-destination-ref"/>
+          <xsd:field xpath="javaee:message-destination-ref-name"/>
+        </xsd:unique>
+        <xsd:unique name="messaged-res-ref-name-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The res-ref-name element specifies the name of a
+              resource manager connection factory reference.  The name
+              is a JNDI name relative to the java:comp/env context.
+              The name must be unique within an component.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:resource-ref"/>
+          <xsd:field xpath="javaee:res-ref-name"/>
+        </xsd:unique>
+        <xsd:unique name="messaged-env-entry-name-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The env-entry-name element contains the name of a
+              component's environment entry.  The name is a JNDI
+              name relative to the java:comp/env context.  The
+              name must be unique within an component.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:env-entry"/>
+          <xsd:field xpath="javaee:env-entry-name"/>
+        </xsd:unique>
+      </xsd:element>
+    </xsd:choice>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="entity-beanType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The entity-beanType declares an entity bean. The declaration
+        consists of:
+        
+        - an optional description
+        - an optional display name
+        - an optional icon element that contains a small and a large 
+        icon file name
+        - a unique name assigned to the enterprise bean
+        in the deployment descriptor
+        - an optional mapped-name element that can be used to provide
+        vendor-specific deployment information such as the physical
+        jndi-name of the entity bean's remote home interface. This 
+        element is not required to be supported by all implementations.
+        Any use of this element is non-portable.
+        - the names of the entity bean's remote home 
+        and remote interfaces, if any
+        - the names of the entity bean's local home and local
+        interfaces, if any
+        - the entity bean's implementation class
+        - the optional entity bean's persistence management type. If 
+        this element is not specified it is defaulted to Container.
+        - the entity bean's primary key class name
+        - an indication of the entity bean's reentrancy
+        - an optional specification of the 
+        entity bean's cmp-version
+        - an optional specification of the entity bean's
+        abstract schema name
+        - an optional list of container-managed fields
+        - an optional specification of the primary key 
+        field
+        - an optional declaration of the bean's environment 
+        entries
+        - an optional declaration of the bean's EJB 
+        references
+        - an optional declaration of the bean's local 
+        EJB references
+        - an optional declaration of the bean's web 
+        service references
+        - an optional declaration of the security role 
+        references
+        - an optional declaration of the security identity
+        to be used for the execution of the bean's methods
+        - an optional declaration of the bean's 
+        resource manager connection factory references
+        - an optional declaration of the bean's
+        resource environment references
+        - an optional declaration of the bean's message 
+        destination references
+        - an optional set of query declarations
+        for finder and select methods for an entity
+        bean with cmp-version 2.x.
+        
+        The optional abstract-schema-name element must be specified
+        for an entity bean with container-managed persistence and
+        cmp-version 2.x.
+        
+        The optional primkey-field may be present in the descriptor
+        if the entity's persistence-type is Container.
+        
+        The optional cmp-version element may be present in the
+        descriptor if the entity's persistence-type is Container. If
+        the persistence-type is Container and the cmp-version
+        element is not specified, its value defaults to 2.x.
+        
+        The optional home and remote elements must be specified if
+        the entity bean cmp-version is 1.x.
+        
+        The optional home and remote elements must be specified if
+        the entity bean has a remote home and remote interface.
+        
+        The optional local-home and local elements must be specified
+        if the entity bean has a local home and local interface.
+        
+        Either both the local-home and the local elements or both
+        the home and the remote elements must be specified.
+        
+        The optional query elements must be present if the
+        persistence-type is Container and the cmp-version is 2.x and
+        query methods other than findByPrimaryKey have been defined
+        for the entity bean.
+        
+        The other elements that are optional are "optional" in the
+        sense that they are omitted if the lists represented by them
+        are empty.
+        
+        At least one cmp-field element must be present in the
+        descriptor if the entity's persistence-type is Container and
+        the cmp-version is 1.x, and none must not be present if the
+        entity's persistence-type is Bean.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="ejb-name"
+                   type="javaee:ejb-nameType"/>
+      <xsd:element name="mapped-name"
+                   type="javaee:xsdStringType"
+                   minOccurs="0"/>
+      <xsd:element name="home"
+                   type="javaee:homeType"
+                   minOccurs="0"/>
+      <xsd:element name="remote"
+                   type="javaee:remoteType"
+                   minOccurs="0"/>
+      <xsd:element name="local-home"
+                   type="javaee:local-homeType"
+                   minOccurs="0"/>
+      <xsd:element name="local"
+                   type="javaee:localType"
+                   minOccurs="0"/>
+      <xsd:element name="ejb-class"
+                   type="javaee:ejb-classType"/>
+      <xsd:element name="persistence-type"
+                   type="javaee:persistence-typeType"/>
+      <xsd:element name="prim-key-class"
+                   type="javaee:fully-qualified-classType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The prim-key-class element contains the
+            fully-qualified name of an
+            entity bean's primary key class.
+            
+            If the definition of the primary key class is
+            deferred to deployment time, the prim-key-class 
+            element should specify java.lang.Object.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="reentrant"
+                   type="javaee:true-falseType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The reentrant element specifies whether an entity
+            bean is reentrant or not.
+            
+            The reentrant element must be one of the two
+            following: true or false
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="cmp-version"
+                   type="javaee:cmp-versionType"
+                   minOccurs="0"/>
+      <xsd:element name="abstract-schema-name"
+                   type="javaee:java-identifierType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The abstract-schema-name element specifies the name
+            of the abstract schema type of an entity bean with 
+            cmp-version 2.x. It is used in EJB QL queries. 
+            
+            For example, the abstract-schema-name for an entity 
+            bean whose local interface is 
+            com.acme.commerce.Order might be Order. 
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="cmp-field"
+                   type="javaee:cmp-fieldType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="primkey-field"
+                   type="javaee:string"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The primkey-field element is used to specify the
+            name of the primary key field for an entity with
+            container-managed persistence.
+            
+            The primkey-field must be one of the fields declared
+            in the cmp-field element, and the type of the field
+            must be the same as the primary key type.
+            
+            The primkey-field element is not used if the primary
+            key maps to multiple container-managed fields
+            (i.e. the key is a compound key). In this case, the
+            fields of the primary key class must be public, and
+            their names must correspond to the field names of
+            the entity bean class that comprise the key.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:group ref="javaee:jndiEnvironmentRefsGroup"/>
+      <xsd:element name="security-role-ref"
+                   type="javaee:security-role-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="security-identity"
+                   type="javaee:security-identityType"
+                   minOccurs="0"/>
+      <xsd:element name="query"
+                   type="javaee:queryType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="exclude-listType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The exclude-listType specifies one or more methods which
+        the Assembler marks to be uncallable.
+        
+        If the method permission relation contains methods that are
+        in the exclude list, the Deployer should consider those
+        methods to be uncallable.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="method"
+                   type="javaee:methodType"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="application-exceptionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The application-exceptionType declares an application
+        exception. The declaration consists of:
+        
+        - the exception class. When the container receives
+        an exception of this type, it is required to 
+        forward this exception as an applcation exception 
+        to the client regardless of whether it is a checked
+        or unchecked exception.
+        - an optional rollback element. If this element is 
+        set to true, the container must rollback the current 
+        transaction before forwarding the exception to the
+        client.  If not specified, it defaults to false.
+        - an optional inherited element. If this element is 
+        set to true, subclasses of the exception class type
+        are also automatically considered application 
+        exceptions (unless overriden at a lower level).
+        If set to false, only the exception class type is
+        considered an application-exception, not its
+        exception subclasses. If not specified, this
+        value defaults to true.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="exception-class"
+                   type="javaee:fully-qualified-classType"/>
+      <xsd:element name="rollback"
+                   type="javaee:true-falseType"
+                   minOccurs="0"/>
+      <xsd:element name="inherited"
+                   type="javaee:true-falseType"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="interceptorsType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The interceptorsType element declares one or more interceptor
+        classes used by components within this ejb-jar or .war.  The declaration
+        consists of :
+        
+        - An optional description.
+        - One or more interceptor elements.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="interceptor"
+                   type="javaee:interceptorType"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="interceptorType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The interceptorType element declares information about a single
+        interceptor class.  It consists of :
+        
+        - An optional description.
+        - The fully-qualified name of the interceptor class.
+        - An optional list of around invoke methods declared on the
+        interceptor class and/or its super-classes.
+        - An optional list of around timeout methods declared on the
+        interceptor class and/or its super-classes.
+        - An optional list environment dependencies for the interceptor
+        class and/or its super-classes.
+        - An optional list of post-activate methods declared on the
+        interceptor class and/or its super-classes.
+        - An optional list of pre-passivate methods declared on the
+        interceptor class and/or its super-classes.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="interceptor-class"
+                   type="javaee:fully-qualified-classType"/>
+      <xsd:element name="around-invoke"
+                   type="javaee:around-invokeType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="around-timeout"
+                   type="javaee:around-timeoutType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:group ref="javaee:jndiEnvironmentRefsGroup"/>
+      <xsd:element name="post-activate"
+                   type="javaee:lifecycle-callbackType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="pre-passivate"
+                   type="javaee:lifecycle-callbackType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="interceptor-bindingType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The interceptor-bindingType element describes the binding of
+        interceptor classes to beans within the ejb-jar or .war.
+        It consists of :
+        
+        - An optional description.
+        - The name of an ejb within the module or the wildcard value "*",
+        which is used to define interceptors that are bound to all
+        beans in the ejb-jar or .war.
+        - A list of interceptor classes that are bound to the contents of
+        the ejb-name element or a specification of the total ordering
+        over the interceptors defined for the given level and above.
+        - An optional exclude-default-interceptors element.  If set to true,
+        specifies that default interceptors are not to be applied to 
+        a bean-class and/or business method.
+        - An optional exclude-class-interceptors element.  If set to true,
+        specifies that class interceptors are not to be applied to 
+        a business method.
+        - An optional set of method elements for describing the name/params
+        of a method-level interceptor.
+        
+        Interceptors bound to all classes using the wildcard syntax
+        "*" are default interceptors for the components in the ejb-jar or .war. 
+        In addition, interceptors may be bound at the level of the bean
+        class (class-level interceptors) or business methods (method-level
+        interceptors ).
+        
+        The binding of interceptors to classes is additive.  If interceptors
+        are bound at the class-level and/or default-level as well as the
+        method-level, both class-level and/or default-level as well as
+        method-level will apply. 
+        
+        There are four possible styles of the interceptor element syntax :
+        
+        1.
+        <interceptor-binding>
+        <ejb-name>*</ejb-name>
+        <interceptor-class>INTERCEPTOR</interceptor-class>
+        </interceptor-binding>
+        
+        Specifying the ejb-name as the wildcard value "*" designates
+        default interceptors (interceptors that apply to all session and
+        message-driven beans contained in the ejb-jar or .war).
+        
+        2. 
+        <interceptor-binding>
+        <ejb-name>EJBNAME</ejb-name>
+        <interceptor-class>INTERCEPTOR</interceptor-class>
+        </interceptor-binding>
+        
+        This style is used to refer to interceptors associated with the
+        specified enterprise bean(class-level interceptors).
+        
+        3. 
+        <interceptor-binding>
+        <ejb-name>EJBNAME</ejb-name>
+        <interceptor-class>INTERCEPTOR</interceptor-class>
+        <method>
+        <method-name>METHOD</method-name>
+        </method>
+        </interceptor-binding>
+        
+        This style is used to associate a method-level interceptor with 
+        the specified enterprise bean.  If there are multiple methods
+        with the same overloaded name, the element of this style refers
+        to all the methods with the overloaded name.  Method-level
+        interceptors can only be associated with business methods of the
+        bean class.   Note that the wildcard value "*" cannot be used
+        to specify method-level interceptors.
+        
+        4. 
+        <interceptor-binding>
+        <ejb-name>EJBNAME</ejb-name>
+        <interceptor-class>INTERCEPTOR</interceptor-class>
+        <method>
+        <method-name>METHOD</method-name>
+        <method-params>
+        <method-param>PARAM-1</method-param>
+        <method-param>PARAM-2</method-param>
+        ...
+        <method-param>PARAM-N</method-param>
+        </method-params>
+        </method>
+        </interceptor-binding>
+        
+        This style is used to associate a method-level interceptor with 
+        the specified method of the specified enterprise bean.  This 
+        style is used to refer to a single method within a set of methods
+        with an overloaded name.  The values PARAM-1 through PARAM-N
+        are the fully-qualified Java types of the method's input parameters
+        (if the method has no input arguments, the method-params element
+        contains no method-param elements). Arrays are specified by the
+        array element's type, followed by one or more pair of square 
+        brackets (e.g. int[][]).
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="ejb-name"
+                   type="javaee:string"/>
+      <xsd:choice>
+        <xsd:element name="interceptor-class"
+                     type="javaee:fully-qualified-classType"
+                     minOccurs="0"
+                     maxOccurs="unbounded"/>
+        <xsd:element name="interceptor-order"
+                     type="javaee:interceptor-orderType"
+                     minOccurs="1"/>
+      </xsd:choice>
+      <xsd:element name="exclude-default-interceptors"
+                   type="javaee:true-falseType"
+                   minOccurs="0"/>
+      <xsd:element name="exclude-class-interceptors"
+                   type="javaee:true-falseType"
+                   minOccurs="0"/>
+      <xsd:element name="method"
+                   type="javaee:named-methodType"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="interceptor-orderType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The interceptor-orderType element describes a total ordering
+        of interceptor classes.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="interceptor-class"
+                   type="javaee:fully-qualified-classType"
+                   minOccurs="1"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="named-methodType">
+    <xsd:sequence>
+      <xsd:element name="method-name"
+                   type="javaee:string"/>
+      <xsd:element name="method-params"
+                   type="javaee:method-paramsType"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="init-methodType">
+    <xsd:sequence>
+      <xsd:element name="create-method"
+                   type="javaee:named-methodType"/>
+      <xsd:element name="bean-method"
+                   type="javaee:named-methodType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="remove-methodType">
+    <xsd:sequence>
+      <xsd:element name="bean-method"
+                   type="javaee:named-methodType"/>
+      <xsd:element name="retain-if-exception"
+                   type="javaee:true-falseType"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="message-driven-beanType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The message-driven element declares a message-driven
+        bean. The declaration consists of:
+        
+        - an optional description
+        - an optional display name
+        - an optional icon element that contains a small and a large 
+        icon file name. 
+        - a name assigned to the enterprise bean in
+        the deployment descriptor
+        - an optional mapped-name element that can be used to provide
+        vendor-specific deployment information such as the physical
+        jndi-name of destination from which this message-driven bean
+        should consume.  This element is not required to be supported 
+        by all implementations.  Any use of this element is non-portable.
+        - the message-driven bean's implementation class
+        - an optional declaration of the bean's messaging 
+        type 
+        - an optional declaration of the bean's timeout method for
+        handling programmatically created timers
+        - an optional declaration of timers to be automatically created at
+        deployment time
+        - the optional message-driven bean's transaction management 
+        type. If it is not defined, it is defaulted to Container.
+        - an optional declaration of the bean's 
+        message-destination-type
+        - an optional declaration of the bean's 
+        message-destination-link
+        - an optional declaration of the message-driven bean's
+        activation configuration properties
+        - an optional list of the message-driven bean class and/or
+        superclass around-invoke methods.
+        - an optional list of the message-driven bean class and/or
+        superclass around-timeout methods.
+        - an optional declaration of the bean's environment
+        entries
+        - an optional declaration of the bean's EJB references
+        - an optional declaration of the bean's local EJB
+        references
+        - an optional declaration of the bean's web service
+        references
+        - an optional declaration of the security role 
+        references
+        - an optional declaration of the security
+        identity to be used for the execution of the bean's
+        methods
+        - an optional declaration of the bean's 
+        resource manager connection factory 
+        references
+        - an optional declaration of the bean's resource
+        environment references.
+        - an optional declaration of the bean's message 
+        destination references
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="ejb-name"
+                   type="javaee:ejb-nameType"/>
+      <xsd:element name="mapped-name"
+                   type="javaee:xsdStringType"
+                   minOccurs="0"/>
+      <xsd:element name="ejb-class"
+                   type="javaee:ejb-classType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The ejb-class element specifies the fully qualified name
+            of the bean class for this ejb.  It is required unless
+            there is a component-defining annotation for the same
+            ejb-name.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="messaging-type"
+                   type="javaee:fully-qualified-classType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The messaging-type element specifies the message
+            listener interface of the message-driven bean. 
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="timeout-method"
+                   type="javaee:named-methodType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The timeout-method element specifies the method that
+            will receive callbacks for programmatically
+            created timers.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="timer"
+                   type="javaee:timerType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="transaction-type"
+                   type="javaee:transaction-typeType"
+                   minOccurs="0"/>
+      <xsd:element name="message-destination-type"
+                   type="javaee:message-destination-typeType"
+                   minOccurs="0"/>
+      <xsd:element name="message-destination-link"
+                   type="javaee:message-destination-linkType"
+                   minOccurs="0"/>
+      <xsd:element name="activation-config"
+                   type="javaee:activation-configType"
+                   minOccurs="0"/>
+      <xsd:element name="around-invoke"
+                   type="javaee:around-invokeType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="around-timeout"
+                   type="javaee:around-timeoutType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:group ref="javaee:jndiEnvironmentRefsGroup"/>
+      <xsd:element name="security-role-ref"
+                   type="javaee:security-role-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded">
+      </xsd:element>
+      <xsd:element name="security-identity"
+                   type="javaee:security-identityType"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="methodType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The methodType is used to denote a method of an enterprise
+        bean's business, home, component, and/or web service endpoint
+        interface, or, in the case of a message-driven bean, the
+        bean's message listener method, or a set of such
+        methods. The ejb-name element must be the name of one of the
+        enterprise beans declared in the deployment descriptor; the
+        optional method-intf element allows to distinguish between a
+        method with the same signature that is multiply defined
+        across the business, home, component, and/or web service 
+        endpoint nterfaces; the method-name element specifies the 
+        method name; and the optional method-params elements identify 
+        a single method among multiple methods with an overloaded
+        method name.
+        
+        There are three possible styles of using methodType element
+        within a method element:
+        
+        1.
+        <method>
+        <ejb-name>EJBNAME</ejb-name>
+        <method-name>*</method-name>
+        </method>
+        
+        This style is used to refer to all the methods of the
+        specified enterprise bean's business, home, component, 
+        and/or web service endpoint interfaces.
+        
+        2.
+        <method>
+        <ejb-name>EJBNAME</ejb-name>
+        <method-name>METHOD</method-name>
+        </method>
+        
+        This style is used to refer to the specified method of
+        the specified enterprise bean. If there are multiple
+        methods with the same overloaded name, the element of
+        this style refers to all the methods with the overloaded
+        name.
+        
+        3.
+        <method>
+        <ejb-name>EJBNAME</ejb-name>
+        <method-name>METHOD</method-name>
+        <method-params>
+        	  <method-param>PARAM-1</method-param>
+        	  <method-param>PARAM-2</method-param>
+        	  ...
+        	  <method-param>PARAM-n</method-param>
+        </method-params>
+        </method>
+        
+        This style is used to refer to a single method within a
+        set of methods with an overloaded name. PARAM-1 through
+        PARAM-n are the fully-qualified Java types of the
+        method's input parameters (if the method has no input
+        arguments, the method-params element contains no
+        method-param elements). Arrays are specified by the
+        array element's type, followed by one or more pair of
+        square brackets (e.g. int[][]). If there are multiple
+        methods with the same overloaded name, this style refers
+        to all of the overloaded methods. 
+        
+        Examples:
+        
+        Style 1: The following method element refers to all the
+        methods of the EmployeeService bean's business, home, 
+        component, and/or web service endpoint interfaces:
+        
+        <method>
+        <ejb-name>EmployeeService</ejb-name>
+        <method-name>*</method-name>
+        </method>
+        
+        Style 2: The following method element refers to all the
+        create methods of the EmployeeService bean's home
+        interface(s).
+        
+        <method>
+        <ejb-name>EmployeeService</ejb-name>
+        <method-name>create</method-name>
+        </method>
+        
+        Style 3: The following method element refers to the
+        create(String firstName, String LastName) method of the
+        EmployeeService bean's home interface(s).
+        
+        <method>
+        <ejb-name>EmployeeService</ejb-name>
+        <method-name>create</method-name>
+        <method-params>
+        	  <method-param>java.lang.String</method-param>
+        	  <method-param>java.lang.String</method-param>
+        </method-params>
+        </method>
+        
+        The following example illustrates a Style 3 element with
+        more complex parameter types. The method 
+        foobar(char s, int i, int[] iar, mypackage.MyClass mycl, 
+        mypackage.MyClass[][] myclaar) would be specified as:
+        
+        <method>
+        <ejb-name>EmployeeService</ejb-name>
+        <method-name>foobar</method-name>
+        <method-params>
+        	  <method-param>char</method-param>
+        	  <method-param>int</method-param>
+        	  <method-param>int[]</method-param>
+        	  <method-param>mypackage.MyClass</method-param>
+        	  <method-param>mypackage.MyClass[][]</method-param>
+        </method-params>
+        </method>
+        
+        The optional method-intf element can be used when it becomes
+        necessary to differentiate between a method that is multiply
+        defined across the enterprise bean's business, home, component,
+        and/or web service endpoint interfaces with the same name and
+        signature. However, if the same method is a method of both the
+        local business interface, and the local component interface, 
+        the same attribute applies to the method for both interfaces.
+        Likewise, if the same method is a method of both the remote 
+        business interface and the remote component interface, the same
+        attribute applies to the method for both interfaces.
+        
+        For example, the method element
+        
+        <method>
+        <ejb-name>EmployeeService</ejb-name>
+        <method-intf>Remote</method-intf>
+        <method-name>create</method-name>
+        <method-params>
+        	  <method-param>java.lang.String</method-param>
+        	  <method-param>java.lang.String</method-param>
+        </method-params>
+        </method>
+        
+        can be used to differentiate the create(String, String)
+        method defined in the remote interface from the
+        create(String, String) method defined in the remote home
+        interface, which would be defined as
+        
+        <method>
+        <ejb-name>EmployeeService</ejb-name>
+        <method-intf>Home</method-intf>
+        <method-name>create</method-name>
+        <method-params>
+        	  <method-param>java.lang.String</method-param>
+        	  <method-param>java.lang.String</method-param>
+        </method-params>
+        </method>
+        
+        and the create method that is defined in the local home
+        interface which would be defined as
+        
+        <method>
+        <ejb-name>EmployeeService</ejb-name>
+        <method-intf>LocalHome</method-intf>
+        <method-name>create</method-name>
+        <method-params>
+        	  <method-param>java.lang.String</method-param>
+        	  <method-param>java.lang.String</method-param>
+        </method-params>
+        </method>
+        
+        The method-intf element can be used with all three Styles
+        of the method element usage. For example, the following
+        method element example could be used to refer to all the
+        methods of the EmployeeService bean's remote home interface
+        and the remote business interface.
+        
+        <method>
+        <ejb-name>EmployeeService</ejb-name>
+        <method-intf>Home</method-intf>
+        <method-name>*</method-name>
+        </method>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="ejb-name"
+                   type="javaee:ejb-nameType"/>
+      <xsd:element name="method-intf"
+                   type="javaee:method-intfType"
+                   minOccurs="0">
+      </xsd:element>
+      <xsd:element name="method-name"
+                   type="javaee:method-nameType"/>
+      <xsd:element name="method-params"
+                   type="javaee:method-paramsType"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="method-intfType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The method-intf element allows a method element to
+        differentiate between the methods with the same name and
+        signature that are multiply defined across the home and
+        component interfaces (e.g, in both an enterprise bean's
+        remote and local interfaces or in both an enterprise bean's
+        home and remote interfaces, etc.); the component and web
+        service endpoint interfaces, and so on. 
+        
+        Local applies to the local component interface, local business 
+        interfaces, and the no-interface view. 
+        
+        Remote applies to both remote component interface and the remote 
+        business interfaces.  
+        
+        ServiceEndpoint refers to methods exposed through a web service
+        endpoint.
+        
+        Timer refers to the bean's timeout callback methods.
+        
+        MessageEndpoint refers to the methods of a message-driven bean's
+        message-listener interface.
+        
+        The method-intf element must be one of the following:
+        
+        Home
+        Remote
+        LocalHome
+        Local
+        ServiceEndpoint
+        Timer
+        MessageEndpoint
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="Home"/>
+        <xsd:enumeration value="Remote"/>
+        <xsd:enumeration value="LocalHome"/>
+        <xsd:enumeration value="Local"/>
+        <xsd:enumeration value="ServiceEndpoint"/>
+        <xsd:enumeration value="Timer"/>
+        <xsd:enumeration value="MessageEndpoint"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="method-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The method-nameType contains a name of an enterprise
+        bean method or the asterisk (*) character. The asterisk is
+        used when the element denotes all the methods of an
+        enterprise bean's client view interfaces.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="method-paramsType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The method-paramsType defines a list of the
+        fully-qualified Java type names of the method parameters.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="method-param"
+                   type="javaee:java-typeType"
+                   minOccurs="0"
+                   maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The method-param element contains a primitive
+            or a fully-qualified Java type name of a method
+            parameter.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="method-permissionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The method-permissionType specifies that one or more
+        security roles are allowed to invoke one or more enterprise
+        bean methods. The method-permissionType consists of an
+        optional description, a list of security role names or an
+        indicator to state that the method is unchecked for
+        authorization, and a list of method elements.
+        
+        The security roles used in the method-permissionType
+        must be defined in the security-role elements of the
+        deployment descriptor, and the methods must be methods
+        defined in the enterprise bean's business, home, component 
+        and/or web service endpoint interfaces.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:choice>
+        <xsd:element name="role-name"
+                     type="javaee:role-nameType"
+                     maxOccurs="unbounded"/>
+        <xsd:element name="unchecked"
+                     type="javaee:emptyType">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The unchecked element specifies that a method is
+              not checked for authorization by the container
+              prior to invocation of the method.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+      </xsd:choice>
+      <xsd:element name="method"
+                   type="javaee:methodType"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="multiplicityType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The multiplicityType describes the multiplicity of the
+        role that participates in a relation.
+        
+        The value must be one of the two following:
+        
+        One
+        Many
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="One"/>
+        <xsd:enumeration value="Many"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="persistence-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The persistence-typeType specifies an entity bean's persistence
+        management type.
+        
+        The persistence-type element must be one of the two following:
+        
+        Bean
+        Container
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="Bean"/>
+        <xsd:enumeration value="Container"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="queryType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The queryType defines a finder or select
+        query. It contains
+        - an optional description of the query
+        - the specification of the finder or select
+        method it is used by
+        	- an optional specification of the result type 
+        	  mapping, if the query is for a select method 
+        	  and entity objects are returned.
+        	- the EJB QL query string that defines the query.
+        
+        Queries that are expressible in EJB QL must use the ejb-ql
+        element to specify the query. If a query is not expressible
+        in EJB QL, the description element should be used to
+        describe the semantics of the query and the ejb-ql element
+        should be empty.
+        
+        The result-type-mapping is an optional element. It can only
+        be present if the query-method specifies a select method
+        that returns entity objects.  The default value for the
+        result-type-mapping element is "Local".
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"/>
+      <xsd:element name="query-method"
+                   type="javaee:query-methodType"/>
+      <xsd:element name="result-type-mapping"
+                   type="javaee:result-type-mappingType"
+                   minOccurs="0"/>
+      <xsd:element name="ejb-ql"
+                   type="javaee:xsdStringType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="query-methodType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The query-method specifies the method for a finder or select
+        query.
+        
+        The method-name element specifies the name of a finder or select
+        method in the entity bean's implementation class.
+        
+        Each method-param must be defined for a query-method using the
+        method-params element.
+        
+        It is used by the query-method element. 
+        
+        Example:
+        
+        <query>
+        <description>Method finds large orders</description>
+        <query-method>
+        	  <method-name>findLargeOrders</method-name>
+        	  <method-params></method-params>
+        </query-method>
+        <ejb-ql>
+        	SELECT OBJECT(o) FROM Order o
+        	  WHERE o.amount &gt; 1000
+        </ejb-ql>
+        </query>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="method-name"
+                   type="javaee:method-nameType"/>
+      <xsd:element name="method-params"
+                   type="javaee:method-paramsType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="relationship-role-sourceType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The relationship-role-sourceType designates the source of a
+        role that participates in a relationship. A
+        relationship-role-sourceType is used by
+        relationship-role-source elements to uniquely identify an
+        entity bean.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="ejb-name"
+                   type="javaee:ejb-nameType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="relationshipsType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The relationshipsType describes the relationships in
+        which entity beans with container-managed persistence
+        participate. The relationshipsType contains an optional
+        description; and a list of ejb-relation elements, which
+        specify the container managed relationships.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="ejb-relation"
+                   type="javaee:ejb-relationType"
+                   maxOccurs="unbounded">
+        <xsd:unique name="role-name-uniqueness">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The ejb-relationship-role-name contains the name of a
+              relationship role. The name must be unique within 
+              a relationship, but can be reused in different
+              relationships.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath=".//javaee:ejb-relationship-role-name"/>
+          <xsd:field xpath="."/>
+        </xsd:unique>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="result-type-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The result-type-mappingType is used in the query element to
+        specify whether an abstract schema type returned by a query
+        for a select method is to be mapped to an EJBLocalObject or
+        EJBObject type.
+        
+        The value must be one of the following:
+        
+        Local
+        Remote
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="Local"/>
+        <xsd:enumeration value="Remote"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="security-identityType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The security-identityType specifies whether the caller's
+        security identity is to be used for the execution of the
+        methods of the enterprise bean or whether a specific run-as
+        identity is to be used. It contains an optional description
+        and a specification of the security identity to be used.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:choice>
+        <xsd:element name="use-caller-identity"
+                     type="javaee:emptyType">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The use-caller-identity element specifies that
+              the caller's security identity be used as the
+              security identity for the execution of the
+              enterprise bean's methods.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="run-as"
+                     type="javaee:run-asType"/>
+      </xsd:choice>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="session-beanType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The session-beanType declares an session bean. The
+        declaration consists of:
+        
+        - an optional description
+        - an optional display name
+        - an optional icon element that contains a small and a large 
+        icon file name
+        - a name assigned to the enterprise bean
+        in the deployment description
+        - an optional mapped-name element that can be used to provide
+        vendor-specific deployment information such as the physical
+        jndi-name of the session bean's remote home/business interface. 
+        This element is not required to be supported by all 
+        implementations. Any use of this element is non-portable.
+        - the names of all the remote or local business interfaces, 
+        if any
+        - the names of the session bean's remote home and
+        remote interfaces, if any
+        - the names of the session bean's local home and
+        local interfaces, if any
+        - an optional declaration that this bean exposes a
+        no-interface view
+        - the name of the session bean's web service endpoint
+        interface, if any
+        - the session bean's implementation class
+        - the session bean's state management type
+        - an optional declaration of a stateful session bean's timeout value
+        - an optional declaration of the session bean's timeout method for
+        handling programmatically created timers
+        - an optional declaration of timers to be automatically created at
+        deployment time
+        - an optional declaration that a Singleton bean has eager
+        initialization
+        - an optional declaration of a Singleton/Stateful bean's concurrency 
+        management type
+        - an optional declaration of the method locking metadata
+        for a Singleton with container managed concurrency
+        - an optional declaration of the other Singleton beans in the
+        application that must be initialized before this bean
+        - an optional declaration of the session bean's asynchronous 
+        methods
+        - the optional session bean's transaction management type. 
+        If it is not present, it is defaulted to Container.
+        - an optional declaration of a stateful session bean's 
+        afterBegin, beforeCompletion, and/or afterCompletion methods
+        - an optional list of the session bean class and/or
+        superclass around-invoke methods.
+        - an optional list of the session bean class and/or
+        superclass around-timeout methods.
+        - an optional declaration of the bean's 
+        environment entries
+        - an optional declaration of the bean's EJB references
+        - an optional declaration of the bean's local 
+        EJB references
+        - an optional declaration of the bean's web 
+        service references
+        - an optional declaration of the security role 
+        references
+        - an optional declaration of the security identity 
+        to be used for the execution of the bean's methods
+        - an optional declaration of the bean's resource 
+        manager connection factory references
+        - an optional declaration of the bean's resource 
+        environment references.
+        - an optional declaration of the bean's message 
+        destination references
+        
+        The elements that are optional are "optional" in the sense
+        that they are omitted when if lists represented by them are
+        empty.
+        
+        The service-endpoint element may only be specified if the
+        bean is a stateless session bean.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="ejb-name"
+                   type="javaee:ejb-nameType"/>
+      <xsd:element name="mapped-name"
+                   type="javaee:xsdStringType"
+                   minOccurs="0"/>
+      <xsd:element name="home"
+                   type="javaee:homeType"
+                   minOccurs="0"/>
+      <xsd:element name="remote"
+                   type="javaee:remoteType"
+                   minOccurs="0"/>
+      <xsd:element name="local-home"
+                   type="javaee:local-homeType"
+                   minOccurs="0"/>
+      <xsd:element name="local"
+                   type="javaee:localType"
+                   minOccurs="0"/>
+      <xsd:element name="business-local"
+                   type="javaee:fully-qualified-classType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="business-remote"
+                   type="javaee:fully-qualified-classType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="local-bean"
+                   type="javaee:emptyType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The local-bean element declares that this
+            session bean exposes a no-interface Local client view.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="service-endpoint"
+                   type="javaee:fully-qualified-classType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The service-endpoint element contains the
+            fully-qualified name of the enterprise bean's web
+            service endpoint interface. The service-endpoint
+            element may only be specified for a stateless
+            session bean. The specified interface must be a
+            valid JAX-RPC service endpoint interface.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="ejb-class"
+                   type="javaee:ejb-classType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The ejb-class element specifies the fully qualified name
+            of the bean class for this ejb.  It is required unless
+            there is a component-defining annotation for the same
+            ejb-name.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="session-type"
+                   type="javaee:session-typeType"
+                   minOccurs="0"/>
+      <xsd:element name="stateful-timeout"
+                   type="javaee:stateful-timeoutType"
+                   minOccurs="0"/>
+      <xsd:element name="timeout-method"
+                   type="javaee:named-methodType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The timeout-method element specifies the method that
+            will receive callbacks for programmatically
+            created timers.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="timer"
+                   type="javaee:timerType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="init-on-startup"
+                   type="javaee:true-falseType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The init-on-startup element specifies that a Singleton
+            bean has eager initialization.
+            This element can only be specified for singleton session
+            beans.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="concurrency-management-type"
+                   type="javaee:concurrency-management-typeType"
+                   minOccurs="0"/>
+      <xsd:element name="concurrent-method"
+                   type="javaee:concurrent-methodType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="depends-on"
+                   type="javaee:depends-onType"
+                   minOccurs="0"/>
+      <xsd:element name="init-method"
+                   type="javaee:init-methodType"
+                   minOccurs="0"
+                   maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The init-method element specifies the mappings for
+            EJB 2.x style create methods for an EJB 3.x bean.
+            This element can only be specified for stateful 
+            session beans. 
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="remove-method"
+                   type="javaee:remove-methodType"
+                   minOccurs="0"
+                   maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The remove-method element specifies the mappings for
+            EJB 2.x style remove methods for an EJB 3.x bean.
+            This element can only be specified for stateful 
+            session beans. 
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="async-method"
+                   type="javaee:async-methodType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="transaction-type"
+                   type="javaee:transaction-typeType"
+                   minOccurs="0"/>
+      <xsd:element name="after-begin-method"
+                   type="javaee:named-methodType"
+                   minOccurs="0"/>
+      <xsd:element name="before-completion-method"
+                   type="javaee:named-methodType"
+                   minOccurs="0"/>
+      <xsd:element name="after-completion-method"
+                   type="javaee:named-methodType"
+                   minOccurs="0"/>
+      <xsd:element name="around-invoke"
+                   type="javaee:around-invokeType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="around-timeout"
+                   type="javaee:around-timeoutType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:group ref="javaee:jndiEnvironmentRefsGroup"/>
+      <xsd:element name="post-activate"
+                   type="javaee:lifecycle-callbackType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="pre-passivate"
+                   type="javaee:lifecycle-callbackType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="security-role-ref"
+                   type="javaee:security-role-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded">
+      </xsd:element>
+      <xsd:element name="security-identity"
+                   type="javaee:security-identityType"
+                   minOccurs="0">
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="session-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The session-typeType describes whether the session bean is a
+        singleton, stateful or stateless session. It is used by
+        session-type elements.
+        
+        The value must be one of the three following:
+        
+        Singleton
+        Stateful
+        Stateless
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="Singleton"/>
+        <xsd:enumeration value="Stateful"/>
+        <xsd:enumeration value="Stateless"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="stateful-timeoutType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The stateful-timeoutType represents the amount of time
+        a stateful session bean can be idle(not receive any client
+        invocations) before it is eligible for removal by the container.
+        
+        A timeout value of 0 means the bean is immediately eligible for removal.
+        
+        A timeout value of -1 means the bean will never be removed due to timeout.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="timeout"
+                   type="javaee:xsdIntegerType"/>
+      <xsd:element name="unit"
+                   type="javaee:time-unit-typeType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="time-unit-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The time-unit-typeType represents a time duration at a given
+        unit of granularity.  
+        
+        The time unit type must be one of the following :
+        
+        Days
+        Hours
+        Minutes
+        Seconds
+        Milliseconds
+        Microseconds
+        Nanoseconds
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="Days"/>
+        <xsd:enumeration value="Hours"/>
+        <xsd:enumeration value="Minutes"/>
+        <xsd:enumeration value="Seconds"/>
+        <xsd:enumeration value="Milliseconds"/>
+        <xsd:enumeration value="Microseconds"/>
+        <xsd:enumeration value="Nanoseconds"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="timer-scheduleType">
+    <xsd:sequence>
+      <xsd:element name="second"
+                   type="javaee:string"
+                   minOccurs="0"/>
+      <xsd:element name="minute"
+                   type="javaee:string"
+                   minOccurs="0"/>
+      <xsd:element name="hour"
+                   type="javaee:string"
+                   minOccurs="0"/>
+      <xsd:element name="day-of-month"
+                   type="javaee:string"
+                   minOccurs="0"/>
+      <xsd:element name="month"
+                   type="javaee:string"
+                   minOccurs="0"/>
+      <xsd:element name="day-of-week"
+                   type="javaee:string"
+                   minOccurs="0"/>
+      <xsd:element name="year"
+                   type="javaee:string"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="timerType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The timerType specifies an enterprise bean timer.  Each
+        timer is automatically created by the container upon
+        deployment.  Timer callbacks occur based on the 
+        schedule attributes.  All callbacks are made to the
+        timeout-method associated with the timer.  
+        
+        A timer can have an optional start and/or end date. If
+        a start date is specified, it takes precedence over the
+        associated timer schedule such that any matching
+        expirations prior to the start time will not occur.
+        Likewise, no matching expirations will occur after any
+        end date.   Start/End dates are specified using the
+        XML Schema dateTime type, which follows the ISO-8601
+        standard for date(and optional time-within-the-day) 
+        representation.
+        
+        An optional flag can be used to control whether
+        this timer has persistent(true) delivery semantics or
+        non-persistent(false) delivery semantics.  If not specified,
+        the value defaults to persistent(true).
+        
+        A time zone can optionally be associated with a timer.
+        If specified, the timer's schedule is evaluated in the context
+        of that time zone, regardless of the default time zone in which
+        the container is executing.   Time zones are specified as an
+        ID string.  The set of required time zone IDs is defined by
+        the Zone Name(TZ) column of the public domain zoneinfo database.
+        
+        An optional info string can be assigned to the timer and 
+        retrieved at runtime through the Timer.getInfo() method.
+        
+        The timerType can only be specified on stateless session
+        beans, singleton session beans, and message-driven beans.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="schedule"
+                   type="javaee:timer-scheduleType"/>
+      <xsd:element name="start"
+                   type="xsd:dateTime"
+                   minOccurs="0"/>
+      <xsd:element name="end"
+                   type="xsd:dateTime"
+                   minOccurs="0"/>
+      <xsd:element name="timeout-method"
+                   type="javaee:named-methodType"/>
+      <xsd:element name="persistent"
+                   type="javaee:true-falseType"
+                   minOccurs="0"/>
+      <xsd:element name="timezone"
+                   type="javaee:string"
+                   minOccurs="0"/>
+      <xsd:element name="info"
+                   type="javaee:string"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="trans-attributeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The trans-attributeType specifies how the container must
+        manage the transaction boundaries when delegating a method 
+        invocation to an enterprise bean's business method. 
+        
+        The value must be one of the following: 
+        
+        NotSupported 
+        Supports 
+        Required  
+        RequiresNew 
+        Mandatory 
+        Never 
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="NotSupported"/>
+        <xsd:enumeration value="Supports"/>
+        <xsd:enumeration value="Required"/>
+        <xsd:enumeration value="RequiresNew"/>
+        <xsd:enumeration value="Mandatory"/>
+        <xsd:enumeration value="Never"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="transaction-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The transaction-typeType specifies an enterprise bean's
+        transaction management type.
+        
+        The transaction-type must be one of the two following:
+        
+        Bean
+        Container
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="Bean"/>
+        <xsd:enumeration value="Container"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/facelet-taglib_1_0.dtd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/facelet-taglib_1_0.dtd
new file mode 100644
index 0000000..e036d0e
--- /dev/null
+++ b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/facelet-taglib_1_0.dtd
@@ -0,0 +1,36 @@
+<!--
+ Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ Licensed under the Common Development and Distribution License,
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ 
+   http://www.sun.com/cddl/
+   
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+ 
+ $Id: facelet-taglib_1_0.dtd,v 1.1 2010/02/10 02:14:51 david_williams Exp $
+-->
+
+<!ELEMENT facelet-taglib (library-class|(namespace,(tag|function)+))>
+<!ATTLIST facelet-taglib xmlns CDATA #FIXED "http://java.sun.com/JSF/Facelet">
+<!ELEMENT namespace (#PCDATA)>
+<!ELEMENT library-class (#PCDATA)>
+<!ELEMENT tag (tag-name,(handler-class|component|converter|validator|source))>
+<!ELEMENT tag-name (#PCDATA)>
+<!ELEMENT handler-class (#PCDATA)>
+<!ELEMENT component (component-type,renderer-type?,handler-class?)>
+<!ELEMENT component-type (#PCDATA)>
+<!ELEMENT renderer-type (#PCDATA)>
+<!ELEMENT converter (converter-id, handler-class?)>
+<!ELEMENT converter-id (#PCDATA)>
+<!ELEMENT validator (validator-id, handler-class?)>
+<!ELEMENT validator-id (#PCDATA)>
+<!ELEMENT source (#PCDATA)>
+<!ELEMENT function (function-name,function-class,function-signature)>
+<!ELEMENT function-name (#PCDATA)>
+<!ELEMENT function-class (#PCDATA)>
+<!ELEMENT function-signature (#PCDATA)>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_6.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_6.xsd
new file mode 100644
index 0000000..f165d18
--- /dev/null
+++ b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_6.xsd
@@ -0,0 +1,2422 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="http://java.sun.com/xml/ns/javaee"
+            xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified"
+            version="6">
+  <xsd:annotation>
+    <xsd:documentation>
+
+      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+      
+      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
+      
+      The contents of this file are subject to the terms of either the
+      GNU General Public License Version 2 only ("GPL") or the Common
+      Development and Distribution License("CDDL") (collectively, the
+      "License").  You may not use this file except in compliance with
+      the License. You can obtain a copy of the License at
+      https://glassfish.dev.java.net/public/CDDL+GPL.html or
+      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
+      specific language governing permissions and limitations under the
+      License.
+      
+      When distributing the software, include this License Header
+      Notice in each file and include the License file at
+      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
+      particular file as subject to the "Classpath" exception as
+      provided by Sun in the GPL Version 2 section of the License file
+      that accompanied this code.  If applicable, add the following
+      below the License Header, with the fields enclosed by brackets []
+      replaced by your own identifying information:
+      "Portions Copyrighted [year] [name of copyright owner]"
+      
+      Contributor(s):
+      
+      If you wish your version of this file to be governed by only the
+      CDDL or only the GPL Version 2, indicate your decision by adding
+      "[Contributor] elects to include this software in this
+      distribution under the [CDDL or GPL Version 2] license."  If you
+      don't indicate a single choice of license, a recipient has the
+      option to distribute your version of this file under either the
+      CDDL, the GPL Version 2 or to extend the choice of license to its
+      licensees as provided above.  However, if you add GPL Version 2
+      code and therefore, elected the GPL Version 2 license, then the
+      option applies only if the new code is made subject to such
+      option by the copyright holder.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      The following definitions that appear in the common
+      shareable schema(s) of Java EE deployment descriptors should be
+      interpreted with respect to the context they are included:
+      
+      Deployment Component may indicate one of the following:
+      java ee application;
+      application client;
+      web application;
+      enterprise bean;
+      resource adapter; 
+      
+      Deployment File may indicate one of the following:
+      ear file;
+      war file;
+      jar file;
+      rar file;
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:import namespace="http://www.w3.org/XML/1998/namespace"
+              schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+
+  <xsd:include schemaLocation="javaee_web_services_client_1_3.xsd"/>
+
+  <xsd:group name="descriptionGroup">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This group keeps the usage of the contained description related
+        elements consistent across Java EE deployment descriptors.
+        
+        All elements may occur multiple times with different languages,
+        to support localization of the content.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="display-name"
+                   type="javaee:display-nameType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="icon"
+                   type="javaee:iconType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:group>
+
+  <xsd:group name="jndiEnvironmentRefsGroup">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This group keeps the usage of the contained JNDI environment
+        reference elements consistent across Java EE deployment descriptors.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="env-entry"
+                   type="javaee:env-entryType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="ejb-ref"
+                   type="javaee:ejb-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="ejb-local-ref"
+                   type="javaee:ejb-local-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:group ref="javaee:service-refGroup"/>
+      <xsd:element name="resource-ref"
+                   type="javaee:resource-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="resource-env-ref"
+                   type="javaee:resource-env-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="message-destination-ref"
+                   type="javaee:message-destination-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="persistence-context-ref"
+                   type="javaee:persistence-context-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="persistence-unit-ref"
+                   type="javaee:persistence-unit-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="post-construct"
+                   type="javaee:lifecycle-callbackType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="pre-destroy"
+                   type="javaee:lifecycle-callbackType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="data-source"
+                   type="javaee:data-sourceType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:group>
+
+  <xsd:group name="resourceGroup">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This group collects elements that are common to most
+        JNDI resource elements.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:group ref="javaee:resourceBaseGroup"/>
+      <xsd:element name="lookup-name"
+                   type="javaee:xsdStringType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The JNDI name to be looked up to resolve a resource reference.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+  </xsd:group>
+
+  <xsd:group name="resourceBaseGroup">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This group collects elements that are common to all the
+        JNDI resource elements. It does not include the lookup-name
+        element, that is only applicable to some resource elements.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="mapped-name"
+                   type="javaee:xsdStringType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            A product specific name that this resource should be
+            mapped to.  The name of this resource, as defined by the
+            resource's name element or defaulted, is a name that is
+            local to the application component using the resource.
+            (It's a name in the JNDI java:comp/env namespace.)  Many
+            application servers provide a way to map these local
+            names to names of resources known to the application
+            server.  This mapped name is often a global JNDI name,
+            but may be a name of any form.
+            
+            Application servers are not required to support any
+            particular form or type of mapped name, nor the ability
+            to use mapped names.  The mapped name is
+            product-dependent and often installation-dependent.  No
+            use of a mapped name is portable.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="injection-target"
+                   type="javaee:injection-targetType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:group>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="data-sourceType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Configuration of a DataSource.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Description of this DataSource.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="name"
+                   type="javaee:jndi-nameType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The name element specifies the JNDI name of the
+            data source being defined.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="class-name"
+                   type="javaee:fully-qualified-classType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            DataSource, XADataSource or ConnectionPoolDataSource
+            implementation class.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="server-name"
+                   type="javaee:string"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Database server name.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="port-number"
+                   type="javaee:xsdIntegerType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Port number where a server is listening for requests.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="database-name"
+                   type="javaee:string"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Name of a database on a server.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="url"
+                   type="javaee:jdbc-urlType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            A JDBC URL. If the <code>url</code> property is specified
+            along with other standard <code>DataSource</code> properties
+            such as <code>serverName</code>, <code>databaseName</code>
+            and <code>portNumber</code>, the more specific properties will
+            take precedence and <code>url</code> will be ignored.
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="user"
+                   type="javaee:string"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            User name to use for connection authentication.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="password"
+                   type="javaee:string"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Password to use for connection authentication.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="property"
+                   type="javaee:propertyType"
+                   minOccurs="0"
+                   maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            JDBC DataSource property.  This may be a vendor-specific
+            property or a less commonly used DataSource property.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="login-timeout"
+                   type="javaee:xsdIntegerType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Sets the maximum time in seconds that this data source
+            will wait while attempting to connect to a database.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="transactional"
+                   type="javaee:xsdBooleanType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Set to false if connections should not participate in
+            transactions.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="isolation-level"
+                   type="javaee:isolation-levelType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Isolation level for connections.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="initial-pool-size"
+                   type="javaee:xsdIntegerType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Number of connections that should be created when a
+            connection pool is initialized.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="max-pool-size"
+                   type="javaee:xsdIntegerType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Maximum number of connections that should be concurrently
+            allocated for a connection pool.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="min-pool-size"
+                   type="javaee:xsdIntegerType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Minimum number of connections that should be concurrently
+            allocated for a connection pool.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="max-idle-time"
+                   type="javaee:xsdIntegerType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The number of seconds that a physical connection should
+            remain unused in the pool before the connection is
+            closed for a connection pool.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="max-statements"
+                   type="javaee:xsdIntegerType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The total number of statements that a connection pool
+            should keep open.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="descriptionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The description type is used by a description element to
+        provide text describing the parent element.  The elements
+        that use this type should include any information that the
+        Deployment Component's Deployment File file producer wants
+        to provide to the consumer of the Deployment Component's
+        Deployment File (i.e., to the Deployer). Typically, the
+        tools used by such a Deployment File consumer will display
+        the description when processing the parent element that
+        contains the description.
+        
+        The lang attribute defines the language that the
+        description is provided in. The default value is "en" (English). 
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="javaee:xsdStringType">
+        <xsd:attribute ref="xml:lang"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+  <xsd:simpleType name="dewey-versionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This type defines a dewey decimal that is used
+        to describe versions of documents. 
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:pattern value="\.?[0-9]+(\.[0-9]+)*"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="display-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The display-name type contains a short name that is intended
+        to be displayed by tools. It is used by display-name
+        elements.  The display name need not be unique.
+        
+        Example: 
+        
+        ...
+        <display-name xml:lang="en">
+        Employee Self Service
+        </display-name>
+        
+        The value of the xml:lang attribute is "en" (English) by default. 
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="javaee:string">
+        <xsd:attribute ref="xml:lang"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-linkType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The ejb-linkType is used by ejb-link
+        elements in the ejb-ref or ejb-local-ref elements to specify
+        that an EJB reference is linked to enterprise bean.
+        
+        The value of the ejb-link element must be the ejb-name of an
+        enterprise bean in the same ejb-jar file or in another ejb-jar
+        file in the same Java EE application unit. 
+        
+        Alternatively, the name in the ejb-link element may be
+        composed of a path name specifying the ejb-jar containing the
+        referenced enterprise bean with the ejb-name of the target
+        bean appended and separated from the path name by "#".  The
+        path name is relative to the Deployment File containing
+        Deployment Component that is referencing the enterprise
+        bean.  This allows multiple enterprise beans with the same
+        ejb-name to be uniquely identified.
+        
+        Examples:
+        
+        <ejb-link>EmployeeRecord</ejb-link>
+        
+        <ejb-link>../products/product.jar#ProductEJB</ejb-link>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-local-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The ejb-local-refType is used by ejb-local-ref elements for
+        the declaration of a reference to an enterprise bean's local
+        home or to the local business interface of a 3.0 bean.
+        The declaration consists of:
+        
+        - an optional description
+        - the EJB reference name used in the code of the Deployment 
+        Component that's referencing the enterprise bean.
+        - the optional expected type of the referenced enterprise bean
+        - the optional expected local interface of the referenced 
+        enterprise bean or the local business interface of the 
+        referenced enterprise bean.
+        - the optional expected local home interface of the referenced 
+        enterprise bean. Not applicable if this ejb-local-ref refers
+        to the local business interface of a 3.0 bean.
+        - optional ejb-link information, used to specify the 
+        referenced enterprise bean
+        - optional elements to define injection of the named enterprise  
+        bean into a component field or property.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="ejb-ref-name"
+                   type="javaee:ejb-ref-nameType"/>
+      <xsd:element name="ejb-ref-type"
+                   type="javaee:ejb-ref-typeType"
+                   minOccurs="0"/>
+      <xsd:element name="local-home"
+                   type="javaee:local-homeType"
+                   minOccurs="0"/>
+      <xsd:element name="local"
+                   type="javaee:localType"
+                   minOccurs="0"/>
+      <xsd:element name="ejb-link"
+                   type="javaee:ejb-linkType"
+                   minOccurs="0"/>
+      <xsd:group ref="javaee:resourceGroup"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-ref-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The ejb-ref-name element contains the name of an EJB
+        reference. The EJB reference is an entry in the
+        Deployment Component's environment and is relative to the
+        java:comp/env context.  The name must be unique within the
+        Deployment Component.
+        
+        It is recommended that name is prefixed with "ejb/".
+        
+        Example:
+        
+        <ejb-ref-name>ejb/Payroll</ejb-ref-name>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:jndi-nameType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The ejb-refType is used by ejb-ref elements for the
+        declaration of a reference to an enterprise bean's home or
+        to the remote business interface of a 3.0 bean.  
+        The declaration consists of:
+        
+        - an optional description
+        - the EJB reference name used in the code of
+        the Deployment Component that's referencing the enterprise
+        bean. 
+        - the optional expected type of the referenced enterprise bean
+        - the optional remote interface of the referenced enterprise bean
+        or the remote business interface of the referenced enterprise 
+        bean
+        - the optional expected home interface of the referenced 
+        enterprise bean.  Not applicable if this ejb-ref
+        refers to the remote business interface of a 3.0 bean.
+        - optional ejb-link information, used to specify the
+        referenced enterprise bean
+        - optional elements to define injection of the named enterprise
+        bean into a component field or property
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="ejb-ref-name"
+                   type="javaee:ejb-ref-nameType"/>
+      <xsd:element name="ejb-ref-type"
+                   type="javaee:ejb-ref-typeType"
+                   minOccurs="0"/>
+      <xsd:element name="home"
+                   type="javaee:homeType"
+                   minOccurs="0"/>
+      <xsd:element name="remote"
+                   type="javaee:remoteType"
+                   minOccurs="0"/>
+      <xsd:element name="ejb-link"
+                   type="javaee:ejb-linkType"
+                   minOccurs="0"/>
+      <xsd:group ref="javaee:resourceGroup"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ejb-ref-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The ejb-ref-typeType contains the expected type of the
+        referenced enterprise bean.
+        
+        The ejb-ref-type designates a value
+        that must be one of the following:
+        
+        Entity
+        Session
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="Entity"/>
+        <xsd:enumeration value="Session"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="emptyType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This type is used to designate an empty
+        element when used. 
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="env-entryType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The env-entryType is used to declare an application's
+        environment entry. The declaration consists of an optional
+        description, the name of the environment entry, a type
+        (optional if the value is injected, otherwise required), and
+        an optional value.
+        
+        It also includes optional elements to define injection of
+        the named resource into fields or JavaBeans properties.
+        
+        If a value is not specified and injection is requested,
+        no injection will occur and no entry of the specified name
+        will be created.  This allows an initial value to be
+        specified in the source code without being incorrectly
+        changed when no override has been specified.
+        
+        If a value is not specified and no injection is requested,
+        a value must be supplied during deployment. 
+        
+        This type is used by env-entry elements.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="env-entry-name"
+                   type="javaee:jndi-nameType">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            The env-entry-name element contains the name of a
+            Deployment Component's environment entry.  The name
+            is a JNDI name relative to the java:comp/env
+            context.  The name must be unique within a 
+            Deployment Component. The uniqueness
+            constraints must be defined within the declared
+            context.
+            
+            Example:
+            
+            <env-entry-name>minAmount</env-entry-name>
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="env-entry-type"
+                   type="javaee:env-entry-type-valuesType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            The env-entry-type element contains the Java language
+            type of the environment entry.  If an injection target
+            is specified for the environment entry, the type may
+            be omitted, or must match the type of the injection
+            target.  If no injection target is specified, the type
+            is required.
+            
+            Example:
+            
+            <env-entry-type>java.lang.Integer</env-entry-type>
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="env-entry-value"
+                   type="javaee:xsdStringType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            The env-entry-value designates the value of a
+            Deployment Component's environment entry. The value
+            must be a String that is valid for the
+            constructor of the specified type that takes a
+            single String parameter, or for java.lang.Character,
+            a single character.
+            
+            Example:
+            
+            <env-entry-value>100.00</env-entry-value>
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:group ref="javaee:resourceGroup"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="env-entry-type-valuesType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        This type contains the fully-qualified Java type of the
+        environment entry value that is expected by the
+        application's code.
+        
+        The following are the legal values of env-entry-type-valuesType:
+        
+        java.lang.Boolean
+        java.lang.Byte
+        java.lang.Character
+        java.lang.String
+        java.lang.Short
+        java.lang.Integer
+        java.lang.Long
+        java.lang.Float
+        java.lang.Double
+        		  java.lang.Class
+        		  any enumeration type (i.e. a subclass of java.lang.Enum)
+        
+        Examples:
+        
+        <env-entry-type>java.lang.Boolean</env-entry-type>
+        <env-entry-type>java.lang.Class</env-entry-type>
+        <env-entry-type>com.example.Color</env-entry-type>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:fully-qualified-classType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="fully-qualified-classType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The elements that use this type designate the name of a
+        Java class or interface.  The name is in the form of a
+        "binary name", as defined in the JLS.  This is the form
+        of name used in Class.forName().  Tools that need the
+        canonical name (the name used in source code) will need
+        to convert this binary name to the canonical name.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="generic-booleanType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This type defines four different values which can designate
+        boolean values. This includes values yes and no which are 
+        not designated by xsd:boolean
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="true"/>
+        <xsd:enumeration value="false"/>
+        <xsd:enumeration value="yes"/>
+        <xsd:enumeration value="no"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="iconType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The icon type contains small-icon and large-icon elements
+        that specify the file names for small and large GIF, JPEG,
+        or PNG icon images used to represent the parent element in a
+        GUI tool. 
+        
+        The xml:lang attribute defines the language that the
+        icon file names are provided in. Its value is "en" (English)
+        by default. 
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="small-icon"
+                   type="javaee:pathType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            The small-icon element contains the name of a file
+            containing a small (16 x 16) icon image. The file
+            name is a relative path within the Deployment
+            Component's Deployment File.
+            
+            The image may be in the GIF, JPEG, or PNG format.
+            The icon can be used by tools.
+            
+            Example:
+            
+            <small-icon>employee-service-icon16x16.jpg</small-icon>
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="large-icon"
+                   type="javaee:pathType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            The large-icon element contains the name of a file
+            containing a large
+            (32 x 32) icon image. The file name is a relative 
+            path within the Deployment Component's Deployment
+            File.
+            
+            The image may be in the GIF, JPEG, or PNG format.
+            The icon can be used by tools.
+            
+            Example:
+            
+            <large-icon>employee-service-icon32x32.jpg</large-icon>
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute ref="xml:lang"/>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="injection-targetType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        An injection target specifies a class and a name within
+        that class into which a resource should be injected.
+        
+        The injection target class specifies the fully qualified
+        class name that is the target of the injection.  The
+        Java EE specifications describe which classes can be an
+        injection target.
+        
+        The injection target name specifies the target within
+        the specified class.  The target is first looked for as a
+        JavaBeans property name.  If not found, the target is
+        looked for as a field name.
+        
+        The specified resource will be injected into the target
+        during initialization of the class by either calling the
+        set method for the target property or by setting a value
+        into the named field.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="injection-target-class"
+                   type="javaee:fully-qualified-classType"/>
+      <xsd:element name="injection-target-name"
+                   type="javaee:java-identifierType"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <xsd:simpleType name="isolation-levelType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        	The following transaction isolation levels are allowed
+        	(see documentation for the java.sql.Connection interface):
+        TRANSACTION_READ_UNCOMMITTED
+        TRANSACTION_READ_COMMITTED
+        TRANSACTION_REPEATABLE_READ
+        TRANSACTION_SERIALIZABLE
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value="TRANSACTION_READ_UNCOMMITTED"/>
+      <xsd:enumeration value="TRANSACTION_READ_COMMITTED"/>
+      <xsd:enumeration value="TRANSACTION_REPEATABLE_READ"/>
+      <xsd:enumeration value="TRANSACTION_SERIALIZABLE"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="java-identifierType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The java-identifierType defines a Java identifier.
+        The users of this type should further verify that 
+        the content does not contain Java reserved keywords.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:pattern value="($|_|\p{L})(\p{L}|\p{Nd}|_|$)*"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="java-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This is a generic type that designates a Java primitive
+        type or a fully qualified name of a Java interface/type,
+        or an array of such types.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:pattern value="[^\p{Z}]*"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="jdbc-urlType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The jdbc-urlType contains the url pattern of the mapping.
+        It must follow the rules specified in Section 9.3 of the
+        JDBC Specification where the format is:
+        
+        jdbc:<subprotocol>:<subname>
+        
+        Example:
+        
+        <url>jdbc:mysql://localhost:3307/testdb</url>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:pattern value="jdbc:(.*):(.*)"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="jndi-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The jndi-nameType type designates a JNDI name in the
+        Deployment Component's environment and is relative to the
+        java:comp/env context.  A JNDI name must be unique within the
+        Deployment Component.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="homeType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The homeType defines the fully-qualified name of
+        an enterprise bean's home interface. 
+        
+        Example:
+        
+        <home>com.aardvark.payroll.PayrollHome</home>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:fully-qualified-classType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="lifecycle-callbackType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The lifecycle-callback type specifies a method on a
+        class to be called when a lifecycle event occurs.
+        Note that each class may have only one lifecycle callback
+        method for any given event and that the method may not
+        be overloaded.
+        
+        If the lifefycle-callback-class element is missing then
+        the class defining the callback is assumed to be the
+        component class in scope at the place in the descriptor
+        in which the callback definition appears.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="lifecycle-callback-class"
+                   type="javaee:fully-qualified-classType"
+                   minOccurs="0"/>
+      <xsd:element name="lifecycle-callback-method"
+                   type="javaee:java-identifierType"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="listenerType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The listenerType indicates the deployment properties for a web
+        application listener bean.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="listener-class"
+                   type="javaee:fully-qualified-classType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The listener-class element declares a class in the
+            application must be registered as a web
+            application listener bean. The value is the fully
+            qualified classname of the listener class.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="localType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The localType defines the fully-qualified name of an
+        enterprise bean's local interface.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:fully-qualified-classType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="local-homeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The local-homeType defines the fully-qualified
+        name of an enterprise bean's local home interface.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:fully-qualified-classType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="param-valueType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This type is a general type that can be used to declare
+        parameter/value lists.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="param-name"
+                   type="javaee:string">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The param-name element contains the name of a
+            parameter.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="param-value"
+                   type="javaee:xsdStringType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The param-value element contains the value of a
+            parameter.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="pathType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The elements that use this type designate either a relative
+        path or an absolute path starting with a "/".
+        
+        In elements that specify a pathname to a file within the
+        same Deployment File, relative filenames (i.e., those not
+        starting with "/") are considered relative to the root of
+        the Deployment File's namespace.  Absolute filenames (i.e.,
+        those starting with "/") also specify names in the root of
+        the Deployment File's namespace.  In general, relative names
+        are preferred.  The exception is .war files where absolute
+        names are preferred for consistency with the Servlet API.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="persistence-context-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The persistence-context-ref element contains a declaration
+        of Deployment Component's reference to a persistence context
+        associated within a Deployment Component's
+        environment. It consists of:
+        
+        - an optional description
+        - the persistence context reference name
+        - an optional persistence unit name.  If not specified,
+        the default persistence unit is assumed.
+        - an optional specification as to whether
+        the persistence context type is Transaction or
+        Extended.  If not specified, Transaction is assumed.
+        - an optional list of persistence properties
+        - optional injection targets
+        
+        Examples:
+        
+        <persistence-context-ref>
+        <persistence-context-ref-name>myPersistenceContext
+        </persistence-context-ref-name>
+        </persistence-context-ref>
+        
+        <persistence-context-ref>
+        <persistence-context-ref-name>myPersistenceContext
+        </persistence-context-ref-name>
+        <persistence-unit-name>PersistenceUnit1
+        </persistence-unit-name>
+        <persistence-context-type>Extended</persistence-context-type>
+        </persistence-context-ref>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="persistence-context-ref-name"
+                   type="javaee:jndi-nameType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The persistence-context-ref-name element specifies
+            the name of a persistence context reference; its
+            value is the environment entry name used in
+            Deployment Component code.  The name is a JNDI name
+            relative to the java:comp/env context.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="persistence-unit-name"
+                   type="javaee:string"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The Application Assembler(or BeanProvider) may use the
+            following syntax to avoid the need to rename persistence
+            units to have unique names within a Java EE application.
+            
+            The Application Assembler specifies the pathname of the
+            root of the persistence.xml file for the referenced
+            persistence unit and appends the name of the persistence
+            unit separated from the pathname by #. The pathname is
+            relative to the referencing application component jar file. 
+            In this manner, multiple persistence units with the same
+            persistence unit name may be uniquely identified when the 
+            Application Assembler cannot change persistence unit names.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="persistence-context-type"
+                   type="javaee:persistence-context-typeType"
+                   minOccurs="0"/>
+      <xsd:element name="persistence-property"
+                   type="javaee:propertyType"
+                   minOccurs="0"
+                   maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Used to specify properties for the container or persistence
+            provider.  Vendor-specific properties may be included in
+            the set of properties.  Properties that are not recognized
+            by a vendor must be ignored.  Entries that make use of the 
+            namespace javax.persistence and its subnamespaces must not
+            be used for vendor-specific properties.  The namespace
+            javax.persistence is reserved for use by the specification.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:group ref="javaee:resourceBaseGroup"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="persistence-context-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The persistence-context-typeType specifies the transactional
+        nature of a persistence context reference.  
+        
+        The value of the persistence-context-type element must be
+        one of the following:
+        Transaction
+        Extended
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="Transaction"/>
+        <xsd:enumeration value="Extended"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="propertyType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Specifies a name/value pair.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="name"
+                   type="javaee:xsdStringType">
+      </xsd:element>
+      <xsd:element name="value"
+                   type="javaee:xsdStringType">
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="persistence-unit-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The persistence-unit-ref element contains a declaration
+        of Deployment Component's reference to a persistence unit
+        associated within a Deployment Component's
+        environment. It consists of:
+        
+        - an optional description
+        - the persistence unit reference name
+        - an optional persistence unit name.  If not specified,
+        the default persistence unit is assumed.
+        - optional injection targets
+        
+        Examples:
+        
+        <persistence-unit-ref>
+        <persistence-unit-ref-name>myPersistenceUnit
+        </persistence-unit-ref-name>
+        </persistence-unit-ref>
+        
+        <persistence-unit-ref>
+        <persistence-unit-ref-name>myPersistenceUnit
+        </persistence-unit-ref-name>
+        <persistence-unit-name>PersistenceUnit1
+        </persistence-unit-name>
+        </persistence-unit-ref>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="persistence-unit-ref-name"
+                   type="javaee:jndi-nameType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The persistence-unit-ref-name element specifies
+            the name of a persistence unit reference; its
+            value is the environment entry name used in
+            Deployment Component code.  The name is a JNDI name
+            relative to the java:comp/env context.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="persistence-unit-name"
+                   type="javaee:string"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The Application Assembler(or BeanProvider) may use the
+            following syntax to avoid the need to rename persistence
+            units to have unique names within a Java EE application.
+            
+            The Application Assembler specifies the pathname of the
+            root of the persistence.xml file for the referenced
+            persistence unit and appends the name of the persistence
+            unit separated from the pathname by #. The pathname is
+            relative to the referencing application component jar file. 
+            In this manner, multiple persistence units with the same
+            persistence unit name may be uniquely identified when the 
+            Application Assembler cannot change persistence unit names.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:group ref="javaee:resourceBaseGroup"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="remoteType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The remote element contains the fully-qualified name
+        of the enterprise bean's remote interface.
+        
+        Example:
+        
+        <remote>com.wombat.empl.EmployeeService</remote>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:fully-qualified-classType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="resource-env-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The resource-env-refType is used to define
+        resource-env-ref elements.  It contains a declaration of a
+        Deployment Component's reference to an administered object
+        associated with a resource in the Deployment Component's
+        environment.  It consists of an optional description, the
+        resource environment reference name, and an optional
+        indication of the resource environment reference type
+        expected by the Deployment Component code.
+        
+        It also includes optional elements to define injection of
+        the named resource into fields or JavaBeans properties.
+        
+        The resource environment type must be supplied unless an
+        injection target is specified, in which case the type
+        of the target is used.  If both are specified, the type
+        must be assignment compatible with the type of the injection
+        target.
+        
+        Example:
+        
+        <resource-env-ref>
+        <resource-env-ref-name>jms/StockQueue
+        </resource-env-ref-name>
+        <resource-env-ref-type>javax.jms.Queue
+        </resource-env-ref-type>
+        </resource-env-ref>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="resource-env-ref-name"
+                   type="javaee:jndi-nameType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The resource-env-ref-name element specifies the name
+            of a resource environment reference; its value is
+            the environment entry name used in
+            the Deployment Component code.  The name is a JNDI 
+            name relative to the java:comp/env context and must 
+            be unique within a Deployment Component.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="resource-env-ref-type"
+                   type="javaee:fully-qualified-classType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The resource-env-ref-type element specifies the type
+            of a resource environment reference.  It is the
+            fully qualified name of a Java language class or
+            interface.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:group ref="javaee:resourceGroup"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="resource-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The resource-refType contains a declaration of a
+        Deployment Component's reference to an external resource. It
+        consists of an optional description, the resource manager
+        connection factory reference name, an optional indication of
+        the resource manager connection factory type expected by the
+        Deployment Component code, an optional type of authentication
+        (Application or Container), and an optional specification of
+        the shareability of connections obtained from the resource
+        (Shareable or Unshareable).
+        
+        It also includes optional elements to define injection of
+        the named resource into fields or JavaBeans properties.
+        
+        The connection factory type must be supplied unless an
+        injection target is specified, in which case the type
+        of the target is used.  If both are specified, the type
+        must be assignment compatible with the type of the injection
+        target.
+        
+        Example:
+        
+        <resource-ref>
+        <res-ref-name>jdbc/EmployeeAppDB</res-ref-name>
+        <res-type>javax.sql.DataSource</res-type>
+        <res-auth>Container</res-auth>
+        <res-sharing-scope>Shareable</res-sharing-scope>
+        </resource-ref>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="res-ref-name"
+                   type="javaee:jndi-nameType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The res-ref-name element specifies the name of a
+            resource manager connection factory reference.
+            The name is a JNDI name relative to the
+            java:comp/env context.  
+            The name must be unique within a Deployment File. 
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="res-type"
+                   type="javaee:fully-qualified-classType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The res-type element specifies the type of the data
+            source. The type is specified by the fully qualified
+            Java language class or interface
+            expected to be implemented by the data source.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="res-auth"
+                   type="javaee:res-authType"
+                   minOccurs="0"/>
+      <xsd:element name="res-sharing-scope"
+                   type="javaee:res-sharing-scopeType"
+                   minOccurs="0"/>
+      <xsd:group ref="javaee:resourceGroup"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="res-authType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The res-authType specifies whether the Deployment Component
+        code signs on programmatically to the resource manager, or
+        whether the Container will sign on to the resource manager
+        on behalf of the Deployment Component. In the latter case,
+        the Container uses information that is supplied by the
+        Deployer.
+        
+        The value must be one of the two following:
+        
+        Application
+        Container
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="Application"/>
+        <xsd:enumeration value="Container"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="res-sharing-scopeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The res-sharing-scope type specifies whether connections
+        obtained through the given resource manager connection
+        factory reference can be shared. The value, if specified,
+        must be one of the two following:
+        
+        Shareable
+        Unshareable
+        
+        The default value is Shareable.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="Shareable"/>
+        <xsd:enumeration value="Unshareable"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="run-asType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The run-asType specifies the run-as identity to be
+        used for the execution of a component. It contains an 
+        optional description, and the name of a security role.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="role-name"
+                   type="javaee:role-nameType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="role-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The role-nameType designates the name of a security role.
+        
+        The name must conform to the lexical rules for a token.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="security-roleType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The security-roleType contains the definition of a security
+        role. The definition consists of an optional description of
+        the security role, and the security role name.
+        
+        Example:
+        
+        <security-role>
+        <description>
+        This role includes all employees who are authorized
+        to access the employee service application.
+        </description>
+        <role-name>employee</role-name>
+        </security-role>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="role-name"
+                   type="javaee:role-nameType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="security-role-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The security-role-refType contains the declaration of a
+        security role reference in a component's or a
+        Deployment Component's code. The declaration consists of an
+        optional description, the security role name used in the
+        code, and an optional link to a security role. If the
+        security role is not specified, the Deployer must choose an
+        appropriate security role.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="role-name"
+                   type="javaee:role-nameType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The value of the role-name element must be the String used
+            as the parameter to the 
+            EJBContext.isCallerInRole(String roleName) method or the
+            HttpServletRequest.isUserInRole(String role) method.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="role-link"
+                   type="javaee:role-nameType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The role-link element is a reference to a defined
+            security role. The role-link element must contain
+            the name of one of the security roles defined in the
+            security-role elements.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdQNameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This type adds an "id" attribute to xsd:QName.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:QName">
+        <xsd:attribute name="id"
+                       type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdBooleanType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This type adds an "id" attribute to xsd:boolean.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:boolean">
+        <xsd:attribute name="id"
+                       type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdNMTOKENType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This type adds an "id" attribute to xsd:NMTOKEN.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:NMTOKEN">
+        <xsd:attribute name="id"
+                       type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdAnyURIType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This type adds an "id" attribute to xsd:anyURI.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:anyURI">
+        <xsd:attribute name="id"
+                       type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdIntegerType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This type adds an "id" attribute to xsd:integer.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:integer">
+        <xsd:attribute name="id"
+                       type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdPositiveIntegerType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This type adds an "id" attribute to xsd:positiveInteger.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:positiveInteger">
+        <xsd:attribute name="id"
+                       type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdNonNegativeIntegerType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This type adds an "id" attribute to xsd:nonNegativeInteger.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:nonNegativeInteger">
+        <xsd:attribute name="id"
+                       type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="xsdStringType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This type adds an "id" attribute to xsd:string.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:string">
+        <xsd:attribute name="id"
+                       type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="string">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This is a special string datatype that is defined by Java EE as
+        a base type for defining collapsed strings. When schemas
+        require trailing/leading space elimination as well as
+        collapsing the existing whitespace, this base type may be
+        used.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:token">
+        <xsd:attribute name="id"
+                       type="xsd:ID"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="true-falseType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This simple type designates a boolean with only two
+        permissible values
+        
+        - true
+        - false
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:xsdBooleanType">
+        <xsd:pattern value="(true|false)"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="url-patternType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The url-patternType contains the url pattern of the mapping.
+        It must follow the rules specified in Section 11.2 of the
+        Servlet API Specification. This pattern is assumed to be in
+        URL-decoded form and must not contain CR(#xD) or LF(#xA).
+        If it contains those characters, the container must inform
+        the developer with a descriptive error message.
+        The container must preserve all characters including whitespaces.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="message-destinationType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The message-destinationType specifies a message
+        destination. The logical destination described by this
+        element is mapped to a physical destination by the Deployer.
+        
+        The message destination element contains: 
+        
+        - an optional description
+        - an optional display-name
+        - an optional icon
+        - a message destination name which must be unique
+        among message destination names within the same 
+        Deployment File. 
+        - an optional mapped name
+        - an optional lookup name
+        
+        Example: 
+        
+        <message-destination>
+        <message-destination-name>CorporateStocks
+        </message-destination-name>
+        </message-destination>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="message-destination-name"
+                   type="javaee:string">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The message-destination-name element specifies a
+            name for a message destination.  This name must be
+            unique among the names of message destinations
+            within the Deployment File.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="mapped-name"
+                   type="javaee:xsdStringType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            A product specific name that this message destination
+            should be mapped to.  Each message-destination-ref
+            element that references this message destination will
+            define a name in the namespace of the referencing
+            component or in one of the other predefined namespaces. 
+            Many application servers provide a way to map these
+            local names to names of resources known to the
+            application server.  This mapped name is often a global
+            JNDI name, but may be a name of any form.  Each of the
+            local names should be mapped to this same global name.
+            
+            Application servers are not required to support any
+            particular form or type of mapped name, nor the ability
+            to use mapped names.  The mapped name is
+            product-dependent and often installation-dependent.  No
+            use of a mapped name is portable.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="lookup-name"
+                   type="javaee:xsdStringType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The JNDI name to be looked up to resolve the message destination.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="message-destination-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The message-destination-ref element contains a declaration
+        of Deployment Component's reference to a message destination
+        associated with a resource in Deployment Component's
+        environment. It consists of:
+        
+        - an optional description
+        - the message destination reference name
+        - an optional message destination type
+        - an optional specification as to whether
+        the destination is used for 
+        consuming or producing messages, or both.
+        if not specified, "both" is assumed.
+        - an optional link to the message destination
+        - optional injection targets
+        
+        The message destination type must be supplied unless an
+        injection target is specified, in which case the type
+        of the target is used.  If both are specified, the type
+        must be assignment compatible with the type of the injection
+        target.
+        
+        Examples:
+        
+        <message-destination-ref>
+        <message-destination-ref-name>jms/StockQueue
+        </message-destination-ref-name>
+        <message-destination-type>javax.jms.Queue
+        </message-destination-type>
+        <message-destination-usage>Consumes
+        </message-destination-usage>
+        <message-destination-link>CorporateStocks
+        </message-destination-link>
+        </message-destination-ref>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="message-destination-ref-name"
+                   type="javaee:jndi-nameType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The message-destination-ref-name element specifies
+            the name of a message destination reference; its
+            value is the environment entry name used in
+            Deployment Component code.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="message-destination-type"
+                   type="javaee:message-destination-typeType"
+                   minOccurs="0"/>
+      <xsd:element name="message-destination-usage"
+                   type="javaee:message-destination-usageType"
+                   minOccurs="0"/>
+      <xsd:element name="message-destination-link"
+                   type="javaee:message-destination-linkType"
+                   minOccurs="0"/>
+      <xsd:group ref="javaee:resourceGroup"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="message-destination-usageType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The message-destination-usageType specifies the use of the
+        message destination indicated by the reference.  The value
+        indicates whether messages are consumed from the message
+        destination, produced for the destination, or both.  The
+        Assembler makes use of this information in linking producers
+        of a destination with its consumers.
+        
+        The value of the message-destination-usage element must be
+        one of the following:
+        Consumes
+        Produces
+        ConsumesProduces
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="Consumes"/>
+        <xsd:enumeration value="Produces"/>
+        <xsd:enumeration value="ConsumesProduces"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="message-destination-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The message-destination-typeType specifies the type of
+        the destination. The type is specified by the Java interface
+        expected to be implemented by the destination.
+        
+        Example: 
+        
+        <message-destination-type>javax.jms.Queue
+        </message-destination-type>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:fully-qualified-classType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="message-destination-linkType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The message-destination-linkType is used to link a message
+        destination reference or message-driven bean to a message
+        destination.
+        
+        The Assembler sets the value to reflect the flow of messages
+        between producers and consumers in the application.
+        
+        The value must be the message-destination-name of a message
+        destination in the same Deployment File or in another
+        Deployment File in the same Java EE application unit.
+        
+        Alternatively, the value may be composed of a path name
+        specifying a Deployment File containing the referenced
+        message destination with the message-destination-name of the
+        destination appended and separated from the path name by
+        "#". The path name is relative to the Deployment File
+        containing Deployment Component that is referencing the
+        message destination.  This allows multiple message
+        destinations with the same name to be uniquely identified.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_1_3.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_1_3.xsd
new file mode 100644
index 0000000..7daf23e
--- /dev/null
+++ b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_1_3.xsd
@@ -0,0 +1,572 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://java.sun.com/xml/ns/javaee"
+            xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified"
+            version="1.3">
+  <xsd:annotation>
+    <xsd:documentation>
+
+      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+      
+      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
+      
+      The contents of this file are subject to the terms of either the
+      GNU General Public License Version 2 only ("GPL") or the Common
+      Development and Distribution License("CDDL") (collectively, the
+      "License").  You may not use this file except in compliance with
+      the License. You can obtain a copy of the License at
+      https://glassfish.dev.java.net/public/CDDL+GPL.html or
+      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
+      specific language governing permissions and limitations under the
+      License.
+      
+      When distributing the software, include this License Header
+      Notice in each file and include the License file at
+      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
+      particular file as subject to the "Classpath" exception as
+      provided by Sun in the GPL Version 2 section of the License file
+      that accompanied this code.  If applicable, add the following
+      below the License Header, with the fields enclosed by brackets []
+      replaced by your own identifying information:
+      "Portions Copyrighted [year] [name of copyright owner]"
+      
+      Contributor(s):
+      
+      If you wish your version of this file to be governed by only the
+      CDDL or only the GPL Version 2, indicate your decision by adding
+      "[Contributor] elects to include this software in this
+      distribution under the [CDDL or GPL Version 2] license."  If you
+      don't indicate a single choice of license, a recipient has the
+      option to distribute your version of this file under either the
+      CDDL, the GPL Version 2 or to extend the choice of license to its
+      licensees as provided above.  However, if you add GPL Version 2
+      code and therefore, elected the GPL Version 2 license, then the
+      option applies only if the new code is made subject to such
+      option by the copyright holder.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      (C) Copyright International Business Machines Corporation 2002
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+      <![CDATA[[
+      The webservices element is the root element for the web services
+      deployment descriptor.  It specifies the set of web service
+      descriptions that are to be deployed into the Java EE Application
+      Server and the dependencies they have on container resources and
+      services.  The deployment descriptor must be named
+      "META-INF/webservices.xml" in the web services' jar file.
+      
+      Used in: webservices.xml
+      
+      All webservices deployment descriptors must indicate the
+      webservices schema by using the Java EE namespace:
+      
+      http://java.sun.com/xml/ns/javaee
+      
+      and by indicating the version of the schema by using the version
+      element as shown below:
+      
+      <webservices xmlns="http://java.sun.com/xml/ns/javaee"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+      	http://java.sun.com/xml/ns/javaee/javaee_web_services_1_3.xsd"
+      version="1.3">
+      ...
+      </webservices>
+      
+      The instance documents may indicate the published version of the
+      schema using the xsi:schemaLocation attribute for the Java EE
+      namespace with the following location:
+      
+      http://java.sun.com/xml/ns/javaee/javaee_web_services_1_3.xsd
+      
+      ]]>
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      The following conventions apply to all Java EE
+      deployment descriptor elements unless indicated otherwise.
+      
+      - In elements that specify a pathname to a file within the
+      same JAR file, relative filenames (i.e., those not
+      starting with "/") are considered relative to the root of
+      the JAR file's namespace.  Absolute filenames (i.e., those
+      starting with "/") also specify names in the root of the
+      JAR file's namespace.  In general, relative names are
+      preferred.  The exception is .war files where absolute
+      names are preferred for consistency with the Servlet API.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:include schemaLocation="javaee_6.xsd"/>
+
+
+<!-- **************************************************** -->
+
+  <xsd:element name="webservices"
+               type="javaee:webservicesType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The webservices element is the root element for the web services
+        deployment descriptor.  It specifies the set of web service
+        descriptions that are to be deployed into the Java EE Application Server
+        and the dependencies they have on container resources and services.
+        
+        Used in: webservices.xml
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:key name="webservice-description-name-key">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The webservice-description-name identifies the collection of
+          port-components associated with a WSDL file and JAX-RPC mapping. The
+          name must be unique within the deployment descriptor.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:webservice-description"/>
+      <xsd:field xpath="javaee:webservice-description-name"/>
+    </xsd:key>
+  </xsd:element>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="port-componentType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The port-component element associates a WSDL port with a web service
+        interface and implementation.  It defines the name of the port as a
+        component, optional description, optional display name, optional iconic
+        representations, WSDL port QName, Service Endpoint Interface, Service
+        Implementation Bean.
+        
+        This element also associates a WSDL service with a JAX-WS Provider
+        implementation.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="1"/>
+      <xsd:element name="display-name"
+                   type="javaee:display-nameType"
+                   minOccurs="0"
+                   maxOccurs="1"/>
+      <xsd:element name="icon"
+                   type="javaee:iconType"
+                   minOccurs="0"
+                   maxOccurs="1"/>
+      <xsd:element name="port-component-name"
+                   type="javaee:string">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            The port-component-name element specifies a port component's
+            name.  This name is assigned by the module producer to name
+            the service implementation bean in the module's deployment
+            descriptor. The name must be unique among the port component
+            names defined in the same module.
+            
+            Used in: port-component
+            
+            Example:
+            	      <port-component-name>EmployeeService
+            	      </port-component-name>
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="wsdl-service"
+                   type="javaee:xsdQNameType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Defines the name space and local name part of the WSDL
+            service QName. This is required to be specified for
+            port components that are JAX-WS Provider implementations.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="wsdl-port"
+                   type="javaee:xsdQNameType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Defines the name space and local name part of the WSDL
+            port QName. This is not required to be specified for port
+            components that are JAX-WS Provider implementations
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="enable-mtom"
+                   type="javaee:true-falseType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Used to enable or disable SOAP MTOM/XOP mechanism for an
+            endpoint implementation.
+            
+            Not to be specified for JAX-RPC runtime
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="mtom-threshold"
+                   type="javaee:xsdNonNegativeIntegerType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            When MTOM is enabled, binary data above this size in bytes
+            will be XOP encoded or sent as attachment. Default value is 0.
+            
+            Not to be specified for JAX-RPC runtime
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="addressing"
+                   type="javaee:addressingType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            This specifies the WS-Addressing requirements for a JAX-WS
+            web service. It corresponds to javax.xml.ws.soap.Addressing
+            annotation or its feature javax.xml.ws.soap.AddressingFeature.
+            
+            See the addressingType for more information.
+            
+            Not to be specified for JAX-RPC runtime
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="respect-binding"
+                   type="javaee:respect-bindingType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Corresponds to the javax.xml.ws.RespectBinding annotation
+            or its corresponding javax.xml.ws.RespectBindingFeature web
+            service feature. This is used to control whether a JAX-WS
+            implementation must respect/honor the contents of the
+            wsdl:binding in the WSDL that is associated with the service.
+            
+            Not to be specified for JAX-RPC runtime
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="protocol-binding"
+                   type="javaee:protocol-bindingType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Used to specify the protocol binding used by the port-component.
+            If this element is not specified, then the default binding is
+            used (SOAP 1.1 over HTTP)
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="service-endpoint-interface"
+                   type="javaee:fully-qualified-classType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+            <![CDATA[[
+            The service-endpoint-interface element contains the
+            fully-qualified name of the port component's Service Endpoint
+            Interface.
+            
+            Used in: port-component
+            
+            Example:
+            	      <remote>com.wombat.empl.EmployeeService</remote>
+            
+            This may not be specified in case there is no Service
+            Enpoint Interface as is the case with directly using an
+            implementation class with the @WebService annotation.
+            
+            When the port component is a Provider implementation
+            this is not specified.
+            
+            ]]>
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="service-impl-bean"
+                   type="javaee:service-impl-beanType"/>
+      <xsd:choice>
+        <xsd:element name="handler"
+                     type="javaee:handlerType"
+                     minOccurs="0"
+                     maxOccurs="unbounded">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              	 To be used with JAX-RPC based runtime only.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="handler-chains"
+                     type="javaee:handler-chainsType"
+                     minOccurs="0"
+                     maxOccurs="1">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              	 To be used with JAX-WS based runtime only.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+      </xsd:choice>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="service-impl-beanType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The service-impl-bean element defines the web service implementation.
+        A service implementation can be an EJB bean class or JAX-RPC web
+        component.  Existing EJB implementations are exposed as a web service
+        using an ejb-link.
+        
+        Used in: port-component
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:choice>
+      <xsd:element name="ejb-link"
+                   type="javaee:ejb-linkType"/>
+      <xsd:element name="servlet-link"
+                   type="javaee:servlet-linkType"/>
+    </xsd:choice>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="servlet-linkType">
+    <xsd:annotation>
+      <xsd:documentation>
+        <![CDATA[[
+        The servlet-link element is used in the service-impl-bean element
+        to specify that a Service Implementation Bean is defined as a
+        JAX-RPC Service Endpoint.
+        
+        The value of the servlet-link element must be the servlet-name of
+        a JAX-RPC Service Endpoint in the same WAR file.
+        
+        Used in: service-impl-bean
+        
+        Example:
+        	  <servlet-link>StockQuoteService</servlet-link>
+        
+        ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="webservice-descriptionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The webservice-description element defines a WSDL document file
+        and the set of Port components associated with the WSDL ports
+        defined in the WSDL document.  There may be multiple
+        webservice-descriptions defined within a module.
+        
+        All WSDL file ports must have a corresponding port-component element
+        defined.
+        
+        Used in: webservices
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="1"/>
+      <xsd:element name="display-name"
+                   type="javaee:display-nameType"
+                   minOccurs="0"
+                   maxOccurs="1"/>
+      <xsd:element name="icon"
+                   type="javaee:iconType"
+                   minOccurs="0"
+                   maxOccurs="1"/>
+      <xsd:element name="webservice-description-name"
+                   type="javaee:string">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The webservice-description-name identifies the collection of
+            port-components associated with a WSDL file and JAX-RPC
+            mapping. The name must be unique within the deployment descriptor.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="wsdl-file"
+                   type="javaee:pathType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The wsdl-file element contains the name of a WSDL file in the
+            module.  The file name is a relative path within the module.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="jaxrpc-mapping-file"
+                   type="javaee:pathType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The jaxrpc-mapping-file element contains the name of a file that
+            describes the JAX-RPC mapping between the Java interaces used by
+            the application and the WSDL description in the wsdl-file.  The
+            file name is a relative path within the module.
+            
+            This is not required when JAX-WS based runtime is used.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="port-component"
+                   type="javaee:port-componentType"
+                   minOccurs="1"
+                   maxOccurs="unbounded">
+        <xsd:key name="port-component_handler-name-key">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              Defines the name of the handler. The name must be unique
+              within the module.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:handler"/>
+          <xsd:field xpath="javaee:handler-name"/>
+        </xsd:key>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="webservicesType">
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="webservice-description"
+                   type="javaee:webservice-descriptionType"
+                   minOccurs="1"
+                   maxOccurs="unbounded">
+        <xsd:key name="port-component-name-key">
+          <xsd:annotation>
+            <xsd:documentation>
+              <![CDATA[[
+              	The port-component-name element specifies a port
+              	component's name.  This name is assigned by the module
+              	producer to name the service implementation bean in the
+              	module's deployment descriptor. The name must be unique
+              	among the port component names defined in the same module.
+              
+              	Used in: port-component
+              
+              	Example:
+              		<port-component-name>EmployeeService
+              		</port-component-name>
+              
+              	
+              
+              ]]>
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:port-component"/>
+          <xsd:field xpath="javaee:port-component-name"/>
+        </xsd:key>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="version"
+                   type="javaee:dewey-versionType"
+                   fixed="1.3"
+                   use="required">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The required value for the version is 1.3.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_client_1_3.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_client_1_3.xsd
new file mode 100644
index 0000000..5c673ae
--- /dev/null
+++ b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_web_services_client_1_3.xsd
@@ -0,0 +1,737 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://java.sun.com/xml/ns/javaee"
+            xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified"
+            version="1.3">
+  <xsd:annotation>
+    <xsd:documentation>
+
+      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+      
+      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
+      
+      The contents of this file are subject to the terms of either the
+      GNU General Public License Version 2 only ("GPL") or the Common
+      Development and Distribution License("CDDL") (collectively, the
+      "License").  You may not use this file except in compliance with
+      the License. You can obtain a copy of the License at
+      https://glassfish.dev.java.net/public/CDDL+GPL.html or
+      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
+      specific language governing permissions and limitations under the
+      License.
+      
+      When distributing the software, include this License Header
+      Notice in each file and include the License file at
+      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
+      particular file as subject to the "Classpath" exception as
+      provided by Sun in the GPL Version 2 section of the License file
+      that accompanied this code.  If applicable, add the following
+      below the License Header, with the fields enclosed by brackets []
+      replaced by your own identifying information:
+      "Portions Copyrighted [year] [name of copyright owner]"
+      
+      Contributor(s):
+      
+      If you wish your version of this file to be governed by only the
+      CDDL or only the GPL Version 2, indicate your decision by adding
+      "[Contributor] elects to include this software in this
+      distribution under the [CDDL or GPL Version 2] license."  If you
+      don't indicate a single choice of license, a recipient has the
+      option to distribute your version of this file under either the
+      CDDL, the GPL Version 2 or to extend the choice of license to its
+      licensees as provided above.  However, if you add GPL Version 2
+      code and therefore, elected the GPL Version 2 license, then the
+      option applies only if the new code is made subject to such
+      option by the copyright holder.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      (C) Copyright International Business Machines Corporation 2002
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="service-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The service-ref element declares a reference to a Web
+        service. It contains optional description, display name and
+        icons, a declaration of the required Service interface,
+        an optional WSDL document location, an optional set
+        of JAX-RPC mappings, an optional QName for the service element,
+        an optional set of Service Endpoint Interfaces to be resolved 
+        by the container to a WSDL port, and an optional set of handlers.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="service-ref-name"
+                   type="javaee:jndi-nameType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The service-ref-name element declares logical name that the
+            components in the module use to look up the Web service. It 
+            is recommended that all service reference names start with 
+            "service/".
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="service-interface"
+                   type="javaee:fully-qualified-classType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The service-interface element declares the fully qualified class
+            name of the JAX-RPC Service interface the client depends on. 
+            In most cases the value will be javax.xml.rpc.Service.  A JAX-RPC
+            generated Service Interface class may also be specified.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="service-ref-type"
+                   type="javaee:fully-qualified-classType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The service-ref-type element declares the type of the service-ref 
+            element that is injected or returned when a JNDI lookup is done.
+            This must be either a fully qualified name of Service class or 
+            the fully qualified name of service endpoint interface class. 
+            This is only used with JAX-WS runtime where the corresponding 
+            @WebServiceRef annotation can be used to denote both a Service
+            or a Port.
+            
+            If this is not specified, then the type of service-ref element 
+            that is injected or returned when a JNDI lookup is done is 
+            always a Service interface/class.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="wsdl-file"
+                   type="javaee:xsdAnyURIType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The wsdl-file element contains the URI location of a WSDL
+            file. The location is relative to the root of the module.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="jaxrpc-mapping-file"
+                   type="javaee:pathType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The jaxrpc-mapping-file element contains the name of a file that
+            describes the JAX-RPC mapping between the Java interaces used by
+            the application and the WSDL description in the wsdl-file.  The 
+            file name is a relative path within the module file.
+            
+            This is not required when JAX-WS based runtime is used.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="service-qname"
+                   type="javaee:xsdQNameType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The service-qname element declares the specific WSDL service
+            element that is being refered to.  It is not specified if no
+            wsdl-file is declared.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="port-component-ref"
+                   type="javaee:port-component-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The port-component-ref element declares a client dependency
+            on the container for resolving a Service Endpoint Interface
+            to a WSDL port. It optionally associates the Service Endpoint
+            Interface with a particular port-component. This is only used
+            by the container for a Service.getPort(Class) method call.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:choice>
+        <xsd:element name="handler"
+                     type="javaee:handlerType"
+                     minOccurs="0"
+                     maxOccurs="unbounded">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              	Declares the handler for a port-component. Handlers can
+              	access the init-param name/value pairs using the
+              	HandlerInfo interface. If port-name is not specified, the
+              	handler is assumed to be associated with all ports of the
+              	service.
+              
+              	To be used with JAX-RPC based runtime only.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="handler-chains"
+                     type="javaee:handler-chainsType"
+                     minOccurs="0"
+                     maxOccurs="1">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              	 To be used with JAX-WS based runtime only.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+      </xsd:choice>
+      <xsd:group ref="javaee:resourceGroup"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="port-component-refType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The port-component-ref element declares a client dependency
+        on the container for resolving a Service Endpoint Interface
+        to a WSDL port. It optionally associates the Service Endpoint
+        Interface with a particular port-component. This is only used
+        by the container for a Service.getPort(Class) method call.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="service-endpoint-interface"
+                   type="javaee:fully-qualified-classType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The service-endpoint-interface element defines a fully qualified
+            Java class that represents the Service Endpoint Interface of a
+            WSDL port.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="enable-mtom"
+                   type="javaee:true-falseType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Used to enable or disable SOAP MTOM/XOP mechanism on the client
+            side for a port-component. 
+            
+            Not to be specified for JAX-RPC runtime
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="mtom-threshold"
+                   type="javaee:xsdNonNegativeIntegerType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            When MTOM is enabled, binary data above this size in bytes
+            should be XOP encoded or sent as attachment. Default value is 0.
+            
+            Not to be specified for JAX-RPC runtime
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="addressing"
+                   type="javaee:addressingType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            This specifies the WS-Addressing requirements for a JAX-WS
+            web service. It corresponds to javax.xml.ws.soap.Addressing
+            annotation or its feature javax.xml.ws.soap.AddressingFeature.
+            
+            See the addressingType for more information.
+            
+            Not to be specified for JAX-RPC runtime
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="respect-binding"
+                   type="javaee:respect-bindingType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Corresponds to the javax.xml.ws.RespectBinding annotation
+            or its corresponding javax.xml.ws.RespectBindingFeature web
+            service feature. This is used to control whether a JAX-WS
+            implementation must respect/honor the contents of the
+            wsdl:binding in the WSDL that is associated with the service.
+            
+            Not to be specified for JAX-RPC runtime
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="port-component-link"
+                   type="javaee:string"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The port-component-link element links a port-component-ref
+            to a specific port-component required to be made available
+            by a service reference.
+            
+            The value of a port-component-link must be the
+            port-component-name of a port-component in the same module
+            or another module in the same application unit. The syntax
+            for specification follows the syntax defined for ejb-link
+            in the EJB 2.0 specification.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="handler-chainsType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The handler-chains element defines the handlerchains associated with this
+        service or service endpoint.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="handler-chain"
+                   type="javaee:handler-chainType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="handler-chainType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The handler-chain element defines the handlerchain. 
+        Handlerchain can be defined such that the handlers in the
+        handlerchain operate,all ports of a service, on a specific
+        port or on a list of protocol-bindings. The choice of elements
+        service-name-pattern, port-name-pattern and protocol-bindings
+        are used to specify whether the handlers in handler-chain are
+        for a service, port or protocol binding. If none of these 
+        choices are specified with the handler-chain element then the
+        handlers specified in the handler-chain will be applied on 
+        everything.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice minOccurs="0"
+                  maxOccurs="1">
+        <xsd:element name="service-name-pattern"
+                     type="javaee:qname-pattern"/>
+        <xsd:element name="port-name-pattern"
+                     type="javaee:qname-pattern"/>
+        <xsd:element name="protocol-bindings"
+                     type="javaee:protocol-bindingListType"/>
+      </xsd:choice>
+      <xsd:element name="handler"
+                   type="javaee:handlerType"
+                   minOccurs="1"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+  <xsd:simpleType name="protocol-bindingListType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Defines the type used for specifying a list of
+        protocol-bindingType(s). For e.g.
+        
+        ##SOAP11_HTTP ##SOAP12_HTTP ##XML_HTTP
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:list itemType="javaee:protocol-bindingType"/>
+  </xsd:simpleType>
+
+  <xsd:simpleType name="protocol-bindingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Defines the type used for specifying the URI for the
+        protocol binding used by the port-component.  For
+        portability one could use one of the following tokens that
+        alias the standard binding types: 
+        
+        ##SOAP11_HTTP
+        ##SOAP11_HTTP_MTOM
+        ##SOAP12_HTTP
+        ##SOAP12_HTTP_MTOM
+        ##XML_HTTP
+        
+        Other specifications could define tokens that start with ##
+        to alias new standard binding URIs that are introduced.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:union memberTypes="xsd:anyURI javaee:protocol-URIAliasType"/>
+  </xsd:simpleType>
+
+  <xsd:simpleType name="protocol-URIAliasType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Defines the type that is used for specifying tokens that
+        start with ## which are used to alias existing standard
+        protocol bindings and support aliases for new standard
+        binding URIs that are introduced in future specifications.
+        
+        The following tokens alias the standard protocol binding
+        URIs:
+        
+        ##SOAP11_HTTP = "http://schemas.xmlsoap.org/wsdl/soap/http"
+        ##SOAP11_HTTP_MTOM = 
+        "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true"
+        ##SOAP12_HTTP = "http://www.w3.org/2003/05/soap/bindings/HTTP/"
+        ##SOAP12_HTTP_MTOM = 
+        "http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true"
+        ##XML_HTTP = "http://www.w3.org/2004/08/wsdl/http"
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:pattern value="##.+"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <xsd:simpleType name="qname-pattern">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This is used to specify the QName pattern in the
+        attribute service-name-pattern and port-name-pattern in
+        the handler-chain element
+        
+        For example, the various forms acceptable here for
+        service-name-pattern attribute in handler-chain element
+        are :
+        
+        Exact Name: service-name-pattern="ns1:EchoService"
+        
+        	 In this case, handlers specified in this
+        	 handler-chain element will apply to all ports with
+        	 this exact service name. The namespace prefix must
+        	 have been declared in a namespace declaration
+        	 attribute in either the start-tag of the element
+        	 where the prefix is used or in an an ancestor 
+        	 element (i.e. an element in whose content the 
+        	 prefixed markup occurs)
+        	 
+        
+        Pattern : service-name-pattern="ns1:EchoService*"
+        
+        	 In this case, handlers specified in this
+        	 handler-chain element will apply to all ports whose
+        	 Service names are like EchoService1, EchoServiceFoo
+        	 etc. The namespace prefix must have been declared in
+        	 a namespace declaration attribute in either the
+        	 start-tag of the element where the prefix is used or
+        	 in an an ancestor element (i.e. an element in whose 
+        	 content the prefixed markup occurs)
+        
+        Wild Card : service-name-pattern="*"
+        
+        	In this case, handlers specified in this handler-chain
+        	element will apply to ports of all service names.
+        
+        The same can be applied to port-name attribute in
+        handler-chain element.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:pattern value="\*|([\i-[:]][\c-[:]]*:)?[\i-[:]][\c-[:]]*\*?"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="addressingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This specifies the WS-Addressing requirements for a JAX-WS web service.
+        It corresponds to javax.xml.ws.soap.Addressing annotation or its
+        feature javax.xml.ws.soap.AddressingFeature.
+        
+        If the "enabled" element is "true", WS-Addressing is enabled.
+        It means that the endpoint supports WS-Addressing but does not require
+        its use. The default value for "enabled" is "true".
+        
+        If the WS-Addressing is enabled and the "required" element is "true",
+        it means that the endpoint requires WS-Addressing. The default value
+        for "required" is "false".
+        
+        If WS-Addressing is enabled, the "responses" element determines
+        if an endpoint requires the use of only anonymous responses,
+        or only non-anonymous responses, or all. The value of the "responses"
+        element must be one of the following:
+        
+        ANONYMOUS
+        NON_ANONYMOUS
+        ALL
+        
+        The default value for the "responses" is ALL.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="enabled"
+                   type="javaee:true-falseType"
+                   minOccurs="0"
+                   maxOccurs="1"/>
+      <xsd:element name="required"
+                   type="javaee:true-falseType"
+                   minOccurs="0"
+                   maxOccurs="1"/>
+      <xsd:element name="responses"
+                   type="javaee:addressing-responsesType"
+                   minOccurs="0"
+                   maxOccurs="1"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="addressing-responsesType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        If WS-Addressing is enabled, this type determines if an endpoint
+        requires the use of only anonymous responses, or only non-anonymous
+        responses, or all.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="ANONYMOUS"/>
+        <xsd:enumeration value="NON_ANONYMOUS"/>
+        <xsd:enumeration value="ALL"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="respect-bindingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Corresponds to the javax.xml.ws.RespectBinding annotation
+        or its corresponding javax.xml.ws.RespectBindingFeature web
+        service feature. This is used to control whether a JAX-WS
+        implementation must respect/honor the contents of the
+        wsdl:binding in the WSDL that is associated with the service.
+        
+        If the "enabled" element is "true", wsdl:binding in the
+        associated WSDL, if any, must be respected/honored.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="enabled"
+                   type="javaee:true-falseType"
+                   minOccurs="0"
+                   maxOccurs="1"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="handlerType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Declares the handler for a port-component, service-ref. Handlers can
+        access the init-param name/value pairs using the HandlerInfo interface.
+        
+        Used in: port-component, service-ref
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="handler-name"
+                   type="javaee:string">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Defines the name of the handler. The name must be unique within the
+            module.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="handler-class"
+                   type="javaee:fully-qualified-classType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Defines a fully qualified class name for the handler implementation.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="init-param"
+                   type="javaee:param-valueType"
+                   minOccurs="0"
+                   maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Not to be specified for JAX-WS runtime
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="soap-header"
+                   type="javaee:xsdQNameType"
+                   minOccurs="0"
+                   maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Defines the QName of a SOAP header that will be processed by the
+            handler.
+            
+            Not to be specified for JAX-WS runtime
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="soap-role"
+                   type="javaee:string"
+                   minOccurs="0"
+                   maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The soap-role element contains a SOAP actor definition that the
+            Handler will play as a role.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="port-name"
+                   type="javaee:string"
+                   minOccurs="0"
+                   maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The port-name element defines the WSDL port-name that a
+            handler should be associated with. If port-name is not
+            specified, the handler is assumed to be associated with
+            all ports of the service.
+            
+            Not to be specified for JAX-WS runtime
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+  <xsd:group name="service-refGroup">
+    <xsd:sequence>
+      <xsd:element name="service-ref"
+                   type="javaee:service-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded">
+        <xsd:key name="service-ref_handler-name-key">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              Defines the name of the handler. The name must be unique
+              within the module.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+          <xsd:selector xpath="javaee:handler"/>
+          <xsd:field xpath="javaee:handler-name"/>
+        </xsd:key>
+      </xsd:element>
+    </xsd:sequence>
+  </xsd:group>
+
+</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/jsp_2_2.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/jsp_2_2.xsd
new file mode 100644
index 0000000..fa41e42
--- /dev/null
+++ b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/jsp_2_2.xsd
@@ -0,0 +1,389 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://java.sun.com/xml/ns/javaee"
+            xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified"
+            version="2.2">
+  <xsd:annotation>
+    <xsd:documentation>
+
+      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+      
+      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
+      
+      The contents of this file are subject to the terms of either the
+      GNU General Public License Version 2 only ("GPL") or the Common
+      Development and Distribution License("CDDL") (collectively, the
+      "License").  You may not use this file except in compliance with
+      the License. You can obtain a copy of the License at
+      https://glassfish.dev.java.net/public/CDDL+GPL.html or
+      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
+      specific language governing permissions and limitations under the
+      License.
+      
+      When distributing the software, include this License Header
+      Notice in each file and include the License file at
+      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
+      particular file as subject to the "Classpath" exception as
+      provided by Sun in the GPL Version 2 section of the License file
+      that accompanied this code.  If applicable, add the following
+      below the License Header, with the fields enclosed by brackets []
+      replaced by your own identifying information:
+      "Portions Copyrighted [year] [name of copyright owner]"
+      
+      Contributor(s):
+      
+      If you wish your version of this file to be governed by only the
+      CDDL or only the GPL Version 2, indicate your decision by adding
+      "[Contributor] elects to include this software in this
+      distribution under the [CDDL or GPL Version 2] license."  If you
+      don't indicate a single choice of license, a recipient has the
+      option to distribute your version of this file under either the
+      CDDL, the GPL Version 2 or to extend the choice of license to its
+      licensees as provided above.  However, if you add GPL Version 2
+      code and therefore, elected the GPL Version 2 license, then the
+      option applies only if the new code is made subject to such
+      option by the copyright holder.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      This is the XML Schema for the JSP 2.2 deployment descriptor
+      types.  The JSP 2.2 schema contains all the special
+      structures and datatypes that are necessary to use JSP files
+      from a web application. 
+      
+      The contents of this schema is used by the web-common_3_0.xsd 
+      file to define JSP specific content. 
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      The following conventions apply to all Java EE
+      deployment descriptor elements unless indicated otherwise.
+      
+      - In elements that specify a pathname to a file within the
+      same JAR file, relative filenames (i.e., those not
+      starting with "/") are considered relative to the root of
+      the JAR file's namespace.  Absolute filenames (i.e., those
+      starting with "/") also specify names in the root of the
+      JAR file's namespace.  In general, relative names are
+      preferred.  The exception is .war files where absolute
+      names are preferred for consistency with the Servlet API.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:include schemaLocation="javaee_6.xsd"/>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="jsp-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The jsp-configType is used to provide global configuration
+        information for the JSP files in a web application. It has
+        two subelements, taglib and jsp-property-group.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="taglib"
+                   type="javaee:taglibType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="jsp-property-group"
+                   type="javaee:jsp-property-groupType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="jsp-fileType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The jsp-file element contains the full path to a JSP file
+        within the web application beginning with a `/'.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:pathType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="jsp-property-groupType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The jsp-property-groupType is used to group a number of
+        files so they can be given global property information.
+        All files so described are deemed to be JSP files.  The
+        following additional properties can be described:
+        
+        - Control whether EL is ignored.
+        - Control whether scripting elements are invalid.
+        - Indicate pageEncoding information.
+        - Indicate that a resource is a JSP document (XML).
+        - Prelude and Coda automatic includes.
+        - Control whether the character sequence #{ is allowed
+        when used as a String literal.
+        - Control whether template text containing only
+        whitespaces must be removed from the response output.
+        - Indicate the default contentType information.
+        - Indicate the default buffering model for JspWriter
+        - Control whether error should be raised for the use of
+        undeclared namespaces in a JSP page.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="url-pattern"
+                   type="javaee:url-patternType"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="el-ignored"
+                   type="javaee:true-falseType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Can be used to easily set the isELIgnored
+            property of a group of JSP pages.  By default, the
+            EL evaluation is enabled for Web Applications using
+            a Servlet 2.4 or greater web.xml, and disabled
+            otherwise.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="page-encoding"
+                   type="javaee:string"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The valid values of page-encoding are those of the
+            pageEncoding page directive.  It is a
+            translation-time error to name different encodings
+            in the pageEncoding attribute of the page directive
+            of a JSP page and in a JSP configuration element
+            matching the page.  It is also a translation-time
+            error to name different encodings in the prolog
+            or text declaration of a document in XML syntax and
+            in a JSP configuration element matching the document.
+            It is legal to name the same encoding through
+            mulitple mechanisms.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="scripting-invalid"
+                   type="javaee:true-falseType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Can be used to easily disable scripting in a
+            group of JSP pages.  By default, scripting is
+            enabled.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="is-xml"
+                   type="javaee:true-falseType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            If true, denotes that the group of resources
+            that match the URL pattern are JSP documents,
+            and thus must be interpreted as XML documents.
+            If false, the resources are assumed to not
+            be JSP documents, unless there is another
+            property group that indicates otherwise.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="include-prelude"
+                   type="javaee:pathType"
+                   minOccurs="0"
+                   maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The include-prelude element is a context-relative
+            path that must correspond to an element in the
+            Web Application.  When the element is present,
+            the given path will be automatically included (as
+            in an include directive) at the beginning of each
+            JSP page in this jsp-property-group.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="include-coda"
+                   type="javaee:pathType"
+                   minOccurs="0"
+                   maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The include-coda element is a context-relative
+            path that must correspond to an element in the
+            Web Application.  When the element is present,
+            the given path will be automatically included (as
+            in an include directive) at the end of each
+            JSP page in this jsp-property-group.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="deferred-syntax-allowed-as-literal"
+                   type="javaee:true-falseType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The character sequence #{ is reserved for EL expressions.
+            Consequently, a translation error occurs if the #{
+            character sequence is used as a String literal, unless
+            this element is enabled (true). Disabled (false) by
+            default.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="trim-directive-whitespaces"
+                   type="javaee:true-falseType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Indicates that template text containing only whitespaces
+            must be removed from the response output. It has no
+            effect on JSP documents (XML syntax). Disabled (false)
+            by default.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="default-content-type"
+                   type="javaee:string"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The valid values of default-content-type are those of the
+            contentType page directive.  It specifies the default
+            response contentType if the page directive does not include
+            a contentType attribute.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="buffer"
+                   type="javaee:string"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The valid values of buffer are those of the
+            buffer page directive.  It specifies if buffering should be
+            used for the output to response, and if so, the size of the
+            buffer to use.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="error-on-undeclared-namespace"
+                   type="javaee:true-falseType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The default behavior when a tag with unknown namespace is used
+            in a JSP page (regular syntax) is to silently ignore it.  If
+            set to true, then an error must be raised during the translation
+            time when an undeclared tag is used in a JSP page.  Disabled
+            (false) by default.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="taglibType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The taglibType defines the syntax for declaring in
+        the deployment descriptor that a tag library is
+        available to the application.  This can be done
+        to override implicit map entries from TLD files and
+        from the container.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="taglib-uri"
+                   type="javaee:string">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            A taglib-uri element describes a URI identifying a
+            tag library used in the web application.  The body
+            of the taglib-uri element may be either an
+            absolute URI specification, or a relative URI.
+            There should be no entries in web.xml with the
+            same taglib-uri value.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="taglib-location"
+                   type="javaee:pathType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            the taglib-location element contains the location
+            (as a resource relative to the root of the web
+            application) where to find the Tag Library
+            Description file for the tag library.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/orm_2_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/orm_2_0.xsd
new file mode 100644
index 0000000..8fb6b37
--- /dev/null
+++ b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/orm_2_0.xsd
@@ -0,0 +1,1940 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Java Persistence API object/relational mapping file schema -->
+<xsd:schema targetNamespace="http://java.sun.com/xml/ns/persistence/orm" 
+  xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" 
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
+  elementFormDefault="qualified" 
+  attributeFormDefault="unqualified" 
+  version="2.0">
+
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)orm_2_0.xsd 2.0  October 1 2009
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+  Copyright (c) 2008, 2009 Sun Microsystems. All rights reserved. 
+  
+  This program and the accompanying materials are made available under the 
+  terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
+  which accompanies this distribution. 
+  The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+  and the Eclipse Distribution License is available at 
+  http://www.eclipse.org/org/documents/edl-v10.php.
+  
+  Contributors:
+      Linda DeMichiel - Java Persistence 2.0, Version 2.0 (October 1, 2009)
+      Specification available from http://jcp.org/en/jsr/detail?id=317
+  
+   This copy of orm_2_0.xsd was originally copied from the Eclipse Runtime 
+   EclipseLink Project and is included here without modification.
+   
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+     <xsd:documentation><![CDATA[
+
+       This is the XML Schema for the persistence object/relational 
+       mapping file.
+       The file may be named "META-INF/orm.xml" in the persistence 
+       archive or it may be named some other name which would be 
+       used to locate the file as resource on the classpath.
+
+       Object/relational mapping files must indicate the object/relational
+       mapping file schema by using the persistence namespace:
+
+       http://java.sun.com/xml/ns/persistence
+
+       and indicate the version of the schema by
+       using the version element as shown below:
+
+      <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
+          http://java.sun.com/xml/ns/persistence/orm/orm_2_0.xsd"
+        version="2.0">
+          ...
+      </entity-mappings>
+
+
+     ]]></xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:complexType name="emptyType"/>
+
+  <xsd:simpleType name="versionType">
+    <xsd:restriction base="xsd:token">
+      <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:element name="entity-mappings">
+    <xsd:complexType>
+      <xsd:annotation>
+        <xsd:documentation>
+
+        The entity-mappings element is the root element of a mapping
+        file. It contains the following four types of elements:
+
+        1. The persistence-unit-metadata element contains metadata
+        for the entire persistence unit. It is undefined if this element
+        occurs in multiple mapping files within the same persistence unit.
+        
+        2. The package, schema, catalog and access elements apply to all of
+        the entity, mapped-superclass and embeddable elements defined in
+        the same file in which they occur.
+
+        3. The sequence-generator, table-generator, named-query,
+        named-native-query and sql-result-set-mapping elements are global
+        to the persistence unit. It is undefined to have more than one
+        sequence-generator or table-generator of the same name in the same
+        or different mapping files in a persistence unit. It is also 
+        undefined to have more than one named-query, named-native-query, or
+        result-set-mapping of the same name in the same or different mapping 
+        files in a persistence unit.
+
+        4. The entity, mapped-superclass and embeddable elements each define
+        the mapping information for a managed persistent class. The mapping
+        information contained in these elements may be complete or it may
+        be partial.
+
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:sequence>
+        <xsd:element name="description" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="persistence-unit-metadata" 
+                     type="orm:persistence-unit-metadata"
+                     minOccurs="0"/>
+        <xsd:element name="package" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="schema" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="catalog" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="access" type="orm:access-type"
+                     minOccurs="0"/>
+        <xsd:element name="sequence-generator" type="orm:sequence-generator"
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="table-generator" type="orm:table-generator" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="named-query" type="orm:named-query" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="named-native-query" type="orm:named-native-query"
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="sql-result-set-mapping" 
+                     type="orm:sql-result-set-mapping" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="mapped-superclass" type="orm:mapped-superclass" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="entity" type="orm:entity" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="embeddable" type="orm:embeddable" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:sequence>
+      <xsd:attribute name="version" type="orm:versionType" 
+                     fixed="2.0" use="required"/>
+    </xsd:complexType>
+  </xsd:element>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="persistence-unit-metadata">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Metadata that applies to the persistence unit and not just to 
+        the mapping file in which it is contained. 
+
+        If the xml-mapping-metadata-complete element is specified,
+        the complete set of mapping metadata for the persistence unit 
+        is contained in the XML mapping files for the persistence unit.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="xml-mapping-metadata-complete" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="persistence-unit-defaults" 
+                   type="orm:persistence-unit-defaults"
+                   minOccurs="0"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="persistence-unit-defaults">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        These defaults are applied to the persistence unit as a whole 
+        unless they are overridden by local annotation or XML 
+        element settings. 
+        
+        schema - Used as the schema for all tables, secondary tables, join
+            tables, collection tables, sequence generators, and table 
+            generators that apply to the persistence unit
+        catalog - Used as the catalog for all tables, secondary tables, join
+            tables, collection tables, sequence generators, and table 
+            generators that apply to the persistence unit
+        delimited-identifiers - Used to treat database identifiers as
+            delimited identifiers.
+        access - Used as the access type for all managed classes in
+            the persistence unit
+        cascade-persist - Adds cascade-persist to the set of cascade options
+            in all entity relationships of the persistence unit
+        entity-listeners - List of default entity listeners to be invoked 
+            on each entity in the persistence unit. 
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+        <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+        <xsd:element name="schema" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="catalog" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="delimited-identifiers" type="orm:emptyType" 
+                     minOccurs="0"/>
+        <xsd:element name="access" type="orm:access-type"
+                     minOccurs="0"/>
+        <xsd:element name="cascade-persist" type="orm:emptyType" 
+                     minOccurs="0"/>
+        <xsd:element name="entity-listeners" type="orm:entity-listeners"
+                     minOccurs="0"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="entity">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Defines the settings and mappings for an entity. Is allowed to be
+        sparsely populated and used in conjunction with the annotations.
+        Alternatively, the metadata-complete attribute can be used to 
+        indicate that no annotations on the entity class (and its fields
+        or properties) are to be processed. If this is the case then 
+        the defaulting rules for the entity and its subelements will 
+        be recursively applied.
+
+        @Target(TYPE) @Retention(RUNTIME)
+          public @interface Entity {
+          String name() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="table" type="orm:table" 
+                   minOccurs="0"/>
+      <xsd:element name="secondary-table" type="orm:secondary-table" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="primary-key-join-column" 
+                   type="orm:primary-key-join-column" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
+      <xsd:element name="inheritance" type="orm:inheritance" minOccurs="0"/>
+      <xsd:element name="discriminator-value" type="orm:discriminator-value" 
+                   minOccurs="0"/>
+      <xsd:element name="discriminator-column" 
+                   type="orm:discriminator-column" 
+                   minOccurs="0"/>
+      <xsd:element name="sequence-generator" type="orm:sequence-generator" 
+                   minOccurs="0"/>
+      <xsd:element name="table-generator" type="orm:table-generator" 
+                   minOccurs="0"/>
+      <xsd:element name="named-query" type="orm:named-query" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="named-native-query" type="orm:named-native-query" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="sql-result-set-mapping" 
+                   type="orm:sql-result-set-mapping" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="exclude-default-listeners" type="orm:emptyType" 
+                   minOccurs="0"/>
+      <xsd:element name="exclude-superclass-listeners" type="orm:emptyType" 
+                   minOccurs="0"/>
+      <xsd:element name="entity-listeners" type="orm:entity-listeners" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
+      <xsd:element name="post-persist" type="orm:post-persist" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
+      <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
+      <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
+      <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
+      <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
+      <xsd:element name="attribute-override" type="orm:attribute-override" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="association-override" 
+                   type="orm:association-override"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="cacheable" type="xsd:boolean"/>
+    <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="access-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This element determines how the persistence provider accesses the
+        state of an entity or embedded object.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="PROPERTY"/>
+      <xsd:enumeration value="FIELD"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="association-override">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface AssociationOverride {
+          String name();
+          JoinColumn[] joinColumns() default{};
+          JoinTable joinTable() default @JoinTable;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:choice>
+        <xsd:element name="join-column" type="orm:join-column"
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="join-table" type="orm:join-table"
+                     minOccurs="0"/>
+      </xsd:choice>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="attribute-override">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface AttributeOverride {
+          String name();
+          Column column();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="column" type="orm:column"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="attributes">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This element contains the entity field or property mappings.
+        It may be sparsely populated to include only a subset of the
+        fields or properties. If metadata-complete for the entity is true
+        then the remainder of the attributes will be defaulted according
+        to the default rules.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:choice>
+        <xsd:element name="id" type="orm:id" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="embedded-id" type="orm:embedded-id" 
+                     minOccurs="0"/>
+      </xsd:choice>
+      <xsd:element name="basic" type="orm:basic"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="version" type="orm:version"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="many-to-one" type="orm:many-to-one"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="one-to-many" type="orm:one-to-many"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="one-to-one" type="orm:one-to-one"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="many-to-many" type="orm:many-to-many" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="element-collection" type="orm:element-collection" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="embedded" type="orm:embedded"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="transient" type="orm:transient"
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="basic">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Basic {
+          FetchType fetch() default EAGER;
+          boolean optional() default true;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column" type="orm:column" minOccurs="0"/>
+      <xsd:choice>
+        <xsd:element name="lob" type="orm:lob" minOccurs="0"/>
+        <xsd:element name="temporal" type="orm:temporal" minOccurs="0"/>
+        <xsd:element name="enumerated" type="orm:enumerated" minOccurs="0"/>
+      </xsd:choice>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="optional" type="xsd:boolean"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="cascade-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum CascadeType { ALL, PERSIST, MERGE, REMOVE, REFRESH, DETACH};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="cascade-all" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="cascade-persist" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="cascade-merge" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="cascade-remove" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="cascade-refresh" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="cascade-detach" type="orm:emptyType"
+                   minOccurs="0"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="collection-table">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface CollectionTable {
+          String name() default "";
+          String catalog() default "";
+          String schema() default "";
+          JoinColumn[] joinColumns() default {};
+          UniqueConstraint[] uniqueConstraints() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="join-column" type="orm:join-column" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="unique-constraint" type="orm:unique-constraint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Column {
+          String name() default "";
+          boolean unique() default false;
+          boolean nullable() default true;
+          boolean insertable() default true;
+          boolean updatable() default true;
+          String columnDefinition() default "";
+          String table() default "";
+          int length() default 255;
+          int precision() default 0; // decimal precision
+          int scale() default 0; // decimal scale
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="unique" type="xsd:boolean"/>
+    <xsd:attribute name="nullable" type="xsd:boolean"/>
+    <xsd:attribute name="insertable" type="xsd:boolean"/>
+    <xsd:attribute name="updatable" type="xsd:boolean"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+    <xsd:attribute name="table" type="xsd:string"/>
+    <xsd:attribute name="length" type="xsd:int"/>
+    <xsd:attribute name="precision" type="xsd:int"/>
+    <xsd:attribute name="scale" type="xsd:int"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="column-result">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface ColumnResult {
+          String name();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="discriminator-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface DiscriminatorColumn {
+          String name() default "DTYPE";
+          DiscriminatorType discriminatorType() default STRING;
+          String columnDefinition() default "";
+          int length() default 31;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="discriminator-type" type="orm:discriminator-type"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+    <xsd:attribute name="length" type="xsd:int"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="discriminator-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum DiscriminatorType { STRING, CHAR, INTEGER };
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="STRING"/>
+      <xsd:enumeration value="CHAR"/>
+      <xsd:enumeration value="INTEGER"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="discriminator-value">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface DiscriminatorValue {
+          String value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string"/>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+<xsd:complexType name="element-collection">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface ElementCollection {
+          Class targetClass() default void.class;
+          FetchType fetch() default LAZY;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice>
+        <xsd:element name="order-by" type="orm:order-by"
+                     minOccurs="0"/>
+        <xsd:element name="order-column" type="orm:order-column"
+                     minOccurs="0"/>
+      </xsd:choice>
+      <xsd:choice>
+        <xsd:element name="map-key" type="orm:map-key"
+                     minOccurs="0"/>
+        <xsd:sequence>
+          <xsd:element name="map-key-class" type="orm:map-key-class"
+                       minOccurs="0"/>
+          <xsd:choice>
+            <xsd:element name="map-key-temporal"
+                         type="orm:temporal"
+                         minOccurs="0"/>
+            <xsd:element name="map-key-enumerated"
+                         type="orm:enumerated"
+                         minOccurs="0"/>
+            <xsd:element name="map-key-attribute-override"
+                         type="orm:attribute-override"
+                         minOccurs="0" maxOccurs="unbounded"/>
+          </xsd:choice>
+          <xsd:choice>
+            <xsd:element name="map-key-column"
+                         type="orm:map-key-column"
+                         minOccurs="0"/>
+            <xsd:element name="map-key-join-column"
+                         type="orm:map-key-join-column"
+                         minOccurs="0" maxOccurs="unbounded"/>
+          </xsd:choice>
+        </xsd:sequence>
+      </xsd:choice>
+      <xsd:choice>
+        <xsd:sequence>
+          <xsd:element name="column" type="orm:column" minOccurs="0"/>
+          <xsd:choice>
+            <xsd:element name="temporal"
+                         type="orm:temporal"
+                         minOccurs="0"/>
+            <xsd:element name="enumerated"
+                         type="orm:enumerated"
+                         minOccurs="0"/>
+            <xsd:element name="lob"
+                         type="orm:lob"
+                         minOccurs="0"/>
+          </xsd:choice>
+        </xsd:sequence>
+        <xsd:sequence>
+          <xsd:element name="attribute-override"
+                       type="orm:attribute-override"
+                       minOccurs="0" maxOccurs="unbounded"/>
+          <xsd:element name="association-override"
+                       type="orm:association-override"
+                       minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+      </xsd:choice>
+      <xsd:element name="collection-table" type="orm:collection-table"
+                     minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="target-class" type="xsd:string"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+</xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="embeddable">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Defines the settings and mappings for embeddable objects. Is 
+        allowed to be sparsely populated and used in conjunction with 
+        the annotations. Alternatively, the metadata-complete attribute 
+        can be used to indicate that no annotations are to be processed 
+        in the class. If this is the case then the defaulting rules will 
+        be recursively applied.
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface Embeddable {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="attributes" type="orm:embeddable-attributes" 
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="embeddable-attributes">
+    <xsd:sequence>
+      <xsd:element name="basic" type="orm:basic" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="many-to-one" type="orm:many-to-one"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="one-to-many" type="orm:one-to-many"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="one-to-one" type="orm:one-to-one"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="many-to-many" type="orm:many-to-many" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="element-collection" type="orm:element-collection" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="embedded" type="orm:embedded"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="transient" type="orm:transient" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="embedded">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Embedded {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="attribute-override" type="orm:attribute-override" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="association-override" 
+                   type="orm:association-override"
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="embedded-id">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface EmbeddedId {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="attribute-override" type="orm:attribute-override" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="entity-listener">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Defines an entity listener to be invoked at lifecycle events
+        for the entities that list this listener.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
+      <xsd:element name="post-persist" type="orm:post-persist" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
+      <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
+      <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
+      <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
+      <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="entity-listeners">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface EntityListeners {
+          Class[] value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="entity-listener" type="orm:entity-listener" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="entity-result">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface EntityResult {
+          Class entityClass();
+          FieldResult[] fields() default {};
+          String discriminatorColumn() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="field-result" type="orm:field-result" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="entity-class" type="xsd:string" use="required"/>
+    <xsd:attribute name="discriminator-column" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="enum-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum EnumType {
+          ORDINAL,
+          STRING
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="ORDINAL"/>
+      <xsd:enumeration value="STRING"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="enumerated">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Enumerated {
+          EnumType value() default ORDINAL;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="orm:enum-type"/>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="fetch-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum FetchType { LAZY, EAGER };
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="LAZY"/>
+      <xsd:enumeration value="EAGER"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="field-result">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface FieldResult {
+          String name();
+          String column();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="column" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="generated-value">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface GeneratedValue {
+          GenerationType strategy() default AUTO;
+          String generator() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="strategy" type="orm:generation-type"/>
+    <xsd:attribute name="generator" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="generation-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum GenerationType { TABLE, SEQUENCE, IDENTITY, AUTO };
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="TABLE"/>
+      <xsd:enumeration value="SEQUENCE"/>
+      <xsd:enumeration value="IDENTITY"/>
+      <xsd:enumeration value="AUTO"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="id">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Id {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column" type="orm:column" 
+                   minOccurs="0"/>
+      <xsd:element name="generated-value" type="orm:generated-value"
+                   minOccurs="0"/>
+      <xsd:element name="temporal" type="orm:temporal" 
+                   minOccurs="0"/>
+      <xsd:element name="table-generator" type="orm:table-generator" 
+                   minOccurs="0"/>
+      <xsd:element name="sequence-generator" type="orm:sequence-generator"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="id-class">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface IdClass {
+          Class value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="inheritance">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface Inheritance {
+          InheritanceType strategy() default SINGLE_TABLE;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="strategy" type="orm:inheritance-type"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="inheritance-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum InheritanceType
+          { SINGLE_TABLE, JOINED, TABLE_PER_CLASS};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="SINGLE_TABLE"/>
+      <xsd:enumeration value="JOINED"/>
+      <xsd:enumeration value="TABLE_PER_CLASS"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="join-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface JoinColumn {
+          String name() default "";
+          String referencedColumnName() default "";
+          boolean unique() default false;
+          boolean nullable() default true;
+          boolean insertable() default true;
+          boolean updatable() default true;
+          String columnDefinition() default "";
+          String table() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="referenced-column-name" type="xsd:string"/>
+    <xsd:attribute name="unique" type="xsd:boolean"/>
+    <xsd:attribute name="nullable" type="xsd:boolean"/>
+    <xsd:attribute name="insertable" type="xsd:boolean"/>
+    <xsd:attribute name="updatable" type="xsd:boolean"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+    <xsd:attribute name="table" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="join-table">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface JoinTable {
+          String name() default "";
+          String catalog() default "";
+          String schema() default "";
+          JoinColumn[] joinColumns() default {};
+          JoinColumn[] inverseJoinColumns() default {};
+          UniqueConstraint[] uniqueConstraints() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="join-column" type="orm:join-column" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="inverse-join-column" type="orm:join-column" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="unique-constraint" type="orm:unique-constraint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="lob">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Lob {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="lock-mode-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum LockModeType { READ, WRITE, OPTIMISTIC, OPTIMISTIC_FORCE_INCREMENT, PESSIMISTIC_READ, PESSIMISTIC_WRITE, PESSIMISTIC_FORCE_INCREMENT, NONE};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="READ"/>
+      <xsd:enumeration value="WRITE"/>
+      <xsd:enumeration value="OPTIMISTIC"/>
+      <xsd:enumeration value="OPTIMISTIC_FORCE_INCREMENT"/>
+      <xsd:enumeration value="PESSIMISTIC_READ"/>
+      <xsd:enumeration value="PESSIMISTIC_WRITE"/>
+      <xsd:enumeration value="PESSIMISTIC_FORCE_INCREMENT"/>
+      <xsd:enumeration value="NONE"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+<xsd:complexType name="many-to-many">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface ManyToMany {
+          Class targetEntity() default void.class;
+          CascadeType[] cascade() default {};
+          FetchType fetch() default LAZY;
+          String mappedBy() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice>
+        <xsd:element name="order-by" type="orm:order-by"
+                   minOccurs="0"/>
+        <xsd:element name="order-column" type="orm:order-column"
+                   minOccurs="0"/>
+      </xsd:choice>
+      <xsd:choice>
+        <xsd:element name="map-key" type="orm:map-key"
+                   minOccurs="0"/>
+        <xsd:sequence>
+          <xsd:element name="map-key-class" type="orm:map-key-class"
+                   minOccurs="0"/>
+          <xsd:choice>
+            <xsd:element name="map-key-temporal"
+                         type="orm:temporal"
+                         minOccurs="0"/>
+            <xsd:element name="map-key-enumerated"
+                         type="orm:enumerated"
+                         minOccurs="0"/>
+            <xsd:element name="map-key-attribute-override"
+                         type="orm:attribute-override"
+                         minOccurs="0" maxOccurs="unbounded"/>
+          </xsd:choice>
+          <xsd:choice>
+            <xsd:element name="map-key-column" type="orm:map-key-column"
+                   minOccurs="0"/>
+            <xsd:element name="map-key-join-column"
+                   type="orm:map-key-join-column"
+                   minOccurs="0" maxOccurs="unbounded"/>
+          </xsd:choice>
+        </xsd:sequence>
+      </xsd:choice>
+      <xsd:element name="join-table" type="orm:join-table"
+                   minOccurs="0"/>
+      <xsd:element name="cascade" type="orm:cascade-type"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="target-entity" type="xsd:string"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="mapped-by" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="many-to-one">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface ManyToOne {
+          Class targetEntity() default void.class;
+          CascadeType[] cascade() default {};
+          FetchType fetch() default EAGER;
+          boolean optional() default true;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice>       
+        <xsd:element name="join-column" type="orm:join-column" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="join-table" type="orm:join-table" 
+                     minOccurs="0"/>
+      </xsd:choice>       
+      <xsd:element name="cascade" type="orm:cascade-type" 
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="target-entity" type="xsd:string"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="optional" type="xsd:boolean"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="maps-id" type="xsd:string"/>
+    <xsd:attribute name="id" type="xsd:boolean"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="map-key">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface MapKey {
+          String name() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="map-key-class">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface MapKeyClass {
+          Class value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="map-key-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface MapKeyColumn {
+          String name() default "";
+          boolean unique() default false;
+          boolean nullable() default false;
+          boolean insertable() default true;
+          boolean updatable() default true;
+          String columnDefinition() default "";
+          String table() default "";
+          int length() default 255;
+          int precision() default 0; // decimal precision
+          int scale() default 0; // decimal scale
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="unique" type="xsd:boolean"/>
+    <xsd:attribute name="nullable" type="xsd:boolean"/>
+    <xsd:attribute name="insertable" type="xsd:boolean"/>
+    <xsd:attribute name="updatable" type="xsd:boolean"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+    <xsd:attribute name="table" type="xsd:string"/>
+    <xsd:attribute name="length" type="xsd:int"/>
+    <xsd:attribute name="precision" type="xsd:int"/>
+    <xsd:attribute name="scale" type="xsd:int"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="map-key-join-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface MapKeyJoinColumn {
+          String name() default "";
+          String referencedColumnName() default "";
+          boolean unique() default false;
+          boolean nullable() default false;
+          boolean insertable() default true;
+          boolean updatable() default true;
+          String columnDefinition() default "";
+          String table() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="referenced-column-name" type="xsd:string"/>
+    <xsd:attribute name="unique" type="xsd:boolean"/>
+    <xsd:attribute name="nullable" type="xsd:boolean"/>
+    <xsd:attribute name="insertable" type="xsd:boolean"/>
+    <xsd:attribute name="updatable" type="xsd:boolean"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+    <xsd:attribute name="table" type="xsd:string"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="mapped-superclass">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Defines the settings and mappings for a mapped superclass. Is 
+        allowed to be sparsely populated and used in conjunction with 
+        the annotations. Alternatively, the metadata-complete attribute 
+        can be used to indicate that no annotations are to be processed 
+        If this is the case then the defaulting rules will be recursively 
+        applied.
+
+        @Target(TYPE) @Retention(RUNTIME)
+        public @interface MappedSuperclass{}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
+      <xsd:element name="exclude-default-listeners" type="orm:emptyType" 
+                   minOccurs="0"/>
+      <xsd:element name="exclude-superclass-listeners" type="orm:emptyType" 
+                   minOccurs="0"/>
+      <xsd:element name="entity-listeners" type="orm:entity-listeners" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
+      <xsd:element name="post-persist" type="orm:post-persist" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
+      <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
+      <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
+      <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
+      <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
+      <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="named-native-query">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface NamedNativeQuery {
+          String name();
+          String query();
+          QueryHint[] hints() default {};
+          Class resultClass() default void.class;
+          String resultSetMapping() default ""; //named SqlResultSetMapping
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="query" type="xsd:string"/>
+      <xsd:element name="hint" type="orm:query-hint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="result-class" type="xsd:string"/>
+    <xsd:attribute name="result-set-mapping" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="named-query">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface NamedQuery {
+          String name();
+          String query();
+          LockModeType lockMode() default NONE;
+          QueryHint[] hints() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="query" type="xsd:string"/>
+      <xsd:element name="lock-mode" type="orm:lock-mode-type" minOccurs="0"/>
+      <xsd:element name="hint" type="orm:query-hint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+</xsd:complexType>
+
+<!-- **************************************************** -->
+
+<xsd:complexType name="one-to-many">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface OneToMany {
+          Class targetEntity() default void.class;
+          CascadeType[] cascade() default {};
+          FetchType fetch() default LAZY;
+          String mappedBy() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice>
+        <xsd:element name="order-by" type="orm:order-by"
+                   minOccurs="0"/>
+        <xsd:element name="order-column" type="orm:order-column"
+                   minOccurs="0"/>
+      </xsd:choice>
+      <xsd:choice>
+        <xsd:element name="map-key" type="orm:map-key"
+                   minOccurs="0"/>
+        <xsd:sequence>
+          <xsd:element name="map-key-class" type="orm:map-key-class"
+                   minOccurs="0"/>
+          <xsd:choice>
+            <xsd:element name="map-key-temporal"
+                         type="orm:temporal"
+                         minOccurs="0"/>
+            <xsd:element name="map-key-enumerated"
+                         type="orm:enumerated"
+                         minOccurs="0"/>
+            <xsd:element name="map-key-attribute-override"
+                         type="orm:attribute-override"
+                         minOccurs="0" maxOccurs="unbounded"/>
+          </xsd:choice>
+          <xsd:choice>
+            <xsd:element name="map-key-column" type="orm:map-key-column"
+                   minOccurs="0"/>
+            <xsd:element name="map-key-join-column"
+                   type="orm:map-key-join-column"
+                   minOccurs="0" maxOccurs="unbounded"/>
+          </xsd:choice>
+        </xsd:sequence>
+      </xsd:choice>
+      <xsd:choice>
+        <xsd:element name="join-table" type="orm:join-table"
+                     minOccurs="0"/>
+        <xsd:element name="join-column" type="orm:join-column"
+                     minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:choice>
+      <xsd:element name="cascade" type="orm:cascade-type"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="target-entity" type="xsd:string"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="mapped-by" type="xsd:string"/>
+    <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="one-to-one">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface OneToOne {
+          Class targetEntity() default void.class;
+          CascadeType[] cascade() default {};
+          FetchType fetch() default EAGER;
+          boolean optional() default true;
+          String mappedBy() default "";
+          boolean orphanRemoval() default false;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice>
+        <xsd:element name="primary-key-join-column" 
+                     type="orm:primary-key-join-column" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="join-column" type="orm:join-column" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="join-table" type="orm:join-table" 
+                     minOccurs="0"/>
+      </xsd:choice>
+      <xsd:element name="cascade" type="orm:cascade-type" 
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="target-entity" type="xsd:string"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="optional" type="xsd:boolean"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="mapped-by" type="xsd:string"/>
+    <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
+    <xsd:attribute name="maps-id" type="xsd:string"/>
+    <xsd:attribute name="id" type="xsd:boolean"/>
+</xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="order-by">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface OrderBy {
+          String value() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string"/>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="order-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface OrderColumn {
+          String name() default "";
+          boolean nullable() default true;
+          boolean insertable() default true;
+          boolean updatable() default true;
+          String columnDefinition() default "";
+         }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="nullable" type="xsd:boolean"/>
+    <xsd:attribute name="insertable" type="xsd:boolean"/>
+    <xsd:attribute name="updatable" type="xsd:boolean"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="post-load">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PostLoad {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="post-persist">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PostPersist {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="post-remove">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PostRemove {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="post-update">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PostUpdate {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="pre-persist">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PrePersist {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="pre-remove">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PreRemove {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="pre-update">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PreUpdate {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="primary-key-join-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface PrimaryKeyJoinColumn {
+          String name() default "";
+          String referencedColumnName() default "";
+          String columnDefinition() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="referenced-column-name" type="xsd:string"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="query-hint">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME) 
+        public @interface QueryHint {
+          String name();
+          String value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="value" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="secondary-table">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface SecondaryTable {
+          String name();
+          String catalog() default "";
+          String schema() default "";
+          PrimaryKeyJoinColumn[] pkJoinColumns() default {};
+          UniqueConstraint[] uniqueConstraints() default {};
+         }
+
+       </xsd:documentation>
+     </xsd:annotation>
+     <xsd:sequence>
+       <xsd:element name="primary-key-join-column" 
+                    type="orm:primary-key-join-column" 
+                    minOccurs="0" maxOccurs="unbounded"/>
+       <xsd:element name="unique-constraint" type="orm:unique-constraint" 
+                    minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="sequence-generator">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface SequenceGenerator {
+          String name();
+          String sequenceName() default "";
+          String catalog() default "";
+          String schema() default "";
+          int initialValue() default 1;
+          int allocationSize() default 50;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="sequence-name" type="xsd:string"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+    <xsd:attribute name="initial-value" type="xsd:int"/>
+    <xsd:attribute name="allocation-size" type="xsd:int"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="sql-result-set-mapping">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface SqlResultSetMapping {
+          String name();
+          EntityResult[] entities() default {};
+          ColumnResult[] columns() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="entity-result" type="orm:entity-result" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="column-result" type="orm:column-result" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="table">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface Table {
+          String name() default "";
+          String catalog() default "";
+          String schema() default "";
+          UniqueConstraint[] uniqueConstraints() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="unique-constraint" type="orm:unique-constraint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="table-generator">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface TableGenerator {
+          String name();
+          String table() default "";
+          String catalog() default "";
+          String schema() default "";
+          String pkColumnName() default "";
+          String valueColumnName() default "";
+          String pkColumnValue() default "";
+          int initialValue() default 0;
+          int allocationSize() default 50;
+          UniqueConstraint[] uniqueConstraints() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="unique-constraint" type="orm:unique-constraint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="table" type="xsd:string"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+    <xsd:attribute name="pk-column-name" type="xsd:string"/>
+    <xsd:attribute name="value-column-name" type="xsd:string"/>
+    <xsd:attribute name="pk-column-value" type="xsd:string"/>
+    <xsd:attribute name="initial-value" type="xsd:int"/>
+    <xsd:attribute name="allocation-size" type="xsd:int"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="temporal">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Temporal {
+          TemporalType value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="orm:temporal-type"/>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="temporal-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum TemporalType {
+          DATE, // java.sql.Date
+          TIME, // java.sql.Time
+          TIMESTAMP // java.sql.Timestamp
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+      <xsd:restriction base="xsd:token">
+        <xsd:enumeration value="DATE"/>
+        <xsd:enumeration value="TIME"/>
+        <xsd:enumeration value="TIMESTAMP"/>
+     </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="transient">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Transient {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="unique-constraint">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface UniqueConstraint {
+          String name() default "";
+          String[] columnNames();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column-name" type="xsd:string" 
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="version">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Version {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column" type="orm:column" minOccurs="0"/>
+      <xsd:element name="temporal" type="orm:temporal" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+  </xsd:complexType>
+
+</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/persistence_2_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/persistence_2_0.xsd
new file mode 100644
index 0000000..8b13a02
--- /dev/null
+++ b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/persistence_2_0.xsd
@@ -0,0 +1,357 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- persistence.xml schema -->
+<xsd:schema targetNamespace="http://java.sun.com/xml/ns/persistence" 
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+  xmlns:persistence="http://java.sun.com/xml/ns/persistence"
+  elementFormDefault="qualified" 
+  attributeFormDefault="unqualified" 
+  version="2.0">
+
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)persistence_2_0.xsd  1.0  October 1 2009
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+  Copyright (c) 2008, 2009 Sun Microsystems. All rights reserved. 
+  
+  This program and the accompanying materials are made available under the 
+  terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
+  which accompanies this distribution. 
+  The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+  and the Eclipse Distribution License is available at 
+  http://www.eclipse.org/org/documents/edl-v10.php.
+  
+  Contributors:
+      Linda DeMichiel - Java Persistence 2.0, Version 2.0 (October 1, 2009)
+      Specification available from http://jcp.org/en/jsr/detail?id=317
+ 
+   This copy of persistence_2_0.xsd was originally copied from the Eclipse Runtime 
+   EclipseLink Project and is included here without modification.
+   
+    </xsd:documentation>
+  </xsd:annotation>
+
+   <xsd:annotation>
+     <xsd:documentation><![CDATA[
+
+     This is the XML Schema for the persistence configuration file.
+     The file must be named "META-INF/persistence.xml" in the 
+     persistence archive.
+
+     Persistence configuration files must indicate
+     the persistence schema by using the persistence namespace:
+
+     http://java.sun.com/xml/ns/persistence
+
+     and indicate the version of the schema by
+     using the version element as shown below:
+
+      <persistence xmlns="http://java.sun.com/xml/ns/persistence"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
+          http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
+        version="2.0">
+          ...
+      </persistence>
+
+    ]]></xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:simpleType name="versionType">
+    <xsd:restriction base="xsd:token">
+      <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:element name="persistence">
+    <xsd:complexType>
+      <xsd:sequence>
+
+        <!-- **************************************************** -->
+
+        <xsd:element name="persistence-unit" 
+                     minOccurs="1" maxOccurs="unbounded">
+          <xsd:complexType>
+            <xsd:annotation>
+              <xsd:documentation>
+
+                Configuration of a persistence unit.
+
+              </xsd:documentation>
+            </xsd:annotation>
+            <xsd:sequence>
+
+            <!-- **************************************************** -->
+
+              <xsd:element name="description" type="xsd:string" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    Description of this persistence unit.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="provider" type="xsd:string" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    Provider class that supplies EntityManagers for this 
+                    persistence unit.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="jta-data-source" type="xsd:string" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    The container-specific name of the JTA datasource to use.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="non-jta-data-source" type="xsd:string" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    The container-specific name of a non-JTA datasource to use.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="mapping-file" type="xsd:string" 
+                           minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    File containing mapping information. Loaded as a resource 
+                    by the persistence provider.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="jar-file" type="xsd:string" 
+                           minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    Jar file that is to be scanned for managed classes. 
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="class" type="xsd:string" 
+                           minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    Managed class to be included in the persistence unit and
+                    to scan for annotations.  It should be annotated 
+                    with either @Entity, @Embeddable or @MappedSuperclass.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="exclude-unlisted-classes" type="xsd:boolean" 
+                           default="true" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    When set to true then only listed classes and jars will 
+                    be scanned for persistent classes, otherwise the 
+                    enclosing jar or directory will also be scanned. 
+                    Not applicable to Java SE persistence units.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="shared-cache-mode" 
+                           type="persistence:persistence-unit-caching-type" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    Defines whether caching is enabled for the 
+                    persistence unit if caching is supported by the
+                    persistence provider. When set to ALL, all entities 
+                    will be cached. When set to NONE, no entities will
+                    be cached. When set to ENABLE_SELECTIVE, only entities
+                    specified as cacheable will be cached. When set to
+                    DISABLE_SELECTIVE, entities specified as not cacheable
+                    will not be cached. When not specified or when set to
+                    UNSPECIFIED, provider defaults may apply.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="validation-mode" 
+                           type="persistence:persistence-unit-validation-mode-type" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    The validation mode to be used for the persistence unit.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="properties" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    A list of standard and vendor-specific properties 
+                    and hints.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:sequence>
+                    <xsd:element name="property" 
+                                 minOccurs="0" maxOccurs="unbounded">
+                      <xsd:annotation>
+                        <xsd:documentation>
+                          A name-value pair.
+                        </xsd:documentation>
+                      </xsd:annotation>
+                      <xsd:complexType>
+                        <xsd:attribute name="name" type="xsd:string" 
+                                       use="required"/>
+                        <xsd:attribute name="value" type="xsd:string" 
+                                       use="required"/>
+                      </xsd:complexType>
+                    </xsd:element>
+                  </xsd:sequence>
+                </xsd:complexType>
+              </xsd:element>
+
+            </xsd:sequence>
+
+            <!-- **************************************************** -->
+
+            <xsd:attribute name="name" type="xsd:string" use="required">
+              <xsd:annotation>
+                <xsd:documentation>
+
+                  Name used in code to reference this persistence unit.
+
+                </xsd:documentation>
+              </xsd:annotation>
+            </xsd:attribute>
+
+            <!-- **************************************************** -->
+
+            <xsd:attribute name="transaction-type" 
+                           type="persistence:persistence-unit-transaction-type">
+              <xsd:annotation>
+                <xsd:documentation>
+
+                  Type of transactions used by EntityManagers from this 
+                  persistence unit.
+
+                </xsd:documentation>
+              </xsd:annotation>
+            </xsd:attribute>
+
+          </xsd:complexType>
+        </xsd:element>
+      </xsd:sequence>
+      <xsd:attribute name="version" type="persistence:versionType" 
+                     fixed="2.0" use="required"/>
+    </xsd:complexType>
+  </xsd:element>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="persistence-unit-transaction-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum PersistenceUnitTransactionType {JTA, RESOURCE_LOCAL};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="JTA"/>
+      <xsd:enumeration value="RESOURCE_LOCAL"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="persistence-unit-caching-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum SharedCacheMode { ALL, NONE, ENABLE_SELECTIVE, DISABLE_SELECTIVE, UNSPECIFIED};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="ALL"/>
+      <xsd:enumeration value="NONE"/>
+      <xsd:enumeration value="ENABLE_SELECTIVE"/>
+      <xsd:enumeration value="DISABLE_SELECTIVE"/>
+      <xsd:enumeration value="UNSPECIFIED"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="persistence-unit-validation-mode-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum ValidationMode { AUTO, CALLBACK, NONE};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="AUTO"/>
+      <xsd:enumeration value="CALLBACK"/>
+      <xsd:enumeration value="NONE"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_3_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_3_0.xsd
new file mode 100644
index 0000000..bbcdf43
--- /dev/null
+++ b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-app_3_0.xsd
@@ -0,0 +1,272 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://java.sun.com/xml/ns/javaee"
+            xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified"
+            version="3.0">
+  <xsd:annotation>
+    <xsd:documentation>
+
+      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+      
+      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
+      
+      The contents of this file are subject to the terms of either the
+      GNU General Public License Version 2 only ("GPL") or the Common
+      Development and Distribution License("CDDL") (collectively, the
+      "License").  You may not use this file except in compliance with
+      the License. You can obtain a copy of the License at
+      https://glassfish.dev.java.net/public/CDDL+GPL.html or
+      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
+      specific language governing permissions and limitations under the
+      License.
+      
+      When distributing the software, include this License Header
+      Notice in each file and include the License file at
+      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
+      particular file as subject to the "Classpath" exception as
+      provided by Sun in the GPL Version 2 section of the License file
+      that accompanied this code.  If applicable, add the following
+      below the License Header, with the fields enclosed by brackets []
+      replaced by your own identifying information:
+      "Portions Copyrighted [year] [name of copyright owner]"
+      
+      Contributor(s):
+      
+      If you wish your version of this file to be governed by only the
+      CDDL or only the GPL Version 2, indicate your decision by adding
+      "[Contributor] elects to include this software in this
+      distribution under the [CDDL or GPL Version 2] license."  If you
+      don't indicate a single choice of license, a recipient has the
+      option to distribute your version of this file under either the
+      CDDL, the GPL Version 2 or to extend the choice of license to its
+      licensees as provided above.  However, if you add GPL Version 2
+      code and therefore, elected the GPL Version 2 license, then the
+      option applies only if the new code is made subject to such
+      option by the copyright holder.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+      <![CDATA[[
+      This is the XML Schema for the Servlet 3.0 deployment descriptor.
+      The deployment descriptor must be named "WEB-INF/web.xml" in the
+      web application's war file.  All Servlet deployment descriptors
+      must indicate the web application schema by using the Java EE
+      namespace:
+      
+      http://java.sun.com/xml/ns/javaee 
+      
+      and by indicating the version of the schema by 
+      using the version element as shown below: 
+      
+      <web-app xmlns="http://java.sun.com/xml/ns/javaee"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="..."
+      version="3.0"> 
+      ...
+      </web-app>
+      
+      The instance documents may indicate the published version of
+      the schema using the xsi:schemaLocation attribute for Java EE
+      namespace with the following location:
+      
+      http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd
+      
+      ]]>
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      The following conventions apply to all Java EE
+      deployment descriptor elements unless indicated otherwise.
+      
+      - In elements that specify a pathname to a file within the
+      same JAR file, relative filenames (i.e., those not
+      starting with "/") are considered relative to the root of
+      the JAR file's namespace.  Absolute filenames (i.e., those
+      starting with "/") also specify names in the root of the
+      JAR file's namespace.  In general, relative names are
+      preferred.  The exception is .war files where absolute
+      names are preferred for consistency with the Servlet API.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:include schemaLocation="web-common_3_0.xsd"/>
+
+
+<!-- **************************************************** -->
+
+  <xsd:element name="web-app"
+               type="javaee:web-appType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The web-app element is the root of the deployment
+        descriptor for a web application.  Note that the sub-elements
+        of this element can be in the arbitrary order. Because of
+        that, the multiplicity of the elements of distributable,
+        session-config, welcome-file-list, jsp-config, login-config,
+        and locale-encoding-mapping-list was changed from "?" to "*"
+        in this schema.  However, the deployment descriptor instance
+        file must not contain multiple elements of session-config,
+        jsp-config, and login-config. When there are multiple elements of
+        welcome-file-list or locale-encoding-mapping-list, the container
+        must concatenate the element contents.  The multiple occurence
+        of the element distributable is redundant and the container
+        treats that case exactly in the same way when there is only
+        one distributable. 
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:unique name="web-common-servlet-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The servlet element contains the name of a servlet.
+          The name must be unique within the web application.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:servlet"/>
+      <xsd:field xpath="javaee:servlet-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-filter-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The filter element contains the name of a filter.
+          The name must be unique within the web application.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:filter"/>
+      <xsd:field xpath="javaee:filter-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-ejb-local-ref-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The ejb-local-ref-name element contains the name of an EJB
+          reference. The EJB reference is an entry in the web
+          application's environment and is relative to the
+          java:comp/env context.  The name must be unique within
+          the web application.
+          
+          It is recommended that name is prefixed with "ejb/".
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:ejb-local-ref"/>
+      <xsd:field xpath="javaee:ejb-ref-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-ejb-ref-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The ejb-ref-name element contains the name of an EJB
+          reference. The EJB reference is an entry in the web
+          application's environment and is relative to the
+          java:comp/env context.  The name must be unique within
+          the web application.
+          
+          It is recommended that name is prefixed with "ejb/".
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:ejb-ref"/>
+      <xsd:field xpath="javaee:ejb-ref-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-resource-env-ref-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The resource-env-ref-name element specifies the name of
+          a resource environment reference; its value is the
+          environment entry name used in the web application code.
+          The name is a JNDI name relative to the java:comp/env
+          context and must be unique within a web application.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:resource-env-ref"/>
+      <xsd:field xpath="javaee:resource-env-ref-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-message-destination-ref-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The message-destination-ref-name element specifies the name of
+          a message destination reference; its value is the
+          environment entry name used in the web application code.
+          The name is a JNDI name relative to the java:comp/env
+          context and must be unique within a web application.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:message-destination-ref"/>
+      <xsd:field xpath="javaee:message-destination-ref-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-res-ref-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The res-ref-name element specifies the name of a
+          resource manager connection factory reference.  The name
+          is a JNDI name relative to the java:comp/env context.
+          The name must be unique within a web application.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:resource-ref"/>
+      <xsd:field xpath="javaee:res-ref-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-env-entry-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The env-entry-name element contains the name of a web
+          application's environment entry.  The name is a JNDI
+          name relative to the java:comp/env context.  The name
+          must be unique within a web application.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:env-entry"/>
+      <xsd:field xpath="javaee:env-entry-name"/>
+    </xsd:unique>
+    <xsd:key name="web-common-role-name-key">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          A role-name-key is specified to allow the references
+          from the security-role-refs.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:security-role"/>
+      <xsd:field xpath="javaee:role-name"/>
+    </xsd:key>
+    <xsd:keyref name="web-common-role-name-references"
+                refer="javaee:web-common-role-name-key">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The keyref indicates the references from
+          security-role-ref to a specified role-name.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:servlet/javaee:security-role-ref"/>
+      <xsd:field xpath="javaee:role-link"/>
+    </xsd:keyref>
+  </xsd:element>
+
+</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-common_3_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-common_3_0.xsd
new file mode 100644
index 0000000..f994bc2
--- /dev/null
+++ b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-common_3_0.xsd
@@ -0,0 +1,1575 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://java.sun.com/xml/ns/javaee"
+            xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified"
+            version="3.0">
+  <xsd:annotation>
+    <xsd:documentation>
+
+      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+      
+      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
+      
+      The contents of this file are subject to the terms of either the
+      GNU General Public License Version 2 only ("GPL") or the Common
+      Development and Distribution License("CDDL") (collectively, the
+      "License").  You may not use this file except in compliance with
+      the License. You can obtain a copy of the License at
+      https://glassfish.dev.java.net/public/CDDL+GPL.html or
+      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
+      specific language governing permissions and limitations under the
+      License.
+      
+      When distributing the software, include this License Header
+      Notice in each file and include the License file at
+      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
+      particular file as subject to the "Classpath" exception as
+      provided by Sun in the GPL Version 2 section of the License file
+      that accompanied this code.  If applicable, add the following
+      below the License Header, with the fields enclosed by brackets []
+      replaced by your own identifying information:
+      "Portions Copyrighted [year] [name of copyright owner]"
+      
+      Contributor(s):
+      
+      If you wish your version of this file to be governed by only the
+      CDDL or only the GPL Version 2, indicate your decision by adding
+      "[Contributor] elects to include this software in this
+      distribution under the [CDDL or GPL Version 2] license."  If you
+      don't indicate a single choice of license, a recipient has the
+      option to distribute your version of this file under either the
+      CDDL, the GPL Version 2 or to extend the choice of license to its
+      licensees as provided above.  However, if you add GPL Version 2
+      code and therefore, elected the GPL Version 2 license, then the
+      option applies only if the new code is made subject to such
+      option by the copyright holder.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+      <![CDATA[[
+      This is the common XML Schema for the Servlet 3.0 deployment descriptor.
+      This file is in turn used by web.xml and web-fragment.xml
+      web application's war file.  All Servlet deployment descriptors
+      must indicate the web common schema by using the Java EE
+      namespace:
+      
+      http://java.sun.com/xml/ns/javaee 
+      
+      and by indicating the version of the schema by 
+      using the version element as shown below: 
+      
+      <web-app xmlns="http://java.sun.com/xml/ns/javaee"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="..."
+      version="3.0"> 
+      ...
+      </web-app>
+      
+      The instance documents may indicate the published version of
+      the schema using the xsi:schemaLocation attribute for Java EE
+      namespace with the following location:
+      
+      http://java.sun.com/xml/ns/javaee/web-common_3_0.xsd
+      
+      ]]>
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      The following conventions apply to all Java EE
+      deployment descriptor elements unless indicated otherwise.
+      
+      - In elements that specify a pathname to a file within the
+      same JAR file, relative filenames (i.e., those not
+      starting with "/") are considered relative to the root of
+      the JAR file's namespace.  Absolute filenames (i.e., those
+      starting with "/") also specify names in the root of the
+      JAR file's namespace.  In general, relative names are
+      preferred.  The exception is .war files where absolute
+      names are preferred for consistency with the Servlet API.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:include schemaLocation="javaee_6.xsd"/>
+
+  <xsd:include schemaLocation="jsp_2_2.xsd"/>
+
+  <xsd:group name="web-commonType">
+    <xsd:choice>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="distributable"
+                   type="javaee:emptyType"/>
+      <xsd:element name="context-param"
+                   type="javaee:param-valueType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The context-param element contains the declaration
+            of a web application's servlet context
+            initialization parameters.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="filter"
+                   type="javaee:filterType"/>
+      <xsd:element name="filter-mapping"
+                   type="javaee:filter-mappingType"/>
+      <xsd:element name="listener"
+                   type="javaee:listenerType"/>
+      <xsd:element name="servlet"
+                   type="javaee:servletType"/>
+      <xsd:element name="servlet-mapping"
+                   type="javaee:servlet-mappingType"/>
+      <xsd:element name="session-config"
+                   type="javaee:session-configType"/>
+      <xsd:element name="mime-mapping"
+                   type="javaee:mime-mappingType"/>
+      <xsd:element name="welcome-file-list"
+                   type="javaee:welcome-file-listType"/>
+      <xsd:element name="error-page"
+                   type="javaee:error-pageType"/>
+      <xsd:element name="jsp-config"
+                   type="javaee:jsp-configType"/>
+      <xsd:element name="security-constraint"
+                   type="javaee:security-constraintType"/>
+      <xsd:element name="login-config"
+                   type="javaee:login-configType"/>
+      <xsd:element name="security-role"
+                   type="javaee:security-roleType"/>
+      <xsd:group ref="javaee:jndiEnvironmentRefsGroup"/>
+      <xsd:element name="message-destination"
+                   type="javaee:message-destinationType"/>
+      <xsd:element name="locale-encoding-mapping-list"
+                   type="javaee:locale-encoding-mapping-listType"/>
+    </xsd:choice>
+  </xsd:group>
+
+  <xsd:attributeGroup name="web-common-attributes">
+    <xsd:attribute name="version"
+                   type="javaee:web-app-versionType"
+                   use="required"/>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+    <xsd:attribute name="metadata-complete"
+                   type="xsd:boolean">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The metadata-complete attribute defines whether this
+          deployment descriptor and other related deployment
+          descriptors for this module (e.g., web service
+          descriptors) are complete, or whether the class
+          files available to this module and packaged with
+          this application should be examined for annotations
+          that specify deployment information.
+          
+          If metadata-complete is set to "true", the deployment
+          tool must ignore any annotations that specify deployment
+          information, which might be present in the class files
+          of the application.
+          
+          If metadata-complete is not specified or is set to
+          "false", the deployment tool must examine the class
+          files of the application for annotations, as
+          specified by the specifications.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+    </xsd:attribute>
+  </xsd:attributeGroup>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="web-appType">
+    <xsd:choice minOccurs="0"
+                maxOccurs="unbounded">
+      <xsd:element name="module-name"
+                   type="javaee:string"
+                   minOccurs="0"/>
+      <xsd:group ref="javaee:web-commonType"/>
+      <xsd:element name="absolute-ordering"
+                   type="javaee:absoluteOrderingType"/>
+    </xsd:choice>
+    <xsd:attributeGroup ref="javaee:web-common-attributes"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="web-fragmentType">
+    <xsd:choice minOccurs="0"
+                maxOccurs="unbounded">
+      <xsd:element name="name"
+                   type="javaee:java-identifierType"/>
+      <xsd:group ref="javaee:web-commonType"/>
+      <xsd:element name="ordering"
+                   type="javaee:orderingType"/>
+    </xsd:choice>
+    <xsd:attributeGroup ref="javaee:web-common-attributes"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="auth-constraintType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The auth-constraintType indicates the user roles that
+        should be permitted access to this resource
+        collection. The role-name used here must either correspond
+        to the role-name of one of the security-role elements
+        defined for this web application, or be the specially
+        reserved role-name "*" that is a compact syntax for
+        indicating all roles in the web application. If both "*"
+        and rolenames appear, the container interprets this as all
+        roles.  If no roles are defined, no user is allowed access
+        to the portion of the web application described by the
+        containing security-constraint.  The container matches
+        role names case sensitively when determining access.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="role-name"
+                   type="javaee:role-nameType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="auth-methodType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The auth-methodType is used to configure the authentication
+        mechanism for the web application. As a prerequisite to
+        gaining access to any web resources which are protected by
+        an authorization constraint, a user must have authenticated
+        using the configured mechanism. Legal values are "BASIC",
+        "DIGEST", "FORM", "CLIENT-CERT", or a vendor-specific
+        authentication scheme.
+        
+        Used in: login-config
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="dispatcherType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The dispatcher has five legal values: FORWARD, REQUEST,
+        INCLUDE, ASYNC, and ERROR.
+        
+        A value of FORWARD means the Filter will be applied under
+        RequestDispatcher.forward() calls.
+        A value of REQUEST means the Filter will be applied under
+        ordinary client calls to the path or servlet.
+        A value of INCLUDE means the Filter will be applied under
+        RequestDispatcher.include() calls.
+        A value of ASYNC means the Filter will be applied under
+        calls dispatched from an AsyncContext.
+        A value of ERROR means the Filter will be applied under the
+        error page mechanism.
+        
+        The absence of any dispatcher elements in a filter-mapping
+        indicates a default of applying filters only under ordinary
+        client calls to the path or servlet.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="FORWARD"/>
+        <xsd:enumeration value="INCLUDE"/>
+        <xsd:enumeration value="REQUEST"/>
+        <xsd:enumeration value="ASYNC"/>
+        <xsd:enumeration value="ERROR"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="error-codeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The error-code contains an HTTP error code, ex: 404
+        
+        Used in: error-page
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:xsdPositiveIntegerType">
+        <xsd:pattern value="\d{3}"/>
+        <xsd:attribute name="id"
+                       type="xsd:ID"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="error-pageType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The error-pageType contains a mapping between an error code
+        or exception type to the path of a resource in the web
+        application.
+        
+        Error-page declarations using the exception-type element in
+        the deployment descriptor must be unique up to the class name of
+        the exception-type. Similarly, error-page declarations using the
+        status-code element must be unique in the deployment descriptor
+        up to the status code.
+        
+        Used in: web-app
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice minOccurs="0"
+                  maxOccurs="1">
+        <xsd:element name="error-code"
+                     type="javaee:error-codeType"/>
+        <xsd:element name="exception-type"
+                     type="javaee:fully-qualified-classType">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The exception-type contains a fully qualified class
+              name of a Java exception type.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+      </xsd:choice>
+      <xsd:element name="location"
+                   type="javaee:war-pathType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The location element contains the location of the
+            resource in the web application relative to the root of
+            the web application. The value of the location must have
+            a leading `/'.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="filterType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The filterType is used to declare a filter in the web
+        application. The filter is mapped to either a servlet or a
+        URL pattern in the filter-mapping element, using the
+        filter-name value to reference. Filters can access the
+        initialization parameters declared in the deployment
+        descriptor at runtime via the FilterConfig interface.
+        
+        Used in: web-app
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="filter-name"
+                   type="javaee:filter-nameType"/>
+      <xsd:element name="filter-class"
+                   type="javaee:fully-qualified-classType"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The fully qualified classname of the filter.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="async-supported"
+                   type="javaee:true-falseType"
+                   minOccurs="0"/>
+      <xsd:element name="init-param"
+                   type="javaee:param-valueType"
+                   minOccurs="0"
+                   maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The init-param element contains a name/value pair as
+            an initialization param of a servlet filter
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="filter-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Declaration of the filter mappings in this web
+        application is done by using filter-mappingType. 
+        The container uses the filter-mapping
+        declarations to decide which filters to apply to a request,
+        and in what order. The container matches the request URI to
+        a Servlet in the normal way. To determine which filters to
+        apply it matches filter-mapping declarations either on
+        servlet-name, or on url-pattern for each filter-mapping
+        element, depending on which style is used. The order in
+        which filters are invoked is the order in which
+        filter-mapping declarations that match a request URI for a
+        servlet appear in the list of filter-mapping elements.The
+        filter-name value must be the value of the filter-name
+        sub-elements of one of the filter declarations in the
+        deployment descriptor.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="filter-name"
+                   type="javaee:filter-nameType"/>
+      <xsd:choice minOccurs="1"
+                  maxOccurs="unbounded">
+        <xsd:element name="url-pattern"
+                     type="javaee:url-patternType"/>
+        <xsd:element name="servlet-name"
+                     type="javaee:servlet-nameType"/>
+      </xsd:choice>
+      <xsd:element name="dispatcher"
+                   type="javaee:dispatcherType"
+                   minOccurs="0"
+                   maxOccurs="5"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="nonEmptyStringType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This type defines a string which contains at least one
+        character.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:minLength value="1"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="filter-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The logical name of the filter is declare
+        by using filter-nameType. This name is used to map the
+        filter.  Each filter name is unique within the web
+        application.
+        
+        Used in: filter, filter-mapping
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="javaee:nonEmptyStringType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="form-login-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The form-login-configType specifies the login and error
+        pages that should be used in form based login. If form based
+        authentication is not used, these elements are ignored.
+        
+        Used in: login-config
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="form-login-page"
+                   type="javaee:war-pathType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The form-login-page element defines the location in the web
+            app where the page that can be used for login can be
+            found.  The path begins with a leading / and is interpreted
+            relative to the root of the WAR.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="form-error-page"
+                   type="javaee:war-pathType">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The form-error-page element defines the location in
+            the web app where the error page that is displayed
+            when login is not successful can be found. 
+            The path begins with a leading / and is interpreted
+            relative to the root of the WAR.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+  <xsd:simpleType name="http-methodType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        A HTTP method type as defined in HTTP 1.1 section 2.2.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:pattern value="[!-~-[\(\)&#60;&#62;@,;:&#34;/\[\]?=\{\}\\\p{Z}]]+"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <xsd:simpleType name="load-on-startupType">
+    <xsd:union memberTypes="javaee:null-charType xsd:integer"/>
+  </xsd:simpleType>
+
+  <xsd:simpleType name="null-charType">
+    <xsd:restriction base="xsd:string">
+      <xsd:enumeration value=""/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="login-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The login-configType is used to configure the authentication
+        method that should be used, the realm name that should be
+        used for this application, and the attributes that are
+        needed by the form login mechanism.
+        
+        Used in: web-app
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="auth-method"
+                   type="javaee:auth-methodType"
+                   minOccurs="0"/>
+      <xsd:element name="realm-name"
+                   type="javaee:string"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The realm name element specifies the realm name to
+            use in HTTP Basic authorization.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="form-login-config"
+                   type="javaee:form-login-configType"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="mime-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The mime-mappingType defines a mapping between an extension
+        and a mime type.
+        
+        Used in: web-app
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The extension element contains a string describing an
+          extension. example: "txt"
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:element name="extension"
+                   type="javaee:string"/>
+      <xsd:element name="mime-type"
+                   type="javaee:mime-typeType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="mime-typeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The mime-typeType is used to indicate a defined mime type.
+        
+        Example:
+        "text/plain"
+        
+        Used in: mime-mapping
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:pattern value="[^\p{Cc}^\s]+/[^\p{Cc}^\s]+"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="security-constraintType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The security-constraintType is used to associate
+        security constraints with one or more web resource
+        collections
+        
+        Used in: web-app
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="display-name"
+                   type="javaee:display-nameType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="web-resource-collection"
+                   type="javaee:web-resource-collectionType"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="auth-constraint"
+                   type="javaee:auth-constraintType"
+                   minOccurs="0"/>
+      <xsd:element name="user-data-constraint"
+                   type="javaee:user-data-constraintType"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="servletType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The servletType is used to declare a servlet.
+        It contains the declarative data of a
+        servlet. If a jsp-file is specified and the load-on-startup
+        element is present, then the JSP should be precompiled and
+        loaded.
+        
+        Used in: web-app
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:group ref="javaee:descriptionGroup"/>
+      <xsd:element name="servlet-name"
+                   type="javaee:servlet-nameType"/>
+      <xsd:choice minOccurs="0"
+                  maxOccurs="1">
+        <xsd:element name="servlet-class"
+                     type="javaee:fully-qualified-classType">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              The servlet-class element contains the fully
+              qualified class name of the servlet.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="jsp-file"
+                     type="javaee:jsp-fileType"/>
+      </xsd:choice>
+      <xsd:element name="init-param"
+                   type="javaee:param-valueType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="load-on-startup"
+                   type="javaee:load-on-startupType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The load-on-startup element indicates that this
+            servlet should be loaded (instantiated and have
+            its init() called) on the startup of the web
+            application. The optional contents of these
+            element must be an integer indicating the order in
+            which the servlet should be loaded. If the value
+            is a negative integer, or the element is not
+            present, the container is free to load the servlet
+            whenever it chooses. If the value is a positive
+            integer or 0, the container must load and
+            initialize the servlet as the application is
+            deployed. The container must guarantee that
+            servlets marked with lower integers are loaded
+            before servlets marked with higher integers. The
+            container may choose the order of loading of
+            servlets with the same load-on-start-up value.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="enabled"
+                   type="javaee:true-falseType"
+                   minOccurs="0"/>
+      <xsd:element name="async-supported"
+                   type="javaee:true-falseType"
+                   minOccurs="0"/>
+      <xsd:element name="run-as"
+                   type="javaee:run-asType"
+                   minOccurs="0"/>
+      <xsd:element name="security-role-ref"
+                   type="javaee:security-role-refType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="multipart-config"
+                   type="javaee:multipart-configType"
+                   minOccurs="0"
+                   maxOccurs="1"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="servlet-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The servlet-mappingType defines a mapping between a
+        servlet and a url pattern. 
+        
+        Used in: web-app
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="servlet-name"
+                   type="javaee:servlet-nameType"/>
+      <xsd:element name="url-pattern"
+                   type="javaee:url-patternType"
+                   minOccurs="1"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="servlet-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The servlet-name element contains the canonical name of the
+        servlet. Each servlet name is unique within the web
+        application.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="javaee:nonEmptyStringType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="session-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The session-configType defines the session parameters
+        for this web application.
+        
+        Used in: web-app
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="session-timeout"
+                   type="javaee:xsdIntegerType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The session-timeout element defines the default
+            session timeout interval for all sessions created
+            in this web application. The specified timeout
+            must be expressed in a whole number of minutes.
+            If the timeout is 0 or less, the container ensures
+            the default behaviour of sessions is never to time
+            out. If this element is not specified, the container
+            must set its default timeout period.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="cookie-config"
+                   type="javaee:cookie-configType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The cookie-config element defines the configuration of the
+            session tracking cookies created by this web application.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="tracking-mode"
+                   type="javaee:tracking-modeType"
+                   minOccurs="0"
+                   maxOccurs="3">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The tracking-mode element defines the tracking modes
+            for sessions created by this web application
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="cookie-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The cookie-configType defines the configuration for the
+        session tracking cookies of this web application.
+        
+        Used in: session-config
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="name"
+                   type="javaee:cookie-nameType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The name that will be assigned to any session tracking
+            cookies created by this web application.
+            The default is JSESSIONID
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="domain"
+                   type="javaee:cookie-domainType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The domain name that will be assigned to any session tracking
+            cookies created by this web application.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="path"
+                   type="javaee:cookie-pathType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The path that will be assigned to any session tracking
+            cookies created by this web application.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="comment"
+                   type="javaee:cookie-commentType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The comment that will be assigned to any session tracking
+            cookies created by this web application.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="http-only"
+                   type="javaee:true-falseType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Specifies whether any session tracking cookies created 
+            by this web application will be marked as HttpOnly
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="secure"
+                   type="javaee:true-falseType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            Specifies whether any session tracking cookies created 
+            by this web application will be marked as secure
+            even if the request that initiated the corresponding session
+            is using plain HTTP instead of HTTPS
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="max-age"
+                   type="javaee:xsdIntegerType"
+                   minOccurs="0">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The lifetime (in seconds) that will be assigned to any
+            session tracking cookies created by this web application.
+            Default is -1
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="cookie-nameType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The name that will be assigned to any session tracking
+        cookies created by this web application.
+        The default is JSESSIONID
+        
+        Used in: cookie-config
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="javaee:nonEmptyStringType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="cookie-domainType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The domain name that will be assigned to any session tracking
+        cookies created by this web application.
+        
+        Used in: cookie-config
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="javaee:nonEmptyStringType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="cookie-pathType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The path that will be assigned to any session tracking
+        cookies created by this web application.
+        
+        Used in: cookie-config
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="javaee:nonEmptyStringType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="cookie-commentType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The comment that will be assigned to any session tracking
+        cookies created by this web application.
+        
+        Used in: cookie-config
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:extension base="javaee:nonEmptyStringType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="tracking-modeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The tracking modes for sessions created by this web
+        application
+        
+        Used in: session-config
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="COOKIE"/>
+        <xsd:enumeration value="URL"/>
+        <xsd:enumeration value="SSL"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="transport-guaranteeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The transport-guaranteeType specifies that the communication
+        between client and server should be NONE, INTEGRAL, or
+        CONFIDENTIAL. NONE means that the application does not
+        require any transport guarantees. A value of INTEGRAL means
+        that the application requires that the data sent between the
+        client and server be sent in such a way that it can't be
+        changed in transit. CONFIDENTIAL means that the application
+        requires that the data be transmitted in a fashion that
+        prevents other entities from observing the contents of the
+        transmission. In most cases, the presence of the INTEGRAL or
+        CONFIDENTIAL flag will indicate that the use of SSL is
+        required.
+        
+        Used in: user-data-constraint
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:enumeration value="NONE"/>
+        <xsd:enumeration value="INTEGRAL"/>
+        <xsd:enumeration value="CONFIDENTIAL"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="user-data-constraintType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The user-data-constraintType is used to indicate how
+        data communicated between the client and container should be
+        protected.
+        
+        Used in: security-constraint
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="transport-guarantee"
+                   type="javaee:transport-guaranteeType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="war-pathType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The elements that use this type designate a path starting
+        with a "/" and interpreted relative to the root of a WAR
+        file.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:string">
+        <xsd:pattern value="/.*"/>
+      </xsd:restriction>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+  <xsd:simpleType name="web-app-versionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This type contains the recognized versions of
+        web-application supported. It is used to designate the
+        version of the web application.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="3.0"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="web-resource-collectionType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The web-resource-collectionType is used to identify the
+        resources and HTTP methods on those resources to which a
+        security constraint applies. If no HTTP methods are specified,
+        then the security constraint applies to all HTTP methods.
+        If HTTP methods are specified by http-method-omission
+        elements, the security constraint applies to all methods
+        except those identified in the collection.
+        http-method-omission and http-method elements are never
+        mixed in the same collection. 
+        
+        Used in: security-constraint
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="web-resource-name"
+                   type="javaee:string">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The web-resource-name contains the name of this web
+            resource collection.
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="description"
+                   type="javaee:descriptionType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="url-pattern"
+                   type="javaee:url-patternType"
+                   maxOccurs="unbounded"/>
+      <xsd:choice minOccurs="0"
+                  maxOccurs="1">
+        <xsd:element name="http-method"
+                     type="javaee:http-methodType"
+                     minOccurs="1"
+                     maxOccurs="unbounded">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              Each http-method names an HTTP method to which the
+              constraint applies.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+        <xsd:element name="http-method-omission"
+                     type="javaee:http-methodType"
+                     minOccurs="1"
+                     maxOccurs="unbounded">
+          <xsd:annotation>
+            <xsd:documentation>
+
+              Each http-method-omission names an HTTP method to
+              which the constraint does not apply.
+              
+            </xsd:documentation>
+          </xsd:annotation>
+        </xsd:element>
+      </xsd:choice>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="welcome-file-listType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The welcome-file-list contains an ordered list of welcome
+        files elements.
+        
+        Used in: web-app
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="welcome-file"
+                   type="xsd:string"
+                   maxOccurs="unbounded">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The welcome-file element contains file name to use
+            as a default welcome file, such as index.html
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+  <xsd:simpleType name="localeType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The localeType defines valid locale defined by ISO-639-1
+        and ISO-3166.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:pattern value="[a-z]{2}(_|-)?([\p{L}\-\p{Nd}]{2})?"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <xsd:simpleType name="encodingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The encodingType defines IANA character sets.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string">
+      <xsd:pattern value="[^\s]+"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="locale-encoding-mapping-listType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The locale-encoding-mapping-list contains one or more
+        locale-encoding-mapping(s).
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="locale-encoding-mapping"
+                   type="javaee:locale-encoding-mappingType"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="locale-encoding-mappingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The locale-encoding-mapping contains locale name and
+        encoding name. The locale name must be either "Language-code",
+        such as "ja", defined by ISO-639 or "Language-code_Country-code",
+        such as "ja_JP".  "Country code" is defined by ISO-3166.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="locale"
+                   type="javaee:localeType"/>
+      <xsd:element name="encoding"
+                   type="javaee:encodingType"/>
+    </xsd:sequence>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ordering-othersType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This element indicates that the ordering sub-element in which
+        it was placed should take special action regarding the ordering
+        of this application resource relative to other application
+        configuration resources.
+        See section 8.2.2 of the specification for details.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="id"
+                   type="xsd:ID"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="absoluteOrderingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Please see section 8.2.2 of the specification for details.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:choice minOccurs="0"
+                maxOccurs="unbounded">
+      <xsd:element name="name"
+                   type="javaee:java-identifierType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="others"
+                   type="javaee:ordering-othersType"
+                   minOccurs="0"
+                   maxOccurs="1"/>
+    </xsd:choice>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="orderingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Please see section 8.2.2 of the specification for details.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="after"
+                   type="javaee:ordering-orderingType"
+                   minOccurs="0"
+                   maxOccurs="1"/>
+      <xsd:element name="before"
+                   type="javaee:ordering-orderingType"
+                   minOccurs="0"
+                   maxOccurs="1"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="ordering-orderingType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This element contains a sequence of "name" elements, each of
+        which
+        refers to an application configuration resource by the "name"
+        declared on its web.xml fragment.  This element can also contain
+        a single "others" element which specifies that this document
+        comes
+        before or after other documents within the application.
+        See section 8.2.2 of the specification for details.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="name"
+                   type="javaee:java-identifierType"
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="others"
+                   type="javaee:ordering-othersType"
+                   minOccurs="0"
+                   maxOccurs="1"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="multipart-configType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This element specifies configuration information related to the
+        handling of multipart/form-data requests.
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="location"
+                   type="javaee:string"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The directory location where uploaded files will be stored
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="max-file-size"
+                   type="xsd:long"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The maximum size limit of uploaded files
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="max-request-size"
+                   type="xsd:long"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The maximum size limit of multipart/form-data requests
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+      <xsd:element name="file-size-threshold"
+                   type="xsd:integer"
+                   minOccurs="0"
+                   maxOccurs="1">
+        <xsd:annotation>
+          <xsd:documentation>
+
+            The size threshold after which an uploaded file will be
+            written to disk
+            
+          </xsd:documentation>
+        </xsd:annotation>
+      </xsd:element>
+    </xsd:sequence>
+  </xsd:complexType>
+
+</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facelettaglibrary_2_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facelettaglibrary_2_0.xsd
new file mode 100644
index 0000000..01b933c
--- /dev/null
+++ b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facelettaglibrary_2_0.xsd
@@ -0,0 +1,515 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+
+<xsd:schema
+      targetNamespace="http://java.sun.com/xml/ns/javaee"
+      xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+      xmlns:xml="http://www.w3.org/XML/1998/namespace"
+      elementFormDefault="qualified"
+      attributeFormDefault="unqualified"
+      version="2.0">
+    <xsd:include schemaLocation="javaee_5.xsd"/>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+      
+      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
+      
+      The contents of this file are subject to the terms of either the
+      GNU General Public License Version 2 only ("GPL") or the Common
+      Development and Distribution License("CDDL") (collectively, the
+      "License").  You may not use this file except in compliance with
+      the License. You can obtain a copy of the License at
+      https://glassfish.dev.java.net/public/CDDL+GPL.html or
+      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
+      specific language governing permissions and limitations under the
+      License.
+      
+      When distributing the software, include this License Header
+      Notice in each file and include the License file at
+      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
+      particular file as subject to the "Classpath" exception as
+      provided by Sun in the GPL Version 2 section of the License file
+      that accompanied this code.  If applicable, add the following
+      below the License Header, with the fields enclosed by brackets []
+      replaced by your own identifying information:
+      "Portions Copyrighted [year] [name of copyright owner]"
+      
+      Contributor(s):
+      
+      If you wish your version of this file to be governed by only the
+      CDDL or only the GPL Version 2, indicate your decision by adding
+      "[Contributor] elects to include this software in this
+      distribution under the [CDDL or GPL Version 2] license."  If you
+      don't indicate a single choice of license, a recipient has the
+      option to distribute your version of this file under either the
+      CDDL, the GPL Version 2 or to extend the choice of license to its
+      licensees as provided above.  However, if you add GPL Version 2
+      code and therefore, elected the GPL Version 2 license, then the
+      option applies only if the new code is made subject to such
+      option by the copyright holder.
+      
+      The Eclipse Foundation elects to include this software in this
+      distribution under the CDDL license.      
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+<xsd:annotation>
+        <xsd:documentation>
+
+            <![CDATA[
+
+            The XML Schema for the Tag Libraries in the JavaServer Faces
+            Standard Facelets View Declaration Language (Facelets VDL)
+            (Version 2.0).
+
+            JSF 2.0 Facelet Tag Libraries that wish to conform to this
+            schema must declare it in the following manner.
+
+            <facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
+              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibary_2_0.xsd"
+              version="2.0">
+
+            ...
+
+            </facelet-taglib>
+
+            The instance documents may indicate the published
+            version of the schema using xsi:schemaLocation attribute
+            for javaee namespace with the following location:
+
+            http://java.sun.com/xml/ns/javaee/web-facelettaglibary_2_0.xsd
+
+            ]]>
+
+        </xsd:documentation>
+    </xsd:annotation>
+
+
+
+    <xsd:element name="facelet-taglib" type="javaee:facelet-taglibType">
+        <xsd:unique name="facelet-taglib-tagname-uniqueness">
+            <xsd:annotation>
+                <xsd:documentation>
+
+                    tag-names must be unique within a document.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:selector xpath="javaee:tag"/>
+            <xsd:field xpath="javaee:tag-name"/>
+        </xsd:unique>
+        <xsd:unique name="faces-config-behavior-ID-uniqueness">
+            <xsd:annotation>
+                <xsd:documentation>
+
+                    Behavior IDs must be unique within a document.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:selector xpath="javaee:behavior"/>
+            <xsd:field xpath="javaee:behavior-id"/>
+        </xsd:unique>
+        <xsd:unique name="faces-config-converter-ID-uniqueness">
+            <xsd:annotation>
+                <xsd:documentation>
+
+                    Converter IDs must be unique within a document.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:selector xpath="javaee:converter"/>
+            <xsd:field xpath="javaee:converter-id"/>
+        </xsd:unique>
+        <xsd:unique name="faces-config-validator-ID-uniqueness">
+            <xsd:annotation>
+                <xsd:documentation>
+
+                    Validator IDs must be unique within a document.
+                </xsd:documentation>
+            </xsd:annotation>
+            <xsd:selector xpath="javaee:validator"/>
+            <xsd:field xpath="javaee:validator-id"/>
+        </xsd:unique>
+    </xsd:element>
+    <xsd:complexType name="facelet-taglibType">
+        <xsd:annotation>
+            <xsd:documentation>
+                The top level XML element in a facelet tag library XML file.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:choice>
+                <xsd:element name="library-class"
+                             type="javaee:fully-qualified-classType"/>
+                <xsd:sequence>
+                    <xsd:element name="namespace" type="javaee:string"/>
+                    <xsd:element minOccurs="0" maxOccurs="1"
+                                 name="composite-library-name"
+                                 type="javaee:fully-qualified-classType"/>
+                    <xsd:choice minOccurs="0" maxOccurs="unbounded">
+                        <xsd:element name="tag"
+                                     type="javaee:facelet-taglib-tagType"/>
+                        <xsd:element name="function"
+                                     type="javaee:facelet-taglib-functionType"/>
+
+                    </xsd:choice>
+                </xsd:sequence>
+            </xsd:choice>
+            <xsd:element name="taglib-extension"
+                         type="javaee:facelet-taglib-extensionType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+        <xsd:attribute name="version"
+                       type="javaee:facelet-taglib-versionType"
+                       use="required"/>
+    </xsd:complexType>
+    <xsd:complexType name="facelet-taglib-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Extension element for facelet-taglib. It may contain
+                implementation specific content.
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="facelet-taglib-tagType">
+        <xsd:annotation>
+            <xsd:documentation>
+                If the tag library XML file contains individual tag
+                declarations rather than pointing to a library-class or a
+                declaring a composite-library name, the individual tags are
+                enclosed in tag elements.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element name="tag-name"
+                         type="javaee:facelet-taglib-canonical-nameType"/>
+            <xsd:choice>
+                <xsd:element name="handler-class"
+                             type="javaee:fully-qualified-classType"/>
+                <xsd:element name="behavior"
+                             type="javaee:facelet-taglib-tag-behaviorType"/>
+                <xsd:element name="component"
+                             type="javaee:facelet-taglib-tag-componentType"/>
+                <xsd:element name="converter"
+                             type="javaee:facelet-taglib-tag-converterType"/>
+                <xsd:element name="validator"
+                             type="javaee:facelet-taglib-tag-validatorType"/>
+                <xsd:element name="source" type="javaee:string"/>
+            </xsd:choice>
+            <xsd:element name="attribute"
+                         type="javaee:facelet-taglib-tag-attributeType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+            <xsd:element name="tag-extension"
+                         type="javaee:facelet-taglib-tag-extensionType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="facelet-taglib-tag-attributeType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The attribute element defines an attribute for the nesting
+                tag. The attribute element may have several subelements
+                defining:
+
+                description a description of the attribute
+
+                name the name of the attribute
+
+                required whether the attribute is required or
+                optional
+
+                type the type of the attribute
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element name="name"
+                         type="javaee:xsdNMTOKENType"/>
+            <xsd:element name="required"
+                         type="javaee:generic-booleanType"
+                         minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        Defines if the nesting attribute is required or
+                        optional.
+
+                        If not present then the default is "false", i.e
+                        the attribute is optional.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:choice>
+                <xsd:element name="type"
+                             type="javaee:fully-qualified-classType"
+                             minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>
+
+                            Defines the Java type of the attributes
+                            value. If this element is omitted, the
+                            expected type is assumed to be
+                            "java.lang.Object".
+
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+                <xsd:element name="method-signature"
+                             type="javaee:string"
+                             minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>
+
+                            Defines the method signature for a MethodExpression-
+                            enabled attribute.
+
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+            </xsd:choice>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+
+    <xsd:complexType name="facelet-taglib-tag-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Extension element for tag It may contain
+                implementation specific content.
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="facelet-taglib-functionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                If the tag library XML file contains individual function
+                declarations rather than pointing to a library-class or a
+                declaring a composite-library name, the individual functions are
+                enclosed in function elements.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element name="function-name" type="javaee:string"/>
+            <xsd:element name="function-class"
+                         type="javaee:fully-qualified-classType"/>
+            <xsd:element name="function-signature" type="javaee:string"/>
+        </xsd:sequence>
+    </xsd:complexType>
+    <xsd:complexType name="facelet-taglib-tag-behaviorType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Within a tag element, the behavior element encapsulates
+                information specific to a JSF Behavior.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element minOccurs="1" maxOccurs="1"
+                         name="behavior-id" type="javaee:string"/>
+            <xsd:element minOccurs="0" maxOccurs="1"
+                         name="handler-class"
+                         type="javaee:fully-qualified-classType"/>
+            <xsd:element name="behavior-extension"
+                         type="javaee:facelet-taglib-tag-behavior-extensionType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:complexType>
+    <xsd:complexType name="facelet-taglib-tag-behavior-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Extension element for behavior. It may contain
+                implementation specific content.
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+    <xsd:complexType name="facelet-taglib-tag-componentType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Within a tag element, the component element encapsulates
+                information specific to a JSF UIComponent.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element name="component-type" type="javaee:string"/>
+            <xsd:element minOccurs="0" maxOccurs="1"
+                         name="renderer-type" type="javaee:string"/>
+            <xsd:element minOccurs="0" maxOccurs="1"
+                         name="handler-class"
+                         type="javaee:fully-qualified-classType"/>
+            <xsd:element name="component-extension"
+                         type="javaee:facelet-taglib-tag-component-extensionType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+
+        </xsd:sequence>
+    </xsd:complexType>
+    <xsd:complexType name="facelet-taglib-tag-component-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Extension element for component It may contain
+                implementation specific content.
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="facelet-taglib-tag-converterType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Within a tag element, the converter element encapsulates
+                information specific to a JSF Converter.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element minOccurs="1" maxOccurs="1"
+                         name="converter-id" type="javaee:string"/>
+            <xsd:element minOccurs="0" maxOccurs="1"
+                         name="handler-class"
+                         type="javaee:fully-qualified-classType"/>
+            <xsd:element name="converter-extension"
+                         type="javaee:facelet-taglib-tag-converter-extensionType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:complexType>
+    <xsd:complexType name="facelet-taglib-tag-converter-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Extension element for converter It may contain
+                implementation specific content.
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="facelet-taglib-tag-validatorType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Within a tag element, the validator element encapsulates
+                information specific to a JSF Validator.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element minOccurs="1" maxOccurs="1"
+                         name="validator-id" type="javaee:string"/>
+            <xsd:element minOccurs="0" maxOccurs="1"
+                         name="handler-class"
+                         type="javaee:fully-qualified-classType"/>
+            <xsd:element name="validator-extension"
+                         type="javaee:facelet-taglib-tag-validator-extensionType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:complexType>
+    <xsd:complexType name="facelet-taglib-tag-validator-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Extension element for validator It may contain
+                implementation specific content.
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+    <xsd:simpleType name="facelet-taglib-versionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                This type contains the recognized versions of
+                facelet-taglib supported.
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:token">
+            <xsd:enumeration value="2.0"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+
+    <xsd:complexType name="facelet-taglib-canonical-nameType">
+
+        <xsd:annotation>
+            <xsd:documentation>
+
+                Defines the canonical name of a tag or attribute being
+                defined.
+
+                The name must conform to the lexical rules for an NCName
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:simpleContent>
+            <xsd:extension base="xsd:NCName">
+                <xsd:attribute name="id" type="xsd:ID"/>
+            </xsd:extension>
+        </xsd:simpleContent>
+    </xsd:complexType>
+
+</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesconfig_2_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesconfig_2_0.xsd
new file mode 100644
index 0000000..92e80f9
--- /dev/null
+++ b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesconfig_2_0.xsd
@@ -0,0 +1,2698 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+
+
+<xsd:schema
+     targetNamespace="http://java.sun.com/xml/ns/javaee"
+     xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+     xmlns:xml="http://www.w3.org/XML/1998/namespace"
+     elementFormDefault="qualified"
+     attributeFormDefault="unqualified"
+     version="2.0">
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+      
+      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
+      
+      The contents of this file are subject to the terms of either the
+      GNU General Public License Version 2 only ("GPL") or the Common
+      Development and Distribution License("CDDL") (collectively, the
+      "License").  You may not use this file except in compliance with
+      the License. You can obtain a copy of the License at
+      https://glassfish.dev.java.net/public/CDDL+GPL.html or
+      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
+      specific language governing permissions and limitations under the
+      License.
+      
+      When distributing the software, include this License Header
+      Notice in each file and include the License file at
+      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
+      particular file as subject to the "Classpath" exception as
+      provided by Sun in the GPL Version 2 section of the License file
+      that accompanied this code.  If applicable, add the following
+      below the License Header, with the fields enclosed by brackets []
+      replaced by your own identifying information:
+      "Portions Copyrighted [year] [name of copyright owner]"
+      
+      Contributor(s):
+      
+      If you wish your version of this file to be governed by only the
+      CDDL or only the GPL Version 2, indicate your decision by adding
+      "[Contributor] elects to include this software in this
+      distribution under the [CDDL or GPL Version 2] license."  If you
+      don't indicate a single choice of license, a recipient has the
+      option to distribute your version of this file under either the
+      CDDL, the GPL Version 2 or to extend the choice of license to its
+      licensees as provided above.  However, if you add GPL Version 2
+      code and therefore, elected the GPL Version 2 license, then the
+      option applies only if the new code is made subject to such
+      option by the copyright holder.
+      
+      The Eclipse Foundation elects to include this software in this
+      distribution under the CDDL license.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+    <xsd:annotation>
+        <xsd:documentation>
+
+            <![CDATA[
+
+            The XML Schema for the JavaServer Faces Application
+            Configuration File (Version 2.0).
+
+            All JavaServer Faces configuration files must indicate
+            the JavaServer Faces schema by indicating the JavaServer
+            Faces namespace:
+
+            http://java.sun.com/xml/ns/javaee
+
+            and by indicating the version of the schema by
+            using the version element as shown below:
+
+            <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                    xsi:schemaLocation="..."
+                    version="2.0">
+                ...
+            </faces-config>
+
+            The instance documents may indicate the published
+            version of the schema using xsi:schemaLocation attribute
+            for javaee namespace with the following location:
+
+            http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd
+
+            ]]>
+
+        </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:include schemaLocation="javaee_5.xsd"/>
+
+    <!-- **************************************************** -->
+
+    <xsd:element name = "faces-config" type="javaee:faces-configType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "faces-config" element is the root of the configuration
+                information hierarchy, and contains nested elements for all
+                of the other configuration settings.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:unique name="faces-config-behavior-ID-uniqueness">
+            <xsd:annotation>
+                <xsd:documentation>
+
+                    Behavior IDs must be unique within a document.
+
+                </xsd:documentation>
+            </xsd:annotation>
+
+            <xsd:selector xpath="javaee:behavior"/>
+            <xsd:field    xpath="javaee:behavior-id"/>
+        </xsd:unique>
+
+        <xsd:unique name="faces-config-converter-ID-uniqueness">
+            <xsd:annotation>
+                <xsd:documentation>
+
+                    Converter IDs must be unique within a document.
+
+                </xsd:documentation>
+            </xsd:annotation>
+
+            <xsd:selector xpath="javaee:converter"/>
+            <xsd:field    xpath="javaee:converter-id"/>
+        </xsd:unique>
+
+        <xsd:unique name="faces-config-converter-for-class-uniqueness">
+            <xsd:annotation>
+                <xsd:documentation>
+
+                    'converter-for-class' element values must be unique
+                    within a document.
+
+                </xsd:documentation>
+            </xsd:annotation>
+
+            <xsd:selector xpath="javaee:converter"/>
+            <xsd:field    xpath="javaee:converter-for-class"/>
+        </xsd:unique>
+
+        <xsd:unique name="faces-config-validator-ID-uniqueness">
+            <xsd:annotation>
+                <xsd:documentation>
+
+                    Validator IDs must be unique within a document.
+
+                </xsd:documentation>
+            </xsd:annotation>
+
+            <xsd:selector xpath="javaee:validator"/>
+            <xsd:field    xpath="javaee:validator-id"/>
+        </xsd:unique>
+
+        <xsd:unique name="faces-config-managed-bean-name-uniqueness">
+            <xsd:annotation>
+                <xsd:documentation>
+
+                    Managed bean names must be unique within a document.
+
+                </xsd:documentation>
+            </xsd:annotation>
+
+            <xsd:selector xpath="javaee:managed-bean"/>
+            <xsd:field    xpath="javaee:managed-bean-name"/>
+        </xsd:unique>
+    </xsd:element>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-configType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "faces-config" element is the root of the configuration
+                information hierarchy, and contains nested elements for all
+                of the other configuration settings.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:choice minOccurs="0" maxOccurs="unbounded">
+            <xsd:element name="application"
+                         type="javaee:faces-config-applicationType"/>
+            <xsd:element name="ordering"
+                         type="javaee:faces-config-orderingType"/>
+            <xsd:element name="absolute-ordering"
+                         type="javaee:faces-config-absoluteOrderingType"
+                         minOccurs="0"
+                         maxOccurs="1"/>
+            <xsd:element name="factory"
+                         type="javaee:faces-config-factoryType"/>
+            <xsd:element name="component"
+                         type="javaee:faces-config-componentType"/>
+            <xsd:element name="converter"
+                         type="javaee:faces-config-converterType"/>
+            <xsd:element name="managed-bean"
+                         type="javaee:faces-config-managed-beanType"/>
+            <xsd:element name="name"
+                         type="javaee:java-identifierType"
+                         minOccurs="0"
+                         maxOccurs="1">
+              <xsd:annotation>
+                  <xsd:documentation>
+                      
+                      The "name" element within the top level "faces-config"
+                      element declares the name of this application
+                      configuration resource.  Such names are used
+                      in the document ordering scheme specified in section
+                      JSF.11.4.6.
+                      
+                  </xsd:documentation>
+              </xsd:annotation>
+            </xsd:element>
+                             
+            <xsd:element name="navigation-rule"
+                         type="javaee:faces-config-navigation-ruleType"/>
+            <xsd:element name="referenced-bean"
+                         type="javaee:faces-config-referenced-beanType"/>
+            <xsd:element name="render-kit"
+                         type="javaee:faces-config-render-kitType"/>
+            <xsd:element name="lifecycle"
+                         type="javaee:faces-config-lifecycleType"/>
+            <xsd:element name="validator"
+                         type="javaee:faces-config-validatorType"/>
+            <xsd:element name="behavior"
+                         type="javaee:faces-config-behaviorType"/>
+            <xsd:element name="faces-config-extension"
+                         type="javaee:faces-config-extensionType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+        </xsd:choice>
+        <xsd:attribute name="metadata-complete"
+                       type="xsd:boolean"
+                       use="optional">
+            <xsd:annotation>
+                <xsd:documentation>
+
+                    The metadata-complete attribute defines whether this
+                    JavaServer Faces application is complete, or whether
+                    the class files available to this module and packaged with
+                    this application should be examined for annotations
+                    that specify configuration information.
+                    
+                    This attribute is only inspected on the application 
+                    configuration resource file located at "WEB-INF/faces-config.xml".
+                    The presence of this attribute on any application configuration
+                    resource other than the one located at "WEB-INF/faces-config.xml",
+                    including any files named using the javax.faces.CONFIG_FILES
+                    attribute, must be ignored.
+
+                    If metadata-complete is set to "true", the JavaServer Faces
+                    runtime must ignore any annotations that specify configuration
+                    information, which might be present in the class files
+                    of the application.
+
+                    If metadata-complete is not specified or is set to
+                    "false", the JavaServer Faces runtime must examine the class
+                    files of the application for annotations, as specified by
+                    the specification.
+
+                    If "WEB-INF/faces-config.xml" is not present, the JavaServer
+                    Faces runtime will assume metadata-complete to be "false".
+
+                    The value of this attribute will have no impact on
+                    runtime annotations such as @ResourceDependency or
+                    @ListenerFor.
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="id" type="xsd:ID" />
+        <xsd:attribute name="version"
+                       type="javaee:faces-config-versionType"
+                       use="required"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name = "faces-config-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                Extension element for faces-config.  It may contain
+                implementation specific content.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded" />
+         </xsd:sequence>
+         <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+
+    <!-- **************************************************** -->
+
+
+    <xsd:complexType name="faces-config-orderingType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+              Please see section JSF.11.4.6 for the specification of this element.
+                
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="after" 
+                         type="javaee:faces-config-ordering-orderingType"
+                         minOccurs="0"
+                         maxOccurs="1"/>
+            <xsd:element name="before" 
+                         type="javaee:faces-config-ordering-orderingType"
+                         minOccurs="0"
+                         maxOccurs="1"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:complexType name="faces-config-ordering-orderingType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                This element contains a sequence of "id" elements, each of which
+                refers to an application configuration resource by the "id"
+                declared on its faces-config element.  This element can also contain
+                a single "others" element which specifies that this document comes
+                before or after other documents within the application.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="name" type="javaee:java-identifierType" minOccurs="0" maxOccurs="unbounded"/>
+            <xsd:element name="others" type="javaee:faces-config-ordering-othersType" minOccurs="0" maxOccurs="1" />
+        </xsd:sequence>
+    </xsd:complexType>
+    
+    <xsd:complexType name="faces-config-ordering-othersType">
+        <xsd:annotation>
+            <xsd:documentation>
+                
+                This element indicates that the ordering sub-element in which
+                it was placed should take special action regarding the ordering
+                of this application resource relative to other
+                application configuration resources.  See section JSF.11.4.6
+                for the complete specification.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+
+    <!-- **************************************************** -->
+
+
+    <xsd:complexType name="faces-config-absoluteOrderingType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+              Only relevant if this is placed within the /WEB-INF/faces-config.xml.
+              Please see section JSF.11.4.6 for the specification for details.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:choice minOccurs="0" maxOccurs="unbounded">
+            <xsd:element name="name" type="javaee:java-identifierType" minOccurs="0" maxOccurs="unbounded"/>
+            <xsd:element name="others" type="javaee:faces-config-ordering-othersType" minOccurs="0" maxOccurs="1" />
+        </xsd:choice>
+    </xsd:complexType>
+
+
+    <!-- **************************************************** -->
+
+
+    <xsd:complexType name="faces-config-applicationType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "application" element provides a mechanism to define the
+                various per-application-singleton implementation artifacts for
+                a particular web application that is utilizing 
+                JavaServer Faces.  For nested elements that are not specified, 
+                the JSF implementation must provide a suitable default.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:choice minOccurs="0" maxOccurs="unbounded">
+            <xsd:element name="action-listener"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                            
+                            The "action-listener" element contains the fully 
+                            qualified class name of the concrete 
+                            ActionListener implementation class that will be 
+                            called during the Invoke Application phase of the 
+                            request processing lifecycle.
+                            
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="default-render-kit-id"
+                         type="javaee:string">
+                <xsd:annotation>
+                    <xsd:documentation>
+                            
+                            The "default-render-kit-id" element allows the 
+                            application to define a renderkit to be used other 
+                            than the standard one. 
+                            
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="message-bundle"
+                         type="javaee:string">
+                <xsd:annotation>
+                    <xsd:documentation>
+                            
+                            The base name of a resource bundle representing 
+                            the message resources for this application.  See 
+                            the JavaDocs for the "java.util.ResourceBundle" 
+                            class for more information on the syntax of 
+                            resource bundle names.
+                            
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="navigation-handler"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                            
+                            The "navigation-handler" element contains the 
+                            fully qualified class name of the concrete 
+                            NavigationHandler implementation class that will 
+                            be called during the Invoke Application phase 
+                            of the request processing lifecycle, if the 
+                            default ActionListener (provided by the JSF 
+                            implementation) is used.
+                            
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="view-handler"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                            
+                            The "view-handler" element contains the fully 
+                            qualified class name of the concrete ViewHandler 
+                            implementation class that will be called during 
+                            the Restore View and Render Response phases of the 
+                            request processing lifecycle.  The faces 
+                            implementation must provide a default 
+                            implementation of this class.
+                            
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="state-manager"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                            
+                            The "state-manager" element contains the fully 
+                            qualified class name of the concrete StateManager 
+                            implementation class that will be called during 
+                            the Restore View and Render Response phases of the 
+                            request processing lifecycle.  The faces 
+                            implementation must provide a default 
+                            implementation of this class.
+                            
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="el-resolver"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                            
+                            The "el-resolver" element contains the fully
+                            qualified class name of the concrete
+                            javax.el.ELResolver implementation class
+                            that will be used during the processing of
+                            EL expressions.
+                            
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="property-resolver"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                            
+                            The "property-resolver" element contains the fully 
+                            qualified class name of the concrete 
+                            PropertyResolver implementation class that will 
+                            be used during the processing of value binding 
+                            expressions.
+                            
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="variable-resolver"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                            The "variable-resolver" element contains the fully
+                            qualified class name of the concrete 
+                            VariableResolver implementation class that will 
+                            be used during the processing of value binding 
+                            expressions.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="resource-handler"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        <![CDATA[
+
+                            The "resource-handler" element contains the
+                            fully qualified class name of the concrete
+                            ResourceHandler implementation class that
+                            will be used during rendering and decoding
+                            of resource requests The standard
+                            constructor based decorator pattern used for
+                            other application singletons will be
+                            honored.
+
+                        ]]>
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="system-event-listener"
+                         type="javaee:faces-config-system-event-listenerType"
+                         minOccurs="0"
+                         maxOccurs="unbounded">
+            </xsd:element>
+            <xsd:element 
+                name="locale-config"
+                type="javaee:faces-config-locale-configType"/>
+            <xsd:element 
+                name="resource-bundle"
+                type="javaee:faces-config-application-resource-bundleType"/>
+            <xsd:element name="application-extension"
+                         type="javaee:faces-config-application-extensionType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+            <xsd:element 
+                name="default-validators"
+                type="javaee:faces-config-default-validatorsType"/>
+            </xsd:choice>
+        <xsd:attribute name = "id" type = "xsd:ID"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="faces-config-application-resource-bundleType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+              The resource-bundle element inside the application element
+              references a java.util.ResourceBundle instance by name
+              using the var element.  ResourceBundles referenced in this
+              manner may be returned by a call to
+              Application.getResourceBundle() passing the current
+              FacesContext for this request and the value of the var
+              element below.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element name="base-name"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        
+                        The fully qualified class name of the
+                        java.util.ResourceBundle instance.
+                        
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="var"
+                         type="javaee:string">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        
+                        The name by which this ResourceBundle instance
+                        is retrieved by a call to
+                        Application.getResourceBundle().
+                        
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name = "faces-config-application-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                Extension element for application.  It may contain
+                implementation specific content.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded" />
+         </xsd:sequence>
+         <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name = "faces-config-factoryType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "factory" element provides a mechanism to define the 
+                various Factories that comprise parts of the implementation 
+                of JavaServer Faces.  For nested elements that are not 
+                specified, the JSF implementation must provide a suitable 
+                default.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:choice minOccurs="0" maxOccurs="unbounded">
+            <xsd:element name="application-factory"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                            
+                        The "application-factory" element contains the 
+                        fully qualified class name of the concrete 
+                        ApplicationFactory implementation class that will 
+                        be called when 
+                        FactoryFinder.getFactory(APPLICATION_FACTORY) is
+                        called.
+                            
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="exception-handler-factory"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                            
+                        The "exception-handler-factory" element contains the
+                        fully qualified class name of the concrete
+                        ExceptionHandlerFactory implementation class that will
+                        be called when 
+                        FactoryFinder.getFactory(EXCEPTION_HANDLER_FACTORY) 
+                        is called.
+                            
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="external-context-factory"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "external-context-factory" element contains the
+                        fully qualified class name of the concrete
+                        ExternalContextFactory implementation class that will
+                        be called when
+                        FactoryFinder.getFactory(EXTERNAL_CONTEXT_FACTORY)
+                        is called.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            
+            <xsd:element name="faces-context-factory"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                            
+                        The "faces-context-factory" element contains the
+                        fully qualified class name of the concrete
+                        FacesContextFactory implementation class that will
+                        be called when 
+                        FactoryFinder.getFactory(FACES_CONTEXT_FACTORY) 
+                        is called.
+                            
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+
+            <xsd:element name="partial-view-context-factory"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "partial-view-context-factory" element contains the
+                        fully qualified class name of the concrete
+                        PartialViewContextFactory implementation class that will
+                        be called when FactoryFinder.getFactory
+                        (FactoryFinder.PARTIAL_VIEW_CONTEXT_FACTORY) is called.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+
+            <xsd:element name="lifecycle-factory"
+                        type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                            
+                        The "lifecycle-factory" element contains the fully
+                        qualified class name of the concrete LifecycleFactory
+                        implementation class that will be called when
+                        FactoryFinder.getFactory(LIFECYCLE_FACTORY) is called.
+                            
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="view-declaration-language-factory"
+                        type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                            
+                        The "view-declaration-language-factory" element contains 
+                        the fully qualified class name of the concrete 
+                        ViewDeclarationLanguageFactory
+                        implementation class that will be called when
+                        FactoryFinder.getFactory(VIEW_DECLARATION_FACTORY) is called.
+                            
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="tag-handler-delegate-factory"
+                        type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                            
+                        The "tag-handler-delegate-factory" element contains 
+                        the fully qualified class name of the concrete 
+                        ViewDeclarationLanguageFactory
+                        implementation class that will be called when
+                        FactoryFinder.getFactory(TAG_HANDLER_DELEGATE_FACTORY) is called.
+                            
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="render-kit-factory"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "render-kit-factory" element contains the fully
+                        qualified class name of the concrete RenderKitFactory
+                        implementation class that will be called when
+                        FactoryFinder.getFactory(RENDER_KIT_FACTORY) is 
+                        called.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="visit-context-factory"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "visit-context-factory" element contains the fully
+                        qualified class name of the concrete VisitContextFactory
+                        implementation class that will be called when
+                        FactoryFinder.getFactory(VISIT_CONTEXT_FACTORY) is 
+                        called.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="factory-extension"
+                         type="javaee:faces-config-factory-extensionType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+        </xsd:choice>
+        <xsd:attribute name = "id" type = "xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name = "faces-config-factory-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                Extension element for factory.  It may contain
+                implementation specific content.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded" />
+         </xsd:sequence>
+         <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-attributeType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "attribute" element represents a named, typed, value
+                associated with the parent UIComponent via the generic
+                attributes mechanism.
+
+                Attribute names must be unique within the scope of the parent
+                (or related) component.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element name="attribute-name"
+                         type="javaee:string">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        
+                        The "attribute-name" element represents the name under 
+                        which the corresponding value will be stored, in the 
+                        generic attributes of the UIComponent we are related 
+                        to.
+                        
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="attribute-class"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "attribute-class" element represents the Java type
+                        of the value associated with this attribute name.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="default-value"
+                         type="javaee:faces-config-default-valueType"
+                         minOccurs="0"/>
+            <xsd:element name="suggested-value"
+                         type="javaee:faces-config-suggested-valueType"
+                         minOccurs="0"/>
+            <xsd:element name="attribute-extension"
+                         type="javaee:faces-config-attribute-extensionType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name = "id" type = "xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name = "faces-config-attribute-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                Extension element for attribute.  It may contain 
+                implementation specific content.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded" />
+         </xsd:sequence>
+         <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-componentType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "component" element represents a concrete UIComponent
+                implementation class that should be registered under the
+                specified type identifier, along with its associated 
+                properties and attributes.  Component types must be unique 
+                within the entire web application.
+
+                Nested "attribute" elements identify generic attributes that 
+                are recognized by the implementation logic of this component.
+                Nested "property" elements identify JavaBeans properties of 
+                the component class that may be exposed for manipulation 
+                via tools.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element name="component-type"
+                         type="javaee:string">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        
+                        The "component-type" element represents the name under 
+                        which the corresponding UIComponent class should be 
+                        registered.
+                        
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="component-class"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        
+                        The "component-class" element represents the fully 
+                        qualified class name of a concrete UIComponent 
+                        implementation class.
+                        
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="facet"
+                         type="javaee:faces-config-facetType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+            <xsd:element name="attribute"
+                         type="javaee:faces-config-attributeType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+            <xsd:element name="property"
+                         type="javaee:faces-config-propertyType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+            <xsd:element name="component-extension"
+                         type="javaee:faces-config-component-extensionType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-component-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Extension element for component.  It may contain 
+                implementation specific content.
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded" />
+         </xsd:sequence>
+         <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-default-localeType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "default-locale" element declares the default locale 
+                for this application instance.
+
+                It must be specified as :language:[_:country:[_:variant:]]
+                without the colons, for example "ja_JP_SJIS".  The
+                separators between the segments may be '-' or '_'.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:simpleContent>
+            <xsd:extension base="javaee:faces-config-localeType">
+                <xsd:attribute name="id" type="xsd:ID"/>                
+            </xsd:extension>
+        </xsd:simpleContent>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+
+    <xsd:complexType name="faces-config-default-valueType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "default-value" contains the value for the property or
+                attribute in which this element resides.  This value differs
+                from the "suggested-value" in that the property or attribute
+                must take the value, whereas in "suggested-value" taking the
+                value is optional.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:simpleContent>
+            <xsd:restriction base="javaee:string"/>
+        </xsd:simpleContent>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:simpleType name="faces-config-el-expressionType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                EL expressions present within a faces config file
+                must start with the character sequence of '#{' and
+                end with '}'.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:string">
+            <xsd:pattern value="#\{.*\}"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-facetType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                Define the name and other design-time information for a facet
+                that is associated with a renderer or a component.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element name="facet-name"
+                         type="javaee:java-identifierType">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "facet-name" element represents the facet name 
+                        under which a UIComponent will be added to its parent.  
+                        It must be of type "Identifier".
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="facet-extension"
+                         type="javaee:faces-config-facet-extensionType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-facet-extensionType">
+         <xsd:annotation>
+            <xsd:documentation>
+
+                Extension element for facet.  It may contain implementation
+                specific content.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded" />
+         </xsd:sequence>
+         <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-from-view-idType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The value of from-view-id must contain one of the following 
+                values:
+
+                  - The exact match for a view identifier that is recognized
+                    by the the ViewHandler implementation being used (such as
+                    "/index.jsp" if you are using the default ViewHandler).
+
+                  - A proper prefix of a view identifier, plus a trailing 
+                    "*" character.  This pattern indicates that all view 
+                    identifiers that match the portion of the pattern up to 
+                    the asterisk will match the surrounding rule.  When more 
+                    than one match exists, the match with the longest pattern 
+                    is selected.
+
+                  - An "*" character, which means that this pattern applies 
+                    to all view identifiers.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:simpleContent>
+            <xsd:restriction base="javaee:string"/>
+        </xsd:simpleContent>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-from-actionType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "from-action" element contains an action reference 
+                expression that must have been executed (by the default 
+                ActionListener for handling application level events) 
+                in order to select the navigation rule.  If not specified, 
+                this rule will be relevant no matter which action reference 
+                was executed (or if no action reference was executed).
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:simpleContent>
+            <xsd:extension base="javaee:faces-config-el-expressionType">
+                <xsd:attribute name="id" type="xsd:ID"/>
+            </xsd:extension>
+        </xsd:simpleContent>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-ifType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "if" element defines a condition that must resolve
+                to true in order for the navigation case on which it is
+                defined to be matched, with the existing match criteria
+                (action method and outcome) as a prerequiste, if present.
+                The condition is defined declaratively using a value
+                expression in the body of this element. The expression is
+                evaluated at the time the navigation case is being matched.
+                If the "from-outcome" is omitted and this element is
+                present, the navigation handler will match a null outcome
+                and use the condition return value to determine if the
+                case should be considered a match.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:simpleContent>
+            <xsd:extension base="javaee:faces-config-el-expressionType">
+                <xsd:attribute name="id" type="xsd:ID"/>
+            </xsd:extension>
+        </xsd:simpleContent>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-converterType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "converter" element represents a concrete Converter
+                implementation class that should be registered under the
+                specified converter identifier.  Converter identifiers must 
+                be unique within the entire web application.
+
+                Nested "attribute" elements identify generic attributes that
+                may be configured on the corresponding UIComponent in order 
+                to affect the operation of the Converter.  Nested "property"
+                elements identify JavaBeans properties of the Converter
+                implementation class that may be configured to affect the
+                operation of the Converter.  "attribute" and "property" 
+                elements are intended to allow component developers to 
+                more completely describe their components to tools and users.
+                These elements have no required runtime semantics.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:choice>
+                <xsd:element name="converter-id"
+                             type="javaee:string">
+                    <xsd:annotation>
+                        <xsd:documentation>
+
+                            The "converter-id" element represents the 
+                            identifier under which the corresponding 
+                            Converter class should be registered.
+
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+                
+                <xsd:element name="converter-for-class"
+                             type="javaee:fully-qualified-classType">
+                    <xsd:annotation>
+                        <xsd:documentation>
+
+                            The "converter-for-class" element represents the 
+                            fully qualified class name for which a Converter 
+                            class will be registered.
+
+                        </xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+            </xsd:choice>
+            
+            <xsd:element name="converter-class"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "converter-class" element represents the fully
+                        qualified class name of a concrete Converter 
+                        implementation class.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="attribute"
+                         type="javaee:faces-config-attributeType"
+                         minOccurs="0"
+                         maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                       Nested "attribute" elements identify generic
+                       attributes that may be configured on the
+                       corresponding UIComponent in order to affect the
+                       operation of the Converter.  This attribute is
+                       primarily for design-time tools and is not
+                       specified to have any meaning at runtime.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="property"
+                         type="javaee:faces-config-propertyType"
+                         minOccurs="0"
+                         maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                       Nested "property" elements identify JavaBeans
+                       properties of the Converter implementation class
+                       that may be configured to affect the operation of
+                       the Converter.  This attribute is primarily for
+                       design-time tools and is not specified to have
+                       any meaning at runtime.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="converter-extension"
+                         type="javaee:faces-config-converter-extensionType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name = "faces-config-converter-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                Extension element for converter.  It may contain
+                implementation specific content.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded" />
+         </xsd:sequence>
+         <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-lifecycleType">
+        <xsd:annotation>
+            <xsd:documentation>
+                
+                The "lifecycle" element provides a mechanism to specify
+                modifications to the behaviour of the default Lifecycle
+                implementation for this web application.
+                
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:element name="phase-listener"
+                         type="javaee:fully-qualified-classType"
+                         minOccurs="0" 
+                         maxOccurs="unbounded">
+                
+                <xsd:annotation>
+                    <xsd:documentation>
+                    
+                        The "phase-listener" element contains the fully 
+                        qualified class name of the concrete PhaseListener 
+                        implementation class that will be registered on 
+                        the Lifecycle.
+                    
+                    </xsd:documentation>
+            </xsd:annotation>                
+            </xsd:element>
+            <xsd:element name="lifecycle-extension"
+                         type="javaee:faces-config-lifecycle-extensionType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name = "faces-config-lifecycle-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                Extension element for lifecycle.  It may contain
+                implementation specific content.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded" />
+         </xsd:sequence>
+         <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    
+    <!-- **************************************************** -->
+    
+    <xsd:simpleType name="faces-config-localeType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The localeType defines valid locale defined by ISO-639-1
+                and ISO-3166.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:restriction base="xsd:string">
+            <xsd:pattern value="([a-z]{2})[_|\-]?([\p{L}]{2})?[_|\-]?(\w+)?"/>
+        </xsd:restriction>
+  </xsd:simpleType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-locale-configType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "locale-config" element allows the app developer to 
+                declare the supported locales for this application.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        
+        <xsd:sequence>
+            <xsd:element name="default-locale"
+                         type="javaee:faces-config-default-localeType"
+                         minOccurs="0">
+            </xsd:element>
+            <xsd:element name="supported-locale"
+                         type="javaee:faces-config-supported-localeType"
+                         minOccurs="0" 
+                         maxOccurs="unbounded">                
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-default-validatorsType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "default-validators" element allows the app developer to 
+                register a set of validators, referenced by identifier, that
+                are automatically assigned to any EditableValueHolder component
+                in the application, unless overridden or disabled locally.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        
+        <xsd:sequence>
+            <xsd:element name="validator-id"
+                         type="javaee:string"
+                         minOccurs="0"
+                         maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        
+                        The "validator-id" element represents the identifier 
+                        of a registered validator.
+                        
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-managed-beanType">
+        <xsd:annotation>
+            <xsd:documentation>
+                
+                The "managed-bean" element represents a JavaBean, of a 
+                particular class, that will be dynamically instantiated 
+                at runtime (by the default VariableResolver implementation) 
+                if it is referenced as the first element of a value binding 
+                expression, and no corresponding bean can be identified in 
+                any scope.  In addition to the creation of the managed bean, 
+                and the optional storing of it into the specified scope, 
+                the nested managed-property elements can be used to 
+                initialize the contents of settable JavaBeans properties of 
+                the created instance.
+                
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element name="managed-bean-name"
+                         type="javaee:java-identifierType">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "managed-bean-name" element represents the 
+                        attribute name under which a managed bean will 
+                        be searched for, as well as stored (unless the 
+                        "managed-bean-scope" value is "none").
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="managed-bean-class"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "managed-bean-class" element represents the fully
+                        qualified class name of the Java class that will be 
+                        used`to instantiate a new instance if creation of the 
+                        specified`managed bean is requested.
+
+                        The specified class must conform to standard JavaBeans
+                        conventions.  In particular, it must have a public
+                        zero-arguments constructor, and zero or more public
+                        property setters.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element 
+                name="managed-bean-scope"
+                type="javaee:faces-config-managed-bean-scopeOrNoneType">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "managed-bean-scope" element represents the scope 
+                        into which a newly created instance of the specified 
+                        managed bean will be stored (unless the value is 
+                        "none").
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:choice>
+                <xsd:element name="managed-property"
+                             type="javaee:faces-config-managed-propertyType"
+                             minOccurs="0"
+                             maxOccurs="unbounded"/>
+                <xsd:element name="map-entries"
+                             type="javaee:faces-config-map-entriesType"/>
+                <xsd:element name="list-entries"
+                             type="javaee:faces-config-list-entriesType"/>
+            </xsd:choice>
+            <xsd:element name="managed-bean-extension"
+                         type="javaee:faces-config-managed-bean-extensionType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="eager"
+                       type="xsd:boolean"
+                       use="optional">
+            <xsd:annotation>
+                <xsd:documentation>
+
+                    This attribute is only considered when associated with
+                    an application-scoped managed bean. If the value of the eager
+                    attribute is true the runtime must instantiate this class
+                    and store the instance within the application scope when the
+                    application starts.
+
+                    If eager is unspecified or is false, the default "lazy"
+                    instantiation and scoped storage of the managed bean
+                    will occur.
+
+                </xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name = "faces-config-managed-bean-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                Extension element for managed-bean.  It may contain
+                implementation specific content.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded" />
+         </xsd:sequence>
+         <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+
+    <!-- **************************************************** -->
+    
+    <xsd:complexType name="faces-config-managed-bean-scopeOrNoneType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                <![CDATA[
+                Defines the legal values for the <managed-bean-scope>
+                element's body content, which includes all of the scopes
+                normally used in a web application, plus the "none" value
+                indicating that a created bean should not be stored into
+                any scope.  Alternatively, an EL expression may be used
+                as the value of this element.  The result of evaluating this
+                expression must by of type java.util.Map.
+                ]]>
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:simpleContent>
+            <xsd:restriction base="javaee:string">
+            <xsd:pattern value="view|request|session|application|none|#\{.*\}"/>
+            </xsd:restriction>
+        </xsd:simpleContent>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-managed-propertyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                
+                The "managed-property" element represents an individual 
+                property of a managed bean that will be configured to the 
+                specified value (or value set) if the corresponding 
+                managed bean is automatically created.
+                
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element name="property-name"
+                         type="javaee:string">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        
+                        The "property-name" element represents the JavaBeans 
+                        property name under which the corresponding value may 
+                        be stored.
+                        
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="property-class"
+                         type="javaee:java-typeType"
+                         minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                    
+                        The "property-class" element represents the Java type 
+                        of the value associated with this property name.  
+                        If not specified, it can be inferred from existing 
+                        classes; however, this element should be specified 
+                        if the configuration file is going to be the source 
+                        for generating the corresponding classes.
+                        
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:choice>
+                <xsd:element name="map-entries"
+                             type="javaee:faces-config-map-entriesType"/>
+                <xsd:element name="null-value"
+                             type="javaee:faces-config-null-valueType">
+                </xsd:element>
+                <xsd:element name="value"
+                             type="javaee:faces-config-valueType"/>
+                <xsd:element name="list-entries"
+                             type="javaee:faces-config-list-entriesType"/>
+            </xsd:choice>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-map-entryType">
+        <xsd:annotation>
+            <xsd:documentation>
+                
+                The "map-entry" element reprsents a single key-entry pair 
+                that will be added to the computed value of a managed 
+                property of type java.util.Map.
+                
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="key"
+                         type="javaee:string">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "key" element is the String representation of a 
+                        map key that will be stored in a managed property of 
+                        type java.util.Map.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:choice>
+                <xsd:element name="null-value"
+                             type="javaee:faces-config-null-valueType"/>
+                <xsd:element name="value"
+                             type="javaee:faces-config-valueType"/>
+            </xsd:choice>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-map-entriesType">
+        <xsd:annotation>
+            <xsd:documentation>
+                
+                The "map-entries' element represents a set of key-entry pairs 
+                that will be added to the computed value of a managed property 
+                of type java.util.Map.  In addition, the Java class types 
+                of the key and entry values may be optionally declared.
+                
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:element name="key-class"
+                         type="javaee:fully-qualified-classType"
+                         minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        
+                        The "key-class" element defines the Java type to which 
+                        each "key" element in a set of "map-entry" elements 
+                        will be converted to.  If omitted, "java.lang.String" 
+                        is assumed.
+                        
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="value-class"
+                         type="javaee:faces-config-value-classType"
+                         minOccurs="0"/>                
+            <xsd:element name="map-entry"
+                         type="javaee:faces-config-map-entryType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-navigation-caseType">
+        <xsd:annotation>
+            <xsd:documentation>
+                
+                The "navigation-case" element describes a particular 
+                combination of conditions that must match for this case to 
+                be executed, and the view id of the component tree that 
+                should be selected next.
+                
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element name="from-action"
+                         type="javaee:faces-config-from-actionType"
+                         minOccurs="0">
+            </xsd:element>
+            <xsd:element name="from-outcome"
+                         type="javaee:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "from-outcome" element contains a logical outcome
+                        string returned by the execution of an application
+                        action method selected via an "actionRef" property
+                        (or a literal value specified by an "action" property)
+                        of a UICommand component.  If specified, this rule 
+                        will be relevant only if the outcome value matches 
+                        this element's value.  If not specified, this rule 
+                        will be relevant if the outcome value is non-null
+                        or, if the "if" element is present, will be relevant
+                        for any outcome value, with the assumption that the
+                        condition specified in the "if" element ultimately
+                        determines if this rule is a match.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="if"
+                         type="javaee:faces-config-ifType"
+                         minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                       Please see section JSF.7.4.2 for the specification of this element.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="to-view-id"
+                         type="javaee:faces-config-valueType">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "to-view-id" element contains the view identifier 
+                        of the next view that should be displayed if this
+                        navigation rule is matched. If the contents is a
+                        value expression, it should be resolved by the
+                        navigation handler to obtain the view identifier.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element 
+                name="redirect"
+                type="javaee:faces-config-redirectType" minOccurs="0"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-navigation-ruleType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "navigation-rule" element represents an individual 
+                decision rule that will be utilized by the default 
+                NavigationHandler implementation to make decisions on 
+                what view should be displayed next, based on the 
+                view id being processed.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element name="from-view-id"
+                         type="javaee:faces-config-from-view-idType"
+                         minOccurs="0"/>
+            <xsd:element name="navigation-case"
+                         type="javaee:faces-config-navigation-caseType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+            <xsd:element 
+                name="navigation-rule-extension"
+                type="javaee:faces-config-navigation-rule-extensionType"
+                minOccurs="0"
+                maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name = "faces-config-navigation-rule-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                Extension element for navigation-rule.  It may contain
+                implementation specific content.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded" />
+         </xsd:sequence>
+         <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-null-valueType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "null-value" element indicates that the managed
+                property in which we are nested will be explicitly
+                set to null if our managed bean is automatically
+                created.  This is different from omitting the managed
+                property element entirely, which will cause no
+                property setter to be called for this property.
+
+                The "null-value" element can only be used when the
+                associated "property-class" identifies a Java class,
+                not a Java primitive.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+    
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-propertyType">
+        <xsd:annotation>
+            <xsd:documentation>
+                
+                The "property" element represents a JavaBean property of the 
+                Java class represented by our parent element.
+
+                Property names must be unique within the scope of the Java 
+                class that is represented by the parent element, and must 
+                correspond to property names that will be recognized when 
+                performing introspection against that class via 
+                java.beans.Introspector.
+                
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element name="property-name"
+                         type="javaee:string">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        
+                        The "property-name" element represents the JavaBeans 
+                        property name under which the corresponding value 
+                        may be stored.
+                        
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="property-class"
+                         type="javaee:java-typeType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        
+                        The "property-class" element represents the Java type 
+                        of the value associated with this property name.  
+                        If not specified, it can be inferred from existing 
+                        classes; however, this element should be specified if 
+                        the configuration file is going to be the source for 
+                        generating the corresponding classes.
+                        
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="default-value"
+                         type="javaee:faces-config-default-valueType"
+                         minOccurs="0"/>               
+            <xsd:element name="suggested-value"
+                         type="javaee:faces-config-suggested-valueType"
+                         minOccurs="0"/>
+            <xsd:element name="property-extension"
+                         type="javaee:faces-config-property-extensionType"
+                         minOccurs="0" 
+                         maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-property-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                Extension element for property.  It may contain 
+                implementation specific content.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded" />
+         </xsd:sequence>
+         <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-redirectType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                    The "redirect" element indicates that navigation to the
+                    specified "to-view-id" should be accomplished by 
+                    performing an HTTP redirect rather than the usual 
+                    ViewHandler mechanisms.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="view-param"
+                         type="javaee:faces-config-redirect-viewParamType"
+                         minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+        <xsd:attribute name="include-view-params" type="xsd:boolean" use="optional"/>
+
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-redirect-viewParamType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                    The "view-param" element, only valid within
+                    a "redirect" element, contains child "name"
+                    and "value" elements that must be included in the
+                    redirect url when the redirect is performed.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="name"
+                         type="javaee:string"
+                         minOccurs="1" maxOccurs="1"/>
+            <xsd:element name="value"
+                         type="javaee:string"
+                         minOccurs="1" maxOccurs="1"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-referenced-beanType">
+        <xsd:annotation>
+            <xsd:documentation>
+                
+                The "referenced-bean" element represents at design time the 
+                promise that a Java object of the specified type will exist at 
+                runtime in some scope, under the specified key.  This can be 
+                used by design time tools to construct user interface dialogs 
+                based on the properties of the specified class.  The presence 
+                or absence of a referenced bean element has no impact on the 
+                JavaServer Faces runtime environment inside a web application.
+                
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element name="referenced-bean-name"
+                         type="javaee:java-identifierType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        
+                        The "referenced-bean-name" element represents the 
+                        attribute name under which the corresponding 
+                        referenced bean may be assumed to be stored, in one 
+                        of 'request', 'session', 'view', 'application' 
+                        or a custom scope.
+                        
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="referenced-bean-class"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "referenced-bean-class" element represents the 
+                        fully qualified class name of the Java class 
+                        (either abstract or concrete) or Java interface 
+                        implemented by the corresponding referenced bean. 
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-render-kitType">
+        <xsd:annotation>
+            <xsd:documentation>
+                
+                The "render-kit" element represents a concrete RenderKit 
+                implementation that should be registered under the specified 
+                render-kit-id.  If no render-kit-id is specified, the 
+                identifier of the default RenderKit 
+                (RenderKitFactory.DEFAULT_RENDER_KIT) is assumed.
+                
+            </xsd:documentation>
+        </xsd:annotation>
+        
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element name="render-kit-id"
+                         type="javaee:string"
+                         minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        
+                        The "render-kit-id" element represents an identifier 
+                        for the RenderKit represented by the parent 
+                        "render-kit" element.
+                        
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="render-kit-class"
+                         type="javaee:fully-qualified-classType"
+                         minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        
+                        The "render-kit-class" element represents the fully 
+                        qualified class name of a concrete RenderKit 
+                        implementation class.
+                        
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="renderer"
+                         type="javaee:faces-config-rendererType"
+                         minOccurs="0" 
+                         maxOccurs="unbounded"/>
+            <xsd:element name="client-behavior-renderer"
+                         type="javaee:faces-config-client-behavior-rendererType"
+                         minOccurs="0" 
+                         maxOccurs="unbounded"/>
+            <xsd:element name="render-kit-extension"
+                         type="javaee:faces-config-render-kit-extensionType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-client-behavior-rendererType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "client-behavior-renderer" element represents a concrete 
+                ClientBehaviorRenderer implementation class that should be 
+                registered under the specified behavior renderer type identifier,
+                in the RenderKit associated with the parent "render-kit"
+                element.  Client Behavior renderer type must be unique within the RenderKit
+                associated with the parent "render-kit" element.
+
+                Nested "attribute" elements identify generic component
+                attributes that are recognized by this renderer.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:element name="client-behavior-renderer-type"
+                         type="javaee:string">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "client-behavior-renderer-type" element represents a renderer type
+                        identifier for the Client Behavior Renderer represented by the parent
+                        "client-behavior-renderer" element.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="client-behavior-renderer-class"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "client-behavior-renderer-class" element represents the fully
+                        qualified class name of a concrete Client Behavior Renderer
+                        implementation class.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:complexType name="faces-config-rendererType">
+        <xsd:annotation>
+            <xsd:documentation>
+                
+                The "renderer" element represents a concrete Renderer 
+                implementation class that should be registered under the 
+                specified component family and renderer type identifiers, 
+                in the RenderKit associated with the parent "render-kit" 
+                element.  Combinations of component family and 
+                renderer type must be unique within the RenderKit 
+                associated with the parent "render-kit" element.
+
+                Nested "attribute" elements identify generic component 
+                attributes that are recognized by this renderer.
+                
+            </xsd:documentation>
+        </xsd:annotation>
+        
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element name="component-family"
+                         type="javaee:string">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        
+                        The "component-family" element represents the 
+                        component family for which the Renderer represented 
+                        by the parent "renderer" element will be used.
+                        
+                    </xsd:documentation>
+                </xsd:annotation>                    
+            </xsd:element>
+            <xsd:element name="renderer-type"
+                         type="javaee:string">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        
+                        The "renderer-type" element represents a renderer type 
+                        identifier for the Renderer represented by the parent 
+                        "renderer" element.
+                        
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="renderer-class"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "renderer-class" element represents the fully
+                        qualified class name of a concrete Renderer
+                        implementation class.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="facet"
+                         type="javaee:faces-config-facetType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+            <xsd:element name="attribute"
+                         type="javaee:faces-config-attributeType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+            <xsd:element name="renderer-extension"
+                         type="javaee:faces-config-renderer-extensionType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-renderer-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                Extension element for renderer.  It may contain implementation
+                specific content.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded" />
+         </xsd:sequence>
+         <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-render-kit-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                Extension element for render-kit.  It may contain
+                implementation specific content.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded" />
+         </xsd:sequence>
+         <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-suggested-valueType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "suggested-value" contains the value for the property or
+                attribute in which this element resides.  This value is 
+                advisory only and is intended for tools to use when 
+                populating pallettes.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:simpleContent>
+            <xsd:restriction base="javaee:string"/>
+        </xsd:simpleContent>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-supported-localeType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "supported-locale" element allows authors to declare
+                which locales are supported in this application instance.
+
+                It must be specified as :language:[_:country:[_:variant:]]
+                without the colons, for example "ja_JP_SJIS".  The
+                separators between the segments may be '-' or '_'.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:simpleContent>
+            <xsd:extension base="javaee:faces-config-localeType">
+                <xsd:attribute name="id" type="xsd:ID"/> 
+            </xsd:extension>
+        </xsd:simpleContent>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-behaviorType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "behavior" element represents a concrete Behavior 
+                implementation class that should be registered under the
+                specified behavior identifier.  Behavior identifiers must
+                be unique within the entire web application.
+
+                Nested "attribute" elements identify generic attributes that
+                may be configured on the corresponding UIComponent in order
+                to affect the operation of the Behavior.  Nested "property"
+                elements identify JavaBeans properties of the Behavior 
+                implementation class that may be configured to affect the
+                operation of the Behavior.  "attribute" and "property"
+                elements are intended to allow component developers to
+                more completely describe their components to tools and users.
+                These elements have no required runtime semantics.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element name="behavior-id"
+                         type="javaee:string">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "behavior-id" element represents the identifier
+                        under which the corresponding Behavior class should
+                        be registered.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="behavior-class"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "behavior-class" element represents the fully
+                        qualified class name of a concrete Behavior 
+                        implementation class.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="attribute"
+                         type="javaee:faces-config-attributeType"
+                         minOccurs="0"
+                         maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                       Nested "attribute" elements identify generic
+                       attributes that may be configured on the
+                       corresponding UIComponent in order to affect the
+                       operation of the Behavior.  This attribute is
+                       primarily for design-time tools and is not
+                       specified to have any meaning at runtime.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+
+            </xsd:element>
+            <xsd:element name="property"
+                         type="javaee:faces-config-propertyType"
+                         minOccurs="0"
+                         maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                       Nested "property" elements identify JavaBeans
+                       properties of the Behavior implementation class
+                       that may be configured to affect the operation of
+                       the Behavior.  This attribute is primarily for
+                       design-time tools and is not specified to have
+                       any meaning at runtime.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="behavior-extension"
+                         type="javaee:faces-config-behavior-extensionType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name = "faces-config-behavior-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                Extension element for behavior.  It may contain
+                implementation specific content.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded" />
+         </xsd:sequence>
+         <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-validatorType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "validator" element represents a concrete Validator
+                implementation class that should be registered under the
+                specified validator identifier.  Validator identifiers must 
+                be unique within the entire web application.
+
+                Nested "attribute" elements identify generic attributes that 
+                may be configured on the corresponding UIComponent in order 
+                to affect the operation of the Validator.  Nested "property"
+                elements identify JavaBeans properties of the Validator
+                implementation class that may be configured to affect the
+                operation of the Validator.  "attribute" and "property" 
+                elements are intended to allow component developers to 
+                more completely describe their components to tools and users.
+                These elements have no required runtime semantics.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="javaee:descriptionGroup"/>
+            <xsd:element name="validator-id"
+                         type="javaee:string">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        
+                        The "validator-id" element represents the identifier 
+                        under which the corresponding Validator class should 
+                        be registered.
+                        
+                    </xsd:documentation>
+                </xsd:annotation>                
+            </xsd:element>
+            <xsd:element name="validator-class"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        
+                        The "validator-class" element represents the fully 
+                        qualified class name of a concrete Validator 
+                        implementation class.  
+                        
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="attribute"
+                         type="javaee:faces-config-attributeType"
+                         minOccurs="0" 
+                         maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+                        
+                       Nested "attribute" elements identify generic
+                       attributes that may be configured on the
+                       corresponding UIComponent in order to affect the
+                       operation of the Validator.  This attribute is
+                       primarily for design-time tools and is not
+                       specified to have any meaning at runtime.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+
+            </xsd:element>
+            <xsd:element name="property"
+                         type="javaee:faces-config-propertyType"
+                         minOccurs="0" 
+                         maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                       Nested "property" elements identify JavaBeans
+                       properties of the Validator implementation class
+                       that may be configured to affect the operation of
+                       the Validator.  This attribute is primarily for
+                       design-time tools and is not specified to have
+                       any meaning at runtime.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="validator-extension"
+                         type="javaee:faces-config-validator-extensionType"
+                         minOccurs="0"
+                         maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name = "faces-config-validator-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                Extension element for validator.  It may contain
+                implementation specific content.
+
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded" />
+         </xsd:sequence>
+         <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:simpleType name="faces-config-valueType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "value" element is the String representation of
+                a literal value to which a scalar managed property
+                will be set, or a value binding expression ("#{...}")
+                that will be used to calculate the required value.
+                It will be converted as specified for the actual
+                property type.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:union 
+            memberTypes="javaee:faces-config-el-expressionType xsd:string"/>
+    </xsd:simpleType>
+    
+    <!-- **************************************************** -->
+    
+    <xsd:complexType name="faces-config-value-classType">
+        <xsd:annotation>
+            <xsd:documentation>
+                
+                The "value-class" element defines the Java type to which each
+                "value" element's value will be converted to, prior to adding 
+                it to the "list-entries" list for a managed property that is 
+                a java.util.List, or a "map-entries" map for a managed 
+                property that is a java.util.Map.  
+                
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:simpleContent>
+            <xsd:restriction base="javaee:fully-qualified-classType"/>
+        </xsd:simpleContent>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-list-entriesType">
+        <xsd:annotation>
+            <xsd:documentation>
+                
+                The "list-entries" element represents a set of initialization
+                elements for a managed property that is a java.util.List or an
+                array.  In the former case, the "value-class" element can 
+                optionally be used to declare the Java type to which each 
+                value should be converted before adding it to the Collection.
+                
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="value-class"
+                         type="javaee:faces-config-value-classType"
+                         minOccurs="0"/>
+            <xsd:choice minOccurs="0" maxOccurs="unbounded">
+                <xsd:element name="null-value"
+                             type="javaee:faces-config-null-valueType"/>
+                <xsd:element name="value"
+                             type="javaee:faces-config-valueType"/>
+            </xsd:choice>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="faces-config-system-event-listenerType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The presence of this element within the "application" element in
+                an application configuration resource file indicates the
+                developer wants to add an SystemEventListener to this
+                application instance.  Elements nested within this element allow
+                selecting the kinds of events that will be delivered to the
+                listener instance, and allow selecting the kinds of classes that
+                can be the source of events that are delivered to the listener
+                instance.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="system-event-listener-class"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "system-event-listener-class" element contains
+                        the fully qualified class name of the concrete
+                        SystemEventListener implementation class that will be
+                        called when events of the type specified by the
+                        "system-event-class" are sent by the runtime.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="system-event-class" 
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "system-event-class" element contains the fully
+                        qualified class name of the SystemEvent subclass for
+                        which events will be delivered to the class whose fully
+                        qualified class name is given by the
+                        "system-event-listener-class" element.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="source-class" minOccurs="0"
+                         type="javaee:fully-qualified-classType">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "source-class" element, if present, contains the
+                        fully qualified class name of the class that will be the
+                        source for the event to be delivered to the class whose
+                        fully qualified class name is given by the
+                        "system-event-listener-class" element.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+    <xsd:simpleType name="faces-config-versionType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                This type contains the recognized versions of
+                faces-config supported.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:token">
+            <xsd:enumeration value="2.0"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+
+    <!-- **************************************************** -->
+
+</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesuicomponent_2_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesuicomponent_2_0.xsd
new file mode 100644
index 0000000..2800606
--- /dev/null
+++ b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-facesuicomponent_2_0.xsd
@@ -0,0 +1,223 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+
+
+
+<xsd:schema
+     targetNamespace="http://java.sun.com/xml/ns/javaee"
+     xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+     xmlns:xml="http://www.w3.org/XML/1998/namespace"
+     elementFormDefault="qualified"
+     attributeFormDefault="unqualified"
+     version="2.0">
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+      
+      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
+      
+      The contents of this file are subject to the terms of either the
+      GNU General Public License Version 2 only ("GPL") or the Common
+      Development and Distribution License("CDDL") (collectively, the
+      "License").  You may not use this file except in compliance with
+      the License. You can obtain a copy of the License at
+      https://glassfish.dev.java.net/public/CDDL+GPL.html or
+      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
+      specific language governing permissions and limitations under the
+      License.
+      
+      When distributing the software, include this License Header
+      Notice in each file and include the License file at
+      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
+      particular file as subject to the "Classpath" exception as
+      provided by Sun in the GPL Version 2 section of the License file
+      that accompanied this code.  If applicable, add the following
+      below the License Header, with the fields enclosed by brackets []
+      replaced by your own identifying information:
+      "Portions Copyrighted [year] [name of copyright owner]"
+      
+      Contributor(s):
+      
+      If you wish your version of this file to be governed by only the
+      CDDL or only the GPL Version 2, indicate your decision by adding
+      "[Contributor] elects to include this software in this
+      distribution under the [CDDL or GPL Version 2] license."  If you
+      don't indicate a single choice of license, a recipient has the
+      option to distribute your version of this file under either the
+      CDDL, the GPL Version 2 or to extend the choice of license to its
+      licensees as provided above.  However, if you add GPL Version 2
+      code and therefore, elected the GPL Version 2 license, then the
+      option applies only if the new code is made subject to such
+      option by the copyright holder.
+      
+      The Eclipse Foundation elects to include this software in this
+      distribution under the CDDL license.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+    <xsd:annotation>
+        <xsd:documentation>
+
+            <![CDATA[
+
+            The XML Schema for a JavaServer Faces UIComponent (Version 2.0).
+
+            The elements in this schema may be used in an XHTML page for
+            a composite component, by pulling in the composite namespace:
+            
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:composite="http://java.sun.com/jsf/composite">
+      
+      <composite:interface>
+         <composite:attribute name="foo" default="bar" />
+      </composite:/interface>
+      <!-- the rest omitted -->
+</html>
+
+            The elements in this schema may also be used in a facelet taglibrary
+            file in the same manner:
+            
+<facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
+              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+              xmlns:composite="http://java.sun.com/jsf/composite"
+              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibary_2_0.xsd"
+              version="2.0">
+  <namespace>http://domain.com/test_schema</namespace>
+  <tag>
+    <tag-name>testSchema</tag-name>
+    <component>
+      <component-type>javax.faces.Input</component-type>
+      <renderer-type>javax.faces.Text</renderer-type>
+      <handler-class>com.sun.faces.facelets.tag.jsf.ComponentHandler</handler-class>
+      <component-extension>
+
+        <composite:attribute name="foo" default="bar" />
+
+      </component-extension>
+    </component>
+  </tag>
+</facelet-taglib>
+            
+            The instance documents may indicate the published
+            version of the schema using xsi:schemaLocation attribute
+            for javaee namespace with the following location:
+
+            http://java.sun.com/xml/ns/javaee/web-facesuicomponent_2_0.xsd
+
+            ]]>
+
+        </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:include schemaLocation="javaee_5.xsd"/>
+
+    <!-- **************************************************** -->
+
+    <xsd:element name = "attribute" type="javaee:uicomponent-attributeType">
+    </xsd:element>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="uicomponent-attributeType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "attribute" element declares an attribute of this 
+                ui component.
+
+            </xsd:documentation>
+        </xsd:annotation>
+        
+        <xsd:choice minOccurs="0" maxOccurs="unbounded">
+            <xsd:element name="attribute"
+                         type="javaee:uicomponent-attributeType"/>
+        </xsd:choice>
+
+        <xsd:attribute name="name"
+                       type="xsd:string"
+                       use="required"/>
+
+        <xsd:attribute name="displayName"
+                       type="xsd:string"
+                       use="optional"/>
+
+        <xsd:attribute name="shortDescription"
+                       type="xsd:string"
+                       use="optional"/>
+
+        <xsd:attribute name="default"
+                       type="xsd:string"
+                       use="optional"/>
+
+        <xsd:attribute name="method-signature"
+                       type="xsd:string"
+                       use="optional">
+
+	  <xsd:annotation>
+	      <xsd:documentation>
+                <![CDATA[
+
+	    Provides the signature of the Java method.  The syntax of
+	    the method-signature element is as follows (taken from
+	    function-signature in web-jsptaglibrary_2_1.xsd):
+
+		MethodSignature ::= ReturnType S MethodName S?
+				      '(' S? Parameters? S? ')'
+
+                ReturnType        ::= Type
+
+		MethodName        ::= Identifier
+
+		Parameters        ::=   Parameter
+				      | ( Parameter S? ',' S? Parameters )
+
+                Parameter         ::= Type
+
+		Where:
+
+ 		    * Type is a basic type or a fully qualified
+		      Java class name (including package name),
+		      as per the 'Type' production in the Java
+		      Language Specification, Second Edition,
+		      Chapter 18.
+
+                    * Identifier is a Java identifier, as per
+		      the 'Identifier' production in the Java
+		      Language Specification, Second
+		      Edition, Chapter 18.
+
+	    Example:
+
+	    java.lang.String nickName( java.lang.String, int )
+
+                ]]>
+	      </xsd:documentation>
+	  </xsd:annotation>
+
+        </xsd:attribute>
+
+        <xsd:attribute name="applyTo"
+                       type="xsd:string"
+                       use="optional"/>
+
+        <xsd:attribute name="required"
+                       type="xsd:boolean"
+                       use="optional"/>
+
+        <xsd:attribute name="preferred"
+                       type="xsd:boolean"
+                       use="optional"/>
+
+        <xsd:attribute name="expert"
+                       type="xsd:boolean"
+                       use="optional"/>
+
+        
+    </xsd:complexType>
+
+    <!-- **************************************************** -->
+
+</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-fragment_3_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-fragment_3_0.xsd
new file mode 100644
index 0000000..fdd422d
--- /dev/null
+++ b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-fragment_3_0.xsd
@@ -0,0 +1,272 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://java.sun.com/xml/ns/javaee"
+            xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified"
+            version="3.0">
+  <xsd:annotation>
+    <xsd:documentation>
+
+      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+      
+      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
+      
+      The contents of this file are subject to the terms of either the
+      GNU General Public License Version 2 only ("GPL") or the Common
+      Development and Distribution License("CDDL") (collectively, the
+      "License").  You may not use this file except in compliance with
+      the License. You can obtain a copy of the License at
+      https://glassfish.dev.java.net/public/CDDL+GPL.html or
+      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
+      specific language governing permissions and limitations under the
+      License.
+      
+      When distributing the software, include this License Header
+      Notice in each file and include the License file at
+      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
+      particular file as subject to the "Classpath" exception as
+      provided by Sun in the GPL Version 2 section of the License file
+      that accompanied this code.  If applicable, add the following
+      below the License Header, with the fields enclosed by brackets []
+      replaced by your own identifying information:
+      "Portions Copyrighted [year] [name of copyright owner]"
+      
+      Contributor(s):
+      
+      If you wish your version of this file to be governed by only the
+      CDDL or only the GPL Version 2, indicate your decision by adding
+      "[Contributor] elects to include this software in this
+      distribution under the [CDDL or GPL Version 2] license."  If you
+      don't indicate a single choice of license, a recipient has the
+      option to distribute your version of this file under either the
+      CDDL, the GPL Version 2 or to extend the choice of license to its
+      licensees as provided above.  However, if you add GPL Version 2
+      code and therefore, elected the GPL Version 2 license, then the
+      option applies only if the new code is made subject to such
+      option by the copyright holder.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+      <![CDATA[[
+      This is the XML Schema for the Servlet 3.0 deployment descriptor.
+      The deployment descriptor must be named "META-INF/web-fragment.xml"
+      in the web fragment's jar file.  All Servlet deployment descriptors
+      must indicate the web application schema by using the Java EE
+      namespace:
+      
+      http://java.sun.com/xml/ns/javaee 
+      
+      and by indicating the version of the schema by 
+      using the version element as shown below: 
+      
+      <web-fragment xmlns="http://java.sun.com/xml/ns/javaee"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="..."
+      version="3.0"> 
+      ...
+      </web-fragment>
+      
+      The instance documents may indicate the published version of
+      the schema using the xsi:schemaLocation attribute for Java EE
+      namespace with the following location:
+      
+      http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd
+      
+      ]]>
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      The following conventions apply to all Java EE
+      deployment descriptor elements unless indicated otherwise.
+      
+      - In elements that specify a pathname to a file within the
+      same JAR file, relative filenames (i.e., those not
+      starting with "/") are considered relative to the root of
+      the JAR file's namespace.  Absolute filenames (i.e., those
+      starting with "/") also specify names in the root of the
+      JAR file's namespace.  In general, relative names are
+      preferred.  The exception is .war files where absolute
+      names are preferred for consistency with the Servlet API.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:include schemaLocation="web-common_3_0.xsd"/>
+
+
+<!-- **************************************************** -->
+
+  <xsd:element name="web-fragment"
+               type="javaee:web-fragmentType">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        The web-fragment element is the root of the deployment
+        descriptor for a web fragment.  Note that the sub-elements
+        of this element can be in the arbitrary order. Because of
+        that, the multiplicity of the elements of distributable,
+        session-config, welcome-file-list, jsp-config, login-config,
+        and locale-encoding-mapping-list was changed from "?" to "*"
+        in this schema.  However, the deployment descriptor instance
+        file must not contain multiple elements of session-config,
+        jsp-config, and login-config. When there are multiple elements of
+        welcome-file-list or locale-encoding-mapping-list, the container
+        must concatenate the element contents.  The multiple occurence
+        of the element distributable is redundant and the container
+        treats that case exactly in the same way when there is only
+        one distributable. 
+        
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:unique name="web-common-servlet-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The servlet element contains the name of a servlet.
+          The name must be unique within the web application.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:servlet"/>
+      <xsd:field xpath="javaee:servlet-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-filter-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The filter element contains the name of a filter.
+          The name must be unique within the web application.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:filter"/>
+      <xsd:field xpath="javaee:filter-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-ejb-local-ref-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The ejb-local-ref-name element contains the name of an EJB
+          reference. The EJB reference is an entry in the web
+          application's environment and is relative to the
+          java:comp/env context.  The name must be unique within
+          the web application.
+          
+          It is recommended that name is prefixed with "ejb/".
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:ejb-local-ref"/>
+      <xsd:field xpath="javaee:ejb-ref-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-ejb-ref-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The ejb-ref-name element contains the name of an EJB
+          reference. The EJB reference is an entry in the web
+          application's environment and is relative to the
+          java:comp/env context.  The name must be unique within
+          the web application.
+          
+          It is recommended that name is prefixed with "ejb/".
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:ejb-ref"/>
+      <xsd:field xpath="javaee:ejb-ref-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-resource-env-ref-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The resource-env-ref-name element specifies the name of
+          a resource environment reference; its value is the
+          environment entry name used in the web application code.
+          The name is a JNDI name relative to the java:comp/env
+          context and must be unique within a web application.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:resource-env-ref"/>
+      <xsd:field xpath="javaee:resource-env-ref-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-message-destination-ref-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The message-destination-ref-name element specifies the name of
+          a message destination reference; its value is the
+          environment entry name used in the web application code.
+          The name is a JNDI name relative to the java:comp/env
+          context and must be unique within a web application.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:message-destination-ref"/>
+      <xsd:field xpath="javaee:message-destination-ref-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-res-ref-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The res-ref-name element specifies the name of a
+          resource manager connection factory reference.  The name
+          is a JNDI name relative to the java:comp/env context.
+          The name must be unique within a web application.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:resource-ref"/>
+      <xsd:field xpath="javaee:res-ref-name"/>
+    </xsd:unique>
+    <xsd:unique name="web-common-env-entry-name-uniqueness">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The env-entry-name element contains the name of a web
+          application's environment entry.  The name is a JNDI
+          name relative to the java:comp/env context.  The name
+          must be unique within a web application.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:env-entry"/>
+      <xsd:field xpath="javaee:env-entry-name"/>
+    </xsd:unique>
+    <xsd:key name="web-common-role-name-key">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          A role-name-key is specified to allow the references
+          from the security-role-refs.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:security-role"/>
+      <xsd:field xpath="javaee:role-name"/>
+    </xsd:key>
+    <xsd:keyref name="web-common-role-name-references"
+                refer="javaee:web-common-role-name-key">
+      <xsd:annotation>
+        <xsd:documentation>
+
+          The keyref indicates the references from
+          security-role-ref to a specified role-name.
+          
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:selector xpath="javaee:servlet/javaee:security-role-ref"/>
+      <xsd:field xpath="javaee:role-link"/>
+    </xsd:keyref>
+  </xsd:element>
+
+</xsd:schema>
diff --git a/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-partialresponse_2_0.xsd b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-partialresponse_2_0.xsd
new file mode 100644
index 0000000..09249bd
--- /dev/null
+++ b/bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/web-partialresponse_2_0.xsd
@@ -0,0 +1,263 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+
+
+<xsd:schema
+     targetNamespace="http://java.sun.com/xml/ns/javaee"
+     xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+     xmlns:xml="http://www.w3.org/XML/1998/namespace"
+     elementFormDefault="qualified"
+     attributeFormDefault="unqualified"
+     version="2.0">
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+      
+      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
+      
+      The contents of this file are subject to the terms of either the
+      GNU General Public License Version 2 only ("GPL") or the Common
+      Development and Distribution License("CDDL") (collectively, the
+      "License").  You may not use this file except in compliance with
+      the License. You can obtain a copy of the License at
+      https://glassfish.dev.java.net/public/CDDL+GPL.html or
+      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
+      specific language governing permissions and limitations under the
+      License.
+      
+      When distributing the software, include this License Header
+      Notice in each file and include the License file at
+      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
+      particular file as subject to the "Classpath" exception as
+      provided by Sun in the GPL Version 2 section of the License file
+      that accompanied this code.  If applicable, add the following
+      below the License Header, with the fields enclosed by brackets []
+      replaced by your own identifying information:
+      "Portions Copyrighted [year] [name of copyright owner]"
+      
+      Contributor(s):
+      
+      If you wish your version of this file to be governed by only the
+      CDDL or only the GPL Version 2, indicate your decision by adding
+      "[Contributor] elects to include this software in this
+      distribution under the [CDDL or GPL Version 2] license."  If you
+      don't indicate a single choice of license, a recipient has the
+      option to distribute your version of this file under either the
+      CDDL, the GPL Version 2 or to extend the choice of license to its
+      licensees as provided above.  However, if you add GPL Version 2
+      code and therefore, elected the GPL Version 2 license, then the
+      option applies only if the new code is made subject to such
+      option by the copyright holder.
+      
+      The Eclipse Foundation elects to include this software in this
+      distribution under the CDDL license.
+      
+    </xsd:documentation>
+  </xsd:annotation>
+
+    <xsd:annotation>
+        <xsd:documentation>
+
+            <![CDATA[
+
+            The XML Schema for the JavaServer Faces (Version 2.0)  
+            Partial Response used in JSF Ajax frameworks.
+
+            ]]>
+
+        </xsd:documentation>
+    </xsd:annotation>
+
+    <xsd:include schemaLocation="javaee_5.xsd"/>
+
+    <!-- **************************************************** -->
+
+    <xsd:element name = "partial-response" type="javaee:partial-responseType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "partial-response" element is the root of the partial 
+                response information hierarchy, and contains nested elements for all
+                possible elements that can exist in the response. 
+
+            </xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+
+    <!-- **************************************************** -->
+
+    <xsd:complexType name="partial-responseType">
+        <xsd:annotation>
+            <xsd:documentation>
+
+                The "partial-response" element is the root of thei partial 
+                response information hierarchy, and contains nested elements for all
+                possible elements that can exist in the response. 
+
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:choice>
+            <xsd:element name="changes" 
+                         type="javaee:partial-response-changesType" 
+                         minOccurs="0" 
+                         maxOccurs="1"/>
+            <xsd:element name="redirect" 
+                         type="javaee:partial-response-redirectType"
+                         minOccurs="0" 
+                         maxOccurs="1"/>
+            <xsd:element name="error" 
+                         type="javaee:partial-response-errorType"
+                         minOccurs="0" 
+                         maxOccurs="1"/>
+        </xsd:choice>
+    </xsd:complexType>
+
+    <xsd:complexType name="partial-response-changesType">
+        <xsd:choice minOccurs="0" maxOccurs="unbounded">
+            <xsd:element name="update"
+                         type="javaee:partial-response-updateType"/>
+            <xsd:element name="insert"
+                         type="javaee:partial-response-insertType"/>
+            <xsd:element name="delete"
+                         type="javaee:partial-response-deleteType"/>
+            <xsd:element name="attributes"
+                         type="javaee:partial-response-attributesType"/>
+            <xsd:element name="eval" type="xsd:string">
+                <xsd:annotation>
+                    <xsd:documentation>
+
+                        The "eval" element enables this element's contents to be executed as JavaScript.
+
+                    </xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="extension"
+                         type="javaee:partial-response-extensionType"/>
+        </xsd:choice>
+    </xsd:complexType>
+
+
+    <xsd:complexType name="partial-response-updateType">
+        <xsd:annotation> 
+            <xsd:documentation>
+               
+                The "update" element enables DOM elements matching the "id"
+                attribute to be updated with the contents of this element. 
+                    
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:simpleContent>
+            <xsd:extension base="xsd:string">
+                <xsd:attribute name="id" type="xsd:string" use="required"/>
+            </xsd:extension>
+        </xsd:simpleContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="partial-response-insertType">
+        <xsd:annotation> 
+            <xsd:documentation>
+                    
+                The "insert" element enables content to be inserted into the DOM
+                before or after an existing DOM element as specified by the
+                nested "before" or "after" elements.  The elements "before" and
+                "after" are mutually exclusive - one of them must be specified. 
+                    
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:choice minOccurs="1" maxOccurs="1">
+            <xsd:element name="before">
+                <xsd:complexType>
+                    <xsd:attribute name="id" type="xsd:string" use="required"/>
+                </xsd:complexType>
+            </xsd:element>
+            <xsd:element name="after">
+                <xsd:complexType>
+                    <xsd:attribute name="id" type="xsd:string" use="required"/>
+                </xsd:complexType>
+            </xsd:element>
+        </xsd:choice>
+    </xsd:complexType>
+
+    <xsd:complexType name="partial-response-deleteType">
+        <xsd:annotation> 
+            <xsd:documentation>
+                    
+                The "delete" element enables DOM elements matching the "id"
+                attribute to be removed. 
+                
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="id" type="xsd:string" use="required"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="partial-response-attributesType">
+        <xsd:annotation> 
+            <xsd:documentation>
+                    
+                The "attributes" element enables attributes of DOM elements matching the "id"
+                attribute to be updated.  If this element is used, then it must contain at
+                least one "attribute" element. 
+                    
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="attribute" minOccurs="1" maxOccurs="unbounded">
+                <xsd:complexType>
+                    <xsd:attribute name="name" type="xsd:string" use="required"/>
+                    <xsd:attribute name="value" type="xsd:string" use="required"/>
+                </xsd:complexType>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:string" use="required"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="partial-response-redirectType">
+        <xsd:annotation> 
+            <xsd:documentation>
+                    
+                The "redirect" element enables a redirect to the location as specified by the
+                "url" attribute. 
+                    
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:attribute name="url" type="xsd:anyURI" use="required"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="partial-response-errorType">
+        <xsd:annotation> 
+            <xsd:documentation>
+                    
+                The "error" element contains error information from the server. 
+                    
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="error-name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+            <xsd:element name="error-message" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:complexType name="partial-response-extensionType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Extension element for partial response.  It may contain
+                implementation specific content.
+            </xsd:documentation>
+        </xsd:annotation>
+
+        <xsd:sequence>
+            <xsd:any namespace="##any"
+                     processContents="lax"
+                     minOccurs="0"
+                     maxOccurs="unbounded" />
+         </xsd:sequence>
+         <xsd:attribute name="id" type="xsd:ID"/>
+    </xsd:complexType>
+
+</xsd:schema>
+
+
+
+
diff --git a/bundles/org.eclipse.jst.standard.schemas/plugin.properties b/bundles/org.eclipse.jst.standard.schemas/plugin.properties
index 4d00680..1497b9f 100644
--- a/bundles/org.eclipse.jst.standard.schemas/plugin.properties
+++ b/bundles/org.eclipse.jst.standard.schemas/plugin.properties
@@ -1,3 +1,3 @@
 # properties file for org.eclipse.jst.standard.schemas
-Bundle-Name.0 = JEE Related Schemas
-Bundle-Vendor.0 = Eclipse.org
\ No newline at end of file
+Bundle-Name.0 = Java EE Related Schemas
+Bundle-Vendor.0 = Eclipse Web Tools Platform
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.standard.schemas/plugin.xml b/bundles/org.eclipse.jst.standard.schemas/plugin.xml
index 01b8ed3..f1b069f 100644
--- a/bundles/org.eclipse.jst.standard.schemas/plugin.xml
+++ b/bundles/org.eclipse.jst.standard.schemas/plugin.xml
@@ -26,6 +26,9 @@
             <uri
                 name="http://java.sun.com/xml/ns/javaee/application_5.xsd"
                 uri="dtdsAndSchemas/application_5.xsd" />
+            <uri
+                name="http://java.sun.com/xml/ns/javaee/application_6.xsd"
+                uri="dtdsAndSchemas/application_6.xsd" />
 
 
             <public
@@ -42,6 +45,9 @@
             <uri
                 name="http://java.sun.com/xml/ns/javaee/application-client_5.xsd"
                 uri="dtdsAndSchemas/application-client_5.xsd" />
+            <uri
+                name="http://java.sun.com/xml/ns/javaee/application-client_6.xsd"
+                uri="dtdsAndSchemas/application-client_6.xsd" />
 
 
             <public
@@ -51,6 +57,9 @@
             <uri
                 name="http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
                 uri="dtdsAndSchemas/connector_1_5.xsd" />
+            <uri
+                name="http://java.sun.com/xml/ns/j2ee/connector_1_6.xsd"
+                uri="dtdsAndSchemas/connector_1_6.xsd" />
 
 
             <public
@@ -67,6 +76,9 @@
             <uri
                 name="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
                 uri="dtdsAndSchemas/ejb-jar_3_0.xsd" />
+            <uri
+                name="http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"
+                uri="dtdsAndSchemas/ejb-jar_3_1.xsd" />
 
 
             <uri
@@ -98,14 +110,23 @@
             <uri
                 name="http://java.sun.com/xml/ns/javaee/javaee_5.xsd"
                 uri="dtdsAndSchemas/javaee_5.xsd" />
+            <uri
+                name="http://java.sun.com/xml/ns/javaee/javaee_6.xsd"
+                uri="dtdsAndSchemas/javaee_6.xsd" />
 
 
             <uri
                 name="http://java.sun.com/xml/ns/javaee/javaee_web_services_1_2.xsd"
                 uri="dtdsAndSchemas/javaee_web_services_1_2.xsd" />
             <uri
+                name="http://java.sun.com/xml/ns/javaee/javaee_web_services_1_3.xsd"
+                uri="dtdsAndSchemas/javaee_web_services_1_3.xsd" />
+            <uri
                 name="http://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_2.xsd"
                 uri="dtdsAndSchemas/javaee_web_services_client_1_2.xsd" />
+            <uri
+                name="http://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_3.xsd"
+                uri="dtdsAndSchemas/javaee_web_services_client_1_3.xsd" />
 
             <uri
                 name="http://java.sun.com/xml/ns/j2ee/jsp_2_0.xsd"
@@ -113,6 +134,9 @@
             <uri
                 name="http://java.sun.com/xml/ns/j2ee/jsp_2_1.xsd"
                 uri="dtdsAndSchemas/jsp_2_1.xsd" />
+            <uri
+                name="http://java.sun.com/xml/ns/j2ee/jsp_2_2.xsd"
+                uri="dtdsAndSchemas/jsp_2_2.xsd" />
 
 
             <public
@@ -132,6 +156,15 @@
             <uri
                 name="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
                 uri="dtdsAndSchemas/web-app_2_5.xsd" />
+            <uri
+                name="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+                uri="dtdsAndSchemas/web-app_3_0.xsd" />
+            <uri
+                name="http://java.sun.com/xml/ns/javaee/web-common_3_0.xsd"
+                uri="dtdsAndSchemas/web-common_3_0.xsd" />
+            <uri
+                name="http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd"
+                uri="dtdsAndSchemas/web-fragment_3_0.xsd" />
 
 
             <public
@@ -166,12 +199,39 @@
                 uri="dtdsAndSchemas/web-facesconfig_1_2.xsd" />
                 
             <uri
-                name="http://java.sun.com/xml/ns/persistence/orm"
+                name="http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
                 uri="dtdsAndSchemas/orm_1_0.xsd" />
    
             <uri
-                name="http://java.sun.com/xml/ns/persistence"
+                name="http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
                 uri="dtdsAndSchemas/persistence_1_0.xsd" />   
+               
+           <uri
+               name="http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
+               uri="dtdsAndSchemas/orm_2_0.xsd" />
+       
+           <uri
+               name="http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
+               uri="dtdsAndSchemas/persistence_2_0.xsd" />
+               
+            <public
+                publicId="-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
+                uri="dtdsAndSchemas/facelet-taglib_1_0.dtd"/>
+
+            <uri
+                name="http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
+                uri="dtdsAndSchemas/web-facelettaglibrary_2_0.xsd"/>
+            <uri
+                name="http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+                uri="dtdsAndSchemas/web-facesconfig_2_0.xsd"/>
+            <uri
+                name="http://java.sun.com/xml/ns/javaee/web-facesuicomponent_2_0.xsd"
+                uri="dtdsAndSchemas/web-facesuicomponent_2_0.xsd"/>
+            <uri
+                name="http://java.sun.com/xml/ns/javaee/web-partialresponse_2_0.xsd"
+                uri="dtdsAndSchemas/web-partialresponse_2_0.xsd"/>
+
+
                           
         </catalogContribution>
 
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 77f00f3..19d6879 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.1.200.qualifier
+Bundle-Version: 1.1.401.qualifier
 Bundle-Activator: org.eclipse.wst.css.core.internal.CSSCorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
@@ -35,11 +35,11 @@
  org.eclipse.wst.css.core.internal.util;x-friends:="org.eclipse.wst.css.ui",
  org.eclipse.wst.css.core.internal.util.declaration;x-internal:=true,
  org.eclipse.wst.css.core.text
+Import-Package: com.ibm.icu.util; version="3.8"
 Require-Bundle: org.apache.xerces;bundle-version="[2.9.0,3.0.0)";visibility:=reexport,
- org.eclipse.wst.xml.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- com.ibm.icu;bundle-version="[3.8.1,4.0.0)"
+ org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)"
 Bundle-ActivationPolicy: lazy;exclude:="org.eclipse.wst.css.core.internal.contenttype"
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.css.core/about.html b/bundles/org.eclipse.wst.css.core/about.html
index 73db36e..2199df3 100644
--- a/bundles/org.eclipse.wst.css.core/about.html
+++ b/bundles/org.eclipse.wst.css.core/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/bundles/org.eclipse.wst.css.core/build.properties b/bundles/org.eclipse.wst.css.core/build.properties
index fba2831..60e22fd 100644
--- a/bundles/org.eclipse.wst.css.core/build.properties
+++ b/bundles/org.eclipse.wst.css.core/build.properties
@@ -18,7 +18,6 @@
 bin.excludes = bin/**,\
                @dot/**,\
                temp.folder/**
-src.includes = component.xml,\
-               build.properties
+src.includes = component.xml
 source.. = src/
                
diff --git a/bundles/org.eclipse.wst.css.core/plugin.properties b/bundles/org.eclipse.wst.css.core/plugin.properties
index 67fcec0..993a482 100644
--- a/bundles/org.eclipse.wst.css.core/plugin.properties
+++ b/bundles/org.eclipse.wst.css.core/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2008 IBM Corporation and others.
+# Copyright (c) 2004, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
 # Contributors:
 #     IBM Corporation - initial API and implementation
 ###############################################################################
-providerName=Eclipse.org
+providerName=Eclipse Web Tools Platform
 pluginName=Structured Source CSS Model
 cssprofile_css2.name=CSS2: Cascading Style Sheets, level 2
 cssprofile_css1.name=CSS1: Cascading Style Sheets, level 1
@@ -16,4 +16,4 @@
 cssprofile_wap.name=WCSS 1.0
 Structured_CSS_Document_Factory_Extension.name=Structured CSS Document Factory Extension
 CSS_Content_Type_Extension_Element.name=CSS
-_taskMarker.name=CSS Task
\ No newline at end of file
+_taskMarker.name=CSS Task
diff --git a/bundles/org.eclipse.wst.css.core/plugin.xml b/bundles/org.eclipse.wst.css.core/plugin.xml
index c1b7b69..dd43818 100644
--- a/bundles/org.eclipse.wst.css.core/plugin.xml
+++ b/bundles/org.eclipse.wst.css.core/plugin.xml
@@ -71,7 +71,7 @@
 		</processor>
 	</extension>
 
-	<extension point="org.eclipse.core.runtime.contentTypes">
+	<extension point="org.eclipse.core.contenttype.contentTypes">
 		<content-type
 			file-extensions="css"
 			priority="high"
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCoreMessages.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCoreMessages.java
index 8d79a98..b967a90 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCoreMessages.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCoreMessages.java
@@ -21,18 +21,6 @@
 	private static final String BUNDLE_NAME = "org.eclipse.wst.css.core.internal.CSSCorePluginResources";//$NON-NLS-1$
 
 	public static String You_cannot_use_CSSStyleShe_UI_;
-	public static String _1concat_ERROR_;
-	public static String _2concat_ERROR_;
-	public static String _3concat_ERROR_;
-	public static String _4concat_ERROR_;
-	public static String _25concat_ERROR_;
-	public static String _26concat_ERROR_;
-	public static String _27concat_ERROR_;
-	public static String _28concat_ERROR_;
-	public static String _5concat_ERROR_;
-	public static String _6concat_ERROR_;
-	public static String _7concat_ERROR_;
-	public static String _8concat_ERROR_;
 	public static String CSSContentPropertiesManager_Updating;
 	public static String CSSContentPropertiesManager_Problems_Updating;
 
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties
index c971cd6..e18d1fd 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties
@@ -9,18 +9,6 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 You_cannot_use_CSSStyleShe_UI_=You cannot use CSSStyleSheet.getOwnerRule() because of many referencers of this rule\nPlease use getOnwerRules()
-_1concat_ERROR_={0}first flat node is null.
-_2concat_ERROR_={0}first flat node is not in model.
-_3concat_ERROR_={0}last flat node is null.
-_4concat_ERROR_={0}last flat node is not in model.
-_25concat_ERROR_={0}first region is null.
-_26concat_ERROR_={0}first region is not in model.
-_27concat_ERROR_={0}last region is null.
-_28concat_ERROR_={0}last region is not in model.
-_5concat_ERROR_={0}first region is null.
-_6concat_ERROR_={0}first region is not in model.
-_7concat_ERROR_={0}last region is null.
-_8concat_ERROR_={0}last region is not in model.
 #
 CSSContentPropertiesManager_Updating=Updating CSS Content Settings
 CSSContentPropertiesManager_Problems_Updating=Problem saving CSS Content Settings for {0}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSHeadTokenizer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSHeadTokenizer.java
index 02c5eaf..dbdffec 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSHeadTokenizer.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSHeadTokenizer.java
@@ -1,18 +1,17 @@
+/* The following code was generated by JFlex 1.2.2 on 7/28/08 5:19 PM */
+
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- *
+ * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
-/* The following code was generated by JFlex 1.2.2 on 1/27/04 6:42 PM */
-
 /*nlsXXX*/
 package org.eclipse.wst.css.core.internal.contenttype;
-
 import java.io.IOException;
 import java.io.Reader;
 
@@ -20,104 +19,124 @@
 import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;
 
 
+
+
 /**
- * This class is a scanner generated by <a
- * href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex </a> 1.2.2
- * on 1/27/04 6:42 PM from the specification file
- * <tt>file:/D:/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jflex</tt>
+ * This class is a scanner generated by 
+ * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
+ * on 7/28/08 5:19 PM from the specification file
+ * <tt>file:/D:/workspaces/wtp301/workspace/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jFlex</tt>
  */
 public class CSSHeadTokenizer {
 
-	/** this character denotes the end of file */
-	final public static int YYEOF = -1;
+  /** this character denotes the end of file */
+  final public static int YYEOF = -1;
 
-	/** lexical states */
-	final public static int YYINITIAL = 0;
-	final public static int UnDelimitedString = 12;
-	final public static int DQ_STRING = 8;
-	final public static int SQ_STRING = 10;
-	final public static int ST_XMLDecl = 2;
-	final public static int QuotedAttributeValue = 6;
-	final public static int CHARSET_RULE = 4;
+  /** lexical states */
+  final public static int YYINITIAL = 0;
+  final public static int UnDelimitedString = 12;
+  final public static int DQ_STRING = 8;
+  final public static int SQ_STRING = 10;
+  final public static int ST_XMLDecl = 2;
+  final public static int QuotedAttributeValue = 6;
+  final public static int CHARSET_RULE = 4;
 
-	/**
-	 * YY_LEXSTATE[l] is the state in the DFA for the lexical state l
-	 * YY_LEXSTATE[l+1] is the state in the DFA for the lexical state l at the
-	 * beginning of a line l is of the form l = 2*k, k a non negative integer
-	 */
-	private final static int YY_LEXSTATE[] = {0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7};
+  /**
+   * YY_LEXSTATE[l] is the state in the DFA for the lexical state l
+   * YY_LEXSTATE[l+1] is the state in the DFA for the lexical state l
+   *                  at the beginning of a line
+   * l is of the form l = 2*k, k a non negative integer
+   */
+  private final static int YY_LEXSTATE[] = { 
+     0,  1,  2,  2,  3,  3,  4,  4,  5,  5,  6,  6,  7, 7
+  };
 
-	/**
-	 * Translates characters to character classes
-	 */
-	final private static String yycmap_packed = "\11\0\1\6\1\11\2\0\1\10\22\0\1\6\1\0\1\36\2\0" + "\1\41\1\0\1\37\7\0\1\40\13\0\1\35\1\12\1\7\1\34" + "\1\13\1\17\1\22\1\0\1\20\1\31\1\25\1\0\1\33\1\21" + "\1\32\2\0\1\16\1\15\1\27\1\30\2\0\1\23\1\24\1\26" + "\3\0\1\14\10\0\1\22\1\0\1\20\1\31\1\25\1\0\1\33" + "\1\21\1\32\2\0\1\16\1\15\1\27\1\30\2\0\1\23\1\24" + "\1\26\3\0\1\14\102\0\1\4\3\0\1\5\17\0\1\3\16\0" + "\1\1\20\0\1\3\16\0\1\1\1\2\170\0\1\2\ufe87\0";
+  /** 
+   * Translates characters to character classes
+   */
+  final private static String yycmap_packed = 
+    "\1\11\10\0\1\6\1\10\2\0\1\7\22\0\1\6\1\0\1\37"+
+    "\2\0\1\42\1\0\1\40\7\0\1\41\13\0\1\36\1\13\1\12"+
+    "\1\35\1\14\1\20\1\23\1\0\1\21\1\32\1\26\1\0\1\34"+
+    "\1\22\1\33\2\0\1\17\1\16\1\30\1\31\2\0\1\24\1\25"+
+    "\1\27\3\0\1\15\10\0\1\23\1\0\1\21\1\32\1\26\1\0"+
+    "\1\34\1\22\1\33\2\0\1\17\1\16\1\30\1\31\2\0\1\24"+
+    "\1\25\1\27\3\0\1\15\102\0\1\4\3\0\1\5\17\0\1\3"+
+    "\16\0\1\1\20\0\1\3\16\0\1\1\1\2\170\0\1\2\ufe87\0";
 
-	/**
-	 * Translates characters to character classes
-	 */
-	final private static char[] yycmap = yy_unpack_cmap(yycmap_packed);
+  /** 
+   * Translates characters to character classes
+   */
+  final private static char [] yycmap = yy_unpack_cmap(yycmap_packed);
 
 
-	/* error codes */
-	final private static int YY_UNKNOWN_ERROR = 0;
-	final private static int YY_ILLEGAL_STATE = 1;
-	final private static int YY_NO_MATCH = 2;
-	final private static int YY_PUSHBACK_2BIG = 3;
+  /* error codes */
+  final private static int YY_UNKNOWN_ERROR = 0;
+  final private static int YY_ILLEGAL_STATE = 1;
+  final private static int YY_NO_MATCH = 2;
+  final private static int YY_PUSHBACK_2BIG = 3;
 
-	/* error messages for the codes above */
-	final private static String YY_ERROR_MSG[] = {"Unkown internal scanner error", "Internal error: unknown state", "Error: could not match input", "Error: pushback value was too large"};
+  /* error messages for the codes above */
+  final private static String YY_ERROR_MSG[] = {
+    "Unkown internal scanner error",
+    "Internal error: unknown state",
+    "Error: could not match input",
+    "Error: pushback value was too large"
+  };
 
-	/** the input device */
-	private java.io.Reader yy_reader;
+  /** the input device */
+  private java.io.Reader yy_reader;
 
-	/** the current state of the DFA */
-	private int yy_state;
+  /** the current state of the DFA */
+  private int yy_state;
 
-	/** the current lexical state */
-	private int yy_lexical_state = YYINITIAL;
+  /** the current lexical state */
+  private int yy_lexical_state = YYINITIAL;
 
-	/**
-	 * this buffer contains the current text to be matched and is the source
-	 * of the yytext() string
-	 */
-	private char yy_buffer[] = new char[16384];
+  /** this buffer contains the current text to be matched and is
+      the source of the yytext() string */
+  private char yy_buffer[] = new char[16384];
 
-	/** the textposition at the last accepting state */
-	private int yy_markedPos;
+  /** the textposition at the last accepting state */
+  private int yy_markedPos;
 
-	/** the textposition at the last state to be included in yytext */
-	private int yy_pushbackPos;
+  /** the textposition at the last state to be included in yytext */
+  private int yy_pushbackPos;
 
-	/** the current text position in the buffer */
-	private int yy_currentPos;
+  /** the current text position in the buffer */
+  private int yy_currentPos;
 
-	/** startRead marks the beginning of the yytext() string in the buffer */
-	private int yy_startRead;
+  /** startRead marks the beginning of the yytext() string in the buffer */
+  private int yy_startRead;
 
-	/**
-	 * endRead marks the last character in the buffer, that has been read from
-	 * input
-	 */
-	private int yy_endRead;
+  /** endRead marks the last character in the buffer, that has been read
+      from input */
+  private int yy_endRead;
 
+  /** number of newlines encountered up to the start of the matched text */
+//  private int yyline;
 
-	/** the number of characters up to the start of the matched text */
-	private int yychar;
+  /** the number of characters up to the start of the matched text */
+  private int yychar;
 
+  /**
+   * the number of characters from the last newline up to the start of the 
+   * matched text
+   */
+//  private int yycolumn; 
 
-	/**
-	 * yy_atBOL == true <=>the scanner is currently at the beginning of a
-	 * line
-	 */
-	private boolean yy_atBOL;
+  /** 
+   * yy_atBOL == true <=> the scanner is currently at the beginning of a line
+   */
+  private boolean yy_atBOL;
 
-	/** yy_atEOF == true <=>the scanner has returned a value for EOF */
-	private boolean yy_atEOF;
+  /** yy_atEOF == true <=> the scanner has returned a value for EOF */
+  private boolean yy_atEOF;
 
-	/** denotes if the user-EOF-code has already been executed */
-	private boolean yy_eof_done;
+  /** denotes if the user-EOF-code has already been executed */
+  private boolean yy_eof_done;
 
-	/* user code: */
+  /* user code: */
 
 
 	private boolean hasMore = true;
@@ -133,71 +152,76 @@
 		super();
 	}
 
-	public void reset(Reader in) {
-		/* the input device */
-		yy_reader = in;
+	  public void reset (Reader in) {
+	  	/* the input device */
+	  	yy_reader = in;
 
-		/* the current state of the DFA */
-		yy_state = 0;
+  		/* the current state of the DFA */
+  		yy_state = 0;
 
-		/* the current lexical state */
-		yy_lexical_state = YYINITIAL;
+  		/* the current lexical state */
+  		yy_lexical_state = YYINITIAL;
 
-		/*
-		 * this buffer contains the current text to be matched and is the
-		 * source of the yytext() string
-		 */
-		java.util.Arrays.fill(yy_buffer, (char) 0);
+  		/* this buffer contains the current text to be matched and is
+  		 the source of the yytext() string */
+  		java.util.Arrays.fill(yy_buffer, (char)0);
 
-		/* the textposition at the last accepting state */
-		yy_markedPos = 0;
+  		/* the textposition at the last accepting state */
+  		yy_markedPos = 0;
 
-		/* the textposition at the last state to be included in yytext */
-		yy_pushbackPos = 0;
+  		/* the textposition at the last state to be included in yytext */
+  		yy_pushbackPos = 0;
 
-		/* the current text position in the buffer */
-		yy_currentPos = 0;
+  		/* the current text position in the buffer */
+  		yy_currentPos = 0;
 
-		/* startRead marks the beginning of the yytext() string in the buffer */
-		yy_startRead = 0;
+  		/* startRead marks the beginning of the yytext() string in the buffer */
+  		yy_startRead = 0;
 
-		/**
-		 * endRead marks the last character in the buffer, that has been read
-		 * from input
-		 */
-		yy_endRead = 0;
+  		/** 
+  		 * endRead marks the last character in the buffer, that has been read
+  		 * from input 
+  		 */
+  		yy_endRead = 0;
+
+  		/* number of newlines encountered up to the start of the matched text */
+//  		yyline = 0;
+
+  		/* the number of characters up to the start of the matched text */
+  		yychar = 0;
+
+  		/**
+  		 * the number of characters from the last newline up to the start
+  		 * of the matched text
+  		 */
+//  		yycolumn = 0; 
+
+  		/** 
+  		 * yy_atBOL == true <=> the scanner is currently at the beginning 
+  		 * of a line
+  		 */
+  		yy_atBOL = false;
+
+  		/* yy_atEOF == true <=> the scanner has returned a value for EOF */
+  		yy_atEOF = false;
+
+  		/* denotes if the user-EOF-code has already been executed */
+  		yy_eof_done = false;
 
 
-		/* the number of characters up to the start of the matched text */
-		yychar = 0;
-
-
-		/**
-		 * yy_atBOL == true <=>the scanner is currently at the beginning of a
-		 * line
-		 */
-		yy_atBOL = false;
-
-		/* yy_atEOF == true <=> the scanner has returned a value for EOF */
-		yy_atEOF = false;
-
-		/* denotes if the user-EOF-code has already been executed */
-		yy_eof_done = false;
-
-
-		fStateStack.clear();
-
-		hasMore = true;
-
+  		fStateStack.clear();
+  		
+  		hasMore = true;
+  		
 		// its a little wasteful to "throw away" first char array generated
 		// by class init (via auto generated code), but we really do want
 		// a small buffer for our head parsers.
 		if (yy_buffer.length != MAX_TO_SCAN) {
 			yy_buffer = new char[MAX_TO_SCAN];
 		}
+  		
 
-
-	}
+  	}
 
 
 	public final HeadParserToken getNextToken() throws IOException {
@@ -207,8 +231,7 @@
 		if (valueText != null) {
 			result = createToken(context, yychar, valueText);
 			valueText = null;
-		}
-		else {
+		} else {
 			result = createToken(context, yychar, yytext());
 		}
 		return result;
@@ -217,7 +240,6 @@
 	public final boolean hasMoreTokens() {
 		return hasMore && yychar < MAX_TO_SCAN;
 	}
-
 	private void pushCurrentState() {
 		fStateStack.push(yystate());
 
@@ -226,1130 +248,1193 @@
 	private void popState() {
 		yybegin(fStateStack.pop());
 	}
-
 	private HeadParserToken createToken(String context, int start, String text) {
 		return new HeadParserToken(context, start, text);
 	}
+	
 
 
 
-	/**
-	 * Creates a new scanner There is also a java.io.InputStream version of
-	 * this constructor.
-	 * 
-	 * @param in
-	 *            the java.io.Reader to read input from.
-	 */
-	public CSSHeadTokenizer(java.io.Reader in) {
-		this.yy_reader = in;
-	}
+  /**
+   * Creates a new scanner
+   * There is also a java.io.InputStream version of this constructor.
+   *
+   * @param   in  the java.io.Reader to read input from.
+   */
+  public CSSHeadTokenizer(java.io.Reader in) {
+    this.yy_reader = in;
+  }
 
-	/**
-	 * Creates a new scanner. There is also java.io.Reader version of this
-	 * constructor.
-	 * 
-	 * @param in
-	 *            the java.io.Inputstream to read input from.
-	 */
-	public CSSHeadTokenizer(java.io.InputStream in) {
-		this(new java.io.InputStreamReader(in));
-	}
+  /**
+   * Creates a new scanner.
+   * There is also java.io.Reader version of this constructor.
+   *
+   * @param   in  the java.io.Inputstream to read input from.
+   */
+  public CSSHeadTokenizer(java.io.InputStream in) {
+    this(new java.io.InputStreamReader(in));
+  }
 
-	/**
-	 * Unpacks the compressed character translation table.
-	 * 
-	 * @param packed
-	 *            the packed character translation table
-	 * @return the unpacked character translation table
-	 */
-	private static char[] yy_unpack_cmap(String packed) {
-		char[] map = new char[0x10000];
-		int i = 0; /* index in packed string */
-		int j = 0; /* index in unpacked array */
-		while (i < 158) {
-			int count = packed.charAt(i++);
-			char value = packed.charAt(i++);
-			do
-				map[j++] = value;
-			while (--count > 0);
-		}
-		return map;
-	}
+  /** 
+   * Unpacks the compressed character translation table.
+   *
+   * @param packed   the packed character translation table
+   * @return         the unpacked character translation table
+   */
+  private static char [] yy_unpack_cmap(String packed) {
+    char [] map = new char[0x10000];
+    int i = 0;  /* index in packed string  */
+    int j = 0;  /* index in unpacked array */
+    while (i < 160) {
+      int  count = packed.charAt(i++);
+      char value = packed.charAt(i++);
+      do map[j++] = value; while (--count > 0);
+    }
+    return map;
+  }
 
 
-	/**
-	 * Gets the next input character.
-	 * 
-	 * @return the next character of the input stream, EOF if the end of the
-	 *         stream is reached.
-	 * @exception IOException
-	 *                if any I/O-Error occurs
-	 */
-	private int yy_advance() throws java.io.IOException {
+  /**
+   * Gets the next input character.
+   *
+   * @return      the next character of the input stream, EOF if the
+   *              end of the stream is reached.
+   * @exception   IOException  if any I/O-Error occurs
+   */
+  private int yy_advance() throws java.io.IOException {
 
-		/* standard case */
-		if (yy_currentPos < yy_endRead)
-			return yy_buffer[yy_currentPos++];
+    /* standard case */
+    if (yy_currentPos < yy_endRead) return yy_buffer[yy_currentPos++];
 
-		/* if the eof is reached, we don't need to work hard */
-		if (yy_atEOF)
-			return YYEOF;
+    /* if the eof is reached, we don't need to work hard */ 
+    if (yy_atEOF) return YYEOF;
 
-		/* otherwise: need to refill the buffer */
+    /* otherwise: need to refill the buffer */
 
-		/* first: make room (if you can) */
-		if (yy_startRead > 0) {
-			System.arraycopy(yy_buffer, yy_startRead, yy_buffer, 0, yy_endRead - yy_startRead);
+    /* first: make room (if you can) */
+    if (yy_startRead > 0) {
+      System.arraycopy(yy_buffer, yy_startRead, 
+                       yy_buffer, 0, 
+                       yy_endRead-yy_startRead);
 
-			/* translate stored positions */
-			yy_endRead -= yy_startRead;
-			yy_currentPos -= yy_startRead;
-			yy_markedPos -= yy_startRead;
-			yy_pushbackPos -= yy_startRead;
-			yy_startRead = 0;
-		}
+      /* translate stored positions */
+      yy_endRead-= yy_startRead;
+      yy_currentPos-= yy_startRead;
+      yy_markedPos-= yy_startRead;
+      yy_pushbackPos-= yy_startRead;
+      yy_startRead = 0;
+    }
 
-		/* is the buffer big enough? */
-		if (yy_currentPos >= yy_buffer.length) {
-			/* if not: blow it up */
-			char newBuffer[] = new char[yy_currentPos * 2];
-			System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
-			yy_buffer = newBuffer;
-		}
+    /* is the buffer big enough? */
+    if (yy_currentPos >= yy_buffer.length) {
+      /* if not: blow it up */
+      char newBuffer[] = new char[yy_currentPos*2];
+      System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
+      yy_buffer = newBuffer;
+    }
 
-		/* finally: fill the buffer with new input */
-		int numRead = yy_reader.read(yy_buffer, yy_endRead, yy_buffer.length - yy_endRead);
+    /* finally: fill the buffer with new input */
+    int numRead = yy_reader.read(yy_buffer, yy_endRead, 
+                                            yy_buffer.length-yy_endRead);
 
-		if (numRead == -1)
-			return YYEOF;
+    if ( numRead == -1 ) return YYEOF;
 
-		yy_endRead += numRead;
+    yy_endRead+= numRead;
 
-		return yy_buffer[yy_currentPos++];
-	}
+    return yy_buffer[yy_currentPos++];
+  }
 
 
-	/**
-	 * Closes the input stream.
-	 */
-	final public void yyclose() throws java.io.IOException {
-		yy_atEOF = true; /* indicate end of file */
-		yy_endRead = yy_startRead; /* invalidate buffer */
-		yy_reader.close();
-	}
+  /**
+   * Closes the input stream.
+   */
+  final public void yyclose() throws java.io.IOException {
+    yy_atEOF = true;            /* indicate end of file */
+    yy_endRead = yy_startRead;  /* invalidate buffer    */
+    yy_reader.close();
+  }
 
 
-	/**
-	 * Returns the current lexical state.
-	 */
-	final public int yystate() {
-		return yy_lexical_state;
-	}
+  /**
+   * Returns the current lexical state.
+   */
+  final public int yystate() {
+    return yy_lexical_state;
+  }
 
-	/**
-	 * Enters a new lexical state
-	 * 
-	 * @param newState
-	 *            the new lexical state
-	 */
-	final public void yybegin(int newState) {
-		yy_lexical_state = newState;
-	}
+  /**
+   * Enters a new lexical state
+   *
+   * @param newState the new lexical state
+   */
+  final public void yybegin(int newState) {
+    yy_lexical_state = newState;
+  }
 
 
-	/**
-	 * Returns the text matched by the current regular expression.
-	 */
-	final public String yytext() {
-		return new String(yy_buffer, yy_startRead, yy_markedPos - yy_startRead);
-	}
+  /**
+   * Returns the text matched by the current regular expression.
+   */
+  final public String yytext() {
+    return new String( yy_buffer, yy_startRead, yy_markedPos-yy_startRead );
+  }
 
-	/**
-	 * Returns the length of the matched text region.
-	 */
-	final public int yylength() {
-		return yy_markedPos - yy_startRead;
-	}
+  /**
+   * Returns the length of the matched text region.
+   */
+  final public int yylength() {
+    return yy_markedPos-yy_startRead;
+  }
 
 
-	/**
-	 * Reports an error that occured while scanning.
-	 * 
-	 * @param errorCode
-	 *            the code of the errormessage to display
-	 */
-	private void yy_ScanError(int errorCode) {
-		try {
-			System.out.println(YY_ERROR_MSG[errorCode]);
-		}
-		catch (ArrayIndexOutOfBoundsException e) {
-			System.out.println(YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
-		}
+  /**
+   * Reports an error that occured while scanning.
+   *
+   * @param   errorCode  the code of the errormessage to display
+   */
+  private void yy_ScanError(int errorCode) {
+    try {
+      System.out.println(YY_ERROR_MSG[errorCode]);
+    }
+    catch (ArrayIndexOutOfBoundsException e) {
+      System.out.println(YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
+    }
 
-		System.exit(1);
-	}
+  } 
 
 
-	/**
-	 * Pushes the specified amount of characters back into the input stream.
-	 * 
-	 * They will be read again by then next call of the scanning method
-	 * 
-	 * @param number
-	 *            the number of characters to be read again. This number must
-	 *            not be greater than yylength()!
-	 */
-	private void yypushback(int number) {
-		if (number > yylength())
-			yy_ScanError(YY_PUSHBACK_2BIG);
+  /**
+   * Pushes the specified amount of characters back into the input stream.
+   *
+   * They will be read again by then next call of the scanning method
+   *
+   * @param number  the number of characters to be read again.
+   *                This number must not be greater than yylength()!
+   */
+  private void yypushback(int number) {
+    if ( number > yylength() )
+      yy_ScanError(YY_PUSHBACK_2BIG);
 
-		yy_markedPos -= number;
-	}
+    yy_markedPos -= number;
+  }
 
 
-	/**
-	 * Contains user EOF-code, which will be executed exactly once, when the
-	 * end of file is reached
-	 */
-	private void yy_do_eof() {
-		if (!yy_eof_done) {
-			yy_eof_done = true;
-			hasMore = false;
+  /**
+   * Contains user EOF-code, which will be executed exactly once,
+   * when the end of file is reached
+   */
+  private void yy_do_eof() {
+    if (!yy_eof_done) {
+      yy_eof_done = true;
+    	hasMore=false;
 
-		}
-	}
+    }
+  }
 
 
-	/**
-	 * Resumes scanning until the next regular expression is matched, the end
-	 * of input is encountered or an I/O-Error occurs.
-	 * 
-	 * @return the next token
-	 * @exception IOException
-	 *                if any I/O-Error occurs
-	 */
-	public String primGetNextToken() throws java.io.IOException {
-		int yy_input;
-		int yy_action;
+  /**
+   * Resumes scanning until the next regular expression is matched,
+   * the end of input is encountered or an I/O-Error occurs.
+   *
+   * @return      the next token
+   * @exception   IOException  if any I/O-Error occurs
+   */
+  public String primGetNextToken() throws java.io.IOException {
+    int yy_input;
+    int yy_action;
 
 
-		while (true) {
+    while (true) {
 
-			yychar += yylength();
+      yychar+= yylength();
 
-			yy_atBOL = yy_markedPos <= 0 || yy_buffer[yy_markedPos - 1] == '\n';
-			if (!yy_atBOL && yy_buffer[yy_markedPos - 1] == '\r') {
-				yy_atBOL = yy_advance() != '\n';
-				if (!yy_atEOF)
-					yy_currentPos--;
-			}
+      yy_atBOL = yy_markedPos <= 0 || yy_buffer[yy_markedPos-1] == '\n';
+      if (!yy_atBOL && yy_buffer[yy_markedPos-1] == '\r') {
+        yy_atBOL = yy_advance() != '\n';
+        if (!yy_atEOF) yy_currentPos--;
+      }
 
-			yy_action = -1;
+      yy_action = -1;
 
-			yy_currentPos = yy_startRead = yy_markedPos;
+      yy_currentPos = yy_startRead = yy_markedPos;
 
-			if (yy_atBOL)
-				yy_state = YY_LEXSTATE[yy_lexical_state + 1];
-			else
-				yy_state = YY_LEXSTATE[yy_lexical_state];
+      if (yy_atBOL)
+        yy_state = YY_LEXSTATE[yy_lexical_state+1];
+      else
+        yy_state = YY_LEXSTATE[yy_lexical_state];
 
 
-			yy_forAction : {
-				while (true) {
+      yy_forAction: {
+        while (true) {
 
-					yy_input = yy_advance();
+          yy_input = yy_advance();
 
-					if (yy_input == YYEOF)
-						break yy_forAction;
+          if ( yy_input == YYEOF ) break yy_forAction;
 
-					yy_input = yycmap[yy_input];
+          yy_input = yycmap[yy_input];
 
-					boolean yy_isFinal = false;
-					boolean yy_noLookAhead = false;
+          boolean yy_isFinal = false;
+          boolean yy_noLookAhead = false;
 
-					yy_forNext : {
-						switch (yy_state) {
-							case 0 :
-								switch (yy_input) {
-									case 1 :
-										yy_isFinal = true;
-										yy_state = 9;
-										break yy_forNext;
-									case 2 :
-										yy_isFinal = true;
-										yy_state = 10;
-										break yy_forNext;
-									case 3 :
-										yy_isFinal = true;
-										yy_state = 11;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 8;
-										break yy_forNext;
-								}
+          yy_forNext: { switch (yy_state) {
+            case 0:
+              switch (yy_input) {
+                case 1: yy_isFinal = true; yy_state = 9; break yy_forNext;
+                case 2: yy_isFinal = true; yy_state = 10; break yy_forNext;
+                case 3: yy_isFinal = true; yy_state = 11; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
+              }
 
-							case 1 :
-								switch (yy_input) {
-									case 1 :
-										yy_isFinal = true;
-										yy_state = 9;
-										break yy_forNext;
-									case 2 :
-										yy_isFinal = true;
-										yy_state = 10;
-										break yy_forNext;
-									case 3 :
-										yy_isFinal = true;
-										yy_state = 11;
-										break yy_forNext;
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_isFinal = true;
-										yy_state = 12;
-										break yy_forNext;
-									case 10 :
-										yy_isFinal = true;
-										yy_state = 13;
-										break yy_forNext;
-									case 15 :
-										yy_isFinal = true;
-										yy_state = 14;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 8;
-										break yy_forNext;
-								}
+            case 1:
+              switch (yy_input) {
+                case 1: yy_isFinal = true; yy_state = 9; break yy_forNext;
+                case 2: yy_isFinal = true; yy_state = 10; break yy_forNext;
+                case 3: yy_isFinal = true; yy_state = 11; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 12; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 13; break yy_forNext;
+                case 11: yy_isFinal = true; yy_state = 14; break yy_forNext;
+                case 16: yy_isFinal = true; yy_state = 15; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
+              }
 
-							case 2 :
-								switch (yy_input) {
-									case 11 :
-										yy_isFinal = true;
-										yy_state = 15;
-										break yy_forNext;
-									case 21 :
-										yy_isFinal = true;
-										yy_state = 16;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 8;
-										break yy_forNext;
-								}
+            case 2:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_state = 16; break yy_forNext;
+                case 12: yy_isFinal = true; yy_state = 17; break yy_forNext;
+                case 22: yy_isFinal = true; yy_state = 18; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
+              }
 
-							case 3 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_isFinal = true;
-										yy_state = 17;
-										break yy_forNext;
-									case 29 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 18;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 8;
-										break yy_forNext;
-								}
+            case 3:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 20; break yy_forNext;
+                case 30: yy_isFinal = true; yy_state = 21; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
+              }
 
-							case 4 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-										yy_isFinal = true;
-										yy_state = 20;
-										break yy_forNext;
-									case 9 :
-										yy_isFinal = true;
-										yy_state = 21;
-										break yy_forNext;
-									case 30 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 22;
-										break yy_forNext;
-									case 31 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 23;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 19;
-										break yy_forNext;
-								}
+            case 4:
+              switch (yy_input) {
+                case 6: 
+                case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
+                case 8: yy_isFinal = true; yy_state = 24; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 25; break yy_forNext;
+                case 31: yy_isFinal = true; yy_state = 26; break yy_forNext;
+                case 32: yy_isFinal = true; yy_state = 27; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
+              }
 
-							case 5 :
-								switch (yy_input) {
-									case 8 :
-									case 9 :
-									case 10 :
-									case 28 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 25;
-										break yy_forNext;
-									case 11 :
-									case 32 :
-										yy_isFinal = true;
-										yy_state = 26;
-										break yy_forNext;
-									case 29 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 27;
-										break yy_forNext;
-									case 30 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 28;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 24;
-										break yy_forNext;
-								}
+            case 5:
+              switch (yy_input) {
+                case 7: 
+                case 8: 
+                case 11: 
+                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 30; break yy_forNext;
+                case 12: 
+                case 33: yy_isFinal = true; yy_state = 31; break yy_forNext;
+                case 30: yy_isFinal = true; yy_state = 32; break yy_forNext;
+                case 31: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
+              }
 
-							case 6 :
-								switch (yy_input) {
-									case 8 :
-									case 9 :
-									case 10 :
-									case 28 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 25;
-										break yy_forNext;
-									case 32 :
-										yy_isFinal = true;
-										yy_state = 26;
-										break yy_forNext;
-									case 29 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 27;
-										break yy_forNext;
-									case 31 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 28;
-										break yy_forNext;
-									case 33 :
-										yy_isFinal = true;
-										yy_state = 29;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 24;
-										break yy_forNext;
-								}
+            case 6:
+              switch (yy_input) {
+                case 7: 
+                case 8: 
+                case 11: 
+                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                case 33: yy_isFinal = true; yy_state = 31; break yy_forNext;
+                case 30: yy_isFinal = true; yy_state = 32; break yy_forNext;
+                case 32: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 34; break yy_forNext;
+                case 34: yy_isFinal = true; yy_state = 35; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
+              }
+
+            case 7:
+              switch (yy_input) {
+                case 11: 
+                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                case 33: yy_isFinal = true; yy_state = 31; break yy_forNext;
+                case 12: yy_isFinal = true; yy_state = 35; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 36; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 37; break yy_forNext;
+                case 30: yy_isFinal = true; yy_state = 38; break yy_forNext;
+                case 31: 
+                case 32: yy_isFinal = true; yy_state = 39; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
+              }
+
+            case 9:
+              switch (yy_input) {
+                case 2: yy_isFinal = true; yy_noLookAhead = true; yy_state = 40; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 10:
+              switch (yy_input) {
+                case 1: yy_isFinal = true; yy_noLookAhead = true; yy_state = 41; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 11:
+              switch (yy_input) {
+                case 4: yy_state = 42; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 12:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 43; break yy_forNext;
+                case 9: yy_state = 44; break yy_forNext;
+                case 11: yy_state = 45; break yy_forNext;
+                case 16: yy_state = 46; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 13:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 43; break yy_forNext;
+                case 11: yy_state = 45; break yy_forNext;
+                case 16: yy_state = 46; break yy_forNext;
+                case 9: yy_state = 47; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 14:
+              switch (yy_input) {
+                case 9: yy_state = 48; break yy_forNext;
+                case 12: yy_state = 49; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 15:
+              switch (yy_input) {
+                case 9: yy_state = 50; break yy_forNext;
+                case 17: yy_state = 51; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 16:
+              switch (yy_input) {
+                case 12: yy_state = 52; break yy_forNext;
+                case 22: yy_state = 53; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 17:
+              switch (yy_input) {
+                case 9: yy_state = 54; break yy_forNext;
+                case 29: yy_isFinal = true; yy_state = 55; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 18:
+              switch (yy_input) {
+                case 9: yy_state = 56; break yy_forNext;
+                case 24: yy_state = 57; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 19:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 58; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 20:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
+                case 30: yy_isFinal = true; yy_state = 21; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 21:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 59; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 23:
+              switch (yy_input) {
+                case 6: 
+                case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
+                case 8: yy_state = 60; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 61; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
+              }
+
+            case 24:
+              switch (yy_input) {
+                case 6: 
+                case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
+                case 8: yy_state = 60; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 61; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
+              }
+
+            case 25:
+              switch (yy_input) {
+                case 31: yy_isFinal = true; yy_state = 26; break yy_forNext;
+                case 32: yy_isFinal = true; yy_state = 27; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_state = 60; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 26:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 62; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 27:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 63; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 29:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 64; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 30:
+              switch (yy_input) {
+                case 7: 
+                case 8: 
+                case 11: 
+                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                case 30: yy_isFinal = true; yy_state = 32; break yy_forNext;
+                case 31: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 12: 
+                case 33: yy_state = 65; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 31:
+              switch (yy_input) {
+                case 29: yy_isFinal = true; yy_state = 32; break yy_forNext;
+                case 9: yy_state = 66; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 32:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 67; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 33:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 68; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 34:
+              switch (yy_input) {
+                case 7: 
+                case 8: 
+                case 11: 
+                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                case 30: yy_isFinal = true; yy_state = 32; break yy_forNext;
+                case 32: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 33: yy_state = 65; break yy_forNext;
+                case 34: yy_state = 69; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 35:
+              switch (yy_input) {
+                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                case 9: yy_state = 70; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 36:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 71; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 37:
+              switch (yy_input) {
+                case 11: 
+                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 36; break yy_forNext;
+                case 30: yy_isFinal = true; yy_state = 38; break yy_forNext;
+                case 31: 
+                case 32: yy_isFinal = true; yy_state = 39; break yy_forNext;
+                case 33: yy_state = 65; break yy_forNext;
+                case 12: yy_state = 69; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 38:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 72; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 39:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 73; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 42:
+              switch (yy_input) {
+                case 5: yy_isFinal = true; yy_noLookAhead = true; yy_state = 74; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 43:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 43; break yy_forNext;
+                case 9: yy_state = 44; break yy_forNext;
+                case 11: yy_state = 45; break yy_forNext;
+                case 16: yy_state = 46; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 44:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 43; break yy_forNext;
+                case 11: yy_state = 45; break yy_forNext;
+                case 16: yy_state = 46; break yy_forNext;
+                case 9: yy_state = 47; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 45:
+              switch (yy_input) {
+                case 9: yy_state = 48; break yy_forNext;
+                case 12: yy_state = 49; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 46:
+              switch (yy_input) {
+                case 9: yy_state = 50; break yy_forNext;
+                case 17: yy_state = 51; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 47:
+              switch (yy_input) {
+                case 11: yy_state = 45; break yy_forNext;
+                case 16: yy_state = 46; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 48:
+              switch (yy_input) {
+                case 12: yy_state = 49; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 49:
+              switch (yy_input) {
+                case 9: yy_state = 75; break yy_forNext;
+                case 13: yy_state = 76; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 50:
+              switch (yy_input) {
+                case 17: yy_state = 51; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 51:
+              switch (yy_input) {
+                case 9: yy_state = 77; break yy_forNext;
+                case 18: yy_state = 78; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 52:
+              switch (yy_input) {
+                case 9: yy_state = 54; break yy_forNext;
+                case 29: yy_isFinal = true; yy_state = 55; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 53:
+              switch (yy_input) {
+                case 9: yy_state = 56; break yy_forNext;
+                case 24: yy_state = 57; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 54:
+              switch (yy_input) {
+                case 29: yy_isFinal = true; yy_state = 55; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 55:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 79; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 56:
+              switch (yy_input) {
+                case 24: yy_state = 57; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 57:
+              switch (yy_input) {
+                case 9: yy_state = 80; break yy_forNext;
+                case 17: yy_state = 81; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 58:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
+                case 9: yy_state = 82; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 60:
+              switch (yy_input) {
+                case 6: 
+                case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
+                case 8: yy_state = 60; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 61; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
+              }
+
+            case 61:
+              switch (yy_input) {
+                case 6: 
+                case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
+                case 8: yy_state = 60; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 83; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
+              }
+
+            case 65:
+              switch (yy_input) {
+                case 29: yy_isFinal = true; yy_state = 32; break yy_forNext;
+                case 9: yy_state = 66; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 66:
+              switch (yy_input) {
+                case 29: yy_isFinal = true; yy_state = 32; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 69:
+              switch (yy_input) {
+                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                case 9: yy_state = 70; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 70:
+              switch (yy_input) {
+                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 75:
+              switch (yy_input) {
+                case 13: yy_state = 76; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 76:
+              switch (yy_input) {
+                case 9: yy_state = 84; break yy_forNext;
+                case 14: yy_state = 85; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 77:
+              switch (yy_input) {
+                case 18: yy_state = 78; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 7 :
-								switch (yy_input) {
-									case 10 :
-									case 28 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 25;
-										break yy_forNext;
-									case 32 :
-										yy_isFinal = true;
-										yy_state = 26;
-										break yy_forNext;
-									case 11 :
-										yy_isFinal = true;
-										yy_state = 29;
-										break yy_forNext;
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 30;
-										break yy_forNext;
-									case 29 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 31;
-										break yy_forNext;
-									case 30 :
-									case 31 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 32;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 24;
-										break yy_forNext;
-								}
+            case 78:
+              switch (yy_input) {
+                case 9: yy_state = 86; break yy_forNext;
+                case 19: yy_state = 87; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 9 :
-								switch (yy_input) {
-									case 2 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 33;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 80:
+              switch (yy_input) {
+                case 17: yy_state = 81; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 10 :
-								switch (yy_input) {
-									case 1 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 34;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 81:
+              switch (yy_input) {
+                case 9: yy_state = 88; break yy_forNext;
+                case 25: yy_state = 89; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 11 :
-								switch (yy_input) {
-									case 4 :
-										yy_state = 35;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 82:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 12 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_state = 36;
-										break yy_forNext;
-									case 10 :
-										yy_state = 37;
-										break yy_forNext;
-									case 15 :
-										yy_state = 38;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 83:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 60; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 13 :
-								switch (yy_input) {
-									case 11 :
-										yy_state = 39;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 84:
+              switch (yy_input) {
+                case 14: yy_state = 85; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 14 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 40;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 85:
+              switch (yy_input) {
+                case 9: yy_state = 90; break yy_forNext;
+                case 15: yy_state = 91; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 15 :
-								switch (yy_input) {
-									case 28 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 41;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 86:
+              switch (yy_input) {
+                case 19: yy_state = 87; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 16 :
-								switch (yy_input) {
-									case 23 :
-										yy_state = 42;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 87:
+              switch (yy_input) {
+                case 9: yy_state = 92; break yy_forNext;
+                case 20: yy_state = 93; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 17 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_isFinal = true;
-										yy_state = 17;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 88:
+              switch (yy_input) {
+                case 25: yy_state = 89; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 20 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-										yy_isFinal = true;
-										yy_state = 20;
-										break yy_forNext;
-									case 9 :
-										yy_state = 43;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 19;
-										break yy_forNext;
-								}
+            case 89:
+              switch (yy_input) {
+                case 9: yy_state = 94; break yy_forNext;
+                case 26: yy_state = 95; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 21 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-										yy_isFinal = true;
-										yy_state = 20;
-										break yy_forNext;
-									case 9 :
-										yy_state = 43;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 19;
-										break yy_forNext;
-								}
+            case 90:
+              switch (yy_input) {
+                case 15: yy_state = 91; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 26 :
-								switch (yy_input) {
-									case 28 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 44;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 91:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
+                case 9: yy_state = 97; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 29 :
-								switch (yy_input) {
-									case 28 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 45;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 92:
+              switch (yy_input) {
+                case 20: yy_state = 93; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 35 :
-								switch (yy_input) {
-									case 5 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 46;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 93:
+              switch (yy_input) {
+                case 9: yy_state = 98; break yy_forNext;
+                case 21: yy_state = 99; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 36 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_state = 36;
-										break yy_forNext;
-									case 10 :
-										yy_state = 37;
-										break yy_forNext;
-									case 15 :
-										yy_state = 38;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 94:
+              switch (yy_input) {
+                case 26: yy_state = 95; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 37 :
-								switch (yy_input) {
-									case 11 :
-										yy_state = 39;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 95:
+              switch (yy_input) {
+                case 9: yy_state = 100; break yy_forNext;
+                case 27: yy_state = 101; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 38 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 40;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 96:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 102; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 39 :
-								switch (yy_input) {
-									case 12 :
-										yy_state = 47;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 97:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
+                case 9: yy_state = 103; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 40 :
-								switch (yy_input) {
-									case 17 :
-										yy_state = 48;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 98:
+              switch (yy_input) {
+                case 21: yy_state = 99; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 42 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 49;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 99:
+              switch (yy_input) {
+                case 9: yy_state = 104; break yy_forNext;
+                case 22: yy_state = 105; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 43 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-										yy_isFinal = true;
-										yy_state = 20;
-										break yy_forNext;
-									case 9 :
-										yy_state = 43;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 19;
-										break yy_forNext;
-								}
+            case 100:
+              switch (yy_input) {
+                case 27: yy_state = 101; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 47 :
-								switch (yy_input) {
-									case 13 :
-										yy_state = 50;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 101:
+              switch (yy_input) {
+                case 9: yy_state = 106; break yy_forNext;
+                case 24: yy_state = 107; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 48 :
-								switch (yy_input) {
-									case 18 :
-										yy_state = 51;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 102:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
+                case 9: yy_state = 103; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 49 :
-								switch (yy_input) {
-									case 24 :
-										yy_state = 52;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 103:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 50 :
-								switch (yy_input) {
-									case 14 :
-										yy_state = 53;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 104:
+              switch (yy_input) {
+                case 22: yy_state = 105; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 51 :
-								switch (yy_input) {
-									case 19 :
-										yy_state = 54;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 105:
+              switch (yy_input) {
+                case 9: yy_state = 108; break yy_forNext;
+                case 23: yy_isFinal = true; yy_state = 109; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 52 :
-								switch (yy_input) {
-									case 25 :
-										yy_state = 55;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 106:
+              switch (yy_input) {
+                case 24: yy_state = 107; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 53 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_isFinal = true;
-										yy_state = 56;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 107:
+              switch (yy_input) {
+                case 9: yy_state = 110; break yy_forNext;
+                case 28: yy_state = 111; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 54 :
-								switch (yy_input) {
-									case 20 :
-										yy_state = 57;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 108:
+              switch (yy_input) {
+                case 23: yy_isFinal = true; yy_state = 109; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 55 :
-								switch (yy_input) {
-									case 26 :
-										yy_state = 58;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 109:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 112; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 56 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_isFinal = true;
-										yy_state = 56;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 110:
+              switch (yy_input) {
+                case 28: yy_state = 111; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 57 :
-								switch (yy_input) {
-									case 21 :
-										yy_state = 59;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 111:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 111; break yy_forNext;
+                case 9: yy_state = 113; break yy_forNext;
+                case 10: yy_isFinal = true; yy_state = 114; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 58 :
-								switch (yy_input) {
-									case 23 :
-										yy_state = 60;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 113:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 111; break yy_forNext;
+                case 10: yy_isFinal = true; yy_state = 114; break yy_forNext;
+                case 9: yy_state = 115; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 59 :
-								switch (yy_input) {
-									case 22 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 61;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 114:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 116; break yy_forNext;
+                case 9: yy_state = 117; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 60 :
-								switch (yy_input) {
-									case 27 :
-										yy_state = 62;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 115:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 111; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 62 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_state = 62;
-										break yy_forNext;
-									case 7 :
-										yy_isFinal = true;
-										yy_state = 63;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 116:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_state = 114; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 116; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 63 :
-								switch (yy_input) {
-									case 6 :
-									case 8 :
-									case 9 :
-										yy_isFinal = true;
-										yy_state = 63;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 117:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 116; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							default :
-								yy_ScanError(YY_ILLEGAL_STATE);
-								break;
-						}
-					}
+            default:
+              yy_ScanError(YY_ILLEGAL_STATE);
+              break;
+          } }
 
-					if (yy_isFinal) {
-						yy_action = yy_state;
-						yy_markedPos = yy_currentPos;
-						if (yy_noLookAhead)
-							break yy_forAction;
-					}
+          if ( yy_isFinal ) {
+            yy_action = yy_state; 
+            yy_markedPos = yy_currentPos; 
+            if ( yy_noLookAhead ) break yy_forAction;
+          }
 
-				}
-			}
+        }
+      }
 
 
-			switch (yy_action) {
+      switch (yy_action) {    
 
-				case 45 : {
-					yypushback(2);
-					popState();
-					valueText = string.toString();
-					return EncodingParserConstants.InvalidTerminatedStringValue;
-				}
-				case 65 :
-					break;
-				case 25 : {
-					yypushback(1);
-					popState();
-					valueText = string.toString();
-					return EncodingParserConstants.InvalidTerminatedStringValue;
-				}
-				case 66 :
-					break;
-				case 19 :
-				case 20 : {
-					yypushback(1);
-					yybegin(UnDelimitedString);
-					string.setLength(0);
-				}
-				case 67 :
-					break;
-				case 18 : {
-					yybegin(YYINITIAL);
-					hasMore = false;
-					return CSSHeadTokenizerConstants.RuleEnd;
-				}
-				case 68 :
-					break;
-				case 32 : {
-					yypushback(1);
-					popState();
-					valueText = string.toString();
-					return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;
-				}
-				case 69 :
-					break;
-				case 44 : {
-					yypushback(2);
-					popState();
-					valueText = string.toString();
-					return EncodingParserConstants.InvalidTerminatedStringValue;
-				}
-				case 70 :
-					break;
-				case 61 : {
-					if (yychar == 0) {
-						yybegin(CHARSET_RULE);
-						return CSSHeadTokenizerConstants.CHARSET_RULE;
-					}
-				}
-				case 71 :
-					break;
-				case 56 : {
-					if (yychar == 0) {
-						yybegin(ST_XMLDecl);
-						return XMLHeadTokenizerConstants.XMLDeclStart;
-					}
-				}
-				case 72 :
-					break;
-				case 8 :
-				case 9 :
-				case 10 :
-				case 11 :
-				case 12 :
-				case 13 :
-				case 14 :
-				case 15 :
-				case 16 :
-				case 21 : {
-					if (yychar > MAX_TO_SCAN) {
-						hasMore = false;
-						return EncodingParserConstants.MAX_CHARS_REACHED;
-					}
-				}
-				case 73 :
-					break;
-				case 41 : {
-					yybegin(YYINITIAL);
-					return XMLHeadTokenizerConstants.XMLDeclEnd;
-				}
-				case 74 :
-					break;
-				case 63 : {
-					pushCurrentState();
-					yybegin(QuotedAttributeValue);
-					return XMLHeadTokenizerConstants.XMLDelEncoding;
-				}
-				case 75 :
-					break;
-				case 3 :
-				case 17 : {
-					pushCurrentState();
-					yybegin(QuotedAttributeValue);
-				}
-				case 76 :
-					break;
-				case 46 : {
-					hasMore = false;
-					return EncodingParserConstants.UTF83ByteBOM;
-				}
-				case 77 :
-					break;
-				case 33 : {
-					hasMore = false;
-					return EncodingParserConstants.UTF16BE;
-				}
-				case 78 :
-					break;
-				case 34 : {
-					hasMore = false;
-					return EncodingParserConstants.UTF16LE;
-				}
-				case 79 :
-					break;
-				case 24 :
-				case 26 :
-				case 29 : {
-					string.append(yytext());
-				}
-				case 80 :
-					break;
-				case 23 : {
-					yybegin(SQ_STRING);
-					string.setLength(0);
-				}
-				case 81 :
-					break;
-				case 22 : {
-					yybegin(DQ_STRING);
-					string.setLength(0);
-				}
-				case 82 :
-					break;
-				case 27 : {
-					yypushback(1);
-					popState();
-					valueText = string.toString();
-					return EncodingParserConstants.InvalidTerminatedStringValue;
-				}
-				case 83 :
-					break;
-				case 28 : {
-					popState();
-					valueText = string.toString();
-					return EncodingParserConstants.StringValue;
-				}
-				case 84 :
-					break;
-				case 30 : {
-					yypushback(1);
-					popState();
-					valueText = string.toString();
-					return EncodingParserConstants.UnDelimitedStringValue;
-				}
-				case 85 :
-					break;
-				case 31 : {
-					yypushback(1);
-					popState();
-					valueText = string.toString();
-					return EncodingParserConstants.UnDelimitedStringValue;
-				}
-				case 86 :
-					break;
-				default :
-					if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
-						yy_atEOF = true;
-						yy_do_eof();
-						{
-							hasMore = false;
-							return EncodingParserConstants.EOF;
-						}
-					}
-					else {
-						yy_ScanError(YY_NO_MATCH);
-					}
-			}
-		}
-	}
+        case 29: 
+        case 64: 
+          {  yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
+        case 119: break;
+        case 22: 
+        case 23: 
+        case 25: 
+        case 61: 
+        case 83: 
+          {  yypushback(yylength()); yybegin(UnDelimitedString); string.setLength(0); }
+        case 120: break;
+        case 21: 
+        case 59: 
+          {  yybegin(YYINITIAL);  hasMore = false; return CSSHeadTokenizerConstants.RuleEnd; }
+        case 121: break;
+        case 39: 
+        case 73: 
+          {  yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue; }
+        case 122: break;
+        case 109: 
+        case 112: 
+          { if (yychar == 0 )  {yybegin(CHARSET_RULE); return CSSHeadTokenizerConstants.CHARSET_RULE;} }
+        case 123: break;
+        case 96: 
+        case 102: 
+          { if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;} }
+        case 124: break;
+        case 8: 
+        case 9: 
+        case 10: 
+        case 11: 
+        case 12: 
+        case 13: 
+        case 14: 
+        case 15: 
+        case 16: 
+        case 17: 
+        case 18: 
+        case 20: 
+        case 24: 
+        case 30: 
+        case 34: 
+        case 37: 
+          { if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;} }
+        case 125: break;
+        case 55: 
+        case 79: 
+          { yybegin(YYINITIAL);  return XMLHeadTokenizerConstants.XMLDeclEnd; }
+        case 126: break;
+        case 114: 
+        case 116: 
+          { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding; }
+        case 127: break;
+        case 3: 
+        case 19: 
+        case 58: 
+          { pushCurrentState(); yybegin(QuotedAttributeValue); }
+        case 128: break;
+        case 40: 
+          { hasMore = false; return EncodingParserConstants.UTF16BE; }
+        case 129: break;
+        case 41: 
+          { hasMore = false; return EncodingParserConstants.UTF16LE; }
+        case 130: break;
+        case 74: 
+          { hasMore = false; return EncodingParserConstants.UTF83ByteBOM; }
+        case 131: break;
+        case 28: 
+        case 31: 
+        case 35: 
+          {  string.append( yytext() );  }
+        case 132: break;
+        case 27: 
+        case 63: 
+          {  yybegin(SQ_STRING); string.setLength(0);  }
+        case 133: break;
+        case 26: 
+        case 62: 
+          {  yybegin(DQ_STRING); string.setLength(0);  }
+        case 134: break;
+        case 32: 
+        case 67: 
+          {  yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;  }
+        case 135: break;
+        case 33: 
+        case 68: 
+          {  popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;  }
+        case 136: break;
+        case 36: 
+        case 71: 
+          {  yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;  }
+        case 137: break;
+        case 38: 
+        case 72: 
+          {  yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;  }
+        case 138: break;
+        default: 
+          if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
+            yy_atEOF = true;
+            yy_do_eof();
+              { hasMore = false; return EncodingParserConstants.EOF; }
+          } 
+          else {
+            yy_ScanError(YY_NO_MATCH);
+          }
+      }
+    }
+  }    
 
-	/**
-	 * Runs the scanner on input files.
-	 * 
-	 * This main method is the debugging routine for the scanner. It prints
-	 * each returned token to System.out until the end of file is reached, or
-	 * an error occured.
-	 * 
-	 * @param argv
-	 *            the command line, contains the filenames to run the scanner
-	 *            on.
-	 */
-	public static void main(String argv[]) {
-		for (int i = 0; i < argv.length; i++) {
-			CSSHeadTokenizer scanner = null;
-			try {
-				scanner = new CSSHeadTokenizer(new java.io.FileReader(argv[i]));
-			}
-			catch (java.io.FileNotFoundException e) {
-				System.out.println("File not found : \"" + argv[i] + "\"");
-				System.exit(1);
-			}
-			catch (ArrayIndexOutOfBoundsException e) {
-				System.out.println("Usage : java CSSHeadTokenizer <inputfile>");
-				System.exit(1);
-			}
+  /**
+   * Runs the scanner on input files.
+   *
+   * This main method is the debugging routine for the scanner.
+   * It prints each returned token to System.out until the end of
+   * file is reached, or an error occured.
+   *
+   * @param argv   the command line, contains the filenames to run
+   *               the scanner on.
+   */
+  public static void main(String argv[]) {
+    for (int i = 0; i < argv.length; i++) {
+      CSSHeadTokenizer scanner = null;
+      try {
+        scanner = new CSSHeadTokenizer( new java.io.FileReader(argv[i]) );
+      }
+      catch (java.io.FileNotFoundException e) {
+        System.out.println("File not found : \""+argv[i]+"\"");
+        System.exit(1);
+      }
+      catch (java.io.IOException e) {
+        System.out.println("Error opening file \""+argv[i]+"\"");
+        System.exit(1);
+      }
+      catch (ArrayIndexOutOfBoundsException e) {
+        System.out.println("Usage : java CSSHeadTokenizer <inputfile>");
+        System.exit(1);
+      }
 
-			try {
-				do {
-					System.out.println(scanner.primGetNextToken());
-				}
-				while (!scanner.yy_atEOF);
+      try {
+        do {
+          System.out.println(scanner.primGetNextToken());
+        } while (!scanner.yy_atEOF);
 
-			}
-			catch (java.io.IOException e) {
-				System.out.println("An I/O error occured while scanning :");
-				System.out.println(e);
-				System.exit(1);
-			}
-			catch (Exception e) {
-				e.printStackTrace();
-				System.exit(1);
-			}
-		}
-	}
+      }
+      catch (java.io.IOException e) {
+        System.out.println("An I/O error occured while scanning :");
+        System.out.println(e);
+        System.exit(1);
+      }
+      catch (Exception e) {
+        e.printStackTrace();
+        System.exit(1);
+      }
+    }
+  }
 
 
 }
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSResourceEncodingDetector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSResourceEncodingDetector.java
index 1562f6f..16f5fbd 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSResourceEncodingDetector.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSResourceEncodingDetector.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -21,6 +21,7 @@
 
 import org.eclipse.core.resources.IStorage;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.content.IContentDescription;
 import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
 import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
 import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
@@ -65,15 +66,13 @@
 			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
 			fEncodingMemento.setUTF83ByteBOMUsed(true);
 		}
-		else if (tokenType == EncodingParserConstants.UTF16BE) {
-			canHandleAsUnicodeStream = true;
-			String enc = "UTF-16BE"; //$NON-NLS-1$
-			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
-		}
-		else if (tokenType == EncodingParserConstants.UTF16LE) {
+		else if (tokenType == EncodingParserConstants.UTF16BE || tokenType == EncodingParserConstants.UTF16LE) {
 			canHandleAsUnicodeStream = true;
 			String enc = "UTF-16"; //$NON-NLS-1$
+			byte[] bom = (tokenType == EncodingParserConstants.UTF16BE) ? IContentDescription.BOM_UTF_16BE : IContentDescription.BOM_UTF_16LE;
 			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
+			fEncodingMemento.setUnicodeStream(true);
+			fEncodingMemento.setUnicodeBOM(bom);
 		}
 		return canHandleAsUnicodeStream;
 	}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/IntStack.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/IntStack.java
index aa8cabd..f2830b9 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/IntStack.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/IntStack.java
@@ -94,6 +94,21 @@
 	}
 
 	public int size() {
-		return list.length;
+		return size;
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	public String toString() {
+		StringBuffer s = new StringBuffer(getClass().getName() + ":" +size + " [");
+		for (int i = 0; i < size; i++) {
+			s.append(list[i]);
+			if(i < size - 1) {
+				s.append(", ");
+			}
+		}
+		s.append("]");
+		return s.toString();
 	}
 }
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java
index 58d9f05..e596064 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -52,7 +52,8 @@
 			for (int i = 0; i < len; i++) {
 				char c = text.charAt(i);
 				if (bNum) {
-					if ('0' <= c && c <= '9' || c == '.' || c == '+' || c == '-') {
+					// Only add +/- if it's the first character in the value buffer
+					if ('0' <= c && c <= '9' || c == '.' || ((c == '+' || c == '-') && i == 0)) {
 						bufValue.append(c);
 					}
 					else {
@@ -65,7 +66,12 @@
 				}
 			}
 			String valueStr = bufValue.toString();
-			fValue = Float.valueOf(valueStr).floatValue();
+			try {
+				fValue = Float.valueOf(valueStr).floatValue();
+			}
+			catch (NumberFormatException e) {
+				bufIdent.insert(0, valueStr);
+			}
 			fIdentifier = bufIdent.toString();
 			fType = getFloatValueType(valueStr, fIdentifier);
 		}
@@ -857,7 +863,9 @@
 				bSpace = true;
 			}
 			else {
-				buf.append(getText(region));
+				// [274945] Multiple regions should have the spaces between collapsed
+				String text = i.hasNext() ? getCollapsedText(region) : getText(region);
+				buf.append(text);
 				bSpace = false;
 			}
 		}
@@ -1066,6 +1074,15 @@
 		}
 	}
 
+	private String getCollapsedText(ITextRegion region) {
+		if (fParentRegion == null)
+			return ""; //$NON-NLS-1$
+		StringBuffer text = new StringBuffer(fParentRegion.getFullText(region));
+		if (region.getLength() > region.getTextLength())
+			text.replace(region.getTextLength(), region.getLength(), " "); //$NON-NLS-1$
+		return text.toString();
+	}
+
 	private String getText(ITextRegion region) {
 		return (fParentRegion != null) ? fParentRegion.getText(region) : ""; //$NON-NLS-1$ 
 	}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelDeletionContext.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelDeletionContext.java
index a864d43..5858bec 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelDeletionContext.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelDeletionContext.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,7 +15,9 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Enumeration;
+import java.util.HashSet;
 import java.util.Iterator;
+import java.util.Set;
 
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
 import org.eclipse.wst.css.core.internal.util.CSSUtil;
@@ -33,11 +35,11 @@
 	private int fNewStart = -1;
 	private int fNewLength = 0;
 	private int fLengthDifference = 0;
-	private IStructuredDocumentRegionList fOldStructuredDocumentRegions = null;
 	// private ICSSNode fRootNode = null;
 	private int fRemovedRangeBegin = -1;
 	private int fRemovedRangeEnd = -1;
 	private CSSNodeListImpl fNodesToBeRemoved = new CSSNodeListImpl();
+	private Set fOldRegionsList;
 
 	/**
 	 * CSSModelDeletionContext constructor comment.
@@ -224,15 +226,7 @@
 	 * 
 	 */
 	private boolean isOldNode(IStructuredDocumentRegion flatNode) {
-		if (fOldStructuredDocumentRegions != null) {
-			for (Enumeration e = fOldStructuredDocumentRegions.elements(); e.hasMoreElements();) {
-				if (e.nextElement() == flatNode) {
-					return true;
-				}
-			}
-		}
-
-		return false;
+		return fOldRegionsList.contains(flatNode);
 	}
 
 	/**
@@ -258,8 +252,12 @@
 			fRemovedRangeBegin = fRemovedRangeEnd = -1;
 		}
 		fLengthDifference = fNewLength - fOldLength;
-		fOldStructuredDocumentRegions = oldStructuredDocumentRegions;
 
+		fOldRegionsList = new HashSet(); 
+		final Enumeration elements = oldStructuredDocumentRegions.elements();
+		while (elements.hasMoreElements()) {
+			fOldRegionsList.add(elements.nextElement());
+		}
 		// cleanup nodes
 		while (0 < fNodesToBeRemoved.getLength()) {
 			fNodesToBeRemoved.removeNode(0);
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelImpl.java
index 03d6d40..c8e7b5d 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelImpl.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -442,7 +442,10 @@
 
 		CSSModelParser parser = getParser();
 		parser.setStructuredDocumentEvent(structuredDocumentEvent);
-		parser.replaceStructuredDocumentRegions(newStructuredDocumentRegions, oldStructuredDocumentRegions);
+		if (structuredDocumentEvent.isEntireDocumentReplaced())
+			parser.replaceDocument(newStructuredDocumentRegions);
+		else
+			parser.replaceStructuredDocumentRegions(newStructuredDocumentRegions, oldStructuredDocumentRegions);
 
 		fStructuredDocumentUpdate = false;
 	}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelParser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelParser.java
index 82adaa2..a9e971e 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelParser.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelParser.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -1016,6 +1016,20 @@
 		}
 	}
 
+	void replaceDocument(IStructuredDocumentRegionList newStructuredDocumentRegions) {
+		if (fDocument == null || fCreationContext == null)
+			return;
+		((CSSDocumentImpl) fDocument).removeChildNodes();
+
+		if (newStructuredDocumentRegions != null && 0 < newStructuredDocumentRegions.getLength()) {
+			setupCreationContext(newStructuredDocumentRegions.item(0));
+			insertStructuredDocumentRegions(newStructuredDocumentRegions);
+		}
+
+		IStructuredDocument structuredDocument = fStructuredDocumentWalker.getStructuredDocument();
+		((CSSStructuredDocumentRegionContainer)fDocument).setRangeStructuredDocumentRegion(structuredDocument.getFirstStructuredDocumentRegion(), structuredDocument.getLastStructuredDocumentRegion());
+	}
+
 	/**
 	 * 
 	 */
@@ -1038,7 +1052,14 @@
 		}
 
 		if (newStructuredDocumentRegions != null && 0 < newStructuredDocumentRegions.getLength()) {
-			setupCreationContext(newStructuredDocumentRegions.item(0));
+			/* when removing old nodes the creation context should be set up based on them
+			 * else creation context is that of the new nodes
+			 */
+			if( oldStructuredDocumentRegions != null && oldStructuredDocumentRegions.getLength() < 0) {
+				setupCreationContext(oldStructuredDocumentRegions.item(0));
+			} else {
+				setupCreationContext(newStructuredDocumentRegions.item(0));
+			}
 			insertStructuredDocumentRegions(newStructuredDocumentRegions);
 		}
 
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUtil.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUtil.java
index f9b137a..d87b011 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUtil.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUtil.java
@@ -13,8 +13,6 @@
 import java.util.Iterator;
 import java.util.Vector;
 
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.css.core.internal.CSSCoreMessages;
 import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
@@ -64,22 +62,22 @@
 			String nodeText = CSSUtil.getClassString(node) + ": ";//$NON-NLS-1$
 			IStructuredDocumentRegion flatNode = node.getFirstStructuredDocumentRegion();
 			if (flatNode == null && (!(node instanceof CSSStyleDeclarationImpl || node instanceof CSSStyleSheetImpl) || node.getFirstChild() != null)) {
-				errors.add(NLS.bind(CSSCoreMessages._1concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first flat node is null."
+				errors.add(nodeText + "first flat node is null."); //$NON-NLS-1$
 			}
 			else if (flatNode != null) {
 				IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(flatNode.getStart());
 				if (flatNode != modelNode) {
-					errors.add(NLS.bind(CSSCoreMessages._2concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first flat node is not in model."
+					errors.add(nodeText + "first flat node is not in model."); //$NON-NLS-1$
 				}
 			}
 			flatNode = node.getLastStructuredDocumentRegion();
 			if (flatNode == null && (!(node instanceof CSSStyleDeclarationImpl || node instanceof CSSStyleSheetImpl) || node.getFirstChild() != null)) {
-				errors.add(NLS.bind(CSSCoreMessages._3concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last flat node is null."
+				errors.add(nodeText + "last flat node is null."); //$NON-NLS-1$
 			}
 			else if (flatNode != null) {
 				IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(flatNode.getStart());
 				if (flatNode != modelNode) {
-					errors.add(NLS.bind(CSSCoreMessages._4concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last flat node is not in model."
+					errors.add(nodeText + "last flat node is not in model."); //$NON-NLS-1$
 				}
 			}
 		}
@@ -89,26 +87,26 @@
 			ITextRegion region = node.getFirstRegion();
 			IStructuredDocumentRegion parentRegion = node.getDocumentRegion();
 			if (region == null && (!(node instanceof MediaListImpl) || node.getFirstChild() != null)) {
-				errors.add(NLS.bind(CSSCoreMessages._25concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first region is null."
+				errors.add(nodeText + "first region is null."); //$NON-NLS-1$
 			}
 			else if (region != null) {
 				int offset = parentRegion.getStartOffset(region);
 				IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
 				ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
 				if (region != modelRegion) {
-					errors.add(NLS.bind(CSSCoreMessages._26concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first region is not in model."
+					errors.add(nodeText + "first region is not in model."); //$NON-NLS-1$
 				}
 			}
 			region = node.getLastRegion();
 			if (region == null && (!(node instanceof MediaListImpl) || node.getFirstChild() != null)) {
-				errors.add(NLS.bind(CSSCoreMessages._27concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last region is null."
+				errors.add(nodeText + "last region is null."); //$NON-NLS-1$
 			}
 			else if (region != null) {
 				int offset = parentRegion.getStartOffset(region);
 				IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
 				ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
 				if (region != modelRegion) {
-					errors.add(NLS.bind(CSSCoreMessages._28concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last region is not in model."
+					errors.add(nodeText + "last region is not in model."); //$NON-NLS-1$
 				}
 			}
 		}
@@ -122,26 +120,26 @@
 			ITextRegion region = node.getFirstRegion();
 			IStructuredDocumentRegion parentRegion = node.getDocumentRegion();
 			if (region == null && 0 < attr.getValue().length()) {
-				errors.add(NLS.bind(CSSCoreMessages._5concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first region is null."
+				errors.add(nodeText + "first region is null."); //$NON-NLS-1$
 			}
 			else if (region != null) {
 				int offset = parentRegion.getStartOffset(region);
 				IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
 				ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
 				if (region != modelRegion) {
-					errors.add(NLS.bind(CSSCoreMessages._6concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first region is not in model."
+					errors.add(nodeText + "first region is not in model."); //$NON-NLS-1$
 				}
 			}
 			region = node.getLastRegion();
 			if (region == null && 0 < attr.getValue().length()) {
-				errors.add(NLS.bind(CSSCoreMessages._7concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last region is null."
+				errors.add(nodeText + "last region is null."); //$NON-NLS-1$
 			}
 			else if (region != null) {
 				int offset = parentRegion.getStartOffset(region);
 				IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
 				ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
 				if (region != modelRegion) {
-					errors.add(NLS.bind(CSSCoreMessages._8concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last region is not in model."
+					errors.add(nodeText + "last region is not in model."); //$NON-NLS-1$
 				}
 			}
 		}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRegionContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRegionContainer.java
index c569e91..3e5caef 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRegionContainer.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRegionContainer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -49,20 +49,19 @@
 		for (int i = 0; i < regions.size(); i++) {
 			ITextRegion current = regions.get(i);
 			if (bIn) {
-				source.append(fParentRegion.getText(current));
+				source.append(fParentRegion.getFullText(current));
 				if (current == fLastRegion)
 					break;
 			}
 			else {
 				if (current == fFirstRegion) {
 					bIn = true;
-					source.append(fParentRegion.getText(current));
+					source.append(fParentRegion.getFullText(current));
 					if (current == fLastRegion)
 						break;
 				}
 			}
 		}
-
 		return source.toString();
 	}
 
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelector.java
index 4f6dd49..f670642 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelector.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelector.java
@@ -15,7 +15,6 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-import com.ibm.icu.util.StringTokenizer;
 
 import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSelectorAdapter;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
@@ -27,6 +26,8 @@
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
+import com.ibm.icu.util.StringTokenizer;
+
 
 /**
  * 
@@ -302,8 +303,7 @@
 		if (i > 0) {
 			if (i > 1)
 				return false;
-			key = element.getAttribute("id");//$NON-NLS-1$
-			if (key == null)
+			if (!element.hasAttribute("id") || (key = element.getAttribute("id")).length() == 0)//$NON-NLS-1$ //$NON-NLS-2$
 				return false;
 			if (!selector.getID(0).equals(key))
 				return false;
@@ -312,8 +312,7 @@
 		// check class
 		i = selector.getNumOfClasses();
 		if (i > 0) {
-			key = element.getAttribute("class");//$NON-NLS-1$
-			if (key == null)
+			if (!element.hasAttribute("class") || (key = element.getAttribute("class")).length() == 0) //$NON-NLS-1$  //$NON-NLS-2$
 				return false;
 			StringTokenizer tokenizer = new StringTokenizer(key);
 			for (i = i - 1; i >= 0; i--) {
@@ -334,8 +333,9 @@
 			StringTokenizer tokenizer = new StringTokenizer(selector.getAttribute(i), "=~| \t\r\n\f");//$NON-NLS-1$
 			int countTokens = tokenizer.countTokens();
 			if (countTokens > 0) {
-				String attrValue = element.getAttribute(tokenizer.nextToken());
-				if (attrValue == null)
+				String attrName = tokenizer.nextToken();
+				String attrValue = null;
+				if (!element.hasAttribute(attrName) || (attrValue = element.getAttribute(attrName)).length() == 0)
 					return false;
 				if (countTokens > 1) {
 					String token = tokenizer.nextToken("= \t\r\n\f");//$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleSheetImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleSheetImpl.java
index ec31ff0..2e66af5 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleSheetImpl.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleSheetImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
 
 import java.util.Iterator;
 import java.util.List;
+import java.util.Stack;
 import java.util.Vector;
 
 import org.eclipse.wst.css.core.internal.CSSCoreMessages;
@@ -37,6 +38,7 @@
 import org.w3c.dom.css.CSSFontFaceRule;
 import org.w3c.dom.css.CSSRule;
 import org.w3c.dom.css.CSSRuleList;
+import org.w3c.dom.css.CSSStyleSheet;
 import org.w3c.dom.css.CSSUnknownRule;
 import org.w3c.dom.stylesheets.MediaList;
 import org.w3c.dom.stylesheets.StyleSheet;
@@ -282,6 +284,46 @@
 		return list;
 	}
 
+	public CSSRuleList getCssRules(boolean shouldImport) {
+		if (!shouldImport)
+			return getCssRules();
+
+		CSSRuleListImpl list = new CSSRuleListImpl();
+		Stack refs = new Stack();
+		getRules(list, this, refs);
+		return list;
+	}
+
+	private void getRules(CSSRuleListImpl list, ICSSStyleSheet sheet, Stack refs) {
+		String href = sheet.getHref();
+		if (href != null) {
+			// Avoid circular @imports
+			if (refs.contains(href))
+				return;
+			refs.push(href);
+		}
+		boolean acceptImports = true;
+		for (ICSSNode node = sheet.getFirstChild(); node != null; node = node.getNextSibling()) {
+			// Import the stylesheet into the list
+			// @import rules must precede all other rules, according to the spec
+			if (node.getNodeType() == ICSSNode.IMPORTRULE_NODE && acceptImports) {
+				CSSStyleSheet importSheet = ((ICSSImportRule) node).getStyleSheet();
+				if (importSheet instanceof ICSSStyleSheet)
+					getRules(list, (ICSSStyleSheet) importSheet, refs);
+				else
+					list.appendNode(node);
+			}
+			// Add the rule to the list
+			else if (node instanceof CSSRule) {
+				list.appendNode(node);
+				if (node.getNodeType() != ICSSNode.CHARSETRULE_NODE)
+					acceptImports = false;
+			}
+		}
+		if (href != null)
+			refs.pop();
+	}
+
 	/**
 	 * <code>false</code> if the style sheet is applied to the document.
 	 * <code>true</code> if it is not. Modifying this attribute may cause a
@@ -485,7 +527,7 @@
 	public String getTitle() {
 		Node node = getOwnerNode();
 		if (node instanceof Element) {
-			return ((Element) node).getAttribute("TITLE");//$NON-NLS-1$
+			return ((Element) node).hasAttribute("TITLE") ? ((Element) node).getAttribute("TITLE") : null;//$NON-NLS-1$ //$NON-NLS-2$
 		}
 		return null;
 	}
@@ -501,7 +543,7 @@
 	public String getType() {
 		Node node = getOwnerNode();
 		if (node instanceof Element) {
-			return ((Element) node).getAttribute("TYPE");//$NON-NLS-1$
+			return ((Element) node).hasAttribute("TYPE") ? ((Element) node).getAttribute("TYPE") : null;//$NON-NLS-1$ //$NON-NLS-2$
 		}
 		return null;
 	}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AbstractCSSSourceFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AbstractCSSSourceFormatter.java
index 7d6cf79..ad2d140 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AbstractCSSSourceFormatter.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AbstractCSSSourceFormatter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -166,22 +166,11 @@
 		}
 		else if (type == CSSRegionContexts.CSS_DECLARATION_SEPARATOR && node instanceof ICSSStyleDeclItem) {
 			int n = preferences.getInt(CSSCorePreferenceNames.FORMAT_PROP_PRE_DELIM);
-			if (preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH) > 0 && (!preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR) || node.getOwnerDocument().getNodeType() != ICSSNode.STYLEDECLARATION_NODE)) {
-				int length = getLastLineLength(node, source);
-				int append = 1;
-				if (length + n + append > preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH)) {
-					source.append(getLineDelimiter(node));
-					source.append(getIndent(node));
-					if (needIndent)
-						source.append(getIndentString());
-					n = 0; // no space is necessary
-				}
-			}
 			// no delimiter case
 			while (n-- > 0)
 				source.append(" ");//$NON-NLS-1$
 		}
-		else if (type == CSSRegionContexts.CSS_DECLARATION_DELIMITER || type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR || type == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE) {
+		else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR || type == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE) {
 			if (preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH) > 0 && (!preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR) || node.getOwnerDocument().getNodeType() != ICSSNode.STYLEDECLARATION_NODE)) {
 				int length = getLastLineLength(node, source);
 				int append = 1;
@@ -193,7 +182,7 @@
 				}
 			}
 		}
-		else if (CSSRegionContexts.CSS_FOREIGN_ELEMENT == type) {
+		else if (CSSRegionContexts.CSS_FOREIGN_ELEMENT == type || CSSRegionContexts.CSS_DECLARATION_DELIMITER == type) {
 			return;
 		}
 		else
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DefaultCSSSourceFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DefaultCSSSourceFormatter.java
index 04a6730..2b27800 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DefaultCSSSourceFormatter.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DefaultCSSSourceFormatter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,7 +13,6 @@
 
 
 import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.parser.CSSRegionUtil;
 import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
@@ -41,23 +40,6 @@
 		// in selector
 		String prevType = prev.getType();
 		String nextType = next.getType();
-		if (CSSRegionUtil.isSelectorBegginingType(prevType) && CSSRegionUtil.isSelectorBegginingType(nextType)) {
-			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=73990
-			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=110539
-			// Formatting CSS file splits element.class into element . class
-			if (((prevType == CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME || prevType == CSSRegionContexts.CSS_SELECTOR_CLASS || prevType == CSSRegionContexts.CSS_SELECTOR_ID) && (nextType == CSSRegionContexts.CSS_SELECTOR_CLASS || nextType == CSSRegionContexts.CSS_SELECTOR_ID)) || ((prevType == CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME || prevType == CSSRegionContexts.CSS_SELECTOR_CLASS) && nextType == CSSRegionContexts.CSS_SELECTOR_PSEUDO) || (nextType == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START)) {
-				// Individually, SELECTOR_ELEMENT_NAME, SELECTOR_CLASS, and SELECTOR_ID can all be beginning types.
-				// But, we should not insert a space in between when they are followed by SELECTOR_CLASS or SELECTOR_ID.
-				// For example: H1.pastoral and H1#z98y and .pastoral.other and #myid.myclass
-				//
-				// Also, space is now not inserted in between when SELECTOR_ELEMENT_NAME is followed by SELECTOR_PSEUDO, or when
-				// SELECTOR_CLASS is followed by SELECTOR_PSEUDO.
-				// For example: P:first-letter and A.external:visited
-			}
-			else
-				appendSpaceBefore(node, next, source);
-			return;
-		}
 
 		if (prevType == CSSRegionContexts.CSS_PAGE || prevType == CSSRegionContexts.CSS_CHARSET || prevType == CSSRegionContexts.CSS_ATKEYWORD || prevType == CSSRegionContexts.CSS_FONT_FACE || prevType == CSSRegionContexts.CSS_IMPORT || prevType == CSSRegionContexts.CSS_MEDIA) {
 			appendSpaceBefore(node, next, source);
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaRuleFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaRuleFormatter.java
index 059f56a..e546892 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaRuleFormatter.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaRuleFormatter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,6 +23,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.w3c.dom.stylesheets.MediaList;
 
 
 /**
@@ -63,59 +64,39 @@
 				regions = getRegions(structuredDocument, new FormatRegion(start, end - start), exceptFor, pickupType);
 			}
 			// extract source
-			if (child != null && child.getNodeType() == ICSSNode.MEDIALIST_NODE) { // between
-				// "@media"
-				// and
-				// mediatype
+			if (child != null && child.getNodeType() == ICSSNode.MEDIALIST_NODE && ((MediaList) child).getLength() > 0) { // between
+				// "@media" and mediatype
 				for (int i = 0; i < regions.length; i++) {
 					appendSpaceBefore(node, regions[i], source);
 					source.append(decoratedRegion(regions[i], 0, stgy)); // must
-					// be
-					// comments
+					// be comments
 				}
 				appendSpaceBefore(node, toAppend, source);
 			} else if (child != null && (child.getPreviousSibling() == null || child.getPreviousSibling().getNodeType() == ICSSNode.MEDIALIST_NODE)) { // between
-				// mediatype
-				// and
-				// the
-				// first
-				// style
-				// rule
+				// mediatype and the first style rule
 				for (int i = 0; i < regions.length; i++) {
 					appendSpaceBefore(node, regions[i], source);
 					source.append(decoratedRegion(regions[i], 0, stgy)); // must
-					// be
-					// comments
+					// be comments
 				}
 				appendDelimBefore(node, null, source);
 			} else { // between styles
 				for (int i = 0; i < regions.length; i++) {
 					appendDelimBefore(node, regions[i], source);
 					source.append(decoratedRegion(regions[i], 0, stgy)); // must
-					// be
-					// comments
+					// be comments
 				}
 				appendDelimBefore(node, null, source);
 			}
 		} else { // source generation
 			if (child == null && prev != null && prev.getNodeType() != ICSSNode.MEDIALIST_NODE) { // after
-				// the
-				// last
-				// style
-				// rule
+				// the last style rule
 				appendDelimBefore(node.getParentNode(), null, source);
-			} else if (child != null && child.getNodeType() == ICSSNode.MEDIALIST_NODE) { // between
-				// "@media"
-				// and
-				// mediatype
+			} else if (child != null && child.getNodeType() == ICSSNode.MEDIALIST_NODE && ((MediaList) child).getLength() > 0) { // between
+				// "@media" and mediatype
 				appendSpaceBefore(node, toAppend, source);
-			} else if (prev != null && prev.getNodeType() == ICSSNode.MEDIALIST_NODE) { // between
-				// mediatype
-				// and
-				// the
-				// first
-				// style
-				// rule
+			} else if (prev != null && prev.getNodeType() == ICSSNode.MEDIALIST_NODE && ((MediaList) prev).getLength() > 0) { // between
+				// mediatype and the first style rule
 				appendSpaceBefore(node, "{", source);//$NON-NLS-1$
 				source.append("{");//$NON-NLS-1$
 				if (child != null)
@@ -139,32 +120,23 @@
 		CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
 		CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
 		if (child != null && child.getNodeType() == ICSSNode.MEDIALIST_NODE) { // between
-			// "@media"
-			// and
-			// mediatype
+			// "@media" and mediatype
 			for (int i = 0; i < regions.length; i++) {
 				if (i != 0 || needS(outside[0]))
 					appendSpaceBefore(node, regions[i], source);
 				source.append(decoratedRegion(regions[i], 0, stgy)); // must
-				// be
-				// comments
+				// be comments
 			}
 			if (needS(outside[1]) && ((IndexedRegion) child).getStartOffset() == region.getOffset() + region.getLength()) {
 				appendSpaceBefore(node, toAppend, source);
 			}
 		} else if (child != null && (child.getPreviousSibling() == null || child.getPreviousSibling().getNodeType() == ICSSNode.MEDIALIST_NODE)) { // between
-			// mediatype
-			// and
-			// the
-			// first
-			// style
-			// rule
+			// mediatype and the first style rule
 			for (int i = 0; i < regions.length; i++) {
 				if (i != 0 || needS(outside[0]))
 					appendSpaceBefore(node, regions[i], source);
 				source.append(decoratedRegion(regions[i], 0, stgy)); // must
-				// be
-				// comments
+				// be comments
 			}
 			if (needS(outside[1]) && ((IndexedRegion) child).getStartOffset() == region.getOffset() + region.getLength()) {
 				appendDelimBefore(node, null, source);
@@ -174,8 +146,7 @@
 				if (i != 0 || needS(outside[0]))
 					appendDelimBefore(node, regions[i], source);
 				source.append(decoratedRegion(regions[i], 0, stgy)); // must
-				// be
-				// comments
+				// be comments
 			}
 			if (needS(outside[1]) && ((IndexedRegion) child).getStartOffset() == region.getOffset() + region.getLength()) {
 				appendDelimBefore(node, null, source);
@@ -246,7 +217,14 @@
 	protected void formatPre(ICSSNode node, StringBuffer source) {
 		int start = ((IndexedRegion) node).getStartOffset();
 		int end = (node.getFirstChild() != null && ((IndexedRegion) node.getFirstChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getFirstChild()).getStartOffset() : getChildInsertPos(node);
-
+		ICSSNode child = node.getFirstChild();
+		if (child != null && (child instanceof MediaList) && ((MediaList) child).getLength() == 0) {
+			if (child.getNextSibling() != null)
+				end = ((IndexedRegion) child.getNextSibling()).getStartOffset();
+			else
+				end = -1;
+		}
+		
 		if (end > 0) { // source formatting
 			CSSCleanupStrategy stgy = getCleanupStrategy(node);
 
@@ -263,8 +241,8 @@
 				str = MEDIA.toUpperCase();
 			source.append(str);
 		}
-		ICSSNode child = node.getFirstChild();
-		if (child != null && (child instanceof org.w3c.dom.stylesheets.MediaList) && ((org.w3c.dom.stylesheets.MediaList) child).getLength() > 0) {
+
+		if (child != null && (child instanceof MediaList) && ((MediaList) child).getLength() > 0) {
 			appendSpaceBefore(node, "", source);//$NON-NLS-1$
 		}
 	}
@@ -326,9 +304,7 @@
 			return 0;
 
 		if (node.getFirstChild().getNextSibling() == node.getLastChild()) { // inserted
-			// first
-			// style
-			// rule
+			// first style rule
 			IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(insertPos);
 			if (flatNode == null)
 				return 0;
@@ -366,9 +342,7 @@
 			return 0;
 
 		if (node.getFirstChild().getNextSibling() == node.getLastChild()) { // inserted
-			// first
-			// style
-			// rule
+			// first style rule
 			int pos = ((IndexedRegion) node.getFirstChild()).getEndOffset();
 			if (pos <= 0)
 				pos = ((IndexedRegion) node).getStartOffset() + 6 /*
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclItemFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclItemFormatter.java
index bf9c042..167c6f0 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclItemFormatter.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclItemFormatter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -155,14 +155,21 @@
 				// comments
 			}
 		}
-		if (child != null && child instanceof ICSSPrimitiveValue) {
-			if (((ICSSPrimitiveValue) child).getPrimitiveType() == ICSSPrimitiveValue.CSS_COMMA)
-				toAppend = ",";//$NON-NLS-1$
-			else if (((ICSSPrimitiveValue) child).getPrimitiveType() == ICSSPrimitiveValue.CSS_SLASH)
-				toAppend = "/";//$NON-NLS-1$
+		if(child != null) {
+			boolean append = true;
+			if (child instanceof ICSSPrimitiveValue) {
+				if (((ICSSPrimitiveValue) child).getPrimitiveType() == ICSSPrimitiveValue.CSS_COMMA)
+					toAppend = ",";//$NON-NLS-1$
+				else if (((ICSSPrimitiveValue) child).getPrimitiveType() == ICSSPrimitiveValue.CSS_SLASH)
+					toAppend = "/";//$NON-NLS-1$
+				ICSSNode prevSibling = child.getPreviousSibling();
+				if (prevSibling instanceof ICSSPrimitiveValue && ((ICSSPrimitiveValue)prevSibling).getPrimitiveType() == ICSSPrimitiveValue.CSS_SLASH)
+					append = false;
+			}
+			if (toAppend != null && !toAppend.equals(",") && !toAppend.equals("/") && append) {//$NON-NLS-1$ //$NON-NLS-2$
+				appendSpaceBefore(node, toAppend, source);
+			}
 		}
-		if (child != null && toAppend != null && !toAppend.equals(",") && !toAppend.equals("/")) //$NON-NLS-1$ //$NON-NLS-2$
-			appendSpaceBefore(node, toAppend, source);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfileRegistry.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfileRegistry.java
index c000cb3..4036a91 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfileRegistry.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfileRegistry.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,17 +10,17 @@
  *******************************************************************************/
 package org.eclipse.wst.css.core.internal.metamodel;
 
-
-
+import java.text.Collator;
+import java.util.ArrayList;
 import java.util.Collections;
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 
 import org.eclipse.wst.css.core.internal.metamodelimpl.RegistryReader;
 
-
-
 public class CSSProfileRegistry {
 	public synchronized static CSSProfileRegistry getInstance() {
 		if (fInstance == null) {
@@ -28,9 +28,24 @@
 		}
 		return fInstance;
 	}
+	
+	static class ProfileNameComparator implements Comparator {
+		static Collator delegate = Collator.getInstance();
+
+		public int compare(Object o1, Object o2) {
+			if (o1 instanceof CSSProfile && o2 instanceof CSSProfile) {
+				if (((CSSProfile) o1).getProfileName() != null && ((CSSProfile) o2).getProfileName() != null) {
+					return delegate.compare(((CSSProfile) o1).getProfileName(), ((CSSProfile) o2).getProfileName());
+				}
+			}
+			return 0;
+		}
+	}
 
 	public Iterator getProfiles() {
-		return Collections.unmodifiableCollection(fProfiles.values()).iterator();
+		List values = new ArrayList(fProfiles.values());
+		Collections.sort(values, new ProfileNameComparator());
+		return Collections.unmodifiableCollection(values).iterator();
 	}
 
 	public CSSProfile getProfile(String profileID) {
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSTokenizer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSTokenizer.java
index fee9ec3..a9b7e60 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSTokenizer.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSTokenizer.java
@@ -1,14 +1,15 @@
+/* The following code was generated by JFlex 1.4.2 on 8/13/10 2:23 PM */
+
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- *
+ * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
-/* The following code was generated by JFlex 1.2.2 on 6/7/06 5:23 PM */
 /*nlsXXX*/
 package org.eclipse.wst.css.core.internal.parser;
 
@@ -24,187 +25,1235 @@
 
 
 /**
- * This class is a scanner generated by <a
- * href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 6/7/06 5:23 PM from the specification file
- * <tt>file:/D:/builds/Workspaces/pureHeadWTP/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.jflex</tt>
+ * This class is a scanner generated by 
+ * <a href="http://www.jflex.de/">JFlex</a> 1.4.2
+ * on 8/13/10 2:23 PM from the specification file
+ * <tt>D:/dev/workspaces/helios/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.jflex</tt>
  */
 public class CSSTokenizer implements CSSRegionContexts, ICSSTokenizer {
 
-	/** this character denotes the end of file */
-	final public static int YYEOF = -1;
+  /** This character denotes the end of file */
+  public static final int YYEOF = -1;
 
-	/** lexical states */
-	final public static int ST_SELECTOR_ATTRIBUTE_NAME = 11;
-	final public static int ST_IMPORT_DELIMITER = 5;
-	final public static int ST_DECLARATION_PRE_VALUE = 17;
-	final public static int ST_SELECTOR = 0;
-	final public static int ST_CHARSET_DELIMITER = 2;
-	final public static int ST_DECLARATION_VALUE = 18;
-	final public static int ST_PAGE_PSEUDO_PAGE = 8;
-	final public static int ST_IMPORT_URI = 3;
-	final public static int ST_SELECTOR_ATTRIBUTE_END = 14;
-	final public static int ST_SELECTOR_ATTRIBUTE_OPERATOR = 12;
-	final public static int ST_DECLARATION = 15;
-	final public static int ST_PAGE_DELIMITER = 9;
-	final public static int ST_SELECTOR_ATTRIBUTE_VALUE = 13;
-	final public static int ST_MEDIA_MEDIUM = 6;
-	final public static int ST_CHARSET_NAME = 1;
-	final public static int ST_IMPORT_MEDIUM = 4;
-	final public static int ST_DECLARATION_SEPARATOR = 16;
-	final public static int ST_FONT_FACE_DELIMITER = 9;
-	final public static int ST_MEDIA_DELIMITER = 7;
-	final public static int ST_SELECTOR_MODIFIER = 10;
-	final public static int YYINITIAL = 0;
+  /** initial size of the lookahead buffer */
+  private static final int ZZ_BUFFERSIZE = 16384;
 
-	/**
-	 * Translates characters to character classes
-	 */
-	final private static String yycmap_packed = "\11\0\1\12\1\17\1\0\1\4\1\20\22\0\1\6\1\31\1\11" + "\1\21\1\16\1\72\1\16\1\5\1\25\1\13\1\35\1\14\1\55" + "\1\10\1\15\1\34\12\1\1\62\1\50\1\30\1\67\1\32\1\27" + "\1\36\1\43\1\26\1\40\1\57\1\46\1\64\1\61\1\41\1\51" + "\2\2\1\24\1\52\1\65\1\54\1\53\1\2\1\23\1\44\1\47" + "\1\22\5\2\1\66\1\3\1\71\1\16\1\2\1\16\1\42\1\7" + "\1\37\1\56\1\45\1\63\1\61\1\41\1\51\2\2\1\24\1\52" + "\1\65\1\54\1\53\1\2\1\23\1\44\1\47\1\22\5\2\1\60" + "\1\70\1\33\1\70\1\0\uff80\2";
+  /** lexical states */
+  public static final int ST_SELECTOR_ATTRIBUTE_NAME = 26;
+  public static final int ST_IMPORT_DELIMITER = 10;
+  public static final int ST_DECLARATION_PRE_VALUE = 38;
+  public static final int ST_SELECTOR = 22;
+  public static final int ST_CHARSET_DELIMITER = 4;
+  public static final int ST_DECLARATION_VALUE = 40;
+  public static final int ST_PAGE_PSEUDO_PAGE = 16;
+  public static final int ST_IMPORT_URI = 6;
+  public static final int ST_SELECTOR_ATTRIBUTE_END = 32;
+  public static final int ST_SELECTOR_ATTRIBUTE_OPERATOR = 28;
+  public static final int ST_DECLARATION = 34;
+  public static final int ST_PAGE_DELIMITER = 18;
+  public static final int ST_SELECTOR_ATTRIBUTE_VALUE = 30;
+  public static final int ST_MEDIA_MEDIUM = 12;
+  public static final int ST_CHARSET_NAME = 2;
+  public static final int ST_IMPORT_MEDIUM = 8;
+  public static final int ST_DECLARATION_SEPARATOR = 36;
+  public static final int ST_FONT_FACE_DELIMITER = 20;
+  public static final int ST_MEDIA_DELIMITER = 14;
+  public static final int ST_SELECTOR_MODIFIER = 24;
+  public static final int YYINITIAL = 0;
 
-	/**
-	 * Translates characters to character classes
-	 */
-	final private static char[] yycmap = yy_unpack_cmap(yycmap_packed);
+  /**
+   * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l
+   * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l
+   *                  at the beginning of a line
+   * l is of the form l = 2*k, k a non negative integer
+   */
+  private static final int ZZ_LEXSTATE[] = { 
+     0,  0,  1,  1,  2,  2,  3,  3,  4,  4,  5,  5,  6,  6,  7,  7, 
+     8,  8,  9,  9,  9,  9,  0,  0, 10, 10, 11, 11, 12, 12, 13, 13, 
+    14, 14, 15, 15, 16, 16, 17, 17, 18, 18
+  };
 
-	/**
-	 * Translates a state to a row index in the transition table
-	 */
-	final private static int yy_rowMap[] = {0, 59, 118, 177, 236, 295, 354, 413, 472, 531, 590, 649, 708, 767, 826, 885, 944, 1003, 1062, 1121, 1180, 1239, 1298, 1357, 1416, 1475, 1534, 1121, 1593, 1121, 1652, 1711, 1121, 1770, 1829, 1888, 1121, 1947, 2006, 2065, 2124, 2183, 2242, 1121, 2301, 2360, 2419, 1121, 1121, 2478, 2537, 2596, 1121, 2655, 2714, 1121, 1121, 2773, 2832, 2891, 1121, 2950, 1121, 3009, 3068, 3127, 3186, 3245, 3304, 3363, 3422, 1121, 1121, 3481, 3540, 3599, 3658, 3717, 3776, 1121, 3835, 3894, 3953, 4012, 4071, 1593, 1121, 4130, 1239, 4189, 4248, 1416, 4307, 1475, 4366, 4425, 4484, 4543, 4602, 4661, 4720, 4779, 4838, 4897, 4956, 1770, 5015, 1121, 1888, 5074, 1947, 5133, 1121, 2006, 5192, 5251, 2183, 5310, 2360, 5369, 2537, 5428, 5487, 1121, 2714, 2832, 5546, 3068, 5605, 3127, 5664, 1121, 3245, 5723, 3363, 5782, 5841, 5900, 5959, 3894, 1121, 3599, 1121, 6018, 3658, 6077, 1121, 3776, 6136, 6195, 3953, 6254, 6313, 6372, 4071, 6431, 1121, 4130, 6490, 1121, 6549, 6608,
-				6667, 6726, 6785, 6844, 6903, 6962, 7021, 7080, 7139, 7198, 1770, 7257, 7316, 1888, 7375, 7434, 1947, 7493, 7552, 2006, 7611, 7670, 7729, 7788, 7847, 7906, 7965, 8024, 3127, 8083, 8142, 3245, 8201, 8260, 8319, 8378, 8437, 3658, 8496, 8555, 3776, 8614, 8673, 8732, 8791, 8850, 8909, 8968, 9027, 1121, 1121, 9086, 9145, 9204, 9263, 9322, 9381, 9440, 9499, 9558, 9617, 9676, 9735, 9794, 9853, 9912, 9971, 10030, 10089, 10148, 10207, 10266, 10325, 10384, 10443, 10502, 10561, 10620, 10679, 10738, 10797, 10856, 10915, 10974, 11033, 11092, 11151, 11210, 1121, 11269, 11328, 1121, 11387, 11446, 11505, 11564, 11623, 11682, 11741, 11800, 11859, 11918, 1121, 11977, 12036, 12095, 12154, 12213, 12272, 12331, 12390, 12449, 12508, 12567, 12626, 12685, 12744, 12803, 12862, 12921, 10797, 12980, 13039, 1121, 13098, 13157, 13216, 13275, 13334, 13393, 1121, 13452, 13511, 13570, 13629, 13688, 13747, 13806, 13865, 13924, 11741, 13983, 14042, 14101, 14160, 14219, 14278, 14337, 14396, 14455,
-				14514, 14573, 14632, 14691, 14750, 14809, 14868, 14927, 14986, 15045, 12862, 15104, 15163, 15222, 15281, 15340, 15399, 15458, 1121, 15517, 15576, 15635, 15694, 15753, 15812, 15871, 15930, 15989, 16048, 16107, 16166, 16225, 16284, 16343, 16402, 16461, 16520, 16579, 16638, 16697, 16756, 16815, 16874, 16933, 16992, 17051, 17110, 17169, 17228, 17287, 17346, 17405, 17464, 17523, 17582, 17641, 17700, 17759, 1121, 17818, 17877, 17936, 17995, 18054, 18113, 18172, 18231, 18290, 11859, 18349, 11918, 18408, 18467, 18526, 18585, 18644, 18703, 18762, 18821, 18880, 18939, 12980, 18998, 13039, 19057, 19116, 19175, 19234, 19293, 19352, 19411, 19470, 19529, 19588, 19647, 1121, 19706, 19765, 19824, 19883, 1121, 19942, 20001, 20060, 1121, 20119, 20178, 20237, 20296, 20355, 20414, 20473, 20532, 20591, 20650};
+  /** 
+   * Translates characters to character classes
+   */
+  private static final String ZZ_CMAP_PACKED = 
+    "\11\0\1\12\1\17\1\0\1\4\1\20\22\0\1\6\1\31\1\11"+
+    "\1\21\1\16\1\72\1\16\1\5\1\25\1\13\1\35\1\15\1\55"+
+    "\1\10\1\14\1\34\12\1\1\62\1\50\1\30\1\67\1\32\1\27"+
+    "\1\36\1\43\1\26\1\40\1\57\1\46\1\64\1\61\1\41\1\51"+
+    "\2\2\1\24\1\52\1\65\1\54\1\53\1\2\1\23\1\44\1\47"+
+    "\1\22\5\2\1\66\1\3\1\71\1\16\1\2\1\16\1\42\1\7"+
+    "\1\37\1\56\1\45\1\63\1\61\1\41\1\51\2\2\1\24\1\52"+
+    "\1\65\1\54\1\53\1\2\1\23\1\44\1\47\1\22\5\2\1\60"+
+    "\1\70\1\33\1\70\1\0\uff80\2";
 
-	/**
-	 * The packed transition table of the DFA
-	 */
-	final private static String yy_packed = "\2\24\1\25\1\26\1\27\1\24\1\27\1\25\1\30" + "\1\24\1\27\2\24\1\31\1\24\2\27\1\32\3\25" + "\1\24\1\25\1\24\1\33\2\24\1\34\1\35\1\36" + "\1\37\11\25\1\24\4\25\1\24\2\25\1\24\1\25" + "\1\40\3\25\1\41\10\24\1\27\1\42\1\27\1\24" + "\1\43\1\44\1\27\4\24\2\27\7\24\1\33\2\24" + "\1\34\1\35\1\24\1\37\40\24\1\27\1\24\1\27" + "\1\24\1\43\1\24\1\27\4\24\2\27\7\24\1\33" + "\2\24\1\34\1\35\1\24\1\37\11\24\1\45\26\24" + "\1\27\1\46\1\27\1\24\1\43\1\47\1\27\4\24" + "\2\27\1\24\1\50\5\24\1\33\2\24\1\34\1\35" + "\1\24\1\37\11\24\1\45\24\24\1\51\1\52\1\27" + "\1\24\1\27\1\51\1\53\1\24\1\27\4\24\2\27" + "\1\24\3\51\1\24\1\51\1\24\1\33\2\24\1\34" + "\1\35\1\24\1\37\11\51\1\45\4\51\1\24\2\51" + "\1\24\1\51\1\24\3\51\11\24\1\27\1\24\1\27" + "\1\24\1\43\1\24\1\27\4\24\2\27\7\24\1\33" + "\2\24\1\34\1\35\1\24\1\37\11\24\1\45\4\24" + "\1\54\17\24\1\55\1\56\1\27\1\24\1\27\1\55" + "\1\57\1\24\1\27\4\24\2\27\1\24\3\55\1\24" + "\1\55\1\24\1\33\2\24\1\34\1\35\1\24\1\37"
-				+ "\11\55\1\24\4\55\1\24\2\55\1\24\1\55\1\24" + "\3\55\11\24\1\27\1\24\1\27\1\24\1\43\1\24" + "\1\27\4\24\2\27\7\24\1\33\2\24\1\34\1\35" + "\1\24\1\37\16\24\1\60\2\24\1\61\14\24\1\62" + "\1\63\1\27\1\24\1\27\1\62\1\64\1\24\1\27" + "\4\24\2\27\1\24\3\62\1\24\1\62\1\24\1\33" + "\2\24\1\34\1\35\1\24\1\37\11\62\1\24\4\62" + "\1\24\2\62\1\65\1\62\1\66\3\62\11\24\1\27" + "\1\24\1\27\1\24\1\43\1\24\1\27\4\24\2\27" + "\7\24\1\33\2\24\1\34\1\35\1\24\1\37\21\24" + "\1\65\16\24\1\67\1\24\1\67\1\24\1\43\1\24" + "\1\67\1\24\1\70\1\31\1\24\2\67\1\32\6\24" + "\1\33\1\24\1\70\1\34\1\35\1\36\1\37\16\24" + "\1\71\2\24\1\65\1\24\1\40\3\24\1\41\6\24" + "\1\72\1\73\1\27\1\24\1\27\1\72\1\74\1\24" + "\1\27\4\24\2\27\1\24\3\72\1\24\1\72\1\24" + "\1\33\2\24\1\34\1\35\1\24\1\37\11\72\1\24" + "\4\72\1\24\2\72\1\24\1\72\1\24\3\72\11\24" + "\1\27\1\24\1\27\1\24\1\43\1\24\1\27\4\24" + "\2\27\7\24\1\33\2\24\1\34\1\35\1\24\1\37" + "\30\24\1\75\1\76\1\77\3\24\1\100\1\101\1\27"
-				+ "\1\102\1\27\1\100\1\103\1\104\1\27\4\24\2\27" + "\1\24\3\100\1\24\1\100\1\24\1\33\2\24\1\34" + "\1\35\1\24\1\37\11\100\1\24\4\100\1\24\2\100" + "\1\24\1\100\1\24\3\100\11\24\1\27\1\24\1\27" + "\1\24\1\43\1\24\1\27\4\24\2\27\7\24\1\33" + "\2\24\1\34\1\35\1\24\1\37\32\24\1\77\3\24" + "\1\105\1\106\1\27\1\24\1\27\1\105\1\107\1\24" + "\1\27\4\24\2\27\1\24\3\105\1\24\1\105\1\24" + "\1\33\2\24\1\34\1\35\1\24\1\37\11\105\1\110" + "\4\105\1\24\2\105\1\24\1\105\1\24\3\105\11\24" + "\1\27\1\24\1\27\1\24\1\43\1\24\1\27\4\24" + "\2\27\7\24\1\33\2\24\1\34\1\35\1\24\1\37" + "\11\24\1\110\11\24\1\111\11\24\1\112\1\113\1\114" + "\1\27\1\115\1\27\1\113\1\116\1\117\1\27\1\120" + "\1\121\1\122\1\24\2\27\1\123\1\124\2\113\1\24" + "\1\113\1\24\1\33\1\125\1\24\1\34\1\126\1\24" + "\1\37\11\113\1\110\4\113\1\127\2\113\1\24\1\113" + "\1\24\3\113\6\24\1\112\1\113\1\114\1\130\1\115" + "\1\130\1\113\1\116\1\117\1\130\1\120\1\121\1\122" + "\1\24\2\130\1\123\1\124\2\113\1\24\1\113\1\24"
-				+ "\1\33\1\125\1\24\1\34\1\126\1\24\1\37\11\113" + "\1\110\4\113\1\127\2\113\1\24\1\113\1\24\3\113" + "\5\24\74\0\2\25\1\131\3\0\2\25\11\0\3\25" + "\1\0\1\25\10\0\11\25\1\0\4\25\1\0\2\25" + "\1\0\1\25\1\0\3\25\6\0\1\132\2\25\1\0" + "\2\25\1\132\2\25\1\0\4\25\2\0\16\25\1\132" + "\2\25\1\132\2\25\1\132\10\25\1\132\4\25\1\132" + "\7\25\4\0\1\27\1\0\1\27\3\0\1\27\4\0" + "\2\27\54\0\1\25\1\131\3\0\1\25\1\133\11\0" + "\3\25\1\0\1\25\10\0\11\25\1\0\4\25\1\0" + "\2\25\1\0\1\25\1\0\3\25\6\0\2\134\1\135" + "\3\0\2\134\11\0\3\134\1\0\1\134\10\0\11\134" + "\1\0\4\134\1\0\2\134\1\0\1\134\1\0\3\134" + "\6\0\2\136\1\137\3\0\2\136\11\0\3\136\1\0" + "\1\136\10\0\11\136\1\0\4\136\1\0\2\136\1\0" + "\1\136\1\0\3\136\36\0\1\140\76\0\1\141\74\0" + "\2\142\10\0\1\143\1\144\1\145\7\0\2\146\10\0" + "\1\147\1\150\3\0\1\147\1\151\11\0\3\147\1\0" + "\1\147\10\0\11\147\1\0\4\147\1\0\2\147\1\0" + "\1\147\1\0\3\147\6\0\2\152\1\153\1\0\1\154" + "\11\152\2\0\52\152\10\0\1\133\63\0\2\155\1\156"
-				+ "\1\0\4\155\1\154\5\155\2\0\52\155\1\0\2\157" + "\1\160\1\0\1\161\11\157\2\0\52\157\1\0\2\162" + "\1\163\1\0\4\162\1\161\5\162\2\0\52\162\23\0" + "\1\164\50\0\2\51\1\165\3\0\2\51\11\0\3\51" + "\1\0\1\51\10\0\11\51\1\0\4\51\1\0\2\51" + "\1\0\1\51\1\0\3\51\6\0\1\166\2\51\1\0" + "\2\51\1\166\2\51\1\0\4\51\2\0\16\51\1\166" + "\2\51\1\166\2\51\1\166\10\51\1\166\4\51\1\166" + "\7\51\2\0\1\51\1\165\3\0\1\51\1\133\11\0" + "\3\51\1\0\1\51\10\0\11\51\1\0\4\51\1\0" + "\2\51\1\0\1\51\1\0\3\51\6\0\2\55\1\167" + "\3\0\2\55\11\0\3\55\1\0\1\55\10\0\11\55" + "\1\0\4\55\1\0\2\55\1\0\1\55\1\0\3\55" + "\6\0\1\170\2\55\1\0\2\55\1\170\2\55\1\0" + "\4\55\2\0\16\55\1\170\2\55\1\170\2\55\1\170" + "\10\55\1\170\4\55\1\170\7\55\2\0\1\55\1\167" + "\3\0\1\55\1\133\11\0\3\55\1\0\1\55\10\0" + "\11\55\1\0\4\55\1\0\2\55\1\0\1\55\1\0" + "\3\55\6\0\2\62\1\171\3\0\2\62\11\0\3\62" + "\1\0\1\62\10\0\11\62\1\0\4\62\1\0\2\62" + "\1\0\1\62\1\0\3\62\6\0\1\172\2\62\1\0"
-				+ "\2\62\1\172\2\62\1\0\4\62\2\0\16\62\1\172" + "\2\62\1\172\2\62\1\172\10\62\1\172\4\62\1\172" + "\7\62\2\0\1\62\1\171\3\0\1\62\1\133\11\0" + "\3\62\1\0\1\62\10\0\11\62\1\0\4\62\1\0" + "\2\62\1\0\1\62\1\0\3\62\7\0\1\62\1\171" + "\3\0\1\62\1\173\11\0\3\62\1\0\1\62\10\0" + "\11\62\1\0\4\62\1\0\2\62\1\0\1\62\1\0" + "\3\62\5\0\4\174\1\175\1\174\1\175\3\174\1\175" + "\1\174\1\0\2\174\2\175\11\174\1\0\25\174\1\0" + "\12\174\1\0\2\72\1\176\3\0\2\72\11\0\3\72" + "\1\0\1\72\10\0\11\72\1\0\4\72\1\0\2\72" + "\1\0\1\72\1\0\3\72\6\0\1\177\2\72\1\0" + "\2\72\1\177\2\72\1\0\4\72\2\0\16\72\1\177" + "\2\72\1\177\2\72\1\177\10\72\1\177\4\72\1\177" + "\7\72\2\0\1\72\1\176\3\0\1\72\1\133\11\0" + "\3\72\1\0\1\72\10\0\11\72\1\0\4\72\1\0" + "\2\72\1\0\1\72\1\0\3\72\74\0\1\75\4\0" + "\2\100\1\200\3\0\2\100\11\0\3\100\1\0\1\100" + "\10\0\11\100\1\0\4\100\1\0\2\100\1\0\1\100" + "\1\0\3\100\6\0\1\201\2\100\1\0\2\100\1\201" + "\2\100\1\0\4\100\2\0\16\100\1\201\2\100\1\201"
-				+ "\2\100\1\201\10\100\1\201\4\100\1\201\7\100\1\0" + "\2\202\1\203\1\0\1\204\11\202\2\0\52\202\2\0" + "\1\100\1\200\3\0\1\100\1\133\11\0\3\100\1\0" + "\1\100\10\0\11\100\1\0\4\100\1\0\2\100\1\0" + "\1\100\1\0\3\100\6\0\2\205\1\206\1\0\4\205" + "\1\204\5\205\2\0\52\205\1\0\2\105\1\207\3\0" + "\2\105\11\0\3\105\1\0\1\105\10\0\11\105\1\0" + "\4\105\1\0\2\105\1\0\1\105\1\0\3\105\6\0" + "\1\210\2\105\1\0\2\105\1\210\2\105\1\0\4\105" + "\2\0\16\105\1\210\2\105\1\210\2\105\1\210\10\105" + "\1\210\4\105\1\210\7\105\2\0\1\105\1\207\3\0" + "\1\105\1\133\11\0\3\105\1\0\1\105\10\0\11\105" + "\1\0\4\105\1\0\2\105\1\0\1\105\1\0\3\105" + "\6\0\1\112\1\211\1\212\3\0\1\211\1\213\4\0" + "\1\214\4\0\3\211\1\0\1\211\10\0\11\211\1\0" + "\4\211\1\0\2\211\1\0\1\211\1\0\3\211\4\0" + "\1\215\1\0\2\113\1\216\3\0\2\113\11\0\3\113" + "\1\217\1\113\10\0\11\113\1\0\4\113\1\0\2\113" + "\1\0\1\113\1\0\3\113\6\0\1\220\2\113\1\0" + "\2\113\1\220\2\113\1\0\4\113\2\0\16\113\1\220"
-				+ "\2\113\1\220\2\113\1\220\10\113\1\220\4\113\1\220" + "\7\113\1\0\2\221\1\222\1\0\1\223\11\221\2\0" + "\52\221\1\0\1\112\1\113\1\216\3\0\1\113\1\133" + "\4\0\1\214\4\0\3\113\1\0\1\113\10\0\11\113" + "\1\0\4\113\1\0\2\113\1\0\1\113\1\0\3\113" + "\6\0\2\224\1\225\1\0\4\224\1\223\5\224\2\0" + "\52\224\1\0\1\112\13\0\1\214\56\0\1\226\72\0" + "\2\227\1\230\3\0\2\227\11\0\3\227\1\0\1\227" + "\10\0\11\227\1\0\4\227\1\0\2\227\1\0\1\227" + "\1\0\3\227\6\0\2\113\1\216\3\0\2\113\3\0" + "\1\231\5\0\1\113\1\232\1\113\1\217\1\113\10\0" + "\11\113\1\0\4\113\1\0\2\113\1\0\1\113\1\0" + "\3\113\11\0\1\233\1\0\1\233\3\0\1\233\4\0" + "\2\233\30\0\1\234\21\0\4\235\1\236\1\235\1\236" + "\3\235\1\236\4\235\2\236\12\235\1\0\14\235\1\0" + "\22\235\1\0\1\237\1\25\1\131\1\25\1\0\1\25" + "\1\237\1\25\1\0\1\25\4\0\2\25\1\0\3\25" + "\1\0\1\25\10\0\1\237\2\25\1\237\2\25\1\237" + "\2\25\1\0\4\25\1\0\1\237\1\25\1\0\1\25" + "\1\0\1\237\2\25\37\0\1\240\41\0\1\241\2\134"
-				+ "\1\0\2\134\1\241\2\134\1\0\4\134\2\0\16\134" + "\1\241\2\134\1\241\2\134\1\241\10\134\1\241\4\134" + "\1\241\7\134\1\0\1\242\2\136\1\0\2\136\1\242" + "\2\136\1\0\4\136\2\0\16\136\1\242\2\136\1\242" + "\2\136\1\242\10\136\1\242\4\136\1\242\7\136\10\0" + "\1\243\62\0\35\141\1\244\35\141\41\0\1\245\103\0" + "\1\246\65\0\2\247\66\0\2\250\103\0\1\251\17\0" + "\2\147\1\150\3\0\2\147\11\0\3\147\1\252\1\147" + "\10\0\11\147\1\0\4\147\1\0\2\147\1\0\1\147" + "\1\0\3\147\6\0\1\253\2\147\1\0\2\147\1\253" + "\2\147\1\0\4\147\2\0\16\147\1\253\2\147\1\253" + "\2\147\1\253\10\147\1\253\4\147\1\253\7\147\2\0" + "\1\147\1\150\3\0\1\147\12\0\3\147\1\0\1\147" + "\10\0\11\147\1\0\4\147\1\0\2\147\1\0\1\147" + "\1\0\3\147\6\0\1\254\1\152\1\153\1\152\1\255" + "\1\152\1\254\10\152\1\256\16\152\1\254\2\152\1\254" + "\2\152\1\254\10\152\1\254\4\152\1\254\7\152\1\0" + "\1\257\1\155\1\156\3\155\1\257\1\155\1\260\6\155" + "\1\261\16\155\1\257\2\155\1\257\2\155\1\257\10\155"
-				+ "\1\257\4\155\1\257\7\155\1\0\1\262\1\157\1\160" + "\1\157\1\263\1\157\1\262\10\157\1\264\16\157\1\262" + "\2\157\1\262\2\157\1\262\10\157\1\262\4\157\1\262" + "\7\157\1\0\1\265\1\162\1\163\3\162\1\265\1\162" + "\1\266\6\162\1\267\16\162\1\265\2\162\1\265\2\162" + "\1\265\10\162\1\265\4\162\1\265\7\162\24\0\1\270" + "\47\0\1\271\1\51\1\165\1\51\1\0\1\51\1\271" + "\1\51\1\0\1\51\4\0\2\51\1\0\3\51\1\0" + "\1\51\10\0\1\271\2\51\1\271\2\51\1\271\2\51" + "\1\0\4\51\1\0\1\271\1\51\1\0\1\51\1\0" + "\1\271\2\51\6\0\1\272\1\55\1\167\1\55\1\0" + "\1\55\1\272\1\55\1\0\1\55\4\0\2\55\1\0" + "\3\55\1\0\1\55\10\0\1\272\2\55\1\272\2\55" + "\1\272\2\55\1\0\4\55\1\0\1\272\1\55\1\0" + "\1\55\1\0\1\272\2\55\6\0\1\273\1\62\1\171" + "\1\62\1\0\1\62\1\273\1\62\1\0\1\62\4\0" + "\2\62\1\0\3\62\1\0\1\62\10\0\1\273\2\62" + "\1\273\2\62\1\273\2\62\1\0\4\62\1\0\1\273" + "\1\62\1\0\1\62\1\0\1\273\2\62\7\0\1\62" + "\1\171\3\0\1\62\12\0\3\62\1\0\1\62\10\0" + "\11\62\1\0\4\62\1\0\2\62\1\0\1\62\1\0"
-				+ "\3\62\6\0\1\274\1\72\1\176\1\72\1\0\1\72" + "\1\274\1\72\1\0\1\72\4\0\2\72\1\0\3\72" + "\1\0\1\72\10\0\1\274\2\72\1\274\2\72\1\274" + "\2\72\1\0\4\72\1\0\1\274\1\72\1\0\1\72" + "\1\0\1\274\2\72\6\0\1\275\1\100\1\200\1\100" + "\1\0\1\100\1\275\1\100\1\0\1\100\4\0\2\100" + "\1\0\3\100\1\0\1\100\10\0\1\275\2\100\1\275" + "\2\100\1\275\2\100\1\0\4\100\1\0\1\275\1\100" + "\1\0\1\100\1\0\1\275\2\100\6\0\1\276\1\202" + "\1\203\1\202\1\277\1\202\1\276\10\202\1\300\16\202" + "\1\276\2\202\1\276\2\202\1\276\10\202\1\276\4\202" + "\1\276\7\202\1\0\1\301\1\205\1\206\3\205\1\301" + "\1\205\1\302\6\205\1\303\16\205\1\301\2\205\1\301" + "\2\205\1\301\10\205\1\301\4\205\1\301\7\205\1\0" + "\1\304\1\105\1\207\1\105\1\0\1\105\1\304\1\105" + "\1\0\1\105\4\0\2\105\1\0\3\105\1\0\1\105" + "\10\0\1\304\2\105\1\304\2\105\1\304\2\105\1\0" + "\4\105\1\0\1\304\1\105\1\0\1\105\1\0\1\304" + "\2\105\6\0\2\211\1\212\3\0\2\211\11\0\3\211" + "\1\0\1\211\10\0\11\211\1\0\4\211\1\0\2\211"
-				+ "\1\0\1\211\1\0\3\211\6\0\1\305\2\211\1\0" + "\2\211\1\305\2\211\1\0\4\211\2\0\16\211\1\305" + "\2\211\1\305\2\211\1\305\10\211\1\305\4\211\1\305" + "\7\211\2\0\1\211\1\212\3\0\1\211\12\0\3\211" + "\1\0\1\211\10\0\11\211\1\0\4\211\1\0\2\211" + "\1\0\1\211\1\0\3\211\6\0\1\306\1\113\1\216" + "\1\113\1\0\1\113\1\306\1\113\1\0\1\113\4\0" + "\2\113\1\0\3\113\1\217\1\113\10\0\1\306\2\113" + "\1\306\2\113\1\306\2\113\1\0\4\113\1\0\1\306" + "\1\113\1\0\1\113\1\0\1\306\2\113\6\0\1\307" + "\1\221\1\222\1\221\1\310\1\221\1\307\10\221\1\311" + "\16\221\1\307\2\221\1\307\2\221\1\307\10\221\1\307" + "\4\221\1\307\7\221\1\0\1\312\1\224\1\225\3\224" + "\1\312\1\224\1\313\6\224\1\314\16\224\1\312\2\224" + "\1\312\2\224\1\312\10\224\1\312\4\224\1\312\7\224" + "\1\0\1\226\1\211\1\212\3\0\1\211\1\213\11\0" + "\3\211\1\0\1\211\10\0\11\211\1\0\4\211\1\0" + "\2\211\1\0\1\211\1\0\3\211\4\0\1\215\1\0" + "\1\315\2\227\1\0\2\227\1\315\2\227\1\0\4\227"
-				+ "\2\0\16\227\1\315\2\227\1\315\2\227\1\315\10\227" + "\1\315\4\227\1\315\7\227\1\0\1\316\5\0\1\316" + "\16\0\2\316\7\0\2\316\1\0\2\316\1\0\2\316" + "\7\0\2\316\3\0\2\316\7\0\2\113\1\216\3\0" + "\2\113\11\0\2\113\1\317\1\217\1\113\10\0\11\113" + "\1\0\4\113\1\0\2\113\1\0\1\113\1\0\3\113" + "\57\0\1\320\21\0\1\321\1\25\1\131\1\25\1\0" + "\1\25\1\321\1\25\1\0\1\25\4\0\2\25\1\0" + "\3\25\1\0\1\25\10\0\1\321\2\25\1\321\2\25" + "\1\321\2\25\1\0\4\25\1\0\1\321\1\25\1\0" + "\1\25\1\0\1\321\2\25\6\0\1\322\1\134\1\135" + "\1\134\1\0\1\134\1\322\1\134\1\0\1\134\4\0" + "\2\134\1\0\3\134\1\0\1\134\10\0\1\322\2\134" + "\1\322\2\134\1\322\2\134\1\0\4\134\1\0\1\322" + "\1\134\1\0\1\134\1\0\1\322\2\134\6\0\1\323" + "\1\136\1\137\1\136\1\0\1\136\1\323\1\136\1\0" + "\1\136\4\0\2\136\1\0\3\136\1\0\1\136\10\0" + "\1\323\2\136\1\323\2\136\1\323\2\136\1\0\4\136" + "\1\0\1\323\1\136\1\0\1\136\1\0\1\323\2\136" + "\15\0\1\324\62\0\34\141\1\325\1\244\35\141\42\0"
-				+ "\2\326\102\0\1\327\75\0\2\330\74\0\1\331\76\0" + "\1\332\7\0\1\333\1\334\1\252\1\0\1\252\1\333" + "\1\335\1\0\1\252\4\0\2\252\1\0\3\333\1\0" + "\1\333\10\0\11\333\1\0\4\333\1\0\2\333\1\0" + "\1\333\1\0\3\333\6\0\1\336\1\147\1\150\1\147" + "\1\0\1\147\1\336\1\147\1\0\1\147\4\0\2\147" + "\1\0\3\147\1\252\1\147\10\0\1\336\2\147\1\336" + "\2\147\1\336\2\147\1\0\4\147\1\0\1\336\1\147" + "\1\0\1\147\1\0\1\336\2\147\6\0\1\337\1\152" + "\1\153\1\152\1\154\1\152\1\337\27\152\1\337\2\152" + "\1\337\2\152\1\337\10\152\1\337\4\152\1\337\7\152" + "\1\0\2\152\1\153\1\0\1\154\12\152\1\0\52\152" + "\1\0\1\340\1\155\1\156\3\155\1\340\1\155\1\154" + "\25\155\1\340\2\155\1\340\2\155\1\340\10\155\1\340" + "\4\155\1\340\7\155\1\0\2\155\1\156\1\0\4\155" + "\1\154\6\155\1\0\52\155\1\0\1\341\1\157\1\160" + "\1\157\1\161\1\157\1\341\27\157\1\341\2\157\1\341" + "\2\157\1\341\10\157\1\341\4\157\1\341\7\157\1\0" + "\2\157\1\160\1\0\1\161\12\157\1\0\52\157\1\0"
-				+ "\1\342\1\162\1\163\3\162\1\342\1\162\1\161\25\162" + "\1\342\2\162\1\342\2\162\1\342\10\162\1\342\4\162" + "\1\342\7\162\1\0\2\162\1\163\1\0\4\162\1\161" + "\6\162\1\0\52\162\25\0\1\343\46\0\1\344\1\51" + "\1\165\1\51\1\0\1\51\1\344\1\51\1\0\1\51" + "\4\0\2\51\1\0\3\51\1\0\1\51\10\0\1\344" + "\2\51\1\344\2\51\1\344\2\51\1\0\4\51\1\0" + "\1\344\1\51\1\0\1\51\1\0\1\344\2\51\6\0" + "\1\345\1\55\1\167\1\55\1\0\1\55\1\345\1\55" + "\1\0\1\55\4\0\2\55\1\0\3\55\1\0\1\55" + "\10\0\1\345\2\55\1\345\2\55\1\345\2\55\1\0" + "\4\55\1\0\1\345\1\55\1\0\1\55\1\0\1\345" + "\2\55\6\0\1\346\1\62\1\171\1\62\1\0\1\62" + "\1\346\1\62\1\0\1\62\4\0\2\62\1\0\3\62" + "\1\0\1\62\10\0\1\346\2\62\1\346\2\62\1\346" + "\2\62\1\0\4\62\1\0\1\346\1\62\1\0\1\62" + "\1\0\1\346\2\62\6\0\1\347\1\72\1\176\1\72" + "\1\0\1\72\1\347\1\72\1\0\1\72\4\0\2\72" + "\1\0\3\72\1\0\1\72\10\0\1\347\2\72\1\347" + "\2\72\1\347\2\72\1\0\4\72\1\0\1\347\1\72" + "\1\0\1\72\1\0\1\347\2\72\6\0\1\350\1\100"
-				+ "\1\200\1\100\1\0\1\100\1\350\1\100\1\0\1\100" + "\4\0\2\100\1\0\3\100\1\0\1\100\10\0\1\350" + "\2\100\1\350\2\100\1\350\2\100\1\0\4\100\1\0" + "\1\350\1\100\1\0\1\100\1\0\1\350\2\100\6\0" + "\1\351\1\202\1\203\1\202\1\204\1\202\1\351\27\202" + "\1\351\2\202\1\351\2\202\1\351\10\202\1\351\4\202" + "\1\351\7\202\1\0\2\202\1\203\1\0\1\204\12\202" + "\1\0\52\202\1\0\1\352\1\205\1\206\3\205\1\352" + "\1\205\1\204\25\205\1\352\2\205\1\352\2\205\1\352" + "\10\205\1\352\4\205\1\352\7\205\1\0\2\205\1\206" + "\1\0\4\205\1\204\6\205\1\0\52\205\1\0\1\353" + "\1\105\1\207\1\105\1\0\1\105\1\353\1\105\1\0" + "\1\105\4\0\2\105\1\0\3\105\1\0\1\105\10\0" + "\1\353\2\105\1\353\2\105\1\353\2\105\1\0\4\105" + "\1\0\1\353\1\105\1\0\1\105\1\0\1\353\2\105" + "\6\0\1\354\1\211\1\212\1\211\1\0\1\211\1\354" + "\1\211\1\0\1\211\4\0\2\211\1\0\3\211\1\0" + "\1\211\10\0\1\354\2\211\1\354\2\211\1\354\2\211" + "\1\0\4\211\1\0\1\354\1\211\1\0\1\211\1\0"
-				+ "\1\354\2\211\6\0\1\355\1\113\1\216\1\113\1\0" + "\1\113\1\355\1\113\1\0\1\113\4\0\2\113\1\0" + "\3\113\1\217\1\113\10\0\1\355\2\113\1\355\2\113" + "\1\355\2\113\1\0\4\113\1\0\1\355\1\113\1\0" + "\1\113\1\0\1\355\2\113\6\0\1\356\1\221\1\222" + "\1\221\1\223\1\221\1\356\27\221\1\356\2\221\1\356" + "\2\221\1\356\10\221\1\356\4\221\1\356\7\221\1\0" + "\2\221\1\222\1\0\1\223\12\221\1\0\52\221\1\0" + "\1\357\1\224\1\225\3\224\1\357\1\224\1\223\25\224" + "\1\357\2\224\1\357\2\224\1\357\10\224\1\357\4\224" + "\1\357\7\224\1\0\2\224\1\225\1\0\4\224\1\223" + "\6\224\1\0\52\224\1\0\1\360\1\227\1\230\1\227" + "\1\0\1\227\1\360\1\227\1\0\1\227\4\0\2\227" + "\1\0\3\227\1\0\1\227\10\0\1\360\2\227\1\360" + "\2\227\1\360\2\227\1\0\4\227\1\0\1\360\1\227" + "\1\0\1\227\1\0\1\360\2\227\6\0\1\361\5\0" + "\1\361\1\362\15\0\2\361\7\0\2\361\1\0\2\361" + "\1\0\2\361\7\0\2\361\3\0\2\361\7\0\2\113" + "\1\216\3\0\2\113\11\0\3\113\1\363\1\113\10\0" + "\11\113\1\0\4\113\1\0\2\113\1\0\1\113\1\0"
-				+ "\3\113\60\0\1\364\20\0\1\365\1\25\1\131\1\25" + "\1\0\1\25\1\365\1\25\1\0\1\25\4\0\2\25" + "\1\0\3\25\1\0\1\25\10\0\1\365\2\25\1\365" + "\2\25\1\365\2\25\1\0\4\25\1\0\1\365\1\25" + "\1\0\1\25\1\0\1\365\2\25\6\0\1\366\1\134" + "\1\135\1\134\1\0\1\134\1\366\1\134\1\0\1\134" + "\4\0\2\134\1\0\3\134\1\0\1\134\10\0\1\366" + "\2\134\1\366\2\134\1\366\2\134\1\0\4\134\1\0" + "\1\366\1\134\1\0\1\134\1\0\1\366\2\134\6\0" + "\1\367\1\136\1\137\1\136\1\0\1\136\1\367\1\136" + "\1\0\1\136\4\0\2\136\1\0\3\136\1\0\1\136" + "\10\0\1\367\2\136\1\367\2\136\1\367\2\136\1\0" + "\4\136\1\0\1\367\1\136\1\0\1\136\1\0\1\367" + "\2\136\30\0\1\370\123\0\1\371\67\0\1\372\66\0" + "\2\373\73\0\1\374\24\0\2\333\1\334\1\375\1\0" + "\1\375\2\333\1\0\1\375\1\376\3\0\2\375\1\0" + "\3\333\1\0\1\333\10\0\11\333\1\0\4\333\1\0" + "\2\333\1\0\1\333\1\0\3\333\6\0\1\377\2\333" + "\1\0\2\333\1\377\2\333\1\0\4\333\2\0\16\333" + "\1\377\2\333\1\377\2\333\1\377\10\333\1\377\4\333"
-				+ "\1\377\7\333\2\0\1\333\1\334\3\0\1\333\12\0" + "\3\333\1\0\1\333\10\0\11\333\1\0\4\333\1\0" + "\2\333\1\0\1\333\1\0\3\333\6\0\1\u0100\1\147" + "\1\150\1\147\1\0\1\147\1\u0100\1\147\1\0\1\147" + "\4\0\2\147\1\0\3\147\1\252\1\147\10\0\1\u0100" + "\2\147\1\u0100\2\147\1\u0100\2\147\1\0\4\147\1\0" + "\1\u0100\1\147\1\0\1\147\1\0\1\u0100\2\147\6\0" + "\1\u0101\1\152\1\153\1\152\1\154\1\152\1\u0101\27\152" + "\1\u0101\2\152\1\u0101\2\152\1\u0101\10\152\1\u0101\4\152" + "\1\u0101\7\152\1\0\1\u0102\1\155\1\156\3\155\1\u0102" + "\1\155\1\154\25\155\1\u0102\2\155\1\u0102\2\155\1\u0102" + "\10\155\1\u0102\4\155\1\u0102\7\155\1\0\1\u0103\1\157" + "\1\160\1\157\1\161\1\157\1\u0103\27\157\1\u0103\2\157" + "\1\u0103\2\157\1\u0103\10\157\1\u0103\4\157\1\u0103\7\157" + "\1\0\1\u0104\1\162\1\163\3\162\1\u0104\1\162\1\161" + "\25\162\1\u0104\2\162\1\u0104\2\162\1\u0104\10\162\1\u0104" + "\4\162\1\u0104\7\162\1\0\2\u0105\1\u0106\1\343\1\u0107"
-				+ "\1\343\2\u0105\1\u0108\1\343\1\u0109\3\u0105\2\343\4\u0105" + "\1\0\45\u0105\1\0\1\u010a\1\51\1\165\1\51\1\0" + "\1\51\1\u010a\1\51\1\0\1\51\4\0\2\51\1\0" + "\3\51\1\0\1\51\10\0\1\u010a\2\51\1\u010a\2\51" + "\1\u010a\2\51\1\0\4\51\1\0\1\u010a\1\51\1\0" + "\1\51\1\0\1\u010a\2\51\6\0\1\u010b\1\55\1\167" + "\1\55\1\0\1\55\1\u010b\1\55\1\0\1\55\4\0" + "\2\55\1\0\3\55\1\0\1\55\10\0\1\u010b\2\55" + "\1\u010b\2\55\1\u010b\2\55\1\0\4\55\1\0\1\u010b" + "\1\55\1\0\1\55\1\0\1\u010b\2\55\6\0\1\u010c" + "\1\62\1\171\1\62\1\0\1\62\1\u010c\1\62\1\0" + "\1\62\4\0\2\62\1\0\3\62\1\0\1\62\10\0" + "\1\u010c\2\62\1\u010c\2\62\1\u010c\2\62\1\0\4\62" + "\1\0\1\u010c\1\62\1\0\1\62\1\0\1\u010c\2\62" + "\6\0\1\u010d\1\72\1\176\1\72\1\0\1\72\1\u010d" + "\1\72\1\0\1\72\4\0\2\72\1\0\3\72\1\0" + "\1\72\10\0\1\u010d\2\72\1\u010d\2\72\1\u010d\2\72" + "\1\0\4\72\1\0\1\u010d\1\72\1\0\1\72\1\0" + "\1\u010d\2\72\6\0\1\u010e\1\100\1\200\1\100\1\0" + "\1\100\1\u010e\1\100\1\0\1\100\4\0\2\100\1\0"
-				+ "\3\100\1\0\1\100\10\0\1\u010e\2\100\1\u010e\2\100" + "\1\u010e\2\100\1\0\4\100\1\0\1\u010e\1\100\1\0" + "\1\100\1\0\1\u010e\2\100\6\0\1\u010f\1\202\1\203" + "\1\202\1\204\1\202\1\u010f\27\202\1\u010f\2\202\1\u010f" + "\2\202\1\u010f\10\202\1\u010f\4\202\1\u010f\7\202\1\0" + "\1\u0110\1\205\1\206\3\205\1\u0110\1\205\1\204\25\205" + "\1\u0110\2\205\1\u0110\2\205\1\u0110\10\205\1\u0110\4\205" + "\1\u0110\7\205\1\0\1\u0111\1\105\1\207\1\105\1\0" + "\1\105\1\u0111\1\105\1\0\1\105\4\0\2\105\1\0" + "\3\105\1\0\1\105\10\0\1\u0111\2\105\1\u0111\2\105" + "\1\u0111\2\105\1\0\4\105\1\0\1\u0111\1\105\1\0" + "\1\105\1\0\1\u0111\2\105\6\0\1\u0112\1\211\1\212" + "\1\211\1\0\1\211\1\u0112\1\211\1\0\1\211\4\0" + "\2\211\1\0\3\211\1\0\1\211\10\0\1\u0112\2\211" + "\1\u0112\2\211\1\u0112\2\211\1\0\4\211\1\0\1\u0112" + "\1\211\1\0\1\211\1\0\1\u0112\2\211\6\0\1\u0113" + "\1\113\1\216\1\113\1\0\1\113\1\u0113\1\113\1\0" + "\1\113\4\0\2\113\1\0\3\113\1\217\1\113\10\0"
-				+ "\1\u0113\2\113\1\u0113\2\113\1\u0113\2\113\1\0\4\113" + "\1\0\1\u0113\1\113\1\0\1\113\1\0\1\u0113\2\113" + "\6\0\1\u0114\1\221\1\222\1\221\1\223\1\221\1\u0114" + "\27\221\1\u0114\2\221\1\u0114\2\221\1\u0114\10\221\1\u0114" + "\4\221\1\u0114\7\221\1\0\1\u0115\1\224\1\225\3\224" + "\1\u0115\1\224\1\223\25\224\1\u0115\2\224\1\u0115\2\224" + "\1\u0115\10\224\1\u0115\4\224\1\u0115\7\224\1\0\1\u0116" + "\1\227\1\230\1\227\1\0\1\227\1\u0116\1\227\1\0" + "\1\227\4\0\2\227\1\0\3\227\1\0\1\227\10\0" + "\1\u0116\2\227\1\u0116\2\227\1\u0116\2\227\1\0\4\227" + "\1\0\1\u0116\1\227\1\0\1\227\1\0\1\u0116\2\227" + "\6\0\1\u0117\5\0\1\u0117\1\362\15\0\2\u0117\7\0" + "\2\u0117\1\0\2\u0117\1\0\2\u0117\7\0\2\u0117\3\0" + "\2\u0117\7\0\1\u0118\5\0\1\u0118\16\0\2\u0118\7\0" + "\2\u0118\1\0\2\u0118\1\0\2\u0118\7\0\2\u0118\3\0" + "\2\u0118\7\0\2\u0119\1\u011a\1\u011b\1\u011c\1\u011b\2\u0119" + "\1\u011d\1\u011b\1\u011e\3\u0119\2\u011b\4\u0119\1\0\45\u0119"
-				+ "\54\0\1\u011f\17\0\1\u0120\1\25\1\131\1\25\1\0" + "\1\25\1\u0120\1\25\1\0\1\25\4\0\2\25\1\0" + "\3\25\1\0\1\25\10\0\1\u0120\2\25\1\u0120\2\25" + "\1\u0120\2\25\1\0\4\25\1\0\1\u0120\1\25\1\0" + "\1\25\1\0\1\u0120\2\25\6\0\1\u0121\1\134\1\135" + "\1\134\1\0\1\134\1\u0121\1\134\1\0\1\134\4\0" + "\2\134\1\0\3\134\1\0\1\134\10\0\1\u0121\2\134" + "\1\u0121\2\134\1\u0121\2\134\1\0\4\134\1\0\1\u0121" + "\1\134\1\0\1\134\1\0\1\u0121\2\134\6\0\1\u0122" + "\1\136\1\137\1\136\1\0\1\136\1\u0122\1\136\1\0" + "\1\136\4\0\2\136\1\0\3\136\1\0\1\136\10\0" + "\1\u0122\2\136\1\u0122\2\136\1\u0122\2\136\1\0\4\136" + "\1\0\1\u0122\1\136\1\0\1\136\1\0\1\u0122\2\136" + "\51\0\1\u0123\51\0\1\u0124\111\0\2\u0125\37\0\1\u0126" + "\66\0\1\375\1\0\1\375\3\0\1\375\1\376\3\0" + "\2\375\53\0\1\u0127\1\333\1\334\1\333\1\0\1\333" + "\1\u0127\1\333\1\0\1\333\1\376\3\0\2\333\1\0" + "\3\333\1\0\1\333\10\0\1\u0127\2\333\1\u0127\2\333" + "\1\u0127\2\333\1\0\4\333\1\0\1\u0127\1\333\1\0"
-				+ "\1\333\1\0\1\u0127\2\333\6\0\1\u0128\1\147\1\150" + "\1\147\1\0\1\147\1\u0128\1\147\1\0\1\147\4\0" + "\2\147\1\0\3\147\1\252\1\147\10\0\1\u0128\2\147" + "\1\u0128\2\147\1\u0128\2\147\1\0\4\147\1\0\1\u0128" + "\1\147\1\0\1\147\1\0\1\u0128\2\147\6\0\1\u0129" + "\1\152\1\153\1\152\1\154\1\152\1\u0129\27\152\1\u0129" + "\2\152\1\u0129\2\152\1\u0129\10\152\1\u0129\4\152\1\u0129" + "\7\152\1\0\1\u012a\1\155\1\156\3\155\1\u012a\1\155" + "\1\154\25\155\1\u012a\2\155\1\u012a\2\155\1\u012a\10\155" + "\1\u012a\4\155\1\u012a\7\155\1\0\1\u012b\1\157\1\160" + "\1\157\1\161\1\157\1\u012b\27\157\1\u012b\2\157\1\u012b" + "\2\157\1\u012b\10\157\1\u012b\4\157\1\u012b\7\157\1\0" + "\1\u012c\1\162\1\163\3\162\1\u012c\1\162\1\161\25\162" + "\1\u012c\2\162\1\u012c\2\162\1\u012c\10\162\1\u012c\4\162" + "\1\u012c\7\162\1\0\2\u0105\1\u0106\1\u012d\1\0\3\u0105" + "\1\0\1\u012d\1\u0109\3\u0105\2\u012d\4\u0105\1\0\45\u0105" + "\1\0\1\u012e\1\u0105\1\u0106\1\u012d\2\u0105\1\u012e\2\u0105"
-				+ "\1\u012d\1\u012f\3\u0105\2\u012d\16\u0105\1\u012e\2\u0105\1\u012e" + "\2\u0105\1\u012e\10\u0105\1\u012e\4\u0105\1\u012e\7\u0105\1\0" + "\2\u0107\1\u0130\1\0\1\u012d\11\u0107\2\0\52\u0107\1\0" + "\2\u0108\1\u0131\1\0\4\u0108\1\u012d\5\u0108\2\0\52\u0108" + "\1\0\1\u0132\1\51\1\165\1\51\1\0\1\51\1\u0132" + "\1\51\1\0\1\51\4\0\2\51\1\0\3\51\1\0" + "\1\51\10\0\1\u0132\2\51\1\u0132\2\51\1\u0132\2\51" + "\1\0\4\51\1\0\1\u0132\1\51\1\0\1\51\1\0" + "\1\u0132\2\51\6\0\1\u0133\1\55\1\167\1\55\1\0" + "\1\55\1\u0133\1\55\1\0\1\55\4\0\2\55\1\0" + "\3\55\1\0\1\55\10\0\1\u0133\2\55\1\u0133\2\55" + "\1\u0133\2\55\1\0\4\55\1\0\1\u0133\1\55\1\0" + "\1\55\1\0\1\u0133\2\55\6\0\1\u0134\1\62\1\171" + "\1\62\1\0\1\62\1\u0134\1\62\1\0\1\62\4\0" + "\2\62\1\0\3\62\1\0\1\62\10\0\1\u0134\2\62" + "\1\u0134\2\62\1\u0134\2\62\1\0\4\62\1\0\1\u0134" + "\1\62\1\0\1\62\1\0\1\u0134\2\62\6\0\1\u0135" + "\1\72\1\176\1\72\1\0\1\72\1\u0135\1\72\1\0" + "\1\72\4\0\2\72\1\0\3\72\1\0\1\72\10\0"
-				+ "\1\u0135\2\72\1\u0135\2\72\1\u0135\2\72\1\0\4\72" + "\1\0\1\u0135\1\72\1\0\1\72\1\0\1\u0135\2\72" + "\6\0\1\u0136\1\100\1\200\1\100\1\0\1\100\1\u0136" + "\1\100\1\0\1\100\4\0\2\100\1\0\3\100\1\0" + "\1\100\10\0\1\u0136\2\100\1\u0136\2\100\1\u0136\2\100" + "\1\0\4\100\1\0\1\u0136\1\100\1\0\1\100\1\0" + "\1\u0136\2\100\6\0\1\u0137\1\202\1\203\1\202\1\204" + "\1\202\1\u0137\27\202\1\u0137\2\202\1\u0137\2\202\1\u0137" + "\10\202\1\u0137\4\202\1\u0137\7\202\1\0\1\u0138\1\205" + "\1\206\3\205\1\u0138\1\205\1\204\25\205\1\u0138\2\205" + "\1\u0138\2\205\1\u0138\10\205\1\u0138\4\205\1\u0138\7\205" + "\1\0\1\u0139\1\105\1\207\1\105\1\0\1\105\1\u0139" + "\1\105\1\0\1\105\4\0\2\105\1\0\3\105\1\0" + "\1\105\10\0\1\u0139\2\105\1\u0139\2\105\1\u0139\2\105" + "\1\0\4\105\1\0\1\u0139\1\105\1\0\1\105\1\0" + "\1\u0139\2\105\6\0\1\u013a\1\211\1\212\1\211\1\0" + "\1\211\1\u013a\1\211\1\0\1\211\4\0\2\211\1\0" + "\3\211\1\0\1\211\10\0\1\u013a\2\211\1\u013a\2\211"
-				+ "\1\u013a\2\211\1\0\4\211\1\0\1\u013a\1\211\1\0" + "\1\211\1\0\1\u013a\2\211\6\0\1\u013b\1\113\1\216" + "\1\113\1\0\1\113\1\u013b\1\113\1\0\1\113\4\0" + "\2\113\1\0\3\113\1\217\1\113\10\0\1\u013b\2\113" + "\1\u013b\2\113\1\u013b\2\113\1\0\4\113\1\0\1\u013b" + "\1\113\1\0\1\113\1\0\1\u013b\2\113\6\0\1\u013c" + "\1\221\1\222\1\221\1\223\1\221\1\u013c\27\221\1\u013c" + "\2\221\1\u013c\2\221\1\u013c\10\221\1\u013c\4\221\1\u013c" + "\7\221\1\0\1\u013d\1\224\1\225\3\224\1\u013d\1\224" + "\1\223\25\224\1\u013d\2\224\1\u013d\2\224\1\u013d\10\224" + "\1\u013d\4\224\1\u013d\7\224\1\0\1\u013e\1\227\1\230" + "\1\227\1\0\1\227\1\u013e\1\227\1\0\1\227\4\0" + "\2\227\1\0\3\227\1\0\1\227\10\0\1\u013e\2\227" + "\1\u013e\2\227\1\u013e\2\227\1\0\4\227\1\0\1\u013e" + "\1\227\1\0\1\227\1\0\1\u013e\2\227\6\0\1\u013f" + "\5\0\1\u013f\1\362\15\0\2\u013f\7\0\2\u013f\1\0" + "\2\u013f\1\0\2\u013f\7\0\2\u013f\3\0\2\u013f\7\0" + "\1\u0140\5\0\1\u0140\16\0\2\u0140\7\0\2\u0140\1\0"
-				+ "\2\u0140\1\0\2\u0140\7\0\2\u0140\3\0\2\u0140\7\0" + "\2\u0119\1\u011a\1\u0141\1\0\3\u0119\1\0\1\u0141\1\u011e" + "\3\u0119\2\u0141\4\u0119\1\0\45\u0119\1\0\1\u0142\1\u0119" + "\1\u011a\1\u0141\2\u0119\1\u0142\2\u0119\1\u0141\1\u0143\3\u0119" + "\2\u0141\16\u0119\1\u0142\2\u0119\1\u0142\2\u0119\1\u0142\10\u0119" + "\1\u0142\4\u0119\1\u0142\7\u0119\1\0\2\u011c\1\u0144\1\0" + "\1\u0141\11\u011c\2\0\52\u011c\1\0\2\u011d\1\u0145\1\0" + "\4\u011d\1\u0141\5\u011d\2\0\52\u011d\23\0\1\u0146\50\0" + "\1\u0147\1\25\1\131\1\25\1\0\1\25\1\u0147\1\25" + "\1\0\1\25\4\0\2\25\1\0\3\25\1\0\1\25" + "\10\0\1\u0147\2\25\1\u0147\2\25\1\u0147\2\25\1\0" + "\4\25\1\0\1\u0147\1\25\1\0\1\25\1\0\1\u0147" + "\2\25\6\0\1\u0148\1\134\1\135\1\134\1\0\1\134" + "\1\u0148\1\134\1\0\1\134\4\0\2\134\1\0\3\134" + "\1\0\1\134\10\0\1\u0148\2\134\1\u0148\2\134\1\u0148" + "\2\134\1\0\4\134\1\0\1\u0148\1\134\1\0\1\134" + "\1\0\1\u0148\2\134\6\0\1\u0149\1\136\1\137\1\136"
-				+ "\1\0\1\136\1\u0149\1\136\1\0\1\136\4\0\2\136" + "\1\0\3\136\1\0\1\136\10\0\1\u0149\2\136\1\u0149" + "\2\136\1\u0149\2\136\1\0\4\136\1\0\1\u0149\1\136" + "\1\0\1\136\1\0\1\u0149\2\136\52\0\2\u014a\73\0" + "\1\u014b\106\0\2\u014c\7\0\1\u014d\1\333\1\334\1\333" + "\1\0\1\333\1\u014d\1\333\1\0\1\333\1\376\3\0" + "\2\333\1\0\3\333\1\0\1\333\10\0\1\u014d\2\333" + "\1\u014d\2\333\1\u014d\2\333\1\0\4\333\1\0\1\u014d" + "\1\333\1\0\1\333\1\0\1\u014d\2\333\6\0\1\u014e" + "\1\147\1\150\1\147\1\0\1\147\1\u014e\1\147\1\0" + "\1\147\4\0\2\147\1\0\3\147\1\252\1\147\10\0" + "\1\u014e\2\147\1\u014e\2\147\1\u014e\2\147\1\0\4\147" + "\1\0\1\u014e\1\147\1\0\1\147\1\0\1\u014e\2\147" + "\6\0\1\u014f\1\152\1\153\1\152\1\154\1\152\1\u014f" + "\27\152\1\u014f\2\152\1\u014f\2\152\1\u014f\10\152\1\u014f" + "\4\152\1\u014f\7\152\1\0\1\u0150\1\155\1\156\3\155" + "\1\u0150\1\155\1\154\25\155\1\u0150\2\155\1\u0150\2\155" + "\1\u0150\10\155\1\u0150\4\155\1\u0150\7\155\1\0\1\u0151"
-				+ "\1\157\1\160\1\157\1\161\1\157\1\u0151\27\157\1\u0151" + "\2\157\1\u0151\2\157\1\u0151\10\157\1\u0151\4\157\1\u0151" + "\7\157\1\0\1\u0152\1\162\1\163\3\162\1\u0152\1\162" + "\1\161\25\162\1\u0152\2\162\1\u0152\2\162\1\u0152\10\162" + "\1\u0152\4\162\1\u0152\7\162\4\0\1\u012d\1\0\1\u012d" + "\3\0\1\u012d\1\u0109\3\0\2\u012d\53\0\1\u0153\1\u0105" + "\1\u0106\1\u0105\1\0\1\u0105\1\u0153\1\u0105\1\0\1\u0105" + "\1\u0109\11\u0105\1\0\11\u0105\1\u0153\2\u0105\1\u0153\2\u0105" + "\1\u0153\10\u0105\1\u0153\4\u0105\1\u0153\7\u0105\1\0\1\u0154" + "\1\u0107\1\u0130\1\u0107\1\u0155\1\u0107\1\u0154\10\u0107\1\u0156" + "\16\u0107\1\u0154\2\u0107\1\u0154\2\u0107\1\u0154\10\u0107\1\u0154" + "\4\u0107\1\u0154\7\u0107\1\0\1\u0157\1\u0108\1\u0131\3\u0108" + "\1\u0157\1\u0108\1\u0158\6\u0108\1\u0159\16\u0108\1\u0157\2\u0108" + "\1\u0157\2\u0108\1\u0157\10\u0108\1\u0157\4\u0108\1\u0157\7\u0108" + "\1\0\1\u015a\1\51\1\165\1\51\1\0\1\51\1\u015a" + "\1\51\1\0\1\51\4\0\2\51\1\0\3\51\1\0"
-				+ "\1\51\10\0\1\u015a\2\51\1\u015a\2\51\1\u015a\2\51" + "\1\0\4\51\1\0\1\u015a\1\51\1\0\1\51\1\0" + "\1\u015a\2\51\6\0\1\u015b\1\55\1\167\1\55\1\0" + "\1\55\1\u015b\1\55\1\0\1\55\4\0\2\55\1\0" + "\3\55\1\0\1\55\10\0\1\u015b\2\55\1\u015b\2\55" + "\1\u015b\2\55\1\0\4\55\1\0\1\u015b\1\55\1\0" + "\1\55\1\0\1\u015b\2\55\6\0\1\u015c\1\62\1\171" + "\1\62\1\0\1\62\1\u015c\1\62\1\0\1\62\4\0" + "\2\62\1\0\3\62\1\0\1\62\10\0\1\u015c\2\62" + "\1\u015c\2\62\1\u015c\2\62\1\0\4\62\1\0\1\u015c" + "\1\62\1\0\1\62\1\0\1\u015c\2\62\6\0\1\u015d" + "\1\72\1\176\1\72\1\0\1\72\1\u015d\1\72\1\0" + "\1\72\4\0\2\72\1\0\3\72\1\0\1\72\10\0" + "\1\u015d\2\72\1\u015d\2\72\1\u015d\2\72\1\0\4\72" + "\1\0\1\u015d\1\72\1\0\1\72\1\0\1\u015d\2\72" + "\6\0\1\u015e\1\100\1\200\1\100\1\0\1\100\1\u015e" + "\1\100\1\0\1\100\4\0\2\100\1\0\3\100\1\0" + "\1\100\10\0\1\u015e\2\100\1\u015e\2\100\1\u015e\2\100" + "\1\0\4\100\1\0\1\u015e\1\100\1\0\1\100\1\0" + "\1\u015e\2\100\6\0\1\u015f\1\202\1\203\1\202\1\204"
-				+ "\1\202\1\u015f\27\202\1\u015f\2\202\1\u015f\2\202\1\u015f" + "\10\202\1\u015f\4\202\1\u015f\7\202\1\0\1\u0160\1\205" + "\1\206\3\205\1\u0160\1\205\1\204\25\205\1\u0160\2\205" + "\1\u0160\2\205\1\u0160\10\205\1\u0160\4\205\1\u0160\7\205" + "\1\0\1\u0161\1\105\1\207\1\105\1\0\1\105\1\u0161" + "\1\105\1\0\1\105\4\0\2\105\1\0\3\105\1\0" + "\1\105\10\0\1\u0161\2\105\1\u0161\2\105\1\u0161\2\105" + "\1\0\4\105\1\0\1\u0161\1\105\1\0\1\105\1\0" + "\1\u0161\2\105\6\0\1\u0162\1\211\1\212\1\211\1\0" + "\1\211\1\u0162\1\211\1\0\1\211\4\0\2\211\1\0" + "\3\211\1\0\1\211\10\0\1\u0162\2\211\1\u0162\2\211" + "\1\u0162\2\211\1\0\4\211\1\0\1\u0162\1\211\1\0" + "\1\211\1\0\1\u0162\2\211\6\0\1\u0163\1\113\1\216" + "\1\113\1\0\1\113\1\u0163\1\113\1\0\1\113\4\0" + "\2\113\1\0\3\113\1\217\1\113\10\0\1\u0163\2\113" + "\1\u0163\2\113\1\u0163\2\113\1\0\4\113\1\0\1\u0163" + "\1\113\1\0\1\113\1\0\1\u0163\2\113\6\0\1\u0164" + "\1\221\1\222\1\221\1\223\1\221\1\u0164\27\221\1\u0164"
-				+ "\2\221\1\u0164\2\221\1\u0164\10\221\1\u0164\4\221\1\u0164" + "\7\221\1\0\1\u0165\1\224\1\225\3\224\1\u0165\1\224" + "\1\223\25\224\1\u0165\2\224\1\u0165\2\224\1\u0165\10\224" + "\1\u0165\4\224\1\u0165\7\224\1\0\1\u0166\1\227\1\230" + "\1\227\1\0\1\227\1\u0166\1\227\1\0\1\227\4\0" + "\2\227\1\0\3\227\1\0\1\227\10\0\1\u0166\2\227" + "\1\u0166\2\227\1\u0166\2\227\1\0\4\227\1\0\1\u0166" + "\1\227\1\0\1\227\1\0\1\u0166\2\227\6\0\1\u0167" + "\5\0\1\u0167\1\362\15\0\2\u0167\7\0\2\u0167\1\0" + "\2\u0167\1\0\2\u0167\7\0\2\u0167\3\0\2\u0167\7\0" + "\1\u0168\5\0\1\u0168\16\0\2\u0168\7\0\2\u0168\1\0" + "\2\u0168\1\0\2\u0168\7\0\2\u0168\3\0\2\u0168\12\0" + "\1\u0141\1\0\1\u0141\3\0\1\u0141\1\u011e\3\0\2\u0141" + "\53\0\1\u0169\1\u0119\1\u011a\1\u0119\1\0\1\u0119\1\u0169" + "\1\u0119\1\0\1\u0119\1\u011e\11\u0119\1\0\11\u0119\1\u0169" + "\2\u0119\1\u0169\2\u0119\1\u0169\10\u0119\1\u0169\4\u0119\1\u0169" + "\7\u0119\1\0\1\u016a\1\u011c\1\u0144\1\u011c\1\u016b\1\u011c"
-				+ "\1\u016a\10\u011c\1\u016c\16\u011c\1\u016a\2\u011c\1\u016a\2\u011c" + "\1\u016a\10\u011c\1\u016a\4\u011c\1\u016a\7\u011c\1\0\1\u016d" + "\1\u011d\1\u0145\3\u011d\1\u016d\1\u011d\1\u016e\6\u011d\1\u016f" + "\16\u011d\1\u016d\2\u011d\1\u016d\2\u011d\1\u016d\10\u011d\1\u016d" + "\4\u011d\1\u016d\7\u011d\47\0\1\u0170\24\0\2\25\1\131" + "\1\25\1\0\3\25\1\0\1\25\4\0\2\25\1\0" + "\3\25\1\0\1\25\10\0\11\25\1\0\4\25\1\0" + "\2\25\1\0\1\25\1\0\3\25\6\0\1\u0171\1\134" + "\1\135\1\134\1\0\1\134\1\u0171\1\134\1\0\1\134" + "\4\0\2\134\1\0\3\134\1\0\1\134\10\0\1\u0171" + "\2\134\1\u0171\2\134\1\u0171\2\134\1\0\4\134\1\0" + "\1\u0171\1\134\1\0\1\134\1\0\1\u0171\2\134\6\0" + "\1\u0172\1\136\1\137\1\136\1\0\1\136\1\u0172\1\136" + "\1\0\1\136\4\0\2\136\1\0\3\136\1\0\1\136" + "\10\0\1\u0172\2\136\1\u0172\2\136\1\u0172\2\136\1\0" + "\4\136\1\0\1\u0172\1\136\1\0\1\136\1\0\1\u0172" + "\2\136\54\0\1\u0173\65\0\2\u0174\30\0\1\u0175\1\333" + "\1\334\1\333\1\0\1\333\1\u0175\1\333\1\0\1\333"
-				+ "\1\376\3\0\2\333\1\0\3\333\1\0\1\333\10\0" + "\1\u0175\2\333\1\u0175\2\333\1\u0175\2\333\1\0\4\333" + "\1\0\1\u0175\1\333\1\0\1\333\1\0\1\u0175\2\333" + "\6\0\1\u0176\1\147\1\150\1\147\1\0\1\147\1\u0176" + "\1\147\1\0\1\147\4\0\2\147\1\0\3\147\1\252" + "\1\147\10\0\1\u0176\2\147\1\u0176\2\147\1\u0176\2\147" + "\1\0\4\147\1\0\1\u0176\1\147\1\0\1\147\1\0" + "\1\u0176\2\147\6\0\1\u0177\1\152\1\153\1\152\1\154" + "\1\152\1\u0177\27\152\1\u0177\2\152\1\u0177\2\152\1\u0177" + "\10\152\1\u0177\4\152\1\u0177\7\152\1\0\1\u0178\1\155" + "\1\156\3\155\1\u0178\1\155\1\154\25\155\1\u0178\2\155" + "\1\u0178\2\155\1\u0178\10\155\1\u0178\4\155\1\u0178\7\155" + "\1\0\1\u0179\1\157\1\160\1\157\1\161\1\157\1\u0179" + "\27\157\1\u0179\2\157\1\u0179\2\157\1\u0179\10\157\1\u0179" + "\4\157\1\u0179\7\157\1\0\1\u017a\1\162\1\163\3\162" + "\1\u017a\1\162\1\161\25\162\1\u017a\2\162\1\u017a\2\162" + "\1\u017a\10\162\1\u017a\4\162\1\u017a\7\162\1\0\1\u017b"
-				+ "\1\u0105\1\u0106\1\u0105\1\0\1\u0105\1\u017b\1\u0105\1\0" + "\1\u0105\1\u0109\11\u0105\1\0\11\u0105\1\u017b\2\u0105\1\u017b" + "\2\u0105\1\u017b\10\u0105\1\u017b\4\u0105\1\u017b\7\u0105\1\0" + "\1\u017c\1\u0107\1\u0130\1\u0107\1\u012d\1\u0107\1\u017c\27\u0107" + "\1\u017c\2\u0107\1\u017c\2\u0107\1\u017c\10\u0107\1\u017c\4\u0107" + "\1\u017c\7\u0107\1\0\2\u0107\1\u0130\2\u012d\1\u0155\3\u0107" + "\1\u0155\1\u017d\3\u0107\2\u012d\52\u0107\1\0\2\u0107\1\u0130" + "\1\0\1\u012d\12\u0107\1\0\52\u0107\1\0\1\u017e\1\u0108" + "\1\u0131\3\u0108\1\u017e\1\u0108\1\u012d\25\u0108\1\u017e\2\u0108" + "\1\u017e\2\u0108\1\u017e\10\u0108\1\u017e\4\u0108\1\u017e\7\u0108" + "\1\0\2\u0108\1\u0131\1\u012d\1\u0108\1\u0158\2\u0108\1\u012d" + "\1\u0158\1\u017f\3\u0108\2\u012d\52\u0108\1\0\2\u0108\1\u0131" + "\1\0\4\u0108\1\u012d\6\u0108\1\0\52\u0108\1\0\2\51" + "\1\165\1\51\1\0\3\51\1\0\1\51\4\0\2\51" + "\1\0\3\51\1\0\1\51\10\0\11\51\1\0\4\51" + "\1\0\2\51\1\0\1\51\1\0\3\51\6\0\2\55"
-				+ "\1\167\1\55\1\0\3\55\1\0\1\55\4\0\2\55" + "\1\0\3\55\1\0\1\55\10\0\11\55\1\0\4\55" + "\1\0\2\55\1\0\1\55\1\0\3\55\6\0\2\62" + "\1\171\1\62\1\0\3\62\1\0\1\62\4\0\2\62" + "\1\0\3\62\1\0\1\62\10\0\11\62\1\0\4\62" + "\1\0\2\62\1\0\1\62\1\0\3\62\6\0\2\72" + "\1\176\1\72\1\0\3\72\1\0\1\72\4\0\2\72" + "\1\0\3\72\1\0\1\72\10\0\11\72\1\0\4\72" + "\1\0\2\72\1\0\1\72\1\0\3\72\6\0\2\100" + "\1\200\1\100\1\0\3\100\1\0\1\100\4\0\2\100" + "\1\0\3\100\1\0\1\100\10\0\11\100\1\0\4\100" + "\1\0\2\100\1\0\1\100\1\0\3\100\6\0\1\u0180" + "\1\202\1\203\1\202\1\204\1\202\1\u0180\27\202\1\u0180" + "\2\202\1\u0180\2\202\1\u0180\10\202\1\u0180\4\202\1\u0180" + "\7\202\1\0\1\u0181\1\205\1\206\3\205\1\u0181\1\205" + "\1\204\25\205\1\u0181\2\205\1\u0181\2\205\1\u0181\10\205" + "\1\u0181\4\205\1\u0181\7\205\1\0\2\105\1\207\1\105" + "\1\0\3\105\1\0\1\105\4\0\2\105\1\0\3\105" + "\1\0\1\105\10\0\11\105\1\0\4\105\1\0\2\105" + "\1\0\1\105\1\0\3\105\6\0\1\u0182\1\211\1\212"
-				+ "\1\211\1\0\1\211\1\u0182\1\211\1\0\1\211\4\0" + "\2\211\1\0\3\211\1\0\1\211\10\0\1\u0182\2\211" + "\1\u0182\2\211\1\u0182\2\211\1\0\4\211\1\0\1\u0182" + "\1\211\1\0\1\211\1\0\1\u0182\2\211\6\0\2\113" + "\1\216\1\113\1\0\3\113\1\0\1\113\4\0\2\113" + "\1\0\3\113\1\217\1\113\10\0\11\113\1\0\4\113" + "\1\0\2\113\1\0\1\113\1\0\3\113\6\0\1\u0183" + "\1\221\1\222\1\221\1\223\1\221\1\u0183\27\221\1\u0183" + "\2\221\1\u0183\2\221\1\u0183\10\221\1\u0183\4\221\1\u0183" + "\7\221\1\0\1\u0184\1\224\1\225\3\224\1\u0184\1\224" + "\1\223\25\224\1\u0184\2\224\1\u0184\2\224\1\u0184\10\224" + "\1\u0184\4\224\1\u0184\7\224\1\0\1\u0185\1\227\1\230" + "\1\227\1\0\1\227\1\u0185\1\227\1\0\1\227\4\0" + "\2\227\1\0\3\227\1\0\1\227\10\0\1\u0185\2\227" + "\1\u0185\2\227\1\u0185\2\227\1\0\4\227\1\0\1\u0185" + "\1\227\1\0\1\227\1\0\1\u0185\2\227\6\0\1\u0186" + "\5\0\1\u0186\1\362\15\0\2\u0186\7\0\2\u0186\1\0" + "\2\u0186\1\0\2\u0186\7\0\2\u0186\3\0\2\u0186\7\0"
-				+ "\1\u0187\5\0\1\u0187\16\0\2\u0187\7\0\2\u0187\1\0" + "\2\u0187\1\0\2\u0187\7\0\2\u0187\3\0\2\u0187\7\0" + "\1\u0188\1\u0119\1\u011a\1\u0119\1\0\1\u0119\1\u0188\1\u0119" + "\1\0\1\u0119\1\u011e\11\u0119\1\0\11\u0119\1\u0188\2\u0119" + "\1\u0188\2\u0119\1\u0188\10\u0119\1\u0188\4\u0119\1\u0188\7\u0119" + "\1\0\1\u0189\1\u011c\1\u0144\1\u011c\1\u0141\1\u011c\1\u0189" + "\27\u011c\1\u0189\2\u011c\1\u0189\2\u011c\1\u0189\10\u011c\1\u0189" + "\4\u011c\1\u0189\7\u011c\1\0\2\u011c\1\u0144\2\u0141\1\u016b" + "\3\u011c\1\u016b\1\u018a\3\u011c\2\u0141\52\u011c\1\0\2\u011c" + "\1\u0144\1\0\1\u0141\12\u011c\1\0\52\u011c\1\0\1\u018b" + "\1\u011d\1\u0145\3\u011d\1\u018b\1\u011d\1\u0141\25\u011d\1\u018b" + "\2\u011d\1\u018b\2\u011d\1\u018b\10\u011d\1\u018b\4\u011d\1\u018b" + "\7\u011d\1\0\2\u011d\1\u0145\1\u0141\1\u011d\1\u016e\2\u011d" + "\1\u0141\1\u016e\1\u018c\3\u011d\2\u0141\52\u011d\1\0\2\u011d" + "\1\u0145\1\0\4\u011d\1\u0141\6\u011d\1\0\52\u011d\42\0"
-				+ "\2\u018d\30\0\2\134\1\135\1\134\1\0\3\134\1\0" + "\1\134\4\0\2\134\1\0\3\134\1\0\1\134\10\0" + "\11\134\1\0\4\134\1\0\2\134\1\0\1\134\1\0" + "\3\134\6\0\2\136\1\137\1\136\1\0\3\136\1\0" + "\1\136\4\0\2\136\1\0\3\136\1\0\1\136\10\0" + "\11\136\1\0\4\136\1\0\2\136\1\0\1\136\1\0" + "\3\136\44\0\2\u018e\33\0\1\u018f\1\333\1\334\1\333" + "\1\0\1\333\1\u018f\1\333\1\0\1\333\1\376\3\0" + "\2\333\1\0\3\333\1\0\1\333\10\0\1\u018f\2\333" + "\1\u018f\2\333\1\u018f\2\333\1\0\4\333\1\0\1\u018f" + "\1\333\1\0\1\333\1\0\1\u018f\2\333\6\0\2\147" + "\1\150\1\147\1\0\3\147\1\0\1\147\4\0\2\147" + "\1\0\3\147\1\252\1\147\10\0\11\147\1\0\4\147" + "\1\0\2\147\1\0\1\147\1\0\3\147\6\0\2\152" + "\1\153\1\152\1\154\65\152\1\0\2\155\1\156\5\155" + "\1\154\61\155\1\0\2\157\1\160\1\157\1\161\65\157" + "\1\0\2\162\1\163\5\162\1\161\61\162\1\0\1\u0190" + "\1\u0105\1\u0106\1\u0105\1\0\1\u0105\1\u0190\1\u0105\1\0" + "\1\u0105\1\u0109\11\u0105\1\0\11\u0105\1\u0190\2\u0105\1\u0190"
-				+ "\2\u0105\1\u0190\10\u0105\1\u0190\4\u0105\1\u0190\7\u0105\1\0" + "\1\u0191\1\u0107\1\u0130\1\u0107\1\u012d\1\u0107\1\u0191\27\u0107" + "\1\u0191\2\u0107\1\u0191\2\u0107\1\u0191\10\u0107\1\u0191\4\u0107" + "\1\u0191\7\u0107\1\0\1\u0192\1\u0108\1\u0131\3\u0108\1\u0192" + "\1\u0108\1\u012d\25\u0108\1\u0192\2\u0108\1\u0192\2\u0108\1\u0192" + "\10\u0108\1\u0192\4\u0108\1\u0192\7\u0108\1\0\2\202\1\203" + "\1\202\1\204\65\202\1\0\2\205\1\206\5\205\1\204" + "\61\205\1\0\2\211\1\212\1\211\1\0\3\211\1\0" + "\1\211\4\0\2\211\1\0\3\211\1\0\1\211\10\0" + "\11\211\1\0\4\211\1\0\2\211\1\0\1\211\1\0" + "\3\211\6\0\2\221\1\222\1\221\1\223\65\221\1\0" + "\2\224\1\225\5\224\1\223\61\224\1\0\2\227\1\230" + "\1\227\1\0\3\227\1\0\1\227\4\0\2\227\1\0" + "\3\227\1\0\1\227\10\0\11\227\1\0\4\227\1\0" + "\2\227\1\0\1\227\1\0\3\227\15\0\1\362\63\0" + "\1\u0193\5\0\1\u0193\16\0\2\u0193\7\0\2\u0193\1\0" + "\2\u0193\1\0\2\u0193\7\0\2\u0193\3\0\2\u0193\7\0"
-				+ "\1\u0194\1\u0119\1\u011a\1\u0119\1\0\1\u0119\1\u0194\1\u0119" + "\1\0\1\u0119\1\u011e\11\u0119\1\0\11\u0119\1\u0194\2\u0119" + "\1\u0194\2\u0119\1\u0194\10\u0119\1\u0194\4\u0119\1\u0194\7\u0119" + "\1\0\1\u0195\1\u011c\1\u0144\1\u011c\1\u0141\1\u011c\1\u0195" + "\27\u011c\1\u0195\2\u011c\1\u0195\2\u011c\1\u0195\10\u011c\1\u0195" + "\4\u011c\1\u0195\7\u011c\1\0\1\u0196\1\u011d\1\u0145\3\u011d" + "\1\u0196\1\u011d\1\u0141\25\u011d\1\u0196\2\u011d\1\u0196\2\u011d" + "\1\u0196\10\u011d\1\u0196\4\u011d\1\u0196\7\u011d\65\0\1\u0197" + "\52\0\2\u0198\25\0\1\u0199\1\333\1\334\1\333\1\0" + "\1\333\1\u0199\1\333\1\0\1\333\1\376\3\0\2\333" + "\1\0\3\333\1\0\1\333\10\0\1\u0199\2\333\1\u0199" + "\2\333\1\u0199\2\333\1\0\4\333\1\0\1\u0199\1\333" + "\1\0\1\333\1\0\1\u0199\2\333\6\0\1\u019a\1\u0105" + "\1\u0106\1\u0105\1\0\1\u0105\1\u019a\1\u0105\1\0\1\u0105" + "\1\u0109\11\u0105\1\0\11\u0105\1\u019a\2\u0105\1\u019a\2\u0105"
-				+ "\1\u019a\10\u0105\1\u019a\4\u0105\1\u019a\7\u0105\1\0\1\u019b" + "\1\u0107\1\u0130\1\u0107\1\u012d\1\u0107\1\u019b\27\u0107\1\u019b" + "\2\u0107\1\u019b\2\u0107\1\u019b\10\u0107\1\u019b\4\u0107\1\u019b" + "\7\u0107\1\0\1\u019c\1\u0108\1\u0131\3\u0108\1\u019c\1\u0108" + "\1\u012d\25\u0108\1\u019c\2\u0108\1\u019c\2\u0108\1\u019c\10\u0108" + "\1\u019c\4\u0108\1\u019c\7\u0108\1\0\1\u019d\5\0\1\u019d" + "\16\0\2\u019d\7\0\2\u019d\1\0\2\u019d\1\0\2\u019d" + "\7\0\2\u019d\3\0\2\u019d\7\0\1\u019e\1\u0119\1\u011a" + "\1\u0119\1\0\1\u0119\1\u019e\1\u0119\1\0\1\u0119\1\u011e" + "\11\u0119\1\0\11\u0119\1\u019e\2\u0119\1\u019e\2\u0119\1\u019e" + "\10\u0119\1\u019e\4\u0119\1\u019e\7\u0119\1\0\1\u019f\1\u011c" + "\1\u0144\1\u011c\1\u0141\1\u011c\1\u019f\27\u011c\1\u019f\2\u011c" + "\1\u019f\2\u011c\1\u019f\10\u011c\1\u019f\4\u011c\1\u019f\7\u011c" + "\1\0\1\u01a0\1\u011d\1\u0145\3\u011d\1\u01a0\1\u011d\1\u0141"
-				+ "\25\u011d\1\u01a0\2\u011d\1\u01a0\2\u011d\1\u01a0\10\u011d\1\u01a0" + "\4\u011d\1\u01a0\7\u011d\47\0\1\u01a1\24\0\2\333\1\334" + "\1\333\1\0\3\333\1\0\1\333\1\376\3\0\2\333" + "\1\0\3\333\1\0\1\333\10\0\11\333\1\0\4\333" + "\1\0\2\333\1\0\1\333\1\0\3\333\6\0\1\u01a2" + "\1\u0105\1\u0106\1\u0105\1\0\1\u0105\1\u01a2\1\u0105\1\0" + "\1\u0105\1\u0109\11\u0105\1\0\11\u0105\1\u01a2\2\u0105\1\u01a2" + "\2\u0105\1\u01a2\10\u0105\1\u01a2\4\u0105\1\u01a2\7\u0105\1\0" + "\1\u01a3\1\u0107\1\u0130\1\u0107\1\u012d\1\u0107\1\u01a3\27\u0107" + "\1\u01a3\2\u0107\1\u01a3\2\u0107\1\u01a3\10\u0107\1\u01a3\4\u0107" + "\1\u01a3\7\u0107\1\0\1\u01a4\1\u0108\1\u0131\3\u0108\1\u01a4" + "\1\u0108\1\u012d\25\u0108\1\u01a4\2\u0108\1\u01a4\2\u0108\1\u01a4" + "\10\u0108\1\u01a4\4\u0108\1\u01a4\7\u0108\1\0\1\u01a5\1\u0119" + "\1\u011a\1\u0119\1\0\1\u0119\1\u01a5\1\u0119\1\0\1\u0119" + "\1\u011e\11\u0119\1\0\11\u0119\1\u01a5\2\u0119\1\u01a5\2\u0119"
-				+ "\1\u01a5\10\u0119\1\u01a5\4\u0119\1\u01a5\7\u0119\1\0\1\u01a6" + "\1\u011c\1\u0144\1\u011c\1\u0141\1\u011c\1\u01a6\27\u011c\1\u01a6" + "\2\u011c\1\u01a6\2\u011c\1\u01a6\10\u011c\1\u01a6\4\u011c\1\u01a6" + "\7\u011c\1\0\1\u01a7\1\u011d\1\u0145\3\u011d\1\u01a7\1\u011d" + "\1\u0141\25\u011d\1\u01a7\2\u011d\1\u01a7\2\u011d\1\u01a7\10\u011d" + "\1\u01a7\4\u011d\1\u01a7\7\u011d\1\0\2\u0105\1\u0106\1\u0105" + "\1\0\3\u0105\1\0\1\u0105\1\u0109\11\u0105\1\0\45\u0105" + "\1\0\1\u01a8\1\u0107\1\u0130\1\u0107\1\u012d\1\u0107\1\u01a8" + "\27\u0107\1\u01a8\2\u0107\1\u01a8\2\u0107\1\u01a8\10\u0107\1\u01a8" + "\4\u0107\1\u01a8\7\u0107\1\0\1\u01a9\1\u0108\1\u0131\3\u0108" + "\1\u01a9\1\u0108\1\u012d\25\u0108\1\u01a9\2\u0108\1\u01a9\2\u0108" + "\1\u01a9\10\u0108\1\u01a9\4\u0108\1\u01a9\7\u0108\1\0\2\u0119" + "\1\u011a\1\u0119\1\0\3\u0119\1\0\1\u0119\1\u011e\11\u0119" + "\1\0\45\u0119\1\0\1\u01aa\1\u011c\1\u0144\1\u011c\1\u0141"
-				+ "\1\u011c\1\u01aa\27\u011c\1\u01aa\2\u011c\1\u01aa\2\u011c\1\u01aa" + "\10\u011c\1\u01aa\4\u011c\1\u01aa\7\u011c\1\0\1\u01ab\1\u011d" + "\1\u0145\3\u011d\1\u01ab\1\u011d\1\u0141\25\u011d\1\u01ab\2\u011d" + "\1\u01ab\2\u011d\1\u01ab\10\u011d\1\u01ab\4\u011d\1\u01ab\7\u011d" + "\1\0\2\u0107\1\u0130\1\u0107\1\u012d\65\u0107\1\0\2\u0108" + "\1\u0131\5\u0108\1\u012d\61\u0108\1\0\2\u011c\1\u0144\1\u011c" + "\1\u0141\65\u011c\1\0\2\u011d\1\u0145\5\u011d\1\u0141\61\u011d";
+  /** 
+   * Translates characters to character classes
+   */
+  private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
 
-	/**
-	 * The transition table of the DFA
-	 */
-	final private static int yytrans[] = yy_unpack(yy_packed);
+  /** 
+   * Translates DFA states to action switch labels.
+   */
+  private static final int [] ZZ_ACTION = zzUnpackAction();
+
+  private static final String ZZ_ACTION_PACKED_0 =
+    "\23\0\1\1\1\2\1\1\1\3\4\1\1\4\1\1"+
+    "\1\5\1\1\1\6\1\7\3\1\1\10\3\1\1\11"+
+    "\2\1\1\12\1\13\2\1\1\14\1\15\1\16\2\1"+
+    "\1\17\1\1\1\3\1\20\1\21\1\22\2\1\1\23"+
+    "\1\1\1\24\1\25\4\1\1\26\3\1\1\27\1\30"+
+    "\1\31\1\32\4\1\1\33\3\1\1\32\1\1\2\34"+
+    "\1\3\1\0\1\2\1\0\1\35\1\0\1\36\10\0"+
+    "\1\6\4\0\1\37\4\0\1\40\4\0\1\11\1\0"+
+    "\1\13\1\0\1\16\1\0\1\41\1\0\1\22\1\0"+
+    "\1\25\2\0\1\25\3\0\1\26\1\0\1\42\3\0"+
+    "\1\43\1\0\1\32\1\44\1\32\2\0\1\45\2\0"+
+    "\1\31\1\46\2\0\1\32\2\0\1\47\1\2\1\50"+
+    "\1\35\1\36\10\0\1\6\1\0\1\37\2\0\1\37"+
+    "\2\0\1\40\2\0\1\40\2\0\1\11\1\13\1\16"+
+    "\1\22\1\25\1\0\1\25\2\0\1\25\1\0\1\26"+
+    "\1\42\1\32\1\0\1\32\1\0\1\45\2\0\1\45"+
+    "\1\0\1\46\1\51\1\32\1\0\1\2\1\35\1\36"+
+    "\1\52\1\53\10\0\1\6\5\0\1\11\1\13\1\16"+
+    "\1\22\1\25\2\0\1\26\1\42\2\32\2\0\1\46"+
+    "\1\51\1\0\1\44\1\0\1\2\1\35\1\36\3\0"+
+    "\1\54\2\0\1\6\1\0\1\6\10\0\1\55\1\11"+
+    "\1\13\1\16\1\22\1\25\2\0\1\26\1\42\2\32"+
+    "\2\0\1\46\2\51\5\0\1\56\1\0\1\2\1\35"+
+    "\1\36\2\0\1\57\2\0\1\6\6\0\1\55\2\0"+
+    "\1\11\1\13\1\16\1\22\1\25\2\0\1\26\1\42"+
+    "\2\32\2\0\1\46\2\51\2\0\1\56\3\0\1\2"+
+    "\1\35\1\36\1\0\1\60\2\0\1\6\13\0\1\11"+
+    "\1\13\1\16\1\22\1\25\2\0\1\26\1\42\2\32"+
+    "\2\0\1\46\2\51\10\0\1\35\1\36\1\61\2\0"+
+    "\1\6\6\0\1\55\1\0\1\55\2\0\1\42\1\32"+
+    "\2\0\1\46\2\51\2\0\1\56\1\0\1\56\6\0"+
+    "\1\32\1\51\4\0\1\62\4\0\1\51\3\0\1\63"+
+    "\12\0";
+
+  private static int [] zzUnpackAction() {
+    int [] result = new int[436];
+    int offset = 0;
+    offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
+    return result;
+  }
+
+  private static int zzUnpackAction(String packed, int offset, int [] result) {
+    int i = 0;       /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int count = packed.charAt(i++);
+      int value = packed.charAt(i++);
+      do result[j++] = value; while (--count > 0);
+    }
+    return j;
+  }
 
 
-	/* error codes */
-	final private static int YY_UNKNOWN_ERROR = 0;
-	// final private static int YY_ILLEGAL_STATE = 1;
-	final private static int YY_NO_MATCH = 2;
-	// final private static int YY_PUSHBACK_2BIG = 3;
+  /** 
+   * Translates a state to a row index in the transition table
+   */
+  private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
 
-	/* error messages for the codes above */
-	final private static String YY_ERROR_MSG[] = {"Unkown internal scanner error", "Internal error: unknown state", "Error: could not match input", "Error: pushback value was too large"};
+  private static final String ZZ_ROWMAP_PACKED_0 =
+    "\0\0\0\73\0\166\0\261\0\354\0\u0127\0\u0162\0\u019d"+
+    "\0\u01d8\0\u0213\0\u024e\0\u0289\0\u02c4\0\u02ff\0\u033a\0\u0375"+
+    "\0\u03b0\0\u03eb\0\u0426\0\u0461\0\u049c\0\u04d7\0\u0512\0\u054d"+
+    "\0\u0588\0\u05c3\0\u05fe\0\u0461\0\u0639\0\u0461\0\u0674\0\u06af"+
+    "\0\u0461\0\u06ea\0\u0725\0\u0760\0\u0461\0\u079b\0\u07d6\0\u0811"+
+    "\0\u084c\0\u0887\0\u08c2\0\u0461\0\u08fd\0\u0938\0\u0973\0\u0461"+
+    "\0\u0461\0\u09ae\0\u09e9\0\u0a24\0\u0461\0\u0a5f\0\u0a9a\0\u0461"+
+    "\0\u0461\0\u0ad5\0\u0b10\0\u0b4b\0\u0461\0\u0b86\0\u0461\0\u0bc1"+
+    "\0\u0bfc\0\u0c37\0\u0c72\0\u0cad\0\u0ce8\0\u0d23\0\u0d5e\0\u0d99"+
+    "\0\u0461\0\u0461\0\u0dd4\0\u0e0f\0\u0e4a\0\u0e85\0\u0ec0\0\u0efb"+
+    "\0\u0461\0\u0f36\0\u0f71\0\u0fac\0\u0fe7\0\u1022\0\u0639\0\u0461"+
+    "\0\u105d\0\u04d7\0\u1098\0\u10d3\0\u0588\0\u110e\0\u05c3\0\u1149"+
+    "\0\u1184\0\u11bf\0\u11fa\0\u1235\0\u1270\0\u12ab\0\u12e6\0\u1321"+
+    "\0\u135c\0\u1397\0\u06ea\0\u13d2\0\u0461\0\u0760\0\u140d\0\u079b"+
+    "\0\u1448\0\u0461\0\u07d6\0\u1483\0\u14be\0\u0887\0\u14f9\0\u0938"+
+    "\0\u1534\0\u09e9\0\u156f\0\u15aa\0\u0461\0\u0b10\0\u15e5\0\u0bfc"+
+    "\0\u1620\0\u0c37\0\u165b\0\u0461\0\u0cad\0\u1696\0\u0d23\0\u16d1"+
+    "\0\u170c\0\u1747\0\u1782\0\u17bd\0\u0f36\0\u0461\0\u0e4a\0\u17f8"+
+    "\0\u0461\0\u1833\0\u0e85\0\u186e\0\u0461\0\u0efb\0\u18a9\0\u18e4"+
+    "\0\u0fac\0\u191f\0\u195a\0\u1995\0\u1022\0\u19d0\0\u0461\0\u1a0b"+
+    "\0\u0461\0\u1a46\0\u1a81\0\u1abc\0\u1af7\0\u1b32\0\u1b6d\0\u1ba8"+
+    "\0\u1be3\0\u1c1e\0\u1c59\0\u1c94\0\u1ccf\0\u06ea\0\u1d0a\0\u1d45"+
+    "\0\u0760\0\u1d80\0\u1dbb\0\u079b\0\u1df6\0\u1e31\0\u07d6\0\u1e6c"+
+    "\0\u1ea7\0\u1ee2\0\u1f1d\0\u1f58\0\u1f93\0\u1fce\0\u2009\0\u0c37"+
+    "\0\u2044\0\u207f\0\u0cad\0\u20ba\0\u20f5\0\u2130\0\u216b\0\u21a6"+
+    "\0\u21e1\0\u221c\0\u0e85\0\u2257\0\u2292\0\u0efb\0\u22cd\0\u2308"+
+    "\0\u2343\0\u237e\0\u23b9\0\u23f4\0\u242f\0\u246a\0\u0461\0\u0461"+
+    "\0\u24a5\0\u24e0\0\u251b\0\u2556\0\u2591\0\u25cc\0\u2607\0\u2642"+
+    "\0\u267d\0\u26b8\0\u26f3\0\u272e\0\u2769\0\u27a4\0\u27df\0\u281a"+
+    "\0\u2855\0\u2890\0\u28cb\0\u2906\0\u2941\0\u297c\0\u29b7\0\u29f2"+
+    "\0\u2a2d\0\u2a68\0\u2aa3\0\u2ade\0\u2b19\0\u2b54\0\u2b8f\0\u2bca"+
+    "\0\u2c05\0\u2c40\0\u2c7b\0\u2cb6\0\u2cf1\0\u2d2c\0\u0461\0\u2d67"+
+    "\0\u2da2\0\u0461\0\u2ddd\0\u2e18\0\u2e53\0\u2e8e\0\u2ec9\0\u2f04"+
+    "\0\u2f3f\0\u2f7a\0\u2fb5\0\u2ff0\0\u0461\0\u302b\0\u3066\0\u30a1"+
+    "\0\u30dc\0\u3117\0\u3152\0\u318d\0\u31c8\0\u3203\0\u323e\0\u3279"+
+    "\0\u32b4\0\u32ef\0\u332a\0\u3365\0\u33a0\0\u33db\0\u3416\0\u2b8f"+
+    "\0\u3451\0\u348c\0\u0461\0\u34c7\0\u3502\0\u353d\0\u3578\0\u35b3"+
+    "\0\u35ee\0\u0461\0\u3629\0\u3664\0\u369f\0\u36da\0\u3715\0\u3750"+
+    "\0\u378b\0\u37c6\0\u3801\0\u2f3f\0\u383c\0\u3877\0\u38b2\0\u38ed"+
+    "\0\u3928\0\u3963\0\u399e\0\u39d9\0\u3a14\0\u3a4f\0\u3a8a\0\u3ac5"+
+    "\0\u3b00\0\u3b3b\0\u3b76\0\u3bb1\0\u3bec\0\u3c27\0\u3c62\0\u3c9d"+
+    "\0\u33db\0\u3cd8\0\u3d13\0\u3d4e\0\u3d89\0\u3dc4\0\u3dff\0\u3e3a"+
+    "\0\u0461\0\u3e75\0\u3eb0\0\u3eeb\0\u3f26\0\u3f61\0\u3f9c\0\u3fd7"+
+    "\0\u4012\0\u404d\0\u4088\0\u40c3\0\u40fe\0\u4139\0\u4174\0\u41af"+
+    "\0\u41ea\0\u4225\0\u4260\0\u429b\0\u42d6\0\u4311\0\u434c\0\u4387"+
+    "\0\u43c2\0\u43fd\0\u4438\0\u4473\0\u44ae\0\u44e9\0\u4524\0\u455f"+
+    "\0\u459a\0\u45d5\0\u4610\0\u464b\0\u4686\0\u46c1\0\u46fc\0\u4737"+
+    "\0\u4772\0\u0461\0\u47ad\0\u47e8\0\u4823\0\u485e\0\u4899\0\u48d4"+
+    "\0\u490f\0\u494a\0\u4985\0\u2fb5\0\u49c0\0\u2ff0\0\u49fb\0\u4a36"+
+    "\0\u4a71\0\u4aac\0\u4ae7\0\u4b22\0\u4b5d\0\u4b98\0\u4bd3\0\u4c0e"+
+    "\0\u4c49\0\u3451\0\u4c84\0\u348c\0\u4cbf\0\u4cfa\0\u4d35\0\u4d70"+
+    "\0\u4dab\0\u4de6\0\u4e21\0\u4e5c\0\u4e97\0\u4ed2\0\u4f0d\0\u4f48"+
+    "\0\u0461\0\u4f83\0\u4fbe\0\u4ff9\0\u5034\0\u0461\0\u506f\0\u50aa"+
+    "\0\u50e5\0\u0461\0\u5120\0\u515b\0\u5196\0\u51d1\0\u520c\0\u5247"+
+    "\0\u5282\0\u52bd\0\u52f8\0\u5333";
 
-	/**
-	 * YY_ATTRIBUTE[aState] contains the attributes of state
-	 * <code>aState</code>
-	 */
-	private final static byte YY_ATTRIBUTE[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 1, 1, 1, 1, 1, 1, 9, 1, 9, 1, 1, 9, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 9, 9, 1, 1, 1, 9, 1, 3, 9, 9, 1, 1, 1, 9, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 9, 3, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 9, 0, 0, 0, 0, 9, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 13, 7, 0, 1, 0, 1, 0, 0, 9, 0, 0, 0, 1, 1, 0, 0, 0, 9, 0, 9, 1, 0, 0, 9, 0, 0, 1, 1, 0, 0, 1, 0, 0, 13, 7, 1, 9, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 9, 0, 0, 9, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 9, 0, 1, 1, 1, 0, 0, 9, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0,
-				0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 9, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 9, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 9, 0, 0, 0, 0, 9, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+  private static int [] zzUnpackRowMap() {
+    int [] result = new int[436];
+    int offset = 0;
+    offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
+    return result;
+  }
 
-	/** the input device */
-	private java.io.Reader yy_reader;
+  private static int zzUnpackRowMap(String packed, int offset, int [] result) {
+    int i = 0;  /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int high = packed.charAt(i++) << 16;
+      result[j++] = high | packed.charAt(i++);
+    }
+    return j;
+  }
 
-	/** the current state of the DFA */
-	private int yy_state;
+  /** 
+   * The transition table of the DFA
+   */
+  private static final int [] ZZ_TRANS = zzUnpackTrans();
 
-	/** the current lexical state */
-	private int yy_lexical_state = YYINITIAL;
+  private static final String ZZ_TRANS_PACKED_0 =
+    "\2\24\1\25\1\26\1\27\1\24\1\27\1\25\1\30"+
+    "\1\24\1\27\1\24\1\31\2\24\2\27\1\32\3\25"+
+    "\1\24\1\25\1\24\1\33\2\24\1\34\1\35\1\36"+
+    "\1\37\11\25\1\24\4\25\1\24\2\25\1\24\1\25"+
+    "\1\40\3\25\1\41\10\24\1\27\1\42\1\27\1\24"+
+    "\1\43\1\44\1\27\4\24\2\27\7\24\1\33\2\24"+
+    "\1\34\1\35\1\24\1\37\40\24\1\27\1\24\1\27"+
+    "\1\24\1\43\1\24\1\27\4\24\2\27\7\24\1\33"+
+    "\2\24\1\34\1\35\1\24\1\37\11\24\1\45\26\24"+
+    "\1\27\1\46\1\27\1\24\1\43\1\47\1\27\4\24"+
+    "\2\27\1\24\1\50\5\24\1\33\2\24\1\34\1\35"+
+    "\1\24\1\37\11\24\1\45\24\24\1\51\1\52\1\27"+
+    "\1\24\1\27\1\51\1\53\1\24\1\27\4\24\2\27"+
+    "\1\24\3\51\1\24\1\51\1\24\1\33\2\24\1\34"+
+    "\1\35\1\24\1\37\11\51\1\45\4\51\1\24\2\51"+
+    "\1\24\1\51\1\24\3\51\11\24\1\27\1\24\1\27"+
+    "\1\24\1\43\1\24\1\27\4\24\2\27\7\24\1\33"+
+    "\2\24\1\34\1\35\1\24\1\37\11\24\1\45\4\24"+
+    "\1\54\17\24\1\55\1\56\1\27\1\24\1\27\1\55"+
+    "\1\57\1\24\1\27\4\24\2\27\1\24\3\55\1\24"+
+    "\1\55\1\24\1\33\2\24\1\34\1\35\1\24\1\37"+
+    "\11\55\1\24\4\55\1\24\2\55\1\60\1\55\1\24"+
+    "\3\55\11\24\1\27\1\24\1\27\1\24\1\43\1\24"+
+    "\1\27\4\24\2\27\7\24\1\33\2\24\1\34\1\35"+
+    "\1\24\1\37\16\24\1\61\2\24\1\60\14\24\1\62"+
+    "\1\63\1\27\1\24\1\27\1\62\1\64\1\24\1\27"+
+    "\4\24\2\27\1\24\3\62\1\24\1\62\1\24\1\33"+
+    "\2\24\1\34\1\35\1\24\1\37\11\62\1\24\4\62"+
+    "\1\24\2\62\1\65\1\62\1\66\3\62\11\24\1\27"+
+    "\1\24\1\27\1\24\1\43\1\24\1\27\4\24\2\27"+
+    "\7\24\1\33\2\24\1\34\1\35\1\24\1\37\21\24"+
+    "\1\65\16\24\1\67\1\24\1\67\1\24\1\43\1\24"+
+    "\1\67\1\24\1\31\1\70\1\24\2\67\1\32\6\24"+
+    "\1\33\1\24\1\70\1\34\1\35\1\36\1\37\16\24"+
+    "\1\71\2\24\1\65\1\24\1\40\3\24\1\41\6\24"+
+    "\1\72\1\73\1\27\1\24\1\27\1\72\1\74\1\24"+
+    "\1\27\4\24\2\27\1\24\3\72\1\24\1\72\1\24"+
+    "\1\33\2\24\1\34\1\35\1\24\1\37\11\72\1\24"+
+    "\4\72\1\24\2\72\1\24\1\72\1\24\3\72\11\24"+
+    "\1\27\1\24\1\27\1\24\1\43\1\24\1\27\4\24"+
+    "\2\27\7\24\1\33\2\24\1\34\1\35\1\24\1\37"+
+    "\30\24\1\75\1\76\1\77\3\24\1\100\1\101\1\27"+
+    "\1\102\1\27\1\100\1\103\1\104\1\27\4\24\2\27"+
+    "\1\24\3\100\1\24\1\100\1\24\1\33\2\24\1\34"+
+    "\1\35\1\24\1\37\11\100\1\24\4\100\1\24\2\100"+
+    "\1\24\1\100\1\24\3\100\11\24\1\27\1\24\1\27"+
+    "\1\24\1\43\1\24\1\27\4\24\2\27\7\24\1\33"+
+    "\2\24\1\34\1\35\1\24\1\37\32\24\1\77\3\24"+
+    "\1\105\1\106\1\27\1\24\1\27\1\105\1\107\1\24"+
+    "\1\27\4\24\2\27\1\24\3\105\1\24\1\105\1\24"+
+    "\1\33\2\24\1\34\1\35\1\110\1\37\11\105\1\111"+
+    "\4\105\1\24\2\105\1\24\1\105\1\24\3\105\11\24"+
+    "\1\27\1\24\1\27\1\24\1\43\1\24\1\27\4\24"+
+    "\2\27\7\24\1\33\2\24\1\34\1\35\1\24\1\37"+
+    "\11\24\1\111\11\24\1\112\11\24\1\113\1\114\1\115"+
+    "\1\27\1\116\1\27\1\114\1\117\1\120\1\27\1\121"+
+    "\1\122\1\123\1\24\2\27\1\124\1\125\2\114\1\24"+
+    "\1\114\1\24\1\33\1\126\1\24\1\34\1\127\1\24"+
+    "\1\37\11\114\1\111\4\114\1\130\2\114\1\24\1\114"+
+    "\1\24\3\114\6\24\1\113\1\114\1\115\1\131\1\116"+
+    "\1\131\1\114\1\117\1\120\1\131\1\121\1\122\1\123"+
+    "\1\24\2\131\1\124\1\125\2\114\1\24\1\114\1\24"+
+    "\1\33\1\126\1\24\1\34\1\127\1\24\1\37\11\114"+
+    "\1\111\4\114\1\130\2\114\1\24\1\114\1\24\3\114"+
+    "\5\24\74\0\2\25\1\132\3\0\2\25\11\0\3\25"+
+    "\1\0\1\25\10\0\11\25\1\0\4\25\1\0\2\25"+
+    "\1\0\1\25\1\0\3\25\6\0\1\133\2\25\1\0"+
+    "\2\25\1\133\2\25\1\0\4\25\2\0\16\25\1\133"+
+    "\2\25\1\133\2\25\1\133\10\25\1\133\4\25\1\133"+
+    "\7\25\4\0\1\27\1\0\1\27\3\0\1\27\4\0"+
+    "\2\27\54\0\1\25\1\132\3\0\1\25\1\134\11\0"+
+    "\3\25\1\0\1\25\10\0\11\25\1\0\4\25\1\0"+
+    "\2\25\1\0\1\25\1\0\3\25\6\0\2\135\1\136"+
+    "\3\0\2\135\11\0\3\135\1\0\1\135\10\0\11\135"+
+    "\1\0\4\135\1\0\2\135\1\0\1\135\1\0\3\135"+
+    "\6\0\2\137\1\140\3\0\2\137\11\0\3\137\1\0"+
+    "\1\137\10\0\11\137\1\0\4\137\1\0\2\137\1\0"+
+    "\1\137\1\0\3\137\36\0\1\141\76\0\1\142\74\0"+
+    "\2\143\10\0\1\144\1\145\1\146\7\0\2\147\10\0"+
+    "\1\150\1\151\3\0\1\150\1\152\11\0\3\150\1\0"+
+    "\1\150\10\0\11\150\1\0\4\150\1\0\2\150\1\0"+
+    "\1\150\1\0\3\150\6\0\2\153\1\154\1\0\1\155"+
+    "\11\153\2\0\52\153\10\0\1\134\63\0\2\156\1\157"+
+    "\1\0\4\156\1\155\5\156\2\0\52\156\1\0\2\160"+
+    "\1\161\1\0\1\162\11\160\2\0\52\160\1\0\2\163"+
+    "\1\164\1\0\4\163\1\162\5\163\2\0\52\163\23\0"+
+    "\1\165\50\0\2\51\1\166\3\0\2\51\11\0\3\51"+
+    "\1\0\1\51\10\0\11\51\1\0\4\51\1\0\2\51"+
+    "\1\0\1\51\1\0\3\51\6\0\1\167\2\51\1\0"+
+    "\2\51\1\167\2\51\1\0\4\51\2\0\16\51\1\167"+
+    "\2\51\1\167\2\51\1\167\10\51\1\167\4\51\1\167"+
+    "\7\51\2\0\1\51\1\166\3\0\1\51\1\134\11\0"+
+    "\3\51\1\0\1\51\10\0\11\51\1\0\4\51\1\0"+
+    "\2\51\1\0\1\51\1\0\3\51\6\0\2\55\1\170"+
+    "\3\0\2\55\11\0\3\55\1\0\1\55\10\0\11\55"+
+    "\1\0\4\55\1\0\2\55\1\0\1\55\1\0\3\55"+
+    "\6\0\1\171\2\55\1\0\2\55\1\171\2\55\1\0"+
+    "\4\55\2\0\16\55\1\171\2\55\1\171\2\55\1\171"+
+    "\10\55\1\171\4\55\1\171\7\55\2\0\1\55\1\170"+
+    "\3\0\1\55\1\134\11\0\3\55\1\0\1\55\10\0"+
+    "\11\55\1\0\4\55\1\0\2\55\1\0\1\55\1\0"+
+    "\3\55\6\0\2\62\1\172\3\0\2\62\11\0\3\62"+
+    "\1\0\1\62\10\0\11\62\1\0\4\62\1\0\2\62"+
+    "\1\0\1\62\1\0\3\62\6\0\1\173\2\62\1\0"+
+    "\2\62\1\173\2\62\1\0\4\62\2\0\16\62\1\173"+
+    "\2\62\1\173\2\62\1\173\10\62\1\173\4\62\1\173"+
+    "\7\62\2\0\1\62\1\172\3\0\1\62\1\134\11\0"+
+    "\3\62\1\0\1\62\10\0\11\62\1\0\4\62\1\0"+
+    "\2\62\1\0\1\62\1\0\3\62\7\0\1\62\1\172"+
+    "\3\0\1\62\1\174\11\0\3\62\1\0\1\62\10\0"+
+    "\11\62\1\0\4\62\1\0\2\62\1\0\1\62\1\0"+
+    "\3\62\5\0\4\175\1\67\1\175\1\67\3\175\1\67"+
+    "\2\175\1\0\1\175\2\67\11\175\1\0\1\175\1\0"+
+    "\20\175\1\0\2\175\1\0\12\175\1\0\2\72\1\176"+
+    "\3\0\2\72\11\0\3\72\1\0\1\72\10\0\11\72"+
+    "\1\0\4\72\1\0\2\72\1\0\1\72\1\0\3\72"+
+    "\6\0\1\177\2\72\1\0\2\72\1\177\2\72\1\0"+
+    "\4\72\2\0\16\72\1\177\2\72\1\177\2\72\1\177"+
+    "\10\72\1\177\4\72\1\177\7\72\2\0\1\72\1\176"+
+    "\3\0\1\72\1\134\11\0\3\72\1\0\1\72\10\0"+
+    "\11\72\1\0\4\72\1\0\2\72\1\0\1\72\1\0"+
+    "\3\72\74\0\1\75\4\0\2\100\1\200\3\0\2\100"+
+    "\11\0\3\100\1\0\1\100\10\0\11\100\1\0\4\100"+
+    "\1\0\2\100\1\0\1\100\1\0\3\100\6\0\1\201"+
+    "\2\100\1\0\2\100\1\201\2\100\1\0\4\100\2\0"+
+    "\16\100\1\201\2\100\1\201\2\100\1\201\10\100\1\201"+
+    "\4\100\1\201\7\100\1\0\2\202\1\203\1\0\1\204"+
+    "\11\202\2\0\52\202\2\0\1\100\1\200\3\0\1\100"+
+    "\1\134\11\0\3\100\1\0\1\100\10\0\11\100\1\0"+
+    "\4\100\1\0\2\100\1\0\1\100\1\0\3\100\6\0"+
+    "\2\205\1\206\1\0\4\205\1\204\5\205\2\0\52\205"+
+    "\1\0\2\105\1\207\3\0\2\105\11\0\3\105\1\0"+
+    "\1\105\10\0\11\105\1\0\4\105\1\0\2\105\1\0"+
+    "\1\105\1\0\3\105\6\0\1\210\2\105\1\0\2\105"+
+    "\1\210\2\105\1\0\4\105\2\0\16\105\1\210\2\105"+
+    "\1\210\2\105\1\210\10\105\1\210\4\105\1\210\7\105"+
+    "\2\0\1\105\1\207\3\0\1\105\1\134\11\0\3\105"+
+    "\1\0\1\105\10\0\11\105\1\0\4\105\1\0\2\105"+
+    "\1\0\1\105\1\0\3\105\7\0\1\105\1\207\3\0"+
+    "\1\105\1\211\11\0\3\105\1\0\1\105\10\0\11\105"+
+    "\1\0\4\105\1\0\2\105\1\0\1\105\1\0\3\105"+
+    "\6\0\1\113\1\212\1\213\3\0\1\212\1\214\3\0"+
+    "\1\215\5\0\3\212\1\0\1\212\10\0\11\212\1\0"+
+    "\4\212\1\0\2\212\1\0\1\212\1\0\3\212\4\0"+
+    "\1\216\1\0\2\114\1\217\3\0\2\114\3\0\1\220"+
+    "\5\0\3\114\1\221\1\114\10\0\11\114\1\0\4\114"+
+    "\1\0\2\114\1\0\1\114\1\0\3\114\6\0\1\222"+
+    "\2\114\1\0\2\114\1\222\2\114\1\0\4\114\2\0"+
+    "\16\114\1\222\2\114\1\222\2\114\1\222\10\114\1\222"+
+    "\4\114\1\222\7\114\1\0\2\223\1\224\1\0\1\225"+
+    "\11\223\2\0\52\223\1\0\1\113\1\114\1\217\3\0"+
+    "\1\114\1\134\3\0\1\215\5\0\3\114\1\0\1\114"+
+    "\10\0\11\114\1\0\4\114\1\0\2\114\1\0\1\114"+
+    "\1\0\3\114\6\0\2\226\1\227\1\0\4\226\1\225"+
+    "\5\226\2\0\52\226\1\0\1\230\72\0\1\113\12\0"+
+    "\1\215\57\0\2\231\1\232\3\0\2\231\11\0\3\231"+
+    "\1\0\1\231\10\0\11\231\1\0\4\231\1\0\2\231"+
+    "\1\0\1\231\1\0\3\231\6\0\2\114\1\217\3\0"+
+    "\2\114\3\0\1\220\1\233\4\0\1\114\1\234\1\114"+
+    "\1\221\1\114\10\0\11\114\1\0\4\114\1\0\2\114"+
+    "\1\0\1\114\1\0\3\114\11\0\1\235\1\0\1\235"+
+    "\3\0\1\235\4\0\2\235\30\0\1\236\21\0\4\237"+
+    "\1\131\1\237\1\131\3\237\1\131\4\237\2\131\12\237"+
+    "\1\0\14\237\1\0\22\237\1\0\1\240\1\25\1\132"+
+    "\1\25\1\0\1\25\1\240\1\25\1\0\1\25\4\0"+
+    "\2\25\1\0\3\25\1\0\1\25\10\0\1\240\2\25"+
+    "\1\240\2\25\1\240\2\25\1\0\4\25\1\0\1\240"+
+    "\1\25\1\0\1\25\1\0\1\240\2\25\37\0\1\241"+
+    "\41\0\1\242\2\135\1\0\2\135\1\242\2\135\1\0"+
+    "\4\135\2\0\16\135\1\242\2\135\1\242\2\135\1\242"+
+    "\10\135\1\242\4\135\1\242\7\135\1\0\1\243\2\137"+
+    "\1\0\2\137\1\243\2\137\1\0\4\137\2\0\16\137"+
+    "\1\243\2\137\1\243\2\137\1\243\10\137\1\243\4\137"+
+    "\1\243\7\137\10\0\1\244\62\0\35\142\1\245\35\142"+
+    "\41\0\1\246\103\0\1\247\65\0\2\250\66\0\2\251"+
+    "\103\0\1\252\17\0\2\150\1\151\3\0\2\150\11\0"+
+    "\3\150\1\253\1\150\10\0\11\150\1\0\4\150\1\0"+
+    "\2\150\1\0\1\150\1\0\3\150\6\0\1\254\2\150"+
+    "\1\0\2\150\1\254\2\150\1\0\4\150\2\0\16\150"+
+    "\1\254\2\150\1\254\2\150\1\254\10\150\1\254\4\150"+
+    "\1\254\7\150\2\0\1\150\1\151\3\0\1\150\12\0"+
+    "\3\150\1\0\1\150\10\0\11\150\1\0\4\150\1\0"+
+    "\2\150\1\0\1\150\1\0\3\150\6\0\1\255\1\153"+
+    "\1\154\1\153\1\256\1\153\1\255\10\153\1\257\16\153"+
+    "\1\255\2\153\1\255\2\153\1\255\10\153\1\255\4\153"+
+    "\1\255\7\153\1\0\1\260\1\156\1\157\3\156\1\260"+
+    "\1\156\1\261\6\156\1\262\16\156\1\260\2\156\1\260"+
+    "\2\156\1\260\10\156\1\260\4\156\1\260\7\156\1\0"+
+    "\1\263\1\160\1\161\1\160\1\264\1\160\1\263\10\160"+
+    "\1\265\16\160\1\263\2\160\1\263\2\160\1\263\10\160"+
+    "\1\263\4\160\1\263\7\160\1\0\1\266\1\163\1\164"+
+    "\3\163\1\266\1\163\1\267\6\163\1\270\16\163\1\266"+
+    "\2\163\1\266\2\163\1\266\10\163\1\266\4\163\1\266"+
+    "\7\163\24\0\1\271\47\0\1\272\1\51\1\166\1\51"+
+    "\1\0\1\51\1\272\1\51\1\0\1\51\4\0\2\51"+
+    "\1\0\3\51\1\0\1\51\10\0\1\272\2\51\1\272"+
+    "\2\51\1\272\2\51\1\0\4\51\1\0\1\272\1\51"+
+    "\1\0\1\51\1\0\1\272\2\51\6\0\1\273\1\55"+
+    "\1\170\1\55\1\0\1\55\1\273\1\55\1\0\1\55"+
+    "\4\0\2\55\1\0\3\55\1\0\1\55\10\0\1\273"+
+    "\2\55\1\273\2\55\1\273\2\55\1\0\4\55\1\0"+
+    "\1\273\1\55\1\0\1\55\1\0\1\273\2\55\6\0"+
+    "\1\274\1\62\1\172\1\62\1\0\1\62\1\274\1\62"+
+    "\1\0\1\62\4\0\2\62\1\0\3\62\1\0\1\62"+
+    "\10\0\1\274\2\62\1\274\2\62\1\274\2\62\1\0"+
+    "\4\62\1\0\1\274\1\62\1\0\1\62\1\0\1\274"+
+    "\2\62\7\0\1\62\1\172\3\0\1\62\12\0\3\62"+
+    "\1\0\1\62\10\0\11\62\1\0\4\62\1\0\2\62"+
+    "\1\0\1\62\1\0\3\62\6\0\1\275\1\72\1\176"+
+    "\1\72\1\0\1\72\1\275\1\72\1\0\1\72\4\0"+
+    "\2\72\1\0\3\72\1\0\1\72\10\0\1\275\2\72"+
+    "\1\275\2\72\1\275\2\72\1\0\4\72\1\0\1\275"+
+    "\1\72\1\0\1\72\1\0\1\275\2\72\6\0\1\276"+
+    "\1\100\1\200\1\100\1\0\1\100\1\276\1\100\1\0"+
+    "\1\100\4\0\2\100\1\0\3\100\1\0\1\100\10\0"+
+    "\1\276\2\100\1\276\2\100\1\276\2\100\1\0\4\100"+
+    "\1\0\1\276\1\100\1\0\1\100\1\0\1\276\2\100"+
+    "\6\0\1\277\1\202\1\203\1\202\1\300\1\202\1\277"+
+    "\10\202\1\301\16\202\1\277\2\202\1\277\2\202\1\277"+
+    "\10\202\1\277\4\202\1\277\7\202\1\0\1\302\1\205"+
+    "\1\206\3\205\1\302\1\205\1\303\6\205\1\304\16\205"+
+    "\1\302\2\205\1\302\2\205\1\302\10\205\1\302\4\205"+
+    "\1\302\7\205\1\0\1\305\1\105\1\207\1\105\1\0"+
+    "\1\105\1\305\1\105\1\0\1\105\4\0\2\105\1\0"+
+    "\3\105\1\0\1\105\10\0\1\305\2\105\1\305\2\105"+
+    "\1\305\2\105\1\0\4\105\1\0\1\305\1\105\1\0"+
+    "\1\105\1\0\1\305\2\105\7\0\1\105\1\207\3\0"+
+    "\1\105\12\0\3\105\1\0\1\105\10\0\11\105\1\0"+
+    "\4\105\1\0\2\105\1\0\1\105\1\0\3\105\6\0"+
+    "\2\212\1\213\3\0\2\212\11\0\3\212\1\0\1\212"+
+    "\10\0\11\212\1\0\4\212\1\0\2\212\1\0\1\212"+
+    "\1\0\3\212\6\0\1\306\2\212\1\0\2\212\1\306"+
+    "\2\212\1\0\4\212\2\0\16\212\1\306\2\212\1\306"+
+    "\2\212\1\306\10\212\1\306\4\212\1\306\7\212\2\0"+
+    "\1\212\1\213\3\0\1\212\12\0\3\212\1\0\1\212"+
+    "\10\0\11\212\1\0\4\212\1\0\2\212\1\0\1\212"+
+    "\1\0\3\212\6\0\2\307\1\310\3\0\2\307\11\0"+
+    "\3\307\1\0\1\307\10\0\11\307\1\0\4\307\1\0"+
+    "\2\307\1\0\1\307\1\0\3\307\6\0\1\311\1\114"+
+    "\1\217\1\114\1\0\1\114\1\311\1\114\1\0\1\114"+
+    "\1\0\1\220\2\0\2\114\1\0\3\114\1\221\1\114"+
+    "\10\0\1\311\2\114\1\311\2\114\1\311\2\114\1\0"+
+    "\4\114\1\0\1\311\1\114\1\0\1\114\1\0\1\311"+
+    "\2\114\6\0\1\312\1\223\1\224\1\223\1\313\1\223"+
+    "\1\312\10\223\1\314\16\223\1\312\2\223\1\312\2\223"+
+    "\1\312\10\223\1\312\4\223\1\312\7\223\1\0\1\315"+
+    "\1\226\1\227\3\226\1\315\1\226\1\316\6\226\1\317"+
+    "\16\226\1\315\2\226\1\315\2\226\1\315\10\226\1\315"+
+    "\4\226\1\315\7\226\1\0\1\230\1\212\1\213\3\0"+
+    "\1\212\1\214\11\0\3\212\1\0\1\212\10\0\11\212"+
+    "\1\0\4\212\1\0\2\212\1\0\1\212\1\0\3\212"+
+    "\4\0\1\216\1\0\1\320\2\231\1\0\2\231\1\320"+
+    "\2\231\1\0\4\231\2\0\16\231\1\320\2\231\1\320"+
+    "\2\231\1\320\10\231\1\320\4\231\1\320\7\231\1\0"+
+    "\1\321\5\0\1\321\16\0\2\321\7\0\2\321\1\0"+
+    "\2\321\1\0\2\321\7\0\2\321\3\0\2\321\7\0"+
+    "\2\114\1\217\3\0\2\114\3\0\1\220\5\0\2\114"+
+    "\1\322\1\221\1\114\10\0\11\114\1\0\4\114\1\0"+
+    "\2\114\1\0\1\114\1\0\3\114\57\0\1\323\21\0"+
+    "\1\324\1\25\1\132\1\25\1\0\1\25\1\324\1\25"+
+    "\1\0\1\25\4\0\2\25\1\0\3\25\1\0\1\25"+
+    "\10\0\1\324\2\25\1\324\2\25\1\324\2\25\1\0"+
+    "\4\25\1\0\1\324\1\25\1\0\1\25\1\0\1\324"+
+    "\2\25\6\0\1\325\1\135\1\136\1\135\1\0\1\135"+
+    "\1\325\1\135\1\0\1\135\4\0\2\135\1\0\3\135"+
+    "\1\0\1\135\10\0\1\325\2\135\1\325\2\135\1\325"+
+    "\2\135\1\0\4\135\1\0\1\325\1\135\1\0\1\135"+
+    "\1\0\1\325\2\135\6\0\1\326\1\137\1\140\1\137"+
+    "\1\0\1\137\1\326\1\137\1\0\1\137\4\0\2\137"+
+    "\1\0\3\137\1\0\1\137\10\0\1\326\2\137\1\326"+
+    "\2\137\1\326\2\137\1\0\4\137\1\0\1\326\1\137"+
+    "\1\0\1\137\1\0\1\326\2\137\15\0\1\327\62\0"+
+    "\34\142\1\330\1\245\35\142\42\0\2\331\102\0\1\332"+
+    "\75\0\2\333\74\0\1\334\76\0\1\335\7\0\1\336"+
+    "\1\337\1\253\1\0\1\253\1\336\1\340\1\0\1\253"+
+    "\4\0\2\253\1\0\3\336\1\0\1\336\10\0\11\336"+
+    "\1\0\4\336\1\0\2\336\1\0\1\336\1\0\3\336"+
+    "\6\0\1\341\1\150\1\151\1\150\1\0\1\150\1\341"+
+    "\1\150\1\0\1\150\4\0\2\150\1\0\3\150\1\253"+
+    "\1\150\10\0\1\341\2\150\1\341\2\150\1\341\2\150"+
+    "\1\0\4\150\1\0\1\341\1\150\1\0\1\150\1\0"+
+    "\1\341\2\150\6\0\1\342\1\153\1\154\1\153\1\155"+
+    "\1\153\1\342\27\153\1\342\2\153\1\342\2\153\1\342"+
+    "\10\153\1\342\4\153\1\342\7\153\1\0\2\153\1\154"+
+    "\1\0\1\155\12\153\1\0\52\153\1\0\1\343\1\156"+
+    "\1\157\3\156\1\343\1\156\1\155\25\156\1\343\2\156"+
+    "\1\343\2\156\1\343\10\156\1\343\4\156\1\343\7\156"+
+    "\1\0\2\156\1\157\1\0\4\156\1\155\6\156\1\0"+
+    "\52\156\1\0\1\344\1\160\1\161\1\160\1\162\1\160"+
+    "\1\344\27\160\1\344\2\160\1\344\2\160\1\344\10\160"+
+    "\1\344\4\160\1\344\7\160\1\0\2\160\1\161\1\0"+
+    "\1\162\12\160\1\0\52\160\1\0\1\345\1\163\1\164"+
+    "\3\163\1\345\1\163\1\162\25\163\1\345\2\163\1\345"+
+    "\2\163\1\345\10\163\1\345\4\163\1\345\7\163\1\0"+
+    "\2\163\1\164\1\0\4\163\1\162\6\163\1\0\52\163"+
+    "\25\0\1\346\46\0\1\347\1\51\1\166\1\51\1\0"+
+    "\1\51\1\347\1\51\1\0\1\51\4\0\2\51\1\0"+
+    "\3\51\1\0\1\51\10\0\1\347\2\51\1\347\2\51"+
+    "\1\347\2\51\1\0\4\51\1\0\1\347\1\51\1\0"+
+    "\1\51\1\0\1\347\2\51\6\0\1\350\1\55\1\170"+
+    "\1\55\1\0\1\55\1\350\1\55\1\0\1\55\4\0"+
+    "\2\55\1\0\3\55\1\0\1\55\10\0\1\350\2\55"+
+    "\1\350\2\55\1\350\2\55\1\0\4\55\1\0\1\350"+
+    "\1\55\1\0\1\55\1\0\1\350\2\55\6\0\1\351"+
+    "\1\62\1\172\1\62\1\0\1\62\1\351\1\62\1\0"+
+    "\1\62\4\0\2\62\1\0\3\62\1\0\1\62\10\0"+
+    "\1\351\2\62\1\351\2\62\1\351\2\62\1\0\4\62"+
+    "\1\0\1\351\1\62\1\0\1\62\1\0\1\351\2\62"+
+    "\6\0\1\352\1\72\1\176\1\72\1\0\1\72\1\352"+
+    "\1\72\1\0\1\72\4\0\2\72\1\0\3\72\1\0"+
+    "\1\72\10\0\1\352\2\72\1\352\2\72\1\352\2\72"+
+    "\1\0\4\72\1\0\1\352\1\72\1\0\1\72\1\0"+
+    "\1\352\2\72\6\0\1\353\1\100\1\200\1\100\1\0"+
+    "\1\100\1\353\1\100\1\0\1\100\4\0\2\100\1\0"+
+    "\3\100\1\0\1\100\10\0\1\353\2\100\1\353\2\100"+
+    "\1\353\2\100\1\0\4\100\1\0\1\353\1\100\1\0"+
+    "\1\100\1\0\1\353\2\100\6\0\1\354\1\202\1\203"+
+    "\1\202\1\204\1\202\1\354\27\202\1\354\2\202\1\354"+
+    "\2\202\1\354\10\202\1\354\4\202\1\354\7\202\1\0"+
+    "\2\202\1\203\1\0\1\204\12\202\1\0\52\202\1\0"+
+    "\1\355\1\205\1\206\3\205\1\355\1\205\1\204\25\205"+
+    "\1\355\2\205\1\355\2\205\1\355\10\205\1\355\4\205"+
+    "\1\355\7\205\1\0\2\205\1\206\1\0\4\205\1\204"+
+    "\6\205\1\0\52\205\1\0\1\356\1\105\1\207\1\105"+
+    "\1\0\1\105\1\356\1\105\1\0\1\105\4\0\2\105"+
+    "\1\0\3\105\1\0\1\105\10\0\1\356\2\105\1\356"+
+    "\2\105\1\356\2\105\1\0\4\105\1\0\1\356\1\105"+
+    "\1\0\1\105\1\0\1\356\2\105\6\0\1\357\1\212"+
+    "\1\213\1\212\1\0\1\212\1\357\1\212\1\0\1\212"+
+    "\4\0\2\212\1\0\3\212\1\0\1\212\10\0\1\357"+
+    "\2\212\1\357\2\212\1\357\2\212\1\0\4\212\1\0"+
+    "\1\357\1\212\1\0\1\212\1\0\1\357\2\212\6\0"+
+    "\2\307\1\310\3\0\2\307\3\0\1\220\5\0\3\307"+
+    "\1\0\1\307\10\0\11\307\1\0\4\307\1\0\2\307"+
+    "\1\0\1\307\1\0\3\307\6\0\1\360\2\307\1\0"+
+    "\2\307\1\360\2\307\1\0\4\307\2\0\16\307\1\360"+
+    "\2\307\1\360\2\307\1\360\10\307\1\360\4\307\1\360"+
+    "\7\307\1\0\1\361\1\114\1\217\1\114\1\0\1\114"+
+    "\1\361\1\114\1\0\1\114\1\0\1\220\2\0\2\114"+
+    "\1\0\3\114\1\221\1\114\10\0\1\361\2\114\1\361"+
+    "\2\114\1\361\2\114\1\0\4\114\1\0\1\361\1\114"+
+    "\1\0\1\114\1\0\1\361\2\114\6\0\1\362\1\223"+
+    "\1\224\1\223\1\225\1\223\1\362\27\223\1\362\2\223"+
+    "\1\362\2\223\1\362\10\223\1\362\4\223\1\362\7\223"+
+    "\1\0\2\223\1\224\1\0\1\225\12\223\1\0\52\223"+
+    "\1\0\1\363\1\226\1\227\3\226\1\363\1\226\1\225"+
+    "\25\226\1\363\2\226\1\363\2\226\1\363\10\226\1\363"+
+    "\4\226\1\363\7\226\1\0\2\226\1\227\1\0\4\226"+
+    "\1\225\6\226\1\0\52\226\1\0\1\364\1\231\1\232"+
+    "\1\231\1\0\1\231\1\364\1\231\1\0\1\231\4\0"+
+    "\2\231\1\0\3\231\1\0\1\231\10\0\1\364\2\231"+
+    "\1\364\2\231\1\364\2\231\1\0\4\231\1\0\1\364"+
+    "\1\231\1\0\1\231\1\0\1\364\2\231\6\0\1\365"+
+    "\5\0\1\365\1\366\15\0\2\365\7\0\2\365\1\0"+
+    "\2\365\1\0\2\365\7\0\2\365\3\0\2\365\7\0"+
+    "\2\114\1\217\3\0\2\114\3\0\1\220\5\0\3\114"+
+    "\1\367\1\114\10\0\11\114\1\0\4\114\1\0\2\114"+
+    "\1\0\1\114\1\0\3\114\60\0\1\370\20\0\1\371"+
+    "\1\25\1\132\1\25\1\0\1\25\1\371\1\25\1\0"+
+    "\1\25\4\0\2\25\1\0\3\25\1\0\1\25\10\0"+
+    "\1\371\2\25\1\371\2\25\1\371\2\25\1\0\4\25"+
+    "\1\0\1\371\1\25\1\0\1\25\1\0\1\371\2\25"+
+    "\6\0\1\372\1\135\1\136\1\135\1\0\1\135\1\372"+
+    "\1\135\1\0\1\135\4\0\2\135\1\0\3\135\1\0"+
+    "\1\135\10\0\1\372\2\135\1\372\2\135\1\372\2\135"+
+    "\1\0\4\135\1\0\1\372\1\135\1\0\1\135\1\0"+
+    "\1\372\2\135\6\0\1\373\1\137\1\140\1\137\1\0"+
+    "\1\137\1\373\1\137\1\0\1\137\4\0\2\137\1\0"+
+    "\3\137\1\0\1\137\10\0\1\373\2\137\1\373\2\137"+
+    "\1\373\2\137\1\0\4\137\1\0\1\373\1\137\1\0"+
+    "\1\137\1\0\1\373\2\137\30\0\1\374\123\0\1\375"+
+    "\67\0\1\376\66\0\2\377\73\0\1\u0100\24\0\2\336"+
+    "\1\337\1\u0101\1\0\1\u0101\2\336\1\0\1\u0101\1\u0102"+
+    "\3\0\2\u0101\1\0\3\336\1\0\1\336\10\0\11\336"+
+    "\1\0\4\336\1\0\2\336\1\0\1\336\1\0\3\336"+
+    "\6\0\1\u0103\2\336\1\0\2\336\1\u0103\2\336\1\0"+
+    "\4\336\2\0\16\336\1\u0103\2\336\1\u0103\2\336\1\u0103"+
+    "\10\336\1\u0103\4\336\1\u0103\7\336\2\0\1\336\1\337"+
+    "\3\0\1\336\12\0\3\336\1\0\1\336\10\0\11\336"+
+    "\1\0\4\336\1\0\2\336\1\0\1\336\1\0\3\336"+
+    "\6\0\1\u0104\1\150\1\151\1\150\1\0\1\150\1\u0104"+
+    "\1\150\1\0\1\150\4\0\2\150\1\0\3\150\1\253"+
+    "\1\150\10\0\1\u0104\2\150\1\u0104\2\150\1\u0104\2\150"+
+    "\1\0\4\150\1\0\1\u0104\1\150\1\0\1\150\1\0"+
+    "\1\u0104\2\150\6\0\1\u0105\1\153\1\154\1\153\1\155"+
+    "\1\153\1\u0105\27\153\1\u0105\2\153\1\u0105\2\153\1\u0105"+
+    "\10\153\1\u0105\4\153\1\u0105\7\153\1\0\1\u0106\1\156"+
+    "\1\157\3\156\1\u0106\1\156\1\155\25\156\1\u0106\2\156"+
+    "\1\u0106\2\156\1\u0106\10\156\1\u0106\4\156\1\u0106\7\156"+
+    "\1\0\1\u0107\1\160\1\161\1\160\1\162\1\160\1\u0107"+
+    "\27\160\1\u0107\2\160\1\u0107\2\160\1\u0107\10\160\1\u0107"+
+    "\4\160\1\u0107\7\160\1\0\1\u0108\1\163\1\164\3\163"+
+    "\1\u0108\1\163\1\162\25\163\1\u0108\2\163\1\u0108\2\163"+
+    "\1\u0108\10\163\1\u0108\4\163\1\u0108\7\163\1\0\2\u0109"+
+    "\1\u010a\1\346\1\u010b\1\346\2\u0109\1\u010c\1\346\1\u010d"+
+    "\3\u0109\2\346\4\u0109\1\0\45\u0109\1\0\1\u010e\1\51"+
+    "\1\166\1\51\1\0\1\51\1\u010e\1\51\1\0\1\51"+
+    "\4\0\2\51\1\0\3\51\1\0\1\51\10\0\1\u010e"+
+    "\2\51\1\u010e\2\51\1\u010e\2\51\1\0\4\51\1\0"+
+    "\1\u010e\1\51\1\0\1\51\1\0\1\u010e\2\51\6\0"+
+    "\1\u010f\1\55\1\170\1\55\1\0\1\55\1\u010f\1\55"+
+    "\1\0\1\55\4\0\2\55\1\0\3\55\1\0\1\55"+
+    "\10\0\1\u010f\2\55\1\u010f\2\55\1\u010f\2\55\1\0"+
+    "\4\55\1\0\1\u010f\1\55\1\0\1\55\1\0\1\u010f"+
+    "\2\55\6\0\1\u0110\1\62\1\172\1\62\1\0\1\62"+
+    "\1\u0110\1\62\1\0\1\62\4\0\2\62\1\0\3\62"+
+    "\1\0\1\62\10\0\1\u0110\2\62\1\u0110\2\62\1\u0110"+
+    "\2\62\1\0\4\62\1\0\1\u0110\1\62\1\0\1\62"+
+    "\1\0\1\u0110\2\62\6\0\1\u0111\1\72\1\176\1\72"+
+    "\1\0\1\72\1\u0111\1\72\1\0\1\72\4\0\2\72"+
+    "\1\0\3\72\1\0\1\72\10\0\1\u0111\2\72\1\u0111"+
+    "\2\72\1\u0111\2\72\1\0\4\72\1\0\1\u0111\1\72"+
+    "\1\0\1\72\1\0\1\u0111\2\72\6\0\1\u0112\1\100"+
+    "\1\200\1\100\1\0\1\100\1\u0112\1\100\1\0\1\100"+
+    "\4\0\2\100\1\0\3\100\1\0\1\100\10\0\1\u0112"+
+    "\2\100\1\u0112\2\100\1\u0112\2\100\1\0\4\100\1\0"+
+    "\1\u0112\1\100\1\0\1\100\1\0\1\u0112\2\100\6\0"+
+    "\1\u0113\1\202\1\203\1\202\1\204\1\202\1\u0113\27\202"+
+    "\1\u0113\2\202\1\u0113\2\202\1\u0113\10\202\1\u0113\4\202"+
+    "\1\u0113\7\202\1\0\1\u0114\1\205\1\206\3\205\1\u0114"+
+    "\1\205\1\204\25\205\1\u0114\2\205\1\u0114\2\205\1\u0114"+
+    "\10\205\1\u0114\4\205\1\u0114\7\205\1\0\1\u0115\1\105"+
+    "\1\207\1\105\1\0\1\105\1\u0115\1\105\1\0\1\105"+
+    "\4\0\2\105\1\0\3\105\1\0\1\105\10\0\1\u0115"+
+    "\2\105\1\u0115\2\105\1\u0115\2\105\1\0\4\105\1\0"+
+    "\1\u0115\1\105\1\0\1\105\1\0\1\u0115\2\105\6\0"+
+    "\1\u0116\1\212\1\213\1\212\1\0\1\212\1\u0116\1\212"+
+    "\1\0\1\212\4\0\2\212\1\0\3\212\1\0\1\212"+
+    "\10\0\1\u0116\2\212\1\u0116\2\212\1\u0116\2\212\1\0"+
+    "\4\212\1\0\1\u0116\1\212\1\0\1\212\1\0\1\u0116"+
+    "\2\212\6\0\1\u0117\1\307\1\310\1\307\1\0\1\307"+
+    "\1\u0117\1\307\1\0\1\307\1\0\1\220\2\0\2\307"+
+    "\1\0\3\307\1\0\1\307\10\0\1\u0117\2\307\1\u0117"+
+    "\2\307\1\u0117\2\307\1\0\4\307\1\0\1\u0117\1\307"+
+    "\1\0\1\307\1\0\1\u0117\2\307\6\0\1\u0118\1\114"+
+    "\1\217\1\114\1\0\1\114\1\u0118\1\114\1\0\1\114"+
+    "\1\0\1\220\2\0\2\114\1\0\3\114\1\221\1\114"+
+    "\10\0\1\u0118\2\114\1\u0118\2\114\1\u0118\2\114\1\0"+
+    "\4\114\1\0\1\u0118\1\114\1\0\1\114\1\0\1\u0118"+
+    "\2\114\6\0\1\u0119\1\223\1\224\1\223\1\225\1\223"+
+    "\1\u0119\27\223\1\u0119\2\223\1\u0119\2\223\1\u0119\10\223"+
+    "\1\u0119\4\223\1\u0119\7\223\1\0\1\u011a\1\226\1\227"+
+    "\3\226\1\u011a\1\226\1\225\25\226\1\u011a\2\226\1\u011a"+
+    "\2\226\1\u011a\10\226\1\u011a\4\226\1\u011a\7\226\1\0"+
+    "\1\u011b\1\231\1\232\1\231\1\0\1\231\1\u011b\1\231"+
+    "\1\0\1\231\4\0\2\231\1\0\3\231\1\0\1\231"+
+    "\10\0\1\u011b\2\231\1\u011b\2\231\1\u011b\2\231\1\0"+
+    "\4\231\1\0\1\u011b\1\231\1\0\1\231\1\0\1\u011b"+
+    "\2\231\6\0\1\u011c\5\0\1\u011c\1\366\15\0\2\u011c"+
+    "\7\0\2\u011c\1\0\2\u011c\1\0\2\u011c\7\0\2\u011c"+
+    "\3\0\2\u011c\7\0\1\u011d\5\0\1\u011d\16\0\2\u011d"+
+    "\7\0\2\u011d\1\0\2\u011d\1\0\2\u011d\7\0\2\u011d"+
+    "\3\0\2\u011d\7\0\2\u011e\1\u011f\1\u0120\1\u0121\1\u0120"+
+    "\2\u011e\1\u0122\1\u0120\1\u0123\3\u011e\2\u0120\4\u011e\1\0"+
+    "\45\u011e\54\0\1\u0124\17\0\1\u0125\1\25\1\132\1\25"+
+    "\1\0\1\25\1\u0125\1\25\1\0\1\25\4\0\2\25"+
+    "\1\0\3\25\1\0\1\25\10\0\1\u0125\2\25\1\u0125"+
+    "\2\25\1\u0125\2\25\1\0\4\25\1\0\1\u0125\1\25"+
+    "\1\0\1\25\1\0\1\u0125\2\25\6\0\1\u0126\1\135"+
+    "\1\136\1\135\1\0\1\135\1\u0126\1\135\1\0\1\135"+
+    "\4\0\2\135\1\0\3\135\1\0\1\135\10\0\1\u0126"+
+    "\2\135\1\u0126\2\135\1\u0126\2\135\1\0\4\135\1\0"+
+    "\1\u0126\1\135\1\0\1\135\1\0\1\u0126\2\135\6\0"+
+    "\1\u0127\1\137\1\140\1\137\1\0\1\137\1\u0127\1\137"+
+    "\1\0\1\137\4\0\2\137\1\0\3\137\1\0\1\137"+
+    "\10\0\1\u0127\2\137\1\u0127\2\137\1\u0127\2\137\1\0"+
+    "\4\137\1\0\1\u0127\1\137\1\0\1\137\1\0\1\u0127"+
+    "\2\137\51\0\1\u0128\51\0\1\u0129\111\0\2\u012a\37\0"+
+    "\1\u012b\66\0\1\u0101\1\0\1\u0101\3\0\1\u0101\1\u0102"+
+    "\3\0\2\u0101\53\0\1\u012c\1\336\1\337\1\336\1\0"+
+    "\1\336\1\u012c\1\336\1\0\1\336\1\u0102\3\0\2\336"+
+    "\1\0\3\336\1\0\1\336\10\0\1\u012c\2\336\1\u012c"+
+    "\2\336\1\u012c\2\336\1\0\4\336\1\0\1\u012c\1\336"+
+    "\1\0\1\336\1\0\1\u012c\2\336\6\0\1\u012d\1\150"+
+    "\1\151\1\150\1\0\1\150\1\u012d\1\150\1\0\1\150"+
+    "\4\0\2\150\1\0\3\150\1\253\1\150\10\0\1\u012d"+
+    "\2\150\1\u012d\2\150\1\u012d\2\150\1\0\4\150\1\0"+
+    "\1\u012d\1\150\1\0\1\150\1\0\1\u012d\2\150\6\0"+
+    "\1\u012e\1\153\1\154\1\153\1\155\1\153\1\u012e\27\153"+
+    "\1\u012e\2\153\1\u012e\2\153\1\u012e\10\153\1\u012e\4\153"+
+    "\1\u012e\7\153\1\0\1\u012f\1\156\1\157\3\156\1\u012f"+
+    "\1\156\1\155\25\156\1\u012f\2\156\1\u012f\2\156\1\u012f"+
+    "\10\156\1\u012f\4\156\1\u012f\7\156\1\0\1\u0130\1\160"+
+    "\1\161\1\160\1\162\1\160\1\u0130\27\160\1\u0130\2\160"+
+    "\1\u0130\2\160\1\u0130\10\160\1\u0130\4\160\1\u0130\7\160"+
+    "\1\0\1\u0131\1\163\1\164\3\163\1\u0131\1\163\1\162"+
+    "\25\163\1\u0131\2\163\1\u0131\2\163\1\u0131\10\163\1\u0131"+
+    "\4\163\1\u0131\7\163\1\0\2\u0109\1\u010a\1\u0132\1\0"+
+    "\3\u0109\1\0\1\u0132\1\u010d\3\u0109\2\u0132\4\u0109\1\0"+
+    "\45\u0109\1\0\1\u0133\1\u0109\1\u010a\1\u0132\2\u0109\1\u0133"+
+    "\2\u0109\1\u0132\1\u0134\3\u0109\2\u0132\16\u0109\1\u0133\2\u0109"+
+    "\1\u0133\2\u0109\1\u0133\10\u0109\1\u0133\4\u0109\1\u0133\7\u0109"+
+    "\1\0\2\u010b\1\u0135\1\0\1\u0132\11\u010b\2\0\52\u010b"+
+    "\1\0\2\u010c\1\u0136\1\0\4\u010c\1\u0132\5\u010c\2\0"+
+    "\52\u010c\1\0\1\u0137\1\51\1\166\1\51\1\0\1\51"+
+    "\1\u0137\1\51\1\0\1\51\4\0\2\51\1\0\3\51"+
+    "\1\0\1\51\10\0\1\u0137\2\51\1\u0137\2\51\1\u0137"+
+    "\2\51\1\0\4\51\1\0\1\u0137\1\51\1\0\1\51"+
+    "\1\0\1\u0137\2\51\6\0\1\u0138\1\55\1\170\1\55"+
+    "\1\0\1\55\1\u0138\1\55\1\0\1\55\4\0\2\55"+
+    "\1\0\3\55\1\0\1\55\10\0\1\u0138\2\55\1\u0138"+
+    "\2\55\1\u0138\2\55\1\0\4\55\1\0\1\u0138\1\55"+
+    "\1\0\1\55\1\0\1\u0138\2\55\6\0\1\u0139\1\62"+
+    "\1\172\1\62\1\0\1\62\1\u0139\1\62\1\0\1\62"+
+    "\4\0\2\62\1\0\3\62\1\0\1\62\10\0\1\u0139"+
+    "\2\62\1\u0139\2\62\1\u0139\2\62\1\0\4\62\1\0"+
+    "\1\u0139\1\62\1\0\1\62\1\0\1\u0139\2\62\6\0"+
+    "\1\u013a\1\72\1\176\1\72\1\0\1\72\1\u013a\1\72"+
+    "\1\0\1\72\4\0\2\72\1\0\3\72\1\0\1\72"+
+    "\10\0\1\u013a\2\72\1\u013a\2\72\1\u013a\2\72\1\0"+
+    "\4\72\1\0\1\u013a\1\72\1\0\1\72\1\0\1\u013a"+
+    "\2\72\6\0\1\u013b\1\100\1\200\1\100\1\0\1\100"+
+    "\1\u013b\1\100\1\0\1\100\4\0\2\100\1\0\3\100"+
+    "\1\0\1\100\10\0\1\u013b\2\100\1\u013b\2\100\1\u013b"+
+    "\2\100\1\0\4\100\1\0\1\u013b\1\100\1\0\1\100"+
+    "\1\0\1\u013b\2\100\6\0\1\u013c\1\202\1\203\1\202"+
+    "\1\204\1\202\1\u013c\27\202\1\u013c\2\202\1\u013c\2\202"+
+    "\1\u013c\10\202\1\u013c\4\202\1\u013c\7\202\1\0\1\u013d"+
+    "\1\205\1\206\3\205\1\u013d\1\205\1\204\25\205\1\u013d"+
+    "\2\205\1\u013d\2\205\1\u013d\10\205\1\u013d\4\205\1\u013d"+
+    "\7\205\1\0\1\u013e\1\105\1\207\1\105\1\0\1\105"+
+    "\1\u013e\1\105\1\0\1\105\4\0\2\105\1\0\3\105"+
+    "\1\0\1\105\10\0\1\u013e\2\105\1\u013e\2\105\1\u013e"+
+    "\2\105\1\0\4\105\1\0\1\u013e\1\105\1\0\1\105"+
+    "\1\0\1\u013e\2\105\6\0\1\u013f\1\212\1\213\1\212"+
+    "\1\0\1\212\1\u013f\1\212\1\0\1\212\4\0\2\212"+
+    "\1\0\3\212\1\0\1\212\10\0\1\u013f\2\212\1\u013f"+
+    "\2\212\1\u013f\2\212\1\0\4\212\1\0\1\u013f\1\212"+
+    "\1\0\1\212\1\0\1\u013f\2\212\6\0\1\u0140\1\307"+
+    "\1\310\1\307\1\0\1\307\1\u0140\1\307\1\0\1\307"+
+    "\1\0\1\220\2\0\2\307\1\0\3\307\1\0\1\307"+
+    "\10\0\1\u0140\2\307\1\u0140\2\307\1\u0140\2\307\1\0"+
+    "\4\307\1\0\1\u0140\1\307\1\0\1\307\1\0\1\u0140"+
+    "\2\307\6\0\1\u0141\1\114\1\217\1\114\1\0\1\114"+
+    "\1\u0141\1\114\1\0\1\114\1\0\1\220\2\0\2\114"+
+    "\1\0\3\114\1\221\1\114\10\0\1\u0141\2\114\1\u0141"+
+    "\2\114\1\u0141\2\114\1\0\4\114\1\0\1\u0141\1\114"+
+    "\1\0\1\114\1\0\1\u0141\2\114\6\0\1\u0142\1\223"+
+    "\1\224\1\223\1\225\1\223\1\u0142\27\223\1\u0142\2\223"+
+    "\1\u0142\2\223\1\u0142\10\223\1\u0142\4\223\1\u0142\7\223"+
+    "\1\0\1\u0143\1\226\1\227\3\226\1\u0143\1\226\1\225"+
+    "\25\226\1\u0143\2\226\1\u0143\2\226\1\u0143\10\226\1\u0143"+
+    "\4\226\1\u0143\7\226\1\0\1\u0144\1\231\1\232\1\231"+
+    "\1\0\1\231\1\u0144\1\231\1\0\1\231\4\0\2\231"+
+    "\1\0\3\231\1\0\1\231\10\0\1\u0144\2\231\1\u0144"+
+    "\2\231\1\u0144\2\231\1\0\4\231\1\0\1\u0144\1\231"+
+    "\1\0\1\231\1\0\1\u0144\2\231\6\0\1\u0145\5\0"+
+    "\1\u0145\1\366\15\0\2\u0145\7\0\2\u0145\1\0\2\u0145"+
+    "\1\0\2\u0145\7\0\2\u0145\3\0\2\u0145\7\0\1\u0146"+
+    "\5\0\1\u0146\16\0\2\u0146\7\0\2\u0146\1\0\2\u0146"+
+    "\1\0\2\u0146\7\0\2\u0146\3\0\2\u0146\7\0\2\u011e"+
+    "\1\u011f\1\u0147\1\0\3\u011e\1\0\1\u0147\1\u0123\3\u011e"+
+    "\2\u0147\4\u011e\1\0\45\u011e\1\0\1\u0148\1\u011e\1\u011f"+
+    "\1\u0147\2\u011e\1\u0148\2\u011e\1\u0147\1\u0149\3\u011e\2\u0147"+
+    "\16\u011e\1\u0148\2\u011e\1\u0148\2\u011e\1\u0148\10\u011e\1\u0148"+
+    "\4\u011e\1\u0148\7\u011e\1\0\2\u0121\1\u014a\1\0\1\u0147"+
+    "\11\u0121\2\0\52\u0121\1\0\2\u0122\1\u014b\1\0\4\u0122"+
+    "\1\u0147\5\u0122\2\0\52\u0122\23\0\1\u014c\50\0\1\u014d"+
+    "\1\25\1\132\1\25\1\0\1\25\1\u014d\1\25\1\0"+
+    "\1\25\4\0\2\25\1\0\3\25\1\0\1\25\10\0"+
+    "\1\u014d\2\25\1\u014d\2\25\1\u014d\2\25\1\0\4\25"+
+    "\1\0\1\u014d\1\25\1\0\1\25\1\0\1\u014d\2\25"+
+    "\6\0\1\u014e\1\135\1\136\1\135\1\0\1\135\1\u014e"+
+    "\1\135\1\0\1\135\4\0\2\135\1\0\3\135\1\0"+
+    "\1\135\10\0\1\u014e\2\135\1\u014e\2\135\1\u014e\2\135"+
+    "\1\0\4\135\1\0\1\u014e\1\135\1\0\1\135\1\0"+
+    "\1\u014e\2\135\6\0\1\u014f\1\137\1\140\1\137\1\0"+
+    "\1\137\1\u014f\1\137\1\0\1\137\4\0\2\137\1\0"+
+    "\3\137\1\0\1\137\10\0\1\u014f\2\137\1\u014f\2\137"+
+    "\1\u014f\2\137\1\0\4\137\1\0\1\u014f\1\137\1\0"+
+    "\1\137\1\0\1\u014f\2\137\52\0\2\u0150\73\0\1\u0151"+
+    "\106\0\2\u0152\7\0\1\u0153\1\336\1\337\1\336\1\0"+
+    "\1\336\1\u0153\1\336\1\0\1\336\1\u0102\3\0\2\336"+
+    "\1\0\3\336\1\0\1\336\10\0\1\u0153\2\336\1\u0153"+
+    "\2\336\1\u0153\2\336\1\0\4\336\1\0\1\u0153\1\336"+
+    "\1\0\1\336\1\0\1\u0153\2\336\6\0\1\u0154\1\150"+
+    "\1\151\1\150\1\0\1\150\1\u0154\1\150\1\0\1\150"+
+    "\4\0\2\150\1\0\3\150\1\253\1\150\10\0\1\u0154"+
+    "\2\150\1\u0154\2\150\1\u0154\2\150\1\0\4\150\1\0"+
+    "\1\u0154\1\150\1\0\1\150\1\0\1\u0154\2\150\6\0"+
+    "\1\u0155\1\153\1\154\1\153\1\155\1\153\1\u0155\27\153"+
+    "\1\u0155\2\153\1\u0155\2\153\1\u0155\10\153\1\u0155\4\153"+
+    "\1\u0155\7\153\1\0\1\u0156\1\156\1\157\3\156\1\u0156"+
+    "\1\156\1\155\25\156\1\u0156\2\156\1\u0156\2\156\1\u0156"+
+    "\10\156\1\u0156\4\156\1\u0156\7\156\1\0\1\u0157\1\160"+
+    "\1\161\1\160\1\162\1\160\1\u0157\27\160\1\u0157\2\160"+
+    "\1\u0157\2\160\1\u0157\10\160\1\u0157\4\160\1\u0157\7\160"+
+    "\1\0\1\u0158\1\163\1\164\3\163\1\u0158\1\163\1\162"+
+    "\25\163\1\u0158\2\163\1\u0158\2\163\1\u0158\10\163\1\u0158"+
+    "\4\163\1\u0158\7\163\4\0\1\u0132\1\0\1\u0132\3\0"+
+    "\1\u0132\1\u010d\3\0\2\u0132\53\0\1\u0159\1\u0109\1\u010a"+
+    "\1\u0109\1\0\1\u0109\1\u0159\1\u0109\1\0\1\u0109\1\u010d"+
+    "\11\u0109\1\0\11\u0109\1\u0159\2\u0109\1\u0159\2\u0109\1\u0159"+
+    "\10\u0109\1\u0159\4\u0109\1\u0159\7\u0109\1\0\1\u015a\1\u010b"+
+    "\1\u0135\1\u010b\1\u015b\1\u010b\1\u015a\10\u010b\1\u015c\16\u010b"+
+    "\1\u015a\2\u010b\1\u015a\2\u010b\1\u015a\10\u010b\1\u015a\4\u010b"+
+    "\1\u015a\7\u010b\1\0\1\u015d\1\u010c\1\u0136\3\u010c\1\u015d"+
+    "\1\u010c\1\u015e\6\u010c\1\u015f\16\u010c\1\u015d\2\u010c\1\u015d"+
+    "\2\u010c\1\u015d\10\u010c\1\u015d\4\u010c\1\u015d\7\u010c\1\0"+
+    "\1\u0160\1\51\1\166\1\51\1\0\1\51\1\u0160\1\51"+
+    "\1\0\1\51\4\0\2\51\1\0\3\51\1\0\1\51"+
+    "\10\0\1\u0160\2\51\1\u0160\2\51\1\u0160\2\51\1\0"+
+    "\4\51\1\0\1\u0160\1\51\1\0\1\51\1\0\1\u0160"+
+    "\2\51\6\0\1\u0161\1\55\1\170\1\55\1\0\1\55"+
+    "\1\u0161\1\55\1\0\1\55\4\0\2\55\1\0\3\55"+
+    "\1\0\1\55\10\0\1\u0161\2\55\1\u0161\2\55\1\u0161"+
+    "\2\55\1\0\4\55\1\0\1\u0161\1\55\1\0\1\55"+
+    "\1\0\1\u0161\2\55\6\0\1\u0162\1\62\1\172\1\62"+
+    "\1\0\1\62\1\u0162\1\62\1\0\1\62\4\0\2\62"+
+    "\1\0\3\62\1\0\1\62\10\0\1\u0162\2\62\1\u0162"+
+    "\2\62\1\u0162\2\62\1\0\4\62\1\0\1\u0162\1\62"+
+    "\1\0\1\62\1\0\1\u0162\2\62\6\0\1\u0163\1\72"+
+    "\1\176\1\72\1\0\1\72\1\u0163\1\72\1\0\1\72"+
+    "\4\0\2\72\1\0\3\72\1\0\1\72\10\0\1\u0163"+
+    "\2\72\1\u0163\2\72\1\u0163\2\72\1\0\4\72\1\0"+
+    "\1\u0163\1\72\1\0\1\72\1\0\1\u0163\2\72\6\0"+
+    "\1\u0164\1\100\1\200\1\100\1\0\1\100\1\u0164\1\100"+
+    "\1\0\1\100\4\0\2\100\1\0\3\100\1\0\1\100"+
+    "\10\0\1\u0164\2\100\1\u0164\2\100\1\u0164\2\100\1\0"+
+    "\4\100\1\0\1\u0164\1\100\1\0\1\100\1\0\1\u0164"+
+    "\2\100\6\0\1\u0165\1\202\1\203\1\202\1\204\1\202"+
+    "\1\u0165\27\202\1\u0165\2\202\1\u0165\2\202\1\u0165\10\202"+
+    "\1\u0165\4\202\1\u0165\7\202\1\0\1\u0166\1\205\1\206"+
+    "\3\205\1\u0166\1\205\1\204\25\205\1\u0166\2\205\1\u0166"+
+    "\2\205\1\u0166\10\205\1\u0166\4\205\1\u0166\7\205\1\0"+
+    "\1\u0167\1\105\1\207\1\105\1\0\1\105\1\u0167\1\105"+
+    "\1\0\1\105\4\0\2\105\1\0\3\105\1\0\1\105"+
+    "\10\0\1\u0167\2\105\1\u0167\2\105\1\u0167\2\105\1\0"+
+    "\4\105\1\0\1\u0167\1\105\1\0\1\105\1\0\1\u0167"+
+    "\2\105\6\0\1\u0168\1\212\1\213\1\212\1\0\1\212"+
+    "\1\u0168\1\212\1\0\1\212\4\0\2\212\1\0\3\212"+
+    "\1\0\1\212\10\0\1\u0168\2\212\1\u0168\2\212\1\u0168"+
+    "\2\212\1\0\4\212\1\0\1\u0168\1\212\1\0\1\212"+
+    "\1\0\1\u0168\2\212\6\0\1\u0169\1\307\1\310\1\307"+
+    "\1\0\1\307\1\u0169\1\307\1\0\1\307\1\0\1\220"+
+    "\2\0\2\307\1\0\3\307\1\0\1\307\10\0\1\u0169"+
+    "\2\307\1\u0169\2\307\1\u0169\2\307\1\0\4\307\1\0"+
+    "\1\u0169\1\307\1\0\1\307\1\0\1\u0169\2\307\6\0"+
+    "\1\u016a\1\114\1\217\1\114\1\0\1\114\1\u016a\1\114"+
+    "\1\0\1\114\1\0\1\220\2\0\2\114\1\0\3\114"+
+    "\1\221\1\114\10\0\1\u016a\2\114\1\u016a\2\114\1\u016a"+
+    "\2\114\1\0\4\114\1\0\1\u016a\1\114\1\0\1\114"+
+    "\1\0\1\u016a\2\114\6\0\1\u016b\1\223\1\224\1\223"+
+    "\1\225\1\223\1\u016b\27\223\1\u016b\2\223\1\u016b\2\223"+
+    "\1\u016b\10\223\1\u016b\4\223\1\u016b\7\223\1\0\1\u016c"+
+    "\1\226\1\227\3\226\1\u016c\1\226\1\225\25\226\1\u016c"+
+    "\2\226\1\u016c\2\226\1\u016c\10\226\1\u016c\4\226\1\u016c"+
+    "\7\226\1\0\1\u016d\1\231\1\232\1\231\1\0\1\231"+
+    "\1\u016d\1\231\1\0\1\231\4\0\2\231\1\0\3\231"+
+    "\1\0\1\231\10\0\1\u016d\2\231\1\u016d\2\231\1\u016d"+
+    "\2\231\1\0\4\231\1\0\1\u016d\1\231\1\0\1\231"+
+    "\1\0\1\u016d\2\231\6\0\1\u016e\5\0\1\u016e\1\366"+
+    "\15\0\2\u016e\7\0\2\u016e\1\0\2\u016e\1\0\2\u016e"+
+    "\7\0\2\u016e\3\0\2\u016e\7\0\1\u016f\5\0\1\u016f"+
+    "\16\0\2\u016f\7\0\2\u016f\1\0\2\u016f\1\0\2\u016f"+
+    "\7\0\2\u016f\3\0\2\u016f\12\0\1\u0147\1\0\1\u0147"+
+    "\3\0\1\u0147\1\u0123\3\0\2\u0147\53\0\1\u0170\1\u011e"+
+    "\1\u011f\1\u011e\1\0\1\u011e\1\u0170\1\u011e\1\0\1\u011e"+
+    "\1\u0123\11\u011e\1\0\11\u011e\1\u0170\2\u011e\1\u0170\2\u011e"+
+    "\1\u0170\10\u011e\1\u0170\4\u011e\1\u0170\7\u011e\1\0\1\u0171"+
+    "\1\u0121\1\u014a\1\u0121\1\u0172\1\u0121\1\u0171\10\u0121\1\u0173"+
+    "\16\u0121\1\u0171\2\u0121\1\u0171\2\u0121\1\u0171\10\u0121\1\u0171"+
+    "\4\u0121\1\u0171\7\u0121\1\0\1\u0174\1\u0122\1\u014b\3\u0122"+
+    "\1\u0174\1\u0122\1\u0175\6\u0122\1\u0176\16\u0122\1\u0174\2\u0122"+
+    "\1\u0174\2\u0122\1\u0174\10\u0122\1\u0174\4\u0122\1\u0174\7\u0122"+
+    "\47\0\1\u0177\24\0\2\25\1\132\1\25\1\0\3\25"+
+    "\1\0\1\25\4\0\2\25\1\0\3\25\1\0\1\25"+
+    "\10\0\11\25\1\0\4\25\1\0\2\25\1\0\1\25"+
+    "\1\0\3\25\6\0\1\u0178\1\135\1\136\1\135\1\0"+
+    "\1\135\1\u0178\1\135\1\0\1\135\4\0\2\135\1\0"+
+    "\3\135\1\0\1\135\10\0\1\u0178\2\135\1\u0178\2\135"+
+    "\1\u0178\2\135\1\0\4\135\1\0\1\u0178\1\135\1\0"+
+    "\1\135\1\0\1\u0178\2\135\6\0\1\u0179\1\137\1\140"+
+    "\1\137\1\0\1\137\1\u0179\1\137\1\0\1\137\4\0"+
+    "\2\137\1\0\3\137\1\0\1\137\10\0\1\u0179\2\137"+
+    "\1\u0179\2\137\1\u0179\2\137\1\0\4\137\1\0\1\u0179"+
+    "\1\137\1\0\1\137\1\0\1\u0179\2\137\54\0\1\u017a"+
+    "\65\0\2\u017b\30\0\1\u017c\1\336\1\337\1\336\1\0"+
+    "\1\336\1\u017c\1\336\1\0\1\336\1\u0102\3\0\2\336"+
+    "\1\0\3\336\1\0\1\336\10\0\1\u017c\2\336\1\u017c"+
+    "\2\336\1\u017c\2\336\1\0\4\336\1\0\1\u017c\1\336"+
+    "\1\0\1\336\1\0\1\u017c\2\336\6\0\1\u017d\1\150"+
+    "\1\151\1\150\1\0\1\150\1\u017d\1\150\1\0\1\150"+
+    "\4\0\2\150\1\0\3\150\1\253\1\150\10\0\1\u017d"+
+    "\2\150\1\u017d\2\150\1\u017d\2\150\1\0\4\150\1\0"+
+    "\1\u017d\1\150\1\0\1\150\1\0\1\u017d\2\150\6\0"+
+    "\1\u017e\1\153\1\154\1\153\1\155\1\153\1\u017e\27\153"+
+    "\1\u017e\2\153\1\u017e\2\153\1\u017e\10\153\1\u017e\4\153"+
+    "\1\u017e\7\153\1\0\1\u017f\1\156\1\157\3\156\1\u017f"+
+    "\1\156\1\155\25\156\1\u017f\2\156\1\u017f\2\156\1\u017f"+
+    "\10\156\1\u017f\4\156\1\u017f\7\156\1\0\1\u0180\1\160"+
+    "\1\161\1\160\1\162\1\160\1\u0180\27\160\1\u0180\2\160"+
+    "\1\u0180\2\160\1\u0180\10\160\1\u0180\4\160\1\u0180\7\160"+
+    "\1\0\1\u0181\1\163\1\164\3\163\1\u0181\1\163\1\162"+
+    "\25\163\1\u0181\2\163\1\u0181\2\163\1\u0181\10\163\1\u0181"+
+    "\4\163\1\u0181\7\163\1\0\1\u0182\1\u0109\1\u010a\1\u0109"+
+    "\1\0\1\u0109\1\u0182\1\u0109\1\0\1\u0109\1\u010d\11\u0109"+
+    "\1\0\11\u0109\1\u0182\2\u0109\1\u0182\2\u0109\1\u0182\10\u0109"+
+    "\1\u0182\4\u0109\1\u0182\7\u0109\1\0\1\u0183\1\u010b\1\u0135"+
+    "\1\u010b\1\u0132\1\u010b\1\u0183\27\u010b\1\u0183\2\u010b\1\u0183"+
+    "\2\u010b\1\u0183\10\u010b\1\u0183\4\u010b\1\u0183\7\u010b\1\0"+
+    "\2\u010b\1\u0135\2\u0132\1\u015b\3\u010b\1\u015b\1\u0184\3\u010b"+
+    "\2\u0132\52\u010b\1\0\2\u010b\1\u0135\1\0\1\u0132\12\u010b"+
+    "\1\0\52\u010b\1\0\1\u0185\1\u010c\1\u0136\3\u010c\1\u0185"+
+    "\1\u010c\1\u0132\25\u010c\1\u0185\2\u010c\1\u0185\2\u010c\1\u0185"+
+    "\10\u010c\1\u0185\4\u010c\1\u0185\7\u010c\1\0\2\u010c\1\u0136"+
+    "\1\u0132\1\u010c\1\u015e\2\u010c\1\u0132\1\u015e\1\u0186\3\u010c"+
+    "\2\u0132\52\u010c\1\0\2\u010c\1\u0136\1\0\4\u010c\1\u0132"+
+    "\6\u010c\1\0\52\u010c\1\0\2\51\1\166\1\51\1\0"+
+    "\3\51\1\0\1\51\4\0\2\51\1\0\3\51\1\0"+
+    "\1\51\10\0\11\51\1\0\4\51\1\0\2\51\1\0"+
+    "\1\51\1\0\3\51\6\0\2\55\1\170\1\55\1\0"+
+    "\3\55\1\0\1\55\4\0\2\55\1\0\3\55\1\0"+
+    "\1\55\10\0\11\55\1\0\4\55\1\0\2\55\1\0"+
+    "\1\55\1\0\3\55\6\0\2\62\1\172\1\62\1\0"+
+    "\3\62\1\0\1\62\4\0\2\62\1\0\3\62\1\0"+
+    "\1\62\10\0\11\62\1\0\4\62\1\0\2\62\1\0"+
+    "\1\62\1\0\3\62\6\0\2\72\1\176\1\72\1\0"+
+    "\3\72\1\0\1\72\4\0\2\72\1\0\3\72\1\0"+
+    "\1\72\10\0\11\72\1\0\4\72\1\0\2\72\1\0"+
+    "\1\72\1\0\3\72\6\0\2\100\1\200\1\100\1\0"+
+    "\3\100\1\0\1\100\4\0\2\100\1\0\3\100\1\0"+
+    "\1\100\10\0\11\100\1\0\4\100\1\0\2\100\1\0"+
+    "\1\100\1\0\3\100\6\0\1\u0187\1\202\1\203\1\202"+
+    "\1\204\1\202\1\u0187\27\202\1\u0187\2\202\1\u0187\2\202"+
+    "\1\u0187\10\202\1\u0187\4\202\1\u0187\7\202\1\0\1\u0188"+
+    "\1\205\1\206\3\205\1\u0188\1\205\1\204\25\205\1\u0188"+
+    "\2\205\1\u0188\2\205\1\u0188\10\205\1\u0188\4\205\1\u0188"+
+    "\7\205\1\0\2\105\1\207\1\105\1\0\3\105\1\0"+
+    "\1\105\4\0\2\105\1\0\3\105\1\0\1\105\10\0"+
+    "\11\105\1\0\4\105\1\0\2\105\1\0\1\105\1\0"+
+    "\3\105\6\0\1\u0189\1\212\1\213\1\212\1\0\1\212"+
+    "\1\u0189\1\212\1\0\1\212\4\0\2\212\1\0\3\212"+
+    "\1\0\1\212\10\0\1\u0189\2\212\1\u0189\2\212\1\u0189"+
+    "\2\212\1\0\4\212\1\0\1\u0189\1\212\1\0\1\212"+
+    "\1\0\1\u0189\2\212\6\0\1\u018a\1\307\1\310\1\307"+
+    "\1\0\1\307\1\u018a\1\307\1\0\1\307\1\0\1\220"+
+    "\2\0\2\307\1\0\3\307\1\0\1\307\10\0\1\u018a"+
+    "\2\307\1\u018a\2\307\1\u018a\2\307\1\0\4\307\1\0"+
+    "\1\u018a\1\307\1\0\1\307\1\0\1\u018a\2\307\6\0"+
+    "\2\114\1\217\1\114\1\0\3\114\1\0\1\114\1\0"+
+    "\1\220\2\0\2\114\1\0\3\114\1\221\1\114\10\0"+
+    "\11\114\1\0\4\114\1\0\2\114\1\0\1\114\1\0"+
+    "\3\114\6\0\1\u018b\1\223\1\224\1\223\1\225\1\223"+
+    "\1\u018b\27\223\1\u018b\2\223\1\u018b\2\223\1\u018b\10\223"+
+    "\1\u018b\4\223\1\u018b\7\223\1\0\1\u018c\1\226\1\227"+
+    "\3\226\1\u018c\1\226\1\225\25\226\1\u018c\2\226\1\u018c"+
+    "\2\226\1\u018c\10\226\1\u018c\4\226\1\u018c\7\226\1\0"+
+    "\1\u018d\1\231\1\232\1\231\1\0\1\231\1\u018d\1\231"+
+    "\1\0\1\231\4\0\2\231\1\0\3\231\1\0\1\231"+
+    "\10\0\1\u018d\2\231\1\u018d\2\231\1\u018d\2\231\1\0"+
+    "\4\231\1\0\1\u018d\1\231\1\0\1\231\1\0\1\u018d"+
+    "\2\231\6\0\1\u018e\5\0\1\u018e\1\366\15\0\2\u018e"+
+    "\7\0\2\u018e\1\0\2\u018e\1\0\2\u018e\7\0\2\u018e"+
+    "\3\0\2\u018e\7\0\1\u018f\5\0\1\u018f\16\0\2\u018f"+
+    "\7\0\2\u018f\1\0\2\u018f\1\0\2\u018f\7\0\2\u018f"+
+    "\3\0\2\u018f\7\0\1\u0190\1\u011e\1\u011f\1\u011e\1\0"+
+    "\1\u011e\1\u0190\1\u011e\1\0\1\u011e\1\u0123\11\u011e\1\0"+
+    "\11\u011e\1\u0190\2\u011e\1\u0190\2\u011e\1\u0190\10\u011e\1\u0190"+
+    "\4\u011e\1\u0190\7\u011e\1\0\1\u0191\1\u0121\1\u014a\1\u0121"+
+    "\1\u0147\1\u0121\1\u0191\27\u0121\1\u0191\2\u0121\1\u0191\2\u0121"+
+    "\1\u0191\10\u0121\1\u0191\4\u0121\1\u0191\7\u0121\1\0\2\u0121"+
+    "\1\u014a\2\u0147\1\u0172\3\u0121\1\u0172\1\u0192\3\u0121\2\u0147"+
+    "\52\u0121\1\0\2\u0121\1\u014a\1\0\1\u0147\12\u0121\1\0"+
+    "\52\u0121\1\0\1\u0193\1\u0122\1\u014b\3\u0122\1\u0193\1\u0122"+
+    "\1\u0147\25\u0122\1\u0193\2\u0122\1\u0193\2\u0122\1\u0193\10\u0122"+
+    "\1\u0193\4\u0122\1\u0193\7\u0122\1\0\2\u0122\1\u014b\1\u0147"+
+    "\1\u0122\1\u0175\2\u0122\1\u0147\1\u0175\1\u0194\3\u0122\2\u0147"+
+    "\52\u0122\1\0\2\u0122\1\u014b\1\0\4\u0122\1\u0147\6\u0122"+
+    "\1\0\52\u0122\42\0\2\u0195\30\0\2\135\1\136\1\135"+
+    "\1\0\3\135\1\0\1\135\4\0\2\135\1\0\3\135"+
+    "\1\0\1\135\10\0\11\135\1\0\4\135\1\0\2\135"+
+    "\1\0\1\135\1\0\3\135\6\0\2\137\1\140\1\137"+
+    "\1\0\3\137\1\0\1\137\4\0\2\137\1\0\3\137"+
+    "\1\0\1\137\10\0\11\137\1\0\4\137\1\0\2\137"+
+    "\1\0\1\137\1\0\3\137\44\0\2\u0196\33\0\1\u0197"+
+    "\1\336\1\337\1\336\1\0\1\336\1\u0197\1\336\1\0"+
+    "\1\336\1\u0102\3\0\2\336\1\0\3\336\1\0\1\336"+
+    "\10\0\1\u0197\2\336\1\u0197\2\336\1\u0197\2\336\1\0"+
+    "\4\336\1\0\1\u0197\1\336\1\0\1\336\1\0\1\u0197"+
+    "\2\336\6\0\2\150\1\151\1\150\1\0\3\150\1\0"+
+    "\1\150\4\0\2\150\1\0\3\150\1\253\1\150\10\0"+
+    "\11\150\1\0\4\150\1\0\2\150\1\0\1\150\1\0"+
+    "\3\150\6\0\2\153\1\154\1\153\1\155\65\153\1\0"+
+    "\2\156\1\157\5\156\1\155\61\156\1\0\2\160\1\161"+
+    "\1\160\1\162\65\160\1\0\2\163\1\164\5\163\1\162"+
+    "\61\163\1\0\1\u0198\1\u0109\1\u010a\1\u0109\1\0\1\u0109"+
+    "\1\u0198\1\u0109\1\0\1\u0109\1\u010d\11\u0109\1\0\11\u0109"+
+    "\1\u0198\2\u0109\1\u0198\2\u0109\1\u0198\10\u0109\1\u0198\4\u0109"+
+    "\1\u0198\7\u0109\1\0\1\u0199\1\u010b\1\u0135\1\u010b\1\u0132"+
+    "\1\u010b\1\u0199\27\u010b\1\u0199\2\u010b\1\u0199\2\u010b\1\u0199"+
+    "\10\u010b\1\u0199\4\u010b\1\u0199\7\u010b\1\0\1\u019a\1\u010c"+
+    "\1\u0136\3\u010c\1\u019a\1\u010c\1\u0132\25\u010c\1\u019a\2\u010c"+
+    "\1\u019a\2\u010c\1\u019a\10\u010c\1\u019a\4\u010c\1\u019a\7\u010c"+
+    "\1\0\2\202\1\203\1\202\1\204\65\202\1\0\2\205"+
+    "\1\206\5\205\1\204\61\205\1\0\2\212\1\213\1\212"+
+    "\1\0\3\212\1\0\1\212\4\0\2\212\1\0\3\212"+
+    "\1\0\1\212\10\0\11\212\1\0\4\212\1\0\2\212"+
+    "\1\0\1\212\1\0\3\212\6\0\1\u019b\1\307\1\310"+
+    "\1\307\1\0\1\307\1\u019b\1\307\1\0\1\307\1\0"+
+    "\1\220\2\0\2\307\1\0\3\307\1\0\1\307\10\0"+
+    "\1\u019b\2\307\1\u019b\2\307\1\u019b\2\307\1\0\4\307"+
+    "\1\0\1\u019b\1\307\1\0\1\307\1\0\1\u019b\2\307"+
+    "\6\0\2\223\1\224\1\223\1\225\65\223\1\0\2\226"+
+    "\1\227\5\226\1\225\61\226\1\0\2\231\1\232\1\231"+
+    "\1\0\3\231\1\0\1\231\4\0\2\231\1\0\3\231"+
+    "\1\0\1\231\10\0\11\231\1\0\4\231\1\0\2\231"+
+    "\1\0\1\231\1\0\3\231\15\0\1\366\63\0\1\u019c"+
+    "\5\0\1\u019c\16\0\2\u019c\7\0\2\u019c\1\0\2\u019c"+
+    "\1\0\2\u019c\7\0\2\u019c\3\0\2\u019c\7\0\1\u019d"+
+    "\1\u011e\1\u011f\1\u011e\1\0\1\u011e\1\u019d\1\u011e\1\0"+
+    "\1\u011e\1\u0123\11\u011e\1\0\11\u011e\1\u019d\2\u011e\1\u019d"+
+    "\2\u011e\1\u019d\10\u011e\1\u019d\4\u011e\1\u019d\7\u011e\1\0"+
+    "\1\u019e\1\u0121\1\u014a\1\u0121\1\u0147\1\u0121\1\u019e\27\u0121"+
+    "\1\u019e\2\u0121\1\u019e\2\u0121\1\u019e\10\u0121\1\u019e\4\u0121"+
+    "\1\u019e\7\u0121\1\0\1\u019f\1\u0122\1\u014b\3\u0122\1\u019f"+
+    "\1\u0122\1\u0147\25\u0122\1\u019f\2\u0122\1\u019f\2\u0122\1\u019f"+
+    "\10\u0122\1\u019f\4\u0122\1\u019f\7\u0122\65\0\1\u01a0\52\0"+
+    "\2\u01a1\25\0\1\u01a2\1\336\1\337\1\336\1\0\1\336"+
+    "\1\u01a2\1\336\1\0\1\336\1\u0102\3\0\2\336\1\0"+
+    "\3\336\1\0\1\336\10\0\1\u01a2\2\336\1\u01a2\2\336"+
+    "\1\u01a2\2\336\1\0\4\336\1\0\1\u01a2\1\336\1\0"+
+    "\1\336\1\0\1\u01a2\2\336\6\0\1\u01a3\1\u0109\1\u010a"+
+    "\1\u0109\1\0\1\u0109\1\u01a3\1\u0109\1\0\1\u0109\1\u010d"+
+    "\11\u0109\1\0\11\u0109\1\u01a3\2\u0109\1\u01a3\2\u0109\1\u01a3"+
+    "\10\u0109\1\u01a3\4\u0109\1\u01a3\7\u0109\1\0\1\u01a4\1\u010b"+
+    "\1\u0135\1\u010b\1\u0132\1\u010b\1\u01a4\27\u010b\1\u01a4\2\u010b"+
+    "\1\u01a4\2\u010b\1\u01a4\10\u010b\1\u01a4\4\u010b\1\u01a4\7\u010b"+
+    "\1\0\1\u01a5\1\u010c\1\u0136\3\u010c\1\u01a5\1\u010c\1\u0132"+
+    "\25\u010c\1\u01a5\2\u010c\1\u01a5\2\u010c\1\u01a5\10\u010c\1\u01a5"+
+    "\4\u010c\1\u01a5\7\u010c\1\0\2\307\1\310\1\307\1\0"+
+    "\3\307\1\0\1\307\1\0\1\220\2\0\2\307\1\0"+
+    "\3\307\1\0\1\307\10\0\11\307\1\0\4\307\1\0"+
+    "\2\307\1\0\1\307\1\0\3\307\6\0\1\u01a6\5\0"+
+    "\1\u01a6\16\0\2\u01a6\7\0\2\u01a6\1\0\2\u01a6\1\0"+
+    "\2\u01a6\7\0\2\u01a6\3\0\2\u01a6\7\0\1\u01a7\1\u011e"+
+    "\1\u011f\1\u011e\1\0\1\u011e\1\u01a7\1\u011e\1\0\1\u011e"+
+    "\1\u0123\11\u011e\1\0\11\u011e\1\u01a7\2\u011e\1\u01a7\2\u011e"+
+    "\1\u01a7\10\u011e\1\u01a7\4\u011e\1\u01a7\7\u011e\1\0\1\u01a8"+
+    "\1\u0121\1\u014a\1\u0121\1\u0147\1\u0121\1\u01a8\27\u0121\1\u01a8"+
+    "\2\u0121\1\u01a8\2\u0121\1\u01a8\10\u0121\1\u01a8\4\u0121\1\u01a8"+
+    "\7\u0121\1\0\1\u01a9\1\u0122\1\u014b\3\u0122\1\u01a9\1\u0122"+
+    "\1\u0147\25\u0122\1\u01a9\2\u0122\1\u01a9\2\u0122\1\u01a9\10\u0122"+
+    "\1\u01a9\4\u0122\1\u01a9\7\u0122\47\0\1\u01aa\24\0\2\336"+
+    "\1\337\1\336\1\0\3\336\1\0\1\336\1\u0102\3\0"+
+    "\2\336\1\0\3\336\1\0\1\336\10\0\11\336\1\0"+
+    "\4\336\1\0\2\336\1\0\1\336\1\0\3\336\6\0"+
+    "\1\u01ab\1\u0109\1\u010a\1\u0109\1\0\1\u0109\1\u01ab\1\u0109"+
+    "\1\0\1\u0109\1\u010d\11\u0109\1\0\11\u0109\1\u01ab\2\u0109"+
+    "\1\u01ab\2\u0109\1\u01ab\10\u0109\1\u01ab\4\u0109\1\u01ab\7\u0109"+
+    "\1\0\1\u01ac\1\u010b\1\u0135\1\u010b\1\u0132\1\u010b\1\u01ac"+
+    "\27\u010b\1\u01ac\2\u010b\1\u01ac\2\u010b\1\u01ac\10\u010b\1\u01ac"+
+    "\4\u010b\1\u01ac\7\u010b\1\0\1\u01ad\1\u010c\1\u0136\3\u010c"+
+    "\1\u01ad\1\u010c\1\u0132\25\u010c\1\u01ad\2\u010c\1\u01ad\2\u010c"+
+    "\1\u01ad\10\u010c\1\u01ad\4\u010c\1\u01ad\7\u010c\1\0\1\u01ae"+
+    "\1\u011e\1\u011f\1\u011e\1\0\1\u011e\1\u01ae\1\u011e\1\0"+
+    "\1\u011e\1\u0123\11\u011e\1\0\11\u011e\1\u01ae\2\u011e\1\u01ae"+
+    "\2\u011e\1\u01ae\10\u011e\1\u01ae\4\u011e\1\u01ae\7\u011e\1\0"+
+    "\1\u01af\1\u0121\1\u014a\1\u0121\1\u0147\1\u0121\1\u01af\27\u0121"+
+    "\1\u01af\2\u0121\1\u01af\2\u0121\1\u01af\10\u0121\1\u01af\4\u0121"+
+    "\1\u01af\7\u0121\1\0\1\u01b0\1\u0122\1\u014b\3\u0122\1\u01b0"+
+    "\1\u0122\1\u0147\25\u0122\1\u01b0\2\u0122\1\u01b0\2\u0122\1\u01b0"+
+    "\10\u0122\1\u01b0\4\u0122\1\u01b0\7\u0122\1\0\2\u0109\1\u010a"+
+    "\1\u0109\1\0\3\u0109\1\0\1\u0109\1\u010d\11\u0109\1\0"+
+    "\45\u0109\1\0\1\u01b1\1\u010b\1\u0135\1\u010b\1\u0132\1\u010b"+
+    "\1\u01b1\27\u010b\1\u01b1\2\u010b\1\u01b1\2\u010b\1\u01b1\10\u010b"+
+    "\1\u01b1\4\u010b\1\u01b1\7\u010b\1\0\1\u01b2\1\u010c\1\u0136"+
+    "\3\u010c\1\u01b2\1\u010c\1\u0132\25\u010c\1\u01b2\2\u010c\1\u01b2"+
+    "\2\u010c\1\u01b2\10\u010c\1\u01b2\4\u010c\1\u01b2\7\u010c\1\0"+
+    "\2\u011e\1\u011f\1\u011e\1\0\3\u011e\1\0\1\u011e\1\u0123"+
+    "\11\u011e\1\0\45\u011e\1\0\1\u01b3\1\u0121\1\u014a\1\u0121"+
+    "\1\u0147\1\u0121\1\u01b3\27\u0121\1\u01b3\2\u0121\1\u01b3\2\u0121"+
+    "\1\u01b3\10\u0121\1\u01b3\4\u0121\1\u01b3\7\u0121\1\0\1\u01b4"+
+    "\1\u0122\1\u014b\3\u0122\1\u01b4\1\u0122\1\u0147\25\u0122\1\u01b4"+
+    "\2\u0122\1\u01b4\2\u0122\1\u01b4\10\u0122\1\u01b4\4\u0122\1\u01b4"+
+    "\7\u0122\1\0\2\u010b\1\u0135\1\u010b\1\u0132\65\u010b\1\0"+
+    "\2\u010c\1\u0136\5\u010c\1\u0132\61\u010c\1\0\2\u0121\1\u014a"+
+    "\1\u0121\1\u0147\65\u0121\1\0\2\u0122\1\u014b\5\u0122\1\u0147"+
+    "\61\u0122";
 
-	/**
-	 * this buffer contains the current text to be matched and is the source
-	 * of the yytext() string
-	 */
-	private char yy_buffer[] = new char[16384];
+  private static int [] zzUnpackTrans() {
+    int [] result = new int[21358];
+    int offset = 0;
+    offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
+    return result;
+  }
 
-	/** the textposition at the last accepting state */
-	private int yy_markedPos;
+  private static int zzUnpackTrans(String packed, int offset, int [] result) {
+    int i = 0;       /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int count = packed.charAt(i++);
+      int value = packed.charAt(i++);
+      value--;
+      do result[j++] = value; while (--count > 0);
+    }
+    return j;
+  }
 
-	/** the textposition at the last state to be included in yytext */
-	private int yy_pushbackPos;
 
-	/** the current text position in the buffer */
-	private int yy_currentPos;
+  /* error codes */
+  private static final int ZZ_UNKNOWN_ERROR = 0;
+  private static final int ZZ_NO_MATCH = 1;
+  private static final int ZZ_PUSHBACK_2BIG = 2;
 
-	/** startRead marks the beginning of the yytext() string in the buffer */
-	private int yy_startRead;
+  /* error messages for the codes above */
+  private static final String ZZ_ERROR_MSG[] = {
+    "Unkown internal scanner error",
+    "Error: could not match input",
+    "Error: pushback value was too large"
+  };
 
-	/**
-	 * endRead marks the last character in the buffer, that has been read from
-	 * input
-	 */
-	private int yy_endRead;
+  /**
+   * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
+   */
+  private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
 
-	/** number of newlines encountered up to the start of the matched text */
-	private int yyline;
+  private static final String ZZ_ATTRIBUTE_PACKED_0 =
+    "\23\0\1\11\7\1\1\11\1\1\1\11\2\1\1\11"+
+    "\3\1\1\11\6\1\1\11\3\1\2\11\3\1\1\11"+
+    "\2\1\2\11\3\1\1\11\1\1\1\11\11\1\2\11"+
+    "\6\1\1\11\6\1\1\11\1\1\1\0\1\1\1\0"+
+    "\1\1\1\0\1\1\10\0\1\1\4\0\1\11\4\0"+
+    "\1\11\4\0\1\1\1\0\1\1\1\0\1\1\1\0"+
+    "\1\11\1\0\1\1\1\0\1\1\2\0\1\11\3\0"+
+    "\1\1\1\0\1\1\3\0\1\11\1\0\1\1\1\11"+
+    "\1\1\2\0\1\11\2\0\2\1\2\0\1\1\2\0"+
+    "\1\11\1\1\1\11\2\1\10\0\1\1\1\0\1\1"+
+    "\2\0\1\1\2\0\1\1\2\0\1\1\2\0\5\1"+
+    "\1\0\1\1\2\0\1\1\1\0\3\1\1\0\1\1"+
+    "\1\0\1\1\2\0\1\1\1\0\3\1\1\0\3\1"+
+    "\2\11\10\0\1\1\5\0\5\1\2\0\4\1\2\0"+
+    "\2\1\1\0\1\1\1\0\3\1\3\0\1\11\2\0"+
+    "\1\11\1\0\1\1\10\0\1\11\5\1\2\0\4\1"+
+    "\2\0\3\1\5\0\1\11\1\0\3\1\2\0\1\11"+
+    "\2\0\1\1\6\0\1\1\2\0\5\1\2\0\4\1"+
+    "\2\0\3\1\2\0\1\1\3\0\3\1\1\0\1\11"+
+    "\2\0\1\1\13\0\5\1\2\0\4\1\2\0\3\1"+
+    "\10\0\2\1\1\11\2\0\1\1\6\0\1\1\1\0"+
+    "\1\1\2\0\2\1\2\0\3\1\2\0\1\1\1\0"+
+    "\1\1\6\0\2\1\4\0\1\11\4\0\1\11\3\0"+
+    "\1\11\12\0";
 
-	/** the number of characters up to the start of the matched text */
-	private int yychar;
+  private static int [] zzUnpackAttribute() {
+    int [] result = new int[436];
+    int offset = 0;
+    offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
+    return result;
+  }
 
-	/**
-	 * the number of characters from the last newline up to the start of the
-	 * matched text
-	 */
-	// private int yycolumn;
-	/**
-	 * yy_atBOL == true <=> the scanner is currently at the beginning of a
-	 * line
-	 */
-	// private boolean yy_atBOL;
-	/** yy_atEOF == true <=> the scanner has returned a value for EOF */
-	private boolean yy_atEOF;
+  private static int zzUnpackAttribute(String packed, int offset, int [] result) {
+    int i = 0;       /* index in packed string  */
+    int j = offset;  /* index in unpacked array */
+    int l = packed.length();
+    while (i < l) {
+      int count = packed.charAt(i++);
+      int value = packed.charAt(i++);
+      do result[j++] = value; while (--count > 0);
+    }
+    return j;
+  }
 
-	/* user code: */
+  /** the input device */
+  private java.io.Reader zzReader;
+
+  /** the current state of the DFA */
+  private int zzState;
+
+  /** the current lexical state */
+  private int zzLexicalState = YYINITIAL;
+
+  /** this buffer contains the current text to be matched and is
+      the source of the yytext() string */
+  private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
+
+  /** the textposition at the last accepting state */
+  private int zzMarkedPos;
+
+  /** the current text position in the buffer */
+  private int zzCurrentPos;
+
+  /** startRead marks the beginning of the yytext() string in the buffer */
+  private int zzStartRead;
+
+  /** endRead marks the last character in the buffer, that has been read
+      from input */
+  private int zzEndRead;
+
+  /** number of newlines encountered up to the start of the matched text */
+  private int yyline;
+
+  /** the number of characters up to the start of the matched text */
+  private int yychar;
+
+  /**
+   * the number of characters from the last newline up to the start of the 
+   * matched text
+   */
+  private int yycolumn;
+
+  /** 
+   * zzAtBOL == true <=> the scanner is currently at the beginning of a line
+   */
+  private boolean zzAtBOL = true;
+
+  /** zzAtEOF == true <=> the scanner is at the EOF */
+  private boolean zzAtEOF;
+
+  /* user code: */
 	private final static String UNDEFINED = "undefined";
 	private String fBufferedContext = null;
 	private int fBufferedStart;
-	// private int fBufferedTextLength;
+//	private int fBufferedTextLength;
 	private int fBufferedLength;
-	// private StringBuffer fBufferedText = null;
+//	private StringBuffer fBufferedText = null;
 	private CSSTextRegionFactory fRegionFactory = CSSTextRegionFactory.getInstance();
 	private int fInitialState = YYINITIAL;
 	public final static int BUFFER_SIZE_NORMAL = 16384;
@@ -214,31 +1263,30 @@
 	public void setInitialState(int state) {
 		fInitialState = state;
 	}
-
+	
 	public void setInitialBufferSize(int size) {
 		fInitialBufferSize = size;
 	}
 
 	/* user method */
-	public final ITextRegion getNextToken() throws IOException {
+  	public final ITextRegion getNextToken() throws IOException {
 		String context;
 		String nextTokenType;
 		boolean spaceFollows;
-		// StringBuffer text;
+//		StringBuffer text;
 		int start;
 		int textLength;
 		int length;
 		if (fBufferedContext != null) {
 			context = fBufferedContext;
-			// text = fBufferedText;
+//			text = fBufferedText;
 			start = fBufferedStart;
 			textLength = length = fBufferedLength;
 
 			fBufferedContext = null;
-		}
-		else {
+		} else {
 			context = primGetNextToken();
-			// text = new StringBuffer(yytext());
+//			text = new StringBuffer(yytext());
 			start = yychar;
 			textLength = length = yylength();
 		}
@@ -248,42 +1296,34 @@
 				// undef -> concatenate undef's
 				nextTokenType = primGetNextToken();
 				while (nextTokenType == UNDEFINED) {
-					// text.append(yytext());
+//					text.append(yytext());
 					textLength += yylength();
 					length = textLength;
 					nextTokenType = primGetNextToken();
 				}
 				fBufferedContext = nextTokenType;
-				// fBufferedText = new StringBuffer(yytext());
+//				fBufferedText = new StringBuffer(yytext());
 				fBufferedStart = yychar;
 				fBufferedLength = yylength();
-			}
-			else {
+			} else {
 				nextTokenType = null;
 				spaceFollows = false;
-				if (CSSRegionUtil.isDeclarationValueType(context)) { // declaration
-																		// value
-																		// can
-																		// contain
-																		// VALUE_S
+				if (CSSRegionUtil.isDeclarationValueType(context)) { // declaration value can contain VALUE_S
 					nextTokenType = primGetNextToken();
 					spaceFollows = (nextTokenType == CSS_DECLARATION_VALUE_S);
-				}
-				else if (canContainSpace(context)) {
+				} else if (canContainSpace(context)) {
 					nextTokenType = primGetNextToken();
 					spaceFollows = (nextTokenType == CSS_S);
 				}
 				if (nextTokenType != null) { // nextToken is retrieved
-					if (spaceFollows) {
+					if (spaceFollows && (context != CSS_COMMENT)) {
 						// next is space -> append
-						// text.append(yytext());
+//						text.append(yytext());
 						length += yylength();
-					}
-					else {
-						// next is NOT space -> push this for next time,
-						// return itself
+					} else {
+						// next is NOT space -> push this for next time, return itself
 						fBufferedContext = nextTokenType;
-						// fBufferedText = new StringBuffer(yytext());
+//						fBufferedText = new StringBuffer(yytext());
 						fBufferedStart = yychar;
 						fBufferedLength = yylength();
 					}
@@ -296,48 +1336,46 @@
 				context = CSS_UNKNOWN;
 			}
 			return fRegionFactory.createRegion(context, start, textLength, length);
-		}
-		else {
+		} else {
 			return null;
 		}
-	}
+  	}
 
 	/* user method */
 	/* for standalone use */
-	public final List parseText() throws IOException {
-		List tokens = new ArrayList();
+  	public final List parseText() throws IOException {
+  		List tokens = new ArrayList();
 
-		CSSTextToken token;
+  		CSSTextToken token;
 		for (String kind = primGetNextToken(); kind != null; kind = primGetNextToken()) {
 			token = new CSSTextToken();
-			token.kind = kind;
+			token.kind = kind;  				
 			token.start = yychar;
 			token.length = yylength();
 			token.image = yytext();
 			tokens.add(token);
 		}
 
-		return tokens;
-	}
-
-	/* user method */
-	private boolean canContainSpace(String type) {
-		if (type == CSS_DELIMITER || type == CSS_RBRACE || type == CSS_DECLARATION_DELIMITER) {
-			return false;
-		}
-		else {
-			return true;
-		}
-	}
+  		return tokens;
+  	}
+  	
+  	/* user method */
+  	private boolean canContainSpace(String type) {
+  		if (type == CSS_DELIMITER || type == CSS_RBRACE || type == CSS_DECLARATION_DELIMITER) {
+  			return false;
+  		} else {
+  			return true;
+  		}
+  	}
 
 	/* user method */
 	public final int getOffset() {
 		return yychar;
 	}
-
+	
 	/* user method */
 	public final boolean isEOF() {
-		return yy_atEOF;
+		return zzAtEOF;
 	}
 
 	/* user method */
@@ -348,40 +1386,36 @@
 	/* user method */
 	public final void reset(java.io.Reader in, int newOffset) {
 		/** the input device */
-		yy_reader = in;
+		zzReader = in;
 
 		/** the current state of the DFA */
-		yy_state = 0;
+		zzState = 0;
 
 		/** the current lexical state */
-		yy_lexical_state = fInitialState; // YYINITIAL;
+		zzLexicalState = fInitialState; //YYINITIAL;
 
-		/**
-		 * this buffer contains the current text to be matched and is the
-		 * source of the yytext() string
-		 */
-		if (yy_buffer.length != fInitialBufferSize) {
-			yy_buffer = new char[fInitialBufferSize];
+		/** this buffer contains the current text to be matched and is
+			the source of the yytext() string */
+		if (zzBuffer.length != fInitialBufferSize) {
+			zzBuffer = new char[fInitialBufferSize];
 		}
-		java.util.Arrays.fill(yy_buffer, (char) 0);
+		java.util.Arrays.fill(zzBuffer, (char)0);
 
 		/** the textposition at the last accepting state */
-		yy_markedPos = 0;
+		zzMarkedPos = 0;
 
 		/** the textposition at the last state to be included in yytext */
-		yy_pushbackPos = 0;
+//		yy_pushbackPos = 0;
 
 		/** the current text position in the buffer */
-		yy_currentPos = 0;
+		zzCurrentPos = 0;
 
 		/** startRead marks the beginning of the yytext() string in the buffer */
-		yy_startRead = 0;
+		zzStartRead = 0;
 
-		/**
-		 * endRead marks the last character in the buffer, that has been read
-		 * from input
-		 */
-		yy_endRead = 0;
+		/** endRead marks the last character in the buffer, that has been read
+			from input */
+		zzEndRead = 0;
 
 		/** number of newlines encountered up to the start of the matched text */
 		yyline = 0;
@@ -390,20 +1424,21 @@
 		yychar = 0;
 
 		/**
-		 * the number of characters from the last newline up to the start of
-		 * the matched text
+		 * the number of characters from the last newline up to the start of the 
+		 * matched text
 		 */
-		// yycolumn = 0;
-		/**
-		 * yy_atBOL == true <=> the scanner is currently at the beginning of a
-		 * line
+//		yycolumn = 0; 
+
+		/** 
+		 * yy_atBOL == true <=> the scanner is currently at the beginning of a line
 		 */
-		// yy_atBOL = false;
-		/** yy_atEOF == true <=> the scanner has returned a value for EOF */
-		yy_atEOF = false;
+//		yy_atBOL = false;
+		
+		/** zzAtEOF == true <=> the scanner has returned a value for EOF */
+		zzAtEOF = false;
 
 		/* user variables */
-		// fUndefined.delete(0, fUndefined.length());
+		//		fUndefined.delete(0, fUndefined.length());
 	}
 
 	/* user method */
@@ -411,795 +1446,534 @@
 		super();
 	}
 
-
-
 	/**
-	 * Creates a new scanner There is also a java.io.InputStream version of
-	 * this constructor.
-	 * 
-	 * @param in
-	 *            the java.io.Reader to read input from.
+	 * Added to workaround stricter compilation options without creating
+	 * an alternate skeleton file
 	 */
-	public CSSTokenizer(java.io.Reader in) {
-		this.yy_reader = in;
-	}
-
-	/**
-	 * Creates a new scanner. There is also java.io.Reader version of this
-	 * constructor.
-	 * 
-	 * @param in
-	 *            the java.io.Inputstream to read input from.
-	 */
-	public CSSTokenizer(java.io.InputStream in) {
-		this(new java.io.InputStreamReader(in));
-	}
-
-	/**
-	 * Unpacks the compressed DFA transition table.
-	 * 
-	 * @param packed
-	 *            the packed transition table
-	 * @return the unpacked transition table
-	 */
-	private static int[] yy_unpack(String packed) {
-		int[] trans = new int[20709];
-		int i = 0; /* index in packed string */
-		int j = 0; /* index in unpacked array */
-		while (i < 13392) {
-			int count = packed.charAt(i++);
-			int value = packed.charAt(i++);
-			value--;
-			do
-				trans[j++] = value;
-			while (--count > 0);
-		}
-		return trans;
-	}
-
-	/**
-	 * Unpacks the compressed character translation table.
-	 * 
-	 * @param packed
-	 *            the packed character translation table
-	 * @return the unpacked character translation table
-	 */
-	private static char[] yy_unpack_cmap(String packed) {
-		char[] map = new char[0x10000];
-		int i = 0; /* index in packed string */
-		int j = 0; /* index in unpacked array */
-		while (i < 170) {
-			int count = packed.charAt(i++);
-			char value = packed.charAt(i++);
-			do
-				map[j++] = value;
-			while (--count > 0);
-		}
-		return map;
+	void _usePrivates() {
+		System.out.print(yycolumn);
+		System.out.print(yyline);
+		System.out.print(Boolean.toString(zzAtBOL));
 	}
 
 
-	/**
-	 * Gets the next input character.
-	 * 
-	 * @return the next character of the input stream, EOF if the end of the
-	 *         stream is reached.
-	 * @exception IOException
-	 *                if any I/O-Error occurs
-	 */
-	private int yy_advance() throws java.io.IOException {
+  /**
+   * Creates a new scanner
+   * There is also a java.io.InputStream version of this constructor.
+   *
+   * @param   in  the java.io.Reader to read input from.
+   */
+  public CSSTokenizer(java.io.Reader in) {
+    this.zzReader = in;
+  }
 
-		/* standard case */
-		if (yy_currentPos < yy_endRead)
-			return yy_buffer[yy_currentPos++];
+  /**
+   * Creates a new scanner.
+   * There is also java.io.Reader version of this constructor.
+   *
+   * @param   in  the java.io.Inputstream to read input from.
+   */
+  public CSSTokenizer(java.io.InputStream in) {
+    this(new java.io.InputStreamReader(in));
+  }
 
-		/* if the eof is reached, we don't need to work hard */
-		if (yy_atEOF)
-			return YYEOF;
-
-		/* otherwise: need to refill the buffer */
-
-		/* first: make room (if you can) */
-		if (yy_startRead > 0) {
-			System.arraycopy(yy_buffer, yy_startRead, yy_buffer, 0, yy_endRead - yy_startRead);
-
-			/* translate stored positions */
-			yy_endRead -= yy_startRead;
-			yy_currentPos -= yy_startRead;
-			yy_markedPos -= yy_startRead;
-			yy_pushbackPos -= yy_startRead;
-			yy_startRead = 0;
-		}
-
-		/* is the buffer big enough? */
-		if (yy_currentPos >= yy_buffer.length) {
-			/* if not: blow it up */
-			char newBuffer[] = new char[yy_currentPos * 2];
-			System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
-			yy_buffer = newBuffer;
-		}
-
-		/* finally: fill the buffer with new input */
-		int numRead = yy_reader.read(yy_buffer, yy_endRead, yy_buffer.length - yy_endRead);
-
-		if (numRead == -1)
-			return YYEOF;
-
-		yy_endRead += numRead;
-
-		return yy_buffer[yy_currentPos++];
-	}
+  /** 
+   * Unpacks the compressed character translation table.
+   *
+   * @param packed   the packed character translation table
+   * @return         the unpacked character translation table
+   */
+  private static char [] zzUnpackCMap(String packed) {
+    char [] map = new char[0x10000];
+    int i = 0;  /* index in packed string  */
+    int j = 0;  /* index in unpacked array */
+    while (i < 170) {
+      int  count = packed.charAt(i++);
+      char value = packed.charAt(i++);
+      do map[j++] = value; while (--count > 0);
+    }
+    return map;
+  }
 
 
-	/**
-	 * Closes the input stream.
-	 */
-	final public void yyclose() throws java.io.IOException {
-		yy_atEOF = true; /* indicate end of file */
-		yy_endRead = yy_startRead; /* invalidate buffer */
-		yy_reader.close();
-	}
+  /**
+   * Refills the input buffer.
+   *
+   * @return      <code>false</code>, iff there was new input.
+   * 
+   * @exception   java.io.IOException  if any I/O-Error occurs
+   */
+  private boolean zzRefill() throws java.io.IOException {
+
+    /* first: make room (if you can) */
+    if (zzStartRead > 0) {
+      System.arraycopy(zzBuffer, zzStartRead,
+                       zzBuffer, 0,
+                       zzEndRead-zzStartRead);
+
+      /* translate stored positions */
+      zzEndRead-= zzStartRead;
+      zzCurrentPos-= zzStartRead;
+      zzMarkedPos-= zzStartRead;
+      zzStartRead = 0;
+    }
+
+    /* is the buffer big enough? */
+    if (zzCurrentPos >= zzBuffer.length) {
+      /* if not: blow it up */
+      char newBuffer[] = new char[zzCurrentPos*2];
+      System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
+      zzBuffer = newBuffer;
+    }
+
+    /* finally: fill the buffer with new input */
+    int numRead = zzReader.read(zzBuffer, zzEndRead,
+                                            zzBuffer.length-zzEndRead);
+
+    if (numRead > 0) {
+      zzEndRead+= numRead;
+      return false;
+    }
+    // unlikely but not impossible: read 0 characters, but not at end of stream    
+    if (numRead == 0) {
+      int c = zzReader.read();
+      if (c == -1) {
+        return true;
+      } else {
+        zzBuffer[zzEndRead++] = (char) c;
+        return false;
+      }     
+    }
+
+	// numRead < 0
+    return true;
+  }
+
+    
+  /**
+   * Closes the input stream.
+   */
+  public final void yyclose() throws java.io.IOException {
+    zzAtEOF = true;            /* indicate end of file */
+    zzEndRead = zzStartRead;  /* invalidate buffer    */
+
+    if (zzReader != null)
+      zzReader.close();
+  }
 
 
-	/**
-	 * Returns the current lexical state.
-	 */
-	final public int yystate() {
-		return yy_lexical_state;
-	}
-
-	/**
-	 * Enters a new lexical state
-	 * 
-	 * @param newState
-	 *            the new lexical state
-	 */
-	final public void yybegin(int newState) {
-		yy_lexical_state = newState;
-	}
+  /**
+   * Resets the scanner to read from a new input stream.
+   * Does not close the old reader.
+   *
+   * All internal variables are reset, the old input stream 
+   * <b>cannot</b> be reused (internal buffer is discarded and lost).
+   * Lexical state is set to <tt>ZZ_INITIAL</tt>.
+   *
+   * @param reader   the new input stream 
+   */
+  public final void yyreset(java.io.Reader reader) {
+    zzReader = reader;
+    zzAtBOL  = true;
+    zzAtEOF  = false;
+    zzEndRead = zzStartRead = 0;
+    zzCurrentPos = zzMarkedPos = 0;
+    yyline = yychar = yycolumn = 0;
+    zzLexicalState = YYINITIAL;
+  }
 
 
-	/**
-	 * Returns the text matched by the current regular expression.
-	 */
-	final public String yytext() {
-		return new String(yy_buffer, yy_startRead, yy_markedPos - yy_startRead);
-	}
-
-	/**
-	 * Returns the length of the matched text region.
-	 */
-	final public int yylength() {
-		return yy_markedPos - yy_startRead;
-	}
+  /**
+   * Returns the current lexical state.
+   */
+  public final int yystate() {
+    return zzLexicalState;
+  }
 
 
-	/**
-	 * Reports an error that occured while scanning.
-	 * 
-	 * @param errorCode
-	 *            the code of the errormessage to display
-	 */
-	private void yy_ScanError(int errorCode) {
-		try {
-			System.out.println(YY_ERROR_MSG[errorCode]);
-		}
-		catch (ArrayIndexOutOfBoundsException e) {
-			System.out.println(YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
-		}
+  /**
+   * Enters a new lexical state
+   *
+   * @param newState the new lexical state
+   */
+  public final void yybegin(int newState) {
+    zzLexicalState = newState;
+  }
 
 
-	}
+  /**
+   * Returns the text matched by the current regular expression.
+   */
+  public final String yytext() {
+    return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
+  }
 
 
-	/**
-	 * Pushes the specified amount of characters back into the input stream.
-	 * 
-	 * They will be read again by then next call of the scanning method
-	 * 
-	 * @param number
-	 *            the number of characters to be read again. This number must
-	 *            not be greater than yylength()!
-	 */
-	// private void yypushback(int number) {
-	// if ( number > yylength() )
-	// yy_ScanError(YY_PUSHBACK_2BIG);
-	//
-	// yy_markedPos -= number;
-	// }
+  /**
+   * Returns the character at position <tt>pos</tt> from the 
+   * matched text. 
+   * 
+   * It is equivalent to yytext().charAt(pos), but faster
+   *
+   * @param pos the position of the character to fetch. 
+   *            A value from 0 to yylength()-1.
+   *
+   * @return the character at position pos
+   */
+  public final char yycharat(int pos) {
+    return zzBuffer[zzStartRead+pos];
+  }
 
-	/**
-	 * Resumes scanning until the next regular expression is matched, the end
-	 * of input is encountered or an I/O-Error occurs.
-	 * 
-	 * @return the next token
-	 * @exception IOException
-	 *                if any I/O-Error occurs
-	 */
-	public String primGetNextToken() throws java.io.IOException {
-		int yy_input;
-		int yy_action;
 
-		yy_pushbackPos = -1;
-		boolean yy_was_pushback;
+  /**
+   * Returns the length of the matched text region.
+   */
+  public final int yylength() {
+    return zzMarkedPos-zzStartRead;
+  }
 
-		while (true) {
 
-			yychar += yylength();
+  /**
+   * Reports an error that occured while scanning.
+   *
+   * In a wellformed scanner (no or only correct usage of 
+   * yypushback(int) and a match-all fallback rule) this method 
+   * will only be called with things that "Can't Possibly Happen".
+   * If this method is called, something is seriously wrong
+   * (e.g. a JFlex bug producing a faulty scanner etc.).
+   *
+   * Usual syntax/scanner level error handling should be done
+   * in error fallback rules.
+   *
+   * @param   errorCode  the code of the errormessage to display
+   */
+  private void zzScanError(int errorCode) {
+    String message;
+    try {
+      message = ZZ_ERROR_MSG[errorCode];
+    }
+    catch (ArrayIndexOutOfBoundsException e) {
+      message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
+    }
 
-			boolean yy_counted = false;
-			for (yy_currentPos = yy_startRead; yy_currentPos < yy_markedPos; yy_currentPos++) {
-				switch (yy_buffer[yy_currentPos]) {
-					case '\r' :
-						yyline++;
-						yy_counted = true;
-						break;
-					case '\n' :
-						if (yy_counted)
-							yy_counted = false;
-						else {
-							yyline++;
-						}
-						break;
-					default :
-						yy_counted = false;
-				}
-			}
+    throw new Error(message);
+  } 
 
-			if (yy_counted) {
-				if (yy_advance() == '\n')
-					yyline--;
-				if (!yy_atEOF)
-					yy_currentPos--;
-			}
 
-			yy_action = -1;
+  /**
+   * Pushes the specified amount of characters back into the input stream.
+   *
+   * They will be read again by then next call of the scanning method
+   *
+   * @param number  the number of characters to be read again.
+   *                This number must not be greater than yylength()!
+   */
+  public void yypushback(int number)  {
+    if ( number > yylength() )
+      zzScanError(ZZ_PUSHBACK_2BIG);
 
-			yy_currentPos = yy_startRead = yy_markedPos;
+    zzMarkedPos -= number;
+  }
 
-			yy_state = yy_lexical_state;
 
-			yy_was_pushback = false;
+  /**
+   * Resumes scanning until the next regular expression is matched,
+   * the end of input is encountered or an I/O-Error occurs.
+   *
+   * @return      the next token
+   * @exception   java.io.IOException  if any I/O-Error occurs
+   */
+  public String primGetNextToken() throws java.io.IOException {
+    int zzInput;
+    int zzAction;
 
-			yy_forAction : {
-				while (true) {
+    // cached fields:
+    int zzCurrentPosL;
+    int zzMarkedPosL;
+    int zzEndReadL = zzEndRead;
+    char [] zzBufferL = zzBuffer;
+    char [] zzCMapL = ZZ_CMAP;
 
-					yy_input = yy_advance();
+    int [] zzTransL = ZZ_TRANS;
+    int [] zzRowMapL = ZZ_ROWMAP;
+    int [] zzAttrL = ZZ_ATTRIBUTE;
 
-					if (yy_input == YYEOF)
-						break yy_forAction;
+    while (true) {
+      zzMarkedPosL = zzMarkedPos;
 
-					int yy_next = yytrans[yy_rowMap[yy_state] + yycmap[yy_input]];
-					if (yy_next == -1)
-						break yy_forAction;
-					yy_state = yy_next;
+      yychar+= zzMarkedPosL-zzStartRead;
 
-					int yy_attributes = YY_ATTRIBUTE[yy_state];
-					if ((yy_attributes & 2) > 0)
-						yy_pushbackPos = yy_currentPos;
+      zzAction = -1;
 
-					if ((yy_attributes & 1) > 0) {
-						yy_was_pushback = (yy_attributes & 4) > 0;
-						yy_action = yy_state;
-						yy_markedPos = yy_currentPos;
-						if ((yy_attributes & 8) > 0)
-							break yy_forAction;
-					}
+      zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
+  
+      zzState = ZZ_LEXSTATE[zzLexicalState];
 
-				}
-			}
 
-			if (yy_was_pushback)
-				yy_markedPos = yy_pushbackPos;
+      zzForAction: {
+        while (true) {
+    
+          if (zzCurrentPosL < zzEndReadL)
+            zzInput = zzBufferL[zzCurrentPosL++];
+          else if (zzAtEOF) {
+            zzInput = YYEOF;
+            break zzForAction;
+          }
+          else {
+            // store back cached positions
+            zzCurrentPos  = zzCurrentPosL;
+            zzMarkedPos   = zzMarkedPosL;
+            boolean eof = zzRefill();
+            // get translated positions and possibly new buffer
+            zzCurrentPosL  = zzCurrentPos;
+            zzMarkedPosL   = zzMarkedPos;
+            zzBufferL      = zzBuffer;
+            zzEndReadL     = zzEndRead;
+            if (eof) {
+              zzInput = YYEOF;
+              break zzForAction;
+            }
+            else {
+              zzInput = zzBufferL[zzCurrentPosL++];
+            }
+          }
+          int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
+          if (zzNext == -1) break zzForAction;
+          zzState = zzNext;
 
-			switch (yy_action) {
+          int zzAttributes = zzAttrL[zzState];
+          if ( (zzAttributes & 1) == 1 ) {
+            zzAction = zzState;
+            zzMarkedPosL = zzCurrentPosL;
+            if ( (zzAttributes & 8) == 8 ) break zzForAction;
+          }
 
-				case 416 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_IMPORTANT;
-				}
-				case 428 :
-					break;
-				case 407 : {
-					yybegin(ST_FONT_FACE_DELIMITER);
-					return CSS_FONT_FACE;
-				}
-				case 429 :
-					break;
-				case 370 : {
-					yybegin(ST_CHARSET_NAME);
-					return CSS_CHARSET;
-				}
-				case 430 :
-					break;
-				case 330 : {
-					yybegin(ST_IMPORT_URI);
-					return CSS_IMPORT;
-				}
-				case 431 :
-					break;
-				case 292 : {
-					yybegin(ST_MEDIA_MEDIUM);
-					return CSS_MEDIA;
-				}
-				case 432 :
-					break;
-				case 285 :
-				case 322 :
-				case 393 :
-				case 395 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_URI;
-				}
-				case 433 :
-					break;
-				case 264 :
-				case 302 :
-				case 380 :
-				case 382 : {
-					yybegin(ST_IMPORT_MEDIUM);
-					return CSS_URI;
-				}
-				case 434 :
-					break;
-				case 250 : {
-					yybegin(ST_PAGE_PSEUDO_PAGE);
-					return CSS_PAGE;
-				}
-				case 435 :
-					break;
-				case 212 : {
-					return CSS_COMMENT;
-				}
-				case 436 :
-					break;
-				case 211 : {
-					return CSS_CDO;
-				}
-				case 437 :
-					break;
-				case 205 :
-				case 240 :
-				case 278 :
-				case 279 :
-				case 318 :
-				case 319 :
-				case 358 :
-				case 359 :
-				case 389 :
-				case 390 :
-				case 402 :
-				case 412 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_UNICODE_RANGE;
-				}
-				case 438 :
-					break;
-				case 159 : {
-					return CSS_CDC;
-				}
-				case 439 :
-					break;
-				case 156 : {
-					return CSS_DECLARATION_VALUE_S;
-				}
-				case 440 :
-					break;
-				case 150 :
-				case 204 :
-				case 239 :
-				case 277 :
-				case 317 :
-				case 357 :
-				case 388 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_HASH;
-				}
-				case 441 :
-					break;
-				case 146 :
-				case 199 :
-				case 202 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_STRING;
-				}
-				case 442 :
-					break;
-				case 57 :
-				case 126 :
-				case 187 :
-				case 230 :
-				case 268 :
-				case 308 :
-				case 348 : {
-					yybegin(ST_SELECTOR_ATTRIBUTE_OPERATOR);
-					return CSS_SELECTOR_ATTRIBUTE_NAME;
-				}
-				case 443 :
-					break;
-				case 56 : {
-					yybegin(ST_SELECTOR);
-					return CSS_SELECTOR_SEPARATOR;
-				}
-				case 444 :
-					break;
-				case 55 :
-				case 123 : {
-					yybegin(ST_SELECTOR);
-					return CSS_SELECTOR_COMBINATOR;
-				}
-				case 445 :
-					break;
-				case 52 : {
-					yybegin(ST_DECLARATION);
-					return CSS_LBRACE;
-				}
-				case 446 :
-					break;
-				case 49 :
-				case 121 :
-				case 186 :
-				case 229 :
-				case 267 :
-				case 307 :
-				case 347 : {
-					yybegin(ST_PAGE_DELIMITER);
-					return CSS_PAGE_SELECTOR;
-				}
-				case 447 :
-					break;
-				case 48 : {
-					yybegin(YYINITIAL);
-					return CSS_LBRACE;
-				}
-				case 448 :
-					break;
-				case 47 : {
-					yybegin(ST_MEDIA_MEDIUM);
-					return CSS_MEDIA_SEPARATOR;
-				}
-				case 449 :
-					break;
-				case 44 :
-				case 119 :
-				case 185 :
-				case 228 :
-				case 266 :
-				case 306 :
-				case 346 : {
-					yybegin(ST_MEDIA_DELIMITER);
-					return CSS_MEDIUM;
-				}
-				case 450 :
-					break;
-				case 43 : {
-					yybegin(ST_IMPORT_MEDIUM);
-					return CSS_MEDIA_SEPARATOR;
-				}
-				case 451 :
-					break;
-				case 20 :
-				case 89 :
-				case 158 :
-				case 208 :
-				case 244 :
-				case 287 :
-				case 326 : {
-					yybegin(ST_SELECTOR_MODIFIER);
-					return CSS_SELECTOR_ELEMENT_NAME;
-				}
-				case 452 :
-					break;
-				case 22 :
-				case 54 :
-				case 87 :
-				case 124 :
-				case 157 : {
-					return CSS_S;
-				}
-				case 453 :
-					break;
-				case 27 : {
-					yybegin(YYINITIAL);
-					return CSS_RBRACE;
-				}
-				case 454 :
-					break;
-				case 29 : {
-					yybegin(ST_SELECTOR_MODIFIER);
-					return CSS_SELECTOR_UNIVERSAL;
-				}
-				case 455 :
-					break;
-				case 32 : {
-					yybegin(ST_SELECTOR_ATTRIBUTE_NAME);
-					return CSS_SELECTOR_ATTRIBUTE_START;
-				}
-				case 456 :
-					break;
-				case 36 : {
-					yybegin(YYINITIAL);
-					return CSS_DELIMITER;
-				}
-				case 457 :
-					break;
-				case 40 :
-				case 117 :
-				case 184 :
-				case 227 :
-				case 265 :
-				case 305 :
-				case 345 : {
-					yybegin(ST_IMPORT_DELIMITER);
-					return CSS_MEDIUM;
-				}
-				case 458 :
-					break;
-				case 60 : {
-					yybegin(ST_SELECTOR_ATTRIBUTE_VALUE);
-					return CSS_SELECTOR_ATTRIBUTE_OPERATOR;
-				}
-				case 459 :
-					break;
-				case 62 : {
-					yybegin(ST_SELECTOR_MODIFIER);
-					return CSS_SELECTOR_ATTRIBUTE_END;
-				}
-				case 460 :
-					break;
-				case 63 :
-				case 128 :
-				case 131 :
-				case 188 :
-				case 190 :
-				case 193 :
-				case 231 :
-				case 269 :
-				case 309 :
-				case 349 : {
-					yybegin(ST_SELECTOR_ATTRIBUTE_END);
-					return CSS_SELECTOR_ATTRIBUTE_VALUE;
-				}
-				case 461 :
-					break;
-				case 68 :
-				case 135 :
-				case 195 :
-				case 234 :
-				case 272 :
-				case 312 :
-				case 352 : {
-					yybegin(ST_DECLARATION_SEPARATOR);
-					return CSS_DECLARATION_PROPERTY;
-				}
-				case 462 :
-					break;
-				case 71 : {
-					yybegin(ST_DECLARATION);
-					return CSS_DECLARATION_DELIMITER;
-				}
-				case 463 :
-					break;
-				case 72 : {
-					yybegin(ST_DECLARATION_PRE_VALUE);
-					return CSS_DECLARATION_SEPARATOR;
-				}
-				case 464 :
-					break;
-				case 73 :
-				case 149 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_NUMBER;
-				}
-				case 465 :
-					break;
-				case 74 :
-				case 83 :
-				case 143 :
-				case 153 :
-				case 197 :
-				case 206 :
-				case 236 :
-				case 274 :
-				case 314 :
-				case 354 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_IDENT;
-				}
-				case 466 :
-					break;
-				case 79 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE;
-				}
-				case 467 :
-					break;
-				case 85 :
-				case 86 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_OPERATOR;
-				}
-				case 468 :
-					break;
-				case 91 :
-				case 160 :
-				case 209 :
-				case 245 :
-				case 288 :
-				case 327 :
-				case 368 : {
-					yybegin(ST_SELECTOR_MODIFIER);
-					return CSS_SELECTOR_CLASS;
-				}
-				case 469 :
-					break;
-				case 93 :
-				case 161 :
-				case 210 :
-				case 246 :
-				case 289 :
-				case 328 :
-				case 369 : {
-					yybegin(ST_SELECTOR_MODIFIER);
-					return CSS_SELECTOR_ID;
-				}
-				case 470 :
-					break;
-				case 102 :
-				case 170 :
-				case 221 :
-				case 253 :
-				case 255 :
-				case 295 :
-				case 333 :
-				case 373 : {
-					yybegin(ST_SELECTOR_MODIFIER);
-					return CSS_SELECTOR_PSEUDO;
-				}
-				case 471 :
-					break;
-				case 107 :
-				case 172 :
-				case 175 : {
-					yybegin(ST_CHARSET_DELIMITER);
-					return CSS_STRING;
-				}
-				case 472 :
-					break;
-				case 112 :
-				case 178 :
-				case 181 : {
-					yybegin(ST_IMPORT_MEDIUM);
-					return CSS_STRING;
-				}
-				case 473 :
-					break;
-				case 136 :
-				case 196 :
-				case 235 :
-				case 273 :
-				case 313 :
-				case 353 :
-				case 385 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_DIMENSION;
-				}
-				case 474 :
-					break;
-				case 140 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_PERCENTAGE;
-				}
-				case 475 :
-					break;
-				case 142 :
-				case 242 : {
-					yybegin(ST_DECLARATION_VALUE);
-					return CSS_DECLARATION_VALUE_FUNCTION;
-				}
-				case 476 :
-					break;
-				case 19 :
-				case 21 :
-				case 23 :
-				case 24 :
-				case 25 :
-				case 26 :
-				case 28 :
-				case 30 :
-				case 31 :
-				case 33 :
-				case 34 :
-				case 35 :
-				case 37 :
-				case 38 :
-				case 39 :
-				case 41 :
-				case 42 :
-				case 45 :
-				case 46 :
-				case 50 :
-				case 51 :
-				case 53 :
-				case 58 :
-				case 59 :
-				case 61 :
-				case 64 :
-				case 65 :
-				case 66 :
-				case 67 :
-				case 69 :
-				case 70 :
-				case 75 :
-				case 76 :
-				case 77 :
-				case 78 :
-				case 80 :
-				case 81 :
-				case 82 :
-				case 84 : {
-					return UNDEFINED;
-				}
-				case 477 :
-					break;
-				default :
-					if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
-						yy_atEOF = true;
-						return null;
-					}
-					else {
-						yy_ScanError(YY_NO_MATCH);
-					}
-			}
-		}
-	}
+        }
+      }
 
-	/**
-	 * Runs the scanner on input files.
-	 * 
-	 * This main method is the debugging routine for the scanner. It prints
-	 * each returned token to System.out until the end of file is reached, or
-	 * an error occured.
-	 * 
-	 * @param argv
-	 *            the command line, contains the filenames to run the scanner
-	 *            on.
-	 */
-	public static void main(String argv[]) {
-		for (int i = 0; i < argv.length; i++) {
-			CSSTokenizer scanner = null;
-			try {
-				scanner = new CSSTokenizer(new java.io.FileReader(argv[i]));
-			}
-			catch (java.io.FileNotFoundException e) {
-				System.out.println("File not found : \"" + argv[i] + "\"");
-			}
-			// catch (java.io.IOException e) {
-			// System.out.println("Error opening file \""+argv[i]+"\"");
-			//       
-			// }
-			catch (ArrayIndexOutOfBoundsException e) {
-				System.out.println("Usage : java CSSTokenizer <inputfile>");
-			}
+      // store back cached position
+      zzMarkedPos = zzMarkedPosL;
 
-			try {
-				do {
-					System.out.println(scanner.primGetNextToken());
-				}
-				while (!scanner.yy_atEOF);
-
-			}
-			catch (java.io.IOException e) {
-				System.out.println("An I/O error occured while scanning :");
-				System.out.println(e);
-
-			}
-			catch (Exception e) {
-				e.printStackTrace();
-
-			}
-		}
-	}
+      switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
+        case 32: 
+          { yybegin(ST_IMPORT_MEDIUM); return CSS_STRING;
+          }
+        case 52: break;
+        case 34: 
+          { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_DIMENSION;
+          }
+        case 53: break;
+        case 39: 
+          // lookahead expression with fixed lookahead length
+          yypushback(1);
+          { return CSS_DECLARATION_VALUE_S;
+          }
+        case 54: break;
+        case 36: 
+          { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_FUNCTION;
+          }
+        case 55: break;
+        case 20: 
+          { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ATTRIBUTE_END;
+          }
+        case 56: break;
+        case 1: 
+          { return UNDEFINED;
+          }
+        case 57: break;
+        case 9: 
+          { yybegin(ST_IMPORT_DELIMITER); return CSS_MEDIUM;
+          }
+        case 58: break;
+        case 37: 
+          { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_STRING;
+          }
+        case 59: break;
+        case 29: 
+          { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_CLASS;
+          }
+        case 60: break;
+        case 12: 
+          { yybegin(YYINITIAL); return CSS_LBRACE;
+          }
+        case 61: break;
+        case 4: 
+          { yybegin(YYINITIAL); return CSS_RBRACE;
+          }
+        case 62: break;
+        case 11: 
+          { yybegin(ST_MEDIA_DELIMITER); return CSS_MEDIUM;
+          }
+        case 63: break;
+        case 10: 
+          { yybegin(ST_IMPORT_MEDIUM); return CSS_MEDIA_SEPARATOR;
+          }
+        case 64: break;
+        case 24: 
+          { yybegin(ST_DECLARATION_PRE_VALUE); return CSS_DECLARATION_SEPARATOR;
+          }
+        case 65: break;
+        case 50: 
+          { yybegin(ST_FONT_FACE_DELIMITER); return CSS_FONT_FACE;
+          }
+        case 66: break;
+        case 49: 
+          { yybegin(ST_CHARSET_NAME); return CSS_CHARSET;
+          }
+        case 67: break;
+        case 45: 
+          { yybegin(ST_IMPORT_MEDIUM); return CSS_URI;
+          }
+        case 68: break;
+        case 19: 
+          { yybegin(ST_SELECTOR_ATTRIBUTE_VALUE); return CSS_SELECTOR_ATTRIBUTE_OPERATOR;
+          }
+        case 69: break;
+        case 40: 
+          { return CSS_CDC;
+          }
+        case 70: break;
+        case 15: 
+          { yybegin(ST_DECLARATION); return CSS_LBRACE;
+          }
+        case 71: break;
+        case 5: 
+          { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_UNIVERSAL;
+          }
+        case 72: break;
+        case 7: 
+          { yybegin(ST_SELECTOR_ATTRIBUTE_NAME); return CSS_SELECTOR_ATTRIBUTE_START;
+          }
+        case 73: break;
+        case 42: 
+          { return CSS_CDO;
+          }
+        case 74: break;
+        case 8: 
+          { yybegin(YYINITIAL); return CSS_DELIMITER;
+          }
+        case 75: break;
+        case 18: 
+          { yybegin(ST_SELECTOR_ATTRIBUTE_OPERATOR); return CSS_SELECTOR_ATTRIBUTE_NAME;
+          }
+        case 76: break;
+        case 38: 
+          { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_HASH;
+          }
+        case 77: break;
+        case 44: 
+          { yybegin(ST_PAGE_PSEUDO_PAGE); return CSS_PAGE;
+          }
+        case 78: break;
+        case 2: 
+          { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ELEMENT_NAME;
+          }
+        case 79: break;
+        case 31: 
+          { yybegin(ST_CHARSET_DELIMITER); return CSS_STRING;
+          }
+        case 80: break;
+        case 25: 
+          { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_NUMBER;
+          }
+        case 81: break;
+        case 16: 
+          { yybegin(ST_SELECTOR); return CSS_SELECTOR_COMBINATOR;
+          }
+        case 82: break;
+        case 33: 
+          // lookahead expression with fixed lookahead length
+          yypushback(1);
+          { yybegin(ST_SELECTOR); return CSS_SELECTOR_COMBINATOR;
+          }
+        case 83: break;
+        case 41: 
+          { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_UNICODE_RANGE;
+          }
+        case 84: break;
+        case 35: 
+          { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_PERCENTAGE;
+          }
+        case 85: break;
+        case 13: 
+          { yybegin(ST_MEDIA_MEDIUM); return CSS_MEDIA_SEPARATOR;
+          }
+        case 86: break;
+        case 26: 
+          { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_IDENT;
+          }
+        case 87: break;
+        case 14: 
+          { yybegin(ST_PAGE_DELIMITER); return CSS_PAGE_SELECTOR;
+          }
+        case 88: break;
+        case 28: 
+          { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_OPERATOR;
+          }
+        case 89: break;
+        case 43: 
+          { return CSS_COMMENT;
+          }
+        case 90: break;
+        case 51: 
+          { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_IMPORTANT;
+          }
+        case 91: break;
+        case 21: 
+          { yybegin(ST_SELECTOR_ATTRIBUTE_END); return CSS_SELECTOR_ATTRIBUTE_VALUE;
+          }
+        case 92: break;
+        case 17: 
+          { yybegin(ST_SELECTOR); return CSS_SELECTOR_SEPARATOR;
+          }
+        case 93: break;
+        case 3: 
+          { return CSS_S;
+          }
+        case 94: break;
+        case 30: 
+          { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ID;
+          }
+        case 95: break;
+        case 48: 
+          { yybegin(ST_IMPORT_URI); return CSS_IMPORT;
+          }
+        case 96: break;
+        case 27: 
+          { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE;
+          }
+        case 97: break;
+        case 47: 
+          { yybegin(ST_MEDIA_MEDIUM); return CSS_MEDIA;
+          }
+        case 98: break;
+        case 23: 
+          { yybegin(ST_DECLARATION); return CSS_DECLARATION_DELIMITER;
+          }
+        case 99: break;
+        case 22: 
+          { yybegin(ST_DECLARATION_SEPARATOR); return CSS_DECLARATION_PROPERTY;
+          }
+        case 100: break;
+        case 6: 
+          { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_PSEUDO;
+          }
+        case 101: break;
+        case 46: 
+          { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_URI;
+          }
+        case 102: break;
+        default: 
+          if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
+            zzAtEOF = true;
+            return null;
+          } 
+          else {
+            zzScanError(ZZ_NO_MATCH);
+          }
+      }
+    }
+  }
 
 
 }
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceInitializer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceInitializer.java
index 2056288..b624d16 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceInitializer.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceInitializer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -59,6 +59,7 @@
 		node.putBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR, true);
 		node.putBoolean(CSSCorePreferenceNames.WRAPPING_NEWLINE_ON_OPEN_BRACE, false);
 		node.putInt(CSSCorePreferenceNames.CASE_IDENTIFIER, CSSCorePreferenceNames.UPPER);
+		node.putInt(CSSCorePreferenceNames.CASE_SELECTOR, CSSCorePreferenceNames.LOWER);
 		node.putInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME, CSSCorePreferenceNames.LOWER);
 		node.putInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE, CSSCorePreferenceNames.LOWER);
 
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceNames.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceNames.java
index d3fa08d..d6fdf06 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceNames.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceNames.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -21,6 +21,7 @@
 	}
 
 	public static final String CASE_IDENTIFIER = "identifierCase"; //$NON-NLS-1$
+	public static final String CASE_SELECTOR = "selectorCase"; //$NON-NLS-1$
 	public static final String CASE_PROPERTY_NAME = "propNameCase"; //$NON-NLS-1$
 	public static final String CASE_PROPERTY_VALUE = "propValueCase"; //$NON-NLS-1$
 	public static final String FORMAT_BETWEEN_VALUE = "betweenValue"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleSheet.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleSheet.java
index 0240eb2..51a82bb 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleSheet.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleSheet.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -44,4 +44,13 @@
 	 * @return org.w3c.dom.stylesheets.StyleSheetList
 	 */
 	StyleSheetList getParentStyleSheets();
+
+	/**
+	 * The list of all CSS rules contained within the stylesheet and, if requested, the rules
+	 * from imported stylesheets are merged into the rule list.
+	 * @param shouldImport indicates if rules from imported stylesheets should be returned
+	 * @return the list of all of the rules in the stylesheet, and if requested,
+	 * any rules from imported stylesheets
+	 */
+	CSSRuleList getCssRules(boolean shouldImport);
 }
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredDocumentWalker.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredDocumentWalker.java
index 10d8142..43cfc3e 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredDocumentWalker.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredDocumentWalker.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -64,7 +64,7 @@
 			if (nextNode == null) {
 				if (isOldNode(node)) {
 					// this may be the end of old flatnodes
-					int newStart = node.getEnd() - fLengthDifference;
+					int newStart = node.getEnd() + fLengthDifference;
 					nextNode = fStructuredDocument.getRegionAtCharacterOffset(newStart);
 				}
 			}
@@ -82,7 +82,7 @@
 		IStructuredDocumentRegion nextNode = null;
 		if (isOldNode(node)) {
 			IStructuredDocumentRegion oldEndNode = fOldStructuredDocumentRegionList.item(fOldStructuredDocumentRegionList.getLength() - 1);
-			int newStart = oldEndNode.getEnd() - fLengthDifference;
+			int newStart = oldEndNode.getEnd() + fLengthDifference;
 			nextNode = fStructuredDocument.getRegionAtCharacterOffset(newStart);
 		}
 		else if (node != null) {
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredTextPartitionerForCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredTextPartitionerForCSS.java
index 98d53c1..f78ac0a 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredTextPartitionerForCSS.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredTextPartitionerForCSS.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,13 +11,15 @@
 package org.eclipse.wst.css.core.internal.text;
 
 import org.eclipse.jface.text.IDocumentPartitioner;
+import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
 import org.eclipse.wst.css.core.text.ICSSPartitions;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
 import org.eclipse.wst.sse.core.text.IStructuredPartitions;
 
 public class StructuredTextPartitionerForCSS extends StructuredTextPartitioner {
 	
-	public final static String[] legalTypes = new String[]{ICSSPartitions.STYLE, IStructuredPartitions.DEFAULT_PARTITION};
+	public final static String[] legalTypes = new String[]{ICSSPartitions.STYLE, ICSSPartitions.COMMENT, IStructuredPartitions.DEFAULT_PARTITION};
 
 	public StructuredTextPartitionerForCSS() {
 		super();
@@ -34,4 +36,25 @@
 	public IDocumentPartitioner newInstance() {
 		return new StructuredTextPartitionerForCSS();
 	}
+	
+	/**
+	 * <p>This partitioner breaks CSS into only two types of partitions depending on the region type:<br />
+	 * <code>COMMENT</code><br />
+	 * <code>STYLE</code></p>
+	 * 
+	 * @see org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner#getPartitionType(org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion, int)
+	 */
+	public String getPartitionType(ITextRegion region, int offset) {
+		String partitionType;
+		
+		String regionType = region.getType();
+		
+		if(regionType == CSSRegionContexts.CSS_COMMENT) {
+			partitionType = ICSSPartitions.COMMENT;
+		} else {
+			partitionType = super.getPartitionType(region, offset);
+		}
+		
+		return partitionType;
+	}
 }
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/text/ICSSPartitions.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/text/ICSSPartitions.java
index e06afcb..ea73d73 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/text/ICSSPartitions.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/text/ICSSPartitions.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -21,4 +21,5 @@
 public interface ICSSPartitions {
 
 	String STYLE = "org.eclipse.wst.css.STYLE"; //$NON-NLS-1$
+	String COMMENT = "org.eclipse.wst.css.COMMENT"; //$NON-NLS-1$
 }
diff --git a/bundles/org.eclipse.wst.css.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.css.ui/META-INF/MANIFEST.MF
index 19f30e5..d59a221 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.300.qualifier
+Bundle-Version: 1.0.501.qualifier
 Bundle-Activator: org.eclipse.wst.css.ui.internal.CSSUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
@@ -29,22 +29,23 @@
  org.eclipse.wst.css.ui.internal.wizard;x-internal:=true,
  org.eclipse.wst.css.ui.views.contentoutline,
  org.eclipse.wst.css.ui.views.properties
-Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.views;bundle-version="[3.3.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.0.400,1.1.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.200,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.200,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.3.0,2.0.0)";resolution:=optional,
- org.eclipse.wst.common.modulecore;bundle-version="[1.1.200,1.2.0)";resolution:=optional,
- com.ibm.icu;bundle-version="[3.8.1,4.0.0)"
+Import-Package: com.ibm.icu.util; version="3.8",
+ com.ibm.icu.text; version="3.8"
+Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.views;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.xml.ui;bundle-version="[1.1.100,1.2.0)",
+ org.eclipse.wst.sse.ui;bundle-version="[1.2.0,1.3.0)",
+ org.eclipse.wst.css.core;bundle-version="[1.1.300,1.2.0)",
+ org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.html.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.0,2.0.0)";resolution:=optional,
+ org.eclipse.wst.common.modulecore;bundle-version="[1.2.0,2.0.0)";resolution:=optional
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.css.ui/about.html b/bundles/org.eclipse.wst.css.ui/about.html
index 73db36e..2199df3 100644
--- a/bundles/org.eclipse.wst.css.ui/about.html
+++ b/bundles/org.eclipse.wst.css.ui/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/bundles/org.eclipse.wst.css.ui/build.properties b/bundles/org.eclipse.wst.css.ui/build.properties
index d5ac966..73f9b41 100644
--- a/bundles/org.eclipse.wst.css.ui/build.properties
+++ b/bundles/org.eclipse.wst.css.ui/build.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2005 IBM Corporation and others.
+# Copyright (c) 2004, 2009 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -19,5 +19,4 @@
 bin.excludes = bin/**,\
                @dot/**,\
                temp.folder/**
-src.includes = build.properties
 source.. = src/
diff --git a/bundles/org.eclipse.wst.css.ui/plugin.properties b/bundles/org.eclipse.wst.css.ui/plugin.properties
index 32dfaf0..94c3b8a 100644
--- a/bundles/org.eclipse.wst.css.ui/plugin.properties
+++ b/bundles/org.eclipse.wst.css.ui/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2008 IBM Corporation and others.
+# Copyright (c) 2004, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -8,11 +8,12 @@
 # Contributors:
 #     IBM Corporation - initial API and implementation
 ###############################################################################
-providerName=Eclipse.org
+providerName=Eclipse Web Tools Platform
 pluginName=SSE CSS Source Editor
 CSS_Source_Page_Editor.name=CSS Editor
 CSS_Files.name=CSS Files
 CSS_Source.name=Editor
+CSS_Content_Assist.name=Content Assist
 CSS_Styles.name=Styles
 CSS_Templates.name=Templates
 CSS_Syntax_Coloring=Syntax Coloring
@@ -23,8 +24,8 @@
 
 
 #org.eclipse.ui.newWizards extension point
-_UI_WIZARD_NAME = CSS
-_UI_WIZARD_CREATE_NEW_FILE = Create a new Cascading Style Sheet
+_UI_WIZARD_NAME = CSS File
+_UI_WIZARD_CREATE_NEW_FILE = Create a new CSS file
 ##
 AddTask.label=Add &Task...
 AddTask.tooltip=Add Task...
@@ -48,9 +49,36 @@
 ##
 preferenceKeywords.files=editor css creating saving files suffix specified encoding iana
 preferenceKeywords.source=editor css source formatting line width insert break properties wrapping style attribute html indent tabs spaces size capitalization identifier property name value uppercase lowercase
+preferenceKeywords.contentassist=editor css content code assist complete completion insert overwrite single proposal common prefix automatically import fill argument name guess alphabetical hide auto activation trigger category categories separate specific
 preferenceKeywords.templates=editor css templates snippet macros
 preferenceKeywords.styles=editor css style customize syntax highlighting type text content foreground background bold color
 preferenceKeywords.webcontent=editor css web content settings profile style
 
 scope.structured.text.editor.css.name=Editing CSS Source
 scope.structured.text.editor.css.description=Editing CSS Source
+
+command.toggle.comment.mnemonic=T
+command.remove.block.comment.mnemonic=R
+command.add.block.comment.mnemonic=A
+
+Colors.atmarkRule=At Mark Rule
+Colors.selector=Selector
+Colors.media=Media
+Colors.comment=Comment
+Colors.propertyName=Property Name
+Colors.propertyValue=Property Value
+Colors.uri=URI
+Colors.string=String
+Colors.error=Error
+Colors.combinator=Combinator
+Colors.pseudo=Pseudo-class
+Colors.attrValue=Attribute Value
+Colors.attrOp=Attribute Operator
+Colors.attrName=Attribute Name
+Colors.attrDelim=Attribute Delimiter
+Colors.universal=Universal Selector
+Colors.class=Class selector
+Colors.id=ID Selector
+
+proposalCategory.css=CSS Proposals
+proposalCategory.cssTemplates=CSS Template Proposals
diff --git a/bundles/org.eclipse.wst.css.ui/plugin.xml b/bundles/org.eclipse.wst.css.ui/plugin.xml
index e622535..2b72d18 100644
--- a/bundles/org.eclipse.wst.css.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.css.ui/plugin.xml
@@ -19,6 +19,9 @@
 		<contentOutlineConfiguration
 			class="org.eclipse.wst.css.ui.views.contentoutline.CSSContentOutlineConfiguration"
 			target="org.eclipse.wst.css.core.csssource" />
+		<quickOutlineConfiguration
+			class="org.eclipse.wst.css.ui.views.contentoutline.CSSQuickOutlineConfiguration"
+			target="org.eclipse.wst.css.core.csssource" />
 		<sourceViewerConfiguration
 			class="org.eclipse.wst.css.ui.StructuredTextViewerConfigurationCSS"
 			target="org.eclipse.wst.css.core.csssource" />
@@ -30,8 +33,8 @@
 			class="org.eclipse.wst.css.ui.internal.text.CSSDocumentRegionEdgeMatcher"
 			target="org.eclipse.wst.css.core.csssource" />
 		<provisionalConfiguration
-			type="structuredtextfoldingprovider"
-			class="org.eclipse.wst.css.ui.internal.projection.StructuredTextFoldingProviderCSS"
+			type="foldingstrategy"
+			class="org.eclipse.wst.css.ui.internal.projection.CSSFoldingStrategy"
 			target="org.eclipse.wst.css.core.csssource" />
 		<provisionalConfiguration
 			type="autoeditstrategy"
@@ -39,7 +42,11 @@
 			target="org.eclipse.wst.css.STYLE" />
 		<provisionalDefinition
 			type="preferencepages"
-			value="org.eclipse.wst.css.ui.preferences.css org.eclipse.wst.sse.ui.preferences.css.source, org.eclipse.wst.css.ui.preferences.templates, org.eclipse.wst.sse.ui.preferences.css.styles"
+			value="org.eclipse.wst.css.ui.preferences.css org.eclipse.wst.sse.ui.preferences.css.source, org.eclipse.wst.css.ui.preferences.templates, org.eclipse.wst.sse.ui.preferences.css.styles, org.eclipse.wst.sse.ui.preferences.css.contentassist"
+			target="org.eclipse.wst.css.core.csssource" />
+		<provisionalDefinition
+			type="spellingregions"
+			value="COMMENT"
 			target="org.eclipse.wst.css.core.csssource" />
 		<provisionalDefinition
 			type="activecontexts"
@@ -86,6 +93,15 @@
 			id="org.eclipse.wst.sse.ui.preferences.css.source">
 			<keywordReference id="org.eclipse.wst.css.ui.source"/>
 		</page>
+  <page
+        category="org.eclipse.wst.sse.ui.preferences.css.source"
+        class="org.eclipse.wst.css.ui.internal.preferences.ui.CSSContentAssistPreferencePage"
+        id="org.eclipse.wst.sse.ui.preferences.css.contentassist"
+        name="%CSS_Content_Assist.name">
+     <keywordReference
+           id="org.eclipse.wst.css.ui.contentassist">
+     </keywordReference>
+  </page>
 		<page
 			name="%CSS_Templates.name"
 			category="org.eclipse.wst.sse.ui.preferences.css.source"
@@ -141,6 +157,10 @@
 		<keyword
 			label="%preferenceKeywords.webcontent"
 			id="org.eclipse.wst.css.ui.webcontent"/>
+  <keyword
+        id="org.eclipse.wst.css.ui.contentassist"
+        label="%preferenceKeywords.contentassist">
+  </keyword>
     </extension>
 
 	<!-- Editor actionsets -->
@@ -155,6 +175,15 @@
 		</actionSetPartAssociation>
 	</extension>
 
+	<extension point="org.eclipse.core.runtime.adapters">
+		<factory
+			adaptableType="org.eclipse.wst.css.core.internal.provisional.document.ICSSModel"
+			class="org.eclipse.wst.css.ui.internal.editor.CSSSelectionConverterFactory">
+			<adapter
+				type="org.eclipse.wst.sse.ui.internal.editor.SelectionConvertor"/>
+		</factory>
+	</extension>
+
 	<!-- initialize css ui preferences -->
 	<extension point="org.eclipse.core.runtime.preferences">
 		<initializer
@@ -173,6 +202,16 @@
 			<selection class="org.eclipse.core.resources.IResource" />
 		</wizard>
 	</extension>
+	
+	<extension point="org.eclipse.ui.menus">
+		<menuContribution locationURI="menu:edit?after=additions">
+			<command commandId="org.eclipse.ui.edit.text.contentAssist.proposals" id="CSSContentAssist" style="push">
+			   <visibleWhen checkEnabled="false">
+					<reference definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition"></reference>
+				</visibleWhen>
+			</command>
+		</menuContribution>
+	</extension>
 
 	<extension point="org.eclipse.ui.popupMenus">
 		<viewerContribution
@@ -228,6 +267,48 @@
 			</enabledWhen>
 		</handler>
 		<handler
+             class="org.eclipse.wst.css.ui.internal.handlers.ToggleCommentHandler"
+             commandId="org.eclipse.wst.sse.ui.toggle.comment">
+             <activeWhen>
+             	<reference
+                    definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition">
+             	</reference>
+             </activeWhen>
+             <enabledWhen>
+             	<reference
+                    definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition">
+             	</reference>
+             </enabledWhen>
+       </handler>
+       <handler
+             class="org.eclipse.wst.css.ui.internal.handlers.AddBlockCommentHandler"
+             commandId="org.eclipse.wst.sse.ui.add.block.comment">
+             <activeWhen>
+             	<reference
+                    definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition">
+             	</reference>
+             </activeWhen>
+             <enabledWhen>
+             	<reference
+                    definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition">
+             	</reference>
+             </enabledWhen>
+       </handler>
+       <handler
+             class="org.eclipse.wst.css.ui.internal.handlers.RemoveBlockCommentHandler"
+             commandId="org.eclipse.wst.sse.ui.remove.block.comment">
+             <activeWhen>
+             	<reference
+                    definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition">
+             	</reference>
+             </activeWhen>
+             <enabledWhen>
+             	<reference
+                    definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition">
+             	</reference>
+             </enabledWhen>
+       </handler>
+		<handler
 			class="org.eclipse.wst.css.ui.internal.handlers.StructuredSelectEnclosingHandler"
 			commandId="org.eclipse.wst.sse.ui.structure.select.enclosing">
 			<activeWhen>
@@ -269,6 +350,54 @@
 			</enabledWhen>
 		</handler>
 	</extension>
+
+	<extension point="org.eclipse.ui.menus">
+		<menuContribution
+	       locationURI="popup:sourcePopupMenuId?before=sourceBegin">
+			<command commandId="org.eclipse.wst.sse.ui.toggle.comment" id="ToggleComment" style="push">
+				<visibleWhen checkEnabled="false">
+					<reference definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition"/>
+				</visibleWhen>
+			</command>
+			<command commandId="org.eclipse.wst.sse.ui.add.block.comment" id="AddBlockComment" style="push">
+				<visibleWhen checkEnabled="false">
+					<reference definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition" />
+				</visibleWhen>
+			</command>
+			<command commandId="org.eclipse.wst.sse.ui.remove.block.comment" id="RemoveBlockComment" style="push">
+				<visibleWhen checkEnabled="false">
+					<reference definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition" />
+				</visibleWhen>
+			</command>
+		</menuContribution>
+
+		<menuContribution locationURI="menu:sourceMenuId?before=sourceBegin">
+			<command commandId="org.eclipse.wst.sse.ui.toggle.comment"
+			         id="ToggleComment"
+			         mnemonic="%command.toggle.comment.mnemonic"
+			         style="push">
+				<visibleWhen checkEnabled="false">
+					<reference definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition"/>
+				</visibleWhen>
+			</command>
+			<command commandId="org.eclipse.wst.sse.ui.add.block.comment"
+			         id="AddBlockComment"
+			         mnemonic="%command.add.block.comment.mnemonic"
+			         style="push">
+				<visibleWhen checkEnabled="false">
+					<reference definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition"/>
+				</visibleWhen>
+			</command>
+			<command commandId="org.eclipse.wst.sse.ui.remove.block.comment"
+			         id="RemoveBlockComment"
+			         mnemonic="%command.remove.block.comment.mnemonic"
+			         style="push">
+				<visibleWhen checkEnabled="false">
+					<reference definitionId="org.eclipse.wst.css.ui.cssSourceContributions.definition"/>
+				</visibleWhen>
+			</command>
+		</menuContribution>
+	</extension>
 	<!-- CSS editor actions -->
 	<extension point="org.eclipse.ui.editorActions">
 		<!--<editorContribution
@@ -341,4 +470,272 @@
             </with>
 		</definition>
 	</extension>
+	
+	<!-- Define theme -->
+	<extension
+		point="org.eclipse.ui.themes">
+		<theme
+			id="org.eclipse.ui.ide.systemDefault">
+			<colorOverride
+				id="ATMARK_RULE"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="SELECTOR"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="MEDIA"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="COMMENT"
+				value="COLOR_LIST_SELECTION">
+			</colorOverride>
+			<colorOverride
+				id="PROPERTY_NAME"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="PROPERTY_VALUE"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="URI"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="STRING"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="ERROR"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="UNIVERSAL"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="ID"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="CLASS"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="ATTRIBUTE_DELIM"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="ATTRIBUTE_NAME"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="ATTRIBUTE_OPERATOR"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="ATTRIBUTE_VALUE"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="PSEUDO"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="COMBINATOR"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+		</theme>
+		<colorDefinition
+			id="ATMARK_RULE"
+			isEditable="false"
+			label="%Colors.atmarkRule"
+			value="63, 127, 127">
+		</colorDefinition>
+		<colorDefinition
+			id="SELECTOR"
+			isEditable="false"
+			label="%Colors.selector"
+			value="63, 127, 127">
+		</colorDefinition>
+		<colorDefinition
+			id="MEDIA"
+			isEditable="false"
+			label="%Colors.media"
+			value="42, 0, 225">
+		</colorDefinition>
+		<colorDefinition
+			id="COMMENT"
+			isEditable="false"
+			label="%Colors.comment"
+			value="63, 95, 191">
+		</colorDefinition>
+		<colorDefinition
+			id="PROPERTY_NAME"
+			isEditable="false"
+			label="%Colors.propertyName"
+			value="127, 0, 127">
+		</colorDefinition>
+		<colorDefinition
+			id="PROPERTY_VALUE"
+			isEditable="false"
+			label="%Colors.propertyValue"
+			value="42, 0, 225">
+		</colorDefinition>
+		<colorDefinition
+			id="URI"
+			isEditable="false"
+			label="%Colors.uri"
+			value="42, 0, 225">
+		</colorDefinition>
+		<colorDefinition
+			id="STRING"
+			isEditable="false"
+			label="%Colors.string"
+			value="42, 0, 225">
+		</colorDefinition>
+		<colorDefinition
+			id="ERROR"
+			isEditable="false"
+			label="%Colors.error"
+			value="191, 63, 63">
+		</colorDefinition>
+		<colorDefinition
+			id="UNIVERSAL"
+			isEditable="false"
+			label="%Colors.universal"
+			value="63, 127, 127">
+		</colorDefinition>
+		<colorDefinition
+			id="ID"
+			isEditable="false"
+			label="%Colors.id"
+			value="63, 127, 127">
+		</colorDefinition>
+		<colorDefinition
+			id="CLASS"
+			isEditable="false"
+			label="%Colors.class"
+			value="63, 127, 127">
+		</colorDefinition>
+		<colorDefinition
+			id="ATTRIBUTE_DELIM"
+			isEditable="false"
+			label="%Colors.attrDelim"
+			value="63, 127, 127">
+		</colorDefinition>
+		<colorDefinition
+			id="ATTRIBUTE_NAME"
+			isEditable="false"
+			label="%Colors.attrName"
+			value="63, 127, 127">
+		</colorDefinition>
+		<colorDefinition
+			id="ATTRIBUTE_OPERATOR"
+			isEditable="false"
+			label="%Colors.attrOp"
+			value="63, 127, 127">
+		</colorDefinition>
+		<colorDefinition
+			id="ATTRIBUTE_VALUE"
+			isEditable="false"
+			label="%Colors.attrValue"
+			value="63, 127, 127">
+		</colorDefinition>
+		<colorDefinition
+			id="PSEUDO"
+			isEditable="false"
+			label="%Colors.pseudo"
+			value="63, 127, 127">
+		</colorDefinition>
+		<colorDefinition
+			id="COMBINATOR"
+			isEditable="false"
+			label="%Colors.combinator"
+			value="63, 127, 127">
+		</colorDefinition>
+	</extension>
+	
+	<!-- Enable the FormatHandler for CSS Content Type -->
+	<extension point="org.eclipse.ui.handlers">
+		<handler 
+			class="org.eclipse.wst.sse.ui.internal.handlers.FormatHandler"
+			commandId="org.eclipse.wst.sse.ui.format">
+			<activeWhen>
+				<reference definitionId="org.eclipse.wst.css.ui.cssContentType.definition"></reference>
+			</activeWhen>
+			<enabledWhen>
+				<reference definitionId="org.eclipse.wst.css.ui.cssContentType.definition"></reference>
+			</enabledWhen>
+		</handler>
+	</extension>
+	
+	<!-- Set up a definition for CSS Content Types -->
+	<extension point="org.eclipse.core.expressions.definitions">
+		<definition id="org.eclipse.wst.css.ui.cssContentType.definition">
+			<iterate ifEmpty="false">
+				<adapt type="org.eclipse.core.resources.IFile">
+					<!-- Force property tester to load, should not cause entire plug-in to start -->
+					<test property="org.eclipse.wst.sse.core.resources.contentTypeId"
+						value="org.eclipse.wst.css.core.csssource" forcePluginActivation="true"/>
+				</adapt>
+			</iterate>
+		</definition>
+	</extension>
+
+	<extension point="org.eclipse.wst.sse.ui.characterPairing">
+		<inserter class="org.eclipse.wst.css.ui.internal.text.CSSCharacterPairInserter" id="org.eclipse.wst.html.css.ui.inserter">
+			<contentTypeIdentifier
+				id="org.eclipse.wst.html.core.htmlsource"
+				partitions="org.eclipse.wst.css.STYLE">
+			</contentTypeIdentifier>
+		</inserter>
+		<inserter class="org.eclipse.wst.css.ui.internal.text.CSSCharacterPairInserter" id="org.eclipse.wst.css.ui.inserter">
+			<contentTypeIdentifier
+				id="org.eclipse.wst.css.core.csssource"
+				partitions="org.eclipse.wst.css.STYLE">
+			</contentTypeIdentifier>
+		</inserter>
+	</extension>
+ <extension
+       point="org.eclipse.wst.sse.ui.completionProposal">
+    <proposalCategory
+          icon="icons/full/obj16/tag_selector.gif"
+          id="org.eclipse.wst.css.ui.proposalCategory.css"
+          name="%proposalCategory.css">
+    </proposalCategory>
+    <proposalCategory
+          icon="icons/full/obj16/tag-template.gif"
+          id="org.eclipse.wst.css.ui.proposalCategory.cssTemplates"
+          name="%proposalCategory.cssTemplates">
+    </proposalCategory>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.wst.css.ui.proposalCategory.css"
+          class="org.eclipse.wst.css.ui.internal.contentassist.CSSCompletionProposalComputer"
+          id="org.eclipse.wst.css.ui.proposalComputer.css">
+       <contentType
+             id="org.eclipse.wst.css.core.csssource">
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.wst.css.ui.proposalCategory.cssTemplates"
+          class="org.eclipse.wst.css.ui.internal.contentassist.CSSTemplatesCompletionProposalComputer"
+          id="org.eclipse.wst.css.ui.proposalComputer.cssTemplates">
+       <contentType
+             id="org.eclipse.wst.css.core.csssource">
+       </contentType>
+    </proposalComputer>
+ </extension>
+ <extension
+       point="org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration">
+    <categoriesConfiguration
+          class="org.eclipse.wst.css.ui.internal.preferences.CSSCompletionProposalCategoriesConfiguration"
+          contentTypeID="org.eclipse.wst.css.core.csssource">
+    </categoriesConfiguration>
+ </extension>
 </plugin>
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java
index b470936..2afea5f 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -24,7 +24,7 @@
 import org.eclipse.wst.css.core.internal.format.FormatProcessorCSS;
 import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
 import org.eclipse.wst.css.core.text.ICSSPartitions;
-import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
+import org.eclipse.wst.css.ui.internal.contentassist.CSSStructuredContentAssistProcessor;
 import org.eclipse.wst.css.ui.internal.style.LineStyleProviderForCSS;
 import org.eclipse.wst.sse.core.text.IStructuredPartitions;
 import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
@@ -73,19 +73,19 @@
 
 	public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
 		if (fConfiguredContentTypes == null) {
-			fConfiguredContentTypes = new String[]{ICSSPartitions.STYLE, IStructuredPartitions.DEFAULT_PARTITION, IStructuredPartitions.UNKNOWN_PARTITION};
+			fConfiguredContentTypes = new String[]{ICSSPartitions.STYLE, ICSSPartitions.COMMENT, IStructuredPartitions.DEFAULT_PARTITION, IStructuredPartitions.UNKNOWN_PARTITION};
 		}
 		return fConfiguredContentTypes;
 	}
-
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration#getContentAssistProcessors(
+	 * 	org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
+	 */
 	protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
-		IContentAssistProcessor[] processors = null;
-
-		if ((partitionType == ICSSPartitions.STYLE) || (partitionType == IStructuredPartitions.UNKNOWN_PARTITION)) {
-			processors = new IContentAssistProcessor[]{new CSSContentAssistProcessor()};
-		}
-
-		return processors;
+		IContentAssistProcessor processor = new CSSStructuredContentAssistProcessor(
+				this.getContentAssistant(), partitionType, sourceViewer);
+		return new IContentAssistProcessor[]{processor};
 	}
 
 	public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
@@ -147,7 +147,7 @@
 	public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
 		LineStyleProvider[] providers = null;
 
-		if (partitionType == ICSSPartitions.STYLE) {
+		if (partitionType == ICSSPartitions.STYLE || partitionType == ICSSPartitions.COMMENT) {
 			providers = new LineStyleProvider[]{getLineStyleProviderForCSS()};
 		}
 
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIMessages.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIMessages.java
index fc57763..56040a5 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIMessages.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIMessages.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -55,6 +55,11 @@
 	public static String PrefsLabel_ColorNormal;
 	public static String PrefsLabel_ColorAtmarkRule;
 	public static String PrefsLabel_ColorSelector;
+	public static String PrefsLabel_ColorCombinator;
+	public static String PrefsLabel_ColorUniversal;
+	public static String PrefsLabel_ColorId;
+	public static String PrefsLabel_ColorPseudoClass;
+	public static String PrefsLabel_ColorClass;
 	public static String PrefsLabel_ColorMedia;
 	public static String PrefsLabel_ColorComment;
 	public static String PrefsLabel_ColorPropertyName;
@@ -65,6 +70,10 @@
 	public static String PrefsLabel_ColorSemiColon;
 	public static String PrefsLabel_ColorCurlyBrace;
 	public static String PrefsLabel_ColorError;
+	public static String PrefsLabel_ColorAttrDelimiter;
+	public static String PrefsLabel_ColorAttrName;
+	public static String PrefsLabel_ColorAttrValue;
+	public static String PrefsLabel_ColorAttrOperator;
 	public static String SortAction_0;
 	public static String _UI_WIZARD_NEW_TITLE;
 	public static String _UI_WIZARD_NEW_HEADING;
@@ -80,6 +89,9 @@
 	public static String UI_none;
 	public static String Cleanup_UI_;
 	public static String CSS_Cleanup_UI_;
+	public static String ToggleComment_tooltip;
+	public static String AddBlockComment_tooltip;
+	public static String RemoveBlockComment_tooltip;
 	public static String Identifier_case__UI_;
 	public static String Property_name_case__UI_;
 	public static String Property_value_case__UI_;
@@ -114,6 +126,7 @@
 	public static String NewCSSTemplatesWizardPage_4;
 	public static String NewCSSTemplatesWizardPage_5;
 	public static String NewCSSTemplatesWizardPage_6;
+	public static String NewCSSTemplatesWizardPage_7;
 	public static String CSSContentSettingsPropertyPage_0;
 	public static String CSSContentSettingsPropertyPage_1;
 	public static String SyntaxColoringPage_0;
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPluginResources.properties b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPluginResources.properties
index 5c4bb7a..a29d6c2 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPluginResources.properties
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPluginResources.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2007 IBM Corporation and others.
+# Copyright (c) 2004, 2009 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -34,11 +34,16 @@
 
 ## The following line is a sample CSS document.  Please translate only the following parts:
 ## Sample Styles
-PrefsLabel_ColorSample=@import url("../sample2.css");\n\n/* Sample Styles */\n\nBODY {\n\tcolor : black;\n\tbackground-color : rgb(181, 253, 211);\n\ttext-align : center;\n\tfont-family : "Heisei Mincho W3", serif\n}\n\n@page :left { margin-left : 4cm }\n\n@media aural {\n\tP.heidi {\n\t\tazimuth : center-left;\n\t\televation : 12.3deg;\n\t\tpause : 30ms 1.6s\n\t}\n}\n
+PrefsLabel_ColorSample=@import url("../sample2.css");\n\n/* Sample Styles */\n\nBODY {\n\tcolor : black;\n\tbackground-color : rgb(181, 253, 211);\n\ttext-align : center;\n\tfont-family : "Heisei Mincho W3", serif\n}\n\n#content > div *.links a[href~="http://"]:hover {\n\ttext-decoration : underline;\n}\n\n@page :left { margin-left : 4cm }\n\n@media aural {\n\tP.heidi {\n\t\tazimuth : center-left;\n\t\televation : 12.3deg;\n\t\tpause : 30ms 1.6s\n\t}\n}\n
 
 PrefsLabel_ColorNormal=Default
 PrefsLabel_ColorAtmarkRule=At-Rule
-PrefsLabel_ColorSelector=Selector
+PrefsLabel_ColorSelector=Type Selector
+PrefsLabel_ColorCombinator=Combinator
+PrefsLabel_ColorUniversal=Universal Selector
+PrefsLabel_ColorId=Id Selector
+PrefsLabel_ColorPseudoClass=Pseudo-class
+PrefsLabel_ColorClass=Class Selector
 PrefsLabel_ColorMedia=Media Name
 PrefsLabel_ColorComment=Comment
 PrefsLabel_ColorPropertyName=Property Name
@@ -46,14 +51,18 @@
 PrefsLabel_ColorUri=URI
 PrefsLabel_ColorString=Quoted String
 PrefsLabel_ColorColon=Property Delimiter
-PrefsLabel_ColorSemiColon=SemiColon
+PrefsLabel_ColorSemiColon=Semicolon
 PrefsLabel_ColorCurlyBrace=Curly Brace
 PrefsLabel_ColorError=Error
+PrefsLabel_ColorAttrDelimiter=Attribute Selector Delimiter
+PrefsLabel_ColorAttrName=Attribute Name
+PrefsLabel_ColorAttrValue=Attribute Value
+PrefsLabel_ColorAttrOperator=Attribute Selector Operator
 #
 SortAction_0=Sort
 #
-_UI_WIZARD_NEW_TITLE = New Cascading Style Sheet
-_UI_WIZARD_NEW_HEADING = Cascading Style Sheet
+_UI_WIZARD_NEW_TITLE = New CSS File
+_UI_WIZARD_NEW_HEADING = CSS
 _UI_WIZARD_NEW_DESCRIPTION = Create a new CSS file.
 _ERROR_FILENAME_MUST_END_CSS = The file name must end in one of the following extensions {0}.
 _WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT = Files created outside of the Web Content folder will not be included in your deployed Web application. 
@@ -68,6 +77,9 @@
 UI_none=none
 Cleanup_UI_=Cleanup
 CSS_Cleanup_UI_=CSS Cleanup
+AddBlockComment_tooltip=Add Block Comment
+RemoveBlockComment_tooltip=Remove Block Comment
+ToggleComment_tooltip=Toggle Comment
 Identifier_case__UI_=Identifier case:
 Property_name_case__UI_=Property name case:
 Property_value_case__UI_=Property value case:
@@ -100,9 +112,10 @@
 NewCSSTemplatesWizardPage_1=Select a template as initial content in the CSS page.
 NewCSSTemplatesWizardPage_2=Name
 NewCSSTemplatesWizardPage_3=Description
-NewCSSTemplatesWizardPage_4=Use CSS Template
-NewCSSTemplatesWizardPage_5=Preview:
+NewCSSTemplatesWizardPage_4=&Use CSS Template
+NewCSSTemplatesWizardPage_5=&Preview:
 NewCSSTemplatesWizardPage_6=Templates are 'New CSS' templates found in the <a>CSS Templates</a> preference page.
+NewCSSTemplatesWizardPage_7=&Templates:
 # CSS Content Settings
 CSSContentSettingsPropertyPage_0=The type of CSS to use.  The project setting is used if you specify "none."
 CSSContentSettingsPropertyPage_1=CSS Profile:
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java
index 531b0ca..43e9c53 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -36,6 +36,7 @@
 
 	class CompoundRegion {
 
+		/* textRegion can be null if the offset is at the end of the document */
 		CompoundRegion(IStructuredDocumentRegion documentRegion, ITextRegion textRegion) {
 			super();
 			this.documentRegion = documentRegion;
@@ -51,27 +52,27 @@
 		}
 
 		int getStart() {
-			return textRegion.getStart();
+			return (textRegion != null) ? textRegion.getStart() : documentRegion.getStart();
 		}
 
 		int getEnd() {
-			return textRegion.getEnd();
+			return (textRegion != null) ? textRegion.getEnd() : documentRegion.getEnd();
 		}
 
 		String getType() {
-			return textRegion.getType();
+			return (textRegion != null) ? textRegion.getType() : CSSRegionContexts.CSS_UNKNOWN;
 		}
 
 		String getText() {
-			return documentRegion.getText(textRegion);
+			return (textRegion != null) ? documentRegion.getText(textRegion) : ""; //$NON-NLS-1$
 		}
 
 		int getStartOffset() {
-			return documentRegion.getStartOffset(textRegion);
+			return (textRegion != null) ? documentRegion.getStartOffset(textRegion) : documentRegion.getStartOffset();
 		}
 
 		int getEndOffset() {
-			return documentRegion.getEndOffset(textRegion);
+			return (textRegion != null) ? documentRegion.getEndOffset(textRegion) : documentRegion.getEndOffset();
 		}
 
 		private IStructuredDocumentRegion documentRegion;
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSCompletionProposalComputer.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSCompletionProposalComputer.java
new file mode 100644
index 0000000..81f6817
--- /dev/null
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSCompletionProposalComputer.java
@@ -0,0 +1,258 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.css.ui.internal.contentassist;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.wst.css.core.internal.Logger;
+import org.eclipse.wst.css.core.internal.provisional.adapters.ICSSModelAdapter;
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
+import org.eclipse.wst.html.core.internal.htmlcss.StyleAdapterFactory;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistUtilities;
+import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
+
+/**
+ * <p>Completion computer for CSS</p>
+ */
+public class CSSCompletionProposalComputer implements ICompletionProposalComputer {
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeCompletionProposals(CompletionProposalInvocationContext context, IProgressMonitor monitor) {
+		ITextViewer viewer = context.getViewer();
+		int documentPosition = context.getInvocationOffset();
+		
+		IndexedRegion indexedNode = ContentAssistUtils.getNodeAt(viewer, documentPosition);
+		IDOMNode xNode = null;
+		IDOMNode parent = null;
+		CSSProposalArranger arranger = null;
+
+		// If there is a selected region, we'll need to replace the text
+		ITextSelection selection = (ITextSelection) viewer.getSelectionProvider().getSelection();
+
+		// bail if we couldn't get an indexed node
+		// if(indexedNode == null) return new ICompletionProposal[0];
+		if (indexedNode instanceof IDOMNode) {
+			xNode = (IDOMNode) indexedNode;
+			parent = (IDOMNode) xNode.getParentNode();
+		}
+		// need to get in here if there in the no 0 region <style>|</style>
+		// case
+		if ((xNode != null) && xNode.getNodeName().equalsIgnoreCase(HTML40Namespace.ElementName.STYLE)) {
+			// now we know the cursor is in a <style> tag w/out region
+			IStructuredModel cssModel = getCSSModel(xNode);
+			if (cssModel != null) {
+				// adjust offsets for embedded style
+				int offset = documentPosition;
+				int pos = 0;
+				IndexedRegion keyIndexedNode = cssModel.getIndexedRegion(pos);
+				if (keyIndexedNode == null) {
+					keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
+				}
+				arranger = new CSSProposalArranger(pos, (ICSSNode) keyIndexedNode, offset, selection.getLength(), (char) 0);
+			}
+		} else if ((parent != null) && parent.getNodeName().equalsIgnoreCase(HTML40Namespace.ElementName.STYLE)) {
+			// now we know the cursor is in a <style> tag with a region
+			// use the parent because that will be the <style> tag
+			IStructuredModel cssModel = getCSSModel(parent);
+			if (cssModel != null) {
+				// adjust offsets for embedded style
+				int offset = indexedNode.getStartOffset();
+				int pos = documentPosition - offset;
+				IndexedRegion keyIndexedNode = cssModel.getIndexedRegion(pos);
+				if (keyIndexedNode == null) {
+					keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
+				}
+				arranger = new CSSProposalArranger(pos, (ICSSNode) keyIndexedNode, offset, selection.getLength(), (char) 0);
+			}
+		} else if (indexedNode instanceof IDOMNode) {
+			IDOMNode domNode = ((IDOMNode)indexedNode);
+			// get model for node w/ style attribute
+			IStructuredModel cssModel = getCSSModel(domNode);
+			if (cssModel != null) {
+				// adjust offsets for embedded style
+				int textRegionStartOffset = getTextRegionStartOffset(domNode, documentPosition);
+				int pos = documentPosition - textRegionStartOffset;
+				
+				char quote = (char) 0;
+				try {
+					quote = context.getDocument().get(textRegionStartOffset, 1).charAt(0);
+				} catch (BadLocationException e) {
+					Logger.logException("error getting quote character", e);
+				}
+				
+				//get css indexed region
+				IndexedRegion cssIndexedNode = cssModel.getIndexedRegion(pos);
+				if (cssIndexedNode == null) {
+					cssIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
+				}
+				if (cssIndexedNode instanceof ICSSNode) {
+					// inline style for a tag, not embedded
+					arranger = new CSSProposalArranger(pos, (ICSSNode) cssIndexedNode, textRegionStartOffset, selection.getLength(), quote);
+				}
+			}
+		} else if (indexedNode instanceof ICSSNode) {
+			// when editing external CSS using CSS Designer, ICSSNode is passed.
+			ICSSDocument cssdoc = ((ICSSNode) indexedNode).getOwnerDocument();
+			if (cssdoc != null) {
+				IStructuredModel cssModel = cssdoc.getModel();
+				if (cssModel != null) {
+					IndexedRegion keyIndexedNode = cssModel.getIndexedRegion(documentPosition);
+					if (keyIndexedNode == null) {
+						keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
+					}
+					if (keyIndexedNode instanceof ICSSNode) {
+						// inline style for a tag, not embedded
+						arranger = new CSSProposalArranger(documentPosition, (ICSSNode) keyIndexedNode, 0, selection.getLength(), (char)0);
+					}
+				}
+			}
+		} else if ((indexedNode == null) && ContentAssistUtils.isViewerEmpty(viewer)) {
+			// the top of empty CSS Document
+			IStructuredModel cssModel = null;
+			try {
+				cssModel = StructuredModelManager.getModelManager().getExistingModelForRead(viewer.getDocument());
+				if (cssModel instanceof ICSSModel) {
+					IndexedRegion keyIndexedNode = cssModel.getIndexedRegion(documentPosition);
+					if (keyIndexedNode == null) {
+						keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
+					}
+					if (keyIndexedNode instanceof ICSSNode) {
+						// inline style for a tag, not embedded
+						arranger = new CSSProposalArranger(documentPosition, (ICSSNode) keyIndexedNode, 0, (char)0);
+					}
+				}
+			} finally {
+				if (cssModel != null)
+					cssModel.releaseFromRead();
+			}
+		}
+
+		ICompletionProposal[] proposals = new ICompletionProposal[0];
+		if (arranger != null) {
+			proposals = arranger.getProposals();
+
+			ICompletionProposal[] newfileproposals = new ICompletionProposal[0];
+			ICompletionProposal[] anyproposals = new ICompletionProposal[0];
+
+			// add end tag if parent is not closed
+			ICompletionProposal endTag = XMLContentAssistUtilities.computeXMLEndTagProposal(viewer, documentPosition, indexedNode, HTML40Namespace.ElementName.STYLE, SharedXMLEditorPluginImageHelper.IMG_OBJ_TAG_GENERIC); 
+
+			// add the additional proposals
+			int additionalLength = newfileproposals.length + anyproposals.length;
+			additionalLength = (endTag != null) ? ++additionalLength : additionalLength;
+			if (additionalLength > 0) {
+				ICompletionProposal[] plusOnes = new ICompletionProposal[proposals.length + additionalLength];
+				int appendPos = proposals.length;
+				// add end tag proposal
+				if (endTag != null) {
+					System.arraycopy(proposals, 0, plusOnes, 1, proposals.length);
+					plusOnes[0] = endTag;
+					++appendPos;
+				} else {
+					System.arraycopy(proposals, 0, plusOnes, 0, proposals.length);
+				}
+				// add items in newfileproposals
+				for (int i = 0; i < newfileproposals.length; ++i) {
+					plusOnes[appendPos + i] = newfileproposals[i];
+				}
+				// add items in anyproposals
+				appendPos = appendPos + newfileproposals.length;
+				for (int i = 0; i < anyproposals.length; ++i) {
+					plusOnes[appendPos + i] = anyproposals[i];
+				}
+				proposals = plusOnes;
+			}
+		}
+		return Arrays.asList(proposals);
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#computeContextInformation(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeContextInformation(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#getErrorMessage()
+	 */
+	public String getErrorMessage() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionStarted()
+	 */
+	public void sessionStarted() {
+		//default is to do nothing
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionEnded()
+	 */
+	public void sessionEnded() {
+		//default is to do nothing
+	}
+	
+	/**
+	 * Returns the CSSmodel for a given XML node.
+	 * 
+	 * @param element
+	 * @return IStructuredModel
+	 */
+	private static IStructuredModel getCSSModel(IDOMNode element) {
+		if (element == null) {
+			return null;
+		}
+		INodeAdapter adapter = StyleAdapterFactory.getInstance().adapt(element);
+		if ((adapter == null) || !(adapter instanceof ICSSModelAdapter)) {
+			return null;
+		}
+		ICSSModelAdapter modelAdapter = (ICSSModelAdapter) adapter;
+		return modelAdapter.getModel();
+	}
+	
+	/**
+	 * <p>Get the start offset of the text region containing the given document position</p>
+	 * 
+	 * @param domNode {@link IDOMNode} containing the document position
+	 * @param documentPosition the document relative position to get the start
+	 * offset of the containing {@link ITextRegion} for
+	 * @return start offset of the {@link ITextRegion} containing the given document position
+	 */
+	private static int getTextRegionStartOffset(IDOMNode domNode, int documentPosition) {
+		IStructuredDocumentRegion structRegion = domNode.getFirstStructuredDocumentRegion();
+		return structRegion.getStartOffset(structRegion.getRegionAtCharacterOffset(documentPosition));
+	}
+}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistContext.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistContext.java
index c810c4f..b5edab9 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistContext.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistContext.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -34,10 +34,12 @@
 	private int fTargetPos = -1;
 	private ICSSNode fTargetNode = null;
 	private int fCursorPos = -1;
+	private int fLength = -1;
 	private IStructuredDocument fStructuredDocument = null;
 	private int fDocumentOffset = 0;
 	private char fQuote = 0;
 	private ICSSModel fModel = null;
+	private boolean fSelected = false;
 
 	/**
 	 *  
@@ -57,6 +59,24 @@
 		initialize(node.getOwnerDocument());
 	}
 
+	CSSContentAssistContext(int documentPosition, ICSSNode node, int documentOffset, int length, char quote) {
+		this();
+		fCursorPos = documentPosition;
+		fDocumentOffset = documentOffset;
+		fQuote = quote;
+		fLength = length;
+		initialize(node.getOwnerDocument());
+	}
+
+	CSSContentAssistContext(int documentPosition, ICSSNode node, int documentOffset, char quote, boolean selected) {
+		this();
+		fCursorPos = documentPosition;
+		fDocumentOffset = documentOffset;
+		fQuote = quote;
+		fSelected = selected;
+		initialize(node.getOwnerDocument());
+	}
+
 	/**
 	 * @return int
 	 */
@@ -96,7 +116,17 @@
 		if (fStructuredDocument != null) {
 			IStructuredDocumentRegion flatNode = fStructuredDocument.getRegionAtCharacterOffset(offset);
 			if (flatNode != null) {
-				region = flatNode.getRegionAtCharacterOffset(offset);
+				//if its a quoted region and at the beginning of a node then get the node before it
+				if(offset == flatNode.getStartOffset() && fQuote != 0) {
+					flatNode = fStructuredDocument.getRegionAtCharacterOffset(offset-1);
+				}
+				
+				//if its the end offset of the node then to get the region need to step back one
+				if(offset == flatNode.getEndOffset()) {
+					region = flatNode.getRegionAtCharacterOffset(offset-1);
+				} else {
+					region = flatNode.getRegionAtCharacterOffset(offset);
+				}
 			}
 		}
 		return region;
@@ -264,6 +294,11 @@
 		} else {
 			fTargetPos = fCursorPos - 1;
 		}
+		
+		//deal with the leading quote
+		if(fQuote != 0) {
+			fTargetPos--;
+		}
 	}
 
 	/**
@@ -279,16 +314,33 @@
 		} else {
 			String regionText = documentRegion.getText(targetRegion);
 			int regionStart = documentRegion.getStartOffset(targetRegion);
-			if (regionStart == fCursorPos || regionText.trim().length() == 0 || regionStart + regionText.length() - 1 < fTargetPos) {
+			if (!fSelected && (regionStart == fCursorPos || regionText.trim().length() == 0 || regionStart + regionText.length() - 1 < this.fTargetPos)) {
 				// to insertion
 				fReplaceBegin = fCursorPos;
 				fTextToReplace = ""; //$NON-NLS-1$
 				fTextToCompare = ""; //$NON-NLS-1$
+				try {
+					if (fLength > 0)
+						fTextToReplace = fStructuredDocument.get(fReplaceBegin, fLength);
+				}
+				catch (BadLocationException e) {
+				}
 			} else {
 				// to replace
 				fReplaceBegin = regionStart;
 				fTextToReplace = regionText;
-				fTextToCompare = regionText.substring(0, fCursorPos - fReplaceBegin);
+
+				//math to deal with leading quote
+				int matchLength = fCursorPos - fReplaceBegin;
+				if(fQuote != 0) {
+					matchLength--;
+					fReplaceBegin++;
+				}
+				
+				if(fCursorPos >= fReplaceBegin && regionText.trim().length() >= (matchLength))
+					fTextToCompare = regionText.substring(0, matchLength);
+				else
+					fTextToCompare = ""; //$NON-NLS-1$
 			}
 		}
 	}
@@ -298,10 +350,18 @@
 	 */
 	private boolean isSpecialDelimiterRegion(int pos) {
 		ITextRegion region = getRegionByOffset(pos);
-		String type = region.getType();
-		return (type == CSSRegionContexts.CSS_LBRACE || type == CSSRegionContexts.CSS_RBRACE || type == CSSRegionContexts.CSS_DELIMITER || type == CSSRegionContexts.CSS_DECLARATION_SEPARATOR || type == CSSRegionContexts.CSS_DECLARATION_DELIMITER || type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR);
+		String type = null;
+		if(region != null) {
+			type = region.getType();
+		}
+		return (type != null) &&((type == CSSRegionContexts.CSS_LBRACE ||
+				type == CSSRegionContexts.CSS_RBRACE ||
+				type == CSSRegionContexts.CSS_DELIMITER ||
+				type == CSSRegionContexts.CSS_DECLARATION_SEPARATOR ||
+				type == CSSRegionContexts.CSS_DECLARATION_DELIMITER ||
+				type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR ||
+				type == CSSRegionContexts.CSS_S));
 	}
-
 	/**
 	 *  
 	 */
@@ -372,12 +432,11 @@
 	 *  
 	 */
 	boolean targetHas(String regionType) {
-		int start = ((IndexedRegion) fTargetNode).getStartOffset();
 		int end = ((IndexedRegion) fTargetNode).getEndOffset();
-		if (start < 0 || end <= 0) {
+		if (getTargetPos() < 0 || end <= 0) {
 			return false;
 		}
-		RegionIterator iRegion = new RegionIterator(fStructuredDocument, start);
+		RegionIterator iRegion = new RegionIterator(fStructuredDocument, getTargetPos());
 		while (iRegion.hasNext()) {
 			ITextRegion region = iRegion.next();
 			if (end <= iRegion.getStructuredDocumentRegion().getStartOffset(region)) {
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistProcessor.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistProcessor.java
index 9530ceb..b4af3d0 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistProcessor.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
 
 
 
+import org.eclipse.jface.text.ITextSelection;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
 import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
@@ -30,6 +31,10 @@
 import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistUtilities;
 import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
 
+/**
+ * @deprecated This class is no longer used locally and will be removed in the future
+ * @see CSSStructuredContentAssistProcessor
+ */
 public class CSSContentAssistProcessor implements IContentAssistProcessor {
 
 	private int fDocumentOffset = 0;
@@ -52,7 +57,10 @@
 		IDOMNode parent = null;
 		CSSProposalArranger arranger = null;
 		boolean isEmptyDocument = false;
-
+		// If there is a selected region, we'll need to replace the text
+		ITextSelection selection = (ITextSelection) viewer.getSelectionProvider().getSelection();
+		boolean selected = (selection != null && selection.getText() != null && selection.getText().trim().length() > 0);
+		
 		// bail if we couldn't get an indexed node
 		// if(indexedNode == null) return new ICompletionProposal[0];
 		if (indexedNode instanceof IDOMNode) {
@@ -66,13 +74,13 @@
 			IStructuredModel cssModel = getCSSModel(xNode);
 			if (cssModel != null) {
 				// adjust offsets for embedded style
-				int offset = documentPosition;
+				int offset = documentPosition + fDocumentOffset;
 				int pos = 0;
 				IndexedRegion keyIndexedNode = cssModel.getIndexedRegion(pos);
 				if (keyIndexedNode == null) {
 					keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
 				}
-				arranger = new CSSProposalArranger(pos, (ICSSNode) keyIndexedNode, offset, (char) 0);
+				arranger = new CSSProposalArranger(pos, (ICSSNode) keyIndexedNode, offset, (char) 0, selected);
 			}
 		} else if ((parent != null) && parent.getNodeName().equalsIgnoreCase(HTML40Namespace.ElementName.STYLE)) {
 			// now we know the cursor is in a <style> tag with a region
@@ -86,7 +94,7 @@
 				if (keyIndexedNode == null) {
 					keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
 				}
-				arranger = new CSSProposalArranger(pos, (ICSSNode) keyIndexedNode, offset, (char) 0);
+				arranger = new CSSProposalArranger(pos, (ICSSNode) keyIndexedNode, offset, (char) 0, selected);
 			}
 		} else if (indexedNode instanceof IDOMNode) {
 			// get model for node w/ style attribute
@@ -98,7 +106,7 @@
 				}
 				if (keyIndexedNode instanceof ICSSNode) {
 					// inline style for a tag, not embedded
-					arranger = new CSSProposalArranger(documentPosition, (ICSSNode) keyIndexedNode, fDocumentOffset, fQuote);
+					arranger = new CSSProposalArranger(documentPosition, (ICSSNode) keyIndexedNode, fDocumentOffset, fQuote, selected);
 				}
 			}
 		} else if (indexedNode instanceof ICSSNode) {
@@ -114,7 +122,7 @@
 					}
 					if (keyIndexedNode instanceof ICSSNode) {
 						// inline style for a tag, not embedded
-						arranger = new CSSProposalArranger(documentPosition, (ICSSNode) keyIndexedNode, fDocumentOffset, fQuote);
+						arranger = new CSSProposalArranger(documentPosition, (ICSSNode) keyIndexedNode, fDocumentOffset, fQuote, selected);
 					}
 				}
 			}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalArranger.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalArranger.java
index e67f5cb..98f8797 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalArranger.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalArranger.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -49,6 +49,16 @@
 		fContext = new CSSContentAssistContext(documentPosition, node, documentOffset, quote);
 	}
 
+	CSSProposalArranger(int documentPosition, ICSSNode node, int documentOffset, int length, char quote) {
+		this();
+		fContext = new CSSContentAssistContext(documentPosition, node, documentOffset, length, quote);
+	}
+
+	CSSProposalArranger(int documentPosition, ICSSNode node, int documentOffset, char quote, boolean selected) {
+		this();
+		fContext = new CSSContentAssistContext(documentPosition, node, documentOffset, quote, selected);
+	}
+
 	/**
 	 *  
 	 */
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGenerator.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGenerator.java
index cb39336..da5214e 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGenerator.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGenerator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,7 +23,6 @@
 import org.eclipse.wst.css.core.internal.CSSCorePlugin;
 import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
 import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
 import org.eclipse.wst.css.ui.internal.image.CSSImageHelper;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 
@@ -55,7 +54,7 @@
 	}
 
 	/**
-	 *  
+	 * 
 	 */
 	protected boolean checkLeadingColon() {
 		boolean hasLeadingColon = false;
@@ -65,20 +64,20 @@
 			if (targetRegion != null && targetRegion.getType() == CSSRegionContexts.CSS_SELECTOR_PSEUDO) {
 				hasLeadingColon = true;
 			}
-		} else if (targetRegion != null) {
-			RegionIterator iterator = fContext.getRegionIterator();
-			if (iterator.hasPrev()) {
-				iterator.prev();
-				if (iterator.hasPrev() && iterator.prev().getType() == CSSRegionContexts.CSS_SELECTOR_PSEUDO) {
-					hasLeadingColon = true;
-				}
+		}
+		else if (targetRegion != null) {
+			// BUG 92848 - Changed how pseudo-selectors are defined in the
+			// tokenizer
+			// The target region should be the CSS_SELECTOR_PSEUDO now
+			if (targetRegion.getType() == CSSRegionContexts.CSS_SELECTOR_PSEUDO) {
+				hasLeadingColon = true;
 			}
 		}
 		return hasLeadingColon;
 	}
 
 	/**
-	 *  
+	 * 
 	 */
 	protected StringAndOffset generateBraces() {
 		StringBuffer buf = new StringBuffer();
@@ -106,7 +105,7 @@
 	}
 
 	/**
-	 *  
+	 * 
 	 */
 	protected StringAndOffset generateParenthesis() {
 		StringBuffer buf = new StringBuffer();
@@ -118,7 +117,7 @@
 	}
 
 	/**
-	 *  
+	 * 
 	 */
 	protected StringAndOffset generateQuotes() {
 		StringBuffer buf = new StringBuffer();
@@ -129,7 +128,7 @@
 	}
 
 	/**
-	 *  
+	 * 
 	 */
 	protected StringAndOffset generateSemicolon() {
 		StringBuffer buf = new StringBuffer();
@@ -140,11 +139,11 @@
 	}
 
 	/**
-	 *  
+	 * 
 	 */
 	protected StringAndOffset generateURI() {
 		StringBuffer buf = new StringBuffer();
-		
+
 		boolean isQuoteInURI = CSSCorePlugin.getDefault().getPluginPreferences().getBoolean(CSSCorePreferenceNames.FORMAT_QUOTE_IN_URI);
 		char quoteChar = getQuoteChar();
 		buf.append("url(");//$NON-NLS-1$
@@ -196,7 +195,7 @@
 	}
 
 	/**
-	 *  
+	 * 
 	 */
 	protected boolean isMatch(String text) {
 		String textToCompare = fContext.getTextToCompare();
@@ -211,7 +210,7 @@
 		 * (text.toUpperCase().indexOf(textToReplace.toUpperCase()) == 0); }
 		 */
 	}
-	
+
 
 	private String getIndentString() {
 		StringBuffer indent = new StringBuffer();
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForDeclarationName.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForDeclarationName.java
index 999d728..4cf8901 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForDeclarationName.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForDeclarationName.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -26,6 +26,8 @@
 import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
 import org.eclipse.wst.css.ui.internal.image.CSSImageType;
 
 class CSSProposalGeneratorForDeclarationName extends CSSProposalGenerator {
@@ -73,7 +75,7 @@
 		// Collections.sort(names);
 
 		boolean bAddColon = true;
-		if (targetNode instanceof ICSSStyleDeclItem && fContext.targetHas(CSSRegionContexts.CSS_DECLARATION_SEPARATOR)) {
+		if ((targetNode instanceof ICSSStyleRule || targetNode instanceof ICSSStyleDeclItem || targetNode instanceof ICSSStyleDeclaration) && fContext.targetHas(CSSRegionContexts.CSS_DECLARATION_SEPARATOR)) {
 			bAddColon = false;
 		}
 
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForHTMLTag.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForHTMLTag.java
index 6f28c14..6302cb1 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForHTMLTag.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForHTMLTag.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,6 +18,8 @@
 import java.util.List;
 import java.util.Vector;
 
+import org.eclipse.wst.css.core.internal.CSSCorePlugin;
+import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
 import org.eclipse.wst.css.ui.internal.image.CSSImageType;
@@ -56,8 +58,8 @@
 			return candidates.iterator();
 		}
 
+		boolean bLowerCase = CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_SELECTOR) == CSSCorePreferenceNames.LOWER;
 		// XHTML requires lower case
-		boolean bLowerCase = false;
 		if (fContext.getModel().getStyleSheetType() == ICSSModel.EMBEDDED) {
 			Node domNode = fContext.getModel().getOwnerDOMNode();
 			if (domNode != null && !(domNode instanceof Document)) {
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForPseudoSelector.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForPseudoSelector.java
index 27df837..e0af646 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForPseudoSelector.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForPseudoSelector.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -77,12 +77,11 @@
 
 			int cursorPos = 0;
 			StringBuffer buf = new StringBuffer();
-			if (hasLeadingColon) {
-				buf.append(text.substring(1));
-			} else {
+			
+			if (!hasLeadingColon)
 				buf.append(textToReplace);
-				buf.append(text);
-			}
+			
+			buf.append(text);
 			cursorPos += buf.length();
 
 			if (0 < buf.length()) {
@@ -137,20 +136,4 @@
 		}
 		return tagList;
 	}
-
-	/**
-	 *  
-	 */
-	protected boolean isMatch(String text) {
-		if (!super.isMatch(text)) {
-			ITextRegion region = fContext.getTargetRegion();
-			if (region != null && region.getType() == CSSRegionContexts.CSS_SELECTOR_PSEUDO) {
-				return true;
-			} else {
-				return false;
-			}
-		} else {
-			return true;
-		}
-	}
 }
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSStructuredContentAssistProcessor.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSStructuredContentAssistProcessor.java
new file mode 100644
index 0000000..0d37ed7
--- /dev/null
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSStructuredContentAssistProcessor.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.css.ui.internal.contentassist;
+
+
+
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor;
+
+/**
+ * <p>Implementation of {@link StructuredContentAssistProcessor} for CSS documents</p>
+ * 
+ * <p>Currently the CSS content assist processor does not do anything different then
+ * the {@link StructuredContentAssistProcessor} but at some point it may have to
+ * react to user preference changes</p>
+ * 
+ * @see StructuredContentAssistProcessor
+ */
+public class CSSStructuredContentAssistProcessor extends StructuredContentAssistProcessor {
+	/**
+	 * <p>Constructor</p>
+	 * 
+	 * @param assistant {@link ContentAssistant} to use
+	 * @param partitionTypeID the partition type this processor is for
+	 * @param viewer {@link ITextViewer} this processor is acting in
+	 */
+	public CSSStructuredContentAssistProcessor(ContentAssistant assistant,
+			String partitionTypeID, ITextViewer viewer) {
+		
+		super(assistant, partitionTypeID, viewer, null);
+	}
+}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSTemplatesCompletionProposalComputer.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSTemplatesCompletionProposalComputer.java
new file mode 100644
index 0000000..2b58dc6
--- /dev/null
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSTemplatesCompletionProposalComputer.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.css.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.wst.css.ui.internal.templates.TemplateContextTypeIdsCSS;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+
+/**
+ * <p>Completion computer for CSS templates</p>
+ */
+public class CSSTemplatesCompletionProposalComputer implements ICompletionProposalComputer {
+	/** <p>The template processor used to create the proposals</p> */
+	private CSSTemplateCompletionProcessor fTemplateProcessor = null;
+	
+	/**
+	 * <p>Create the computer</p>
+	 */
+	public CSSTemplatesCompletionProposalComputer() {
+		fTemplateProcessor = new CSSTemplateCompletionProcessor();
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeCompletionProposals(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		List proposals = new ArrayList();
+		
+		boolean isEmptyDocument =
+			ContentAssistUtils.isViewerEmpty(context.getViewer());
+		if (isEmptyDocument) {
+			proposals.addAll(getTemplates(TemplateContextTypeIdsCSS.NEW, context));
+		}
+		proposals.addAll(getTemplates(TemplateContextTypeIdsCSS.ALL, context));
+		
+		
+		return proposals;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#computeContextInformation(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeContextInformation(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#getErrorMessage()
+	 */
+	public String getErrorMessage() {
+		return null;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionStarted()
+	 */
+	public void sessionStarted() {
+		//default is to do nothing
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionEnded()
+	 */
+	public void sessionEnded() {
+		//default is to do nothing
+	}
+	
+
+	/**
+	 * <p>Gets template proposals for the given template and proposal contexts</p>
+	 * 
+	 * @param templateContext the template context
+	 * @param context the proposal context
+	 * @return {@link List} of template proposals for the given contexts
+	 */
+	private List getTemplates(String templateContext,
+			CompletionProposalInvocationContext context) {
+	
+		fTemplateProcessor.setContextType(templateContext);
+		ICompletionProposal[] proposals = fTemplateProcessor.computeCompletionProposals(
+				context.getViewer(), context.getInvocationOffset());
+		
+		return Arrays.asList(proposals);
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/CSSNodeAdapter.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/CSSNodeAdapter.java
index 1e44905..1898c59 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/CSSNodeAdapter.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/CSSNodeAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,11 +16,13 @@
 import java.util.List;
 import java.util.Vector;
 
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.viewers.StructuredViewer;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.views.properties.PropertySheetPage;
+import org.eclipse.wst.css.core.internal.document.CSSStructuredDocumentRegionContainer;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSMediaRule;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
@@ -45,6 +47,17 @@
  * Adapts the CSS DOM node to a JFace viewer.
  */
 class CSSNodeAdapter implements IJFaceNodeAdapter, INodeAdapter, Runnable {
+	/**
+	 * debug .option
+	 */
+	private static final boolean DEBUG = getDebugValue();
+
+	private static boolean getDebugValue() {
+		String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/outline"); //$NON-NLS-1$
+		boolean result = (value != null) && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+		return result;
+	}
+
 	class NotifyContext {
 		NotifyContext(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
 			this.notifier = notifier;
@@ -80,6 +93,7 @@
 	private Vector notifyQueue;
 	StyleViewUpdater lastUpdater;
 	protected int delayMSecs = 500;
+	RefreshStructureJob fRefreshJob = null;
 	final static Class ADAPTER_KEY = IJFaceNodeAdapter.class;
 
 	public CSSNodeAdapter(INodeAdapterFactory adapterFactory) {
@@ -87,6 +101,13 @@
 		this.adapterFactory = adapterFactory;
 	}
 
+	private synchronized RefreshStructureJob getRefreshJob() {
+		if (fRefreshJob == null) {
+			fRefreshJob = new RefreshStructureJob();
+		}
+		return fRefreshJob;
+	}
+
 	/**
 	 * Insert the method's description here.
 	 */
@@ -317,19 +338,34 @@
 	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
 		if (notifyQueue == null)
 			notifyQueue = new Vector();
-		notifyQueue.add(new NotifyContext(notifier, eventType, changedFeature, oldValue, newValue, pos));
+//		notifyQueue.add(new NotifyContext(notifier, eventType, changedFeature, oldValue, newValue, pos));
 		// TODO-future: there's probably a better way than relying on async
 		// exec
-		if (Thread.currentThread() == getDisplay().getThread())
-			getDisplay().timerExec(delayMSecs, this);
-		else
-			getDisplay().asyncExec(new Runnable() {
-				public void run() {
-					if (getDisplay() != null) {
-						getDisplay().timerExec(delayMSecs, this);
+		if (notifier instanceof ICSSNode) {
+			Collection listeners = ((JFaceNodeAdapterFactoryCSS) adapterFactory).getListeners();
+			Iterator iterator = listeners.iterator();
+
+			while (iterator.hasNext()) {
+				Object listener = iterator.next();
+				// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90637
+				// if (notifier instanceof Node && (listener instanceof
+				// StructuredViewer) && (eventType ==
+				// INodeNotifier.STRUCTURE_CHANGED || (eventType ==
+				// INodeNotifier.CHANGE && changedFeature == null))) {
+				if ((listener instanceof StructuredViewer) && ((eventType == INodeNotifier.STRUCTURE_CHANGED) || (eventType == INodeNotifier.CONTENT_CHANGED) || (eventType == INodeNotifier.CHANGE || (eventType == INodeNotifier.ADD) || (eventType == INodeNotifier.REMOVE)))) {
+					if (DEBUG) {
+						System.out.println("JFaceNodeAdapter notified on event type > " + eventType); //$NON-NLS-1$
+					}
+
+					// refresh on structural and "unknown" changes
+					StructuredViewer structuredViewer = (StructuredViewer) listener;
+					// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5230
+					if (structuredViewer.getControl() != null) {
+						getRefreshJob().refresh(structuredViewer, (ICSSNode) notifier);
 					}
 				}
-			});
+			}
+		}
 	}
 
 	Display getDisplay() {
@@ -547,8 +583,20 @@
 
 			if (object instanceof ICSSStyleDeclItem)
 				return false;
-			else
-				return ((ICSSNode) object).hasChildNodes();
+			else {
+				if(((ICSSNode) object).hasChildNodes()) {
+					ICSSNode child = ((ICSSNode) object).getFirstChild();
+					
+					while(child != null) {
+						if(child instanceof CSSStructuredDocumentRegionContainer) {
+							String childText = ((CSSStructuredDocumentRegionContainer) child).getCssText();
+							if(childText != null && childText.length() > 0)
+								return true;
+						}
+						child = child.getNextSibling();
+					}
+				}
+			}
 		}
 		return false;
 	}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/RefreshStructureJob.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/RefreshStructureJob.java
new file mode 100644
index 0000000..11114ce
--- /dev/null
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/RefreshStructureJob.java
@@ -0,0 +1,355 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.css.ui.internal.contentoutline;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
+
+public class RefreshStructureJob extends Job {
+	/** debug flag */
+	static final boolean DEBUG;
+	private static final long UPDATE_DELAY = 300;
+	static {
+		String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/refreshStructure"); //$NON-NLS-1$
+		DEBUG = (value != null) && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+	}
+	/** List of refresh requests (Nodes) */
+	private final List fRefreshes;
+	/** List of update requests (Nodes) */
+	private final List fUpdates;
+	/** List of update requests (Nodes) */
+	private final List fUpdateProperties;
+	/** the structured viewers */
+	Set fRefreshViewers = new HashSet(3);
+	Set fUpdateViewers = new HashSet(3);
+
+	public RefreshStructureJob() {
+		super(XMLUIMessages.refreshoutline_0);
+		setPriority(Job.LONG);
+		setSystem(true);
+		fRefreshes = new ArrayList(5);
+		fUpdates = new ArrayList(5);
+		fUpdateProperties = new ArrayList(5);
+	}
+
+	private synchronized void addUpdateRequest(ICSSNode newNodeRequest, String[] updateProperties) {
+		/*
+		 * If we get to here, either from existing request list being zero
+		 * length, or no exisitng requests "matched" new request, then add the
+		 * new request.
+		 */
+		fUpdates.add(newNodeRequest);
+		fUpdateProperties.add(updateProperties);
+	}
+
+	private synchronized void addUpdateViewer(StructuredViewer viewer) {
+		fUpdateViewers.add(viewer);
+	}
+
+	private synchronized void addRefreshRequest(ICSSNode newNodeRequest) {
+		/*
+		 * note: the caller must NOT pass in null node request (which, since
+		 * private method, we do not need to gaurd against here, as long as we
+		 * gaurd against it in calling method.
+		 */
+		int size = fRefreshes.size();
+		for (int i = 0; i < size; i++) {
+			ICSSNode existingNodeRequest = (ICSSNode) fRefreshes.get(i);
+			/*
+			 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=157427 If we
+			 * already have a request which equals the new request, discard
+			 * the new request
+			 */
+			if (existingNodeRequest.equals(newNodeRequest)) {
+				return;
+			}
+			/*
+			 * If we already have a request which contains the new request,
+			 * discard the new request
+			 */
+			if (contains(existingNodeRequest, newNodeRequest)) {
+				return;
+			}
+			/*
+			 * If new request contains any existing requests, replace it with
+			 * new request. ISSUE: technically, we should replace ALL
+			 * contained, existing requests (such as if many siblings already
+			 * que'd up when their common parent is then requested, but, I'm
+			 * not sure if that occurs much, in practice, or if there's an
+			 * algorithm to quickly find them all. Actually, I guess we could
+			 * just go through the _rest_ of the list (i+1 to size) and remove
+			 * any that are contained by new request ... in future :) .
+			 */
+			if (contains(newNodeRequest, existingNodeRequest)) {
+				fRefreshes.set(i, newNodeRequest);
+				return;
+			}
+		}
+		/*
+		 * If we get to here, either from existing request list being zero
+		 * length, or no exisitng requests "matched" new request, then add the
+		 * new request.
+		 */
+		fRefreshes.add(newNodeRequest);
+	}
+
+	private synchronized void addRefreshViewer(StructuredViewer viewer) {
+		fRefreshViewers.add(viewer);
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.runtime.jobs.Job#canceling()
+	 */
+	protected void canceling() {
+		fUpdates.clear();
+		fUpdateViewers.clear();
+		super.canceling();
+	}
+
+	/**
+	 * Simple hierarchical containment relationship. Note, this method returns
+	 * "false" if the two nodes are equal!
+	 * 
+	 * @param root
+	 * @param possible
+	 * @return if the root is parent of possible, return true, otherwise
+	 *         return false
+	 */
+	private boolean contains(ICSSNode root, ICSSNode possible) {
+		if (DEBUG) {
+			System.out.println("=============================================================================================================="); //$NON-NLS-1$
+			System.out.println("recursive call w/ root: " + root + " and possible: " + possible); //$NON-NLS-1$ //$NON-NLS-2$
+			System.out.println("--------------------------------------------------------------------------------------------------------------"); //$NON-NLS-1$
+		}
+
+		// the following checks are important
+		// #document node will break the algorithm otherwise
+
+		// can't contain the child if it's null
+		if (root == null) {
+			if (DEBUG) {
+				System.out.println("returning false: root is null"); //$NON-NLS-1$
+			}
+			return false;
+		}
+		// nothing can be parent of Document node
+		if (possible instanceof ICSSDocument) {
+			if (DEBUG) {
+				System.out.println("returning false: possible is Document node"); //$NON-NLS-1$
+			}
+			return false;
+		}
+		// document contains everything
+		if (root instanceof ICSSDocument) {
+			if (DEBUG) {
+				System.out.println("returning true: root is Document node"); //$NON-NLS-1$
+			}
+			return true;
+		}
+
+		// check parentage
+		ICSSNode current = possible;
+		// loop parents
+		while ((current != null) && (current.getNodeType() != ICSSNode.STYLESHEET_NODE || current.getNodeType() != ICSSNode.STYLEDECLARATION_NODE)) {
+			// found it
+			if (root.equals(current)) {
+				if (DEBUG) {
+					System.out.println("   !!! found: " + possible + " in subelement of: " + root); //$NON-NLS-1$ //$NON-NLS-2$
+				}
+				return true;
+			}
+			current = current.getParentNode();
+		}
+		// never found it
+		return false;
+	}
+
+	/**
+	 * Refresh must be on UI thread because it's on a SWT widget.
+	 * 
+	 * @param node
+	 */
+	private void doRefresh(final ICSSNode node, final StructuredViewer[] viewers) {
+		final Display display = PlatformUI.getWorkbench().getDisplay();
+		display.asyncExec(new Runnable() {
+			public void run() {
+				if (DEBUG) {
+					System.out.println("refresh on: [" + node + "]"); //$NON-NLS-1$ //$NON-NLS-2$
+				}
+
+				for (int i = 0; i < viewers.length; i++) {
+					if (!viewers[i].getControl().isDisposed()) {
+						if (node.getNodeType() == ICSSNode.STYLESHEET_NODE || node.getNodeType() == ICSSNode.STYLEDECLARATION_NODE) {
+							viewers[i].refresh(false);
+						}
+						else {
+							viewers[i].refresh(node, false);
+						}
+					}
+					else {
+						if (DEBUG) {
+							System.out.println("   !!! skipped refreshing disposed viewer: " + viewers[i]); //$NON-NLS-1$
+						}
+					}
+				}
+			}
+		});
+	}
+
+	/**
+	 * Update must be on UI thread because it's on a SWT widget.
+	 * 
+	 * @param node
+	 */
+	private void doUpdate(final StructuredViewer[] viewers, final ICSSNode node, final String[] properties) {
+		final Display display = PlatformUI.getWorkbench().getDisplay();
+		display.asyncExec(new Runnable() {
+			public void run() {
+				if (DEBUG) {
+					System.out.println("refresh on: [" + node + "]"); //$NON-NLS-1$ //$NON-NLS-2$
+				}
+
+				for (int i = 0; i < viewers.length; i++) {
+					if (!viewers[i].getControl().isDisposed()) {
+						viewers[i].update(node, properties);
+					}
+					else {
+						if (DEBUG) {
+							System.out.println("   !!! skipped refreshing disposed viewer: " + viewers[i]); //$NON-NLS-1$
+						}
+					}
+				}
+			}
+		});
+	}
+
+	/**
+	 * This method also synchronized because it accesses the fRefreshes queue
+	 * and fRefreshViewers list
+	 * 
+	 * @return an array containing and array of the currently requested Nodes
+	 *         to refresh and the viewers in which to refresh them
+	 */
+	private synchronized Object[] getRefreshRequests() {
+		ICSSNode[] toRefresh = (ICSSNode[]) fRefreshes.toArray(new ICSSNode[fRefreshes.size()]);
+		fRefreshes.clear();
+
+		StructuredViewer[] viewers = (StructuredViewer[]) fRefreshViewers.toArray(new StructuredViewer[fRefreshViewers.size()]);
+		fRefreshViewers.clear();
+
+		return new Object[]{toRefresh, viewers};
+	}
+
+	/**
+	 * This method also synchronized because it accesses the fUpdates queue
+	 * and fUpdateViewers list
+	 * 
+	 * @return an array containing and array of the currently requested Nodes
+	 *         to refresh and the viewers in which to refresh them
+	 */
+	private synchronized Object[] getUpdateRequests() {
+		ICSSNode[] toUpdate = (ICSSNode[]) fUpdates.toArray(new ICSSNode[fUpdates.size()]);
+		fUpdates.clear();
+
+		StructuredViewer[] viewers = (StructuredViewer[]) fUpdateViewers.toArray(new StructuredViewer[fUpdateViewers.size()]);
+		fUpdateViewers.clear();
+
+		String[][] properties = (String[][]) fUpdateProperties.toArray(new String[fUpdateProperties.size()][]);
+		fUpdateProperties.clear();
+
+		return new Object[]{toUpdate, viewers, properties};
+	}
+
+	/**
+	 * Invoke a refresh on the viewer on the given node.
+	 * 
+	 * @param node
+	 */
+	public void refresh(StructuredViewer viewer, ICSSNode node) {
+		if (node == null) {
+			return;
+		}
+
+		addRefreshViewer(viewer);
+		addRefreshRequest(node);
+		schedule(UPDATE_DELAY);
+	}
+
+	/**
+	 * Invoke a refresh on the viewer on the given node.
+	 * 
+	 * @param node
+	 */
+	public void update(StructuredViewer viewer, ICSSNode node, String[] properties) {
+		if (node == null) {
+			return;
+		}
+
+		addUpdateViewer(viewer);
+		addUpdateRequest(node, properties);
+		schedule(UPDATE_DELAY);
+	}
+
+	protected IStatus run(IProgressMonitor monitor) {
+		IStatus status = Status.OK_STATUS;
+		try {
+			performUpdates();
+			
+			performRefreshes(monitor);
+		}
+		finally {
+			monitor.done();
+		}
+		return status;
+	}
+
+	private void performRefreshes(IProgressMonitor monitor) {
+		// Retrieve BOTH viewers and Nodes on one block
+		Object[] requests = getRefreshRequests();
+		ICSSNode[] nodes = (ICSSNode[]) requests[0];
+		StructuredViewer[] viewers = (StructuredViewer[]) requests[1];
+
+		for (int i = 0; i < nodes.length; i++) {
+			if (monitor.isCanceled()) {
+				throw new OperationCanceledException();
+			}
+			doRefresh(nodes[i], viewers);
+		}
+	}
+
+	private void performUpdates() {
+		// Retrieve BOTH viewers and Nodes on one block
+		Object[] requests = getUpdateRequests();
+		ICSSNode[] nodes = (ICSSNode[]) requests[0];
+		StructuredViewer[] viewers = (StructuredViewer[]) requests[1];
+		String[][] properties = (String[][]) requests[2];
+
+		for (int i = 0; i < nodes.length; i++) {
+			doUpdate(viewers, nodes[i], properties[i]);
+		}
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupDialogCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupDialogCSS.java
index d3007a0..7c60678 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupDialogCSS.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupDialogCSS.java
@@ -12,6 +12,8 @@
 
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
@@ -24,7 +26,7 @@
 import org.eclipse.wst.css.ui.internal.CSSUIMessages;
 import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
 
-public class CleanupDialogCSS extends Dialog {
+public class CleanupDialogCSS extends Dialog implements SelectionListener{
 
 	private boolean embeddedCSS;
 	protected Button fRadioButtonIdentCaseAsis;
@@ -85,10 +87,13 @@
 		identCase.setLayout(hLayout);
 		fRadioButtonIdentCaseAsis = new Button(identCase, SWT.RADIO);
 		fRadioButtonIdentCaseAsis.setText(CSSUIMessages.As_is_UI_);
+		fRadioButtonIdentCaseAsis.addSelectionListener(this);
 		fRadioButtonIdentCaseLower = new Button(identCase, SWT.RADIO);
 		fRadioButtonIdentCaseLower.setText(CSSUIMessages.Lower_UI_);
+		fRadioButtonIdentCaseLower.addSelectionListener(this);
 		fRadioButtonIdentCaseUpper = new Button(identCase, SWT.RADIO);
 		fRadioButtonIdentCaseUpper.setText(CSSUIMessages.Upper_UI_);
+		fRadioButtonIdentCaseUpper.addSelectionListener(this);
 
 		// Convert property name case
 		// ACC: Group radio buttons together so associated label is read
@@ -103,10 +108,13 @@
 		propNameCase.setLayout(hLayout);
 		fRadioButtonPropNameCaseAsis = new Button(propNameCase, SWT.RADIO);
 		fRadioButtonPropNameCaseAsis.setText(CSSUIMessages.As_is_UI_);
+		fRadioButtonPropNameCaseAsis.addSelectionListener(this);
 		fRadioButtonPropNameCaseLower = new Button(propNameCase, SWT.RADIO);
 		fRadioButtonPropNameCaseLower.setText(CSSUIMessages.Lower_UI_);
+		fRadioButtonPropNameCaseLower.addSelectionListener(this);
 		fRadioButtonPropNameCaseUpper = new Button(propNameCase, SWT.RADIO);
 		fRadioButtonPropNameCaseUpper.setText(CSSUIMessages.Upper_UI_);
+		fRadioButtonPropNameCaseUpper.addSelectionListener(this);
 
 		// Convert property Value case
 		// ACC: Group radio buttons together so associated label is read
@@ -121,10 +129,13 @@
 		propValueCase.setLayout(hLayout);
 		fRadioButtonPropValueCaseAsis = new Button(propValueCase, SWT.RADIO);
 		fRadioButtonPropValueCaseAsis.setText(CSSUIMessages.As_is_UI_);
+		fRadioButtonPropValueCaseAsis.addSelectionListener(this);
 		fRadioButtonPropValueCaseLower = new Button(propValueCase, SWT.RADIO);
 		fRadioButtonPropValueCaseLower.setText(CSSUIMessages.Lower_UI_);
+		fRadioButtonPropValueCaseLower.addSelectionListener(this);
 		fRadioButtonPropValueCaseUpper = new Button(propValueCase, SWT.RADIO);
 		fRadioButtonPropValueCaseUpper.setText(CSSUIMessages.Upper_UI_);
+		fRadioButtonPropValueCaseUpper.addSelectionListener(this);
 
 		if (!isEmbeddedCSS()) {
 			// Convert selector tag case
@@ -140,20 +151,25 @@
 			selectorTagCase.setLayout(hLayout);
 			fRadioButtonSelectorTagCaseAsis = new Button(selectorTagCase, SWT.RADIO);
 			fRadioButtonSelectorTagCaseAsis.setText(CSSUIMessages.As_is_UI_);
+			fRadioButtonSelectorTagCaseAsis.addSelectionListener(this);
 			fRadioButtonSelectorTagCaseLower = new Button(selectorTagCase, SWT.RADIO);
 			fRadioButtonSelectorTagCaseLower.setText(CSSUIMessages.Lower_UI_);
+			fRadioButtonSelectorTagCaseLower.addSelectionListener(this);
 			fRadioButtonSelectorTagCaseUpper = new Button(selectorTagCase, SWT.RADIO);
 			fRadioButtonSelectorTagCaseUpper.setText(CSSUIMessages.Upper_UI_);
+			fRadioButtonSelectorTagCaseUpper.addSelectionListener(this);
 		}
 
 		// Quote attribute values
 		fCheckBoxQuoteValues = new Button(panel, SWT.CHECK);
 		fCheckBoxQuoteValues.setText(CSSUIMessages.Quote_values_UI_);
+		fCheckBoxQuoteValues.addSelectionListener(this);
 
 		if (!isEmbeddedCSS()) {
 			// Format source
 			fCheckBoxFormatSource = new Button(panel, SWT.CHECK);
 			fCheckBoxFormatSource.setText(CSSUIMessages.Format_source_UI_);
+			fCheckBoxFormatSource.addSelectionListener(this);
 		}
 
 		setCleanupOptions();
@@ -289,4 +305,21 @@
 		// save these values to preferences
 		((CSSCleanupStrategyImpl) stgy).saveOptions();
 	}
+
+	public void widgetSelected(SelectionEvent e) {
+		boolean okEnabled = fCheckBoxFormatSource.getSelection()
+		|| fCheckBoxQuoteValues.getSelection()
+		|| ((fRadioButtonIdentCaseLower != null && fRadioButtonIdentCaseLower.getSelection()) || (fRadioButtonIdentCaseUpper != null && fRadioButtonIdentCaseUpper.getSelection()))
+		|| ((fRadioButtonPropNameCaseLower != null && fRadioButtonPropNameCaseLower.getSelection()) || (fRadioButtonPropNameCaseUpper != null && fRadioButtonPropNameCaseUpper.getSelection()))
+		|| ((fRadioButtonPropValueCaseLower != null && fRadioButtonPropValueCaseLower.getSelection()) || (fRadioButtonPropValueCaseUpper != null && fRadioButtonPropValueCaseUpper.getSelection()))
+		|| ((fRadioButtonSelectorTagCaseLower != null && fRadioButtonSelectorTagCaseLower.getSelection()) || (fRadioButtonSelectorTagCaseUpper != null && fRadioButtonSelectorTagCaseUpper.getSelection()))
+		;
+		getButton(OK).setEnabled(okEnabled);
+		
+	}
+
+	public void widgetDefaultSelected(SelectionEvent e) {
+		widgetSelected(e);
+		
+	}
 }
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/CSSSelectionConverterFactory.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/CSSSelectionConverterFactory.java
new file mode 100644
index 0000000..02de091
--- /dev/null
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/CSSSelectionConverterFactory.java
@@ -0,0 +1,153 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.css.ui.internal.editor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.wst.css.core.internal.document.CSSNodeImpl;
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
+import org.eclipse.wst.css.ui.internal.Logger;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.ui.internal.editor.SelectionConvertor;
+
+/**
+ * <p>Factory to adapt from {@link ICSSModel} to {@link SelectionConvertor}</p>
+ */
+public class CSSSelectionConverterFactory implements IAdapterFactory {
+
+	/** the list of classes this factory can adapt to */
+	private static final Class[] ADAPTER_LIST = new Class[]{SelectionConvertor.class};
+	
+	/** the adapted class */
+	private static final Object selectionConvertor = new CSSSelectionConverter();
+	
+	/**
+	 * <p>Default constructor</p>
+	 */
+	public CSSSelectionConverterFactory() {
+	}
+	
+	/**
+	 * <p>Adapts {@link ICSSModel} to {@link SelectionConvertor}</p>
+	 * 
+	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
+	 */
+	public Object getAdapter(Object adaptableObject, Class adapterType) {
+		Object adapter = null;
+		if (adaptableObject instanceof ICSSModel && SelectionConvertor.class.equals(adapterType)) {
+			adapter = selectionConvertor;
+		}
+		return adapter;
+	}
+
+	/**
+	 * <p>Adapts to {@link SelectionConvertor}</p>
+	 * 
+	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
+	 */
+	public Class[] getAdapterList() {
+		return ADAPTER_LIST;
+	}
+	
+	/**
+	 * <p>{@link SelectionConvertor} specific to CSS</p>
+	 */
+	private static class CSSSelectionConverter extends SelectionConvertor {
+		/**
+		 * <p>Default constructor</p>
+		 */
+		public CSSSelectionConverter() {
+		}
+		
+		/**
+		 * @see org.eclipse.wst.sse.ui.internal.editor.SelectionConvertor#getElements(org.eclipse.wst.sse.core.internal.provisional.IStructuredModel, int, int)
+		 */
+		public Object[] getElements(IStructuredModel model, int start, int end) {
+			Object[] localSelectedStructures = null;
+			if (model != null) {
+				IndexedRegion region = model.getIndexedRegion(start);
+				
+				/* in CSS docs whitespace is owned by the style sheet
+				 * this is to find the first none whitespace region
+				 */
+				if(region instanceof ICSSStyleSheet) {
+					try {
+						String selection = model.getStructuredDocument().get(start, end);
+						int whitespaceLength = beginingWhitespaceLength(selection);
+						region = model.getIndexedRegion(start+whitespaceLength+1);
+					} catch(BadLocationException e) {
+						//should never be able to happen
+						Logger.logException("Bad location on selection, this should never happen", e);
+					}
+				}
+
+				if (region != null) {
+					// if single selection spans selected region
+					// else multiple selection
+					if (end <= region.getEndOffset()) {
+						// single selection
+						localSelectedStructures = new Object[1];
+						localSelectedStructures[0] = region;
+					}
+					else {
+						int maxLength = model.getStructuredDocument().getLength();
+						List structures = new ArrayList(2);
+						while (region != null && region.getEndOffset() <= end && region.getEndOffset() <= maxLength) {
+							structures.add(region);
+							
+							//use the CSS model to find the next sibling
+							boolean foundNextSibling = false;
+							if(region instanceof CSSNodeImpl ) {
+								ICSSNode node = ((ICSSNode)region).getNextSibling();
+								if(node instanceof IndexedRegion) {
+									region = (IndexedRegion)node;
+									foundNextSibling = true;
+								}
+							}
+							
+							if(!foundNextSibling) {
+								region = model.getIndexedRegion(region.getEndOffset() + 1);
+							}
+						}
+						localSelectedStructures = structures.toArray();
+					}
+				}
+			}
+			if (localSelectedStructures == null) {
+				localSelectedStructures = new Object[0];
+			}
+			return localSelectedStructures;
+		}
+
+	}
+	
+	/**
+	 * @param s find the length of the whitespace preceding this {@link String}
+	 * @return the length of the whitespace preceding the given {@link String}
+	 */
+	private static int beginingWhitespaceLength(String s) {
+		int length = 0;
+		
+		for (int i = 0; i < s.length() && length == 0; ++i) {
+			if (!Character.isWhitespace(s.charAt(i))) {
+				length = i;
+			}
+		}
+		
+		return length;
+	}
+}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/AbstractCommentHandler.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/AbstractCommentHandler.java
new file mode 100644
index 0000000..f0122fb
--- /dev/null
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/AbstractCommentHandler.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.css.ui.internal.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.css.ui.internal.Logger;
+
+public class AbstractCommentHandler extends AbstractHandler {
+
+	static final String OPEN_COMMENT = "/*"; //$NON-NLS-1$
+	static final String CLOSE_COMMENT = "*/"; //$NON-NLS-1$
+
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		ITextEditor textEditor = getTextEditor(event);
+		if (textEditor != null) {
+			IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
+			if (document != null) {
+				// get current text selection
+				ITextSelection textSelection = getCurrentSelection(textEditor);
+				if (textSelection.isEmpty()) {
+					return null;
+				}
+
+				processAction(textEditor, document, textSelection);
+			}
+		}
+
+		return null;
+	}
+
+	protected void processAction(ITextEditor editor, IDocument document, ITextSelection textSelection) {
+	}
+
+	protected ITextEditor getTextEditor(ExecutionEvent event) {
+		IEditorPart editor = HandlerUtil.getActiveEditor(event);
+		ITextEditor textEditor = null;
+		if (editor instanceof ITextEditor)
+			textEditor = (ITextEditor) editor;
+		else {
+			Object o = editor.getAdapter(ITextEditor.class);
+			if (o != null)
+				textEditor = (ITextEditor) o;
+		}
+		return textEditor;
+	}
+
+	protected ITextSelection getCurrentSelection(ITextEditor textEditor) {
+		ISelectionProvider provider = textEditor.getSelectionProvider();
+		if (provider != null) {
+			ISelection selection = provider.getSelection();
+			if (selection instanceof ITextSelection) {
+				return (ITextSelection) selection;
+			}
+		}
+		return TextSelection.emptySelection();
+	}
+
+	protected void removeOpenCloseComments(IDocument document, int offset, int length) {
+		try {
+			int adjusted_length = length;
+
+			// remove open comments
+			String string = document.get(offset, length);
+			int index = string.lastIndexOf(OPEN_COMMENT);
+			while (index != -1) {
+				document.replace(offset + index, OPEN_COMMENT.length(), ""); //$NON-NLS-1$
+				index = string.lastIndexOf(OPEN_COMMENT, index - 1);
+				adjusted_length -= OPEN_COMMENT.length();
+			}
+
+			// remove close comments
+			string = document.get(offset, adjusted_length);
+			index = string.lastIndexOf(CLOSE_COMMENT);
+			while (index != -1) {
+				document.replace(offset + index, CLOSE_COMMENT.length(), ""); //$NON-NLS-1$
+				index = string.lastIndexOf(CLOSE_COMMENT, index - 1);
+			}
+		}
+		catch (BadLocationException e) {
+			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/AddBlockCommentHandler.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/AddBlockCommentHandler.java
new file mode 100644
index 0000000..232b0dc
--- /dev/null
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/AddBlockCommentHandler.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.css.ui.internal.handlers;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
+import org.eclipse.wst.css.ui.internal.Logger;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.css.ui.internal.CSSUIMessages;
+
+public class AddBlockCommentHandler extends AbstractCommentHandler {
+
+	protected void processAction(ITextEditor textEditor, IDocument document, ITextSelection textSelection) {
+		IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
+		if (model != null && document instanceof IStructuredDocument) {
+			try {
+				IStructuredDocument doc = (IStructuredDocument) document;
+				IStructuredDocumentRegion startRegion = doc.getRegionAtCharacterOffset(textSelection.getOffset());
+				IStructuredDocumentRegion endRegion = doc.getRegionAtCharacterOffset(textSelection.getOffset() + textSelection.getLength());
+
+				if (startRegion == null) {
+					return;
+				}
+				if ((endRegion == null) && (textSelection.getLength() > 0)) {
+					endRegion = doc.getRegionAtCharacterOffset(textSelection.getOffset() + textSelection.getLength() - 1);
+				}
+				if (endRegion == null) {
+					return;
+				}
+
+				int openCommentOffset = startRegion.getStartOffset();
+				int closeCommentOffset = endRegion.getEndOffset() + CLOSE_COMMENT.length();
+
+				if ((textSelection.getLength() == 0) && (startRegion.getType() == CSSRegionContexts.CSS_COMMENT)) {
+					return;
+				}
+
+				model.beginRecording(this, CSSUIMessages.AddBlockComment_tooltip);
+				model.aboutToChangeModel();
+
+				try {
+					document.replace(openCommentOffset, 0, OPEN_COMMENT);
+					document.replace(closeCommentOffset, 0, CLOSE_COMMENT);
+					super.removeOpenCloseComments(document, openCommentOffset + OPEN_COMMENT.length(), closeCommentOffset - openCommentOffset - CLOSE_COMMENT.length());
+				}
+				catch (BadLocationException e) {
+					Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+				}
+				finally {
+					model.changedModel();
+					model.endRecording(this);
+				}
+			}
+			finally {
+				model.releaseFromEdit();
+			}
+		}
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/RemoveBlockCommentHandler.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/RemoveBlockCommentHandler.java
new file mode 100644
index 0000000..6d07909
--- /dev/null
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/RemoveBlockCommentHandler.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.css.ui.internal.handlers;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
+import org.eclipse.wst.css.ui.internal.Logger;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.css.ui.internal.CSSUIMessages;
+
+public class RemoveBlockCommentHandler extends AbstractCommentHandler {
+
+	protected void processAction(ITextEditor textEditor, IDocument document, ITextSelection textSelection) {
+		IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
+		if (model != null && document instanceof IStructuredDocument) {
+			try {
+				IStructuredDocument doc = (IStructuredDocument) document;
+				IStructuredDocumentRegion startRegion = doc.getRegionAtCharacterOffset(textSelection.getOffset());
+				IStructuredDocumentRegion endRegion = doc.getRegionAtCharacterOffset(textSelection.getOffset() + textSelection.getLength());
+
+				if ((startRegion == null) || (endRegion == null)) {
+					return;
+				}
+
+				int openCommentOffset = startRegion.getStartOffset();
+				int closeCommentOffset = endRegion.getEndOffset() - OPEN_COMMENT.length() - CLOSE_COMMENT.length();
+
+				model.beginRecording(this, CSSUIMessages.RemoveBlockComment_tooltip);
+				model.aboutToChangeModel();
+
+				try {
+					if (textSelection.getLength() == 0) {
+						if (startRegion.getType() == CSSRegionContexts.CSS_COMMENT) {
+							document.replace(openCommentOffset, OPEN_COMMENT.length(), ""); //$NON-NLS-1$
+							document.replace(closeCommentOffset, CLOSE_COMMENT.length(), ""); //$NON-NLS-1$
+						}
+					}
+					else {
+						if (startRegion.getType() == CSSRegionContexts.CSS_COMMENT) {
+							document.replace(openCommentOffset, OPEN_COMMENT.length(), ""); //$NON-NLS-1$
+						}
+
+						if (endRegion.getType() == CSSRegionContexts.CSS_COMMENT) {
+							document.replace(closeCommentOffset, CLOSE_COMMENT.length(), ""); //$NON-NLS-1$
+						}
+					}
+					removeOpenCloseComments(document, openCommentOffset + OPEN_COMMENT.length(), closeCommentOffset - openCommentOffset - CLOSE_COMMENT.length());
+				}
+				catch (BadLocationException e) {
+					Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+				}
+				finally {
+					model.changedModel();
+					model.endRecording(this);
+				}
+			}
+			finally {
+				model.releaseFromEdit();
+			}
+		}
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectEnclosingHandler.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectEnclosingHandler.java
index ac19982..efd4711 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectEnclosingHandler.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectEnclosingHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
 import org.eclipse.wst.sse.ui.internal.handlers.AbstractStructuredSelectHandler;
+import org.w3c.dom.css.CSSStyleDeclaration;
 
 public class StructuredSelectEnclosingHandler extends AbstractStructuredSelectHandler {
 	
@@ -36,6 +37,9 @@
 			int currentEndOffset = currentOffset + textSelection.getLength();
 			if (cursorNodeRegion.getOffset() >= currentOffset && cursorNodeRegion.getOffset() <= currentEndOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= currentOffset && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= currentEndOffset) {
 				ICSSNode newNode = cursorNode.getParentNode();
+				if(newNode instanceof CSSStyleDeclaration) {
+					newNode = newNode.getParentNode();
+				}
 
 				if (newNode instanceof IndexedRegion) {
 					IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/ToggleCommentHandler.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/ToggleCommentHandler.java
new file mode 100644
index 0000000..ca7dd92
--- /dev/null
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/ToggleCommentHandler.java
@@ -0,0 +1,159 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.css.ui.internal.handlers;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.css.ui.internal.Logger;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.css.ui.internal.CSSUIMessages;
+
+public class ToggleCommentHandler extends AbstractCommentHandler {
+
+	protected void processAction(ITextEditor textEditor, IDocument document, ITextSelection textSelection) {
+		// get text selection lines info
+		int selectionStartLine = textSelection.getStartLine();
+		int selectionEndLine = textSelection.getEndLine();
+		try {
+			int selectionEndLineOffset = document.getLineOffset(selectionEndLine);
+			int selectionEndOffset = textSelection.getOffset() + textSelection.getLength();
+
+			// adjust selection end line
+			if ((selectionEndLine > selectionStartLine) && (selectionEndLineOffset == selectionEndOffset)) {
+				selectionEndLine--;
+			}
+
+		}
+		catch (BadLocationException e) {
+			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+		}
+
+		// save the selection position since it will be changing
+		Position selectionPosition = null;
+		boolean updateStartOffset = false;
+		try {
+			selectionPosition = new Position(textSelection.getOffset(), textSelection.getLength());
+			document.addPosition(selectionPosition);
+
+			// extra check if commenting from beginning of line
+			int selectionStartLineOffset = document.getLineOffset(selectionStartLine);
+			if ((textSelection.getLength() > 0) && (selectionStartLineOffset == textSelection.getOffset()) && !isCommentLine(document, selectionStartLine)) {
+				updateStartOffset = true;
+			}
+		}
+		catch (BadLocationException e) {
+			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+		}
+
+		processAction(document, selectionStartLine, selectionEndLine);
+
+		updateCurrentSelection(textEditor, selectionPosition, document, updateStartOffset);
+	}
+
+	private void processAction(IDocument document, int selectionStartLine, int selectionEndLine) {
+		IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
+		if (model != null) {
+			try {
+				model.beginRecording(this, CSSUIMessages.ToggleComment_tooltip);
+				model.aboutToChangeModel();
+
+				for (int i = selectionStartLine; i <= selectionEndLine; i++) {
+					try {
+						if (document.getLineLength(i) > 0) {
+							if (isCommentLine(document, i)) {
+								int lineOffset = document.getLineOffset(i);
+								IRegion region = document.getLineInformation(i);
+								String string = document.get(region.getOffset(), region.getLength());
+								int openCommentOffset = lineOffset + string.indexOf(OPEN_COMMENT);
+								int closeCommentOffset = lineOffset + string.indexOf(CLOSE_COMMENT) - OPEN_COMMENT.length();
+								uncomment(document, openCommentOffset, closeCommentOffset);
+							}
+							else {
+								int openCommentOffset = document.getLineOffset(i);
+								int lineDelimiterLength = document.getLineDelimiter(i) == null ? 0 : document.getLineDelimiter(i).length();
+								int closeCommentOffset = openCommentOffset + document.getLineLength(i) - lineDelimiterLength + OPEN_COMMENT.length();
+								comment(document, openCommentOffset, closeCommentOffset);
+							}
+						}
+					}
+					catch (BadLocationException e) {
+						Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+					}
+				}
+			}
+			finally {
+				model.changedModel();
+				model.endRecording(this);
+				model.releaseFromEdit();
+			}
+		}
+	}
+
+	private void updateCurrentSelection(ITextEditor textEditor, Position selectionPosition, IDocument document, boolean updateStartOffset) {
+		// update the selection if text selection changed
+		if (selectionPosition != null) {
+			ITextSelection selection = null;
+			if (updateStartOffset) {
+				selection = new TextSelection(document, selectionPosition.getOffset() - OPEN_COMMENT.length(), selectionPosition.getLength() + OPEN_COMMENT.length());
+			}
+			else {
+				selection = new TextSelection(document, selectionPosition.getOffset(), selectionPosition.getLength());
+			}
+			ISelectionProvider provider = textEditor.getSelectionProvider();
+			if (provider != null) {
+				provider.setSelection(selection);
+			}
+			document.removePosition(selectionPosition);
+		}
+	}
+
+	private boolean isCommentLine(IDocument document, int line) {
+		boolean isComment = false;
+
+		try {
+			IRegion region = document.getLineInformation(line);
+			String string = document.get(region.getOffset(), region.getLength()).trim();
+			isComment = (string.length() >= OPEN_COMMENT.length() + CLOSE_COMMENT.length()) && string.startsWith(OPEN_COMMENT) && string.endsWith(CLOSE_COMMENT);
+		}
+		catch (BadLocationException e) {
+			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+		}
+		return isComment;
+	}
+
+	private void comment(IDocument document, int openCommentOffset, int closeCommentOffset) {
+		try {
+			document.replace(openCommentOffset, 0, OPEN_COMMENT);
+			document.replace(closeCommentOffset, 0, CLOSE_COMMENT);
+			removeOpenCloseComments(document, openCommentOffset + OPEN_COMMENT.length(), closeCommentOffset - openCommentOffset - CLOSE_COMMENT.length());
+		}
+		catch (BadLocationException e) {
+			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+		}
+	}
+
+	private void uncomment(IDocument document, int openCommentOffset, int closeCommentOffset) {
+		try {
+			document.replace(openCommentOffset, OPEN_COMMENT.length(), ""); //$NON-NLS-1$
+			document.replace(closeCommentOffset, CLOSE_COMMENT.length(), ""); //$NON-NLS-1$
+		}
+		catch (BadLocationException e) {
+			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSCompletionProposalCategoriesConfiguration.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSCompletionProposalCategoriesConfiguration.java
new file mode 100644
index 0000000..3691c7a
--- /dev/null
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSCompletionProposalCategoriesConfiguration.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.css.ui.internal.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
+import org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration;
+
+/**
+ * <p>The readable and writable completion proposal categories configuration
+ * for the CSS content type</p>
+ */
+public class CSSCompletionProposalCategoriesConfiguration extends
+		AbstractCompletionProposalCategoriesConfiguration {
+
+	/** the ID of the preference page where users can change the preferences */
+	private static final String PREFERENCES_PAGE_ID = "org.eclipse.wst.css.ui.preferences.contentassist"; //$NON-NLS-1$
+	
+	/**
+	 * <p>Creates the configuration</p>
+	 */
+	public CSSCompletionProposalCategoriesConfiguration() {
+		//nothing to do.
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getPreferenceStore()
+	 */
+	protected IPreferenceStore getPreferenceStore() {
+		return CSSUIPlugin.getDefault().getPreferenceStore();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#hasAssociatedPropertiesPage()
+	 */
+	public boolean hasAssociatedPropertiesPage() {
+		return true;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#getPropertiesPageID()
+	 */
+	public String getPropertiesPageID() {
+		return PREFERENCES_PAGE_ID;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnDefaultPagePrefKey()
+	 */
+	protected String getShouldNotDisplayOnDefaultPagePrefKey() {
+		return CSSUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnOwnPagePrefKey()
+	 */
+	protected String getShouldNotDisplayOnOwnPagePrefKey() {
+		return CSSUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getPageSortOrderPrefKey()
+	 */
+	protected String getPageSortOrderPrefKey() {
+		return CSSUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getDefaultPageSortOrderPrefKey()
+	 */
+	protected String getDefaultPageSortOrderPrefKey() {
+		return CSSUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER;
+	}
+}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceInitializer.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceInitializer.java
index 44d0e02..b5ab212 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceInitializer.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceInitializer.java
@@ -2,7 +2,8 @@
 
 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
 import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.resource.ColorRegistry;
+import org.eclipse.ui.PlatformUI;
 import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
 import org.eclipse.wst.css.ui.internal.style.IStyleConstantsCSS;
 import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
@@ -17,28 +18,55 @@
 	 */
 	public void initializeDefaultPreferences() {
 		IPreferenceStore store = CSSUIPlugin.getDefault().getPreferenceStore();
+		ColorRegistry registry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
+		
 		// CSS Style Preferences
 		String NOBACKGROUNDBOLD = " | null | false"; //$NON-NLS-1$
 		String JUSTITALIC = " | null | false | true"; //$NON-NLS-1$
+		String JUSTBOLD = " | null | true";
 		String styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
 		store.setDefault(IStyleConstantsCSS.NORMAL, styleValue);
 
-		styleValue = ColorHelper.getColorString(63, 127, 127) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.ATMARK_RULE, 63, 127, 127) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsCSS.ATMARK_RULE, styleValue);
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.SELECTOR, 63, 127, 127) + JUSTBOLD;
 		store.setDefault(IStyleConstantsCSS.SELECTOR, styleValue);
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.UNIVERSAL, 63, 127, 127) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsCSS.UNIVERSAL, styleValue);
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.COMBINATOR, 63, 127, 127) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsCSS.COMBINATOR, styleValue);
 
-		styleValue = ColorHelper.getColorString(42, 0, 225) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.SELECTOR_CLASS, 63, 127, 127) + JUSTITALIC;
+		store.setDefault(IStyleConstantsCSS.SELECTOR_CLASS, styleValue);
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.ID, 63, 127, 127) + JUSTITALIC;
+		store.setDefault(IStyleConstantsCSS.ID, styleValue);
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.PSEUDO, 63, 127, 127) + JUSTITALIC;
+		store.setDefault(IStyleConstantsCSS.PSEUDO, styleValue);
+
+		/* Attribute selector */
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.ATTRIBUTE_DELIM, 63, 127, 127) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsCSS.ATTRIBUTE_DELIM, styleValue);
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.ATTRIBUTE_NAME, 63, 127, 127) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsCSS.ATTRIBUTE_NAME, styleValue);
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.ATTRIBUTE_OPERATOR, 63, 127, 127) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsCSS.ATTRIBUTE_OPERATOR, styleValue);
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.ATTRIBUTE_VALUE, 63, 127, 127) + NOBACKGROUNDBOLD;
+		store.setDefault(IStyleConstantsCSS.ATTRIBUTE_VALUE, styleValue);
+
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.MEDIA, 42, 0, 225) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsCSS.MEDIA, styleValue);
 
-		styleValue = ColorHelper.getColorString(63, 95, 191) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.COMMENT, 63, 95, 191) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsCSS.COMMENT, styleValue);
 
-		styleValue = ColorHelper.getColorString(127, 0, 127) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.PROPERTY_NAME, 127, 0, 127) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsCSS.PROPERTY_NAME, styleValue);
 
-		styleValue = ColorHelper.getColorString(42, 0, 225) + JUSTITALIC;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.PROPERTY_VALUE, 42, 0, 225) + JUSTITALIC;
 		store.setDefault(IStyleConstantsCSS.PROPERTY_VALUE, styleValue);
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.URI, 42, 0, 225) + JUSTITALIC;
 		store.setDefault(IStyleConstantsCSS.URI, styleValue);
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.STRING, 42, 0, 225) + JUSTITALIC;
 		store.setDefault(IStyleConstantsCSS.STRING, styleValue);
 
 		styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
@@ -46,19 +74,25 @@
 		store.setDefault(IStyleConstantsCSS.SEMI_COLON, styleValue);
 		store.setDefault(IStyleConstantsCSS.CURLY_BRACE, styleValue);
 
-		styleValue = ColorHelper.getColorString(191, 63, 63) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsCSS.ERROR, 191, 63, 63) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsCSS.ERROR, styleValue);
 		
 		// set default new css file template to use in new file wizard
 		/*
 		 * Need to find template name that goes with default template id (name
-		 * may change for differnt language)
+		 * may change for different language)
 		 */
-		String templateName = ""; //$NON-NLS-1$
-		Template template = CSSUIPlugin.getDefault().getTemplateStore().findTemplateById("org.eclipse.wst.css.ui.internal.templates.newcss"); //$NON-NLS-1$
-		if (template != null)
-			templateName = template.getName();
-		store.setDefault(CSSUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
+		store.setDefault(CSSUIPreferenceNames.NEW_FILE_TEMPLATE_ID, "org.eclipse.wst.css.ui.internal.templates.newcss"); //$NON-NLS-1$
+		
+		// Defaults for Content Assist preference page
+		store.setDefault(CSSUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE, "");
+		store.setDefault(CSSUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE, "");
+		store.setDefault(CSSUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER,
+				"org.eclipse.wst.css.ui.proposalCategory.css\0" +
+				"org.eclipse.wst.css.ui.proposalCategory.cssTemplates");
+		store.setDefault(CSSUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER,
+				"org.eclipse.wst.css.ui.proposalCategory.cssTemplates\0"+ 
+				"org.eclipse.wst.css.ui.proposalCategory.css");
 	}
 
 }
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceNames.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceNames.java
index 48ab781..1dc5129 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceNames.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceNames.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -34,4 +34,46 @@
 	 * </p>
 	 */
 	public static final String NEW_FILE_TEMPLATE_NAME = "newFileTemplateName"; //$NON-NLS-1$
+
+	/**
+	 * The initial template ID to be used in the new CSS file wizard. In the absence
+	 * of {@link NEW_FILE_TEMPLATE_NAME}, this ID is used to find a template name
+	 */
+	public static final String NEW_FILE_TEMPLATE_ID = "newFileTemplateId"; //$NON-NLS-1$
+
+	/**
+	 * <p>preference key used for saving which categories should not display on the default page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>), ordered is ignored</p>
+	 */
+	public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE = "css_content_assist_display_on_default_page"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key used for saving which categories should not display on their own page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>), order is ignored</p>
+	 */
+	public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE = "css_content_assist_display_on_own_page"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key for saving the sort order of the categories when displaying them on their own page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>) in the desired sort order.</p>
+	 */
+	public static final String CONTENT_ASSIST_OWN_PAGE_SORT_ORDER= "css_content_assist_own_page_sort_order"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key for saving the sort order of the categories when displaying them on the default page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>) in the desired sort order.</p>
+	 */
+	public static final String CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER= "css_content_assist_default_page_sort_order"; //$NON-NLS-1$
 }
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSContentAssistPreferencePage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSContentAssistPreferencePage.java
new file mode 100644
index 0000000..0bf18af
--- /dev/null
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSContentAssistPreferencePage.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.css.ui.internal.preferences.ui;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.wst.css.ui.internal.CSSUIPlugin;
+import org.eclipse.wst.sse.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposoalCatigoriesConfigurationRegistry;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
+import org.eclipse.wst.sse.ui.preferences.CodeAssistCyclingConfigurationBlock;
+import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter;
+
+/**
+ * <p>Defines the preference page for allowing the user to change the content
+ * assist preferences</p>
+ */
+public class CSSContentAssistPreferencePage extends AbstractPreferencePage implements
+		IWorkbenchPreferencePage {
+
+	private static final String CSS_CONTENT_TYPE_ID = "org.eclipse.wst.css.core.csssource"; //$NON-NLS-1$
+	
+	/** configuration block for changing preference having to do with the content assist categories */
+	private CodeAssistCyclingConfigurationBlock fConfigurationBlock;
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+	 */
+	protected Control createContents(Composite parent) {
+		final Composite composite = super.createComposite(parent, 1);
+		
+		createContentsForCyclingGroup(composite);
+		
+		setSize(composite);
+		loadPreferences();
+		
+		return composite;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#performDefaults()
+	 */
+	protected void performDefaults() {
+		performDefaultsForCyclingGroup();
+
+		validateValues();
+		enableValues();
+
+		super.performDefaults();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#initializeValues()
+	 */
+	protected void initializeValues() {
+		initializeValuesForCyclingGroup();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#storeValues()
+	 */
+	protected void storeValues() {
+		storeValuesForCyclingGroup();
+	}
+	
+	/**
+	 * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
+	 */
+	protected IPreferenceStore doGetPreferenceStore() {
+		return CSSUIPlugin.getDefault().getPreferenceStore();
+	}
+	
+	/**
+	 * <p>Create the contents for the content assist cycling preference group</p>
+	 * @param parent {@link Composite} parent of the group
+	 */
+	private void createContentsForCyclingGroup(Composite parent) {
+		ICompletionProposalCategoriesConfigurationWriter configurationWriter = CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getWritableConfiguration(CSS_CONTENT_TYPE_ID);
+		
+		if(configurationWriter != null) {
+			fConfigurationBlock = new CodeAssistCyclingConfigurationBlock(CSS_CONTENT_TYPE_ID, configurationWriter);
+			fConfigurationBlock.createContents(parent, null); //$NON-NLS-1$
+		} else {
+			Logger.log(Logger.ERROR, "There should be an ICompletionProposalCategoriesConfigurationWriter" + //$NON-NLS-1$
+					" specified for the CSS content type, but can't fine it, thus can't create user" + //$NON-NLS-1$
+					" preference block for editing proposal categories preferences."); //$NON-NLS-1$
+		}
+	}
+	
+	/**
+	 * <p>Store the values for the cycling group</p>
+	 */
+	private void storeValuesForCyclingGroup() {
+		if (fConfigurationBlock != null) {
+			fConfigurationBlock.storeValues();
+		}
+	}
+	
+	/**
+	 * <p>Initialize the values for the cycling group</p>
+	 */
+	private void initializeValuesForCyclingGroup() {
+		if(fConfigurationBlock != null) {
+			fConfigurationBlock.initializeValues();
+		}
+	}
+	
+	/**
+	 * <p>Load the defaults of the cycling group</p>
+	 */
+	private void performDefaultsForCyclingGroup() {
+		if(fConfigurationBlock != null) {
+			fConfigurationBlock.performDefaults();
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSourcePreferencePage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSourcePreferencePage.java
index 235373c..c2ffddb 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSourcePreferencePage.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSourcePreferencePage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
@@ -64,6 +65,11 @@
 	protected Button fPropValueLower;
 	// case of property value
 	protected Button fPropValueUpper;
+
+	// Selector case
+	protected Button fSelectorUpper;
+	protected Button fSelectorLower;
+
 	protected Button fSplitMultiAttrs;
 	private final int MAX_INDENTATION_SIZE = 16;
 	private final int MIN_INDENTATION_SIZE = 0;
@@ -92,7 +98,7 @@
 
 	private void createContentsForContentAssistGroup(Composite parent) {
 		// not content assist, but preferred case
-		Group caseGroup = createGroup(parent, 3);
+		Group caseGroup = createGroup(parent, 4);
 		caseGroup.setText(CSSUIMessages.PrefsLabel_CaseGroup);
 
 		// use group for radio buttons so that associated label is read
@@ -102,6 +108,12 @@
 		fIdentLower = createRadioButton(identGroup, CSSUIMessages.PrefsLabel_CaseIdentLower);
 
 		// use group for radio buttons so that associated label is read
+		Group selectorGroup = createGroup(caseGroup, 1);
+		selectorGroup.setText(CSSUIMessages.PrefsLabel_SelectorTagName);
+		fSelectorUpper = createRadioButton(selectorGroup, CSSUIMessages.PrefsLabel_CaseIdentUpper);
+		fSelectorLower = createRadioButton(selectorGroup, CSSUIMessages.PrefsLabel_CaseIdentLower);
+
+		// use group for radio buttons so that associated label is read
 		Group propNameGroup = createGroup(caseGroup, 1);
 		propNameGroup.setText(CSSUIMessages.PrefsLabel_CasePropName);
 		fPropNameUpper = createRadioButton(propNameGroup, CSSUIMessages.PrefsLabel_CasePropNameUpper);
@@ -130,12 +142,18 @@
 
 		fNowrapAttr = createCheckBox(formattingGroup, CSSUIMessages.PrefsLabel_WrappingWithoutAttr);
 		((GridData) fNowrapAttr.getLayoutData()).horizontalSpan = 2;
-		
-		fIndentUsingTabs = createRadioButton(formattingGroup, CSSUIMessages.Indent_using_tabs_);
-		((GridData) fIndentUsingTabs.getLayoutData()).horizontalSpan = 2;
-		fIndentUsingSpaces = createRadioButton(formattingGroup, CSSUIMessages.Indent_using_spaces);
-		((GridData) fIndentUsingSpaces.getLayoutData()).horizontalSpan = 2;
-		
+
+		// [269224] - Place the indent controls in their own composite for proper tab ordering
+		Composite indentComposite = createComposite(formattingGroup, 1);
+		((GridData) indentComposite.getLayoutData()).horizontalSpan = 2;
+		((GridLayout) indentComposite.getLayout()).marginWidth = 0;
+		((GridLayout) indentComposite.getLayout()).marginHeight = 0;
+
+		fIndentUsingTabs = createRadioButton(indentComposite, CSSUIMessages.Indent_using_tabs_);
+		((GridData) fIndentUsingTabs.getLayoutData()).horizontalSpan = 1;
+		fIndentUsingSpaces = createRadioButton(indentComposite, CSSUIMessages.Indent_using_spaces);
+		((GridData) fIndentUsingSpaces.getLayoutData()).horizontalSpan = 1;
+
 		createLabel(formattingGroup, CSSUIMessages.Indentation_size);
 		fIndentationSize = new Spinner(formattingGroup, SWT.READ_ONLY | SWT.BORDER);
 		GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
@@ -174,6 +192,8 @@
 		Preferences prefs = getModelPreferences();
 		fIdentUpper.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER);
 		fIdentLower.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.LOWER);
+		fSelectorUpper.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_SELECTOR) == CSSCorePreferenceNames.UPPER);
+		fSelectorLower.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_SELECTOR) == CSSCorePreferenceNames.LOWER);
 		fPropNameUpper.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.UPPER);
 		fPropNameLower.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.LOWER);
 		fPropValueUpper.setSelection(prefs.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER);
@@ -213,6 +233,8 @@
 		Preferences prefs = getModelPreferences();
 		fIdentUpper.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER);
 		fIdentLower.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.LOWER);
+		fSelectorUpper.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_SELECTOR) == CSSCorePreferenceNames.UPPER);
+		fSelectorLower.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_SELECTOR) == CSSCorePreferenceNames.LOWER);
 		fPropNameUpper.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.UPPER);
 		fPropNameLower.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.LOWER);
 		fPropValueUpper.setSelection(prefs.getDefaultInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER);
@@ -253,6 +275,7 @@
 		// not content assist, but preferred case
 		Preferences prefs = getModelPreferences();
 		prefs.setValue(CSSCorePreferenceNames.CASE_IDENTIFIER, (fIdentUpper.getSelection()) ? CSSCorePreferenceNames.UPPER : CSSCorePreferenceNames.LOWER);
+		prefs.setValue(CSSCorePreferenceNames.CASE_SELECTOR, (fSelectorUpper.getSelection()) ? CSSCorePreferenceNames.UPPER : CSSCorePreferenceNames.LOWER);
 		prefs.setValue(CSSCorePreferenceNames.CASE_PROPERTY_NAME, (fPropNameUpper.getSelection()) ? CSSCorePreferenceNames.UPPER : CSSCorePreferenceNames.LOWER);
 		prefs.setValue(CSSCorePreferenceNames.CASE_PROPERTY_VALUE, (fPropValueUpper.getSelection()) ? CSSCorePreferenceNames.UPPER : CSSCorePreferenceNames.LOWER);
 	}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSyntaxColoringPage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSyntaxColoringPage.java
index afd4014..c840995 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSyntaxColoringPage.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSyntaxColoringPage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -663,6 +663,15 @@
 			styles.add(IStyleConstantsCSS.NORMAL);
 			styles.add(IStyleConstantsCSS.ATMARK_RULE);
 			styles.add(IStyleConstantsCSS.SELECTOR);
+			styles.add(IStyleConstantsCSS.UNIVERSAL);
+			styles.add(IStyleConstantsCSS.COMBINATOR);
+			styles.add(IStyleConstantsCSS.SELECTOR_CLASS);
+			styles.add(IStyleConstantsCSS.ID);
+			styles.add(IStyleConstantsCSS.PSEUDO);
+			styles.add(IStyleConstantsCSS.ATTRIBUTE_DELIM);
+			styles.add(IStyleConstantsCSS.ATTRIBUTE_NAME);
+			styles.add(IStyleConstantsCSS.ATTRIBUTE_OPERATOR);
+			styles.add(IStyleConstantsCSS.ATTRIBUTE_VALUE);
 			styles.add(IStyleConstantsCSS.MEDIA);
 			styles.add(IStyleConstantsCSS.COMMENT);
 			styles.add(IStyleConstantsCSS.PROPERTY_NAME);
@@ -786,18 +795,21 @@
 		fContextToStyleMap.put(CSSRegionContexts.CSS_PAGE_SELECTOR, IStyleConstantsCSS.MEDIA);
 
 		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME, IStyleConstantsCSS.SELECTOR);
-		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_UNIVERSAL, IStyleConstantsCSS.SELECTOR);
-		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_PSEUDO, IStyleConstantsCSS.SELECTOR);
-		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_CLASS, IStyleConstantsCSS.SELECTOR);
-		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ID, IStyleConstantsCSS.SELECTOR);
+		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_UNIVERSAL, IStyleConstantsCSS.UNIVERSAL);
 
-		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_COMBINATOR, IStyleConstantsCSS.SELECTOR);
+		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_PSEUDO, IStyleConstantsCSS.PSEUDO);
+		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_CLASS, IStyleConstantsCSS.SELECTOR_CLASS);
+		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ID, IStyleConstantsCSS.ID);
+
+		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_COMBINATOR, IStyleConstantsCSS.COMBINATOR);
 		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_SEPARATOR, IStyleConstantsCSS.SELECTOR);
-		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START, IStyleConstantsCSS.SELECTOR);
-		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END, IStyleConstantsCSS.SELECTOR);
-		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_NAME, IStyleConstantsCSS.SELECTOR);
-		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_VALUE, IStyleConstantsCSS.SELECTOR);
-		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_OPERATOR, IStyleConstantsCSS.SELECTOR);
+
+		/* Attribute selector */
+		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START, IStyleConstantsCSS.ATTRIBUTE_DELIM);
+		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END, IStyleConstantsCSS.ATTRIBUTE_DELIM);
+		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_NAME, IStyleConstantsCSS.ATTRIBUTE_NAME);
+		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_VALUE, IStyleConstantsCSS.ATTRIBUTE_VALUE);
+		fContextToStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_OPERATOR, IStyleConstantsCSS.ATTRIBUTE_OPERATOR);
 
 		fContextToStyleMap.put(CSSRegionContexts.CSS_DECLARATION_PROPERTY, IStyleConstantsCSS.PROPERTY_NAME);
 		fContextToStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT, IStyleConstantsCSS.PROPERTY_VALUE);
@@ -823,6 +835,15 @@
 		fStyleToDescriptionMap.put(IStyleConstantsCSS.NORMAL, CSSUIMessages.PrefsLabel_ColorNormal);//$NON-NLS-1$
 		fStyleToDescriptionMap.put(IStyleConstantsCSS.ATMARK_RULE, CSSUIMessages.PrefsLabel_ColorAtmarkRule);//$NON-NLS-1$
 		fStyleToDescriptionMap.put(IStyleConstantsCSS.SELECTOR, CSSUIMessages.PrefsLabel_ColorSelector);//$NON-NLS-1$
+		fStyleToDescriptionMap.put(IStyleConstantsCSS.COMBINATOR, CSSUIMessages.PrefsLabel_ColorCombinator);//$NON-NLS-1$
+		fStyleToDescriptionMap.put(IStyleConstantsCSS.UNIVERSAL, CSSUIMessages.PrefsLabel_ColorUniversal);//$NON-NLS-1$
+		fStyleToDescriptionMap.put(IStyleConstantsCSS.ID, CSSUIMessages.PrefsLabel_ColorId);//$NON-NLS-1$
+		fStyleToDescriptionMap.put(IStyleConstantsCSS.PSEUDO, CSSUIMessages.PrefsLabel_ColorPseudoClass);//$NON-NLS-1$
+		fStyleToDescriptionMap.put(IStyleConstantsCSS.SELECTOR_CLASS, CSSUIMessages.PrefsLabel_ColorClass);//$NON-NLS-1$
+		fStyleToDescriptionMap.put(IStyleConstantsCSS.ATTRIBUTE_DELIM, CSSUIMessages.PrefsLabel_ColorAttrDelimiter);//$NON-NLS-1$
+		fStyleToDescriptionMap.put(IStyleConstantsCSS.ATTRIBUTE_NAME, CSSUIMessages.PrefsLabel_ColorAttrName);//$NON-NLS-1$
+		fStyleToDescriptionMap.put(IStyleConstantsCSS.ATTRIBUTE_OPERATOR, CSSUIMessages.PrefsLabel_ColorAttrOperator);//$NON-NLS-1$
+		fStyleToDescriptionMap.put(IStyleConstantsCSS.ATTRIBUTE_VALUE, CSSUIMessages.PrefsLabel_ColorAttrValue);//$NON-NLS-1$
 		fStyleToDescriptionMap.put(IStyleConstantsCSS.MEDIA, CSSUIMessages.PrefsLabel_ColorMedia);//$NON-NLS-1$
 		fStyleToDescriptionMap.put(IStyleConstantsCSS.COMMENT, CSSUIMessages.PrefsLabel_ColorComment);//$NON-NLS-1$
 		fStyleToDescriptionMap.put(IStyleConstantsCSS.PROPERTY_NAME, CSSUIMessages.PrefsLabel_ColorPropertyName);//$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSTemplatePreferencePage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSTemplatePreferencePage.java
index 419351e..baf7fd6 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSTemplatePreferencePage.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSTemplatePreferencePage.java
@@ -133,7 +133,7 @@
 		SourceViewer viewer = null;
 		String contentTypeID = ContentTypeIdForCSS.ContentTypeID_CSS;
 		viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
-		((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+		viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
 		IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(contentTypeID);
 		IDocument document = scratchModel.getStructuredDocument();
 		viewer.configure(viewerConfiguration);
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/CSSFoldingStrategy.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/CSSFoldingStrategy.java
new file mode 100644
index 0000000..03037e0
--- /dev/null
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/CSSFoldingStrategy.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.css.ui.internal.projection;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.text.Position;
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy;
+
+/**
+ * A folding strategy for CSS structured documents.
+ * See AbstractStructuredFoldingStrategy for more details.
+ */
+public class CSSFoldingStrategy extends AbstractStructuredFoldingStrategy {
+
+	/**
+	 * Create an instance of the folding strategy.
+	 * Be sure to set the viewer and document after creation.
+	 */
+	public CSSFoldingStrategy() {
+		super();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.projection.AbstractFoldingStrategy#calcNewFoldPosition(org.eclipse.wst.sse.core.internal.provisional.IndexedRegion)
+	 */
+	protected Position calcNewFoldPosition(IndexedRegion indexedRegion) {
+		Position newPos = null;
+		
+		//only want to fold regions with a valid range
+		if(indexedRegion.getStartOffset() >= 0 && indexedRegion.getLength() >= 0) {
+			newPos = new CSSRuleFoldingPosition(indexedRegion);
+		}
+		return newPos;
+	}
+	
+	/**
+	 * The same as the AbstractFoldingStrategy implementation except for the new position is
+	 * calculated on the given IndexRegion and not the annotations stored IndexedRegion because
+	 * of the way CSS regions are replaced when they are updated.
+	 * 
+	 * (non-Javadoc)
+	 * @see org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy#updateAnnotations(java.util.Iterator, org.eclipse.wst.sse.core.internal.provisional.IndexedRegion, java.util.List, java.util.List)
+	 */
+	protected void updateAnnotations(Iterator existingAnnotationsIter, IndexedRegion dirtyRegion,
+			List modifications, List deletions) {
+		
+		while(existingAnnotationsIter.hasNext()) {
+			Object obj = existingAnnotationsIter.next();
+			if(obj instanceof FoldingAnnotation) {
+				FoldingAnnotation annotation = (FoldingAnnotation)obj;
+				
+				//NOTE can not use the annotations stored region because the CSSStructuredDocument
+				//	replaces the old region with a new one when it is modified
+				Position newPos = calcNewFoldPosition(annotation.getRegion());
+				if(newPos != null) {
+					Position oldPos = fProjectionAnnotationModel.getPosition(annotation);
+					if(!newPos.equals(oldPos)) {
+						oldPos.setOffset(newPos.offset);
+						oldPos.setLength(newPos.length);
+						modifications.add(annotation);
+					}
+				} else {
+					deletions.add(annotation);
+				}
+			}
+		}
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.projection.AbstractFoldingStrategy#indexedRegionValidType(org.eclipse.wst.sse.core.internal.provisional.IndexedRegion)
+	 */
+	protected boolean indexedRegionValidType(IndexedRegion indexedRegion) {
+		return (indexedRegion instanceof ICSSStyleRule);
+	}
+}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/CSSRuleFoldingPosition.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/CSSRuleFoldingPosition.java
new file mode 100644
index 0000000..dfc0984
--- /dev/null
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/CSSRuleFoldingPosition.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.css.ui.internal.projection;
+
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingPosition;
+import org.w3c.dom.css.CSSStyleRule;
+
+/**
+ * An {@link AbstractStructuredFoldingPosition} used to cover CSS regions
+ */
+public class CSSRuleFoldingPosition extends AbstractStructuredFoldingPosition {
+
+	/**
+	 * the region that will be folded
+	 */
+	private IndexedRegion fRegion;
+	
+	/**
+	 * Creates a folding position that covers {@link IndexedRegion}s
+	 * in a CSS document
+	 * 
+	 * @param region the {@link IndexedRegion} that this folding position covers
+	 */
+	public CSSRuleFoldingPosition(IndexedRegion region) {
+		super(region.getStartOffset(), region.getLength());
+		this.fRegion = region;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingPosition#getStartOffset()
+	 */
+	protected int getStartOffset() {
+		int startOffset = fRegion.getStartOffset();
+		
+		//so that multi-line CSS selector text does not get folded
+		if(this.fRegion instanceof CSSStyleRule) {
+			CSSStyleRule rule = (CSSStyleRule)this.fRegion;
+			startOffset += rule.getSelectorText().length();
+		}
+		
+		return startOffset;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingPosition#getEndOffset()
+	 */
+	protected int getEndOffset() {
+		return fRegion.getEndOffset();
+	}
+
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionAnnotationModelChanges.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionAnnotationModelChanges.java
deleted file mode 100644
index 1c5108b..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionAnnotationModelChanges.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.projection;
-
-import java.util.Map;
-
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-
-/**
- * Contains a set of projection model additions/deletions/modifications
- */
-class ProjectionAnnotationModelChanges {
-	// copies of this class located in:
-	// org.eclipse.wst.xml.ui.internal.projection
-	// org.eclipse.wst.css.ui.internal.projection
-	// org.eclipse.wst.html.ui.internal.projection
-	// org.eclipse.jst.jsp.ui.internal.projection
-	// change Node to ICSSNode
-	private ICSSNode fNode;
-	private Annotation[] fDeletions;
-	private Map fAdditions;
-	private Annotation[] fModifications;
-
-	public ProjectionAnnotationModelChanges(ICSSNode node, Annotation[] deletions, Map additions, Annotation[] modifications) {
-		fNode = node;
-		fDeletions = deletions;
-		fAdditions = additions;
-		fModifications = modifications;
-	}
-
-	public Map getAdditions() {
-		return fAdditions;
-	}
-
-	public Annotation[] getDeletions() {
-		return fDeletions;
-	}
-
-	public Annotation[] getModifications() {
-		return fModifications;
-	}
-
-	public ICSSNode getNode() {
-		return fNode;
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionModelNodeAdapterCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionModelNodeAdapterCSS.java
deleted file mode 100644
index af6e56e..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionModelNodeAdapterCSS.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.projection;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-
-/**
- * Updates projection annotation model with projection annotations for this
- * adapter node's children
- */
-public class ProjectionModelNodeAdapterCSS implements INodeAdapter {
-	private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.css.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$\
-
-	private class TagProjectionAnnotation extends ProjectionAnnotation {
-		private boolean fIsVisible = false; /* workaround for BUG85874 */
-		private ICSSNode fNode;
-
-		public TagProjectionAnnotation(ICSSNode node, boolean isCollapsed) {
-			super(isCollapsed);
-			fNode = node;
-		}
-
-		public ICSSNode getNode() {
-			return fNode;
-		}
-
-		public void setNode(ICSSNode node) {
-			fNode = node;
-		}
-
-		/**
-		 * Does not paint hidden annotations. Annotations are hidden when they
-		 * only span one line.
-		 * 
-		 * @see ProjectionAnnotation#paint(org.eclipse.swt.graphics.GC,
-		 *      org.eclipse.swt.widgets.Canvas,
-		 *      org.eclipse.swt.graphics.Rectangle)
-		 */
-		public void paint(GC gc, Canvas canvas, Rectangle rectangle) {
-			/* workaround for BUG85874 */
-			/*
-			 * only need to check annotations that are expanded because hidden
-			 * annotations should never have been given the chance to
-			 * collapse.
-			 */
-			if (!isCollapsed()) {
-				// working with rectangle, so line height
-				FontMetrics metrics = gc.getFontMetrics();
-				if (metrics != null) {
-					// do not draw annotations that only span one line and
-					// mark them as not visible
-					if ((rectangle.height / metrics.getHeight()) <= 1) {
-						fIsVisible = false;
-						return;
-					}
-				}
-			}
-			fIsVisible = true;
-			super.paint(gc, canvas, rectangle);
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.jface.text.source.projection.ProjectionAnnotation#markCollapsed()
-		 */
-		public void markCollapsed() {
-			/* workaround for BUG85874 */
-			// do not mark collapsed if annotation is not visible
-			if (fIsVisible)
-				super.markCollapsed();
-		}
-	}
-
-	ProjectionModelNodeAdapterFactoryCSS fAdapterFactory;
-	private Map fTagAnnotations = new HashMap();
-
-	public ProjectionModelNodeAdapterCSS(ProjectionModelNodeAdapterFactoryCSS factory) {
-		fAdapterFactory = factory;
-	}
-
-	/**
-	 * Create a projection position from the given node. Able to get
-	 * projection position if node isNodeProjectable.
-	 * 
-	 * @param node
-	 * @return null if no projection position possible, a Position otherwise
-	 */
-	private Position createProjectionPosition(ICSSNode node) {
-		Position pos = null;
-		if (isNodeProjectable(node) && node instanceof IndexedRegion) {
-			// IDocument document =
-			// fAdapterFactory.getProjectionViewer().getDocument();
-			// if (document != null) {
-			IndexedRegion inode = (IndexedRegion) node;
-			int start = inode.getStartOffset();
-			int end = inode.getEndOffset();
-			if (start >= 0 && start < end) {
-				// region-based
-				// extra line when collapsed, but no region increase when
-				// add newline
-				pos = new Position(start, end - start);
-				// try {
-				// // line-based
-				// // extra line when collapsed, but no region
-				// // increase when add newline
-				// IRegion startLineRegion =
-				// document.getLineInformationOfOffset(start);
-				// IRegion endLineRegion =
-				// document.getLineInformationOfOffset(end);
-				// int startOffset = startLineRegion.getOffset();
-				// int endOffset = endLineRegion.getOffset() +
-				// endLineRegion.getLength();
-				// if (endOffset > startOffset) {
-				// pos = new Position(startOffset, endOffset -
-				// startOffset);
-				// }
-				//
-				// // line-based
-				// // no extra line when collapsed, but region increase
-				// // when add newline
-				// int startLine = document.getLineOfOffset(start);
-				// int endLine = document.getLineOfOffset(end);
-				// if (endLine + 1 < document.getNumberOfLines()) {
-				// int offset = document.getLineOffset(startLine);
-				// int endOffset = document.getLineOffset(endLine + 1);
-				// pos = new Position(offset, endOffset - offset);
-				// }
-				// }
-				// catch (BadLocationException x) {
-				// Logger.log(Logger.WARNING_DEBUG, null, x);
-				// }
-			}
-			// }
-		}
-		return pos;
-	}
-
-	/**
-	 * Find TagProjectionAnnotation for node in the current list of projection
-	 * annotations for this adapter
-	 * 
-	 * @param node
-	 * @return TagProjectionAnnotation
-	 */
-	private TagProjectionAnnotation getExistingAnnotation(ICSSNode node) {
-		TagProjectionAnnotation anno = null;
-
-		if ((node != null) && (!fTagAnnotations.isEmpty())) {
-			Iterator it = fTagAnnotations.keySet().iterator();
-			while (it.hasNext() && anno == null) {
-				TagProjectionAnnotation a = (TagProjectionAnnotation) it.next();
-				ICSSNode n = a.getNode();
-				if (node.equals(n)) {
-					anno = a;
-				}
-			}
-		}
-		return anno;
-	}
-
-	public boolean isAdapterForType(Object type) {
-		return type == ProjectionModelNodeAdapterCSS.class;
-	}
-
-	/**
-	 * Returns true if node is a node type able to fold
-	 * 
-	 * @param node
-	 * @return boolean true if node is projectable, false otherwise
-	 */
-	private boolean isNodeProjectable(ICSSNode node) {
-		if (node != null) {
-			short type = node.getNodeType();
-			if (type == ICSSNode.STYLERULE_NODE || type == ICSSNode.PAGERULE_NODE || type == ICSSNode.MEDIARULE_NODE || type == ICSSNode.IMPORTRULE_NODE || type == ICSSNode.FONTFACERULE_NODE || type == ICSSNode.CHARSETRULE_NODE)
-				return true;
-		}
-		return false;
-	}
-
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		// check if folding is even enabled, if not, just ignore notifyChanged
-		// events
-		if (!fAdapterFactory.isActive()) {
-			return;
-		}
-
-		// workaround for Bug85342 - STRUCTRE_CHANGED is never fired so need
-		// to listen for every ADD, REMOVE
-		// if ((eventType == INodeNotifier.STRUCTURE_CHANGED) && (notifier
-		// instanceof ICSSNode)) {
-		if ((eventType == INodeNotifier.ADD || eventType == INodeNotifier.REMOVE) && (notifier instanceof ICSSNode)) {
-			updateAdapter((ICSSNode) notifier);
-		}
-	}
-
-	/**
-	 * Update the projection annotation of all the nodes that are children of
-	 * node
-	 * 
-	 * @param node
-	 */
-	void updateAdapter(ICSSNode node) {
-		updateAdapter(node, null);
-	}
-
-	/**
-	 * Update the projection annotation of all the nodes that are children of
-	 * node and adds all projection annotations to viewer (for newly added
-	 * viewers)
-	 * 
-	 * @param node
-	 * @param viewer
-	 */
-	void updateAdapter(ICSSNode node, ProjectionViewer viewer) {
-		long start = System.currentTimeMillis();
-
-		Map additions = new HashMap();
-		Map projectionAnnotations = new HashMap();
-
-		// go through immediate child nodes and figure out projection
-		// model annotations
-		if (node != null) {
-			ICSSNode childNode = node.getFirstChild();
-			while (childNode != null) {
-				Position newPos = createProjectionPosition(childNode);
-				if (newPos != null) {
-					TagProjectionAnnotation newAnnotation = new TagProjectionAnnotation(childNode, false);
-					TagProjectionAnnotation existing = getExistingAnnotation(childNode);
-					if (existing == null) {
-						// add to map containing all annotations for this
-						// adapter
-						projectionAnnotations.put(newAnnotation, newPos);
-						// add to map containing annotations to add
-						additions.put(newAnnotation, newPos);
-					}
-					else {
-						// add to map containing all annotations for this
-						// adapter
-						projectionAnnotations.put(existing, newPos);
-						// remove from map containing annotations to delete
-						fTagAnnotations.remove(existing);
-					}
-				}
-				childNode = childNode.getNextSibling();
-			}
-
-			// in the end, want to delete anything leftover in old list, add
-			// everything in additions, and update everything in
-			// projectionAnnotations
-			ProjectionAnnotation[] oldList = null;
-			if (!fTagAnnotations.isEmpty()) {
-				oldList = (ProjectionAnnotation[]) fTagAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
-			}
-			ProjectionAnnotation[] modifyList = null;
-			if (!projectionAnnotations.isEmpty()) {
-				modifyList = (ProjectionAnnotation[]) projectionAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
-			}
-
-			// specifically add all annotations to viewer
-			if (viewer != null && !projectionAnnotations.isEmpty()) {
-				fAdapterFactory.queueAnnotationModelChanges(node, null, projectionAnnotations, null, viewer);
-			}
-
-			// only update when there is something to update
-			if ((oldList != null && oldList.length > 0) || (!additions.isEmpty()) || (modifyList != null && modifyList.length > 0))
-				fAdapterFactory.queueAnnotationModelChanges(node, oldList, additions, modifyList);
-		}
-
-		// save new list of annotations
-		fTagAnnotations = projectionAnnotations;
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			String nodeName = node != null ? node.toString() : "null"; //$NON-NLS-1$
-			System.out.println("ProjectionModelNodeAdapterCSS.updateAdapter (" + nodeName + "):" + (end - start)); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionModelNodeAdapterFactoryCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionModelNodeAdapterFactoryCSS.java
deleted file mode 100644
index 10d7239..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionModelNodeAdapterFactoryCSS.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.projection;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-public class ProjectionModelNodeAdapterFactoryCSS extends AbstractAdapterFactory {
-	/**
-	 * List of projection viewers currently associated with this projection
-	 * model node adapter factory.
-	 */
-	private HashMap fProjectionViewers;
-
-	public ProjectionModelNodeAdapterFactoryCSS() {
-		this(ProjectionModelNodeAdapterCSS.class);
-	}
-
-	public ProjectionModelNodeAdapterFactoryCSS(Object adapterKey, boolean registerAdapters) {
-		super(adapterKey, registerAdapters);
-	}
-
-	public ProjectionModelNodeAdapterFactoryCSS(Object adapterKey) {
-		super(adapterKey);
-	}
-
-	protected INodeAdapter createAdapter(INodeNotifier target) {
-		ProjectionModelNodeAdapterCSS adapter = null;
-
-		if ((isActive()) && (target instanceof ICSSNode)) {
-			ICSSNode node = (ICSSNode) target;
-			short type = node.getNodeType();
-			// only add for top stylesheet node
-			if (type == ICSSNode.STYLESHEET_NODE) {
-				adapter = new ProjectionModelNodeAdapterCSS(this);
-				adapter.updateAdapter(node);
-			}
-		}
-
-		return adapter;
-	}
-
-	/**
-	 * Return true if this factory is currently actively managing projection
-	 * 
-	 * @return
-	 */
-	boolean isActive() {
-		return (fProjectionViewers != null && !fProjectionViewers.isEmpty());
-	}
-
-	/**
-	 * Updates projection annotation model if document is not in flux.
-	 * Otherwise, queues up the changes to be applied when document is ready.
-	 * 
-	 * @param node
-	 * @param deletions
-	 * @param additions
-	 * @param modifications
-	 */
-	void queueAnnotationModelChanges(ICSSNode node, Annotation[] deletions, Map additions, Annotation[] modifications) {
-		queueAnnotationModelChanges(node, deletions, additions, modifications, null);
-	}
-
-	/**
-	 * Updates projection annotation model for a specific projection viewer if
-	 * document is not in flux. Otherwise, queues up the changes to be applied
-	 * when document is ready.
-	 * 
-	 * @param node
-	 * @param deletions
-	 * @param additions
-	 * @param modifications
-	 * @param viewer
-	 */
-	void queueAnnotationModelChanges(ICSSNode node, Annotation[] deletions, Map additions, Annotation[] modifications, ProjectionViewer viewer) {
-		// create a change object for latest change and add to queue
-		ProjectionAnnotationModelChanges newChange = new ProjectionAnnotationModelChanges(node, deletions, additions, modifications);
-		if (fProjectionViewers != null) {
-			if (viewer != null) {
-				ProjectionViewerInformation info = (ProjectionViewerInformation) fProjectionViewers.get(viewer);
-				if (info != null) {
-					info.queueAnnotationModelChanges(newChange);
-				}
-			}
-			else {
-				Iterator infos = fProjectionViewers.values().iterator();
-				while (infos.hasNext()) {
-					ProjectionViewerInformation info = (ProjectionViewerInformation) infos.next();
-					info.queueAnnotationModelChanges(newChange);
-				}
-			}
-		}
-	}
-
-	public void release() {
-		// go through every projectionviewer and call
-		// removeProjectionViewer(viewer);
-		if (fProjectionViewers != null) {
-			Iterator infos = fProjectionViewers.values().iterator();
-			while (infos.hasNext()) {
-				ProjectionViewerInformation info = (ProjectionViewerInformation) infos.next();
-				info.dispose();
-				infos.remove();
-			}
-			fProjectionViewers = null;
-		}
-		super.release();
-	}
-
-	/**
-	 * Adds viewer to list of projection viewers this factory is associated
-	 * with
-	 * 
-	 * @param viewer -
-	 *            assumes viewer's document and projection annotation model
-	 *            are not null
-	 */
-	void addProjectionViewer(ProjectionViewer viewer) {
-		// remove old entry if it exists
-		removeProjectionViewer(viewer);
-
-		if (fProjectionViewers == null) {
-			fProjectionViewers = new HashMap();
-		}
-
-		// create new object containing projection viewer and its info
-		ProjectionViewerInformation info = new ProjectionViewerInformation(viewer);
-		fProjectionViewers.put(viewer, info);
-		info.initialize();
-	}
-
-	/**
-	 * Removes the given viewer from the list of projection viewers this
-	 * factor is associated with
-	 * 
-	 * @param viewer
-	 */
-	void removeProjectionViewer(ProjectionViewer viewer) {
-		if (fProjectionViewers != null) {
-			// remove entry from list of viewers
-			ProjectionViewerInformation info = (ProjectionViewerInformation) fProjectionViewers.remove(viewer);
-			if (info != null) {
-				info.dispose();
-			}
-			// if removing last projection viewer, clear out everything
-			if (fProjectionViewers.isEmpty()) {
-				fProjectionViewers = null;
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionViewerInformation.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionViewerInformation.java
deleted file mode 100644
index a058fd1..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionViewerInformation.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.projection;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.css.ui.internal.Logger;
-
-/**
- * Contains information about a projection viewer and also manages updating
- * the viewer's projection annotation model
- */
-class ProjectionViewerInformation {
-	// copies of this class located in:
-	// org.eclipse.wst.xml.ui.internal.projection
-	// org.eclipse.wst.css.ui.internal.projection
-	// org.eclipse.wst.html.ui.internal.projection
-	// org.eclipse.jst.jsp.ui.internal.projection
-
-	/**
-	 * Listens to document to be aware of when to update the projection
-	 * annotation model.
-	 */
-	private class DocumentListener implements IDocumentListener {
-		private ProjectionViewerInformation fInfo;
-
-		public DocumentListener(ProjectionViewerInformation info) {
-			fInfo = info;
-		}
-
-		public void documentAboutToBeChanged(DocumentEvent event) {
-			IDocument document = event.getDocument();
-			if (fInfo.getDocument() == document) {
-				fInfo.setIsDocumentChanging(true);
-			}
-		}
-
-		public void documentChanged(DocumentEvent event) {
-			// register a post notification replace so that projection
-			// annotation model will be updated after all documentChanged
-			// listeners have been notified
-			IDocument document = event.getDocument();
-			if (document instanceof IDocumentExtension && fInfo.getDocument() == document) {
-				if (fInfo.hasChangesQueued())
-					((IDocumentExtension) document).registerPostNotificationReplace(this, new PostDocumentChangedListener(fInfo));
-			}
-		}
-	}
-
-	/**
-	 * Essentially a post document changed listener because it is called after
-	 * documentchanged has been fired.
-	 */
-	private class PostDocumentChangedListener implements IDocumentExtension.IReplace {
-		private ProjectionViewerInformation fInfo;
-
-		public PostDocumentChangedListener(ProjectionViewerInformation info) {
-			fInfo = info;
-		}
-
-		public void perform(IDocument document, IDocumentListener owner) {
-			fInfo.applyAnnotationModelChanges();
-			fInfo.setIsDocumentChanging(false);
-		}
-	}
-
-	/**
-	 * Projection annotation model current associated with this projection
-	 * viewer
-	 */
-	private ProjectionAnnotationModel fProjectionAnnotationModel;
-	/**
-	 * Document currently associated with this projection viewer
-	 */
-	private IDocument fDocument;
-	/**
-	 * Listener to fProjectionViewer's document
-	 */
-	private IDocumentListener fDocumentListener;
-	/**
-	 * Indicates whether or not document is in the middle of changing
-	 */
-	private boolean fIsDocumentChanging = false;
-	/**
-	 * List of projection annotation model changes that need to be applied
-	 */
-	private List fQueuedAnnotationChanges;
-
-	public ProjectionViewerInformation(ProjectionViewer viewer) {
-		fDocument = viewer.getDocument();
-		fProjectionAnnotationModel = viewer.getProjectionAnnotationModel();
-	}
-
-	IDocument getDocument() {
-		return fDocument;
-	}
-
-	private List getQueuedAnnotationChanges() {
-		if (fQueuedAnnotationChanges == null) {
-			fQueuedAnnotationChanges = new ArrayList();
-		}
-		return fQueuedAnnotationChanges;
-	}
-
-	void setIsDocumentChanging(boolean changing) {
-		fIsDocumentChanging = changing;
-	}
-
-	private boolean isDocumentChanging() {
-		return fIsDocumentChanging;
-	}
-
-	/**
-	 * Applies the pending projection annotation model changes to the
-	 * projection annotation model.
-	 */
-	void applyAnnotationModelChanges() {
-		List queuedChanges = getQueuedAnnotationChanges();
-		// go through all the pending annotation changes and apply
-		// them to
-		// the projection annotation model
-		while (!queuedChanges.isEmpty()) {
-			ProjectionAnnotationModelChanges changes = (ProjectionAnnotationModelChanges) queuedChanges.remove(0);
-			try {
-				fProjectionAnnotationModel.modifyAnnotations(changes.getDeletions(), changes.getAdditions(), changes.getModifications());
-			}
-			catch (Exception e) {
-				// if anything goes wrong, log it be continue
-				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-			}
-		}
-	}
-
-	/**
-	 * Returns true if there are annotation changes queued up, false otherwise
-	 * 
-	 * @return boolean
-	 */
-	boolean hasChangesQueued() {
-		return !getQueuedAnnotationChanges().isEmpty();
-	}
-
-	/**
-	 * Updates projection annotation model if document is not in flux.
-	 * Otherwise, queues up the changes to be applied when document is ready.
-	 */
-	public void queueAnnotationModelChanges(ProjectionAnnotationModelChanges newChange) {
-		/*
-		 * future_TODO: maybe improve by checking if annotation projection
-		 * model change already exists for node. if so, throw out old change.
-		 */
-		getQueuedAnnotationChanges().add(newChange);
-
-		// if document isn't changing, go ahead and apply it
-		if (!isDocumentChanging()) {
-			applyAnnotationModelChanges();
-		}
-	}
-
-	public void initialize() {
-		// add document listener
-		if (fDocumentListener == null) {
-			fDocumentListener = new DocumentListener(this);
-		}
-		getDocument().addDocumentListener(fDocumentListener);
-	}
-
-	public void dispose() {
-		// remove document listener
-		if (fDocumentListener != null) {
-			getDocument().removeDocumentListener(fDocumentListener);
-		}
-
-		// clear out list of queued changes since it may no longer
-		// be accurate
-		if (fQueuedAnnotationChanges != null) {
-			fQueuedAnnotationChanges.clear();
-			fQueuedAnnotationChanges = null;
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/StructuredTextFoldingProviderCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/StructuredTextFoldingProviderCSS.java
deleted file mode 100644
index 1d06224..0000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/StructuredTextFoldingProviderCSS.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.ui.internal.projection;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.jface.text.source.projection.IProjectionListener;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
-
-/**
- * Updates the projection model of a structured model for CSS.
- */
-public class StructuredTextFoldingProviderCSS implements IStructuredTextFoldingProvider, IProjectionListener, ITextInputListener {
-	private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.css.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$\
-
-	private IDocument fDocument;
-	private ProjectionViewer fViewer;
-	private boolean fProjectionNeedsToBeEnabled = false;
-
-	/**
-	 * Just add adapter to top stylesheet node. This adapter will track
-	 * children addition/deletion.
-	 */
-	private void addAllAdapters() {
-		long start = System.currentTimeMillis();
-
-		if (fDocument != null) {
-			IStructuredModel sModel = null;
-			try {
-				sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-				if (sModel instanceof ICSSModel) {
-					ICSSModel cssModel = (ICSSModel) sModel;
-					ICSSDocument cssDoc = cssModel.getDocument();
-					if (cssDoc instanceof INodeNotifier) {
-						INodeNotifier notifier = (INodeNotifier) cssDoc;
-						ProjectionModelNodeAdapterCSS adapter = (ProjectionModelNodeAdapterCSS) notifier.getExistingAdapter(ProjectionModelNodeAdapterCSS.class);
-						if (adapter != null) {
-							adapter.updateAdapter(cssDoc, fViewer);
-						}
-						else {
-							// just call getadapter so the adapter is created
-							// and
-							// automatically initialized
-							notifier.getAdapterFor(ProjectionModelNodeAdapterCSS.class);
-						}
-					}
-				}
-			}
-			finally {
-				if (sModel != null) {
-					sModel.releaseFromRead();
-				}
-			}
-		}
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderCSS.addAllAdapters: " + (end - start)); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Get the ProjectionModelNodeAdapterFactoryCSS to use with this provider.
-	 * 
-	 * @return ProjectionModelNodeAdapterFactoryCSS
-	 */
-	private ProjectionModelNodeAdapterFactoryCSS getAdapterFactory(boolean createIfNeeded) {
-		ProjectionModelNodeAdapterFactoryCSS factory = null;
-		if (fDocument != null) {
-			IStructuredModel sModel = null;
-			try {
-				sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-				if (sModel != null) {
-					FactoryRegistry factoryRegistry = sModel.getFactoryRegistry();
-
-					// getting the projectionmodelnodeadapter for the first
-					// time
-					// so do some initializing
-					if (!factoryRegistry.contains(ProjectionModelNodeAdapterCSS.class) && createIfNeeded) {
-						ProjectionModelNodeAdapterFactoryCSS newFactory = new ProjectionModelNodeAdapterFactoryCSS();
-
-						// add factory to factory registry
-						factoryRegistry.addFactory(newFactory);
-					}
-
-					// try and get the factory
-					factory = (ProjectionModelNodeAdapterFactoryCSS) factoryRegistry.getFactoryFor(ProjectionModelNodeAdapterCSS.class);
-				}
-			}
-			finally {
-				if (sModel != null)
-					sModel.releaseFromRead();
-			}
-		}
-		return factory;
-	}
-
-	/**
-	 * Initialize this provider with the correct document. Assumes projection
-	 * is enabled. (otherwise, only install would have been called)
-	 */
-	public void initialize() {
-		if (!isInstalled())
-			return;
-
-		long start = System.currentTimeMillis();
-		// clear out old info
-		projectionDisabled();
-
-		fDocument = fViewer.getDocument();
-
-		// set projection viewer on new document's adapter factory
-		if (fViewer.getProjectionAnnotationModel() != null) {
-			ProjectionModelNodeAdapterFactoryCSS factory = getAdapterFactory(true);
-			if (factory != null) {
-				factory.addProjectionViewer(fViewer);
-			}
-
-			try {
-				// https://bugs.eclipse.org/bugs/show_bug.cgi?id=198304
-				// disable redraw while adding all adapters
-				fViewer.setRedraw(false);
-				addAllAdapters();
-			}
-			finally {
-				fViewer.setRedraw(true);
-			}
-		}
-		fProjectionNeedsToBeEnabled = false;
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderCSS.initialize: " + (end - start)); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Associate a ProjectionViewer with this IStructuredTextFoldingProvider
-	 * 
-	 * @param viewer -
-	 *            assumes not null
-	 */
-	public void install(ProjectionViewer viewer) {
-		// uninstall before trying to install new viewer
-		if (isInstalled()) {
-			uninstall();
-		}
-		fViewer = viewer;
-		fViewer.addProjectionListener(this);
-		fViewer.addTextInputListener(this);
-	}
-
-	private boolean isInstalled() {
-		return fViewer != null;
-	}
-
-	public void projectionDisabled() {
-		ProjectionModelNodeAdapterFactoryCSS factory = getAdapterFactory(false);
-		if (factory != null) {
-			factory.removeProjectionViewer(fViewer);
-		}
-
-		// clear out all annotations
-		if (fViewer.getProjectionAnnotationModel() != null)
-			fViewer.getProjectionAnnotationModel().removeAllAnnotations();
-
-		removeAllAdapters();
-
-		fDocument = null;
-		fProjectionNeedsToBeEnabled = false;
-	}
-
-	public void projectionEnabled() {
-		initialize();
-	}
-
-	/**
-	 * Removes adapter from top stylesheet node
-	 */
-	private void removeAllAdapters() {
-		long start = System.currentTimeMillis();
-
-		if (fDocument != null) {
-			IStructuredModel sModel = null;
-			try {
-				sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-				if (sModel instanceof ICSSModel) {
-					ICSSModel cssModel = (ICSSModel) sModel;
-					ICSSDocument cssDoc = cssModel.getDocument();
-					if (cssDoc instanceof INodeNotifier) {
-						INodeNotifier notifier = (INodeNotifier) cssDoc;
-						INodeAdapter adapter = notifier.getExistingAdapter(ProjectionModelNodeAdapterCSS.class);
-						if (adapter != null) {
-							notifier.removeAdapter(adapter);
-						}
-					}
-				}
-			}
-			finally {
-				if (sModel != null) {
-					sModel.releaseFromRead();
-				}
-			}
-		}
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderCSS.addAllAdapters: " + (end - start)); //$NON-NLS-1$
-		}
-	}
-
-	public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
-		// if folding is enabled and new document is going to be a totally
-		// different document, disable projection
-		if (fDocument != null && fDocument != newInput) {
-			// disable projection and disconnect everything
-			projectionDisabled();
-			fProjectionNeedsToBeEnabled = true;
-		}
-	}
-
-	public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
-		// if projection was previously enabled before input document changed
-		// and new document is different than old document
-		if (fProjectionNeedsToBeEnabled && fDocument == null && newInput != null) {
-			projectionEnabled();
-			fProjectionNeedsToBeEnabled = false;
-		}
-	}
-
-	/**
-	 * Disconnect this IStructuredTextFoldingProvider from projection viewer
-	 */
-	public void uninstall() {
-		if (isInstalled()) {
-			projectionDisabled();
-
-			fViewer.removeProjectionListener(this);
-			fViewer.removeTextInputListener(this);
-			fViewer = null;
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSPropertySource.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSPropertySource.java
index 2fa5f0d..5060e8b 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSPropertySource.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSPropertySource.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -33,13 +33,14 @@
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSNodeList;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
 import org.eclipse.wst.css.ui.internal.CSSUIMessages;
+import org.eclipse.wst.sse.ui.views.properties.IPropertySourceExtension;
 import org.w3c.dom.css.CSSStyleDeclaration;
 
 /**
  * A IPropertySource implementation for a JFace viewer used to display
  * properties of CSS nodes.
  */
-public class CSSPropertySource implements IPropertySource {
+public class CSSPropertySource implements IPropertySource, IPropertySourceExtension {
 	protected ICSSNode fNode = null;
 	// for performance...
 	final static Class ADAPTER_KEY = IPropertySource.class;
@@ -335,4 +336,20 @@
 
 		return declaration;
 	}
+
+	// Bug 130039 - Implement IPropertySourceExtension
+	
+	public boolean isPropertyRemovable(Object name) {
+		return true;
+	}
+
+	public void removeProperty(Object name) {
+		if(name == null)
+			return;
+		
+		CSSStyleDeclaration declaration = getDeclarationNode();
+		
+		if(declaration != null)
+			declaration.removeProperty(name.toString());
+	}
 }
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/IStyleConstantsCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/IStyleConstantsCSS.java
index a9b5330..2287a63 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/IStyleConstantsCSS.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/IStyleConstantsCSS.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,6 +18,10 @@
 	public static final String NORMAL = "NORMAL"; //$NON-NLS-1$
 	public static final String ATMARK_RULE = "ATMARK_RULE"; //$NON-NLS-1$
 	public static final String SELECTOR = "SELECTOR"; //$NON-NLS-1$
+	public static final String UNIVERSAL = "UNIVERSAL"; //$NON-NLS-1$
+	public static final String PSEUDO = "PSEUDO"; //$NON-NLS-1$
+	public static final String SELECTOR_CLASS = "CLASS"; //$NON-NLS-1$
+	public static final String ID = "ID"; //$NON-NLS-1$
 	public static final String MEDIA = "MEDIA"; //$NON-NLS-1$
 	public static final String COMMENT = "COMMENT"; //$NON-NLS-1$
 	public static final String PROPERTY_NAME = "PROPERTY_NAME"; //$NON-NLS-1$
@@ -27,5 +31,10 @@
 	public static final String COLON = "COLON"; //$NON-NLS-1$
 	public static final String SEMI_COLON = "SEMI_COLON"; //$NON-NLS-1$
 	public static final String CURLY_BRACE = "CURLY_BRACE"; //$NON-NLS-1$
+	public static final String ATTRIBUTE_DELIM = "ATTRIBUTE_DELIM"; //$NON-NLS-1$
+	public static final String ATTRIBUTE_NAME = "ATTRIBUTE_NAME"; //$NON-NLS-1$
+	public static final String ATTRIBUTE_OPERATOR = "ATTRIBUTE_OPERATOR"; //$NON-NLS-1$
+	public static final String ATTRIBUTE_VALUE = "ATTRIBUTE_VALUE"; //$NON-NLS-1$
+	public static final String COMBINATOR = "COMBINATOR"; //$NON-NLS-1$
 	public static final String ERROR = "ERROR"; //$NON-NLS-1$
 }
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForCSS.java
index cb05027..8cffa99 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForCSS.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForCSS.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -86,18 +86,21 @@
 		fColorTypes.put(CSSRegionContexts.CSS_PAGE_SELECTOR, IStyleConstantsCSS.MEDIA);
 
 		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME, IStyleConstantsCSS.SELECTOR);
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_UNIVERSAL, IStyleConstantsCSS.SELECTOR);
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_PSEUDO, IStyleConstantsCSS.SELECTOR);
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_CLASS, IStyleConstantsCSS.SELECTOR);
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ID, IStyleConstantsCSS.SELECTOR);
+		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_UNIVERSAL, IStyleConstantsCSS.UNIVERSAL);
 
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_COMBINATOR, IStyleConstantsCSS.SELECTOR);
+		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_PSEUDO, IStyleConstantsCSS.PSEUDO);
+		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_CLASS, IStyleConstantsCSS.SELECTOR_CLASS);
+		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ID, IStyleConstantsCSS.ID);
+
+		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_COMBINATOR, IStyleConstantsCSS.COMBINATOR);
 		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_SEPARATOR, IStyleConstantsCSS.SELECTOR);
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START, IStyleConstantsCSS.SELECTOR);
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END, IStyleConstantsCSS.SELECTOR);
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_NAME, IStyleConstantsCSS.SELECTOR);
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_VALUE, IStyleConstantsCSS.SELECTOR);
-		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_OPERATOR, IStyleConstantsCSS.SELECTOR);
+
+		/* Attribute selector */
+		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START, IStyleConstantsCSS.ATTRIBUTE_DELIM);
+		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END, IStyleConstantsCSS.ATTRIBUTE_DELIM);
+		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_NAME, IStyleConstantsCSS.ATTRIBUTE_NAME);
+		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_VALUE, IStyleConstantsCSS.ATTRIBUTE_VALUE);
+		fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_OPERATOR, IStyleConstantsCSS.ATTRIBUTE_OPERATOR);
 
 		fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_PROPERTY, IStyleConstantsCSS.PROPERTY_NAME);
 		fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT, IStyleConstantsCSS.PROPERTY_VALUE);
@@ -139,12 +142,30 @@
 				styleKey = IStyleConstantsCSS.MEDIA;
 			} else if (IStyleConstantsCSS.NORMAL.equals(prefKey)) {
 				styleKey = IStyleConstantsCSS.NORMAL;
+			} else if (IStyleConstantsCSS.ATTRIBUTE_DELIM.equals(prefKey)) {
+				styleKey = IStyleConstantsCSS.ATTRIBUTE_DELIM;
+			} else if (IStyleConstantsCSS.ATTRIBUTE_NAME.equals(prefKey)) {
+				styleKey = IStyleConstantsCSS.ATTRIBUTE_NAME;
+			} else if (IStyleConstantsCSS.ATTRIBUTE_OPERATOR.equals(prefKey)) {
+				styleKey = IStyleConstantsCSS.ATTRIBUTE_OPERATOR;
+			} else if (IStyleConstantsCSS.ATTRIBUTE_VALUE.equals(prefKey)) {
+				styleKey = IStyleConstantsCSS.ATTRIBUTE_VALUE;
+			} else if (IStyleConstantsCSS.COMBINATOR.equals(prefKey)) {
+				styleKey = IStyleConstantsCSS.COMBINATOR;
 			} else if (IStyleConstantsCSS.PROPERTY_NAME.equals(prefKey)) {
 				styleKey = IStyleConstantsCSS.PROPERTY_NAME;
 			} else if (IStyleConstantsCSS.PROPERTY_VALUE.equals(prefKey)) {
 				styleKey = IStyleConstantsCSS.PROPERTY_VALUE;
 			} else if (IStyleConstantsCSS.SELECTOR.equals(prefKey)) {
 				styleKey = IStyleConstantsCSS.SELECTOR;
+			} else if (IStyleConstantsCSS.UNIVERSAL.equals(prefKey)) {
+				styleKey = IStyleConstantsCSS.UNIVERSAL;
+			} else if (IStyleConstantsCSS.ID.equals(prefKey)) {
+				styleKey = IStyleConstantsCSS.ID;
+			} else if (IStyleConstantsCSS.PSEUDO.equals(prefKey)) {
+				styleKey = IStyleConstantsCSS.PSEUDO;
+			} else if (IStyleConstantsCSS.SELECTOR_CLASS.equals(prefKey)) {
+				styleKey = IStyleConstantsCSS.SELECTOR_CLASS;
 			} else if (IStyleConstantsCSS.SEMI_COLON.equals(prefKey)) {
 				styleKey = IStyleConstantsCSS.SEMI_COLON;
 			} else if (IStyleConstantsCSS.STRING.equals(prefKey)) {
@@ -187,6 +208,15 @@
 		addTextAttribute(IStyleConstantsCSS.PROPERTY_NAME);
 		addTextAttribute(IStyleConstantsCSS.PROPERTY_VALUE);
 		addTextAttribute(IStyleConstantsCSS.SELECTOR);
+		addTextAttribute(IStyleConstantsCSS.UNIVERSAL);
+		addTextAttribute(IStyleConstantsCSS.ATTRIBUTE_DELIM);
+		addTextAttribute(IStyleConstantsCSS.ATTRIBUTE_NAME);
+		addTextAttribute(IStyleConstantsCSS.ATTRIBUTE_OPERATOR);
+		addTextAttribute(IStyleConstantsCSS.ATTRIBUTE_VALUE);
+		addTextAttribute(IStyleConstantsCSS.COMBINATOR);
+		addTextAttribute(IStyleConstantsCSS.ID);
+		addTextAttribute(IStyleConstantsCSS.SELECTOR_CLASS);
+		addTextAttribute(IStyleConstantsCSS.PSEUDO);
 		addTextAttribute(IStyleConstantsCSS.SEMI_COLON);
 		addTextAttribute(IStyleConstantsCSS.STRING);
 		addTextAttribute(IStyleConstantsCSS.URI);
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForEmbeddedCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForEmbeddedCSS.java
index ccdc88a..1428f6d 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForEmbeddedCSS.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForEmbeddedCSS.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,13 +14,16 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.ITypedRegion;
 import org.eclipse.jface.text.TextAttribute;
 import org.eclipse.swt.custom.StyleRange;
 import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
 import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
+import org.eclipse.wst.css.ui.internal.Logger;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 
 public class LineStyleProviderForEmbeddedCSS extends LineStyleProviderForCSS {
 
@@ -29,38 +32,62 @@
 		int regionEnd = regionStart + typedRegion.getLength();
 		IStructuredDocumentRegion wholeRegion = getDocument().getRegionAtCharacterOffset(regionStart);
 
-		List tokens;
-		int offset;
+		if (wholeRegion == null)
+			return false;
 
-		ParserCache cache = getCachedParsingResult(wholeRegion);
+		List tokens = null;
+		int offset = typedRegion.getOffset();
+
+		List cache = getCachedParsingResult(wholeRegion);
 		if (cache == null) {
-			offset = wholeRegion.getStartOffset();
-			String content;
-			content = wholeRegion.getText();
-
-			CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_STYLESHEET, content);
-			tokens = parser.getTokenList();
-			cacheParsingResult(wholeRegion, new ParserCache(offset, tokens));
-		} else {
-			tokens = cache.tokens;
-			offset = cache.offset;
+			try {
+				String content = getDocument().get(typedRegion.getOffset(), typedRegion.getLength());
+				
+				//if region is an XML tag then in CSS style attribute, else in style tag
+ 				int mode;
+				if(wholeRegion.getType() == DOMRegionContext.XML_TAG_NAME) {
+					mode = CSSTextParser.MODE_DECLARATION;
+				} else {
+					mode = CSSTextParser.MODE_STYLESHEET;
+				}
+				
+				CSSTextParser parser = new CSSTextParser(mode, content);
+				tokens = parser.getTokenList();
+				cacheParsingResult(wholeRegion, tokens);
+			} catch (BadLocationException e) {
+				Logger.logException("Given a bad ITypedRegion: " + typedRegion, e);
+			}
+		}
+		else {
+			tokens = cache;
 		}
 
 		boolean result = false;
 
-		if (0 < tokens.size()) {
+		if (tokens != null && 0 < tokens.size()) {
 			int start = offset;
+			int end = start;
 			Iterator i = tokens.iterator();
 			while (i.hasNext()) {
 				CSSTextToken token = (CSSTextToken) i.next();
+				end = start + token.length;
+				int styleLength = token.length;
+				/* The token starts in the region */
 				if (regionStart <= start && start < regionEnd) {
-					TextAttribute attribute = getAttributeFor(token.kind);
-					if (attribute != null) {
-						holdResults.add(new StyleRange(start, token.length, attribute.getForeground(), attribute.getBackground(), attribute.getStyle()));
-					}
-					else {
-						holdResults.add(new StyleRange(start, token.length, null, null));
-					}
+					/* [239415] The region may not span the total length of the token -
+					 * Adjust the length so that it doesn't overlap with other style ranges */
+					if (regionEnd < end)
+						styleLength = regionEnd - start;
+					addStyleRange(holdResults, getAttributeFor(token.kind), start, styleLength);
+				}
+				/* The region starts in the token */
+				else if (start <= regionStart && regionStart < end ) {
+					/* The token may not span the total length of the region */
+					if (end < regionEnd)
+						styleLength = end - regionStart;
+					else /* Bugzilla 282218 */ 
+						styleLength = regionEnd - regionStart;
+					addStyleRange(holdResults, getAttributeFor(token.kind), regionStart, styleLength);
 				}
 				start += token.length;
 			}
@@ -69,6 +96,13 @@
 
 		return result;
 	}
+	
+	private void addStyleRange(Collection holdResults, TextAttribute attribute, int start, int end) {
+		if (attribute != null)
+			holdResults.add(new StyleRange(start, end, attribute.getForeground(), attribute.getBackground(), attribute.getStyle()));
+		else
+			holdResults.add(new StyleRange(start, end, null, null));
+	}
 
 	protected TextAttribute getAttributeFor(ITextRegion region) {
 		return null;
@@ -79,14 +113,14 @@
 		fCacheResult = null;
 	}
 
-	private ParserCache getCachedParsingResult(IStructuredDocumentRegion region) {
+	private List getCachedParsingResult(IStructuredDocumentRegion region) {
 		if (fCacheKey == region.getText().hashCode()) {
 			return fCacheResult;
 		}
 		return null;
 	}
 
-	private void cacheParsingResult(IStructuredDocumentRegion region, ParserCache result) {
+	private void cacheParsingResult(IStructuredDocumentRegion region, List result) {
 		fCacheKey = region.getText().hashCode();
 		fCacheResult = result;
 	}
@@ -96,16 +130,6 @@
 		cleanupCache();
 	}
 
-	private class ParserCache {
-		ParserCache(int newOffset, List newTokens) {
-			offset = newOffset;
-			tokens = newTokens;
-		}
-
-		int offset;
-		List tokens;
-	}
-
 	int fCacheKey = -1;
-	ParserCache fCacheResult = null;
+	List fCacheResult = null;
 }
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/text/CSSCharacterPairInserter.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/text/CSSCharacterPairInserter.java
new file mode 100644
index 0000000..9034f42
--- /dev/null
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/text/CSSCharacterPairInserter.java
@@ -0,0 +1,43 @@
+/*******************************************************************************

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

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

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

+ * which accompanies this distribution, and is available at

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

+ *

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

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

+package org.eclipse.wst.css.ui.internal.text;

+

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

+

+public class CSSCharacterPairInserter extends AbstractCharacterPairInserter {

+

+	public boolean hasPair(char c) {

+		switch (c) {

+			case '"':

+			case '\'':

+			case '[':

+			case '(':

+				return true;

+			default:

+				return false;

+		}

+	}

+

+	protected char getPair(char c) {

+		switch (c) {

+			case '\'':

+			case '"':

+				return c;

+			case '(':

+				return ')';

+			case '[':

+				return ']';

+			default:

+				throw new IllegalArgumentException();

+		}

+	}

+

+}

diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSTemplatesWizardPage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSTemplatesWizardPage.java
index 1100391..220afa4 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSTemplatesWizardPage.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSTemplatesWizardPage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -230,16 +230,10 @@
 		GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
 		innerParent.setLayoutData(gd);
 
-		// Create linked text to just to templates preference page
-		Link link = new Link(innerParent, SWT.NONE);
-		link.setText(CSSUIMessages.NewCSSTemplatesWizardPage_6);
+		Label label = new Label(innerParent, SWT.NONE);
+		label.setText(CSSUIMessages.NewCSSTemplatesWizardPage_7);
 		data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
-		link.setLayoutData(data);
-		link.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				linkClicked();
-			}
-		});
+		label.setLayoutData(data);
 
 		// create table that displays templates
 		Table table = new Table(innerParent, SWT.BORDER | SWT.FULL_SELECTION);
@@ -294,6 +288,17 @@
 		fTemplateStore = CSSUIPlugin.getDefault().getTemplateStore();
 		fTableViewer.setInput(fTemplateStore);
 
+		// Create linked text to just to templates preference page
+		Link link = new Link(parent, SWT.NONE);
+		link.setText(CSSUIMessages.NewCSSTemplatesWizardPage_6);
+		data = new GridData(SWT.END, SWT.FILL, true, false, 2, 1);
+		link.setLayoutData(data);
+		link.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				linkClicked();
+			}
+		});
+
 		configureTableResizing(innerParent, table, column1, column2);
 		loadLastSavedPreferences();
 
@@ -324,7 +329,7 @@
 			}
 		};
 		SourceViewer viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
-		((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+		viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
 		IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForCSS.ContentTypeID_CSS);
 		IDocument document = scratchModel.getStructuredDocument();
 		viewer.configure(sourceViewerConfiguration);
@@ -346,6 +351,8 @@
 		data = new GridData(GridData.FILL_BOTH);
 		data.horizontalSpan = 2;
 		data.heightHint = convertHeightInCharsToPixels(5);
+		// [261274] - source viewer was growing to fit the max line width of the template
+		data.widthHint = convertWidthInCharsToPixels(2);
 		control.setLayoutData(data);
 
 		return viewer;
@@ -436,15 +443,24 @@
 	 * Load the last template name used in New CSS File wizard.
 	 */
 	private void loadLastSavedPreferences() {
+		fLastSelectedTemplateName = ""; //$NON-NLS-1$
+		boolean setSelection = false;
 		String templateName = CSSUIPlugin.getDefault().getPreferenceStore().getString(CSSUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
 		if (templateName == null || templateName.length() == 0) {
-			fLastSelectedTemplateName = ""; //$NON-NLS-1$
-			fUseTemplateButton.setSelection(false);
+			templateName = CSSUIPlugin.getDefault().getPreferenceStore().getString(CSSUIPreferenceNames.NEW_FILE_TEMPLATE_ID);
+			if (templateName != null && templateName.length() > 0) {
+				Template template = fTemplateStore.findTemplateById(templateName);
+				if (template != null) {
+					fLastSelectedTemplateName = template.getName();
+					setSelection = true;
+				}
+			}
 		}
 		else {
 			fLastSelectedTemplateName = templateName;
-			fUseTemplateButton.setSelection(true);
+			setSelection = true;
 		}
+		fUseTemplateButton.setSelection(setSelection);
 		enableTemplates();
 	}
 
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSContentSelectionProvider.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSContentSelectionProvider.java
new file mode 100644
index 0000000..d7f0be7
--- /dev/null
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSContentSelectionProvider.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.css.ui.views.contentoutline;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
+import org.eclipse.wst.sse.ui.IContentSelectionProvider;
+
+class CSSContentSelectionProvider implements IContentSelectionProvider {
+
+	public ISelection getSelection(TreeViewer viewer, ISelection selection) {
+		ISelection filteredSelection = selection;
+		if (selection instanceof IStructuredSelection) {
+			Object[] filteredNodes = getFilteredNodes(((IStructuredSelection) selection).toArray());
+			filteredSelection = new StructuredSelection(filteredNodes);
+		}
+		return filteredSelection;
+	}
+
+	private Object[] getFilteredNodes(Object[] filteredNodes) {
+		for (int i = 0; i < filteredNodes.length; i++) {
+			filteredNodes[i] = getFilteredNode(filteredNodes[i]);
+		}
+		return filteredNodes;
+	}
+
+	private Object getFilteredNode(Object object) {
+		// If the selection is a primitive value, get the property that contains it */
+		if (object instanceof ICSSPrimitiveValue) {
+			ICSSPrimitiveValue value = (ICSSPrimitiveValue) object;
+			object = value.getParentNode();
+		}
+		return object;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSQuickOutlineConfiguration.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSQuickOutlineConfiguration.java
new file mode 100644
index 0000000..d226166
--- /dev/null
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSQuickOutlineConfiguration.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.css.ui.views.contentoutline;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.wst.sse.ui.IContentSelectionProvider;
+import org.eclipse.wst.sse.ui.quickoutline.AbstractQuickOutlineConfiguration;
+
+public class CSSQuickOutlineConfiguration extends AbstractQuickOutlineConfiguration {
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.sse.ui.quickoutline.AbstractQuickOutlineConfiguration#getContentProvider()
+	 */
+	public ITreeContentProvider getContentProvider() {
+		return new JFaceNodeContentProviderCSS();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.sse.ui.quickoutline.AbstractQuickOutlineConfiguration#getContentSelectionProvider()
+	 */
+	public IContentSelectionProvider getContentSelectionProvider() {
+		return new CSSContentSelectionProvider();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.sse.ui.quickoutline.AbstractQuickOutlineConfiguration#getLabelProvider()
+	 */
+	public ILabelProvider getLabelProvider() {
+		return new JFaceNodeLabelProviderCSS();
+	}
+
+}
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 a01867a..f5afc87 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.1.200.qualifier
+Bundle-Version: 1.1.400.qualifier
 Bundle-Activator: org.eclipse.wst.dtd.core.internal.DTDCorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
@@ -30,6 +30,8 @@
  org.eclipse.wst.dtd.core.internal.validation.eclipse;x-internal:=true,
  org.eclipse.wst.dtd.core.text,
  rose
+Import-Package: com.ibm.icu.util; version="3.8",
+ com.ibm.icu.text; version="3.8"
 Require-Bundle: org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
  org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
  org.eclipse.emf.ecore;bundle-version="[2.4.0,3.0.0)",
@@ -38,7 +40,6 @@
  org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
  org.eclipse.wst.sse.core;bundle-version="[1.1.300,1.2.0)",
  org.eclipse.wst.xml.core;bundle-version="[1.1.300,1.2.0)",
- com.ibm.icu;bundle-version="[3.8.1,4.0.0)",
  org.eclipse.wst.validation;bundle-version="[1.2.0,1.3.0)"
 Bundle-ActivationPolicy: lazy; exclude:="org.eclipse.wst.dtd.core.internal.content"
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.dtd.core/about.html b/bundles/org.eclipse.wst.dtd.core/about.html
index 73db36e..2199df3 100644
--- a/bundles/org.eclipse.wst.dtd.core/about.html
+++ b/bundles/org.eclipse.wst.dtd.core/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/DTDImpl.java b/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/DTDImpl.java
index 17180ca..570b062 100644
--- a/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/DTDImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/DTDImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -135,7 +135,7 @@
 			return result;
 		}
 
-		public Adapter adapt(Notifier target) {
+		public synchronized Adapter adapt(Notifier target) {
 			return adapt(target, this);
 		}
 	}
@@ -741,6 +741,7 @@
 			dataTypeNameTable[DTDBasicTypeKind.CDATA] = CMDataType.CDATA;
 			dataTypeNameTable[DTDBasicTypeKind.ID] = CMDataType.ID;
 			dataTypeNameTable[DTDBasicTypeKind.IDREF] = CMDataType.IDREF;
+			dataTypeNameTable[DTDBasicTypeKind.IDREFS] = CMDataType.IDREFS;
 			dataTypeNameTable[DTDBasicTypeKind.ENTITY] = CMDataType.ENTITY;
 			dataTypeNameTable[DTDBasicTypeKind.ENTITIES] = CMDataType.ENTITIES;
 			dataTypeNameTable[DTDBasicTypeKind.NMTOKEN] = CMDataType.NMTOKEN;
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAnyContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAnyContentImpl.java
index 2e81288..3aaeb98 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAnyContentImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAnyContentImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -102,8 +102,8 @@
 	 * @generated
 	 */
 	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
+		if (eContainerFeatureID() >= 0) {
+			switch (eContainerFeatureID()) {
 				case DTDPackage.DTD_ANY_CONTENT__GROUP :
 					return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
 				case DTDPackage.DTD_ANY_CONTENT__ELEMENT :
@@ -112,7 +112,7 @@
 					return eDynamicBasicRemoveFromContainer(msgs);
 			}
 		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
+		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAttributeImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAttributeImpl.java
index a860207..89de883 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAttributeImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAttributeImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -606,7 +606,7 @@
 	 * @generated
 	 */
 	public DTDElement getDTDElement() {
-		if (eContainerFeatureID != DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT)
+		if (eContainerFeatureID() != DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT)
 			return null;
 		return (DTDElement) eContainer;
 	}
@@ -617,7 +617,7 @@
 	 * @generated
 	 */
 	public void setDTDElement(DTDElement newDTDElement) {
-		if (newDTDElement != eContainer || (eContainerFeatureID != DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT && newDTDElement != null)) {
+		if (newDTDElement != eContainer || (eContainerFeatureID() != DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT && newDTDElement != null)) {
 			if (EcoreUtil.isAncestor(this, newDTDElement))
 				throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
 			NotificationChain msgs = null;
@@ -693,15 +693,15 @@
 	 * @generated
 	 */
 	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
+		if (eContainerFeatureID() >= 0) {
+			switch (eContainerFeatureID()) {
 				case DTDPackage.DTD_ATTRIBUTE__DTD_ELEMENT :
 					return eContainer.eInverseRemove(this, DTDPackage.DTD_ELEMENT__DTD_ATTRIBUTE, DTDElement.class, msgs);
 				default :
 					return eDynamicBasicRemoveFromContainer(msgs);
 			}
 		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
+		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDBasicTypeImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDBasicTypeImpl.java
index f7f9a88..ce289b5 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDBasicTypeImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDBasicTypeImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -202,15 +202,15 @@
 	 * @generated
 	 */
 	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
+		if (eContainerFeatureID() >= 0) {
+			switch (eContainerFeatureID()) {
 				case DTDPackage.DTD_BASIC_TYPE__EPACKAGE :
 					return eContainer.eInverseRemove(this, EcorePackage.EPACKAGE__ECLASSIFIERS, EPackage.class, msgs);
 				default :
 					return eDynamicBasicRemoveFromContainer(msgs);
 			}
 		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
+		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDContentImpl.java
index b6147cd..cb185d0 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDContentImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDContentImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -50,7 +50,7 @@
 	 * @generated
 	 */
 	public DTDFile getDTDFile() {
-		if (eContainerFeatureID != DTDPackage.DTD_CONTENT__DTD_FILE)
+		if (eContainerFeatureID() != DTDPackage.DTD_CONTENT__DTD_FILE)
 			return null;
 		return (DTDFile) eContainer;
 	}
@@ -61,7 +61,7 @@
 	 * @generated
 	 */
 	public void setDTDFile(DTDFile newDTDFile) {
-		if (newDTDFile != eContainer || (eContainerFeatureID != DTDPackage.DTD_CONTENT__DTD_FILE && newDTDFile != null)) {
+		if (newDTDFile != eContainer || (eContainerFeatureID() != DTDPackage.DTD_CONTENT__DTD_FILE && newDTDFile != null)) {
 			if (EcoreUtil.isAncestor(this, newDTDFile))
 				throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
 			NotificationChain msgs = null;
@@ -121,15 +121,15 @@
 	 * @generated
 	 */
 	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
+		if (eContainerFeatureID() >= 0) {
+			switch (eContainerFeatureID()) {
 				case DTDPackage.DTD_CONTENT__DTD_FILE :
 					return eContainer.eInverseRemove(this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDFile.class, msgs);
 				default :
 					return eDynamicBasicRemoveFromContainer(msgs);
 			}
 		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
+		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementContentImpl.java
index 7c66948..b5e767c 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementContentImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementContentImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -187,7 +187,7 @@
 	 * @generated
 	 */
 	public DTDGroupContent getGroup() {
-		if (eContainerFeatureID != DTDPackage.DTD_ELEMENT_CONTENT__GROUP)
+		if (eContainerFeatureID() != DTDPackage.DTD_ELEMENT_CONTENT__GROUP)
 			return null;
 		return (DTDGroupContent) eContainer;
 	}
@@ -198,7 +198,7 @@
 	 * @generated
 	 */
 	public void setGroup(DTDGroupContent newGroup) {
-		if (newGroup != eContainer || (eContainerFeatureID != DTDPackage.DTD_ELEMENT_CONTENT__GROUP && newGroup != null)) {
+		if (newGroup != eContainer || (eContainerFeatureID() != DTDPackage.DTD_ELEMENT_CONTENT__GROUP && newGroup != null)) {
 			if (EcoreUtil.isAncestor(this, newGroup))
 				throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
 			NotificationChain msgs = null;
@@ -220,7 +220,7 @@
 	 * @generated
 	 */
 	public DTDElement getElement() {
-		if (eContainerFeatureID != DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT)
+		if (eContainerFeatureID() != DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT)
 			return null;
 		return (DTDElement) eContainer;
 	}
@@ -231,7 +231,7 @@
 	 * @generated
 	 */
 	public void setElement(DTDElement newElement) {
-		if (newElement != eContainer || (eContainerFeatureID != DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT && newElement != null)) {
+		if (newElement != eContainer || (eContainerFeatureID() != DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT && newElement != null)) {
 			if (EcoreUtil.isAncestor(this, newElement))
 				throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
 			NotificationChain msgs = null;
@@ -297,8 +297,8 @@
 	 * @generated
 	 */
 	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
+		if (eContainerFeatureID() >= 0) {
+			switch (eContainerFeatureID()) {
 				case DTDPackage.DTD_ELEMENT_CONTENT__GROUP :
 					return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
 				case DTDPackage.DTD_ELEMENT_CONTENT__ELEMENT :
@@ -307,7 +307,7 @@
 					return eDynamicBasicRemoveFromContainer(msgs);
 			}
 		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
+		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementImpl.java
index 4a274d7..adf0b93 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -339,8 +339,8 @@
 	 * @generated
 	 */
 	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
+		if (eContainerFeatureID() >= 0) {
+			switch (eContainerFeatureID()) {
 				case DTDPackage.DTD_ELEMENT__EPACKAGE :
 					return eContainer.eInverseRemove(this, EcorePackage.EPACKAGE__ECLASSIFIERS, EPackage.class, msgs);
 				case DTDPackage.DTD_ELEMENT__DTD_FILE :
@@ -349,7 +349,7 @@
 					return eDynamicBasicRemoveFromContainer(msgs);
 			}
 		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
+		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
 	}
 
 	/**
@@ -626,7 +626,7 @@
 	 * @generated This field/method will be replaced during code generation.
 	 */
 	public DTDFile getDTDFile() {
-		if (eContainerFeatureID != DTDPackage.DTD_ELEMENT__DTD_FILE)
+		if (eContainerFeatureID() != DTDPackage.DTD_ELEMENT__DTD_FILE)
 			return null;
 		return (DTDFile) eContainer;
 	}
@@ -635,7 +635,7 @@
 	 * @generated This field/method will be replaced during code generation.
 	 */
 	public void setDTDFile(DTDFile newDTDFile) {
-		if (newDTDFile != eContainer || (eContainerFeatureID != DTDPackage.DTD_ELEMENT__DTD_FILE && newDTDFile != null)) {
+		if (newDTDFile != eContainer || (eContainerFeatureID() != DTDPackage.DTD_ELEMENT__DTD_FILE && newDTDFile != null)) {
 			if (EcoreUtil.isAncestor(this, newDTDFile))
 				throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
 			NotificationChain msgs = null;
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementReferenceContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementReferenceContentImpl.java
index cbd9933..b81f4c4 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementReferenceContentImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementReferenceContentImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -146,8 +146,8 @@
 	 * @generated
 	 */
 	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
+		if (eContainerFeatureID() >= 0) {
+			switch (eContainerFeatureID()) {
 				case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__GROUP :
 					return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
 				case DTDPackage.DTD_ELEMENT_REFERENCE_CONTENT__ELEMENT :
@@ -156,7 +156,7 @@
 					return eDynamicBasicRemoveFromContainer(msgs);
 			}
 		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
+		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEmptyContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEmptyContentImpl.java
index 8689c51..d87ef09 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEmptyContentImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEmptyContentImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -88,8 +88,8 @@
 	 * @generated
 	 */
 	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
+		if (eContainerFeatureID() >= 0) {
+			switch (eContainerFeatureID()) {
 				case DTDPackage.DTD_EMPTY_CONTENT__GROUP :
 					return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
 				case DTDPackage.DTD_EMPTY_CONTENT__ELEMENT :
@@ -98,7 +98,7 @@
 					return eDynamicBasicRemoveFromContainer(msgs);
 			}
 		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
+		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityContentImpl.java
index 2617d33..2bf7ee0 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityContentImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityContentImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -55,7 +55,7 @@
 	 * @generated This field/method will be replaced during code generation
 	 */
 	public DTDEntity getDTDEntity() {
-		if (eContainerFeatureID != DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY)
+		if (eContainerFeatureID() != DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY)
 			return null;
 		return (DTDEntity) eContainer;
 	}
@@ -64,7 +64,7 @@
 	 * @generated This field/method will be replaced during code generation.
 	 */
 	public void setDTDEntity(DTDEntity newDTDEntity) {
-		if (newDTDEntity != eContainer || (eContainerFeatureID != DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY && newDTDEntity != null)) {
+		if (newDTDEntity != eContainer || (eContainerFeatureID() != DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY && newDTDEntity != null)) {
 			if (EcoreUtil.isAncestor(this, newDTDEntity))
 				throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
 			NotificationChain msgs = null;
@@ -124,15 +124,15 @@
 	 * @generated
 	 */
 	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
+		if (eContainerFeatureID() >= 0) {
+			switch (eContainerFeatureID()) {
 				case DTDPackage.DTD_ENTITY_CONTENT__DTD_ENTITY :
 					return eContainer.eInverseRemove(this, DTDPackage.DTD_ENTITY__CONTENT, DTDEntity.class, msgs);
 				default :
 					return eDynamicBasicRemoveFromContainer(msgs);
 			}
 		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
+		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityImpl.java
index b3f7963..11d0742 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -501,15 +501,15 @@
 	 * @generated
 	 */
 	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
+		if (eContainerFeatureID() >= 0) {
+			switch (eContainerFeatureID()) {
 				case DTDPackage.DTD_ENTITY__DTD_FILE :
 					return eContainer.eInverseRemove(this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDFile.class, msgs);
 				default :
 					return eDynamicBasicRemoveFromContainer(msgs);
 			}
 		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
+		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityReferenceContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityReferenceContentImpl.java
index 3e97fff..51fde41 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityReferenceContentImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityReferenceContentImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -227,8 +227,8 @@
 	 * @generated
 	 */
 	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
+		if (eContainerFeatureID() >= 0) {
+			switch (eContainerFeatureID()) {
 				case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__GROUP :
 					return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
 				case DTDPackage.DTD_ENTITY_REFERENCE_CONTENT__ELEMENT :
@@ -237,7 +237,7 @@
 					return eDynamicBasicRemoveFromContainer(msgs);
 			}
 		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
+		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEnumerationTypeImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEnumerationTypeImpl.java
index a93f653..8e604b9 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEnumerationTypeImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEnumerationTypeImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -121,7 +121,7 @@
 	 * @generated This field/method will be replaced during code generation
 	 */
 	public DTDFile getDTDFile() {
-		if (eContainerFeatureID != DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE)
+		if (eContainerFeatureID() != DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE)
 			return null;
 		return (DTDFile) eContainer;
 	}
@@ -130,7 +130,7 @@
 	 * @generated This field/method will be replaced during code generation.
 	 */
 	public void setDTDFile(DTDFile newDTDFile) {
-		if (newDTDFile != eContainer || (eContainerFeatureID != DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE && newDTDFile != null)) {
+		if (newDTDFile != eContainer || (eContainerFeatureID() != DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE && newDTDFile != null)) {
 			if (EcoreUtil.isAncestor(this, newDTDFile))
 				throw new IllegalArgumentException("Recursive containment not allowed for " + toString() + "."); //$NON-NLS-1$ //$NON-NLS-2$
 			NotificationChain msgs = null;
@@ -204,8 +204,8 @@
 	 * @generated
 	 */
 	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
+		if (eContainerFeatureID() >= 0) {
+			switch (eContainerFeatureID()) {
 				case DTDPackage.DTD_ENUMERATION_TYPE__EPACKAGE :
 					return eContainer.eInverseRemove(this, EcorePackage.EPACKAGE__ECLASSIFIERS, EPackage.class, msgs);
 				case DTDPackage.DTD_ENUMERATION_TYPE__DTD_FILE :
@@ -214,7 +214,7 @@
 					return eDynamicBasicRemoveFromContainer(msgs);
 			}
 		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
+		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDExternalEntityImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDExternalEntityImpl.java
index 7bb5d03..69bd4c4 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDExternalEntityImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDExternalEntityImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -278,15 +278,15 @@
 	 * @generated
 	 */
 	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
+		if (eContainerFeatureID() >= 0) {
+			switch (eContainerFeatureID()) {
 				case DTDPackage.DTD_EXTERNAL_ENTITY__DTD_ENTITY :
 					return eContainer.eInverseRemove(this, DTDPackage.DTD_ENTITY__CONTENT, DTDEntity.class, msgs);
 				default :
 					return eDynamicBasicRemoveFromContainer(msgs);
 			}
 		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
+		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDGroupContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDGroupContentImpl.java
index 44e021e..b2a8236 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDGroupContentImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDGroupContentImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -173,8 +173,8 @@
 	 * @generated
 	 */
 	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
+		if (eContainerFeatureID() >= 0) {
+			switch (eContainerFeatureID()) {
 				case DTDPackage.DTD_GROUP_CONTENT__GROUP :
 					return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
 				case DTDPackage.DTD_GROUP_CONTENT__ELEMENT :
@@ -183,7 +183,7 @@
 					return eDynamicBasicRemoveFromContainer(msgs);
 			}
 		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
+		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDInternalEntityImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDInternalEntityImpl.java
index 1d47e55..1e36173 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDInternalEntityImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDInternalEntityImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,7 +12,7 @@
 package org.eclipse.wst.dtd.core.internal.emf.impl;
 
 import java.text.CharacterIterator;
-import com.ibm.icu.text.StringCharacterIterator;
+import java.text.StringCharacterIterator;
 
 import org.eclipse.emf.common.notify.Notification;
 import org.eclipse.emf.common.notify.NotificationChain;
@@ -153,7 +153,7 @@
 	 * @generated
 	 */
 	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
+		if (eContainerFeatureID() >= 0) {
 			switch (eContainerFeatureID) {
 				case DTDPackage.DTD_INTERNAL_ENTITY__DTD_ENTITY :
 					return eContainer.eInverseRemove(this, DTDPackage.DTD_ENTITY__CONTENT, DTDEntity.class, msgs);
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDNotationImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDNotationImpl.java
index 47ec928..b4374cc 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDNotationImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDNotationImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -313,15 +313,15 @@
 	 * @generated
 	 */
 	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
+		if (eContainerFeatureID() >= 0) {
+			switch (eContainerFeatureID()) {
 				case DTDPackage.DTD_NOTATION__DTD_FILE :
 					return eContainer.eInverseRemove(this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDFile.class, msgs);
 				default :
 					return eDynamicBasicRemoveFromContainer(msgs);
 			}
 		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
+		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDPCDataContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDPCDataContentImpl.java
index e8c00f0..16aedaf 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDPCDataContentImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDPCDataContentImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -88,8 +88,8 @@
 	 * @generated
 	 */
 	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
+		if (eContainerFeatureID() >= 0) {
+			switch (eContainerFeatureID()) {
 				case DTDPackage.DTD_PC_DATA_CONTENT__GROUP :
 					return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
 				case DTDPackage.DTD_PC_DATA_CONTENT__ELEMENT :
@@ -98,7 +98,7 @@
 					return eDynamicBasicRemoveFromContainer(msgs);
 			}
 		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
+		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDParameterEntityReferenceImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDParameterEntityReferenceImpl.java
index e1e26be..58fd1c4 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDParameterEntityReferenceImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDParameterEntityReferenceImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -245,15 +245,15 @@
 	 * @generated
 	 */
 	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
+		if (eContainerFeatureID() >= 0) {
+			switch (eContainerFeatureID()) {
 				case DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__DTD_FILE :
 					return eContainer.eInverseRemove(this, DTDPackage.DTD_FILE__DTD_CONTENT, DTDFile.class, msgs);
 				default :
 					return eDynamicBasicRemoveFromContainer(msgs);
 			}
 		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
+		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDRepeatableContentImpl.java b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDRepeatableContentImpl.java
index c8f227c..4ed8dbc 100644
--- a/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDRepeatableContentImpl.java
+++ b/bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDRepeatableContentImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -153,8 +153,8 @@
 	 * @generated
 	 */
 	public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
-		if (eContainerFeatureID >= 0) {
-			switch (eContainerFeatureID) {
+		if (eContainerFeatureID() >= 0) {
+			switch (eContainerFeatureID()) {
 				case DTDPackage.DTD_REPEATABLE_CONTENT__GROUP :
 					return eContainer.eInverseRemove(this, DTDPackage.DTD_GROUP_CONTENT__CONTENT, DTDGroupContent.class, msgs);
 				case DTDPackage.DTD_REPEATABLE_CONTENT__ELEMENT :
@@ -163,7 +163,7 @@
 					return eDynamicBasicRemoveFromContainer(msgs);
 			}
 		}
-		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
+		return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID(), null, msgs);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.dtd.core/plugin.properties b/bundles/org.eclipse.wst.dtd.core/plugin.properties
index 33740d0..2c8c78b 100644
--- a/bundles/org.eclipse.wst.dtd.core/plugin.properties
+++ b/bundles/org.eclipse.wst.dtd.core/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2008 IBM Corporation and others.
+# Copyright (c) 2001, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -11,11 +11,11 @@
 #     
 ###############################################################################
 
-providerName=Eclipse.org
+providerName=Eclipse Web Tools Platform
 pluginName=Structured Source DTD Core
 #
 Structured_DTD_Document_Factory_Extension.name=Structured DTD Document Factory Extension
 DTD_Content_Type_Extension_Element.name=DTD
 _DTD_VALIDATOR_NAME               = DTD Validator
 _validationMarker.name=DTD Problem
-_taskMarker.name=DTD Task
\ No newline at end of file
+_taskMarker.name=DTD Task
diff --git a/bundles/org.eclipse.wst.dtd.core/plugin.xml b/bundles/org.eclipse.wst.dtd.core/plugin.xml
index 09c83b4..488a0f5 100644
--- a/bundles/org.eclipse.wst.dtd.core/plugin.xml
+++ b/bundles/org.eclipse.wst.dtd.core/plugin.xml
@@ -52,7 +52,7 @@
 			extension="ent" />
 	</extension>
 
-	<extension point="org.eclipse.core.runtime.contentTypes">
+	<extension point="org.eclipse.core.contenttype.contentTypes">
 		<content-type
 			file-extensions="dtd,mod,ent"
 			priority="normal"
@@ -100,30 +100,27 @@
 	</extension>
 	
 	<!-- ====================================================== -->
-	<!-- Register the DTD validator with the validation 		-->
+	<!-- Register the DTD validator with the (new) validation   -->
 	<!-- framework. 										    -->
 	<!-- ====================================================== -->
-	<extension
-		id="dtdDTDValidator"
-		name="%_DTD_VALIDATOR_NAME"
-		point="org.eclipse.wst.validation.validator">
-		<validator>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				caseSensitive="false"
-				nameFilter="*.dtd">
-			</filter>
-         	<contentTypeBinding contentTypeId="org.eclipse.wst.dtd.core.dtdsource"/>
-			<helper class="org.eclipse.wst.xml.core.internal.validation.core.Helper"/>
-			<run
-				async="true"
-         		class="org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator"
-         		enabled="true"
-         		fullBuild="true"
-         		incremental="true"/>
-         <markerId markerIdValue="org.eclipse.wst.dtd.core.validationMarker"/>
+   <extension id="dtdDTDValidator" name="%_DTD_VALIDATOR_NAME" point="org.eclipse.wst.validation.validatorV2">
+      <validator
+            build="true"
+            class="org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator"
+            manual="true"
+            sourceid="org.eclipse.wst.dtd.dtdsourcevalidator"
+            version="1"
+            markerId="org.eclipse.wst.dtd.core.validationMarker">
+         <include>
+            <rules>
+               <contentType id="org.eclipse.wst.dtd.core.dtdsource"/>
+               <fileext caseSensitive="false" ext="dtd"/>
+               <fileext caseSensitive="false" ext="ent"/>
+               <fileext caseSensitive="false" ext="mod"/>
+            </rules>
+         </include>
       </validator>
-	</extension>
+   </extension>
 
 	<!-- ====================================================== -->
 	<!-- DTD as you type validation								-->
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDFile.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDFile.java
index 5bcf031..615d1ed 100644
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDFile.java
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDFile.java
@@ -8,6 +8,9 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     Hajime Katayama  - bug 245216 - correction to get the best node when the ending
+ *                                     and starting offsets are equal, and they both
+ *                                     contain the offset range.
  *     
  *******************************************************************************/
 package org.eclipse.wst.dtd.core.internal;
@@ -378,13 +381,20 @@
 	}
 
 	public DTDNode getTopLevelNodeAt(int offset) {
+		DTDNode bestNode = null;
 		for (int i = 0; i < nodeList.size(); i++) {
 			DTDNode node = (DTDNode) nodeList.get(i);
 			if (node.contains(offset)) {
-				return node;
+				if(bestNode == null) {
+					bestNode = node;
+				} else {
+					if(node.getStartOffset() > bestNode.getStartOffset()) {
+						bestNode = node;
+					}
+				}
 			}
 		}
-		return null;
+		return bestNode;
 	}
 
 	public NodeList getUnrecognized() {
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/StructuredTextPartitionerForDTD.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/StructuredTextPartitionerForDTD.java
index 6eda06d..142bd4f 100644
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/StructuredTextPartitionerForDTD.java
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/StructuredTextPartitionerForDTD.java
@@ -12,6 +12,7 @@
  *******************************************************************************/
 package org.eclipse.wst.dtd.core.internal.text;
 
+import org.eclipse.jface.text.IDocumentPartitioner;
 import org.eclipse.wst.dtd.core.text.IDTDPartitions;
 import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
 import org.eclipse.wst.sse.core.text.IStructuredPartitions;
@@ -39,4 +40,11 @@
 	protected void initLegalContentTypes() {
 		fSupportedTypes = new String[]{IDTDPartitions.DTD_DEFAULT, IStructuredPartitions.UNKNOWN_PARTITION};
 	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner#newInstance()
+	 */
+	public IDocumentPartitioner newInstance() {
+		return new StructuredTextPartitionerForDTD();
+	}
 }
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 d32f973..059ff61 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.300.qualifier
+Bundle-Version: 1.0.500.qualifier
 Bundle-Activator: org.eclipse.wst.dtd.ui.internal.DTDUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
@@ -21,6 +21,8 @@
  org.eclipse.wst.dtd.ui.internal.views.properties;x-internal:=true,
  org.eclipse.wst.dtd.ui.internal.wizard;x-internal:=true,
  org.eclipse.wst.dtd.ui.views.contentoutline
+Import-Package: com.ibm.icu.util; version="3.8",
+ com.ibm.icu.text; version="3.8"
 Require-Bundle: org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
  org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
  org.eclipse.jface.text;bundle-version="[3.4.0,4.0.0)",
@@ -29,12 +31,10 @@
  org.eclipse.wst.common.ui;bundle-version="[1.1.301,1.2.0)",
  org.eclipse.wst.dtd.core;bundle-version="[1.1.200,1.2.0)",
  org.eclipse.wst.sse.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.1.0,1.2.0)",
+ org.eclipse.wst.sse.ui;bundle-version="[1.2.0,1.3.0)",
  org.eclipse.wst.xml.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.0.400,1.1.0)",
- org.eclipse.wst.common.ui;bundle-version="[1.1.301,1.2.0)",
+ org.eclipse.wst.xml.ui;bundle-version="[1.0.400,1.2.0)",
  org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
- org.eclipse.ui.views.properties.tabbed;bundle-version="[3.4.0,4.0.0)",
- com.ibm.icu;bundle-version="[3.8.1,4.0.0)"
+ org.eclipse.ui.views.properties.tabbed;bundle-version="[3.4.0,4.0.0)"
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.dtd.ui/about.html b/bundles/org.eclipse.wst.dtd.ui/about.html
index 73db36e..2199df3 100644
--- a/bundles/org.eclipse.wst.dtd.ui/about.html
+++ b/bundles/org.eclipse.wst.dtd.ui/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/bundles/org.eclipse.wst.dtd.ui/build.properties b/bundles/org.eclipse.wst.dtd.ui/build.properties
index 0579e83..8f38fb6 100644
--- a/bundles/org.eclipse.wst.dtd.ui/build.properties
+++ b/bundles/org.eclipse.wst.dtd.ui/build.properties
@@ -24,4 +24,3 @@
                temp.folder/**
 source.. = src/,\
            src-properties/
-src.includes = build.properties
diff --git a/bundles/org.eclipse.wst.dtd.ui/plugin.properties b/bundles/org.eclipse.wst.dtd.ui/plugin.properties
index 410db75..4304acc 100644
--- a/bundles/org.eclipse.wst.dtd.ui/plugin.properties
+++ b/bundles/org.eclipse.wst.dtd.ui/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2007 IBM Corporation and others.
+# Copyright (c) 2001, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -13,7 +13,7 @@
 ! Properties file for component: XMDTD - XML Tools DTD Editor
 ! Packaged for translation in:  xml.zip
 
-providerName=Eclipse.org
+providerName=Eclipse Web Tools Platform
 pluginName=SSE DTD Source Editor
 
 DTD_Source_Page_Editor.name=DTD Editor
@@ -50,3 +50,13 @@
 preferenceKeywords.files=editor dtd creating files suffix specified
 preferenceKeywords.templates=editor dtd templates snippet macros
 preferenceKeywords.styles=editor dtd style customize syntax highlighting type text content foreground background bold color
+
+Colors.dtdDefault=DTD Default
+Colors.dtdTag=DTD Tag
+Colors.dtdTagName=DTD Tag Name
+Colors.dtdComment=DTD Comment
+Colors.dtdKeyword=DTD Keyword
+Colors.dtdString=DTD String
+Colors.dtdData=DTD Data
+Colors.dtdSymbol=DTD Symbol
+			
diff --git a/bundles/org.eclipse.wst.dtd.ui/plugin.xml b/bundles/org.eclipse.wst.dtd.ui/plugin.xml
index 8d17761..86729bd 100644
--- a/bundles/org.eclipse.wst.dtd.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.dtd.ui/plugin.xml
@@ -27,12 +27,10 @@
 			type="characterpairmatcher"
 			class="org.eclipse.wst.dtd.ui.internal.text.DTDDocumentRegionEdgeMatcher"
 			target="org.eclipse.wst.dtd.core.dtdsource" />
-		<!-- comment out till able to improve dtd folding
 		<provisionalConfiguration
-			type="structuredtextfoldingprovider"
-			class="org.eclipse.wst.dtd.ui.internal.projection.StructuredTextFoldingProviderDTD"
+			type="foldingstrategy"
+			class="org.eclipse.wst.dtd.ui.internal.projection.DTDFoldingStrategy"
 			target="org.eclipse.wst.dtd.core.dtdsource" />
-		-->
 		<provisionalDefinition
 			type="preferencepages"
 			value="org.eclipse.wst.dtd.ui.preferences.dtd, org.eclipse.wst.sse.ui.preferences.dtd.templates, org.eclipse.wst.sse.ui.preferences.dtd.styles"
@@ -384,4 +382,121 @@
 	 </propertySection>
   </propertySections>
 </extension>
+
+	<!-- Define theme -->
+	<extension
+		point="org.eclipse.ui.themes">
+		<theme
+			id="org.eclipse.ui.ide.systemDefault">
+			<colorOverride
+				id="dtdDefault"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="dtdTag"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="dtdTagName"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="dtdComment"
+				value="COLOR_LIST_SELECTION">
+			</colorOverride>
+			<colorOverride
+				id="dtdKeyword"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="dtdString"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="dtdData"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="dtdSymbol"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+		</theme>
+		<colorDefinition
+			id="dtdDefault"
+			isEditable="false"
+			label="%Colors.dtdDefault"
+			value="0, 0, 0">
+		</colorDefinition>
+		<colorDefinition
+			id="dtdTag"
+			isEditable="false"
+			label="%Colors.dtdTag"
+			value="63, 63, 191">
+		</colorDefinition>
+		<colorDefinition
+			id="dtdTagName"
+			isEditable="false"
+			label="%Colors.dtdTagName"
+			value="63, 63, 191">
+		</colorDefinition>
+		<colorDefinition
+			id="dtdComment"
+			isEditable="false"
+			label="%Colors.dtdComment"
+			value="127, 127, 127">
+		</colorDefinition>
+		<colorDefinition
+			id="dtdKeyword"
+			isEditable="false"
+			label="%Colors.dtdKeyword"
+			value="128, 0, 0">
+		</colorDefinition>
+		<colorDefinition
+			id="dtdString"
+			isEditable="false"
+			label="%Colors.dtdString"
+			value="63, 159, 95">
+		</colorDefinition>
+		<colorDefinition
+			id="dtdData"
+			isEditable="false"
+			label="%Colors.dtdData"
+			value="191, 95, 95">
+		</colorDefinition>
+		<colorDefinition
+			id="dtdSymbol"
+			isEditable="false"
+			label="%Colors.dtdSymbol"
+			value="128, 0, 0">
+		</colorDefinition>
+	</extension>
+
+ <extension point="org.eclipse.ui.menus">
+	<menuContribution locationURI="toolbar:org.eclipse.wst.xml.ui.perspective.NewFileToolBar">
+        <command
+              commandId="org.eclipse.ui.newWizard"
+              icon="icons/full/etool16/newdtd_wiz.gif"
+              id="org.eclipse.wst.dtd.ui.newDTDFile"
+              style="push"
+              tooltip="%DTD_New_context_type_Extension_Element.name">
+             <parameter name="newWizardId" value="org.eclipse.wst.dtd.ui.internal.wizard.NewDTDWizard"/>
+          <visibleWhen checkEnabled="false">
+			<with variable="activeWorkbenchWindow.activePerspective">
+				<equals value="org.eclipse.wst.xml.ui.perspective"/>
+			</with>
+           </visibleWhen>         
+        </command>
+     </menuContribution>
+  </extension>
+
+ <extension point="org.eclipse.ui.navigator.navigatorContent">
+	<commonWizard type="new" wizardId="org.eclipse.wst.dtd.ui.internal.wizard.NewDTDWizard" menuGroupId="org.eclipse.wst.xml.new.menuGroup">
+		<enablement>
+			<instanceof value="org.eclipse.core.resources.IResource"/>
+			<with variable="activeWorkbenchWindow.activePerspective">
+			   <equals value="org.eclipse.wst.xml.ui.perspective"/>
+			</with>
+		</enablement>
+	</commonWizard>
+ </extension>
 </plugin>
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIMessages.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIMessages.java
index fc77591..710f2c7 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIMessages.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIMessages.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -65,6 +65,7 @@
 	public static String NewDTDTemplatesWizardPage_4;
 	public static String NewDTDTemplatesWizardPage_5;
 	public static String NewDTDTemplatesWizardPage_6;
+	public static String NewDTDTemplatesWizardPage_7;
 	public static String SyntaxColoringPage_0;
 	public static String SyntaxColoringPage_2;
 	public static String SyntaxColoringPage_3;
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPluginResources.properties b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPluginResources.properties
index d4ae96c..26a34c6 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPluginResources.properties
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/DTDUIPluginResources.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2005, 2008 IBM Corporation and others.
+# Copyright (c) 2005, 2009 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -72,9 +72,10 @@
 NewDTDTemplatesWizardPage_1=Select a template as initial content in the DTD page.
 NewDTDTemplatesWizardPage_2=Name
 NewDTDTemplatesWizardPage_3=Description
-NewDTDTemplatesWizardPage_4=Use DTD Template
-NewDTDTemplatesWizardPage_5=Preview:
+NewDTDTemplatesWizardPage_4=&Use DTD Template
+NewDTDTemplatesWizardPage_5=&Preview:
 NewDTDTemplatesWizardPage_6=Templates are 'New DTD' templates found in the <a>DTD Templates</a> preference page.
+NewDTDTemplatesWizardPage_7=&Templates:
 
 SourceMenu_label=Source
 
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDTemplatePreferencePage.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDTemplatePreferencePage.java
index 8cca387..29ffd77 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDTemplatePreferencePage.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDTemplatePreferencePage.java
@@ -135,7 +135,7 @@
 		SourceViewer viewer = null;
 		String contentTypeID = ContentTypeIdForDTD.ContentTypeID_DTD;
 		viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
-		((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+		viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
 		IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(contentTypeID);
 		IDocument document = scratchModel.getStructuredDocument();
 		viewer.configure(viewerConfiguration);
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceInitializer.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceInitializer.java
index 66bb95c..3f6f2c6 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceInitializer.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/preferences/DTDUIPreferenceInitializer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,6 +13,9 @@
 
 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
 import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.ColorRegistry;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.ui.PlatformUI;
 import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
 import org.eclipse.wst.dtd.ui.internal.style.IStyleConstantsDTD;
 import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
@@ -29,33 +32,46 @@
 	 */
 	public void initializeDefaultPreferences() {
 		IPreferenceStore store = DTDUIPlugin.getDefault().getPreferenceStore();
-
+		ColorRegistry registry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
+		
 		// DTD Style Preferences
 		String NOBACKGROUNDBOLD = " | null | false"; //$NON-NLS-1$
 		String JUSTITALIC = " | null | false | true"; //$NON-NLS-1$
-		String styleValue = ColorHelper.getColorString(0, 0, 0) + NOBACKGROUNDBOLD;
+		String styleValue = ColorHelper.findRGBString(registry, IStyleConstantsDTD.DTD_DEFAULT, 0, 0, 0) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsDTD.DTD_DEFAULT, styleValue); // black
 
-		styleValue = ColorHelper.getColorString(63, 63, 191) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsDTD.DTD_TAG, 63, 63, 191) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsDTD.DTD_TAG, styleValue); // blue
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsDTD.DTD_TAGNAME, 63, 63, 191) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsDTD.DTD_TAGNAME, styleValue); // blue
 
-		styleValue = ColorHelper.getColorString(127, 127, 127) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsDTD.DTD_COMMENT, 127, 127, 127) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsDTD.DTD_COMMENT, styleValue); // grey
 
-		styleValue = ColorHelper.getColorString(128, 0, 0) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsDTD.DTD_KEYWORD, 128, 0, 0) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsDTD.DTD_KEYWORD, styleValue); // dark
 		// red
 
-		styleValue = ColorHelper.getColorString(63, 159, 95) + JUSTITALIC;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsDTD.DTD_STRING, 63, 159, 95) + JUSTITALIC;
 		store.setDefault(IStyleConstantsDTD.DTD_STRING, styleValue); // green
 
-		styleValue = ColorHelper.getColorString(191, 95, 95) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsDTD.DTD_DATA, 191, 95, 95) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsDTD.DTD_DATA, styleValue); // light
 		// red
 
-		styleValue = ColorHelper.getColorString(128, 0, 0) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsDTD.DTD_SYMBOL, 128, 0, 0) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsDTD.DTD_SYMBOL, styleValue); // dark
 		// red
+
+		// set default new xml file template to use in new file wizard
+		/*
+		 * Need to find template name that goes with default template id (name
+		 * may change for differnt language)
+		 */
+		String templateName = ""; //$NON-NLS-1$
+		Template template = DTDUIPlugin.getDefault().getTemplateStore().findTemplateById("org.eclipse.wst.dtd.ui.internal.templates.xmldeclaration"); //$NON-NLS-1$
+		if (template != null)
+			templateName = template.getName();
+		store.setDefault(DTDUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
 	}
 }
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/projection/DTDFoldingStrategy.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/projection/DTDFoldingStrategy.java
new file mode 100644
index 0000000..adc0739
--- /dev/null
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/projection/DTDFoldingStrategy.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.dtd.ui.internal.projection;
+
+import org.eclipse.jface.text.Position;
+import org.eclipse.wst.dtd.core.internal.Comment;
+import org.eclipse.wst.dtd.core.internal.DTDNode;
+import org.eclipse.wst.dtd.core.internal.Unrecognized;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy;
+import org.eclipse.wst.xml.ui.internal.projection.XMLCommentFoldingPosition;
+import org.eclipse.wst.xml.ui.internal.projection.XMLElementFoldingPosition;
+
+
+/**
+ * A folding strategy for DTD structured documents.
+ * See AbstractStructuredFoldingStrategy for more details.
+ * 
+ * This strategy is rather lame because the DTD parser does not
+ * create regions for syntax such as <[ ]> so folding on it
+ * can not currently occur.
+ */
+public class DTDFoldingStrategy extends AbstractStructuredFoldingStrategy {
+
+	/**
+	 * Create an instance of the folding strategy.
+	 * Be sure to set the viewer and document after creation.
+	 */
+	public DTDFoldingStrategy() {
+		super();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.projection.AbstractFoldingStrategy#calcNewFoldPosition(org.eclipse.wst.sse.core.internal.provisional.IndexedRegion)
+	 */
+	protected Position calcNewFoldPosition(IndexedRegion indexedRegion) {
+		Position newPos = null;
+		
+		//only want to fold regions with a valid range
+		if(indexedRegion.getStartOffset() >= 0 && indexedRegion.getLength() >= 0) {
+			IStructuredDocumentRegion structRegion = ((DTDNode) indexedRegion).getStructuredDTDDocumentRegion();
+			//if Comment then use comment folding position
+			//else use element folding position
+			if(indexedRegion instanceof Comment) {
+				newPos = new XMLCommentFoldingPosition(structRegion);
+			} else {
+				newPos = new XMLElementFoldingPosition(structRegion);
+			}
+		}
+		return newPos;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.projection.AbstractFoldingStrategy#indexedRegionValidType(org.eclipse.wst.sse.core.internal.provisional.IndexedRegion)
+	 */
+	protected boolean indexedRegionValidType(IndexedRegion indexedRegion) {
+		//can only fold DTDNodes
+		return (indexedRegion instanceof DTDNode && !(indexedRegion instanceof Unrecognized));
+	}
+}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/projection/StructuredTextFoldingProviderDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/projection/StructuredTextFoldingProviderDTD.java
deleted file mode 100644
index fddd13a..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/projection/StructuredTextFoldingProviderDTD.java
+++ /dev/null
@@ -1,563 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.projection;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.projection.IProjectionListener;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.TopLevelNode;
-import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.internal.event.IDTDFileListener;
-import org.eclipse.wst.dtd.core.internal.event.NodesEvent;
-import org.eclipse.wst.dtd.ui.internal.Logger;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
-import org.w3c.dom.Node;
-
-/**
- * Updates the projection model of a structured model for DTD.
- */
-public class StructuredTextFoldingProviderDTD implements IStructuredTextFoldingProvider, IProjectionListener, IDTDFileListener, ITextInputListener {
-	private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.dtd.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	private class TagProjectionAnnotation extends ProjectionAnnotation {
-		private boolean fIsVisible = false; /* workaround for BUG85874 */
-		private Node fNode;
-
-		public TagProjectionAnnotation(Node node, boolean isCollapsed) {
-			super(isCollapsed);
-			fNode = node;
-		}
-
-		public Node getNode() {
-			return fNode;
-		}
-
-		public void setNode(Node node) {
-			fNode = node;
-		}
-
-		/**
-		 * Does not paint hidden annotations. Annotations are hidden when they
-		 * only span one line.
-		 * 
-		 * @see ProjectionAnnotation#paint(org.eclipse.swt.graphics.GC,
-		 *      org.eclipse.swt.widgets.Canvas,
-		 *      org.eclipse.swt.graphics.Rectangle)
-		 */
-		public void paint(GC gc, Canvas canvas, Rectangle rectangle) {
-			/* workaround for BUG85874 */
-			/*
-			 * only need to check annotations that are expanded because hidden
-			 * annotations should never have been given the chance to
-			 * collapse.
-			 */
-			if (!isCollapsed()) {
-				// working with rectangle, so line height
-				FontMetrics metrics = gc.getFontMetrics();
-				if (metrics != null) {
-					// do not draw annotations that only span one line and
-					// mark them as not visible
-					if ((rectangle.height / metrics.getHeight()) <= 1) {
-						fIsVisible = false;
-						return;
-					}
-				}
-			}
-			fIsVisible = true;
-			super.paint(gc, canvas, rectangle);
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.jface.text.source.projection.ProjectionAnnotation#markCollapsed()
-		 */
-		public void markCollapsed() {
-			/* workaround for BUG85874 */
-			// do not mark collapsed if annotation is not visible
-			if (fIsVisible)
-				super.markCollapsed();
-		}
-	}
-
-	/**
-	 * Listens to document to be aware of when to update the projection
-	 * annotation model.
-	 */
-	class DocumentListener implements IDocumentListener {
-		public void documentAboutToBeChanged(DocumentEvent event) {
-			if (fDocument == event.getDocument())
-				fIsDocumentChanging = true;
-		}
-
-		public void documentChanged(DocumentEvent event) {
-			// register a post notification replace so that projection
-			// annotation model will be updated after all documentChanged
-			// listeners have been notified
-			IDocument document = event.getDocument();
-			if (document instanceof IDocumentExtension && fDocument == document) {
-				if (fViewer != null && fQueuedNodeChanges != null && !fQueuedNodeChanges.isEmpty()) {
-					((IDocumentExtension) document).registerPostNotificationReplace(this, new PostDocumentChangedListener());
-				}
-			}
-		}
-	}
-
-	/**
-	 * Essentially a post document changed listener because it is called after
-	 * documentchanged has been fired.
-	 */
-	class PostDocumentChangedListener implements IDocumentExtension.IReplace {
-		public void perform(IDocument document, IDocumentListener owner) {
-			applyAnnotationModelChanges();
-			fIsDocumentChanging = false;
-		}
-	}
-
-	/**
-	 * Contains node and an indication on how it changed
-	 */
-	class NodeChange {
-		static final int ADD = 1;
-		static final int REMOVE = 2;
-
-		private Node fNode;
-		private int fChangeType;
-
-		public NodeChange(Node node, int changeType) {
-			fNode = node;
-			fChangeType = changeType;
-		}
-
-		public Node getNode() {
-			return fNode;
-		}
-
-		public int getChangeType() {
-			return fChangeType;
-		}
-	}
-
-	IDocument fDocument;
-	ProjectionViewer fViewer;
-	private boolean fProjectionNeedsToBeEnabled = false;
-	/**
-	 * Listener to fProjectionViewer's document
-	 */
-	private IDocumentListener fDocumentListener;
-	/**
-	 * Indicates whether or not document is in the middle of changing
-	 */
-	boolean fIsDocumentChanging = false;
-	/**
-	 * List of changed nodes that need to be recalculated
-	 */
-	List fQueuedNodeChanges = null;
-
-	/**
-	 * Processes all the queued node changes and updates projection annotation
-	 * model.
-	 */
-	void applyAnnotationModelChanges() {
-		if (fViewer != null && fQueuedNodeChanges != null && !fQueuedNodeChanges.isEmpty()) {
-			ProjectionAnnotationModel annotationModel = fViewer.getProjectionAnnotationModel();
-
-			// go through all the pending annotation changes and apply them to
-			// the projection annotation model
-			while (!fQueuedNodeChanges.isEmpty()) {
-				NodeChange changes = (NodeChange) fQueuedNodeChanges.remove(0);
-				if (changes.getChangeType() == NodeChange.ADD) {
-					// add
-					Node node = changes.getNode();
-					Position newPos = createProjectionPosition(node);
-					if (newPos != null) {
-						TagProjectionAnnotation newAnnotation = new TagProjectionAnnotation(node, false);
-						// add to map containing annotations to add
-						try {
-							annotationModel.addAnnotation(newAnnotation, newPos);
-						}
-						catch (Exception e) {
-							// if anything goes wrong, log it and continue
-							Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-						}
-					}
-				}
-				else if (changes.getChangeType() == NodeChange.REMOVE) {
-					// remove
-					Node node = changes.getNode();
-					TagProjectionAnnotation anno = findExistingAnnotation(node);
-					if (anno != null) {
-						try {
-							annotationModel.removeAnnotation(anno);
-						}
-						catch (Exception e) {
-							// if anything goes wrong, log it and continue
-							Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-						}
-					}
-				}
-			}
-			fQueuedNodeChanges = null;
-		}
-	}
-
-	/**
-	 * Goes through every node creates projection annotation if needed
-	 * 
-	 * @param DTDFile
-	 *            assumes file is not null
-	 */
-	private void addAllAnnotations(DTDFile file) {
-		long start = System.currentTimeMillis();
-
-		List nodes = file.getNodes();
-		Iterator it = nodes.iterator();
-		while (it.hasNext()) {
-			DTDNode node = (DTDNode) it.next();
-			Position newPos = createProjectionPosition(node);
-			if (newPos != null) {
-				TagProjectionAnnotation newAnnotation = new TagProjectionAnnotation(node, false);
-				// add to map containing annotations to add
-				fViewer.getProjectionAnnotationModel().addAnnotation(newAnnotation, newPos);
-			}
-		}
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderDTD.addAllAnnotations: " + (end - start)); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Create a projection position from the given node. Able to get
-	 * projection position if node isNodeProjectable.
-	 * 
-	 * @param node
-	 * @return null if no projection position possible, a Position otherwise
-	 */
-	private Position createProjectionPosition(Node node) {
-		Position pos = null;
-		if (isNodeProjectable(node) && node instanceof IndexedRegion) {
-			IDocument document = fViewer.getDocument();
-			if (document != null) {
-				IndexedRegion inode = (IndexedRegion) node;
-				int start = inode.getStartOffset();
-				int end = inode.getEndOffset();
-				if (start >= 0 && start < end) {
-					pos = new Position(start, end - start);
-				}
-			}
-		}
-		return pos;
-	}
-
-	/**
-	 * Searches through projection annotation model and retrieves
-	 * TagProjectionAnnotation for node
-	 * 
-	 * @param node
-	 * @return TagProjectionAnnotation for node or null if could not be found
-	 */
-	private TagProjectionAnnotation findExistingAnnotation(Node node) {
-		TagProjectionAnnotation anno = null;
-
-		if (node != null) {
-			Iterator it = fViewer.getProjectionAnnotationModel().getAnnotationIterator();
-			while (it.hasNext() && anno == null) {
-				TagProjectionAnnotation a = (TagProjectionAnnotation) it.next();
-				if (node.equals(a.getNode()))
-					anno = a;
-			}
-		}
-		return anno;
-	}
-
-	/**
-	 * Get the dtd file for the fDocument
-	 * 
-	 * @return DTDFile if it exists, null otherwise
-	 */
-	private DTDFile getDTDFile() {
-		DTDFile dtdFile = null;
-
-		if (fDocument != null) {
-			IStructuredModel sModel = null;
-			try {
-				sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-				if (sModel instanceof DTDModelImpl) {
-					dtdFile = ((DTDModelImpl) sModel).getDTDFile();
-				}
-			}
-			finally {
-				if (sModel != null) {
-					sModel.releaseFromRead();
-				}
-			}
-		}
-		return dtdFile;
-	}
-
-	/**
-	 * Initialize this provider with the correct document. Assumes projection
-	 * is enabled. (otherwise, only install would have been called)
-	 */
-	public void initialize() {
-		if (!isInstalled())
-			return;
-
-		long start = System.currentTimeMillis();
-		// remove old info
-		projectionDisabled();
-
-		fDocument = fViewer.getDocument();
-		DTDFile file = getDTDFile();
-
-		if (fDocument != null && file != null && fViewer.getProjectionAnnotationModel() != null) {
-			if (fDocumentListener == null)
-				fDocumentListener = new DocumentListener();
-
-			fDocument.addDocumentListener(fDocumentListener);
-
-			// add dtd file listener to new dtd file
-			file.addDTDFileListener(this);
-
-			try {
-				// https://bugs.eclipse.org/bugs/show_bug.cgi?id=198304
-				// disable redraw while adding all adapters
-				fViewer.setRedraw(false);
-				addAllAnnotations(file);
-			}
-			finally {
-				fViewer.setRedraw(true);
-			}
-		}
-		fProjectionNeedsToBeEnabled = false;
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderDTD.initialize: " + (end - start)); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Associate a ProjectionViewer with this IStructuredTextFoldingProvider
-	 * 
-	 * @param viewer
-	 */
-	public void install(ProjectionViewer viewer) {
-		// uninstall before trying to install new viewer
-		if (isInstalled()) {
-			uninstall();
-		}
-		fViewer = viewer;
-		fViewer.addProjectionListener(this);
-		fViewer.addTextInputListener(this);
-	}
-
-	private boolean isInstalled() {
-		return fViewer != null;
-	}
-
-	/**
-	 * Returns true if node is a node type able to fold
-	 * 
-	 * @param node
-	 * @return boolean true if node is projectable, false otherwise
-	 */
-	private boolean isNodeProjectable(Node node) {
-		if (node != null) {
-			if (node instanceof TopLevelNode)
-				return true;
-		}
-		return false;
-	}
-
-	public void nodeChanged(DTDNode node) {
-		/*
-		 * Don't believe this is necessary (used to need it to only add
-		 * projection annotations to elements that span more than one line,
-		 * but now just always add projection annotation)
-		 */
-		// long start = System.currentTimeMillis();
-		// // recalculate projection annotations for node
-		// // check if this was even a projectable node to start with
-		// if (isNodeProjectable(node)) {
-		// // find the existing annotation
-		// TagProjectionAnnotation anno = findExistingAnnotation(node);
-		// // if able to project node see if projection annotation was
-		// // already created and create new if needed
-		// Position newPos = createProjectionPosition(node);
-		// if (newPos != null && anno == null) {
-		// TagProjectionAnnotation newAnnotation = new
-		// TagProjectionAnnotation(node, false);
-		// // add to map containing annotations to add
-		// fViewer.getProjectionAnnotationModel().addAnnotation(newAnnotation,
-		// newPos);
-		// }
-		// // if not able to project node see if projection annotation was
-		// // already created and remove it
-		// if (newPos == null && anno != null) {
-		// fViewer.getProjectionAnnotationModel().removeAnnotation(anno);
-		// }
-		// }
-		//
-		// long end = System.currentTimeMillis();
-		// if (debugProjectionPerf) {
-		// String nodeName = node != null ? node.getNodeName() : "null";
-		// //$NON-NLS-1$
-		// System.out.println("StructuredTextFoldingProviderDTD.nodeChanged ("
-		// + nodeName + "):" + (end - start)); //$NON-NLS-1$ //$NON-NLS-2$
-		// }
-	}
-
-	public void nodesAdded(NodesEvent event) {
-		long start = System.currentTimeMillis();
-
-		processNodesEvent(event, NodeChange.ADD);
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderDTD.nodesAdded: " + (end - start)); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Goes through every changed node in event and add to queue of node
-	 * changes that will be recalculated for projection annotation model.
-	 * 
-	 * @param event
-	 * @param changeType
-	 */
-	private void processNodesEvent(NodesEvent event, int changeType) {
-		List nodes = event.getNodes();
-		Iterator it = nodes.iterator();
-		while (it.hasNext()) {
-			DTDNode node = (DTDNode) it.next();
-			if (isNodeProjectable(node)) {
-				if (fQueuedNodeChanges == null) {
-					fQueuedNodeChanges = new ArrayList();
-				}
-
-				int existingIndex = fQueuedNodeChanges.indexOf(node);
-				if (existingIndex > -1) {
-					// node is already queued up
-					NodeChange existingChange = (NodeChange) fQueuedNodeChanges.remove(existingIndex);
-					// don't add if added then removed node or vice versa
-					if (existingChange.getChangeType() == changeType) {
-						NodeChange newChange = new NodeChange(node, changeType);
-						fQueuedNodeChanges.add(newChange);
-					}
-				}
-				else {
-					// not queued up yet, so queue node
-					NodeChange newChange = new NodeChange(node, changeType);
-					fQueuedNodeChanges.add(newChange);
-				}
-			}
-		}
-		// if document isn't changing, go ahead and apply it
-		if (!fIsDocumentChanging) {
-			applyAnnotationModelChanges();
-		}
-	}
-
-	public void nodesRemoved(NodesEvent event) {
-		long start = System.currentTimeMillis();
-
-		processNodesEvent(event, NodeChange.REMOVE);
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderDTD.nodesRemoved: " + (end - start)); //$NON-NLS-1$
-		}
-	}
-
-	public void projectionDisabled() {
-		DTDFile file = getDTDFile();
-		if (file != null) {
-			file.removeDTDFileListener(this);
-		}
-
-		// remove document listener
-		if (fDocumentListener != null && fDocument != null) {
-			fDocument.removeDocumentListener(fDocumentListener);
-			fDocument = null;
-
-			// clear out list of queued changes since it may no longer be
-			// accurate
-			if (fQueuedNodeChanges != null) {
-				fQueuedNodeChanges.clear();
-				fQueuedNodeChanges = null;
-			}
-		}
-
-		fDocument = null;
-		fProjectionNeedsToBeEnabled = false;
-	}
-
-	public void projectionEnabled() {
-		initialize();
-	}
-
-	public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
-		// if folding is enabled and new document is going to be a totally
-		// different document, disable projection
-		if (fDocument != null && fDocument != newInput) {
-			// disable projection and disconnect everything
-			projectionDisabled();
-			fProjectionNeedsToBeEnabled = true;
-		}
-	}
-
-	public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
-		// if projection was previously enabled before input document changed
-		// and new document is different than old document
-		if (fProjectionNeedsToBeEnabled && fDocument == null && newInput != null) {
-			projectionEnabled();
-			fProjectionNeedsToBeEnabled = false;
-		}
-	}
-
-	/**
-	 * Disconnect this IStructuredTextFoldingProvider from projection viewer
-	 */
-	public void uninstall() {
-		if (isInstalled()) {
-			projectionDisabled();
-
-			fViewer.removeProjectionListener(this);
-			fViewer.addTextInputListener(this);
-			fViewer = null;
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTDSubSet.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTDSubSet.java
index 63875bd..0f25b7e 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTDSubSet.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTDSubSet.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -21,7 +21,6 @@
 import org.eclipse.jface.text.ITypedRegion;
 import org.eclipse.jface.text.TextAttribute;
 import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.StyleRange;
 import org.eclipse.swt.graphics.RGB;
 import org.eclipse.wst.dtd.core.internal.provisional.contenttype.ContentTypeIdForDTD;
@@ -34,13 +33,10 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter;
+import org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider;
 import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
 
-public class LineStyleProviderForDTDSubSet implements LineStyleProvider {
-	private IStructuredDocument fDocument = null;
-	private Highlighter fHighlighter = null;
+public class LineStyleProviderForDTDSubSet extends AbstractLineStyleProvider implements LineStyleProvider {
 	private IStructuredModel fInternalModel = null;
 	private LineStyleProviderForDTD fInternalProvider = null;
 	private StyleRange[] fInternalRanges;
@@ -76,10 +72,6 @@
 			holdResults.add(range);
 		}
 	}
-
-	private TextAttribute createTextAttribute(RGB foreground, RGB background, boolean bold) {
-		return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, bold ? SWT.BOLD : SWT.NORMAL);
-	}
 	
 	protected TextAttribute getAttributeFor(ITextRegion region) {
 		TextAttribute ta = null;
@@ -109,11 +101,6 @@
 		return fInternalModel.getStructuredDocument();
 	}
 
-	public void init(IStructuredDocument document, Highlighter highlighter) {
-		fDocument = document;
-		fHighlighter = highlighter;
-	}
-	
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -141,6 +128,7 @@
 	}
 
 	public void release() {
+		super.release();
 		if (fInternalProvider != null) {
 			fInternalProvider.release();
 		}
@@ -152,7 +140,7 @@
 			try {
 				ITypedRegion regions[] = TextUtilities.computePartitioning(getInternalDocument(), fPartitioning, 0, document.getLength(), false);
 				List ranges = new ArrayList();
-				fInternalProvider.init(getInternalDocument(), fHighlighter);
+				fInternalProvider.init(getInternalDocument(), fRecHighlighter);
 				for (int i = 0; i < regions.length; i++) {
 					fInternalProvider.prepareRegions(regions[i], regions[i].getOffset(), regions[i].getLength(), ranges);
 				}
@@ -163,4 +151,9 @@
 			}
 		}
 	}
+
+
+	protected void loadColors() {
+		fInternalProvider.loadColors();
+	}
 }
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDTemplatesWizardPage.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDTemplatesWizardPage.java
index 63a52f3..a66906e 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDTemplatesWizardPage.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDTemplatesWizardPage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -231,16 +231,10 @@
 		GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
 		innerParent.setLayoutData(gd);
 
-		// Create linked text to just to templates preference page
-		Link link = new Link(innerParent, SWT.NONE);
-		link.setText(DTDUIMessages.NewDTDTemplatesWizardPage_6);
+		Label label = new Label(innerParent, SWT.NONE);
+		label.setText(DTDUIMessages.NewDTDTemplatesWizardPage_7);
 		data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
-		link.setLayoutData(data);
-		link.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				linkClicked();
-			}
-		});
+		label.setLayoutData(data);
 
 		// create table that displays templates
 		Table table = new Table(innerParent, SWT.BORDER | SWT.FULL_SELECTION);
@@ -295,6 +289,17 @@
 		fTemplateStore = DTDUIPlugin.getDefault().getTemplateStore();
 		fTableViewer.setInput(fTemplateStore);
 
+		// Create linked text to just to templates preference page
+		Link link = new Link(parent, SWT.NONE);
+		link.setText(DTDUIMessages.NewDTDTemplatesWizardPage_6);
+		data = new GridData(SWT.END, SWT.FILL, true, false, 2, 1);
+		link.setLayoutData(data);
+		link.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				linkClicked();
+			}
+		});
+
 		configureTableResizing(innerParent, table, column1, column2);
 		loadLastSavedPreferences();
 
@@ -325,7 +330,7 @@
 			}
 		};
 		SourceViewer viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
-		((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+		viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
 		IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForDTD.ContentTypeID_DTD);
 		IDocument document = scratchModel.getStructuredDocument();
 		viewer.configure(sourceViewerConfiguration);
@@ -347,6 +352,8 @@
 		data = new GridData(GridData.FILL_BOTH);
 		data.horizontalSpan = 2;
 		data.heightHint = convertHeightInCharsToPixels(5);
+		// [261274] - source viewer was growing to fit the max line width of the template
+		data.widthHint = convertWidthInCharsToPixels(2);
 		control.setLayoutData(data);
 
 		return viewer;
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDWizard.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDWizard.java
index 06e15a1..ad7a35c 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDWizard.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDWizard.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -51,6 +51,7 @@
 import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImages;
 import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
 import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
 
 public class NewDTDWizard extends Wizard implements INewWizard {
 	private WizardNewFileCreationPage fNewFilePage;
@@ -227,9 +228,8 @@
 			if (templateString != null) {
 				templateString = applyLineDelimiter(file, templateString);
 				// determine the encoding for the new file
-				Preferences preference = DTDCorePlugin.getInstance().getPluginPreferences();
-				String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
-
+				String charSet = getAppropriateCharset();
+				
 				try {
 					ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
 					OutputStreamWriter outputStreamWriter = null;
@@ -260,5 +260,18 @@
 		}
 		return performedOK;
 	}
+	
+	/**
+	 * If the DTD preference identifies a charset, use that. If not, revert to the XML
+	 * charset preference
+	 * 
+	 * @return charset based on DTD preferences if defined, if not, from the XML preferences
+	 */
+	private String getAppropriateCharset() {
+		String charset = DTDCorePlugin.getInstance().getPluginPreferences().getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
+		if(charset == null || charset.trim().equals(""))
+			charset = XMLCorePlugin.getDefault().getPluginPreferences().getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
+		return charset;
+	}
 
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContentOutlineComparator.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContentOutlineComparator.java
new file mode 100644
index 0000000..e6aca53
--- /dev/null
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContentOutlineComparator.java
@@ -0,0 +1,37 @@
+/*******************************************************************************

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

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

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

+ * which accompanies this distribution, and is available at

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

+ *

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *     

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

+package org.eclipse.wst.dtd.ui.views.contentoutline;

+

+import org.eclipse.jface.viewers.Viewer;

+import org.eclipse.jface.viewers.ViewerComparator;

+import org.eclipse.wst.dtd.core.internal.CMNode;

+

+/**

+ * Comparator for the outline. Allows sorting of regular DTD elements, but not

+ * their content models since the ordering there is important.

+ */

+class DTDContentOutlineComparator extends ViewerComparator {

+

+	public DTDContentOutlineComparator() {

+		super();

+	}

+

+	public int compare(Viewer viewer, Object e1, Object e2) {

+		if (e1 instanceof CMNode && e2 instanceof CMNode)

+			return 0;

+		return super.compare(viewer, e1, e2);

+	}

+	

+	public boolean isSorterProperty(Object element, String property) {

+		return super.isSorterProperty(element, property);

+	}

+}

diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContextMenuHelper.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContextMenuHelper.java
index 272a9a4..f99a07f 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContextMenuHelper.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContextMenuHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     Naoki Akiyama (Fujitsu) - bug 187172 - fix attribute grouping
  *     
  *******************************************************************************/
 
@@ -187,7 +188,7 @@
 				menu.add(addParameterEntityReferenceAction);
 			}
 			else if (folder.getListType().equals(DTDRegionTypes.ATTLIST_TAG)) {
-				menu.add(addAttributeAction);
+				menu.add(addAttributeListAction);
 			}
 		}
 		if (selectedObject instanceof DTDFile || selectedObject == null) {
@@ -214,17 +215,9 @@
 			else if (contentModel != null && CMNode.EMPTY.equals(contentModel.getType())) {
 				menu.add(replaceEmptyContentModelWithGroupAction);
 			}
-			// if (!(((Element)selectedObject).getContentModel() instanceof
-			// CMGroupNode))
-			// {
-			// menu.add(addGroupToContentModelAction);
-			// }
-			// addAttributeAction.setElement(selectedObject);
 			menu.add(addAttributeAction);
 		}
 		else if (selectedObject instanceof CMGroupNode) {
-			// addElementToContentModelAction.setElement(selectedObject);
-			// addGroupToContentModelAction.setElement(selectedObject);
 			menu.add(addElementToContentModelAction);
 			menu.add(addGroupToContentModelAction);
 		}
@@ -239,15 +232,6 @@
 		if (selectedObject instanceof DTDNode && !(selectedObject instanceof CMNode && ((CMNode) selectedObject).isRootElementContent())) {
 			menu.add(deleteAction);
 			deleteAction.setEnabled(true);
-			// if (selectedObject instanceof DTDElementContent)
-			// {
-			// DTDElementContent content = (DTDElementContent) selectedObject;
-			// if (content.getElement() != null && (content instanceof
-			// DTDPCDataContent || content instanceof DTDEmptyContent))
-			// {
-			// deleteAction.setEnabled(false);
-			// } // end of if ()
-			// } // end of if ()
 		}
 	}
 
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDTreeContentProvider.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDTreeContentProvider.java
index f3bf54f..a6aa906 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDTreeContentProvider.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDTreeContentProvider.java
@@ -242,7 +242,7 @@
 		return true;// !nodeList.getListType().equals(DTDRegionTypes.ATTLIST_TAG);
 	}
 
-	public void nodeChanged(DTDNode node) {
+	public void nodeChanged(final DTDNode node) {
 		if (fViewer instanceof StructuredViewer) {
 			// System.out.println("node changed notified");
 			// System.out.println("selection before = " +
@@ -254,13 +254,50 @@
 				while (iter.hasNext()) {
 					DTDNode currentNode = (DTDNode) iter.next();
 					if (currentNode.getName().equals(node.getName()) && currentNode instanceof Element) {
-						((StructuredViewer) fViewer).refresh(currentNode);
+						((StructuredViewer) fViewer).refresh(currentNode, true);
 					}
 				} // end of while ()
 			}
 			else {
 				// do standard stuff
-				((StructuredViewer) fViewer).refresh(node);
+				fViewer.getControl().getDisplay().asyncExec(new Runnable() {
+					public void run() {
+						if (fViewer.getControl().isDisposed())
+							return;
+						if (node.getParentNode() != null) {
+							((StructuredViewer) fViewer).refresh(node.getParentNode(), true);
+						}
+						((StructuredViewer) fViewer).refresh(node, true);
+					}
+				});
+			}
+			
+			if (node instanceof Attribute) {
+				fViewer.getControl().getDisplay().asyncExec(new Runnable() {
+					public void run() {
+						if (fViewer.getControl().isDisposed())
+							return;
+						/*
+						 * go from the attribute to its list and then owning element
+						 * so we refresh the tree item there as well
+						 */
+						Object attrList = node.getParentNode();
+						if (attrList != null && attrList instanceof AttributeList) {
+							String attListName = ((AttributeList) attrList).getName();
+							Iterator iter = node.getDTDFile().getElementsAndParameterEntityReferences().getNodes().iterator();
+							Object parent = null;
+							while (iter.hasNext() && parent == null) {
+								DTDNode currentNode = (DTDNode) iter.next();
+								if (currentNode instanceof Element && currentNode.getName().equals(attListName)) {
+									parent = currentNode;
+								}
+							}
+							if (parent != null) {
+								((StructuredViewer) fViewer).refresh(parent, true);
+							}
+						}
+					}
+				});
 			}
 			// System.out.println("selection after = " +
 			// ((StructuredViewer)view).getSelection());
@@ -278,10 +315,10 @@
 				oldSelectedNode = (DTDNode) firstObj;
 			}
 
-			AbstractTreeViewer abstractTreeViewer = (AbstractTreeViewer) fViewer;
+			final AbstractTreeViewer abstractTreeViewer = (AbstractTreeViewer) fViewer;
 			for (Iterator it = event.getNodes().iterator(); it.hasNext();) {
 				Object node = it.next();
-				Object parent = getParent(node);
+				final Object parent = getParent(node);
 				// Bug 111100 - If it is a top level node (ie. parent is a
 				// DTDFile),
 				// insert the node directly to improve performance
@@ -297,12 +334,24 @@
 				// If the parent node is not a DTDFile, just refresh the
 				// parent for now
 				else if (parent != null) {
-					abstractTreeViewer.refresh(parent);
+					fViewer.getControl().getDisplay().asyncExec(new Runnable() {
+						public void run() {
+							if (fViewer.getControl().isDisposed())
+								return;
+							abstractTreeViewer.refresh(parent, true);
+						}
+					});
 				}
 				// You should never reach this block, if you do, just refresh
 				// the whole tree
 				else {
-					abstractTreeViewer.refresh();
+					fViewer.getControl().getDisplay().asyncExec(new Runnable() {
+						public void run() {
+							if (fViewer.getControl().isDisposed())
+								return;
+							abstractTreeViewer.refresh(true);
+						}
+					});
 				}
 			}
 
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/SortAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/SortAction.java
index 482a1f6..dc73f47 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/SortAction.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/SortAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -22,14 +22,16 @@
 
 class SortAction extends PropertyChangeUpdateAction {
 	private TreeViewer treeViewer;
+	private ViewerComparator fComparator;
 
 	public SortAction(TreeViewer viewer, IPreferenceStore store, String preferenceKey) {
 		super(DTDUIMessages._UI_BUTTON_SORT_ITEMS, store, preferenceKey, false); //$NON-NLS-1$
 		setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_OBJ_SORT));
 		setToolTipText(getText());
+		fComparator = new DTDContentOutlineComparator();
 		treeViewer = viewer;
 		if (isChecked()) {
-			treeViewer.setComparator(new ViewerComparator());
+			treeViewer.setComparator(fComparator);
 		}
 	}
 
@@ -43,7 +45,7 @@
 		treeViewer.getControl().setRedraw(false);
 		Object[] expandedElements = treeViewer.getExpandedElements();
 		if (isChecked()) {
-			treeViewer.setComparator(new ViewerComparator());
+			treeViewer.setComparator(fComparator);
 		}
 		else {
 			treeViewer.setComparator(null);
diff --git a/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
index c659f03..e44f0b5 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.1.200.qualifier
+Bundle-Version: 1.1.402.qualifier
 Bundle-Activator: org.eclipse.wst.html.core.internal.HTMLCorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
@@ -27,12 +27,14 @@
  org.eclipse.wst.html.core.internal.text;x-internal:=true,
  org.eclipse.wst.html.core.internal.validate;x-internal:=true,
  org.eclipse.wst.html.core.text
-Require-Bundle: org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- com.ibm.icu;bundle-version="[3.8.1,4.0.0)",
+Import-Package: com.ibm.icu.util; version="3.8"
+Require-Bundle: org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
  org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.200,1.2.0)"
-Bundle-ActivationPolicy: lazy;exclude:="org.eclipse.wst.html.core.internal.contenttype"
+ org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.css.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.core.filebuffers;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.common.modulecore;bundle-version="[1.2.0,2.0.0)";resolution:=optional
+Bundle-ActivationPolicy: lazy;exclude:="org.eclipse.wst.html.core.internal.contenttype,org.eclipse.wst.html.core.internal.provisional.contenttype"
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.html.core/about.html b/bundles/org.eclipse.wst.html.core/about.html
index 73db36e..2199df3 100644
--- a/bundles/org.eclipse.wst.html.core/about.html
+++ b/bundles/org.eclipse.wst.html.core/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/bundles/org.eclipse.wst.html.core/build.properties b/bundles/org.eclipse.wst.html.core/build.properties
index 7ea2b7e..5c655fd 100644
--- a/bundles/org.eclipse.wst.html.core/build.properties
+++ b/bundles/org.eclipse.wst.html.core/build.properties
@@ -18,6 +18,5 @@
 bin.excludes = bin/**,\
                @dot/**,\
                temp.folder/**
-src.includes = component.xml,\
-               build.properties
+src.includes = component.xml
 source.. = src/
diff --git a/bundles/org.eclipse.wst.html.core/plugin.properties b/bundles/org.eclipse.wst.html.core/plugin.properties
index 7ba2487..14b6fdc 100644
--- a/bundles/org.eclipse.wst.html.core/plugin.properties
+++ b/bundles/org.eclipse.wst.html.core/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2008 IBM Corporation and others.
+# Copyright (c) 2004, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
 # Contributors:
 #     IBM Corporation - initial API and implementation
 ###############################################################################
-providerName=Eclipse.org
+providerName=Eclipse Web Tools Platform
 pluginName=Structured Source HTML Model
 Structured_HTML_Document_Factory_Extension.name=Structured HTML Document Factory Extension
 HTML_Content_Type_Extension_Element.name=HTML
diff --git a/bundles/org.eclipse.wst.html.core/plugin.xml b/bundles/org.eclipse.wst.html.core/plugin.xml
index 0bd5628..6c0bae8 100644
--- a/bundles/org.eclipse.wst.html.core/plugin.xml
+++ b/bundles/org.eclipse.wst.html.core/plugin.xml
@@ -121,7 +121,7 @@
 		</annotationFile>
 	</extension>
 
-	<extension point="org.eclipse.core.runtime.contentTypes">
+	<extension point="org.eclipse.core.contenttype.contentTypes">
 		<content-type
 			file-extensions="html,htm,xhtml,htpl,wml,shtml,shtm"
 			priority="high"
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java
index 92f6df1..f2f93b1 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -50,6 +50,9 @@
 	public static String _ERROR_Attribute_value___0___not_closed__1;
 	public static String HTMLContentPropertiesManager_Updating;
 	public static String HTMLContentPropertiesManager_Problems_Updating;
+	public static String _ERROR_Resource_not_found_0;
+	public static String Obsolete_attribute_name___ERROR_;
+	public static String Obsolete_tag___ERROR_;
 
 	static {
 		// load message values from bundle file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties
index 7cb04b6..7301451 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2006 IBM Corporation and others.
+# Copyright (c) 2004, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -40,3 +40,6 @@
 #
 HTMLContentPropertiesManager_Updating=Updating Web Content Settings
 HTMLContentPropertiesManager_Problems_Updating=Problem saving Web Content Settings for {0}
+_ERROR_Resource_not_found_0=Resource not found: {0}
+Obsolete_attribute_name___ERROR_=Attribute ({0}) is obsolete. Its use is discouraged in HTML5 documents.
+Obsolete_tag___ERROR_=Element ({0}) is obsolete. Its use is discouraged in HTML5 documents.
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/CSSTextNodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/CSSTextNodeCleanupHandler.java
index 05675c6..7a2b246 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/CSSTextNodeCleanupHandler.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/CSSTextNodeCleanupHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -37,7 +37,9 @@
 		IStructuredDocument structuredDocument = model.getStructuredDocument();
 		if (structuredDocument == null)
 			return node;
-
+		if ( !getCleanupPreferences().getFormatSource())
+			return node;
+		
 		String content = getCSSContent(node);
 		if (content == null)
 			return node;
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java
index 11af74b..9f37d31 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     David Carver (Intalion) - Cleanup Repeated Conditional check in isXMLType method
  *******************************************************************************/
 package org.eclipse.wst.html.core.internal.cleanup;
 
@@ -33,6 +34,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.sse.core.utils.StringUtils;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
@@ -52,6 +54,7 @@
 import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 // nakamori_TODO: check and remove CSS formatting
 
@@ -105,10 +108,12 @@
 		// there are any
 		// insertMissingTags() will return the new missing start tag if one is
 		// missing
+		// then compress any empty element tags
 		// applyTagNameCase() will return the renamed node.
 		// The renamed/new node will be saved and returned to caller when all
 		// cleanup is done.
 		renamedNode = insertMissingTags(renamedNode);
+		renamedNode = compressEmptyElementTag(renamedNode);
 		renamedNode = insertRequiredAttrs(renamedNode);
 		renamedNode = applyTagNameCase(renamedNode);
 		applyAttrNameCase(renamedNode);
@@ -170,6 +175,8 @@
 
 		for (int i = 0; i < attributesLength; i++) {
 			IDOMNode eachAttr = (IDOMNode) attributes.item(i);
+			if (hasNestedRegion(eachAttr.getNameRegion()))
+				continue;
 			String oldAttrName = eachAttr.getNodeName();
 			String newAttrName = oldAttrName;
 			/*
@@ -195,6 +202,19 @@
 		}
 	}
 
+	/**
+	 * True if container has nested regions, meaning container is probably too
+	 * complicated (like JSP regions) to validate with this validator.
+	 */
+	private boolean hasNestedRegion(ITextRegion container) {
+		if (!(container instanceof ITextRegionContainer))
+			return false;
+		ITextRegionList regions = ((ITextRegionContainer) container).getRegions();
+		if (regions == null)
+			return false;
+		return true;
+	}
+
 	protected IDOMNode applyTagNameCase(IDOMNode node) {
 		IDOMElement element = (IDOMElement) node;
 		if (element.isCommentTag())
@@ -506,7 +526,7 @@
 	protected boolean isXMLType(IDOMModel structuredModel) {
 		boolean result = false;
 
-		if (structuredModel != null && structuredModel != null) {
+		if (structuredModel != null) {
 			IDOMDocument document = structuredModel.getDocument();
 
 			if (document != null)
@@ -692,4 +712,51 @@
 
 		return result;
 	}
+
+	/**
+	 * <p>Compress empty element tags if the prefence is set to do so</p>
+	 * 
+	 * @copyof org.eclipse.wst.xml.core.internal.cleanup.ElementNodeCleanupHandler#compressEmptyElementTag
+	 * 
+	 * @param node the {@link IDOMNode} to possible compress
+	 * @return the compressed node if the given node should be compressed, else the node as it was given
+	 */
+	private IDOMNode compressEmptyElementTag(IDOMNode node) {
+		boolean compressEmptyElementTags = getCleanupPreferences().getCompressEmptyElementTags();
+		IDOMNode newNode = node;
+
+		IStructuredDocumentRegion startTagStructuredDocumentRegion = newNode.getFirstStructuredDocumentRegion();
+		IStructuredDocumentRegion endTagStructuredDocumentRegion = newNode.getLastStructuredDocumentRegion();
+
+		//only compress tags if they are empty
+		if ((compressEmptyElementTags && startTagStructuredDocumentRegion != endTagStructuredDocumentRegion &&
+				startTagStructuredDocumentRegion != null)) {
+
+			//only compress end tags if its XHTML or not a container
+			if(isXMLTag((IDOMElement)newNode) || !newNode.isContainer()) {
+				ITextRegionList regions = startTagStructuredDocumentRegion.getRegions();
+				ITextRegion lastRegion = regions.get(regions.size() - 1);
+				// format children and end tag if not empty element tag
+				if (lastRegion.getType() != DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
+					NodeList childNodes = newNode.getChildNodes();
+					if (childNodes == null || childNodes.getLength() == 0 || (childNodes.getLength() == 1 && (childNodes.item(0)).getNodeType() == Node.TEXT_NODE && ((childNodes.item(0)).getNodeValue().trim().length() == 0))) {
+						IDOMModel structuredModel = newNode.getModel();
+						IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
+
+						int startTagStartOffset = newNode.getStartOffset();
+						int offset = endTagStructuredDocumentRegion.getStart();
+						int length = endTagStructuredDocumentRegion.getLength();
+						structuredDocument.replaceText(structuredDocument, offset, length, ""); //$NON-NLS-1$
+						newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
+
+						offset = startTagStructuredDocumentRegion.getStart() + lastRegion.getStart();
+						structuredDocument.replaceText(structuredDocument, offset, 0, "/"); //$NON-NLS-1$
+						newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
+					}
+				}
+			}
+		}
+
+		return newNode;
+	}
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupHandlerFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupHandlerFactory.java
index 2560790..8dfc778 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupHandlerFactory.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupHandlerFactory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -43,10 +43,10 @@
 		IStructuredCleanupHandler handler = null;
 		switch (nodeType) {
 			case Node.ELEMENT_NODE : {
-				if (isJSPTag(node))
-					handler = new JSPElementNodeCleanupHandler();
-				else
+				if (isXMLTag(node))
 					handler = new ElementNodeCleanupHandler();
+				else
+					handler = new JSPElementNodeCleanupHandler();
 				break;
 			}
 			case Node.TEXT_NODE : {
@@ -65,56 +65,13 @@
 
 		return handler;
 	}
-
-	/**
-	 * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
-	 * way for expedency. Should be evolved in future to depend on "nestedContext".
-	 */
-
-	private boolean isJSPTag(Node node) {
-
-		final String JSP_CLOSE = "JSP_CLOSE"; //$NON-NLS-1$
-		// final String JSP_COMMENT_CLOSE = "JSP_COMMENT_CLOSE"; //$NON-NLS-1$
-
-		// final String JSP_COMMENT_OPEN = "JSP_COMMENT_OPEN"; //$NON-NLS-1$
-		// final String JSP_COMMENT_TEXT = "JSP_COMMENT_TEXT"; //$NON-NLS-1$
-
-		final String JSP_CONTENT = "JSP_CONTENT"; //$NON-NLS-1$
-		final String JSP_DECLARATION_OPEN = "JSP_DECLARATION_OPEN"; //$NON-NLS-1$
-		final String JSP_DIRECTIVE_CLOSE = "JSP_DIRECTIVE_CLOSE"; //$NON-NLS-1$
-		final String JSP_DIRECTIVE_NAME = "JSP_DIRECTIVE_NAME"; //$NON-NLS-1$
-
-		final String JSP_DIRECTIVE_OPEN = "JSP_DIRECTIVE_OPEN"; //$NON-NLS-1$
-		final String JSP_EXPRESSION_OPEN = "JSP_EXPRESSION_OPEN"; //$NON-NLS-1$
-
-		// final String JSP_ROOT_TAG_NAME = "JSP_ROOT_TAG_NAME"; //$NON-NLS-1$
-
-		final String JSP_SCRIPTLET_OPEN = "JSP_SCRIPTLET_OPEN"; //$NON-NLS-1$
-
-		boolean result = false;
-
-		if (node instanceof IDOMNode) {
-			IStructuredDocumentRegion flatNode = ((IDOMNode) node).getFirstStructuredDocumentRegion();
-			// in some cases, the nodes exists, but hasn't been associated
-			// with
-			// a flatnode yet (the screen updates can be initiated on a
-			// different thread,
-			// so the request for a flatnode can come in before the node is
-			// fully formed.
-			// if the flatnode is null, we'll just allow the defaults to
-			// apply.
-			if (flatNode != null) {
-				String flatNodeType = flatNode.getType();
-				// should not be null, but just to be sure
-				if (flatNodeType != null) {
-					if ((flatNodeType.equals(JSP_CONTENT)) || (flatNodeType.equals(JSP_EXPRESSION_OPEN)) || (flatNodeType.equals(JSP_SCRIPTLET_OPEN)) || (flatNodeType.equals(JSP_DECLARATION_OPEN)) || (flatNodeType.equals(JSP_DIRECTIVE_CLOSE)) || (flatNodeType.equals(JSP_DIRECTIVE_NAME)) || (flatNodeType.equals(JSP_DIRECTIVE_OPEN)) || (flatNodeType.equals(JSP_CLOSE))) {
-						result = true;
-					}
-				}
-			}
+	
+	private boolean isXMLTag(Node node) {
+		if(node instanceof IDOMNode) {
+			IStructuredDocumentRegion region = ((IDOMNode) node).getFirstStructuredDocumentRegion();
+			return (DOMRegionContext.XML_TAG_NAME == region.getType());
 		}
-
-		return result;
+		return false;
 	}
 
 	private boolean isParentStyleTag(Node node) {
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/JSPElementNodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/JSPElementNodeCleanupHandler.java
index fcc8a41..a289144 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/JSPElementNodeCleanupHandler.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/JSPElementNodeCleanupHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,11 +12,19 @@
 
 
 
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.w3c.dom.Node;
 
-public class JSPElementNodeCleanupHandler extends AbstractNodeCleanupHandler {
+public class JSPElementNodeCleanupHandler extends ElementNodeCleanupHandler {
 
 	public Node cleanup(Node node) {
+		/* <jsp:root> should cleanup its descendant nodes */
+		if(node instanceof IDOMNode) {
+			IStructuredDocumentRegion region = ((IDOMNode) node).getFirstStructuredDocumentRegion();
+			if("JSP_ROOT_TAG_NAME".equals(region.getType())) //$NON-NLS-1$
+				return super.cleanup(node);
+		}
 		return node;
 	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java
index ab2a71c..fa77f0e 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,10 +23,10 @@
 /**
  * Factory for attribute declarations.
  */
-final class AttributeCollection extends CMNamedNodeMapImpl implements HTML40Namespace {
+class AttributeCollection extends CMNamedNodeMapImpl implements HTML40Namespace {
 
 	/** bodycolors. */
-	private static final String[] BODYCOLORS = {ATTR_NAME_BGCOLOR, ATTR_NAME_TEXT, ATTR_NAME_LINK, ATTR_NAME_VLINK, HTML40Namespace.ATTR_NAME_ALINK};
+	private static final String[] BODYCOLORS = {ATTR_NAME_BGCOLOR, ATTR_NAME_TEXT, ATTR_NAME_LINK, ATTR_NAME_VLINK, ATTR_NAME_ALINK};
 	/** coreattrs. */
 	private static final String[] CORE = {ATTR_NAME_ID, ATTR_NAME_CLASS, ATTR_NAME_STYLE, ATTR_NAME_TITLE};
 	/** events. */
@@ -49,7 +49,7 @@
 	 * @param attrName
 	 *            java.lang.String
 	 */
-	private HTMLAttrDeclImpl create(String attrName) {
+	protected HTMLAttrDeclImpl create(String attrName) {
 		HTMLAttrDeclImpl attr = null;
 		HTMLCMDataTypeImpl atype = null;
 
@@ -1209,7 +1209,7 @@
 		atype.setEnumValues(values);
 
 		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
-		declarations.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
+		declarations.putNamedItem(ATTR_NAME_ALIGN, attr);
 
 		// the rest.
 		Iterator names = Arrays.asList(CELLHALIGN).iterator();
@@ -1221,9 +1221,9 @@
 	 * (top|middle|bottom|baseline) #IMPLIED)
 	 */
 	public void getCellvalign(CMNamedNodeMapImpl declarations) {
-		HTMLAttributeDeclaration dec = getDeclaration(HTML40Namespace.ATTR_NAME_VALIGN);
+		HTMLAttributeDeclaration dec = getDeclaration(ATTR_NAME_VALIGN);
 		if (dec != null)
-			declarations.putNamedItem(HTML40Namespace.ATTR_NAME_VALIGN, dec);
+			declarations.putNamedItem(ATTR_NAME_VALIGN, dec);
 	}
 
 	/**
@@ -1282,4 +1282,410 @@
 		Iterator names = Arrays.asList(I18N).iterator();
 		getDeclarations(declarations, names);
 	}
+	
+	/**
+	 * create declarations.
+	 */
+	public void createAttributeDeclarations(String elementName, CMNamedNodeMapImpl attributes) {
+		 /* (type %InputType; TEXT) ... should be defined locally.
+		 * (name CDATA #IMPLIED)
+		 * (value CDATA #IMPLIED)
+		 * (checked (checked) #IMPLIED)
+		 * (disabled (disabled) #IMPLIED)
+		 * (readonly (readonly) #IMPLIED)
+		 * (size CDATA #IMPLIED) ... should be defined locally.
+		 * (maxlength NUMBER #IMPLIED)
+		 * (src %URI; #IMPLIED)
+		 * (alt CDATA #IMPLIED) ... should be defined locally.
+		 * (usemap %URI; #IMPLIED)
+		 * (ismap (ismap) #IMPLIED)
+		 * (tabindex NUMBER #IMPLIED)
+		 * (accesskey %Character; #IMPLIED)
+		 * (onfocus %Script; #IMPLIED)
+		 * (onblur %Script; #IMPLIED)
+		 * (onselect %Script; #IMPLIED)
+		 * (onchange %Script; #IMPLIED)
+		 * (accept %ContentTypes; #IMPLIED)
+		 * (align %IAlign; #IMPLIED) ... should be defined locally.
+		 * (istyle CDATA #IMPLIED)
+		 * <<D215684
+		 * (width CDATA; #IMPLIED)
+		 * (height CDATA; #IMPLIED)
+		 * (border CDATA; #IMPLIED)
+		 * D215684
+		 */
+		if (elementName.equals(HTML40Namespace.ElementName.INPUT)){
+			HTMLCMDataTypeImpl atype = null;
+			HTMLAttrDeclImpl attr = null;
+			// (type %InputType; TEXT) ... should be defined locally.
+			// NOTE: %InputType is ENUM;
+			// (text | password | checkbox | radio | submit | reset |
+			//  file | hidden | image | button)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_TEXT, ATTR_VALUE_PASSWORD, ATTR_VALUE_CHECKBOX, ATTR_VALUE_RADIO, ATTR_VALUE_SUBMIT, ATTR_VALUE_RESET, ATTR_VALUE_FILE, ATTR_VALUE_HIDDEN, ATTR_VALUE_IMAGE, ATTR_VALUE_BUTTON};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TEXT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+
+			// (size CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_SIZE, attr);
+
+			// (alt CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ALT, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_ALT, attr);
+
+			// (align %IAlign; #IMPLIED) ... should be defined locally.
+			attr = AttributeCollection.createAlignForImage();
+			attributes.putNamedItem(ATTR_NAME_ALIGN, attr);
+
+			// the rest.
+			String[] names = {ATTR_NAME_NAME, ATTR_NAME_VALUE, ATTR_NAME_CHECKED, ATTR_NAME_DISABLED, ATTR_NAME_READONLY, ATTR_NAME_SIZE, ATTR_NAME_MAXLENGTH, ATTR_NAME_SRC, ATTR_NAME_ALT, ATTR_NAME_USEMAP, ATTR_NAME_ISMAP, ATTR_NAME_TABINDEX, ATTR_NAME_ACCESSKEY, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR, ATTR_NAME_ONSELECT, ATTR_NAME_ONCHANGE, ATTR_NAME_ACCEPT, ATTR_NAME_ALIGN, ATTR_NAME_ISTYLE,
+			//<<D215684
+						ATTR_NAME_WIDTH, ATTR_NAME_HEIGHT, ATTR_NAME_BORDER
+			//<D215684
+			};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		}
+		 /* (charset %Charset; #IMPLIED)
+		 * (href %URI; #IMPLIED)
+		 * (hreflang %LanguageCode; #IMPLIED)
+		 * (type %ContentType; #IMPLIED): should be defined locally.
+		 * (rel %LinkTypes; #IMPLIED)
+		 * (rev %LinkTypes; #IMPLIED)
+		 * (media %MediaDesc; #IMPLIED)
+		 * (target %FrameTarget; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.LINK)){
+			String[] names = {ATTR_NAME_CHARSET, ATTR_NAME_HREF, ATTR_NAME_HREFLANG, ATTR_NAME_REL, ATTR_NAME_REV, ATTR_NAME_MEDIA, ATTR_NAME_TARGET};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// (type %ContentType; #IMPLIED)
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+		
+		}
+		/* (charset %Charset; #IMPLIED)
+		 * (type %ContentType; #IMPLIED)
+		 * (name CDATA #IMPLIED)
+		 * (href %URI; #IMPLIED)
+		 * (hreflang %LanguageCode; #IMPLIED)
+		 * (target %FrameTarget; #IMPLIED)
+		 * (rel %LinkTypes; #IMPLIED)
+		 * (rev %LinkTypes; #IMPLIED)
+		 * (accesskey %Character; #IMPLIED)
+		 * (directkey %Character; #IMPLIED)
+		 * (shape %Shape; rect)
+		 * (coords %Coords; #IMPLIED)
+		 * (tabindex NUMBER #IMPLIED)
+		 * (onfocus %Script; #IMPLIED)
+		 * (onblur %Script; #IMPLIED) 
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.A)){
+			String[] names = {ATTR_NAME_CHARSET, ATTR_NAME_TYPE, ATTR_NAME_NAME, ATTR_NAME_HREF, ATTR_NAME_HREFLANG, ATTR_NAME_TARGET, ATTR_NAME_REL, ATTR_NAME_REV, ATTR_NAME_ACCESSKEY, ATTR_NAME_DIRECTKEY, ATTR_NAME_SHAPE, ATTR_NAME_COORDS, ATTR_NAME_TABINDEX, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		
+		}
+		/*
+		 * (shape %Shape; rect)
+		 * (coords %Coords; #IMPLIED)
+		 * (href %URI; #IMPLIED)
+		 * (target %FrameTarget; #IMPLIED)
+		 * (nohref (nohref) #IMPLIED)
+		 * (alt %Text; #REQUIRED)
+		 * (tabindex NUMBER #IMPLIED)
+		 * (accesskey %Character; #IMPLIED)
+		 * (onfocus %Script; #IMPLIED)
+		 * (onblur %Script; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.AREA)){
+			String[] names = {ATTR_NAME_SHAPE, ATTR_NAME_COORDS, ATTR_NAME_HREF, ATTR_NAME_TARGET, ATTR_NAME_NOHREF, ATTR_NAME_ALT, ATTR_NAME_TABINDEX, ATTR_NAME_ACCESSKEY, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		}
+		/*
+		 *  %i18n;
+		 * (http-equiv NAME #IMPLIED)
+		 * (name NAME #IMPLIED) ... should be defined locally.
+		 * (content CDATA #REQUIRED)
+		 * (scheme CDATA #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.META)){
+			// %i18n;
+			getI18n(attributes);
+
+			// (name NAME #IMPLIED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.NAME);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_NAME, attr);
+
+			String[] names = {ATTR_NAME_HTTP_EQUIV, ATTR_NAME_CONTENT, ATTR_NAME_SCHEME};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		}
+		/*
+		 * (src %URI; #REQUIRED): should be defined locally.
+		 * (alt %Text; #REQUIRED)
+		 * (longdesc %URI; #IMPLIED)
+		 * (name CDATA #IMPLIED)
+		 * (height %Length; #IMPLIED)
+		 * (width %Length; #IMPLIED)
+		 * (usemap %URI; #IMPLIED)
+		 * (ismap (ismap) #IMPLIED)
+		 * (align %IAlign; #IMPLIED): should be defined locally.
+		 * (border %Pixels; #IMPLIED)
+		 * (hspace %Pixels; #IMPLIED)
+		 * (vspace %Pixels; #IMPLIED)
+		 * (mapfile %URI; #IMPLIED)
+	 
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.IMG)){
+			// (src %URI; #REQUIRED): should be defined locally.
+			HTMLCMDataTypeImpl atype = null;
+			HTMLAttrDeclImpl attr = null;
+			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
+			attributes.putNamedItem(ATTR_NAME_SRC, attr);
+
+			String[] names = {ATTR_NAME_ALT, ATTR_NAME_LONGDESC, ATTR_NAME_NAME, ATTR_NAME_HEIGHT, ATTR_NAME_WIDTH, ATTR_NAME_USEMAP, ATTR_NAME_ISMAP, ATTR_NAME_BORDER, ATTR_NAME_HSPACE, ATTR_NAME_VSPACE, ATTR_NAME_MAPFILE};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// align (local); should be defined locally.
+			attr = AttributeCollection.createAlignForImage();
+			attributes.putNamedItem(ATTR_NAME_ALIGN, attr);
+		
+		}
+		/*
+		 * (id ID #IMPLIED)
+		 * (name CDATA #REQUIRED) ... should be defined locally.
+		 * (value CDATA #IMPLIED)
+		 * (valuetype (DATA|REF|OBJECT) DATA)
+		 * (type %ContentType; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.PARAM)){
+			String[] names = {ATTR_NAME_ID, ATTR_NAME_VALUE, ATTR_NAME_VALUETYPE, ATTR_NAME_TYPE};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// (name CDATA #REQUIRED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.REQUIRED);
+			attributes.putNamedItem(ATTR_NAME_NAME, attr);
+		}
+		/*
+		 * %reserved; ... empty
+		 * (name CDATA #IMPLIED)
+		 * (rows NUMBER #REQUIRED)
+		 * (cols NUMBER #REQUIRED)
+		 * (disabled (disabled) #IMPLIED)
+		 * (readonly (readonly) #IMPLIED)
+		 * (tabindex NUMBER #IMPLIED)
+		 * (accesskey %Character; #IMPLIED)
+		 * (onfocus %Script; #IMPLIED)
+		 * (onblur %Script; #IMPLIED)
+		 * (onselect %Script; #IMPLIED)
+		 * (onchange %Script; #IMPLIED)
+		 * (istyle CDATA #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.TEXTAREA)){
+			String[] names = {ATTR_NAME_NAME, ATTR_NAME_ROWS, ATTR_NAME_COLS, ATTR_NAME_DISABLED, ATTR_NAME_READONLY, ATTR_NAME_TABINDEX, ATTR_NAME_ACCESSKEY, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR, ATTR_NAME_ONSELECT, ATTR_NAME_ONCHANGE, ATTR_NAME_ISTYLE};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		}
+		/*
+		 * (charset %Charset; #IMPLIED)
+		 * (type %ContentType; #REQUIRED) ... should be defined locally.
+		 * (language CDATA #IMPLIED)
+		 * (src %URI; #IMPLIED)
+		 * (defer (defer) #IMPLIED)
+		 * (event CDATA #IMPLIED)
+		 * (for %URI; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.SCRIPT)){
+			String[] names = {ATTR_NAME_CHARSET, ATTR_NAME_LANGUAGE, ATTR_NAME_SRC, ATTR_NAME_DEFER, ATTR_NAME_EVENT, ATTR_NAME_FOR};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// (type %ContentType; #REQUIRED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, "text/javascript"); //$NON-NLS-1$
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.REQUIRED);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+		
+		}
+		/*
+		 *  %i18n;
+		 * (type %ContentType; #REQUIRED) ... should be defined locally.
+		 * (media %MediaDesc; #IMPLIED)
+		 * (title %Text; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.STYLE)){
+			// %i18n;
+			getI18n(attributes);
+
+			String[] names = {ATTR_NAME_MEDIA, ATTR_NAME_TITLE};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+			// (type %ContentType; #REQUIRED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, "text/css"); //$NON-NLS-1$
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.REQUIRED);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+		
+		}
+		/*
+		 * %reserved;
+		 * (name CDATA #IMPLIED)
+		 * (size NUMBER #IMPLIED) ... should be defined locally.
+		 * (multiple (multiple) #IMPLIED)
+		 * (disabled (disabled) #IMPLIED)
+		 * (tabindex NUMBER #IMPLIED)
+		 * (onfocus %Script; #IMPLIED)
+		 * (onblur %Script; #IMPLIED)
+		 * (onchange %Script; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.SELECT)){
+			// (size NUMBER #IMPLIED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_SIZE, attr);
+
+			String[] names = {ATTR_NAME_NAME, ATTR_NAME_MULTIPLE, ATTR_NAME_DISABLED, ATTR_NAME_TABINDEX, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR, ATTR_NAME_ONCHANGE};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		
+		}
+		/*
+		 * 	(type %LIStyle; #IMPLIED) ... should be defined locally.
+		 * (value NUMBER #IMPLIED) ... should be defined locally.
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.LI)){
+			// (type %LIStyle; #IMPLIED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LI_STYLE);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+
+			// (value NUMBER #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_VALUE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_VALUE, attr);
+		
+		}
+		/*
+		 * (type %OLStyle; #IMPLIED) ... should be defined locally.
+		 * (compact (compact) #IMPLIED)
+		 * (start NUMBER #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.OL)){
+			// (type %OLStyle; #IMPLIED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.OL_STYLE);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+
+			// the rest.
+			String[] names = {ATTR_NAME_COMPACT, ATTR_NAME_START};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		
+		}
+		/**
+		 * %coreattrs;
+		 * (longdesc %URI; #IMPLIED)
+		 * (name CDATA #IMPLIED)
+		 * (src %URI; #IMPLIED)
+		 * (frameborder (1|0) 1)
+		 * (marginwidth %Pixels; #IMPLIED)
+		 * (marginheight %Pixels; #IMPLIED)
+		 * (scrolling (yes|no|auto) auto)
+		 * (align %IAlign; #IMPLIED) ... should be defined locally.
+		 * (height %Length; #IMPLIED)
+		 * (width %Length; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.IFRAME)){
+			// %coreattrs;
+			getCore(attributes);
+
+			String[] names = {ATTR_NAME_LONGDESC, ATTR_NAME_NAME, ATTR_NAME_SRC, ATTR_NAME_FRAMEBORDER, ATTR_NAME_MARGINWIDTH, ATTR_NAME_MARGINHEIGHT, ATTR_NAME_SCROLLING, ATTR_NAME_HEIGHT, ATTR_NAME_WIDTH};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// align
+			HTMLAttrDeclImpl attr = AttributeCollection.createAlignForImage();
+			if (attr != null)
+				attributes.putNamedItem(ATTR_NAME_ALIGN, attr);
+		
+		}
+		/*
+		 * %i18n attrs
+		 * %version
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.HTML)){
+			// %i18n;
+			getI18n(attributes);
+			// version
+			HTMLAttributeDeclaration adec = getDeclaration(ATTR_NAME_VERSION);
+			if (adec != null)
+				attributes.putNamedItem(ATTR_NAME_VERSION, adec);
+		
+		}
+		/*
+		 * (compact (compact) #IMPLIED)
+	 	 */
+		else if (elementName.equals(HTML40Namespace.ElementName.MENU)){
+			String[] names = {ATTR_NAME_COMPACT};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		
+		}
+		/*
+		 * %reserved; ... empty.
+		 * (name CDATA #IMPLIED)
+		 * (value CDATA #IMPLIED)
+		 * (type (button|submit|reset) submit) ... should be defined locally.
+		 * (disabled (disabled) #IMPLIED)
+		 * (tabindex NUMBER #IMPLIED)
+		 * (accesskey %Character; #IMPLIED)
+		 * (onfocus %Script; #IMPLIED)
+		 * (onblur %Script; #IMPLIED)
+	 	 */
+		else if (elementName.equals(HTML40Namespace.ElementName.BUTTON)){
+			String[] names = {ATTR_NAME_NAME, ATTR_NAME_VALUE, ATTR_NAME_DISABLED, ATTR_NAME_TABINDEX, ATTR_NAME_ACCESSKEY, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// (type (button|submit|reset) submit) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_BUTTON, ATTR_VALUE_SUBMIT, ATTR_VALUE_RESET};
+			atype.setEnumValues(values);
+
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+		
+		}
+		/*
+		 * %reserved;
+		 * (summary %Text; #IMPLIED)
+		 * (width %Length; #IMPLIED)
+		 * (border %Pixels; #IMPLIED)
+		 * (frame %TFrame; #IMPLIED)
+		 * (rules %TRules; #IMPLIED)
+		 * (cellspacing %Length; #IMPLIED)
+		 * (cellpadding %Length; #IMPLIED)
+		 * (align %TAlign; #IMPLIED)
+		 * (bgcolor %Color; #IMPLIED)
+		 * (datapagesize CDATA #IMPLIED)
+		 * (height %Pixels; #IMPLIED)
+		 * (background %URI; #IMPLIED)
+		 * (bordercolor %Color #IMPLIED) ... D205514
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.TABLE)){
+			// %reserved;
+			// ... %reserved; is empty in the current DTD.
+
+			String[] names = {ATTR_NAME_SUMMARY, ATTR_NAME_WIDTH, ATTR_NAME_BORDER, ATTR_NAME_FRAME, ATTR_NAME_RULES, ATTR_NAME_CELLSPACING, ATTR_NAME_CELLPADDING, ATTR_NAME_BGCOLOR, ATTR_NAME_DATAPAGESIZE, ATTR_NAME_HEIGHT, ATTR_NAME_BACKGROUND, ATTR_NAME_BORDERCOLOR // D205514
+			};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// align (local)
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] alignValues = {ATTR_VALUE_LEFT, ATTR_VALUE_CENTER, ATTR_VALUE_RIGHT};
+			atype.setEnumValues(alignValues);
+			HTMLAttrDeclImpl adec = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_ALIGN, adec);
+			
+		}
+	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinitionFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinitionFactory.java
index 9a38d53..51d693d 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinitionFactory.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinitionFactory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -28,6 +28,8 @@
 	public final static String CTYPE_COLUMN_GROUP = "CTYPE_COLUMN_GROUP";//$NON-NLS-1$
 	/** for DL. */
 	public final static String CTYPE_DEFINITION_LIST = "CTYPE_DEFINITION_LIST";//$NON-NLS-1$
+	/** for DETAILS */
+	public final static String CTYPE_DETAILS_CONTAINER = "CTYPE_DETAILS_CONTAINER";//$NON-NLS-1$
 	/** for EMBED. */
 	public final static String CTYPE_EMBED = "CTYPE_EMBED";//$NON-NLS-1$
 	/** empty content. No ComplexTypeDefinition instance should be created. */
@@ -64,7 +66,17 @@
 	public final static String CTYPE_TCELL_CONTAINER = "CTYPE_TCELL_CONTAINER";//$NON-NLS-1$
 	/** table record container. (TR)+ */
 	public final static String CTYPE_TR_CONTAINER = "CTYPE_TR_CONTAINER";//$NON-NLS-1$
-
+	/** heading group container. (H1|h2|H3|H4|H5|H6)+ */
+	public final static String CTYPE_HEADING_CONTAINER = "CTYPE_HGROUP_CONTAINER"; //$NON-NLS-1$
+	/** media content. (AUDIO|VIDEO) */
+	public final static String CTYPE_MEDIA_ELEMENT = "CTYPE_MEDIA";//$NON-NLS-1$
+	/** for DATALIST. */
+	public final static String CTYPE_DATALIST = "CTYPE_DATALIST";//$NON-NLS-1$
+	/** for FIGURE. */
+	public final static String CTYPE_FIGURE = "CTYPE_FIGURE";//$NON-NLS-1$
+	/** for RUBY. */
+	public final static String CTYPE_RUBY = "CTYPE_RUBY";//$NON-NLS-1$
+	
 	/**
 	 * ComplexTypeDefinitionFactory constructor comment.
 	 */
@@ -81,8 +93,17 @@
 	 * @param elementCollection ElementCollection
 	 */
 	public ComplexTypeDefinition createTypeDefinition(String definitionName, ElementCollection elementCollection) {
+		ComplexTypeDefinition[] defs = null;
 		if (definitions.containsKey(definitionName)) {
-			return (ComplexTypeDefinition) definitions.get(definitionName);
+			defs =  (ComplexTypeDefinition[]) definitions.get(definitionName);
+			for (int i = 0; i < defs.length; i++) {
+				if (defs[i].collection == elementCollection)
+					return defs[i];
+			}
+		}
+		else {
+			// initialize a new definition
+			defs = new ComplexTypeDefinition[0];
 		}
 
 		ComplexTypeDefinition def = null;
@@ -94,10 +115,17 @@
 			def = new CtdColumnGroup(elementCollection);
 
 		}
+		else if (definitionName == CTYPE_DATALIST) {
+			def = new CtdDatalist(elementCollection);
+
+		}
 		else if (definitionName == CTYPE_DEFINITION_LIST) {
 			def = new CtdDl(elementCollection);
 
 		}
+		else if (definitionName == CTYPE_DETAILS_CONTAINER) {
+			def = new CtdDetails(elementCollection);
+		}
 		else if (definitionName == CTYPE_EMBED) {
 			def = new CtdEmbed(elementCollection);
 
@@ -106,6 +134,10 @@
 			def = new CtdFieldset(elementCollection);
 
 		}
+		else if (definitionName == CTYPE_FIGURE) {
+			def = new CtdFigure(elementCollection);
+
+		}
 		else if (definitionName == CTYPE_FLOW_CONTAINER) {
 			def = new CtdFlowContainer(elementCollection);
 
@@ -118,6 +150,9 @@
 			def = new CtdHead(elementCollection);
 
 		}
+		else if (definitionName == CTYPE_HEADING_CONTAINER) {
+			def = new CtdHeadingContainer(elementCollection);
+		}
 		else if (definitionName == CTYPE_HTML) {
 			def = new CtdHtml(elementCollection);
 
@@ -134,6 +169,10 @@
 			def = new CtdMap(elementCollection);
 
 		}
+		else if (definitionName == CTYPE_MEDIA_ELEMENT) {
+			def = new CtdMediaElement(elementCollection);
+			
+		}
 		else if (definitionName == CTYPE_NOFRAMES_CONTENT) {
 			def = new CtdNoframesContent(elementCollection);
 
@@ -146,6 +185,10 @@
 			def = new CtdParamContainer(elementCollection);
 
 		}
+		else if (definitionName == CTYPE_RUBY) {
+			def = new CtdRuby(elementCollection);
+
+		}
 		else if (definitionName == CTYPE_SELECT) {
 			def = new CtdSelect(elementCollection);
 
@@ -167,7 +210,11 @@
 		}
 		if (def == null)
 			return null; // fail to create.
-		definitions.put(definitionName, def);
+		ComplexTypeDefinition[] temp = defs;
+		defs = new ComplexTypeDefinition[defs.length + 1];
+		System.arraycopy(temp, 0, defs, 0, temp.length);
+		defs[temp.length] = def;
+		definitions.put(definitionName, defs);
 		return def;
 	}
 
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDatalist.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDatalist.java
new file mode 100644
index 0000000..457debf
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDatalist.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+/**
+ * for DATALIST.
+ */
+final class CtdDatalist extends ComplexTypeDefinition {
+
+	/**
+	 * @param elementCollection ElementCollection
+	 */
+	public CtdDatalist(ElementCollection elementCollection) {
+		super(elementCollection);
+		primaryCandidateName = HTML40Namespace.ElementName.OPTION;
+	}
+
+	/**
+	 * (OPTION)+.
+	 */
+	protected void createContent() {
+		if (content != null)
+			return; // already created.
+		if (collection == null)
+			return;
+
+	
+		content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
+		// OPTION
+		CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.OPTION);
+		if (dec != null)
+			content.appendChild(dec);
+	}
+
+	/**
+	 * (OPTION)+.
+	 * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
+	 * those are defined in CMElementDeclaration.
+	 */
+	public int getContentType() {
+		return CMElementDeclaration.ELEMENT;
+	}
+
+	/**
+	 * @return java.lang.String
+	 */
+	public String getTypeName() {
+		return ComplexTypeDefinitionFactory.CTYPE_DATALIST;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDetails.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDetails.java
new file mode 100644
index 0000000..914d5db
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDetails.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+public class CtdDetails extends ComplexTypeDefinition {
+
+	public CtdDetails(ElementCollection elementCollection) {
+		super(elementCollection);
+		primaryCandidateName = HTML50Namespace.ElementName.SUMMARY;
+	}
+
+	protected void createContent() {
+		if (content != null)
+			return; // already created.
+		if (collection == null)
+			return;
+
+		content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
+		// summary
+		CMNode dec = collection.getNamedItem(HTML50Namespace.ElementName.SUMMARY);
+		if (dec != null)
+			content.appendChild(dec);
+
+		CMGroupImpl group = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
+		content.appendChild(group);
+		collection.getFlow(group);
+	}
+
+	public int getContentType() {
+		return CMElementDeclaration.ELEMENT;
+	}
+
+	public String getTypeName() {
+		return ComplexTypeDefinitionFactory.CTYPE_DETAILS_CONTAINER;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFigure.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFigure.java
new file mode 100644
index 0000000..165054f
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFigure.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+/**
+ * for FIGURE.
+ */
+final class CtdFigure extends ComplexTypeDefinition {
+
+	/**
+	 * @param elementCollection ElementCollection
+	 */
+	public CtdFigure(ElementCollection elementCollection) {
+		super(elementCollection);
+		primaryCandidateName = HTML50Namespace.ElementName.FIGCAPTION;
+	}
+
+	/**
+	 * (FIGCAPTION)+.
+	 */
+	protected void createContent() {
+		if (content != null)
+			return; // already created.
+		if (collection == null)
+			return;
+
+		// ( | )+
+		content = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
+		
+		CMGroupImpl group1 = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
+		if (group1 != null){
+			content.appendChild(group1);
+		}
+		// FIGCAPTION, FLOW
+		CMNode dec = collection.getNamedItem(HTML50Namespace.ElementName.FIGCAPTION);
+		if (dec != null)
+			group1.appendChild(dec);
+		CMGroupImpl flowgroup = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
+		group1.appendChild(flowgroup);
+		collection.getFlow(flowgroup);
+		
+		CMGroupImpl group2 = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
+		if (group2 != null){
+			content.appendChild(group2);
+		}
+		// FLOW , FIGCAPTION
+		CMGroupImpl flowgroup2 = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
+		group2.appendChild(flowgroup2);
+		collection.getFlow(flowgroup2);
+		CMNode dec1 = collection.getNamedItem(HTML50Namespace.ElementName.FIGCAPTION);
+		if (dec1 != null)
+			group2.appendChild(dec1);
+		//FLOW
+		CMGroupImpl group3 = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
+		if (group3 != null){
+			content.appendChild(group3);
+			
+		}
+		collection.getFlow(group3);
+
+	}
+
+	/**
+	 * (FIGCAPTION)+.
+	 * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
+	 * those are defined in CMElementDeclaration.
+	 */
+	public int getContentType() {
+		return CMElementDeclaration.ELEMENT;
+	}
+
+	/**
+	 * @return java.lang.String
+	 */
+	public String getTypeName() {
+		return ComplexTypeDefinitionFactory.CTYPE_FIGURE;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHeadingContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHeadingContainer.java
new file mode 100644
index 0000000..e7fdba7
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHeadingContainer.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+
+
+public class CtdHeadingContainer extends ComplexTypeDefinition {
+
+	/**
+	 * @param elementCollection ElementCollection
+	 */
+	public CtdHeadingContainer(ElementCollection elementCollection) {
+		super(elementCollection);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition#createContent()
+	 */
+	protected void createContent() {
+		if (content != null)
+			return; // already created.
+		if (collection == null)
+			return;
+		// ( )*
+		content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
+		// H1|H2|H3|H4|H5|H6
+		 collection.getHeading(content);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition#getContentType()
+	 */
+	public int getContentType() {
+		return CMElementDeclaration.ELEMENT;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition#getTypeName()
+	 */
+	public String getTypeName() {
+		return ComplexTypeDefinitionFactory.CTYPE_HEADING_CONTAINER;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHtml.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHtml.java
index d2396fc..ca7295b 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHtml.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHtml.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@
 import java.util.Arrays;
 
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
@@ -319,6 +320,53 @@
 	    edec = collection.getNamedItem(HTML40Namespace.ElementName.STRONG);
 		if (edec != null)
 			content.appendChild(edec);
+		edec = collection.getNamedItem(HTML50Namespace.ElementName.ARTICLE);
+		if (edec != null)
+			content.appendChild(edec);
+
+	    edec = collection.getNamedItem(HTML50Namespace.ElementName.ASIDE);
+		if (edec != null)
+			content.appendChild(edec);
+		edec = collection.getNamedItem(HTML50Namespace.ElementName.NAV);
+		if (edec != null)
+			content.appendChild(edec);
+
+	    edec = collection.getNamedItem(HTML50Namespace.ElementName.SECTION);
+		if (edec != null)
+			content.appendChild(edec);
+		edec = collection.getNamedItem(HTML50Namespace.ElementName.AUDIO);
+		if (edec != null)
+			content.appendChild(edec);
+
+	    edec = collection.getNamedItem(HTML50Namespace.ElementName.VIDEO);
+		if (edec != null)
+			content.appendChild(edec);
+		edec = collection.getNamedItem(HTML50Namespace.ElementName.CANVAS);
+		if (edec != null)
+			content.appendChild(edec);
+
+	    edec = collection.getNamedItem(HTML50Namespace.ElementName.COMMAND);
+		if (edec != null)
+			content.appendChild(edec);
+		
+	    edec = collection.getNamedItem(HTML50Namespace.ElementName.HEADER);
+		if (edec != null)
+			content.appendChild(edec);
+		
+	    edec = collection.getNamedItem(HTML50Namespace.ElementName.FOOTER);
+		if (edec != null)
+			content.appendChild(edec);
+		
+	    edec = collection.getNamedItem(HTML50Namespace.ElementName.MARK);
+		if (edec != null)
+			content.appendChild(edec);
+		
+		edec = collection.getNamedItem(HTML50Namespace.ElementName.FIGURE);
+		if (edec != null)
+			content.appendChild(edec);
+		edec = collection.getNamedItem(HTML50Namespace.ElementName.RUBY);
+		if (edec != null)
+			content.appendChild(edec);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdMediaElement.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdMediaElement.java
new file mode 100644
index 0000000..95cb598
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdMediaElement.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+
+public class CtdMediaElement extends ComplexTypeDefinition {
+
+	/**
+	 * @param elementCollection ElementCollection
+	 */
+	public CtdMediaElement(ElementCollection elementCollection) {
+		super(elementCollection);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition#createContent()
+	 */
+	protected void createContent() {
+		if (content != null)
+			return; // already created.
+		if (collection == null)
+			return;
+		// ( )*
+		content = new CMGroupImpl(CMGroup.SEQUENCE,0, 1);
+		//source
+		CMNode source = collection.getNamedItem(HTML50Namespace.ElementName.SOURCE);
+		if (source != null)
+			content.appendChild(source);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition#getContentType()
+	 */
+	public int getContentType() {
+		return CMElementDeclaration.ELEMENT;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition#getTypeName()
+	 */
+	public String getTypeName() {
+		return ComplexTypeDefinitionFactory.CTYPE_MEDIA_ELEMENT;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdParamContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdParamContainer.java
index 4732191..4eb45b4 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdParamContainer.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdParamContainer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -49,6 +49,7 @@
 		if (flows == null)
 			return;
 		collection.getInline(flows);
+		collection.getBlock(flows);
 		content.appendChild(flows);
 	}
 
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdRuby.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdRuby.java
new file mode 100644
index 0000000..9ec37d0
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdRuby.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+/**
+ * for RUBY.
+ */
+final class CtdRuby extends ComplexTypeDefinition {
+
+	/**
+	 * @param elementCollection ElementCollection
+	 */
+	public CtdRuby(ElementCollection elementCollection) {
+		super(elementCollection);
+		primaryCandidateName = HTML50Namespace.ElementName.RT;
+	}
+
+	/**
+	 * (RT)+.
+	 */
+	protected void createContent() {
+		if (content != null)
+			return; // already created.
+		if (collection == null)
+			return;
+
+	
+		content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
+		
+		CMGroupImpl phraseGroup = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
+		if (phraseGroup == null)
+			return;
+		content.appendChild(phraseGroup);
+		collection.getPhrase(phraseGroup);
+		
+		CMGroupImpl rtrpgroup = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
+		if (rtrpgroup == null)
+			return;
+		content.appendChild(rtrpgroup);
+		
+		//RT
+		CMNode dec = collection.getNamedItem(HTML50Namespace.ElementName.RT);
+		if (dec != null)
+			rtrpgroup.appendChild(dec);
+		
+		CMGroupImpl rpgroup = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
+		if (rpgroup == null)
+			return;
+		rtrpgroup.appendChild(rpgroup);
+		
+		// RP
+		dec = collection.getNamedItem(HTML50Namespace.ElementName.RP);
+		if (dec != null)
+			rpgroup.appendChild(dec);
+		// RT
+		dec = collection.getNamedItem(HTML50Namespace.ElementName.RT);
+		if (dec != null)
+			rpgroup.appendChild(dec);
+		dec = collection.getNamedItem(HTML50Namespace.ElementName.RP);
+		if (dec != null)
+			rpgroup.appendChild(dec);
+	}
+
+	/**
+	 * (RT)+.
+	 * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
+	 * those are defined in CMElementDeclaration.
+	 */
+	public int getContentType() {
+		return CMElementDeclaration.ELEMENT;
+	}
+
+	/**
+	 * @return java.lang.String
+	 */
+	public String getTypeName() {
+		return ComplexTypeDefinitionFactory.CTYPE_RUBY;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ElementCollection.java
index 8349964..92ddfdf 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ElementCollection.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ElementCollection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -22,11 +22,11 @@
 /**
  * Factory for element declarations.
  */
-final class ElementCollection extends DeclCollection implements org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ElementName {
+class ElementCollection extends DeclCollection implements org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ElementName {
 
 
 	// Element IDs
-	private static class Ids {
+	protected static class Ids {
 		public static final int ID_A = 0;
 		public static final int ID_ABBR = 1;
 		public static final int ID_ACRONYM = 2;
@@ -183,123 +183,18 @@
 	private static final String[] LIST = {UL, OL, DIR, MENU};
 	/** %preformatted;. PRE */
 	private static final String[] PREFORMATTED = {PRE};
-	private AttributeCollection attributeCollection = null;
+	protected AttributeCollection attributeCollection = null;
 	private static String[] fNames = null;
 
-	static {
-		fNames = new String[Ids.getNumOfIds()];
-		fNames[Ids.ID_A] = A;
-		fNames[Ids.ID_ABBR] = ABBR;
-		fNames[Ids.ID_ACRONYM] = ACRONYM;
-		fNames[Ids.ID_ADDRESS] = ADDRESS;
-		fNames[Ids.ID_APPLET] = APPLET;
-		fNames[Ids.ID_AREA] = AREA;
-		fNames[Ids.ID_B] = B;
-		fNames[Ids.ID_BASE] = BASE;
-		fNames[Ids.ID_BASEFONT] = BASEFONT;
-		fNames[Ids.ID_BDO] = BDO;
-		fNames[Ids.ID_BIG] = BIG;
-		fNames[Ids.ID_BLINK] = BLINK;
-		fNames[Ids.ID_BLOCKQUOTE] = BLOCKQUOTE;
-		fNames[Ids.ID_BODY] = BODY;
-		fNames[Ids.ID_BR] = BR;
-		fNames[Ids.ID_BUTTON] = BUTTON;
-		fNames[Ids.ID_CAPTION] = CAPTION;
-		fNames[Ids.ID_CENTER] = CENTER;
-		fNames[Ids.ID_CITE] = CITE;
-		fNames[Ids.ID_CODE] = CODE;
-		fNames[Ids.ID_COL] = COL;
-		fNames[Ids.ID_COLGROUP] = COLGROUP;
-		fNames[Ids.ID_DD] = DD;
-		fNames[Ids.ID_DEL] = DEL;
-		fNames[Ids.ID_DFN] = DFN;
-		fNames[Ids.ID_DIR] = DIR;
-		fNames[Ids.ID_DIV] = DIV;
-		fNames[Ids.ID_DL] = DL;
-		fNames[Ids.ID_DT] = DT;
-		fNames[Ids.ID_EM] = EM;
-		fNames[Ids.ID_EMBED] = EMBED;
-		fNames[Ids.ID_FIELDSET] = FIELDSET;
-		fNames[Ids.ID_FONT] = FONT;
-		fNames[Ids.ID_FORM] = FORM;
-		fNames[Ids.ID_FRAME] = FRAME;
-		fNames[Ids.ID_FRAMESET] = FRAMESET;
-		fNames[Ids.ID_H1] = H1;
-		fNames[Ids.ID_H2] = H2;
-		fNames[Ids.ID_H3] = H3;
-		fNames[Ids.ID_H4] = H4;
-		fNames[Ids.ID_H5] = H5;
-		fNames[Ids.ID_H6] = H6;
-		fNames[Ids.ID_HEAD] = HEAD;
-		fNames[Ids.ID_HR] = HR;
-		fNames[Ids.ID_HTML] = HTML;
-		fNames[Ids.ID_I] = I;
-		fNames[Ids.ID_IFRAME] = IFRAME;
-		fNames[Ids.ID_IMG] = IMG;
-		fNames[Ids.ID_INPUT] = INPUT;
-		fNames[Ids.ID_INS] = INS;
-		fNames[Ids.ID_ISINDEX] = ISINDEX;
-		fNames[Ids.ID_KBD] = KBD;
-		fNames[Ids.ID_LABEL] = LABEL;
-		fNames[Ids.ID_LEGEND] = LEGEND;
-		fNames[Ids.ID_LI] = LI;
-		fNames[Ids.ID_LINK] = LINK;
-		fNames[Ids.ID_MAP] = MAP;
-		fNames[Ids.ID_MENU] = MENU;
-		fNames[Ids.ID_META] = META;
-		fNames[Ids.ID_NOEMBED] = NOEMBED;
-		fNames[Ids.ID_NOFRAMES] = NOFRAMES;
-		fNames[Ids.ID_NOSCRIPT] = NOSCRIPT;
-		fNames[Ids.ID_OBJECT] = OBJECT;
-		fNames[Ids.ID_OL] = OL;
-		fNames[Ids.ID_OPTGROUP] = OPTGROUP;
-		fNames[Ids.ID_OPTION] = OPTION;
-		fNames[Ids.ID_P] = P;
-		fNames[Ids.ID_PARAM] = PARAM;
-		fNames[Ids.ID_PRE] = PRE;
-		fNames[Ids.ID_Q] = Q;
-		fNames[Ids.ID_S] = S;
-		fNames[Ids.ID_SAMP] = SAMP;
-		fNames[Ids.ID_SCRIPT] = SCRIPT;
-		fNames[Ids.ID_SELECT] = SELECT;
-		fNames[Ids.ID_SMALL] = SMALL;
-		fNames[Ids.ID_SPAN] = SPAN;
-		fNames[Ids.ID_STRIKE] = STRIKE;
-		fNames[Ids.ID_STRONG] = STRONG;
-		fNames[Ids.ID_STYLE] = STYLE;
-		fNames[Ids.ID_SUB] = SUB;
-		fNames[Ids.ID_SUP] = SUP;
-		fNames[Ids.ID_TABLE] = TABLE;
-		fNames[Ids.ID_TBODY] = TBODY;
-		fNames[Ids.ID_TD] = TD;
-		fNames[Ids.ID_TEXTAREA] = TEXTAREA;
-		fNames[Ids.ID_TFOOT] = TFOOT;
-		fNames[Ids.ID_TH] = TH;
-		fNames[Ids.ID_THEAD] = THEAD;
-		fNames[Ids.ID_TITLE] = TITLE;
-		fNames[Ids.ID_TR] = TR;
-		fNames[Ids.ID_TT] = TT;
-		fNames[Ids.ID_U] = U;
-		fNames[Ids.ID_UL] = UL;
-		fNames[Ids.ID_VAR] = VAR;
-		fNames[Ids.ID_MARQUEE] = MARQUEE;
-		fNames[Ids.ID_SSI_CONFIG] = SSI_CONFIG;
-		fNames[Ids.ID_SSI_ECHO] = SSI_ECHO;
-		fNames[Ids.ID_SSI_EXEC] = SSI_EXEC;
-		fNames[Ids.ID_SSI_FSIZE] = SSI_FSIZE;
-		fNames[Ids.ID_SSI_FLASTMOD] = SSI_FLASTMOD;
-		fNames[Ids.ID_SSI_INCLUDE] = SSI_INCLUDE;
-		fNames[Ids.ID_SSI_PRINTENV] = SSI_PRINTENV;
-		fNames[Ids.ID_SSI_SET] = SSI_SET;
-		fNames[Ids.ID_BGSOUND] = BGSOUND;
-		fNames[Ids.ID_NOBR] = NOBR;
-		fNames[Ids.ID_WBR] = WBR;
-	}
-
 	/**
 	 */
 	public ElementCollection(AttributeCollection collection) {
-		super(fNames, TOLERANT_CASE);
+		super(getNames(), TOLERANT_CASE);
+		attributeCollection = collection;
+	}
+
+	public ElementCollection(String[] names, AttributeCollection collection) {
+		super(names, TOLERANT_CASE);
 		attributeCollection = collection;
 	}
 
@@ -747,7 +642,7 @@
 		return attributeCollection;
 	}
 
-	public final Collection getNamesOfBlock() {
+	public Collection getNamesOfBlock() {
 		// P, DL, DIV, CENTER, NOSCRIPT, NOFRAMES, BLOCKQUOTE, FORM, ISINDEX, HR,
 		// TABLE, FIELDSET, ADDRESS
 		String[] blockMisc = {P, DL, DIV, CENTER, NOSCRIPT, NOFRAMES, BLOCKQUOTE, FORM, ISINDEX, HR, TABLE, FIELDSET, ADDRESS};
@@ -781,7 +676,7 @@
 	 * into a <code>CMGroupImpl</code> instance.
 	 * @param group CMGroupImpl Return values.
 	 */
-	public final void getFlow(CMGroupImpl group) {
+	public void getFlow(CMGroupImpl group) {
 		if (group == null)
 			return;
 		getBlock(group);
@@ -793,7 +688,7 @@
 	 * instance.<br>
 	 * @param group CMGroupImpl Return values.
 	 */
-	public final void getFontstyle(CMGroupImpl group) {
+	public void getFontstyle(CMGroupImpl group) {
 		if (group == null)
 			return;
 		getDeclarations(group, Arrays.asList(FONTSTYLE).iterator());
@@ -804,7 +699,7 @@
 	 * instance.<br>
 	 * @param group CMGroupImpl Return values.
 	 */
-	public final void getFormctrl(CMGroupImpl group) {
+	public void getFormctrl(CMGroupImpl group) {
 		if (group == null)
 			return;
 		getDeclarations(group, Arrays.asList(FORMCTL).iterator());
@@ -814,7 +709,7 @@
 	 * %heading;.
 	 * @param group CMGroupImpl Return values.
 	 */
-	public final void getHeading(CMGroupImpl group) {
+	public void getHeading(CMGroupImpl group) {
 		if (group == null)
 			return;
 
@@ -826,7 +721,7 @@
 	 * into a <code>CMGroupImpl</code> instance.
 	 * @param group CMGroupImpl Return values.
 	 */
-	public final void getInline(CMGroupImpl group) {
+	public void getInline(CMGroupImpl group) {
 		if (group == null)
 			return;
 		getFontstyle(group);
@@ -839,7 +734,7 @@
 	 * %list;.
 	 * @param group CMGroupImpl Return values.
 	 */
-	public final void getList(CMGroupImpl group) {
+	public void getList(CMGroupImpl group) {
 		if (group == null)
 			return;
 
@@ -851,7 +746,7 @@
 	 * instance.<br>
 	 * @param group CMGroupImpl Return values.
 	 */
-	public final void getPhrase(CMGroupImpl group) {
+	public void getPhrase(CMGroupImpl group) {
 		if (group == null)
 			return;
 		getDeclarations(group, Arrays.asList(PHRASE).iterator());
@@ -861,7 +756,7 @@
 	 * %preformatted;
 	 * @param group CMGroupImpl Return values.
 	 */
-	public final void getPreformatted(CMGroupImpl group) {
+	public void getPreformatted(CMGroupImpl group) {
 		if (group == null)
 			return;
 
@@ -873,9 +768,122 @@
 	 * instance.<br>
 	 * @param group CMGroupImpl Return values.
 	 */
-	public final void getSpecial(CMGroupImpl group) {
+	public void getSpecial(CMGroupImpl group) {
 		if (group == null)
 			return;
 		getDeclarations(group, Arrays.asList(SPECIAL).iterator());
 	}
+
+	private static String[] getNames() {
+		if (fNames == null) {
+			fNames = new String[Ids.getNumOfIds()];
+			fNames[Ids.ID_A] = A;
+			fNames[Ids.ID_ABBR] = ABBR;
+			fNames[Ids.ID_ACRONYM] = ACRONYM;
+			fNames[Ids.ID_ADDRESS] = ADDRESS;
+			fNames[Ids.ID_APPLET] = APPLET;
+			fNames[Ids.ID_AREA] = AREA;
+			fNames[Ids.ID_B] = B;
+			fNames[Ids.ID_BASE] = BASE;
+			fNames[Ids.ID_BASEFONT] = BASEFONT;
+			fNames[Ids.ID_BDO] = BDO;
+			fNames[Ids.ID_BIG] = BIG;
+			fNames[Ids.ID_BLINK] = BLINK;
+			fNames[Ids.ID_BLOCKQUOTE] = BLOCKQUOTE;
+			fNames[Ids.ID_BODY] = BODY;
+			fNames[Ids.ID_BR] = BR;
+			fNames[Ids.ID_BUTTON] = BUTTON;
+			fNames[Ids.ID_CAPTION] = CAPTION;
+			fNames[Ids.ID_CENTER] = CENTER;
+			fNames[Ids.ID_CITE] = CITE;
+			fNames[Ids.ID_CODE] = CODE;
+			fNames[Ids.ID_COL] = COL;
+			fNames[Ids.ID_COLGROUP] = COLGROUP;
+			fNames[Ids.ID_DD] = DD;
+			fNames[Ids.ID_DEL] = DEL;
+			fNames[Ids.ID_DFN] = DFN;
+			fNames[Ids.ID_DIR] = DIR;
+			fNames[Ids.ID_DIV] = DIV;
+			fNames[Ids.ID_DL] = DL;
+			fNames[Ids.ID_DT] = DT;
+			fNames[Ids.ID_EM] = EM;
+			fNames[Ids.ID_EMBED] = EMBED;
+			fNames[Ids.ID_FIELDSET] = FIELDSET;
+			fNames[Ids.ID_FONT] = FONT;
+			fNames[Ids.ID_FORM] = FORM;
+			fNames[Ids.ID_FRAME] = FRAME;
+			fNames[Ids.ID_FRAMESET] = FRAMESET;
+			fNames[Ids.ID_H1] = H1;
+			fNames[Ids.ID_H2] = H2;
+			fNames[Ids.ID_H3] = H3;
+			fNames[Ids.ID_H4] = H4;
+			fNames[Ids.ID_H5] = H5;
+			fNames[Ids.ID_H6] = H6;
+			fNames[Ids.ID_HEAD] = HEAD;
+			fNames[Ids.ID_HR] = HR;
+			fNames[Ids.ID_HTML] = HTML;
+			fNames[Ids.ID_I] = I;
+			fNames[Ids.ID_IFRAME] = IFRAME;
+			fNames[Ids.ID_IMG] = IMG;
+			fNames[Ids.ID_INPUT] = INPUT;
+			fNames[Ids.ID_INS] = INS;
+			fNames[Ids.ID_ISINDEX] = ISINDEX;
+			fNames[Ids.ID_KBD] = KBD;
+			fNames[Ids.ID_LABEL] = LABEL;
+			fNames[Ids.ID_LEGEND] = LEGEND;
+			fNames[Ids.ID_LI] = LI;
+			fNames[Ids.ID_LINK] = LINK;
+			fNames[Ids.ID_MAP] = MAP;
+			fNames[Ids.ID_MENU] = MENU;
+			fNames[Ids.ID_META] = META;
+			fNames[Ids.ID_NOEMBED] = NOEMBED;
+			fNames[Ids.ID_NOFRAMES] = NOFRAMES;
+			fNames[Ids.ID_NOSCRIPT] = NOSCRIPT;
+			fNames[Ids.ID_OBJECT] = OBJECT;
+			fNames[Ids.ID_OL] = OL;
+			fNames[Ids.ID_OPTGROUP] = OPTGROUP;
+			fNames[Ids.ID_OPTION] = OPTION;
+			fNames[Ids.ID_P] = P;
+			fNames[Ids.ID_PARAM] = PARAM;
+			fNames[Ids.ID_PRE] = PRE;
+			fNames[Ids.ID_Q] = Q;
+			fNames[Ids.ID_S] = S;
+			fNames[Ids.ID_SAMP] = SAMP;
+			fNames[Ids.ID_SCRIPT] = SCRIPT;
+			fNames[Ids.ID_SELECT] = SELECT;
+			fNames[Ids.ID_SMALL] = SMALL;
+			fNames[Ids.ID_SPAN] = SPAN;
+			fNames[Ids.ID_STRIKE] = STRIKE;
+			fNames[Ids.ID_STRONG] = STRONG;
+			fNames[Ids.ID_STYLE] = STYLE;
+			fNames[Ids.ID_SUB] = SUB;
+			fNames[Ids.ID_SUP] = SUP;
+			fNames[Ids.ID_TABLE] = TABLE;
+			fNames[Ids.ID_TBODY] = TBODY;
+			fNames[Ids.ID_TD] = TD;
+			fNames[Ids.ID_TEXTAREA] = TEXTAREA;
+			fNames[Ids.ID_TFOOT] = TFOOT;
+			fNames[Ids.ID_TH] = TH;
+			fNames[Ids.ID_THEAD] = THEAD;
+			fNames[Ids.ID_TITLE] = TITLE;
+			fNames[Ids.ID_TR] = TR;
+			fNames[Ids.ID_TT] = TT;
+			fNames[Ids.ID_U] = U;
+			fNames[Ids.ID_UL] = UL;
+			fNames[Ids.ID_VAR] = VAR;
+			fNames[Ids.ID_MARQUEE] = MARQUEE;
+			fNames[Ids.ID_SSI_CONFIG] = SSI_CONFIG;
+			fNames[Ids.ID_SSI_ECHO] = SSI_ECHO;
+			fNames[Ids.ID_SSI_EXEC] = SSI_EXEC;
+			fNames[Ids.ID_SSI_FSIZE] = SSI_FSIZE;
+			fNames[Ids.ID_SSI_FLASTMOD] = SSI_FLASTMOD;
+			fNames[Ids.ID_SSI_INCLUDE] = SSI_INCLUDE;
+			fNames[Ids.ID_SSI_PRINTENV] = SSI_PRINTENV;
+			fNames[Ids.ID_SSI_SET] = SSI_SET;
+			fNames[Ids.ID_BGSOUND] = BGSOUND;
+			fNames[Ids.ID_NOBR] = NOBR;
+			fNames[Ids.ID_WBR] = WBR;
+		}
+		return fNames;
+	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/H5CMDocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/H5CMDocImpl.java
new file mode 100644
index 0000000..e16c9dd
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/H5CMDocImpl.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+/**
+ * CMDocument implementation for the HTML.
+ */
+class H5CMDocImpl extends CMNodeImpl implements HTMLCMDocument {
+
+	/** Namespace for all names of elements, entities and attributes. */
+	private CMNamespaceImpl namespace = null;
+	private HTML5ElementCollection elements = null;
+	private EntityCollection entities = null;
+	private AttributeCollection attributes = null;
+
+	/**
+	 */
+	public H5CMDocImpl(String docTypeName, CMNamespaceImpl targetNamespace) {
+		super(docTypeName);
+		namespace = targetNamespace;
+		
+		attributes = new HTML5AttributeCollection();
+		elements = new HTML5ElementCollection(attributes);
+		entities = new EntityCollection();
+	}
+
+	AttributeCollection getAttributes() {
+		return attributes;
+	}
+
+	public HTMLElementDeclaration getElementDeclaration(String elementName) {
+		if (elements == null)
+			return null;
+		return (HTMLElementDeclaration) elements.getNamedItem(elementName);
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
+	 */
+	public CMNamedNodeMap getElements() {
+		return elements;
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
+	 */
+	public CMNamedNodeMap getEntities() {
+		return entities;
+	}
+
+	public HTMLEntityDeclaration getEntityDeclaration(String entityName) {
+		if (entities == null)
+			return null;
+		return (HTMLEntityDeclaration) entities.getNamedItem(entityName);
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
+	 */
+	public CMNamespace getNamespace() {
+		return namespace;
+	}
+
+	/**
+	 * @see CMNode
+	 */
+	public int getNodeType() {
+		return CMNode.DOCUMENT;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5AttributeCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5AttributeCollection.java
new file mode 100644
index 0000000..9622122
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5AttributeCollection.java
@@ -0,0 +1,1332 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import java.util.Arrays;
+import java.util.Iterator;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+
+public class HTML5AttributeCollection extends AttributeCollection implements HTML50Namespace {
+	/** html5 core attribs */
+	private static final String[] CORE = {ATTR_NAME_ACCESSKEY, ATTR_NAME_CLASS, ATTR_NAME_CONTENT_EDITABLE, ATTR_NAME_CONTEXT_MENU, ATTR_NAME_DIR, ATTR_NAME_DRAGGABLE, ATTR_NAME_HIDDEN, ATTR_NAME_ID, ATTR_NAME_LANG, ATTR_NAME_SPELLCHECK,ATTR_NAME_STYLE, ATTR_NAME_TABINDEX, ATTR_NAME_TITLE};
+	/** events for HTML5. */
+	private static final String[] EVENTS = {ATTR_NAME_ONABORT, ATTR_NAME_ONBLUR, ATTR_NAME_ONCAN_PLAY, ATTR_NAME_ONCAN_PLAY_THROUGH, ATTR_NAME_ONCHANGE, ATTR_NAME_ONCLICK, ATTR_NAME_ONCONTEXT_MENU, ATTR_NAME_ONDBLCLICK, ATTR_NAME_ONDRAG, ATTR_NAME_ONDRAG_END, ATTR_NAME_ONDRAG_ENTER, ATTR_NAME_ONDRAG_LEAVE, 
+		ATTR_NAME_ONDRAG_OVER, ATTR_NAME_ONDRAG_START, ATTR_NAME_ONDROP, ATTR_NAME_ONDURATION_CHANGE, ATTR_NAME_ONEMPTIED, ATTR_NAME_ONENDED, ATTR_NAME_ONERROR, ATTR_NAME_ONFOCUS, ATTR_NAME_ONFORM_CHANGE, ATTR_NAME_ONFORM_INPUT, ATTR_NAME_ONINVALID,ATTR_NAME_ONKEYPRESS, ATTR_NAME_ONKEYDOWN, ATTR_NAME_ONKEYUP, 
+		ATTR_NAME_ONLOAD, ATTR_NAME_ONLOAD_START, ATTR_NAME_ONLOADED_DATA, ATTR_NAME_ONLOADED_METADATA, ATTR_NAME_ONMOUSEDOWN, ATTR_NAME_ONMOUSEUP, ATTR_NAME_ONMOUSEOVER, ATTR_NAME_ONMOUSEMOVE, ATTR_NAME_ONMOUSEOUT, ATTR_NAME_ONMOUSE_WHEEL, ATTR_NAME_ONPAUSE, ATTR_NAME_ONPLAY, ATTR_NAME_ONPLAYING, ATTR_NAME_ONPROGRESS,
+		ATTR_NAME_ONRATE_CHANGE, ATTR_NAME_ONREADY_STATE_CHANGE, ATTR_NAME_ONSCROLL, ATTR_NAME_ONSEEKED, ATTR_NAME_ONSEEKING, ATTR_NAME_ONSELECT, ATTR_NAME_ONSHOW, ATTR_NAME_ONSTALLED, ATTR_NAME_ONSUBMIT, ATTR_NAME_ONSUSPEND, ATTR_NAME_ONTIME_UPDATE, ATTR_NAME_ONVOLUME_UPDATE, ATTR_NAME_ONWAITING};
+
+	protected HTMLAttrDeclImpl create(String attrName) {
+		HTMLAttrDeclImpl attr = null;
+		HTMLCMDataTypeImpl atype = null;
+		if (attrName.equalsIgnoreCase(ATTR_NAME_AUTOFOCUS)) {
+			// (disabled (disabled) #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			// boolean attribute must have the same value as its name.
+			String[] values = {ATTR_NAME_AUTOFOCUS};
+			atype.setEnumValues(values);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_AUTOFOCUS, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_CONTENT_EDITABLE)) {
+			// (contenteditable (EMPTY|TRUE|FALSE|INHERIT) TRUE)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_EMPTY, ATTR_VALUE_TRUE, ATTR_VALUE_FALSE, ATTR_VALUE_INHERIT};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TRUE);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_CONTENT_EDITABLE, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_CHALLENGE)) {
+			// (challenge CDATA; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_CHALLENGE, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_CONTEXT_MENU)) {
+			// (contextmenu, CDATA, IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_CONTEXT_MENU, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_DRAGGABLE)) {
+			// (draggable (TRUE|FALSE|AUTO) TRUE)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE, ATTR_VALUE_AUTO};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_FALSE);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_DRAGGABLE, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_FORM)) {
+			// (form CDATA; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORM, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_KEYTYPE)) {
+			// (keytype CDATA; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_KEYTYPE, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_LOW)) {
+			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_LOW, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_HIGH)) {
+			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_HIGH, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_OPTIMUM)) {
+			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_OPTIMUM, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_MIN)) {
+			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_MIN, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_MAX)) {
+			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_MAX, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_OPEN)) {
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			atype.setEnumValues(new String[] { ATTR_NAME_OPEN });
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_OPEN, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_PUBDATE)) {
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			atype.setEnumValues(new String[] { ATTR_NAME_PUBDATE });
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_PUBDATE, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_SPELLCHECK)) {
+			// (spellcheck (EMPTY|TRUE|FALSE) TRUE)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_EMPTY, ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_FALSE);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SPELLCHECK, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONABORT)) {
+			// (onabort %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONABORT, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONCAN_PLAY)) {
+			// (oncanplay %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONCAN_PLAY, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONCAN_PLAY_THROUGH)) {
+			// (oncanplaythrough %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONCAN_PLAY_THROUGH, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONCHANGE)) {
+			// (onchange %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONCHANGE, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONCONTEXT_MENU)) {
+			// (onacontextmenu %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONCONTEXT_MENU, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDRAG)) {
+			// (onadrag %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDRAG, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDRAG_END)) {
+			// (ondragend %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDRAG_END, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDRAG_ENTER)) {
+			// (ondragenter %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDRAG_ENTER, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDRAG_LEAVE)) {
+			// (ondragleave %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDRAG_LEAVE, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDRAG_OVER)) {
+			// (ondragover %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDRAG_OVER, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDRAG_START)) {
+			// (ondragstart %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDRAG_START, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDROP)) {
+			// (ondrop %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDROP, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDURATION_CHANGE)) {
+			// (ondurationchange %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDURATION_CHANGE, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONEMPTIED)) {
+			// (onemptied %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONEMPTIED, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONENDED)) {
+			// (onended %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONENDED, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONERROR)) {
+			// (onerror %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONERROR, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONFOCUS)) {
+			// (onfocus %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONFOCUS, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONFORM_CHANGE)) {
+			// (onformchange %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONFORM_CHANGE, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONFORM_INPUT)) {
+			// (onforminput %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONFORM_INPUT, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONINPUT)) {
+			// (oninput %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONINPUT, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONINVALID)) {
+			// (oninvalid %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONINVALID, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONLOAD)) {
+			// (onload %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONLOAD, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONLOAD_START)) {
+			// (onloadstart %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONLOAD_START, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONLOADED_DATA)) {
+			// (onloadeddata %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONLOADED_DATA, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONLOADED_METADATA)) {
+			// (onloadedmetadata %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONLOADED_METADATA, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONMOUSE_WHEEL)) {
+			// (onmousewheel %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONMOUSE_WHEEL, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONPLAY)) {
+			// (onplay %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONPLAY, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONPLAYING)) {
+			// (onplaying %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONPLAYING, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONPAUSE)) {
+			// (onpause %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONPAUSE, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONPROGRESS)) {
+			// (onprogress %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONPROGRESS, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONRATE_CHANGE)) {
+			// (onratechange %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONRATE_CHANGE, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONREADY_STATE_CHANGE)) {
+			// (onreadystatechange %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONREADY_STATE_CHANGE, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSCROLL)) {
+			// (onscroll %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSCROLL, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSEEKED)) {
+			// (onseeked %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSEEKED, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSEEKING)) {
+			// (onseeking %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSEEKING, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSELECT)) {
+			// (onselect %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSELECT, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSHOW)) {
+			// (onshow %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSHOW, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSTALLED)) {
+			// (onstalled %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSTALLED, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSUBMIT)) {
+			// (onsubmit %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSUBMIT, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSUSPEND)) {
+			// (onsuspend %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSUSPEND, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONTIME_UPDATE)) {
+			// (ontimeupdate %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONTIME_UPDATE, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONVOLUME_UPDATE)) {
+			// (onvolumeupdate %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONVOLUME_UPDATE, atype, CMAttributeDeclaration.OPTIONAL);
+
+		}
+		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONWAITING)) {
+			// (onwaiting %Script; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONWAITING, atype, CMAttributeDeclaration.OPTIONAL);
+		}
+		else {
+			attr = super.create(attrName);
+		}
+		return attr;
+	}
+
+	public void getAttrs(CMNamedNodeMapImpl declarations) {
+		// %coreattrs;
+		getCore(declarations);
+		// %events;
+		getEvents(declarations);
+	}
+
+	public void getCore(CMNamedNodeMapImpl declarations) {
+		Iterator names = Arrays.asList(CORE).iterator();
+		getDeclarations(declarations, names);
+	}
+
+	public void getEvents(CMNamedNodeMapImpl declarations) {
+		Iterator names = Arrays.asList(EVENTS).iterator();
+		getDeclarations(declarations, names);
+	}
+	
+	public void createAttributeDeclarations(String elementName, CMNamedNodeMapImpl attributes) {
+		/* (type %InputType; TEXT) ... should be defined locally.
+		 * (name CDATA #IMPLIED)
+		 * (value CDATA #IMPLIED)
+		 * (checked (checked) #IMPLIED)
+		 * (disabled (disabled) #IMPLIED)
+		 * (readonly (readonly) #IMPLIED)
+		 * (size CDATA #IMPLIED) ... should be defined locally.
+		 * (maxlength NUMBER #IMPLIED)
+		 * (src %URI; #IMPLIED)
+		 * (alt CDATA #IMPLIED) ... should be defined locally.
+		 * (accept %ContentTypes; #IMPLIED)
+		 * (width CDATA; #IMPLIED)
+		 * (height CDATA; #IMPLIED)
+		 * (autocomplete Boolean; #IMPLIED)
+		 * (autofocus Boolean; #IMPLIED)
+		 * (form CDATA; #IMPLIED)
+		 * (formaction)
+		 * (formenctype)
+		 * (formmethod)
+		 * (formnovalidate)
+		 * (formtarget)
+		 * (list)
+		 * (max)
+		 * (min)
+		 * (multiple)
+		 * (pattern)
+		 * (placeholder CDATA #IMPLIED)
+		 * (required)
+		 * (step)
+		 * discouraged tags :- 
+		 * (usemap %URI; #IMPLIED)
+		 * (ismap (ismap) #IMPLIED)
+		 */
+		if (elementName.equals(HTML40Namespace.ElementName.INPUT)){
+			HTMLCMDataTypeImpl atype = null;
+			HTMLAttrDeclImpl attr = null;
+			// (type %InputType; TEXT) ... should be defined locally.
+			// NOTE: %InputType is ENUM;
+			// (text | password | checkbox | radio | submit | reset |
+			//  file | hidden | image | button
+			//  color| date | time | datetime | datetime-local | month | week| email| 
+			//  number | range | search | tel)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_TEXT, ATTR_VALUE_PASSWORD, ATTR_VALUE_CHECKBOX, ATTR_VALUE_RADIO, ATTR_VALUE_SUBMIT, ATTR_VALUE_RESET, ATTR_VALUE_FILE, ATTR_VALUE_HIDDEN, ATTR_VALUE_IMAGE, ATTR_VALUE_BUTTON,
+					 ATTR_VALUE_COLOR, ATTR_VALUE_DATE, ATTR_VALUE_DATETIME, ATTR_VALUE_DATETIME_LOCAL, ATTR_VALUE_EMAIL, ATTR_VALUE_MONTH, ATTR_VALUE_NUMBER, ATTR_VALUE_RANGE, ATTR_VALUE_SEARCH, ATTR_VALUE_TEL, ATTR_VALUE_TIME};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TEXT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+
+			// (size CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_SIZE, attr);
+
+			// (alt CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ALT, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_ALT, attr);
+			
+			
+			// (type %autocomeplete; ) ... should be defined locally.
+			// NOTE: %autocomeplete is ENUM;
+			// (on | off)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] autoCompleteValues = {ATTR_VALUE_ON, ATTR_VALUE_OFF};
+			atype.setEnumValues(autoCompleteValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_AUTOCOMPLETE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_AUTOCOMPLETE, attr);
+
+			
+			// (form CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORM, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORM, attr);
+			
+			
+			// (formaction URI #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMACTION, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMACTION, attr);
+
+			
+			// (type %formmethod; GET) ... should be defined locally.
+			// NOTE: %formmethod is ENUM;
+			// (GET|POST|PUT|DELETE)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] formMethodValues = {ATTR_VALUE_GET, ATTR_VALUE_POST, ATTR_VALUE_PUT, ATTR_VALUE_DELETE};
+			atype.setEnumValues(formMethodValues);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_GET);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMMETHOD, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMMETHOD, attr);
+
+			// (type %formenctype; GET) ... should be defined locally.
+			// NOTE: %formenctype is ENUM;
+			// (application/x-www-form-urlencoded| multipart/form-data| text/plain)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] formEncTypeValues = {ATTR_VALUE_WWW_FORM_URLENCODED, ATTR_VALUE_FORM_DATA, ATTR_VALUE_PLAIN};
+			atype.setEnumValues(formEncTypeValues);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_WWW_FORM_URLENCODED);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMENCTYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMENCTYPE, attr);
+
+			// (formtarget BROWSEING CONTEXT #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.BROWSING_CONTEXT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMTARGET, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMTARGET, attr);
+			
+			// (formtnovalidate  #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			// boolean attribute must have the same value as its name.
+			String[] formNoValidateValues = {ATTR_NAME_FORMNOVALIDATE};
+			atype.setEnumValues(formNoValidateValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMNOVALIDATE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMNOVALIDATE, attr);
+
+		
+			// (list ID #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.ID);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_LIST, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_LIST, attr);
+
+			// (min CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_MIN, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_MIN, attr);
+
+			// (max CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_MAX, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_MAX, attr);
+
+			// (maxlength NUMBER #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_MAXLENGTH, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_MAXLENGTH, attr);
+
+			// (multiple  #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			// boolean attribute must have the same value as its name.
+			String[] multipleValues = {ATTR_NAME_MULTIPLE};
+			atype.setEnumValues(multipleValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_MULTIPLE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_MULTIPLE, attr);
+
+		
+			// (step CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_STEP, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_STEP, attr);
+
+			// (placeholder CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_PLACEHOLDER, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_PLACEHOLDER, attr);
+
+			// (pattern CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_PATTERN, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_PATTERN, attr);
+
+			// (required  #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			// boolean attribute must have the same value as its name.
+			String[] requiredValues = {ATTR_NAME_REQUIRED};
+			atype.setEnumValues(requiredValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_REQUIRED, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_REQUIRED, attr);
+
+			String[] names = {ATTR_NAME_NAME, ATTR_NAME_VALUE, ATTR_NAME_CHECKED, ATTR_NAME_DISABLED, ATTR_NAME_READONLY, ATTR_NAME_SIZE, ATTR_NAME_MAXLENGTH, ATTR_NAME_SRC, ATTR_NAME_ALT, ATTR_NAME_ACCEPT, //<<D215684
+						ATTR_NAME_WIDTH, ATTR_NAME_HEIGHT,			//<D215684
+				//html5
+						ATTR_NAME_AUTOFOCUS
+			};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+			//discouraged
+			// (ismap (ismap) #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] ismapValues = {ATTR_NAME_ISMAP};
+			atype.setEnumValues(ismapValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ISMAP, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_ISMAP, attr);
+			
+			// (usemap %URI; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_USEMAP, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_USEMAP, attr);
+
+			
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		}
+		/* (href %URI; #IMPLIED)
+		 * (hreflang %LanguageCode; #IMPLIED)
+		 * (type %ContentType; #IMPLIED): should be defined locally.
+		 * (rel %LinkTypes; #IMPLIED)
+		 * (media %MediaDesc; #IMPLIED)
+		 * // discouraged
+		 * (charset %Charset; #IMPLIED)
+		 * (rev %LinkTypes; #IMPLIED)
+		 * (target %FrameTarget; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.LINK)){
+			String[] names = { ATTR_NAME_TYPE, ATTR_NAME_HREF, ATTR_NAME_HREFLANG, ATTR_NAME_REL,  ATTR_NAME_MEDIA};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// (sizes %Pixels; #IMPLIED)
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZES, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_SIZES, attr);
+			
+			//discouraged
+			// (charset %Charset; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARSET);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_CHARSET, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_CHARSET, attr);
+			
+			// (rev %LinkTypes; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LINK_TYPES);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_REV, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_REV, attr);
+			
+			// (target %FrameTarget; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.FRAME_TARGET);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_TARGET, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_TARGET, attr);
+			
+		}
+		/* (type %ContentType; #IMPLIED)
+		 * (href %URI; #IMPLIED)
+		 * (hreflang %LanguageCode; #IMPLIED)
+		 * (target %FrameTarget; #IMPLIED)
+		 * (rel %LinkTypes; #IMPLIED)
+		 * (media %media_desc; #IMPLIED
+		 * //discouraged
+		 * (charset %Charset; #IMPLIED)
+		 * (name CDATA #IMPLIED)
+		 * (rev %LinkTypes; #IMPLIED)
+		 * (directkey %Character; #IMPLIED)
+		 * (shape %Shape; rect)
+		 * (coords %Coords; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.A)){
+			String[] names = { ATTR_NAME_MEDIA, ATTR_NAME_TYPE, ATTR_NAME_HREF, ATTR_NAME_HREFLANG, ATTR_NAME_REL};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+			
+			
+			//discouraged
+			// (charset %Charset; #IMPLIED)
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARSET);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_CHARSET, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_CHARSET, attr);
+			
+			// (rev %LinkTypes; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LINK_TYPES);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_REV, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_REV, attr);
+			
+			// (target %FrameTarget; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.FRAME_TARGET);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_TARGET, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_TARGET, attr);
+			
+			// (directkey %Character; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARACTER);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_DIRECTKEY, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_DIRECTKEY, attr);
+			
+			// (shape %Shape; rect): %Shape; is (rect|circle|poly|default).
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_RECT, ATTR_VALUE_CIRCLE, ATTR_VALUE_POLY, ATTR_VALUE_DEFAULT};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_RECT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SHAPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_SHAPE, attr);
+			
+			// (coords %Coords; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COORDS);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_COORDS, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_COORDS, attr);
+			
+			// (name CDATA #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_NAME, attr);
+	
+		}
+		/*
+		 * (shape %Shape; rect)
+		 * (coords %Coords; #IMPLIED)
+		 * (href %URI; #IMPLIED)
+		 * (target %FrameTarget; #IMPLIED)
+		 * (alt %Text; #REQUIRED)
+		 * (media %media_desc; #IMPLIED)
+		 * (rel %LinkTypes; #IMPLIED)
+		 * (type %ContentType; #IMPLIED)
+		 * //disocuraged
+		 * (nohref (nohref) #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.AREA)){
+			// (media %MediaDesc; #IMPLIED)
+			String[] names = {ATTR_NAME_TYPE, ATTR_NAME_MEDIA, ATTR_NAME_SHAPE, ATTR_NAME_COORDS, ATTR_NAME_HREF, ATTR_NAME_HREFLANG, ATTR_NAME_TARGET, ATTR_NAME_ALT, ATTR_NAME_REL};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+			
+			// (nohref (nohref) #IMPLIED)
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_NAME_NOHREF};
+			atype.setEnumValues(values);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_NOHREF, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_NOHREF, attr);
+		
+		}
+		/*
+		 *  %globalattrs;
+		 * (http-equiv NAME #IMPLIED)
+		 * (name NAME #IMPLIED) ... should be defined locally.
+		 * (content CDATA #REQUIRED)
+		 * (charset %Charset; #IMPLIED)
+		 *  //discouraged
+		 * (scheme CDATA #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.META)){
+			// globalattrs;
+			getAttrs(attributes);
+
+			// (name NAME #IMPLIED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.NAME);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_NAME, attr);
+
+			// (content CDATA #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_CONTENT, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_CONTENT, attr);
+			
+			String[] names = {ATTR_NAME_HTTP_EQUIV, ATTR_NAME_CHARSET};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+			
+			// discouraged
+			// (scheme CDATA #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SCHEME, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_SCHEME, attr);
+			
+		}
+		/*
+		 * (src %URI; #REQUIRED): should be defined locally.
+		 * (alt %Text; #REQUIRED)
+		 * (usemap %URI; #IMPLIED)
+		 * (ismap (ismap) #IMPLIED)
+		 *  // discouraged
+		 * (longdesc %URI; #IMPLIED)
+		 * (name CDATA #IMPLIED)
+		 * (height %Length; #IMPLIED)
+		 * (width %Length; #IMPLIED)
+		 * (align %IAlign; #IMPLIED): should be defined locally.
+		 * (border %Pixels; #IMPLIED)
+		 * (hspace %Pixels; #IMPLIED)
+		 * (vspace %Pixels; #IMPLIED)
+		 * (mapfile %URI; #IMPLIED)
+	 
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.IMG)){
+			// (src %URI; #REQUIRED): should be defined locally.
+			HTMLCMDataTypeImpl atype = null;
+			HTMLAttrDeclImpl attr = null;
+			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
+			attributes.putNamedItem(ATTR_NAME_SRC, attr);
+
+			String[] names = {ATTR_NAME_ALT, ATTR_NAME_LONGDESC, ATTR_NAME_NAME, ATTR_NAME_HEIGHT, ATTR_NAME_WIDTH, ATTR_NAME_USEMAP, ATTR_NAME_ISMAP, ATTR_NAME_BORDER, ATTR_NAME_HSPACE, ATTR_NAME_VSPACE, ATTR_NAME_MAPFILE};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// align (local); should be defined locally.
+			attr = AttributeCollection.createAlignForImage();
+			attributes.putNamedItem(ATTR_NAME_ALIGN, attr);
+		
+		}
+		/*
+		 * (name CDATA #REQUIRED) ... should be defined locally.
+		 * (value CDATA #IMPLIED)
+		 * global attributes
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.PARAM)){
+			
+			// (name CDATA #REQUIRED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.REQUIRED);
+			attributes.putNamedItem(ATTR_NAME_NAME, attr);
+			
+			// (value CDATA #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_VALUE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_VALUE, attr);
+			
+			// gloabl attrs
+			getAttrs(attributes);
+		}
+		/*
+		 * (autofocus Boolean; #IMPLIED)
+		 * (form CDATA; #IMPLIED)
+		 * (placeholder CDATA #IMPLIED)
+		 * (name CDATA #IMPLIED)
+		 * (rows NUMBER #REQUIRED)
+		 * (cols NUMBER #REQUIRED)
+		 * (disabled (disabled) #IMPLIED)
+		 * (readonly (readonly) #IMPLIED)
+		 * (maxlength NUMBER; #IMPLIED)
+		 * (wrap ENUM; #IMPLIED)
+		 *  //discouraged
+		 * (istyle CDATA #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.TEXTAREA)){
+			String[] names = {ATTR_NAME_MAXLENGTH, ATTR_NAME_FORM, ATTR_NAME_AUTOFOCUS, ATTR_NAME_NAME, ATTR_NAME_ROWS, ATTR_NAME_COLS, ATTR_NAME_DISABLED, ATTR_NAME_READONLY};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+			
+			// (placeholder CDATA #IMPLIED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_PLACEHOLDER, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_PLACEHOLDER, attr);
+			
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_SOFT, ATTR_VALUE_HARD};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_SOFT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_WRAP, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_WRAP, attr);
+			
+			// discouraged
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ISTYLE, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_ISTYLE, attr);
+		}
+		/*
+		 * (charset %Charset; #IMPLIED)
+		 * (type %ContentType; #REQUIRED) ... should be defined locally.
+		 * (asynch boolean #IMPLIED)
+		 * (src %URI; #IMPLIED)
+		 * (defer (defer) #IMPLIED)
+		 *  // discouraged
+		 * (language CDATA #IMPLIED)
+		 * (event CDATA #IMPLIED)
+		 * (for %URI; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.TEXTAREA)){
+			String[] names = {ATTR_NAME_CHARSET,  ATTR_NAME_SRC, ATTR_NAME_DEFER};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// (type %ContentType; #REQUIRED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, "text/javascript"); //$NON-NLS-1$
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.REQUIRED);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+			
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_NAME_ASYNC};
+			atype.setEnumValues(values);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_ASYNC, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_ASYNC, attr);
+			
+			
+			// discouraged
+			// (language %CDATA; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_LANGUAGE, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_LANGUAGE, attr);
+			
+			// (event CDATA #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_EVENT, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_EVENT, attr);
+			
+			// (for %URI; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FOR, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_FOR, attr);
+		
+		}
+		/*
+		 *  %attrs;
+		 * (type %ContentType; #REQUIRED) ... should be defined locally.
+		 * (media %MediaDesc; #IMPLIED)
+		 * (scoped boolean; #implied)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.STYLE)){
+			// %i18n;
+			getAttrs(attributes);
+
+			String[] names = {ATTR_NAME_MEDIA};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+			// (type %ContentType; #REQUIRED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, "text/css"); //$NON-NLS-1$
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.REQUIRED);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+			
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_NAME_SCOPED};
+			atype.setEnumValues(values);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SCOPED, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_SCOPED, attr);
+		}
+		/*
+		 * %reserved;
+		 * (name CDATA #IMPLIED)
+		 * (size NUMBER #IMPLIED) ... should be defined locally.
+		 * (multiple (multiple) #IMPLIED)
+		 * (disabled (disabled) #IMPLIED)
+		 * (autofocus Boolean; #IMPLIED)
+		 * (form CDATA; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.SELECT)){
+			// (size NUMBER #IMPLIED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_SIZE, attr);
+
+			String[] names = {ATTR_NAME_FORM, ATTR_NAME_AUTOFOCUS,ATTR_NAME_NAME, ATTR_NAME_MULTIPLE, ATTR_NAME_DISABLED, ATTR_NAME_TABINDEX, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR, ATTR_NAME_ONCHANGE};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+		
+		}
+		/*
+		 * (value NUMBER #IMPLIED) ... should be defined locally.
+		 *  //discouraged
+		 *  (type %LIStyle; #IMPLIED) ... should be defined locally.
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.LI)){
+			// (type %LIStyle; #IMPLIED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LI_STYLE);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+
+			// (value NUMBER #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_VALUE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_VALUE, attr);
+		
+		}
+		/*
+		 * (start NUMBER #IMPLIED)
+		 * (reversed BOOLEAN; IMPLIED)
+		 *   //discouraged
+		 * (type %OLStyle; #IMPLIED) ... should be defined locally.
+		 * (compact (compact) #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.OL)){
+
+			String[] names = { ATTR_NAME_START};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+			
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_NAME_REVERSED};
+			atype.setEnumValues(values);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_REVERSED, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_REVERSED, attr);
+			
+			//discouraged 
+			// (type %OLStyle; #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.OL_STYLE);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+			
+			// (compact (compact) #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] compactValues = {ATTR_NAME_COMPACT};
+			atype.setEnumValues(compactValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_COMPACT, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_COMPACT, attr);
+		}
+		/**
+		 * %attrs;
+		 * (src %URI; #IMPLIED)
+		 * (srcdoc %CONTENT_TYPE; #IMPLIED)
+		 * (seamless BOOLEAN; #IMPLIED)
+		 * (sandbox CDATA; #IMPLED)
+		 * (height %Length; #IMPLIED)
+		 * (width %Length; #IMPLIED)
+		 * (name CDATA #IMPLIED)
+		 * //discouraged
+		 * (longdesc %URI; #IMPLIED)
+		 * (frameborder (1|0) 1)
+		 * (marginwidth %Pixels; #IMPLIED)
+		 * (marginheight %Pixels; #IMPLIED)
+		 * (scrolling (yes|no|auto) auto)
+		 * (align %IAlign; #IMPLIED) ... should be defined locally.
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.IFRAME)){
+			// %attrs;
+			getAttrs(attributes);
+			
+			//srcdoc
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_SRCDOC, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_SRCDOC, attr);
+
+			// (seamless (seamless) #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] compactValues = {ATTR_NAME_SEAMLESS};
+			atype.setEnumValues(compactValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SEAMLESS, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_SEAMLESS, attr);
+		
+			//sandbox
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SANDBOX, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_SANDBOX, attr);
+			
+			
+			String[] names = { ATTR_NAME_NAME, ATTR_NAME_SRC, ATTR_NAME_HEIGHT, ATTR_NAME_WIDTH};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			//discouraged
+			// (marginwidth %Pixels; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_MARGINWIDTH, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_MARGINWIDTH, attr);
+			
+			// (marginheight %Pixels; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_MARGINHEIGHT, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_MARGINHEIGHT, attr);
+			
+			// (scrolling (yes|no|auto) auto)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_YES, ATTR_VALUE_NO, ATTR_VALUE_AUTO};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_AUTO);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_SCROLLING, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_SCROLLING, attr);
+
+			// (frameborder (1|0) 1)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] frameValues = {ATTR_VALUE_1, ATTR_VALUE_0};
+			atype.setEnumValues(frameValues);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_1);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FRAMEBORDER, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_FRAMEBORDER, attr);
+			
+			// (longdesc %URI; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_LONGDESC, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_LONGDESC, attr);
+			
+			
+			// align
+			attr = AttributeCollection.createAlignForImage();
+			if (attr != null)
+				attr.obsolete(true);
+				attributes.putNamedItem(ATTR_NAME_ALIGN, attr);
+		}
+		/*
+		 * (%attrs)
+		 * (manisfest %URI; #IMPLIED)
+		 * (xmlns %URI; #IMPLIED)
+		 * //discouraged
+		 * (version CDATA #FIXED '%HTML.Version;)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.HTML)){
+			// %attrs;
+			getAttrs(attributes);
+			// (manisfest %URI; #IMPLIED)
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_MANIFEST, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_MANIFEST, attr);
+			
+			// (version CDATA #FIXED '%HTML.Version;)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_FIXED, ATTR_VALUE_VERSION_TRANSITIONAL);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_VERSION, atype, CMAttributeDeclaration.FIXED);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_VERSION, attr);
+			
+			// (xmlns CDATA #FIXED '%xmlns;)
+			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_XMLNS, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_XMLNS, attr);
+		}
+		/*
+		 * (type enum; (context | toolbar | list))
+		 * (label %Text; #IMPLIED)
+		 *  //discouraged
+		 * (compact (compact) #IMPLIED)
+	 	 */
+		else if (elementName.equals(HTML40Namespace.ElementName.MENU)){
+			// (type %menuType; list) ... should be defined locally is ENUM.
+			//  (context | toolbar | list)
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_CONTEXT, ATTR_VALUE_TOOLBAR, ATTR_VALUE_LIST};
+			atype.setEnumValues(values);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_LIST);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+
+			// (label %Text; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_LABEL, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_LABEL, attr);
+
+			// (compact (compact) #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] compactValues = {ATTR_NAME_COMPACT};
+			atype.setEnumValues(compactValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_COMPACT, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_COMPACT, attr);
+		}
+		/*
+		 * (type %button; TEXT) ... should be defined locally.
+		 * (name CDATA #IMPLIED)
+		 * (value CDATA #IMPLIED)
+		 * (disabled (disabled) #IMPLIED)
+		 * (autofocus Boolean; #IMPLIED)
+		 * (form CDATA; #IMPLIED)
+		 * (formaction)
+		 * (formenctype)
+		 * (formmethod)
+		 * (formnovalidate)
+		 * (formtarget)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.BUTTON)){
+			// (type (button|submit|reset) submit) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_BUTTON, ATTR_VALUE_SUBMIT, ATTR_VALUE_RESET};
+			atype.setEnumValues(values);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_TYPE, attr);
+			
+
+			String[] names = {ATTR_NAME_NAME, ATTR_NAME_VALUE, ATTR_NAME_DISABLED,
+				//html5
+						ATTR_NAME_AUTOFOCUS
+			};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+			
+			// (form CDATA #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORM, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORM, attr);
+			
+			
+			// (formaction URI #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMACTION, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMACTION, attr);
+
+			
+			// (type %formmethod; GET) ... should be defined locally.
+			// NOTE: %formmethod is ENUM;
+			// (GET|POST|PUT|DELETE)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] formMethodValues = {ATTR_VALUE_GET, ATTR_VALUE_POST, ATTR_VALUE_PUT, ATTR_VALUE_DELETE};
+			atype.setEnumValues(formMethodValues);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_GET);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMMETHOD, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMMETHOD, attr);
+
+			// (type %formenctype; GET) ... should be defined locally.
+			// NOTE: %formenctype is ENUM;
+			// (application/x-www-form-urlencoded| multipart/form-data| text/plain)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] formEncTypeValues = {ATTR_VALUE_WWW_FORM_URLENCODED, ATTR_VALUE_FORM_DATA, ATTR_VALUE_PLAIN};
+			atype.setEnumValues(formEncTypeValues);
+			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_WWW_FORM_URLENCODED);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMENCTYPE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMENCTYPE, attr);
+
+			// (formtarget BROWSEING CONTEXT #IMPLIED) ... should be defined locally.
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.BROWSING_CONTEXT);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMTARGET, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMTARGET, attr);
+			
+			// (formtnovalidate  #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			// boolean attribute must have the same value as its name.
+			String[] formNoValidateValues = {ATTR_NAME_FORMNOVALIDATE};
+			atype.setEnumValues(formNoValidateValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FORMNOVALIDATE, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORMNOVALIDATE, attr);
+
+		}
+		/*
+		 * (name CDATA #IMPLIED)
+		 * (disabled (disabled) #IMPLIED)
+		 * (form CDATA; #IMPLIED)
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.FIELDSET)){
+			// (form CDATA #IMPLIED) ... should be defined locally.
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_FORM, atype, CMAttributeDeclaration.OPTIONAL);
+			attributes.putNamedItem(ATTR_NAME_FORM, attr);
+			
+			String[] names = {ATTR_NAME_NAME, ATTR_NAME_DISABLED };
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+				
+		}
+		/*
+		 * (summary %Text; #IMPLIED)
+		 *  //discouraged
+		 * %reserved;
+		 * (width %Length; #IMPLIED)
+		 * (border %Pixels; #IMPLIED)
+		 * (frame %TFrame; #IMPLIED)
+		 * (rules %TRules; #IMPLIED)
+		 * (cellspacing %Length; #IMPLIED)
+		 * (cellpadding %Length; #IMPLIED)
+		 * (align %TAlign; #IMPLIED)
+		 * (bgcolor %Color; #IMPLIED)
+		 * (datapagesize CDATA #IMPLIED)
+		 * (height %Pixels; #IMPLIED)
+		 * (background %URI; #IMPLIED)
+		 * (bordercolor %Color #IMPLIED) ... D205514
+		 */
+		else if (elementName.equals(HTML40Namespace.ElementName.TABLE)){
+			// %reserved;
+			// ... %reserved; is empty in the current DTD.
+
+			String[] names = {ATTR_NAME_SUMMARY};
+			getDeclarations(attributes, Arrays.asList(names).iterator());
+
+			// align (local)
+			HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] alignValues = {ATTR_VALUE_LEFT, ATTR_VALUE_CENTER, ATTR_VALUE_RIGHT};
+			atype.setEnumValues(alignValues);
+			HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_ALIGN, attr);
+			
+			// (width %Length; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_WIDTH, attr);
+			
+			// (border %Pixels; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_BORDER, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_BORDER, attr);
+			
+			// (frame %TFrame; #IMPLIED)
+			// %TFrame; is
+			// (void|above|below|hsides|lhs|rhs|vsides|box|border).
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = {ATTR_VALUE_VOID, ATTR_VALUE_ABOVE, ATTR_VALUE_BELOW, ATTR_VALUE_HSIDES, ATTR_VALUE_LHS, ATTR_VALUE_RHS, ATTR_VALUE_VSIDES, ATTR_VALUE_BOX, ATTR_VALUE_BORDER};
+			atype.setEnumValues(values);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_FRAME, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_FRAME, attr);
+			
+			// (rules %TRules; #IMPLIED)
+			// %TRules; is (none | groups | rows | cols | all).
+			atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] ruleValues = {ATTR_VALUE_NONE, ATTR_VALUE_GROUPS, ATTR_VALUE_ROWS, ATTR_VALUE_COLS, ATTR_VALUE_ALL};
+			atype.setEnumValues(ruleValues);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_RULES, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_RULES, attr);
+			
+			// (cellspacing %Length; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_CELLSPACING, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_CELLSPACING, attr);
+			
+			// (cellpadding %Length; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_CELLPADDING, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_CELLPADDING, attr);
+			
+			// (bgcolor %Color; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_BGCOLOR, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_BGCOLOR, attr);
+			
+			// (datapagesize CDATA #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_DATAPAGESIZE, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_DATAPAGESIZE, attr);
+			
+			// (height %Length; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_HEIGHT, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_HEIGHT, attr);
+			
+			// (background %URI; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_BACKGROUND, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_BACKGROUND, attr);
+			
+			// (bordercolor, %Color; #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
+			attr = new HTMLAttrDeclImpl(ATTR_NAME_BORDERCOLOR, atype, CMAttributeDeclaration.OPTIONAL);
+			attr.obsolete(true);
+			attributes.putNamedItem(ATTR_NAME_BORDERCOLOR, attr);
+			
+			
+		}
+	}
+	
+	public static String[] getGlobalAttributeList(){
+		return CORE;
+	}
+	
+	public static String[] getGlobalEventList(){
+		return EVENTS;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5ElementCollection.java
new file mode 100644
index 0000000..9e2d4b8
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5ElementCollection.java
@@ -0,0 +1,577 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import java.lang.reflect.Field;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Vector;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+/**
+ * Factory for element declarations.
+ */
+class HTML5ElementCollection extends ElementCollection implements org.eclipse.wst.html.core.internal.provisional.HTML50Namespace.ElementName {
+
+
+	// Element IDs
+	private static class Ids50 extends Ids {
+		// <<D205513
+		
+		public static final int ID_ARTICLE =106;
+		public static final int ID_ASIDE =107;
+		public static final int ID_AUDIO =108;
+		public static final int ID_CANVAS =109;
+		public static final int ID_COMMAND =110;
+		public static final int ID_DATALIST =111;
+		public static final int ID_DETAILS = 112;
+		public static final int ID_FIGURE =113;
+		public static final int ID_FIGCAPTION = 114;
+		public static final int ID_FOOTER =115;
+		public static final int ID_HEADER = 116;
+		public static final int ID_HGROUP =117;
+		public static final int ID_KEYGEN =118;
+		public static final int ID_MARK =119;
+		public static final int ID_MATH =120;
+		public static final int ID_METER =121;
+		public static final int ID_NAV =122;
+		public static final int ID_OUTPUT =123;
+		public static final int ID_PROGRESS =124;
+		public static final int ID_RP = 125;
+		public static final int ID_RT = 126;
+		public static final int ID_RUBY =127;
+		public static final int ID_SECTION =128;
+		public static final int ID_SOURCE = 129;
+		public static final int ID_SUMMARY = 130;
+		public static final int ID_SVG =131;
+		public static final int ID_TIME =132;
+		public static final int ID_VIDEO =133;
+
+		// D205513
+
+		public static int getNumOfIds() {
+			if (numofids != -1)
+				return numofids;
+
+			// NOTE: If the reflection is too slow, this method should
+			// just return the literal value, like 105.
+			// -- 5/25/2001
+			Class clazz = Ids50.class;
+			Field[] fields = clazz.getFields();
+			numofids = 0;
+			for (int i = 0; i < fields.length; i++) {
+				String name = fields[i].getName();
+				if (name.startsWith("ID_"))//$NON-NLS-1$
+					numofids++;
+			}
+			return numofids;
+		}
+
+		// chache the result of the reflection.
+		private static int numofids = -1;
+	}
+
+	/** %fontstyle;. TT | I | B | U | S | STRIKE | BIG | SMALL | BLINK */
+	private static final String[] FONTSTYLE = {TT, I, B, U, S, STRIKE, BIG, SMALL, BLINK};
+	/** %formctl;. INPUT | SELECT | TEXTAREA | LABEL | BUTTON */
+	private static final String[] FORMCTL = {INPUT, SELECT, TEXTAREA, LABEL, BUTTON, DATALIST};
+	/** %phrase;.
+	 * EM | STRONG | DFN | CODE | SAMP | KBD | VAR | CITE | ABBR | ACRONYM | MARK
+	 */	private static final String[] PHRASE = {KEYGEN, EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ABBR, ACRONYM, MARK};
+	/** %special;.
+	 * A | IMG | APPLET | OBJECT | FONT | BASEFONT | BR | SCRIPT |
+	 * MAP | Q | SUB | SUP | SPAN | BDO | IFRAME | EMBED | MARQUEE |
+	 * D2W | SUBMIT
+	 * WBR | NOBR | BGSOUND
+	 */
+	private static final String[] SPECIAL = {A, IMG, APPLET, OBJECT, FONT, BASEFONT, BR, WBR, // D205513
+				SCRIPT, MAP, Q, SUB, SUP, SPAN, BDO, IFRAME, EMBED, BGSOUND, // D205513
+				MARQUEE, NOBR, // D205513
+				OUTPUT, TIME, METER, PROGRESS,
+				COMMAND
+	};
+	/** %heading;. H[1-6] */
+	private static final String[] HEADING = {H1, H2, H3, H4, H5, H6};
+	/** %list;. UL | OL | DIR | MENU */
+	private static final String[] LIST = {UL, OL, DIR, MENU};
+	/** %preformatted;. PRE */
+	private static final String[] PREFORMATTED = {PRE};
+	/** %sectioning;. ARTICLE | ASIDE | NAV | SECTION */
+	private static final String[] SECTIONING = { ARTICLE, ASIDE, NAV, SECTION };
+
+	/** %embedded;. AUDIO|CANVAS|EMBED|IFRAME|IMG|MATH|OBJECT|SVG|VIDEO */
+	private static final String[] EMBEDDED = { AUDIO, CANVAS, EMBED, IFRAME, IMG, MATH, OBJECT, SVG, VIDEO};
+
+    private static String[] fNames = null;
+
+	/**
+	 */
+	public HTML5ElementCollection(AttributeCollection collection) {
+		super(getNames(), collection);
+		attributeCollection = collection;
+	}
+
+	/**
+	 * Actually creates HTMLElementDeclaration instance.
+	 * @return HTMLElementDeclaration
+	 */
+	protected CMNode create(String elementName) {
+		CMNode edec = null;
+
+		if (elementName.equalsIgnoreCase(ACRONYM)) {
+			edec = new HedPhrase(ACRONYM, this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(APPLET)) {
+			edec = new HedAPPLET(this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(ARTICLE)) {
+			edec = new HedSectioning(ARTICLE, this);
+
+		}
+		else if (elementName.equalsIgnoreCase(ASIDE)) {
+			edec = new HedSectioning(ASIDE, this);
+
+		}
+		else if (elementName.equalsIgnoreCase(AUDIO)) {
+			edec = new HedMediaElement(AUDIO, this);
+
+		}
+		else if (elementName.equalsIgnoreCase(BASEFONT)) {
+			edec = new HedBASEFONT(this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(BIG)) {
+			edec = new HedFontStyle(BIG, this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(CANVAS)) {
+			edec = new HedCANVAS(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(CENTER)) {
+			edec = new HedCENTER(this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(COMMAND)) {
+			edec = new HedCOMMAND(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(DATALIST)) {
+			edec = new HedDATALIST(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(DETAILS)) {
+			edec = new HedDETAILS(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(DIR)) {
+			edec = new HedMENU(DIR, this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(FIGCAPTION)) {
+			edec = new HedFIGCAPTION(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(FIGURE)) {
+			edec = new HedFIGURE(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(FOOTER)) {
+			edec = new HedHEADER(HTML50Namespace.ElementName.FOOTER ,this);
+
+		}
+		else if (elementName.equalsIgnoreCase(FRAME)) {
+			edec = new HedFRAME(this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(FRAMESET)) {
+			edec = new HedFRAMESET(this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(HEADER)) {
+			edec = new HedHEADER(HTML50Namespace.ElementName.HEADER ,this);
+		}
+		else if (elementName.equalsIgnoreCase(HGROUP)) {
+			edec = new HedHGROUP(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(ISINDEX)) {
+			edec = new HedISINDEX(this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(KEYGEN)) {
+			edec = new HedKEYGEN(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(MARK)) {
+			edec = new HedPhrase(HTML50Namespace.ElementName.MARK,this);
+
+		}
+		else if (elementName.equalsIgnoreCase(MATH)) {
+			edec = new HedMath(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(METER)) {
+			edec = new HedMETER(this);
+		}
+		else if (elementName.equalsIgnoreCase(NAV)) {
+			edec = new HedSectioning(NAV, this);
+		}
+		else if (elementName.equalsIgnoreCase(NOFRAMES)) {
+			edec = new HedNOFRAMES(this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(OUTPUT)) {
+			edec = new HedOUTPUT(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(PROGRESS)) {
+			edec = new HedPROGRESS(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(RP)) {
+			edec = new HedRP(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(RT)) {
+			edec = new HedRT(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(RUBY)) {
+			edec = new HedRUBY(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(S)) {
+			edec = new HedFontStyle(S, this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(SECTION)) {
+			edec = new HedSectioning(SECTION, this);
+
+		}
+		else if (elementName.equalsIgnoreCase(SOURCE)) {
+			edec = new HedSOURCE(this);
+
+		}
+		else if (elementName.equalsIgnoreCase(STRIKE)) {
+			edec = new HedFontStyle(STRIKE, this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(SUMMARY)) {
+			edec = new HedSUMMARY(this);
+		}
+		else if (elementName.equalsIgnoreCase(SVG)) {
+			edec = new HedSVG(this);
+		}
+		else if (elementName.equalsIgnoreCase(TIME)) {
+			edec = new HedTIME(this);
+		}
+		else if (elementName.equalsIgnoreCase(TT)) {
+			edec = new HedFontStyle(TT, this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(U)) {
+			edec = new HedFontStyle(U, this);
+			((HTMLElemDeclImpl) edec).obsolete(true);
+		}
+		else if (elementName.equalsIgnoreCase(VIDEO)) {
+			edec = new HedVIDEO(this);
+
+		}
+		// unknown
+		else {
+			// NOTE: We don't define the UNKNOWN element declaration.
+			// <code>null</code> for a declaration is a sign of
+			// the target element is unknown.
+			// -- 3/9/2001
+			edec = super.create(elementName);
+		}
+		return edec;
+	}
+
+	public AttributeCollection getAttributeCollection() {
+		return attributeCollection;
+	}
+
+	public final Collection getNamesOfBlock() {
+		// P, DL, DIV, CENTER, NOSCRIPT, NOFRAMES, BLOCKQUOTE, FORM, ISINDEX, HR,
+		// TABLE, FIELDSET, ADDRESS, RUBY, FIGURE
+		String[] blockMisc = {HEADER, FOOTER, HGROUP, P, DL, DIV, CENTER, NOSCRIPT, NOFRAMES, BLOCKQUOTE, FORM, ISINDEX, HR, TABLE, FIELDSET, ADDRESS, RUBY, FIGURE};
+		Vector names = new Vector(Arrays.asList(blockMisc));
+		// %heading;
+		names.addAll(Arrays.asList(HEADING));
+		// %list;
+		names.addAll(Arrays.asList(LIST));
+		// %preformatted;
+		names.addAll(Arrays.asList(PREFORMATTED));
+
+		
+		return names;
+	}
+
+	
+	public final void getSectioning(CMGroupImpl group) {
+		if (group == null)
+			return;
+		getDeclarations(group, Arrays.asList(SECTIONING).iterator());
+	}
+	
+	public void getEmbedded(CMGroupImpl group) {
+		if (group == null)
+			return;
+		getDeclarations(group, Arrays.asList(EMBEDDED).iterator());
+	}
+
+	public void getFlow(CMGroupImpl group) {
+		if (group == null)
+			return;
+		super.getFlow(group);
+		getSectioning(group);
+		CMNode node = getNamedItem(DETAILS);
+		if (node != null) {
+			group.appendChild(node);
+		}
+	}
+
+	public void getInline(CMGroupImpl group) {
+		if (group == null)
+			return;
+		super.getInline(group);
+		getEmbedded(group);
+	}
+
+	/**
+	 * Create element declarations and store them into a <code>CMGroupImpl</code>
+	 * instance.<br>
+	 * @param group CMGroupImpl Return values.
+	 */
+	public final void getFontstyle(CMGroupImpl group) {
+		if (group == null)
+			return;
+		getDeclarations(group, Arrays.asList(FONTSTYLE).iterator());
+	}
+
+	/**
+	 * Create element declarations and store them into a <code>CMGroupImpl</code>
+	 * instance.<br>
+	 * @param group CMGroupImpl Return values.
+	 */
+	public final void getFormctrl(CMGroupImpl group) {
+		if (group == null)
+			return;
+		getDeclarations(group, Arrays.asList(FORMCTL).iterator());
+	}
+
+	/**
+	 * %heading;.
+	 * @param group CMGroupImpl Return values.
+	 */
+	public final void getHeading(CMGroupImpl group) {
+		if (group == null)
+			return;
+
+		getDeclarations(group, Arrays.asList(HEADING).iterator());
+	}
+
+	
+
+	/**
+	 * %list;.
+	 * @param group CMGroupImpl Return values.
+	 */
+	public final void getList(CMGroupImpl group) {
+		if (group == null)
+			return;
+
+		getDeclarations(group, Arrays.asList(LIST).iterator());
+	}
+
+	/**
+	 * Create element declarations and store them into a <code>CMGroupImpl</code>
+	 * instance.<br>
+	 * @param group CMGroupImpl Return values.
+	 */
+	public final void getPhrase(CMGroupImpl group) {
+		if (group == null)
+			return;
+		getDeclarations(group, Arrays.asList(PHRASE).iterator());
+	}
+
+	/**
+	 * %preformatted;
+	 * @param group CMGroupImpl Return values.
+	 */
+	public final void getPreformatted(CMGroupImpl group) {
+		if (group == null)
+			return;
+
+		getDeclarations(group, Arrays.asList(PREFORMATTED).iterator());
+	}
+
+	/**
+	 * Create element declarations and store them into a <code>CMGroupImpl</code>
+	 * instance.<br>
+	 * @param group CMGroupImpl Return values.
+	 */
+	public final void getSpecial(CMGroupImpl group) {
+		if (group == null)
+			return;
+		getDeclarations(group, Arrays.asList(SPECIAL).iterator());
+	}
+
+	private static String[] getNames() {
+		if (fNames == null) {
+			fNames = new String[Ids50.getNumOfIds()];
+			fNames[Ids.ID_A] = A;
+			fNames[Ids.ID_ABBR] = ABBR;
+			fNames[Ids.ID_ACRONYM] = ACRONYM;
+			fNames[Ids.ID_ADDRESS] = ADDRESS;
+			fNames[Ids.ID_APPLET] = APPLET;
+			fNames[Ids.ID_AREA] = AREA;
+			fNames[Ids50.ID_ARTICLE] = ARTICLE;
+			fNames[Ids50.ID_ASIDE] = ASIDE;
+			fNames[Ids50.ID_AUDIO] = AUDIO;
+			fNames[Ids.ID_B] = B;
+			fNames[Ids.ID_BASE] = BASE;
+			fNames[Ids.ID_BASEFONT] = BASEFONT;
+			fNames[Ids.ID_BDO] = BDO;
+			fNames[Ids.ID_BIG] = BIG;
+			fNames[Ids.ID_BLINK] = BLINK;
+			fNames[Ids.ID_BLOCKQUOTE] = BLOCKQUOTE;
+			fNames[Ids.ID_BODY] = BODY;
+			fNames[Ids.ID_BR] = BR;
+			fNames[Ids.ID_BUTTON] = BUTTON;
+			fNames[Ids.ID_CAPTION] = CAPTION;
+			fNames[Ids50.ID_CANVAS] = CANVAS;
+			fNames[Ids.ID_CENTER] = CENTER;
+			fNames[Ids.ID_CITE] = CITE;
+			fNames[Ids.ID_CODE] = CODE;
+			fNames[Ids.ID_COL] = COL;
+			fNames[Ids.ID_COLGROUP] = COLGROUP;
+			fNames[Ids50.ID_COMMAND] = COMMAND;
+			fNames[Ids50.ID_DATALIST] = DATALIST;
+			fNames[Ids50.ID_DETAILS] = DETAILS;
+			fNames[Ids.ID_DD] = DD;
+			fNames[Ids.ID_DEL] = DEL;
+			fNames[Ids.ID_DFN] = DFN;
+			fNames[Ids.ID_DIR] = DIR;
+			fNames[Ids.ID_DIV] = DIV;
+			fNames[Ids.ID_DL] = DL;
+			fNames[Ids.ID_DT] = DT;
+			fNames[Ids.ID_EM] = EM;
+			fNames[Ids.ID_EMBED] = EMBED;
+			fNames[Ids.ID_FIELDSET] = FIELDSET;
+			fNames[Ids50.ID_FIGURE] = FIGURE;
+			fNames[Ids50.ID_FIGCAPTION] = FIGCAPTION;
+			fNames[Ids.ID_FONT] = FONT;
+			fNames[Ids.ID_FORM] = FORM;
+			fNames[Ids50.ID_FOOTER] = FOOTER;
+			fNames[Ids.ID_FRAME] = FRAME;
+			fNames[Ids.ID_FRAMESET] = FRAMESET;
+			fNames[Ids.ID_H1] = H1;
+			fNames[Ids.ID_H2] = H2;
+			fNames[Ids.ID_H3] = H3;
+			fNames[Ids.ID_H4] = H4;
+			fNames[Ids.ID_H5] = H5;
+			fNames[Ids.ID_H6] = H6;
+			fNames[Ids.ID_HEAD] = HEAD;
+			fNames[Ids50.ID_HEADER] = HEADER;
+			fNames[Ids50.ID_HGROUP] = HGROUP;
+			fNames[Ids.ID_HR] = HR;
+			fNames[Ids.ID_HTML] = HTML;
+			fNames[Ids.ID_I] = I;
+			fNames[Ids.ID_IFRAME] = IFRAME;
+			fNames[Ids.ID_IMG] = IMG;
+			fNames[Ids.ID_INPUT] = INPUT;
+			fNames[Ids.ID_INS] = INS;
+			fNames[Ids.ID_ISINDEX] = ISINDEX;
+			fNames[Ids.ID_KBD] = KBD;
+			fNames[Ids50.ID_KEYGEN] = KEYGEN;
+			fNames[Ids.ID_LABEL] = LABEL;
+			fNames[Ids.ID_LEGEND] = LEGEND;
+			fNames[Ids.ID_LI] = LI;
+			fNames[Ids.ID_LINK] = LINK;
+			fNames[Ids.ID_MAP] = MAP;
+			fNames[Ids50.ID_MARK] = MARK;
+			fNames[Ids.ID_MARQUEE] = MARQUEE;
+			fNames[Ids50.ID_MATH] = MATH;
+			fNames[Ids.ID_MENU] = MENU;
+			fNames[Ids.ID_META] = META;
+			fNames[Ids50.ID_METER] = METER;
+			fNames[Ids50.ID_NAV] = NAV;
+			fNames[Ids.ID_NOEMBED] = NOEMBED;
+			fNames[Ids.ID_NOFRAMES] = NOFRAMES;
+			fNames[Ids.ID_NOSCRIPT] = NOSCRIPT;
+			fNames[Ids.ID_OBJECT] = OBJECT;
+			fNames[Ids.ID_OL] = OL;
+			fNames[Ids.ID_OPTGROUP] = OPTGROUP;
+			fNames[Ids.ID_OPTION] = OPTION;
+			fNames[Ids50.ID_OUTPUT] = OUTPUT;
+			fNames[Ids.ID_P] = P;
+			fNames[Ids.ID_PARAM] = PARAM;
+			fNames[Ids.ID_PRE] = PRE;
+			fNames[Ids50.ID_PROGRESS] = PROGRESS;
+			fNames[Ids.ID_Q] = Q;
+			fNames[Ids50.ID_RP] = RP;
+			fNames[Ids50.ID_RT] = RT;
+			fNames[Ids50.ID_RUBY] = RUBY;
+			fNames[Ids.ID_S] = S;
+			fNames[Ids.ID_SAMP] = SAMP;
+			fNames[Ids.ID_SCRIPT] = SCRIPT;
+			fNames[Ids50.ID_SECTION] = SECTION;
+			fNames[Ids.ID_SELECT] = SELECT;
+			fNames[Ids.ID_SMALL] = SMALL;
+			fNames[Ids50.ID_SOURCE] = SOURCE;
+			fNames[Ids.ID_SPAN] = SPAN;
+			fNames[Ids.ID_STRIKE] = STRIKE;
+			fNames[Ids.ID_STRONG] = STRONG;
+			fNames[Ids.ID_STYLE] = STYLE;
+			fNames[Ids50.ID_SUMMARY] = SUMMARY;
+			fNames[Ids.ID_SUB] = SUB;
+			fNames[Ids.ID_SUP] = SUP;
+			fNames[Ids50.ID_SVG] = SVG;
+			fNames[Ids.ID_TABLE] = TABLE;
+			fNames[Ids.ID_TBODY] = TBODY;
+			fNames[Ids.ID_TD] = TD;
+			fNames[Ids.ID_TEXTAREA] = TEXTAREA;
+			fNames[Ids.ID_TFOOT] = TFOOT;
+			fNames[Ids.ID_TH] = TH;
+			fNames[Ids.ID_THEAD] = THEAD;
+			fNames[Ids50.ID_TIME] = TIME;
+			fNames[Ids.ID_TITLE] = TITLE;
+			fNames[Ids.ID_TR] = TR;
+			fNames[Ids.ID_TT] = TT;
+			fNames[Ids.ID_U] = U;
+			fNames[Ids.ID_UL] = UL;
+			fNames[Ids.ID_VAR] = VAR;
+			fNames[Ids50.ID_VIDEO] = VIDEO;
+			fNames[Ids.ID_WBR] = WBR;
+			fNames[Ids.ID_SSI_CONFIG] = SSI_CONFIG;
+			fNames[Ids.ID_SSI_ECHO] = SSI_ECHO;
+			fNames[Ids.ID_SSI_EXEC] = SSI_EXEC;
+			fNames[Ids.ID_SSI_FSIZE] = SSI_FSIZE;
+			fNames[Ids.ID_SSI_FLASTMOD] = SSI_FLASTMOD;
+			fNames[Ids.ID_SSI_INCLUDE] = SSI_INCLUDE;
+			fNames[Ids.ID_SSI_PRINTENV] = SSI_PRINTENV;
+			fNames[Ids.ID_SSI_SET] = SSI_SET;
+			fNames[Ids.ID_BGSOUND] = BGSOUND;
+			fNames[Ids.ID_NOBR] = NOBR;
+			fNames[Ids.ID_WBR] = WBR;
+		}
+		return fNames;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttrDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttrDeclImpl.java
index ce938e3..9c85e4a 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttrDeclImpl.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttrDeclImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -27,6 +27,8 @@
 
 	private HTMLCMDataTypeImpl type = null;
 	private int usage = 0;
+	private boolean is_obsolete = false;
+
 
 	/**
 	 */
@@ -106,6 +108,9 @@
 			return true;
 		else if (propertyName.equals(HTMLCMProperties.IS_SCRIPTABLE))
 			return true;
+		else if (propertyName.equals(HTMLCMProperties.IS_OBSOLETE))
+			return is_obsolete;
+		
 		return super.supports(propertyName);
 	}
 
@@ -117,6 +122,13 @@
 		else if (propertyName.equals(HTMLCMProperties.IS_SCRIPTABLE)) {
 			return getAttrType().getDataTypeName() == HTMLCMDataType.SCRIPT ? new Boolean(true) : new Boolean(false);
 		}
+		else if (propertyName.equals(HTMLCMProperties.IS_OBSOLETE))
+			return new Boolean(is_obsolete);
+		
 		return super.getProperty(propertyName);
 	}
+	
+	public void obsolete(boolean is_obsolete){
+		this.is_obsolete = is_obsolete;
+	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttributeDeclaration.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttributeDeclaration.java
index 675dc59..80adfe3 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttributeDeclaration.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttributeDeclaration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -20,5 +20,5 @@
  * and {@link <code>HTMLCMNode</code>}.<br>
  */
 public interface HTMLAttributeDeclaration extends CMAttributeDeclaration {
-
+	String IS_HTML = "isHTML"; //$NON-NLS-1$
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataType.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataType.java
index fba0b86..3c94c47 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataType.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataType.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -63,4 +63,9 @@
 	public static final String STYLE_SHEET = CMDataType.CDATA;
 	/** %Text; == CDATA */
 	public static final String TEXT = CMDataType.CDATA;
+	/** %MediaType; == CDATA */
+	public static final String MEDIA_TYPE = CMDataType.CDATA;
+	/** %BrowsingContext; == CDATA */
+	public static final String BROWSING_CONTEXT = CMDataType.CDATA;
+	
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java
index 28316ec..7b9f634 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@
 
 import org.eclipse.wst.html.core.internal.contentmodel.chtml.CHCMDocImpl;
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
 
@@ -27,7 +28,7 @@
 public final class HTMLCMDocumentFactory {
 
 	private static Hashtable cmdocs = new Hashtable();
-	private static List supportedCMtypes = Arrays.asList(new Object[]{CMDocType.HTML_DOC_TYPE, CMDocType.CHTML_DOC_TYPE, CMDocType.JSP11_DOC_TYPE, CMDocType.JSP12_DOC_TYPE, CMDocType.JSP20_DOC_TYPE, CMDocType.TAG20_DOC_TYPE});
+	private static List supportedCMtypes = Arrays.asList(new Object[]{CMDocType.HTML_DOC_TYPE, CMDocType.CHTML_DOC_TYPE, CMDocType.JSP11_DOC_TYPE, CMDocType.JSP12_DOC_TYPE, CMDocType.JSP20_DOC_TYPE, CMDocType.TAG20_DOC_TYPE, CMDocType.JSP21_DOC_TYPE, CMDocType.HTML5_DOC_TYPE});
 
 	private static JCMDocImpl jsp11doc = null;
 
@@ -62,12 +63,24 @@
 			return html40doc;
 		}
 
+		else if (CMDocType.HTML5_DOC_TYPE.equals(cmtype)) {
+			CMNamespaceImpl h50ns = new CMNamespaceImpl(HTML50Namespace.HTML50_URI, HTML50Namespace.HTML50_TAG_PREFIX);
+			H5CMDocImpl html50doc = new H5CMDocImpl(CMDocType.HTML5_DOC_TYPE, h50ns);
+			return html50doc;
+		}
+		
 		else if (CMDocType.JSP20_DOC_TYPE.equals(cmtype)) {
 			CMNamespaceImpl j20ns = new CMNamespaceImpl(JSP20Namespace.JSP20_URI, JSP11Namespace.JSP_TAG_PREFIX);
 			JCM20DocImpl jsp20doc = new JCM20DocImpl(CMDocType.JSP20_DOC_TYPE, j20ns);
 			return jsp20doc;
 		}
 
+		else if (CMDocType.JSP21_DOC_TYPE.equals(cmtype)) {
+			CMNamespaceImpl j21ns = new CMNamespaceImpl(JSP21Namespace.JSP21_URI, JSP11Namespace.JSP_TAG_PREFIX);
+			JCM21DocImpl jsp21doc = new JCM21DocImpl(CMDocType.JSP21_DOC_TYPE, j21ns);
+			return jsp21doc;
+		}
+
 		else if (CMDocType.TAG20_DOC_TYPE.equals(cmtype)) {
 			CMNamespaceImpl j20ns = new CMNamespaceImpl(JSP20Namespace.JSP20_URI, JSP11Namespace.JSP_TAG_PREFIX);
 			TagCMDocImpl tag20doc = new TagCMDocImpl(CMDocType.TAG20_DOC_TYPE, j20ns);
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElemDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElemDeclImpl.java
index f0b1471..3f5a9b7 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElemDeclImpl.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElemDeclImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -43,6 +43,7 @@
 	protected boolean indentChild = false;
 	protected ElementCollection elementCollection = null;
 	protected AttributeCollection attributeCollection = null;
+	private boolean is_obsolete = false;
 	protected final static CMNamedNodeMap EMPTY_MAP = new CMNamedNodeMap() {
 		public int getLength() {
 			return 0;
@@ -282,6 +283,9 @@
 			ComplexTypeDefinition def = getComplexTypeDefinition();
 			return (def != null);
 		}
+		if (propertyName.equals(HTMLCMProperties.IS_OBSOLETE)) {
+			return is_obsolete;
+		}
 		else {
 			PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
 			if (pp == null)
@@ -301,6 +305,9 @@
 			ComplexTypeDefinition def = getComplexTypeDefinition();
 			return (def != null) ? def.getPrimaryCandidate() : null;
 		}
+		else if (propertyName.equals(HTMLCMProperties.IS_OBSOLETE)){
+			return new Boolean(is_obsolete);
+		}
 		else {
 			PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
 			if (pp == null)
@@ -363,4 +370,8 @@
 		}
 		return false;
 	}
+	
+	public void obsolete(boolean is_obsolete){
+		this.is_obsolete = is_obsolete;
+	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedA.java
index 92eb28e..270fc91 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedA.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedA.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,8 +12,6 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
@@ -35,21 +33,6 @@
 
 	/**
 	 * %attrs;
-	 * (charset %Charset; #IMPLIED)
-	 * (type %ContentType; #IMPLIED)
-	 * (name CDATA #IMPLIED)
-	 * (href %URI; #IMPLIED)
-	 * (hreflang %LanguageCode; #IMPLIED)
-	 * (target %FrameTarget; #IMPLIED)
-	 * (rel %LinkTypes; #IMPLIED)
-	 * (rev %LinkTypes; #IMPLIED)
-	 * (accesskey %Character; #IMPLIED)
-	 * (directkey %Character; #IMPLIED)
-	 * (shape %Shape; rect)
-	 * (coords %Coords; #IMPLIED)
-	 * (tabindex NUMBER #IMPLIED)
-	 * (onfocus %Script; #IMPLIED)
-	 * (onblur %Script; #IMPLIED) 
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -62,8 +45,9 @@
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
 
-		String[] names = {HTML40Namespace.ATTR_NAME_CHARSET, HTML40Namespace.ATTR_NAME_TYPE, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_HREF, HTML40Namespace.ATTR_NAME_HREFLANG, HTML40Namespace.ATTR_NAME_TARGET, HTML40Namespace.ATTR_NAME_REL, HTML40Namespace.ATTR_NAME_REV, HTML40Namespace.ATTR_NAME_ACCESSKEY, HTML40Namespace.ATTR_NAME_DIRECTKEY, HTML40Namespace.ATTR_NAME_SHAPE, HTML40Namespace.ATTR_NAME_COORDS, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.A, attributes);
+	
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAREA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAREA.java
index 3afad06..322e65c 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAREA.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAREA.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,8 +12,6 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
 
 
@@ -34,16 +32,6 @@
 	/**
 	 * AREA.
 	 * %attrs;
-	 * (shape %Shape; rect)
-	 * (coords %Coords; #IMPLIED)
-	 * (href %URI; #IMPLIED)
-	 * (target %FrameTarget; #IMPLIED)
-	 * (nohref (nohref) #IMPLIED)
-	 * (alt %Text; #REQUIRED)
-	 * (tabindex NUMBER #IMPLIED)
-	 * (accesskey %Character; #IMPLIED)
-	 * (onfocus %Script; #IMPLIED)
-	 * (onblur %Script; #IMPLIED)
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -55,7 +43,8 @@
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
 
-		String[] names = {HTML40Namespace.ATTR_NAME_SHAPE, HTML40Namespace.ATTR_NAME_COORDS, HTML40Namespace.ATTR_NAME_HREF, HTML40Namespace.ATTR_NAME_TARGET, HTML40Namespace.ATTR_NAME_NOHREF, HTML40Namespace.ATTR_NAME_ALT, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_ACCESSKEY, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.AREA, attributes);
+	
 	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBUTTON.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBUTTON.java
index 9754980..6ace2cb 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBUTTON.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBUTTON.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,9 +15,7 @@
 import java.util.Arrays;
 
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 
@@ -35,15 +33,6 @@
 
 	/**
 	 * %attrs;
-	 * %reserved; ... empty.
-	 * (name CDATA #IMPLIED)
-	 * (value CDATA #IMPLIED)
-	 * (type (button|submit|reset) submit) ... should be defined locally.
-	 * (disabled (disabled) #IMPLIED)
-	 * (tabindex NUMBER #IMPLIED)
-	 * (accesskey %Character; #IMPLIED)
-	 * (onfocus %Script; #IMPLIED)
-	 * (onblur %Script; #IMPLIED)
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -55,17 +44,10 @@
 
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_VALUE, HTML40Namespace.ATTR_NAME_DISABLED, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_ACCESSKEY, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// (type (button|submit|reset) submit) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-		String[] values = {HTML40Namespace.ATTR_VALUE_BUTTON, HTML40Namespace.ATTR_VALUE_SUBMIT, HTML40Namespace.ATTR_VALUE_RESET};
-		atype.setEnumValues(values);
-
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
+		
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.BUTTON, attributes);
+	
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCANVAS.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCANVAS.java
new file mode 100644
index 0000000..453fb1c
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCANVAS.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import java.util.Arrays;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+
+
+/**
+ * CANVAS.
+ */
+final class HedCANVAS extends HTMLElemDeclImpl {
+
+	/**
+	 */
+	public HedCANVAS(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.CANVAS, collection);
+		layoutType = LAYOUT_BLOCK;
+	}
+
+	/**
+	 * %attrs;
+	 * (height, width)
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+		
+		
+		String[] names = { HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_HEIGHT };
+		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOMMAND.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOMMAND.java
new file mode 100644
index 0000000..3fc7c03
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOMMAND.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+
+/**
+ * COMMAND.
+ */
+final class HedCOMMAND extends HTMLElemDeclImpl {
+
+	/**
+	 */
+	public HedCOMMAND(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.COMMAND, collection);
+		layoutType = LAYOUT_OBJECT;
+	}
+
+	/**
+	 * COMMAND.
+	 * %attrs;
+	 * // (type %CommandTYPE; command | checkbox|radio) 
+	 * // (label %CDATA; #REQUIRED) 
+	 * // (icon %URI; #OPTIONAL) 
+	 * // (disabled %BOOLEAN; #OPTIONAL) 
+	 * // (checked %BOOLEAN; #OPTIONAL) 
+	 * // (radiogroup %TEXT; #OPTIONAL) 
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+
+		HTMLCMDataTypeImpl atype = null;
+		HTMLAttrDeclImpl attr = null;
+		// (type %CommandTYPE; command | checkbox|radio) 
+		// NOTE: %InputType is ENUM;
+		atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+		String[] values = {HTML50Namespace.ATTR_VALUE_COMMAND, HTML40Namespace.ATTR_VALUE_CHECKBOX, HTML40Namespace.ATTR_VALUE_RADIO};
+		atype.setEnumValues(values);
+		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML50Namespace.ATTR_VALUE_COMMAND);
+		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
+		
+		// (label %CDATA; #REQUIRED) 
+		atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
+		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_LABEL, atype, CMAttributeDeclaration.REQUIRED);
+		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_LABEL, attr);
+
+		// (icon %URI; #OPTIONAL) 
+		atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+		attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_ICON, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML50Namespace.ATTR_NAME_ICON, attr);
+
+		
+		// (disabled %BOOLEAN; #OPTIONAL) 
+		atype = new HTMLCMDataTypeImpl(HTMLCMDataType.BOOLEAN);
+		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_FALSE);
+		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_DISABLED, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_DISABLED, attr);
+
+		// (checked %BOOLEAN; #OPTIONAL) 
+		atype = new HTMLCMDataTypeImpl(HTMLCMDataType.BOOLEAN);
+		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_FALSE);
+		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_CHECKED, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_CHECKED, attr);
+
+		// (radiogroup %TEXT; #OPTIONAL) 
+		atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
+		attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_RADIOGROUP, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML50Namespace.ATTR_NAME_RADIOGROUP, attr);
+
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDATALIST.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDATALIST.java
new file mode 100644
index 0000000..ba671c6
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDATALIST.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+/**
+ * DATALIST.
+ */
+final class HedDATALIST extends HTMLElemDeclImpl {
+
+	/**
+	 */
+	public HedDATALIST(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.DATALIST, collection);
+		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_DATALIST;
+		layoutType = LAYOUT_OBJECT;
+		indentChild = true;
+	}
+
+	/**
+	 * %attrs;
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDETAILS.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDETAILS.java
new file mode 100644
index 0000000..a4e8f01
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDETAILS.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+public class HedDETAILS extends HTMLElemDeclImpl {
+
+	public HedDETAILS(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.DETAILS, collection);
+		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_DETAILS_CONTAINER;
+	}
+
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+
+		CMNode node = attributeCollection.getDeclaration(HTML50Namespace.ATTR_NAME_OPEN);
+		if (node != null)
+			attributes.putNamedItem(HTML50Namespace.ATTR_NAME_OPEN, node);
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIELDSET.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIELDSET.java
index f47fbcb..3e0d7ff 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIELDSET.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIELDSET.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -41,6 +41,9 @@
 
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.FIELDSET, attributes);
+	
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGCAPTION.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGCAPTION.java
new file mode 100644
index 0000000..9b6162c
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGCAPTION.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+public class HedFIGCAPTION extends HedFlowContainer {
+	public HedFIGCAPTION(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.FIGCAPTION, collection);
+		layoutType = LAYOUT_HIDDEN;
+	}
+
+	/**
+	 * Article.
+	 * %attrs;
+	 * Global attributes
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGURE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGURE.java
new file mode 100644
index 0000000..87a4610
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIGURE.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+/**
+ * FIGURE.
+ */
+final class HedFIGURE extends HTMLElemDeclImpl {
+
+	/**
+	 */
+	public HedFIGURE(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.FIGURE, collection);
+		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_FIGURE;
+		layoutType = LAYOUT_BLOCK;
+		indentChild = true;
+	}
+
+	/**
+	 * %attrs;
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+
+	}
+	
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHEADER.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHEADER.java
new file mode 100644
index 0000000..5e72a35
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHEADER.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+public class HedHEADER extends HedFlowContainer {
+
+	public HedHEADER(String name, ElementCollection collection) {
+		super(name, collection);
+	}
+
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+	}
+
+	/**
+	 * Exclusion.
+	 * <code>HEADER</code> has the exclusion.
+	 * It is <code>HEADER</code> and <code>FOOTER</code>.
+	 */
+	public CMContent getExclusion() {
+		if (exclusion != null)
+			return exclusion; // already created.
+		if (elementCollection == null)
+			return null; // fatal
+
+		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
+		CMNode node = elementCollection.getNamedItem(HTML50Namespace.ElementName.HEADER);
+		if (node != null)
+			exclusion.appendChild(node);
+		node = elementCollection.getNamedItem(HTML50Namespace.ElementName.FOOTER);
+		if (node != null)
+			exclusion.appendChild(node);
+
+		return exclusion;
+	}
+
+	/**
+	 */
+	public CMNamedNodeMap getProhibitedAncestors() {
+		if (prohibitedAncestors != null)
+			return prohibitedAncestors;
+
+		String[] names = {HTML50Namespace.ElementName.HEADER, HTML50Namespace.ElementName.FOOTER};
+		prohibitedAncestors = elementCollection.getDeclarations(names);
+
+		return prohibitedAncestors;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHGROUP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHGROUP.java
new file mode 100644
index 0000000..3bb51a4
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHGROUP.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+
+public class HedHGROUP extends HTMLElemDeclImpl {
+
+	public HedHGROUP(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.HGROUP, collection);
+		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_HEADING_CONTAINER;
+		correctionType = CORRECT_EMPTY;
+		layoutType = LAYOUT_BLOCK;
+		indentChild = true;
+	}
+
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+	}
+
+	/**
+	 */
+	public CMNamedNodeMap getProhibitedAncestors() {
+		if (prohibitedAncestors != null)
+			return prohibitedAncestors;
+
+		String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
+		prohibitedAncestors = elementCollection.getDeclarations(names);
+
+		return prohibitedAncestors;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHTML.java
index 99b6332..e393d04 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHTML.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHTML.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -62,13 +62,10 @@
 
 		attributes = new CMNamedNodeMapImpl();
 
-		// %i18n;
-		attributeCollection.getI18n(attributes);
-		// version
-		HTMLAttributeDeclaration adec = attributeCollection.getDeclaration(HTML40Namespace.ATTR_NAME_VERSION);
-		if (adec != null)
-			attributes.putNamedItem(HTML40Namespace.ATTR_NAME_VERSION, adec);
-	}
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.HTML, attributes);
+	
+		}
 
 	/**
 	 * HTML has terminators.
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIFRAME.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIFRAME.java
index 191615e..0e4c564 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIFRAME.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIFRAME.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,8 +12,6 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 
@@ -29,19 +27,7 @@
 		layoutType = LAYOUT_OBJECT;
 	}
 
-	/**
-	 * %coreattrs;
-	 * (longdesc %URI; #IMPLIED)
-	 * (name CDATA #IMPLIED)
-	 * (src %URI; #IMPLIED)
-	 * (frameborder (1|0) 1)
-	 * (marginwidth %Pixels; #IMPLIED)
-	 * (marginheight %Pixels; #IMPLIED)
-	 * (scrolling (yes|no|auto) auto)
-	 * (align %IAlign; #IMPLIED) ... should be defined locally.
-	 * (height %Length; #IMPLIED)
-	 * (width %Length; #IMPLIED)
-	 */
+	
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
 			return; // already created.
@@ -50,16 +36,9 @@
 
 		attributes = new CMNamedNodeMapImpl();
 
-		// %coreattrs;
-		attributeCollection.getCore(attributes);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_LONGDESC, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_SRC, HTML40Namespace.ATTR_NAME_FRAMEBORDER, HTML40Namespace.ATTR_NAME_MARGINWIDTH, HTML40Namespace.ATTR_NAME_MARGINHEIGHT, HTML40Namespace.ATTR_NAME_SCROLLING, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_WIDTH};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// align
-		HTMLAttrDeclImpl attr = AttributeCollection.createAlignForImage();
-		if (attr != null)
-			attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.IFRAME, attributes);
+	
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIMG.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIMG.java
index 1e1805e..b719416 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIMG.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIMG.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,11 +12,7 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 
 /**
@@ -34,19 +30,6 @@
 	/**
 	 * IMG.
 	 * %attrs;
-	 * (src %URI; #REQUIRED): should be defined locally.
-	 * (alt %Text; #REQUIRED)
-	 * (longdesc %URI; #IMPLIED)
-	 * (name CDATA #IMPLIED)
-	 * (height %Length; #IMPLIED)
-	 * (width %Length; #IMPLIED)
-	 * (usemap %URI; #IMPLIED)
-	 * (ismap (ismap) #IMPLIED)
-	 * (align %IAlign; #IMPLIED): should be defined locally.
-	 * (border %Pixels; #IMPLIED)
-	 * (hspace %Pixels; #IMPLIED)
-	 * (vspace %Pixels; #IMPLIED)
-	 * (mapfile %URI; #IMPLIED)
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -59,19 +42,9 @@
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
 
-		// (src %URI; #REQUIRED): should be defined locally.
-		HTMLCMDataTypeImpl atype = null;
-		HTMLAttrDeclImpl attr = null;
-		atype = new HTMLCMDataTypeImpl(CMDataType.URI);
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SRC, attr);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_ALT, HTML40Namespace.ATTR_NAME_LONGDESC, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_USEMAP, HTML40Namespace.ATTR_NAME_ISMAP, HTML40Namespace.ATTR_NAME_BORDER, HTML40Namespace.ATTR_NAME_HSPACE, HTML40Namespace.ATTR_NAME_VSPACE, HTML40Namespace.ATTR_NAME_MAPFILE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// align (local); should be defined locally.
-		attr = AttributeCollection.createAlignForImage();
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.IMG, attributes);
+	
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedINPUT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedINPUT.java
index 60b3049..9080201 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedINPUT.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedINPUT.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,11 +12,7 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 
 /**
@@ -34,32 +30,7 @@
 	/**
 	 * INPUT.
 	 * %attrs;
-	 * (type %InputType; TEXT) ... should be defined locally.
-	 * (name CDATA #IMPLIED)
-	 * (value CDATA #IMPLIED)
-	 * (checked (checked) #IMPLIED)
-	 * (disabled (disabled) #IMPLIED)
-	 * (readonly (readonly) #IMPLIED)
-	 * (size CDATA #IMPLIED) ... should be defined locally.
-	 * (maxlength NUMBER #IMPLIED)
-	 * (src %URI; #IMPLIED)
-	 * (alt CDATA #IMPLIED) ... should be defined locally.
-	 * (usemap %URI; #IMPLIED)
-	 * (ismap (ismap) #IMPLIED)
-	 * (tabindex NUMBER #IMPLIED)
-	 * (accesskey %Character; #IMPLIED)
-	 * (onfocus %Script; #IMPLIED)
-	 * (onblur %Script; #IMPLIED)
-	 * (onselect %Script; #IMPLIED)
-	 * (onchange %Script; #IMPLIED)
-	 * (accept %ContentTypes; #IMPLIED)
-	 * (align %IAlign; #IMPLIED) ... should be defined locally.
-	 * (istyle CDATA #IMPLIED)
-	 * <<D215684
-	 * (width CDATA; #IMPLIED)
-	 * (height CDATA; #IMPLIED)
-	 * (border CDATA; #IMPLIED)
-	 * D215684
+	
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -72,40 +43,8 @@
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
 
-		HTMLCMDataTypeImpl atype = null;
-		HTMLAttrDeclImpl attr = null;
-		// (type %InputType; TEXT) ... should be defined locally.
-		// NOTE: %InputType is ENUM;
-		// (text | password | checkbox | radio | submit | reset |
-		//  file | hidden | image | button)
-		atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-		String[] values = {HTML40Namespace.ATTR_VALUE_TEXT, HTML40Namespace.ATTR_VALUE_PASSWORD, HTML40Namespace.ATTR_VALUE_CHECKBOX, HTML40Namespace.ATTR_VALUE_RADIO, HTML40Namespace.ATTR_VALUE_SUBMIT, HTML40Namespace.ATTR_VALUE_RESET, HTML40Namespace.ATTR_VALUE_FILE, HTML40Namespace.ATTR_VALUE_HIDDEN, HTML40Namespace.ATTR_VALUE_IMAGE, HTML40Namespace.ATTR_VALUE_BUTTON};
-		atype.setEnumValues(values);
-		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_TEXT);
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
-
-		// (size CDATA #IMPLIED) ... should be defined locally.
-		atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SIZE, attr);
-
-		// (alt CDATA #IMPLIED) ... should be defined locally.
-		atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_ALT, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALT, attr);
-
-		// (align %IAlign; #IMPLIED) ... should be defined locally.
-		attr = AttributeCollection.createAlignForImage();
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
-
-		// the rest.
-		String[] names = {HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_VALUE, HTML40Namespace.ATTR_NAME_CHECKED, HTML40Namespace.ATTR_NAME_DISABLED, HTML40Namespace.ATTR_NAME_READONLY, HTML40Namespace.ATTR_NAME_SIZE, HTML40Namespace.ATTR_NAME_MAXLENGTH, HTML40Namespace.ATTR_NAME_SRC, HTML40Namespace.ATTR_NAME_ALT, HTML40Namespace.ATTR_NAME_USEMAP, HTML40Namespace.ATTR_NAME_ISMAP, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_ACCESSKEY, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR, HTML40Namespace.ATTR_NAME_ONSELECT, HTML40Namespace.ATTR_NAME_ONCHANGE, HTML40Namespace.ATTR_NAME_ACCEPT, HTML40Namespace.ATTR_NAME_ALIGN, HTML40Namespace.ATTR_NAME_ISTYLE,
-		//<<D215684
-					HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_BORDER
-		//<D215684
-		};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.INPUT, attributes);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedKEYGEN.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedKEYGEN.java
new file mode 100644
index 0000000..c84b30a
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedKEYGEN.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import java.util.Arrays;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+public class HedKEYGEN extends HedEmpty {
+
+	public HedKEYGEN(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.KEYGEN, collection);
+		layoutType = LAYOUT_OBJECT;
+	}
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		attributeCollection.getAttrs(attributes);
+
+		String[] names = { HTML50Namespace.ATTR_NAME_AUTOFOCUS, HTML50Namespace.ATTR_NAME_CHALLENGE, HTML40Namespace.ATTR_NAME_DISABLED, HTML50Namespace.ATTR_NAME_FORM, HTML50Namespace.ATTR_NAME_KEYTYPE, HTML40Namespace.ATTR_NAME_NAME};
+		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLI.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLI.java
index f43785e..a413193 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLI.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLI.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,8 +16,6 @@
 import java.util.Iterator;
 
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 
 /**
  * LI.
@@ -36,8 +34,6 @@
 
 	/**
 	 * %attrs;
-	 * (type %LIStyle; #IMPLIED) ... should be defined locally.
-	 * (value NUMBER #IMPLIED) ... should be defined locally.
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -50,15 +46,9 @@
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
 
-		// (type %LIStyle; #IMPLIED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LI_STYLE);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
-
-		// (value NUMBER #IMPLIED) ... should be defined locally.
-		atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_VALUE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_VALUE, attr);
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.LI, attributes);
+	
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLINK.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLINK.java
index bfe132c..4c28bbe 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLINK.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLINK.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,10 +12,7 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 
 /**
  * LINK.
@@ -32,14 +29,6 @@
 	/**
 	 * LINK.
 	 * %attrs;
-	 * (charset %Charset; #IMPLIED)
-	 * (href %URI; #IMPLIED)
-	 * (hreflang %LanguageCode; #IMPLIED)
-	 * (type %ContentType; #IMPLIED): should be defined locally.
-	 * (rel %LinkTypes; #IMPLIED)
-	 * (rev %LinkTypes; #IMPLIED)
-	 * (media %MediaDesc; #IMPLIED)
-	 * (target %FrameTarget; #IMPLIED)
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -52,12 +41,8 @@
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
 
-		String[] names = {HTML40Namespace.ATTR_NAME_CHARSET, HTML40Namespace.ATTR_NAME_HREF, HTML40Namespace.ATTR_NAME_HREFLANG, HTML40Namespace.ATTR_NAME_REL, HTML40Namespace.ATTR_NAME_REV, HTML40Namespace.ATTR_NAME_MEDIA, HTML40Namespace.ATTR_NAME_TARGET};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// (type %ContentType; #IMPLIED)
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
+		// different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.LINK, attributes);
+		
 	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMENU.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMENU.java
index 0142558..812af9b 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMENU.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMENU.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -32,8 +32,7 @@
 
 	/**
 	 * MENU/DIR.
-	 * (compact (compact) #IMPLIED)
-	 */
+	*/
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
 			return; // already created.
@@ -45,8 +44,8 @@
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
 
-		String[] names = {HTML40Namespace.ATTR_NAME_COMPACT};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.MENU, attributes);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETA.java
index d5b232c..92554ea 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETA.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETA.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,10 +12,7 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 
 /**
  * META.
@@ -31,11 +28,7 @@
 
 	/**
 	 * META.
-	 * %i18n;
-	 * (http-equiv NAME #IMPLIED)
-	 * (name NAME #IMPLIED) ... should be defined locally.
-	 * (content CDATA #REQUIRED)
-	 * (scheme CDATA #IMPLIED)
+
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -44,16 +37,9 @@
 			return; // fatal
 
 		attributes = new CMNamedNodeMapImpl();
-
-		// %i18n;
-		attributeCollection.getI18n(attributes);
-
-		// (name NAME #IMPLIED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.NAME);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_NAME, attr);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_HTTP_EQUIV, HTML40Namespace.ATTR_NAME_CONTENT, HTML40Namespace.ATTR_NAME_SCHEME};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+		
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.META, attributes);
+	
 	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETER.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETER.java
new file mode 100644
index 0000000..c79e9e9
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETER.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import java.util.Arrays;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+public class HedMETER extends HedInlineContainer {
+
+	public HedMETER(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.METER, collection);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.html.core.internal.contentmodel.HTMLElemDeclImpl#createAttributeDeclarations()
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+		attributeCollection.getAttrs(attributes);
+
+		String[] names = { HTML50Namespace.ATTR_NAME_MIN, HTML50Namespace.ATTR_NAME_MAX, HTML50Namespace.ATTR_NAME_LOW, HTML50Namespace.ATTR_NAME_HIGH, HTML50Namespace.ATTR_NAME_OPTIMUM, HTML50Namespace.ATTR_NAME_FORM };
+		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+
+		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
+		HTMLAttrDeclImpl decl = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_VALUE, atype, CMAttributeDeclaration.REQUIRED);
+		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_VALUE, decl);
+	}
+
+	public CMContent getExclusion() {
+		if (exclusion != null)
+			return exclusion; // already created.
+		if (elementCollection == null)
+			return null;
+
+		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
+		CMNode meter = elementCollection.getNamedItem(HTML50Namespace.ElementName.METER);
+		if (meter != null)
+			exclusion.appendChild(meter);
+
+		return exclusion;
+	}
+
+	public CMNamedNodeMap getProhibitedAncestors() {
+		if (prohibitedAncestors != null)
+			return prohibitedAncestors;
+
+		String[] names = {HTML50Namespace.ElementName.METER};
+		prohibitedAncestors = elementCollection.getDeclarations(names);
+
+		return prohibitedAncestors;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMath.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMath.java
new file mode 100644
index 0000000..154dbfa
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMath.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import java.util.Arrays;
+import java.util.Iterator;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+
+/**
+ * Math.
+ */
+final class HedMath extends HTMLElemDeclImpl {
+
+	private static String[] terminators = {HTML50Namespace.ElementName.MATH};
+
+	/**
+	 */
+	public HedMath(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.MATH, collection);
+		layoutType = LAYOUT_OBJECT;
+	}
+
+	/**
+	 * Create all attribute declarations.
+	 * MathML namespace
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+	}
+
+	/**
+	 * MATH has terminators.
+	 * @return java.util.Iterator
+	 */
+	protected Iterator getTerminators() {
+		return Arrays.asList(terminators).iterator();
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMediaElement.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMediaElement.java
new file mode 100644
index 0000000..dd23bd4
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMediaElement.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+
+/**
+ * EMBED.
+ */
+class HedMediaElement extends HTMLElemDeclImpl {
+
+	/**
+	 */
+	public HedMediaElement(String elementName, ElementCollection collection) {
+		super(elementName, collection);
+		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_MEDIA_ELEMENT;
+		layoutType = LAYOUT_OBJECT;
+		indentChild = true;
+	}
+
+	/**
+	 * MediaElement
+	 * %attrs;
+	 * (src %URI; #REQUIRED): should be defined locally.
+	 * (preload %CDATA; #IMPLIED) 
+	 * (autoplay %ENUM; #IMPLIED) 
+	 * (loop %ENUM; #IMPLIED)
+	 * (controls %MediaType; #IMPLIED)
+	 * Global attributes
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+	
+		// (src %URI; #REQUIRED): should be defined locally.
+		HTMLCMDataTypeImpl atype = null;
+		HTMLAttrDeclImpl attr = null;
+		atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
+		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SRC, attr);
+
+		//(preload %CDATA; #IMPLIED) ENUM
+		// (none | metadata | auto)
+		atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+		String[] values = {HTML40Namespace.ATTR_VALUE_NONE, HTML50Namespace.ATTR_VALUE_METADATA, HTML40Namespace.ATTR_VALUE_AUTO, HTML50Namespace.ATTR_VALUE_EMPTY};
+		atype.setEnumValues(values);
+		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_AUTO);
+		attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_PRELOAD, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML50Namespace.ATTR_NAME_PRELOAD, attr);
+
+		// (autoplay (boolean) #IMPLIED)
+		atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+		String[] autoPlayValues = {HTML50Namespace.ATTR_NAME_AUTOPLAY};
+		atype.setEnumValues(autoPlayValues);
+		attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_AUTOPLAY, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML50Namespace.ATTR_NAME_AUTOPLAY, attr);
+
+		// (loop (true|false) #IMPLIED)
+		atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+		String[] loopValues = {HTML40Namespace.ATTR_VALUE_TRUE, HTML40Namespace.ATTR_VALUE_FALSE};
+		atype.setEnumValues(loopValues);
+		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_FALSE);
+		attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_LOOP, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML50Namespace.ATTR_NAME_LOOP, attr);
+
+		// (controls (true|false) #IMPLIED)
+		atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+		String[] controlValues = {HTML40Namespace.ATTR_VALUE_TRUE, HTML40Namespace.ATTR_VALUE_FALSE};
+		atype.setEnumValues(controlValues);
+		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_FALSE);
+		attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_CONTROLS, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML50Namespace.ATTR_NAME_CONTROLS, attr);
+
+		
+		// global attributes
+		attributeCollection.getAttrs(attributes);
+	}
+}
+
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOL.java
index 6668b90..6c6d50c 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOL.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOL.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,10 +12,7 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 
 /**
@@ -31,9 +28,6 @@
 
 	/**
 	 * OL.
-	 * (type %OLStyle; #IMPLIED) ... should be defined locally.
-	 * (compact (compact) #IMPLIED)
-	 * (start NUMBER #IMPLIED)
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -46,14 +40,9 @@
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
 
-		// (type %OLStyle; #IMPLIED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.OL_STYLE);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
-
-		// the rest.
-		String[] names = {HTML40Namespace.ATTR_NAME_COMPACT, HTML40Namespace.ATTR_NAME_START};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.OL, attributes);
+	
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOUTPUT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOUTPUT.java
new file mode 100644
index 0000000..fc172e1
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOUTPUT.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import java.util.Arrays;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+public class HedOUTPUT extends HedInlineContainer {
+
+	public HedOUTPUT(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.OUTPUT, collection);
+	}
+
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+
+		String[] names = { HTML40Namespace.ATTR_NAME_FOR, HTML50Namespace.ATTR_NAME_FORM, HTML40Namespace.ATTR_NAME_NAME};
+		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPARAM.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPARAM.java
index 5541a1f..1bcea7e 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPARAM.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPARAM.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,11 +12,7 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 
 /**
  * PARAM.
@@ -32,11 +28,6 @@
 
 	/**
 	 * PARAM.
-	 * (id ID #IMPLIED)
-	 * (name CDATA #REQUIRED) ... should be defined locally.
-	 * (value CDATA #IMPLIED)
-	 * (valuetype (DATA|REF|OBJECT) DATA)
-	 * (type %ContentType; #IMPLIED)
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -46,12 +37,9 @@
 
 		attributes = new CMNamedNodeMapImpl();
 
-		String[] names = {HTML40Namespace.ATTR_NAME_ID, HTML40Namespace.ATTR_NAME_VALUE, HTML40Namespace.ATTR_NAME_VALUETYPE, HTML40Namespace.ATTR_NAME_TYPE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// (name CDATA #REQUIRED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_NAME, atype, CMAttributeDeclaration.REQUIRED);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_NAME, attr);
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.PARAM, attributes);
+	
+		
 	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPROGRESS.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPROGRESS.java
new file mode 100644
index 0000000..223c129
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPROGRESS.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import java.util.Arrays;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+public class HedPROGRESS extends HedInlineContainer {
+
+	public HedPROGRESS(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.PROGRESS, collection);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.html.core.internal.contentmodel.HTMLElemDeclImpl#createAttributeDeclarations()
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+		attributeCollection.getAttrs(attributes);
+
+		String[] names = { HTML40Namespace.ATTR_NAME_VALUE, HTML50Namespace.ATTR_NAME_MAX, HTML50Namespace.ATTR_NAME_FORM };
+		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+	}
+
+	public CMContent getExclusion() {
+		if (exclusion != null)
+			return exclusion;
+		if (elementCollection == null)
+			return null;
+
+		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
+		CMNode progress = elementCollection.getNamedItem(HTML50Namespace.ElementName.PROGRESS);
+		if (progress != null) {
+			exclusion.appendChild(progress);
+		}
+		return exclusion;
+	}
+
+	public CMNamedNodeMap getProhibitedAncestors() {
+		if (prohibitedAncestors == null) {
+			String[] names = { HTML50Namespace.ElementName.PROGRESS };
+			prohibitedAncestors = elementCollection.getDeclarations(names);
+		}
+		return prohibitedAncestors;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRP.java
new file mode 100644
index 0000000..e31a9bc
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRP.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import java.util.Arrays;
+import java.util.Iterator;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+
+/**
+ * RP.
+ */
+final class HedRP extends HedPcdata {
+
+	private static String[] terminators = {HTML50Namespace.ElementName.RP};
+
+	/**
+	 */
+	public HedRP(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.RP, collection);
+		layoutType = LAYOUT_HIDDEN;
+	}
+
+	/**
+	 * OPTION.
+	 * %attrs;
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+
+	}
+
+	/**
+	 * OPTION has terminators.
+	 * @return java.util.Iterator
+	 */
+	protected Iterator getTerminators() {
+		return Arrays.asList(terminators).iterator();
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRT.java
new file mode 100644
index 0000000..aba4a38
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRT.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import java.util.Arrays;
+import java.util.Iterator;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+
+/**
+ * RT.
+ */
+final class HedRT extends HedPcdata {
+
+	private static String[] terminators = {HTML50Namespace.ElementName.RT};
+
+	/**
+	 */
+	public HedRT(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.RT, collection);
+		layoutType = LAYOUT_BLOCK;
+
+	}
+
+	/**
+	 * OPTION.
+	 * %attrs;
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+
+	}
+
+	/**
+	 * OPTION has terminators.
+	 * @return java.util.Iterator
+	 */
+	protected Iterator getTerminators() {
+		return Arrays.asList(terminators).iterator();
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRUBY.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRUBY.java
new file mode 100644
index 0000000..6686a25
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedRUBY.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+/**
+ * RUBY.
+ */
+final class HedRUBY extends HTMLElemDeclImpl {
+
+	/**
+	 */
+	public HedRUBY(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.RUBY, collection);
+		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_RUBY;
+		layoutType = LAYOUT_BLOCK;
+		indentChild = true;
+	}
+
+	/**
+	 * %attrs;
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSCRIPT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSCRIPT.java
index ae910b7..2af1317 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSCRIPT.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSCRIPT.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,12 +12,8 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
 
 /**
@@ -35,13 +31,6 @@
 
 	/**
 	 * SCRIPT.
-	 * (charset %Charset; #IMPLIED)
-	 * (type %ContentType; #REQUIRED) ... should be defined locally.
-	 * (language CDATA #IMPLIED)
-	 * (src %URI; #IMPLIED)
-	 * (defer (defer) #IMPLIED)
-	 * (event CDATA #IMPLIED)
-	 * (for %URI; #IMPLIED)
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -51,14 +40,9 @@
 
 		attributes = new CMNamedNodeMapImpl();
 
-		String[] names = {HTML40Namespace.ATTR_NAME_CHARSET, HTML40Namespace.ATTR_NAME_LANGUAGE, HTML40Namespace.ATTR_NAME_SRC, HTML40Namespace.ATTR_NAME_DEFER, HTML40Namespace.ATTR_NAME_EVENT, HTML40Namespace.ATTR_NAME_FOR};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// (type %ContentType; #REQUIRED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
-		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, "text/javascript"); //$NON-NLS-1$
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.REQUIRED);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.SCRIPT, attributes);
+	
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSELECT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSELECT.java
index 78c3a08..a0de442 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSELECT.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSELECT.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,11 +12,7 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 
 /**
@@ -35,15 +31,6 @@
 
 	/**
 	 * %attrs;
-	 * %reserved;
-	 * (name CDATA #IMPLIED)
-	 * (size NUMBER #IMPLIED) ... should be defined locally.
-	 * (multiple (multiple) #IMPLIED)
-	 * (disabled (disabled) #IMPLIED)
-	 * (tabindex NUMBER #IMPLIED)
-	 * (onfocus %Script; #IMPLIED)
-	 * (onblur %Script; #IMPLIED)
-	 * (onchange %Script; #IMPLIED)
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -55,14 +42,11 @@
 
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
+		
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.SELECT, attributes);
+	
 
-		// (size NUMBER #IMPLIED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SIZE, attr);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_MULTIPLE, HTML40Namespace.ATTR_NAME_DISABLED, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR, HTML40Namespace.ATTR_NAME_ONCHANGE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSOURCE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSOURCE.java
new file mode 100644
index 0000000..647a9d4
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSOURCE.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import java.util.Arrays;
+import java.util.Iterator;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+
+/**
+ * SOURCE.
+ */
+final class HedSOURCE extends HTMLElemDeclImpl {
+
+	private static String[] terminators = {HTML50Namespace.ElementName.SOURCE};
+
+	/**
+	 */
+	public HedSOURCE(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.SOURCE, collection);
+		typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_CDATA;
+		layoutType = LAYOUT_HIDDEN;
+	}
+
+	/**
+	 * SOURCE
+	 * %attrs;
+	 * (src %URI; #REQUIRED): should be defined locally.
+	 * (type %ContentType; #IMPLIED) 
+	 * (media %MediaType; #IMPLIED) 
+	 * Global attributes
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+	
+		// (src %URI; #REQUIRED): should be defined locally.
+		HTMLCMDataTypeImpl atype = null;
+		HTMLAttrDeclImpl attr = null;
+		atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
+		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SRC, attr);
+
+		// (type %ContentType; #IMPLIED) 
+		atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
+		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
+		
+
+		// (media %MediaType; #IMPLIED) 
+		atype = new HTMLCMDataTypeImpl(HTMLCMDataType.MEDIA_TYPE);
+		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_ALL);
+		attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_MEDIA, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_MEDIA, attr);
+		
+		
+		// global attributes
+		attributeCollection.getAttrs(attributes);
+	}
+	
+	/**
+	 * SOURCE has terminators.
+	 * @return java.util.Iterator
+	 */
+	protected Iterator getTerminators() {
+		return Arrays.asList(terminators).iterator();
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSTYLE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSTYLE.java
index 985b7fa..da0c3ed 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSTYLE.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSTYLE.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,12 +12,8 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
 
 /**
@@ -35,11 +31,7 @@
 
 	/**
 	 * STYLE
-	 * %i18n;
-	 * (type %ContentType; #REQUIRED) ... should be defined locally.
-	 * (media %MediaDesc; #IMPLIED)
-	 * (title %Text; #IMPLIED)
-	 */
+	*/
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
 			return; // already created.
@@ -47,17 +39,11 @@
 			return; // fatal
 
 		attributes = new CMNamedNodeMapImpl();
-
-		// %i18n;
-		attributeCollection.getI18n(attributes);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_MEDIA, HTML40Namespace.ATTR_NAME_TITLE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-		// (type %ContentType; #REQUIRED) ... should be defined locally.
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
-		atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, "text/css"); //$NON-NLS-1$
-		HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.REQUIRED);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
+		
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.STYLE, attributes);
+	
+		
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSUMMARY.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSUMMARY.java
new file mode 100644
index 0000000..c2b3e82
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSUMMARY.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+public class HedSUMMARY extends HedInlineContainer {
+
+	public HedSUMMARY(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.SUMMARY, collection);
+	}
+
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSVG.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSVG.java
new file mode 100644
index 0000000..0515172
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSVG.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+
+
+import java.util.Arrays;
+import java.util.Iterator;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+
+
+/**
+ * SVG.
+ */
+final class HedSVG extends HTMLElemDeclImpl {
+
+	private static String[] terminators = {HTML50Namespace.ElementName.SVG};
+
+	/**
+	 */
+	public HedSVG(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.SVG, collection);
+		layoutType = LAYOUT_OBJECT;
+	}
+
+	/**
+	 * Create all attribute declarations.
+	 * SVG namespace
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		attributeCollection.getAttrs(attributes);
+	}
+
+	/**
+	 * SVG has terminators.
+	 * @return java.util.Iterator
+	 */
+	protected Iterator getTerminators() {
+		return Arrays.asList(terminators).iterator();
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSectioning.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSectioning.java
new file mode 100644
index 0000000..07a7209
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSectioning.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+public class HedSectioning extends HedFlowContainer {
+	public HedSectioning(String elementName, ElementCollection collection) {
+		super(elementName, collection);
+		layoutType = LAYOUT_BLOCK;
+		correctionType = CORRECT_EMPTY;
+	}
+
+	/**
+	 * Article.
+	 * %attrs;
+	 * Global attributes
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+
+		// %attrs;
+		attributeCollection.getAttrs(attributes);
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTABLE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTABLE.java
index bed267c..426cd78 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTABLE.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTABLE.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,11 +12,7 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 
 /**
@@ -36,20 +32,6 @@
 	/**
 	 * TABLE.
 	 * %attrs;
-	 * %reserved;
-	 * (summary %Text; #IMPLIED)
-	 * (width %Length; #IMPLIED)
-	 * (border %Pixels; #IMPLIED)
-	 * (frame %TFrame; #IMPLIED)
-	 * (rules %TRules; #IMPLIED)
-	 * (cellspacing %Length; #IMPLIED)
-	 * (cellpadding %Length; #IMPLIED)
-	 * (align %TAlign; #IMPLIED)
-	 * (bgcolor %Color; #IMPLIED)
-	 * (datapagesize CDATA #IMPLIED)
-	 * (height %Pixels; #IMPLIED)
-	 * (background %URI; #IMPLIED)
-	 * (bordercolor %Color #IMPLIED) ... D205514
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -61,19 +43,10 @@
 
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
-		// %reserved;
-		// ... %reserved; is empty in the current DTD.
-
-		String[] names = {HTML40Namespace.ATTR_NAME_SUMMARY, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_BORDER, HTML40Namespace.ATTR_NAME_FRAME, HTML40Namespace.ATTR_NAME_RULES, HTML40Namespace.ATTR_NAME_CELLSPACING, HTML40Namespace.ATTR_NAME_CELLPADDING, HTML40Namespace.ATTR_NAME_BGCOLOR, HTML40Namespace.ATTR_NAME_DATAPAGESIZE, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_BACKGROUND, HTML40Namespace.ATTR_NAME_BORDERCOLOR // D205514
-		};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
-		// align (local)
-		HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
-		String[] alignValues = {HTML40Namespace.ATTR_VALUE_LEFT, HTML40Namespace.ATTR_VALUE_CENTER, HTML40Namespace.ATTR_VALUE_RIGHT};
-		atype.setEnumValues(alignValues);
-		HTMLAttrDeclImpl adec = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
-		attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, adec);
+		
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.TABLE, attributes);
+		
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTEXTAREA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTEXTAREA.java
index f8a61c6..1b5ba41 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTEXTAREA.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTEXTAREA.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,8 +12,6 @@
 
 
 
-import java.util.Arrays;
-
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 
@@ -35,19 +33,6 @@
 	/**
 	 * TEXTAREA.
 	 * %attrs;
-	 * %reserved; ... empty
-	 * (name CDATA #IMPLIED)
-	 * (rows NUMBER #REQUIRED)
-	 * (cols NUMBER #REQUIRED)
-	 * (disabled (disabled) #IMPLIED)
-	 * (readonly (readonly) #IMPLIED)
-	 * (tabindex NUMBER #IMPLIED)
-	 * (accesskey %Character; #IMPLIED)
-	 * (onfocus %Script; #IMPLIED)
-	 * (onblur %Script; #IMPLIED)
-	 * (onselect %Script; #IMPLIED)
-	 * (onchange %Script; #IMPLIED)
-	 * (istyle CDATA #IMPLIED)
 	 */
 	protected void createAttributeDeclarations() {
 		if (attributes != null)
@@ -58,10 +43,10 @@
 
 		// %attrs;
 		attributeCollection.getAttrs(attributes);
-
-		String[] names = {HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_ROWS, HTML40Namespace.ATTR_NAME_COLS, HTML40Namespace.ATTR_NAME_DISABLED, HTML40Namespace.ATTR_NAME_READONLY, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_ACCESSKEY, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR, HTML40Namespace.ATTR_NAME_ONSELECT, HTML40Namespace.ATTR_NAME_ONCHANGE, HTML40Namespace.ATTR_NAME_ISTYLE};
-		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-	}
+		//different sets of attributes for html 4 & 5
+		attributeCollection.createAttributeDeclarations(HTML40Namespace.ElementName.TEXTAREA, attributes);
+	
+		}
 
 	/**
 	 */
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTIME.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTIME.java
new file mode 100644
index 0000000..ec8191c
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTIME.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import java.util.Arrays;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+public class HedTIME extends HedInlineContainer {
+
+	public HedTIME(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.TIME, collection);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.html.core.internal.contentmodel.HTMLElemDeclImpl#createAttributeDeclarations()
+	 */
+	protected void createAttributeDeclarations() {
+		if (attributes != null)
+			return; // already created.
+		if (attributeCollection == null)
+			return; // fatal
+
+		attributes = new CMNamedNodeMapImpl();
+		attributeCollection.getAttrs(attributes);
+
+		String[] names = { HTML40Namespace.ATTR_NAME_DATETIME, HTML50Namespace.ATTR_NAME_PUBDATE };
+		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+
+	}
+
+	public CMContent getExclusion() {
+		if (exclusion != null)
+			return exclusion; // already created.
+		if (elementCollection == null)
+			return null;
+
+		exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
+		CMNode time = elementCollection.getNamedItem(HTML50Namespace.ElementName.TIME);
+		if (time != null)
+			exclusion.appendChild(time);
+
+		return exclusion;
+	}
+
+	public CMNamedNodeMap getProhibitedAncestors() {
+		if (prohibitedAncestors != null)
+			return prohibitedAncestors;
+
+		String[] names = {HTML50Namespace.ElementName.TIME};
+		prohibitedAncestors = elementCollection.getDeclarations(names);
+		return prohibitedAncestors;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedVIDEO.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedVIDEO.java
new file mode 100644
index 0000000..98eb444
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedVIDEO.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import java.util.Arrays;
+
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+
+
+
+
+/**
+ * VIDEO.
+ */
+final class HedVIDEO extends HedMediaElement {
+
+	
+	public HedVIDEO(ElementCollection collection) {
+		super(HTML50Namespace.ElementName.VIDEO, collection);
+	}
+
+	/**
+	 * MediaElement
+	 * %attrs;
+	 * (src %URI; #REQUIRED): should be defined locally.
+	 * (preload %CDATA; #IMPLIED) 
+	 * (autoplay %ENUM; #IMPLIED) 
+	 * (loop %ENUM; #IMPLIED)
+	 * (controls %MediaType; #IMPLIED)
+	 * (poster %URI; OPTIONAL)
+	 * (height %Length; #IMPLIED)
+	 * (width %Length; #IMPLIED)
+	 * Global attributes
+	 */
+	protected void createAttributeDeclarations() {
+		super.createAttributeDeclarations();
+		
+		// (poster %URI; #optional): should be defined locally.
+		
+		HTMLCMDataTypeImpl atype = null;
+		HTMLAttrDeclImpl attr = null;
+		atype = new HTMLCMDataTypeImpl(CMDataType.URI);
+		attr = new HTMLAttrDeclImpl(HTML50Namespace.ATTR_NAME_POSTER, atype, CMAttributeDeclaration.OPTIONAL);
+		attributes.putNamedItem(HTML50Namespace.ATTR_NAME_POSTER, attr);
+		
+		// height , width
+		String[] names = {HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_WIDTH};
+		attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
+
+
+		
+	}
+}
+
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCM21DocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCM21DocImpl.java
new file mode 100644
index 0000000..ba9e0cd
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCM21DocImpl.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+class JCM21DocImpl extends JCMDocImpl {
+	/**
+	 * JCM21DocImpl constructor comment.
+	 */
+	public JCM21DocImpl(String docTypeName, CMNamespaceImpl targetNamespace) {
+		super(docTypeName, targetNamespace, new JSP21ElementCollection());
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20ElementCollection.java
index d2e1be8..fd404c5 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20ElementCollection.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20ElementCollection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,7 +23,7 @@
 /**
  * Factory for element declarations of JSP 1.1 and JSP 1.2.
  */
-final class JSP20ElementCollection extends JSPElementCollection implements JSP20Namespace.ElementName {
+class JSP20ElementCollection extends JSPElementCollection implements JSP20Namespace.ElementName {
 
 	// element IDs
 	private static class Ids20 extends Ids {
@@ -55,7 +55,7 @@
 	}
 
 	// attribute creater
-	private class JACreater20 extends JACreater {
+	class JACreater20 extends JACreater {
 		public JACreater20() {
 			super();
 		}
@@ -77,6 +77,15 @@
 				case Ids.ID_DIRECTIVE_TAGLIB :
 					createForDirTaglib();
 					break;
+				case Ids.ID_DIRECTIVE_PAGE :
+					createForDirPage();
+					break;
+				case Ids.ID_ROOT :
+					createForRoot();
+					break;
+				case Ids.ID_PLUGIN :
+					createForPlugin();
+					break;
 				default :
 					super.getDeclarations(eid);
 			}
@@ -87,13 +96,13 @@
 		}
 
 		private void createForOutput() {
-			AttrDecl adec = new AttrDecl(JSP20Namespace.ElementName.OUTPUT);
+			AttrDecl adec = new AttrDecl(JSP20Namespace.ATTR_NAME_OMIT_XML_DECL);
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
 			String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE, JSP20Namespace.ATTR_VALUE_YES, JSP20Namespace.ATTR_VALUE_NO};
 			adec.type.setEnumValues(values);
 			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_NO);
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
-			declarations.putNamedItem(JSP20Namespace.ElementName.OUTPUT, adec);
+			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_OMIT_XML_DECL, adec);
 
 			adec = new AttrDecl(JSP20Namespace.ATTR_NAME_DOCTYPE_ROOT_ELEMENT);
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
@@ -134,6 +143,82 @@
 			declarations.putNamedItem(ATTR_NAME_PREFIX, adec);
 		}
 		
+		void createForDirPage() {
+			AttrDecl adec = null;
+			// ("language" CDATA DECLARED "java")
+			adec = new AttrDecl(ATTR_NAME_LANGUAGE);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_JAVA);
+			declarations.putNamedItem(ATTR_NAME_LANGUAGE, adec);
+
+			// ("extends" CDATA IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_EXTENDS);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			declarations.putNamedItem(ATTR_NAME_EXTENDS, adec);
+
+			// ("import" CDATA IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_IMPORT);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			declarations.putNamedItem(ATTR_NAME_IMPORT, adec);
+
+			// ("session" ENUM DECLARED (true|false) "true")
+			adec = createBoolType(ATTR_NAME_SESSION, ATTR_VALUE_TRUE);
+			if (adec != null)
+				declarations.putNamedItem(ATTR_NAME_SESSION, adec);
+
+			// ("buffer" CDATA DECLARED "8kb")
+			adec = new AttrDecl(ATTR_NAME_BUFFER);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_BUFSIZ_DEFAULT);
+			declarations.putNamedItem(ATTR_NAME_BUFFER, adec);
+
+			// ("autoFlush" ENUM DECLARED (true|false) "true")
+			adec = createBoolType(ATTR_NAME_AUTOFLUSH, ATTR_VALUE_TRUE);
+			if (adec != null)
+				declarations.putNamedItem(ATTR_NAME_AUTOFLUSH, adec);
+
+			// ("isThreadSafe" ENUM DECLARED (true|false) "true")
+			adec = createBoolType(ATTR_NAME_IS_THREAD_SAFE, ATTR_VALUE_TRUE);
+			if (adec != null)
+				declarations.putNamedItem(ATTR_NAME_IS_THREAD_SAFE, adec);
+
+			// ("info" CDATA IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_INFO);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			declarations.putNamedItem(ATTR_NAME_INFO, adec);
+
+			// ("errorPage" URI IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_ERROR_PAGE);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
+			declarations.putNamedItem(ATTR_NAME_ERROR_PAGE, adec);
+
+			// ("isErrorPage" ENUM DECLARED (true|false) "false")
+			adec = createBoolType(ATTR_NAME_IS_ERROR_PAGE, ATTR_VALUE_FALSE);
+			if (adec != null)
+				declarations.putNamedItem(ATTR_NAME_IS_ERROR_PAGE, adec);
+
+			// ("contentType" CDATA DECLARED "text/html; ISO-8859-1")
+			adec = new AttrDecl(ATTR_NAME_CONTENT_TYPE);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_CT_DEFAULT);
+			declarations.putNamedItem(ATTR_NAME_CONTENT_TYPE, adec);
+
+			// ("pageEncoding" CDATA IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_PAGE_ENCODING);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_ENCODING_DEFAULT);
+			declarations.putNamedItem(ATTR_NAME_PAGE_ENCODING, adec);
+
+			// ("isELIgnored" ENUM DECLARED (true|false) "false")
+			adec = new AttrDecl(JSP20Namespace.ATTR_NAME_ISELIGNORED);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] values = new String[]{ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
+			adec.type.setEnumValues(values);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_FALSE);
+			adec.usage = CMAttributeDeclaration.OPTIONAL;
+			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_ISELIGNORED, adec);
+		}
+		
 		private void createForElement() {
 			AttrDecl adec = new AttrDecl(ATTR_NAME_NAME);
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
@@ -151,10 +236,106 @@
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
 			String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
 			adec.type.setEnumValues(values);
-			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_FALSE);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TRUE);
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
 			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_TRIM, adec);
 		}
+		
+		private void createForRoot() {
+			// ("xmlns:jsp" CDATA "http://java.sun.com/JSP/Page")
+			AttrDecl adec = new AttrDecl(ATTR_NAME_XMLNS_JSP);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_XMLNS_JSP);
+			declarations.putNamedItem(ATTR_NAME_XMLNS_JSP, adec);
+			// ("version" CDATA REQUIRED)
+			adec = new AttrDecl(ATTR_NAME_VERSION);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_JSP_VER_20);
+			adec.usage = CMAttributeDeclaration.REQUIRED;
+			declarations.putNamedItem(ATTR_NAME_VERSION, adec);
+		}
+		
+		private void createForPlugin() {
+			// ("type" ENUM REQUIRED (bean|applet))
+			AttrDecl adec = new AttrDecl(ATTR_NAME_TYPE);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			adec.usage = CMAttributeDeclaration.REQUIRED;
+			String[] values = {ATTR_VALUE_BEAN, ATTR_VALUE_APPLET};
+			adec.type.setEnumValues(values);
+			declarations.putNamedItem(ATTR_NAME_TYPE, adec);
+
+			// ("code" CDATA REQUIRED)
+			adec = new AttrDecl(ATTR_NAME_CODE);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
+			adec.usage = CMAttributeDeclaration.REQUIRED;
+			declarations.putNamedItem(ATTR_NAME_CODE, adec);
+
+			// ("codebase" URI REQUIRED)
+			adec = new AttrDecl(ATTR_NAME_CODEBASE);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
+			adec.usage = CMAttributeDeclaration.REQUIRED;
+			declarations.putNamedItem(ATTR_NAME_CODEBASE, adec);
+
+			// ("align" ENUM IMPLIED (top|middle|bottom|left|right))
+			adec = new AttrDecl(ATTR_NAME_ALIGN);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] aligns = {ATTR_VALUE_TOP, ATTR_VALUE_MIDDLE, ATTR_VALUE_BOTTOM, ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT};
+			adec.type.setEnumValues(aligns);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_BOTTOM);
+			declarations.putNamedItem(ATTR_NAME_ALIGN, adec);
+
+			// ("archive" CDATA IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_ARCHIVE);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			declarations.putNamedItem(ATTR_NAME_ARCHIVE, adec);
+
+			// ("height" CDATA IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_HEIGHT);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			declarations.putNamedItem(ATTR_NAME_HEIGHT, adec);
+
+			// ("hspace" CDATA IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_HSPACE);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			declarations.putNamedItem(ATTR_NAME_HSPACE, adec);
+
+			// ("jreversion" CDATA DECLARED "1.1")
+			adec = new AttrDecl(ATTR_NAME_JREVERSION);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_JVER12);
+			declarations.putNamedItem(ATTR_NAME_JREVERSION, adec);
+
+			// ("name" CDATA IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_NAME);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			declarations.putNamedItem(ATTR_NAME_NAME, adec);
+
+			// ("vspace" CDATA IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_VSPACE);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			declarations.putNamedItem(ATTR_NAME_VSPACE, adec);
+
+			// ("width" CDATA IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_WIDTH);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			declarations.putNamedItem(ATTR_NAME_WIDTH, adec);
+
+			// ("nspluginurl" URI IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_NSPLUGINURL);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
+			declarations.putNamedItem(ATTR_NAME_NSPLUGINURL, adec);
+
+			// ("iepluginurl" URI IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_IEPLUGINURL);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
+			declarations.putNamedItem(ATTR_NAME_IEPLUGINURL, adec);
+			
+			// ("mayscript" ENUM IMPLIED (true | false)
+			adec = new AttrDecl(JSP20Namespace.ATTR_NAME_MAYSCRIPT);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			adec.type.setEnumValues(new String[] {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE});
+			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_MAYSCRIPT, adec);
+		}
 	}
 
 	private static String[] names = null;
@@ -274,6 +455,25 @@
 				packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
 				packet.format = HTMLElementDeclaration.FORMAT_JSP_DIRECTIVE;
 				break;
+			case Ids.ID_DIRECTIVE_PAGE :
+				// directive.page
+				packet.name = DIRECTIVE_PAGE;
+				packet.omit = HTMLElementDeclaration.OMIT_END;
+				packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
+				packet.format = HTMLElementDeclaration.FORMAT_JSP_DIRECTIVE;
+				break;
+			case Ids.ID_ROOT :
+				packet.name = ROOT;
+				packet.content = CMElementDeclaration.ELEMENT;
+				packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN; // same as HTML
+				break;
+			case Ids.ID_PLUGIN :
+				// plugin
+				packet.name = PLUGIN;
+				packet.content = CMElementDeclaration.ELEMENT;
+				packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
+				packet.indentChild = true;
+				break;
 			default :
 				return super.createElemDecl(eid);
 		}
@@ -283,9 +483,13 @@
 		if (content != null)
 			decl.setContent(content);
 
-		JACreater20 creater = new JACreater20();
+		JACreater20 creater = getAttributeCreator();
 		decl.setAttributes(creater.getDeclarations(eid));
 
 		return decl;
 	}
+
+	protected JACreater20 getAttributeCreator() {
+		return new JACreater20();
+	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20Namespace.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20Namespace.java
index 5a0dc9a..ee138a2 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20Namespace.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20Namespace.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -44,8 +44,6 @@
 	String ATTR_NAME_DESCRIPTION = "description"; //$NON-NLS-1$
 	String ATTR_NAME_EXAMPLE = "example"; //$NON-NLS-1$
 	String ATTR_NAME_LANGUAGE = "language"; //$NON-NLS-1$
-	String ATTR_NAME_IMPORT = "import"; //$NON-NLS-1$
-	String ATTR_NAME_PAGEENCODING = "pageEncoding"; //$NON-NLS-1$
 	String ATTR_NAME_ISELIGNORED = "isELIgnored"; //$NON-NLS-1$
 
 	String ATTR_NAME_REQUIRED = "required"; //$NON-NLS-1$
@@ -68,14 +66,32 @@
 	String ATTR_NAME_VAR = "var"; //$NON-NLS-1$
 	String ATTR_NAME_VARREADER = "varReader"; //$NON-NLS-1$
 
+	String ATTR_NAME_OMIT_XML_DECL = "omit-xml-declaration"; //$NON-NLS-1$
 	String ATTR_NAME_DOCTYPE_ROOT_ELEMENT = "doctype-root-element"; //$NON-NLS-1$
 	String ATTR_NAME_DOCTYPE_SYSTEM = "doctype-system"; //$NON-NLS-1$
 	String ATTR_NAME_DOCTYPE_PUBLIC = "doctype-public"; //$NON-NLS-1$
 
-	String ATTR_VALUE_NO = "no";
-	String ATTR_VALUE_YES = "yes";
+	String ATTR_VALUE_NO = "no"; //$NON-NLS-1$
+	String ATTR_VALUE_YES = "yes"; //$NON-NLS-1$
 
-	String ATTR_VALUE_SCOPE_AT_END = "AT_END";
-	String ATTR_VALUE_SCOPE_AT_BEGIN = "AT_BEGIN";
-	String ATTR_VALUE_SCOPE_NESTED = "NESTED";
+	String ATTR_VALUE_SCOPE_AT_END = "AT_END"; //$NON-NLS-1$
+	String ATTR_VALUE_SCOPE_AT_BEGIN = "AT_BEGIN"; //$NON-NLS-1$
+	String ATTR_VALUE_SCOPE_NESTED = "NESTED"; //$NON-NLS-1$
+
+	String ATTR_NAME_DYNAMIC_ATTRIBUTES = "dynamic-attributes"; //$NON-NLS-1$
+	
+	String ATTR_VALUE_ENCODING_DEFAULT = "ISO-8859-1"; //$NON-NLS-1$
+	
+	String ATTR_VALUE_VARIABLE_CLASS_DEFAULT = "java.lang.String"; //$NON-NLS-1$
+	
+	String ATTR_NAME_MAYSCRIPT = "mayscript"; //$NON-NLS-1$
+	
+	String ATTR_VALUE_JVER12 = "1.2"; //$NON-NLS-1$
+	
+	String ATTR_VALUE_JSP_VER_20 = "2.0"; //$NON-NLS-1$
+	
+	// JSP 2.1 attributes
+//	String ATTR_NAME_DEFERRED_SYNTAX_ALLOWED_AS_LITERAL = "deferredSyntaxAllowedAsLiteral"; //$NON-NLS-1$
+//	String ATTR_NAME_TRIM_DIRECTIVE_WHITESPACES = "trimDirectiveWhitespaces"; //$NON-NLS-1$
+	
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21ElementCollection.java
new file mode 100644
index 0000000..4b7a1ba
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21ElementCollection.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+
+class JSP21ElementCollection extends JSP20ElementCollection {
+
+	class JACreator21 extends JACreater20 {
+		void createForDirPage() {
+			super.createForDirPage();
+			AttrDecl adec;
+			// ("trimDirectiveWhitespaces" ENUM DECLARED (true|false) "false")
+			adec = createBoolType(JSP21Namespace.ATTR_NAME_TRIM_DIRECTIVE_WHITESPACES, ATTR_VALUE_FALSE);
+			if (adec != null) {
+				adec.usage = CMAttributeDeclaration.OPTIONAL;
+				declarations.putNamedItem(JSP21Namespace.ATTR_NAME_TRIM_DIRECTIVE_WHITESPACES, adec);
+			}
+			// ("deferredSyntaxAllowedAsLiteral" ENUM DECLARED (true|false) "false")
+			adec = createBoolType(JSP21Namespace.ATTR_NAME_DEFERRED_SYNTAX_ALLOWED_AS_LITERAL, ATTR_VALUE_FALSE);
+			if (adec != null) {
+				adec.usage = CMAttributeDeclaration.OPTIONAL;
+				declarations.putNamedItem(JSP21Namespace.ATTR_NAME_DEFERRED_SYNTAX_ALLOWED_AS_LITERAL, adec);
+			}
+		}
+	}
+
+	protected JACreater20 getAttributeCreator() {
+		return new JACreator21();
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21Namespace.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21Namespace.java
new file mode 100644
index 0000000..dde35b7
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP21Namespace.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contentmodel;
+
+public interface JSP21Namespace extends JSP20Namespace {
+	String JSP21_URI = "";//$NON-NLS-1$
+	String ATTR_NAME_TRIM_DIRECTIVE_WHITESPACES = "trimDirectiveWhitespaces"; //$NON-NLS-1$
+	String ATTR_NAME_DEFERRED_SYNTAX_ALLOWED_AS_LITERAL = "deferredSyntaxAllowedAsLiteral"; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPElementCollection.java
index 67832d9..c517f99 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPElementCollection.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPElementCollection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -327,7 +327,7 @@
 			return declarations;
 		}
 
-		private AttrDecl createBoolType(String name, String defValue) {
+		AttrDecl createBoolType(String name, String defValue) {
 			AttrDecl adec = new AttrDecl(name);
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
 			String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
@@ -411,7 +411,7 @@
 			declarations.putNamedItem(ATTR_NAME_FILE, adec);
 		}
 
-		void createForDirTaglib() {
+		private void createForDirTaglib() {
 			// ("uri" URI REQUIRED)
 			AttrDecl adec = new AttrDecl(ATTR_NAME_URI);
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
@@ -613,7 +613,7 @@
 		}
 
 		private void createForRoot() {
-			// ("xmlns:jsp" CDATA "http://jva.sun.com/JSP/Page")
+			// ("xmlns:jsp" CDATA "http://java.sun.com/JSP/Page")
 			AttrDecl adec = new AttrDecl(ATTR_NAME_XMLNS_JSP);
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
 			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_XMLNS_JSP);
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag20ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag20ElementCollection.java
index c8fb4ba..8dd86bc 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag20ElementCollection.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/Tag20ElementCollection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -91,7 +91,7 @@
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
 			String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
 			adec.type.setEnumValues(values);
-			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_FALSE);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TRUE);
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
 			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_TRIM, adec);
 		}
@@ -109,6 +109,7 @@
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
 			String[] values = new String[]{ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
 			adec.type.setEnumValues(values);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_FALSE);
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
 			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_REQUIRED, adec);
 
@@ -116,6 +117,7 @@
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
 			values = new String[]{ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
 			adec.type.setEnumValues(values);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_FALSE);
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
 			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_FRAGMENT, adec);
 
@@ -123,6 +125,7 @@
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
 			values = new String[]{ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
 			adec.type.setEnumValues(values);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TRUE);
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
 			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_RTEXPRVALUE, adec);
 
@@ -131,11 +134,6 @@
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
 			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_TYPE, adec);
 
-			adec = new AttrDecl(ATTR_NAME_NAME);
-			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
-			adec.usage = CMAttributeDeclaration.REQUIRED;
-			declarations.putNamedItem(ATTR_NAME_NAME, adec);
-
 			adec = new AttrDecl(JSP20Namespace.ATTR_NAME_DESCRIPTION);
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
@@ -159,8 +157,14 @@
 			String[] values = {JSP20Namespace.ATTR_VALUE_EMPTY, JSP20Namespace.ATTR_VALUE_TAGDEPENDENT, JSP20Namespace.ATTR_VALUE_SCRIPTLESS};
 			adec.type.setEnumValues(values);
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_SCRIPTLESS);
 			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_BODY_CONTENT, adec);
 
+			adec = new AttrDecl(JSP20Namespace.ATTR_NAME_DYNAMIC_ATTRIBUTES);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			adec.usage = CMAttributeDeclaration.OPTIONAL;
+			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_DYNAMIC_ATTRIBUTES, adec);
+			
 			adec = new AttrDecl(JSP20Namespace.ATTR_NAME_SMALL_ICON);
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
@@ -183,23 +187,26 @@
 
 			adec = new AttrDecl(JSP20Namespace.ATTR_NAME_LANGUAGE);
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_JAVA);
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
 			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_LANGUAGE, adec);
 
-			adec = new AttrDecl(JSP20Namespace.ATTR_NAME_IMPORT);
+			adec = new AttrDecl(JSP11Namespace.ATTR_NAME_IMPORT);
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
-			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_IMPORT, adec);
+			declarations.putNamedItem(JSP11Namespace.ATTR_NAME_IMPORT, adec);
 
-			adec = new AttrDecl(JSP20Namespace.ATTR_NAME_PAGEENCODING);
+			adec = new AttrDecl(JSP11Namespace.ATTR_NAME_PAGE_ENCODING);
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_ENCODING_DEFAULT);
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
-			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_PAGEENCODING, adec);
+			declarations.putNamedItem(JSP11Namespace.ATTR_NAME_PAGE_ENCODING, adec);
 
 			adec = new AttrDecl(JSP20Namespace.ATTR_NAME_ISELIGNORED);
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
 			values = new String[]{ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
 			adec.type.setEnumValues(values);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_FALSE);
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
 			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_ISELIGNORED, adec);
 		}
@@ -245,6 +252,7 @@
 
 			adec = new AttrDecl(JSP20Namespace.ATTR_NAME_VARIABLE_CLASS);
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_VARIABLE_CLASS_DEFAULT);
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
 			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_VARIABLE_CLASS, adec);
 
@@ -252,6 +260,7 @@
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
 			String[] values = new String[]{ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
 			adec.type.setEnumValues(values);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TRUE);
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
 			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_DECLARE, adec);
 
@@ -284,7 +293,7 @@
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
 			String[] values = {ATTR_VALUE_PAGE, ATTR_VALUE_REQUEST, ATTR_VALUE_SESSION, ATTR_VALUE_APPLICATION};
 			adec.type.setEnumValues(values);
-			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_FALSE);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_PAGE);
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
 			declarations.putNamedItem(JSP11Namespace.ATTR_NAME_SCOPE, adec);
 		}
@@ -316,19 +325,19 @@
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
 			String[] values = {ATTR_VALUE_PAGE, ATTR_VALUE_REQUEST, ATTR_VALUE_SESSION, ATTR_VALUE_APPLICATION};
 			adec.type.setEnumValues(values);
-			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_FALSE);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_PAGE);
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
 			declarations.putNamedItem(JSP11Namespace.ATTR_NAME_SCOPE, adec);
 		}
 
 		private void createForOutput() {
-			AttrDecl adec = new AttrDecl(JSP20Namespace.ElementName.OUTPUT);
+			AttrDecl adec = new AttrDecl(JSP20Namespace.ATTR_NAME_OMIT_XML_DECL);
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
 			String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE, JSP20Namespace.ATTR_VALUE_YES, JSP20Namespace.ATTR_VALUE_NO};
 			adec.type.setEnumValues(values);
 			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_NO);
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
-			declarations.putNamedItem(JSP20Namespace.ElementName.OUTPUT, adec);
+			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_OMIT_XML_DECL, adec);
 
 			adec = new AttrDecl(JSP20Namespace.ATTR_NAME_DOCTYPE_ROOT_ELEMENT);
 			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
@@ -345,6 +354,102 @@
 			adec.usage = CMAttributeDeclaration.OPTIONAL;
 			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_DOCTYPE_PUBLIC, adec);
 		}
+		
+		private void createForRoot() {
+			// ("xmlns:jsp" CDATA "http://java.sun.com/JSP/Page")
+			AttrDecl adec = new AttrDecl(ATTR_NAME_XMLNS_JSP);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_XMLNS_JSP);
+			declarations.putNamedItem(ATTR_NAME_XMLNS_JSP, adec);
+			// ("version" CDATA REQUIRED)
+			adec = new AttrDecl(ATTR_NAME_VERSION);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_JSP_VER_20);
+			adec.usage = CMAttributeDeclaration.REQUIRED;
+			declarations.putNamedItem(ATTR_NAME_VERSION, adec);
+		}
+		
+		private void createForPlugin() {
+			// ("type" ENUM REQUIRED (bean|applet))
+			AttrDecl adec = new AttrDecl(ATTR_NAME_TYPE);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			adec.usage = CMAttributeDeclaration.REQUIRED;
+			String[] values = {ATTR_VALUE_BEAN, ATTR_VALUE_APPLET};
+			adec.type.setEnumValues(values);
+			declarations.putNamedItem(ATTR_NAME_TYPE, adec);
+
+			// ("code" CDATA REQUIRED)
+			adec = new AttrDecl(ATTR_NAME_CODE);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
+			adec.usage = CMAttributeDeclaration.REQUIRED;
+			declarations.putNamedItem(ATTR_NAME_CODE, adec);
+
+			// ("codebase" URI REQUIRED)
+			adec = new AttrDecl(ATTR_NAME_CODEBASE);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
+			adec.usage = CMAttributeDeclaration.REQUIRED;
+			declarations.putNamedItem(ATTR_NAME_CODEBASE, adec);
+
+			// ("align" ENUM IMPLIED (top|middle|bottom|left|right))
+			adec = new AttrDecl(ATTR_NAME_ALIGN);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			String[] aligns = {ATTR_VALUE_TOP, ATTR_VALUE_MIDDLE, ATTR_VALUE_BOTTOM, ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT};
+			adec.type.setEnumValues(aligns);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_BOTTOM);
+			declarations.putNamedItem(ATTR_NAME_ALIGN, adec);
+
+			// ("archive" CDATA IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_ARCHIVE);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			declarations.putNamedItem(ATTR_NAME_ARCHIVE, adec);
+
+			// ("height" CDATA IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_HEIGHT);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			declarations.putNamedItem(ATTR_NAME_HEIGHT, adec);
+
+			// ("hspace" CDATA IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_HSPACE);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			declarations.putNamedItem(ATTR_NAME_HSPACE, adec);
+
+			// ("jreversion" CDATA DECLARED "1.1")
+			adec = new AttrDecl(ATTR_NAME_JREVERSION);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, JSP20Namespace.ATTR_VALUE_JVER12);
+			declarations.putNamedItem(ATTR_NAME_JREVERSION, adec);
+
+			// ("name" CDATA IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_NAME);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			declarations.putNamedItem(ATTR_NAME_NAME, adec);
+
+			// ("vspace" CDATA IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_VSPACE);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			declarations.putNamedItem(ATTR_NAME_VSPACE, adec);
+
+			// ("width" CDATA IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_WIDTH);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
+			declarations.putNamedItem(ATTR_NAME_WIDTH, adec);
+
+			// ("nspluginurl" URI IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_NSPLUGINURL);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
+			declarations.putNamedItem(ATTR_NAME_NSPLUGINURL, adec);
+
+			// ("iepluginurl" URI IMPLIED)
+			adec = new AttrDecl(ATTR_NAME_IEPLUGINURL);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
+			declarations.putNamedItem(ATTR_NAME_IEPLUGINURL, adec);
+			
+			// ("mayscript" ENUM IMPLIED (true | false)
+			adec = new AttrDecl(JSP20Namespace.ATTR_NAME_MAYSCRIPT);
+			adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
+			adec.type.setEnumValues(new String[] {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE});
+			declarations.putNamedItem(JSP20Namespace.ATTR_NAME_MAYSCRIPT, adec);
+		}
 
 		public CMNamedNodeMapImpl getDeclarations(int eid) {
 			switch (eid) {
@@ -378,6 +483,12 @@
 				case TagIds20.ID_OUTPUT :
 					createForOutput();
 					break;
+				case TagIds20.ID_ROOT :
+					createForRoot();
+					break;
+				case TagIds20.ID_PLUGIN :
+					createForPlugin();
+					break;
 				default :
 					super.getDeclarations(eid);
 					break;
@@ -390,23 +501,23 @@
 
 	static {
 		names = new String[TagIds20.getNumOfIds()];
-		names[Ids.ID_SCRIPTLET] = JSP11Namespace.ElementName.SCRIPTLET;
-		names[Ids.ID_EXPRESSION] = JSP11Namespace.ElementName.EXPRESSION;
-		names[Ids.ID_DECLARATION] = JSP11Namespace.ElementName.DECLARATION;
+		names[TagIds20.ID_SCRIPTLET] = JSP11Namespace.ElementName.SCRIPTLET;
+		names[TagIds20.ID_EXPRESSION] = JSP11Namespace.ElementName.EXPRESSION;
+		names[TagIds20.ID_DECLARATION] = JSP11Namespace.ElementName.DECLARATION;
 		names[TagIds20.ID_DIRECTIVE_TAG] = JSP20Namespace.ElementName.DIRECTIVE_TAG;
-		names[Ids.ID_DIRECTIVE_INCLUDE] = JSP11Namespace.ElementName.DIRECTIVE_INCLUDE;
-		names[Ids.ID_DIRECTIVE_TAGLIB] = JSP11Namespace.ElementName.DIRECTIVE_TAGLIB;
-		names[Ids.ID_USEBEAN] = JSP11Namespace.ElementName.USEBEAN;
-		names[Ids.ID_SETPROPERTY] = JSP11Namespace.ElementName.SETPROPERTY;
-		names[Ids.ID_GETPROPERTY] = JSP11Namespace.ElementName.GETPROPERTY;
-		names[Ids.ID_INCLUDE] = JSP11Namespace.ElementName.INCLUDE;
-		names[Ids.ID_FORWARD] = JSP11Namespace.ElementName.FORWARD;
-		names[Ids.ID_PLUGIN] = JSP11Namespace.ElementName.PLUGIN;
-		names[Ids.ID_PARAMS] = JSP11Namespace.ElementName.PARAMS;
-		names[Ids.ID_FALLBACK] = JSP11Namespace.ElementName.FALLBACK;
-		names[Ids.ID_PARAM] = JSP11Namespace.ElementName.PARAM;
-		names[Ids.ID_ROOT] = JSP11Namespace.ElementName.ROOT;
-		names[Ids.ID_TEXT] = JSP11Namespace.ElementName.TEXT;
+		names[TagIds20.ID_DIRECTIVE_INCLUDE] = JSP11Namespace.ElementName.DIRECTIVE_INCLUDE;
+		names[TagIds20.ID_DIRECTIVE_TAGLIB] = JSP11Namespace.ElementName.DIRECTIVE_TAGLIB;
+		names[TagIds20.ID_USEBEAN] = JSP11Namespace.ElementName.USEBEAN;
+		names[TagIds20.ID_SETPROPERTY] = JSP11Namespace.ElementName.SETPROPERTY;
+		names[TagIds20.ID_GETPROPERTY] = JSP11Namespace.ElementName.GETPROPERTY;
+		names[TagIds20.ID_INCLUDE] = JSP11Namespace.ElementName.INCLUDE;
+		names[TagIds20.ID_FORWARD] = JSP11Namespace.ElementName.FORWARD;
+		names[TagIds20.ID_PLUGIN] = JSP11Namespace.ElementName.PLUGIN;
+		names[TagIds20.ID_PARAMS] = JSP11Namespace.ElementName.PARAMS;
+		names[TagIds20.ID_FALLBACK] = JSP11Namespace.ElementName.FALLBACK;
+		names[TagIds20.ID_PARAM] = JSP11Namespace.ElementName.PARAM;
+		names[TagIds20.ID_ROOT] = JSP11Namespace.ElementName.ROOT;
+		names[TagIds20.ID_TEXT] = JSP11Namespace.ElementName.TEXT;
 		names[TagIds20.ID_DIRECTIVE_VARIABLE] = JSP20Namespace.ElementName.DIRECTIVE_VARIABLE;
 		names[TagIds20.ID_DIRECTIVE_ATTRIBUTE] = JSP20Namespace.ElementName.DIRECTIVE_ATTRIBUTE;
 		names[TagIds20.ID_BODY] = JSP20Namespace.ElementName.BODY;
@@ -553,6 +664,18 @@
 				packet.indentChild = true;
 				packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
 				break;
+			case TagIds20.ID_ROOT :
+				packet.name = ROOT;
+				packet.content = CMElementDeclaration.ELEMENT;
+				packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN; // same as HTML
+				break;
+			case TagIds20.ID_PLUGIN :
+				// plugin
+				packet.name = PLUGIN;
+				packet.content = CMElementDeclaration.ELEMENT;
+				packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
+				packet.indentChild = true;
+				break;
 			default :
 				return super.createElemDecl(eid);
 		}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.java
index 33e48f2..ea727f8 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.java
@@ -1,18 +1,17 @@
+/* The following code was generated by JFlex 1.2.2 on 8/17/10 3:37 PM */
+
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- *
+ * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
-/* The following code was generated by JFlex 1.2.2 on 1/27/04 6:41 PM */
-
-/*nlsXXX*/  
+/*nlsXXX*/
 package org.eclipse.wst.html.core.internal.contenttype;
-
 import java.io.IOException;
 import java.io.Reader;
 
@@ -21,103 +20,129 @@
 
 
 
+
 /**
  * This class is a scanner generated by 
  * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 1/27/04 6:41 PM from the specification file
- * <tt>file:/D:/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jflex</tt>
+ * on 8/17/10 3:37 PM from the specification file
+ * <tt>file:/D:/dev/workspaces/helios/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex</tt>
  */
 public class HTMLHeadTokenizer {
 
-	/** this character denotes the end of file */
-	final public static int YYEOF = -1;
+  /** this character denotes the end of file */
+  final public static int YYEOF = -1;
 
-	/** lexical states */
-	final public static int ST_META_TAG = 4;
-	final public static int YYINITIAL = 0;
-	final public static int UnDelimitedString = 12;
-	final public static int DQ_STRING = 8;
-	final public static int SQ_STRING = 10;
-	final public static int ST_XMLDecl = 2;
-	final public static int QuotedAttributeValue = 6;
+  /** lexical states */
+  final public static int ST_META_TAG = 4;
+  final public static int YYINITIAL = 0;
+  final public static int UnDelimitedString = 12;
+  final public static int DQ_STRING = 8;
+  final public static int UnDelimitedCharset = 14;
+  final public static int SQ_STRING = 10;
+  final public static int ST_XMLDecl = 2;
+  final public static int QuotedAttributeValue = 6;
 
-	/**
-	 * YY_LEXSTATE[l] is the state in the DFA for the lexical state l
-	 * YY_LEXSTATE[l+1] is the state in the DFA for the lexical state l
-	 *                  at the beginning of a line
-	 * l is of the form l = 2*k, k a non negative integer
-	 */
-	private final static int YY_LEXSTATE[] = {0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7};
+  /**
+   * YY_LEXSTATE[l] is the state in the DFA for the lexical state l
+   * YY_LEXSTATE[l+1] is the state in the DFA for the lexical state l
+   *                  at the beginning of a line
+   * l is of the form l = 2*k, k a non negative integer
+   */
+  private final static int YY_LEXSTATE[] = { 
+     0,  1,  2,  2,  3,  3,  4,  4,  5,  5,  6,  6,  7,  7,  8, 8
+  };
 
-	/** 
-	 * Translates characters to character classes
-	 */
-	final private static String yycmap_packed = "\11\0\1\6\1\7\2\0\1\11\22\0\1\22\1\0\1\40\2\0" + "\1\44\1\0\1\43\5\0\1\34\1\0\1\42\13\0\1\45\1\12" + "\1\10\1\31\1\13\1\0\1\21\1\0\1\24\1\26\1\17\1\0" + "\1\30\1\32\1\27\2\0\1\16\1\15\1\23\1\25\1\33\1\35" + "\2\0\1\20\1\36\1\37\1\0\1\14\1\41\7\0\1\21\1\0" + "\1\24\1\26\1\17\1\0\1\30\1\32\1\27\2\0\1\16\1\15" + "\1\23\1\25\1\33\1\35\2\0\1\20\1\36\1\37\1\0\1\14" + "\1\41\101\0\1\4\3\0\1\5\17\0\1\3\16\0\1\1\20\0" + "\1\3\16\0\1\1\1\2\170\0\1\2\ufe87\0";
+  /** 
+   * Translates characters to character classes
+   */
+  final private static String yycmap_packed = 
+    "\1\11\10\0\1\6\1\7\2\0\1\10\22\0\1\6\1\0\1\40"+
+    "\2\0\1\46\1\0\1\45\5\0\1\34\1\0\1\44\13\0\1\47"+
+    "\1\13\1\12\1\31\1\14\1\0\1\22\1\0\1\24\1\26\1\20"+
+    "\1\0\1\30\1\32\1\27\2\0\1\17\1\16\1\23\1\25\1\33"+
+    "\1\35\1\42\1\43\1\21\1\36\1\37\1\0\1\15\1\41\7\0"+
+    "\1\22\1\0\1\24\1\26\1\20\1\0\1\30\1\32\1\27\2\0"+
+    "\1\17\1\16\1\23\1\25\1\33\1\35\1\42\1\43\1\21\1\36"+
+    "\1\37\1\0\1\15\1\41\101\0\1\4\3\0\1\5\17\0\1\3"+
+    "\16\0\1\1\20\0\1\3\16\0\1\1\1\2\170\0\1\2\ufe87\0";
 
-	/** 
-	 * Translates characters to character classes
-	 */
-	final private static char[] yycmap = yy_unpack_cmap(yycmap_packed);
+  /** 
+   * Translates characters to character classes
+   */
+  final private static char [] yycmap = yy_unpack_cmap(yycmap_packed);
 
 
-	/* error codes */
-	final private static int YY_UNKNOWN_ERROR = 0;
-	final private static int YY_ILLEGAL_STATE = 1;
-	final private static int YY_NO_MATCH = 2;
-	final private static int YY_PUSHBACK_2BIG = 3;
+  /* error codes */
+  final private static int YY_UNKNOWN_ERROR = 0;
+  final private static int YY_ILLEGAL_STATE = 1;
+  final private static int YY_NO_MATCH = 2;
+  final private static int YY_PUSHBACK_2BIG = 3;
 
-	/* error messages for the codes above */
-	final private static String YY_ERROR_MSG[] = {"Unkown internal scanner error", "Internal error: unknown state", "Error: could not match input", "Error: pushback value was too large"};
+  /* error messages for the codes above */
+  final private static String YY_ERROR_MSG[] = {
+    "Unkown internal scanner error",
+    "Internal error: unknown state",
+    "Error: could not match input",
+    "Error: pushback value was too large"
+  };
 
-	/** the input device */
-	private java.io.Reader yy_reader;
+  /** the input device */
+  private java.io.Reader yy_reader;
 
-	/** the current state of the DFA */
-	private int yy_state;
+  /** the current state of the DFA */
+  private int yy_state;
 
-	/** the current lexical state */
-	private int yy_lexical_state = YYINITIAL;
+  /** the current lexical state */
+  private int yy_lexical_state = YYINITIAL;
 
-	/** this buffer contains the current text to be matched and is
-	 the source of the yytext() string */
-	private char yy_buffer[] = new char[16384];
+  /** this buffer contains the current text to be matched and is
+      the source of the yytext() string */
+  private char yy_buffer[] = new char[16384];
 
-	/** the textposition at the last accepting state */
-	private int yy_markedPos;
+  /** the textposition at the last accepting state */
+  private int yy_markedPos;
 
-	/** the textposition at the last state to be included in yytext */
-	private int yy_pushbackPos;
+  /** the textposition at the last state to be included in yytext */
+  private int yy_pushbackPos;
 
-	/** the current text position in the buffer */
-	private int yy_currentPos;
+  /** the current text position in the buffer */
+  private int yy_currentPos;
 
-	/** startRead marks the beginning of the yytext() string in the buffer */
-	private int yy_startRead;
+  /** startRead marks the beginning of the yytext() string in the buffer */
+  private int yy_startRead;
 
-	/** endRead marks the last character in the buffer, that has been read
-	 from input */
-	private int yy_endRead;
+  /** endRead marks the last character in the buffer, that has been read
+      from input */
+  private int yy_endRead;
 
+  /** number of newlines encountered up to the start of the matched text */
+  //private int yyline;
 
-	/** the number of characters up to the start of the matched text */
-	private int yychar;
+  /** the number of characters up to the start of the matched text */
+  private int yychar;
 
+  /**
+   * the number of characters from the last newline up to the start of the 
+   * matched text
+   */
+  //private int yycolumn; 
 
-	/** 
-	 * yy_atBOL == true <=> the scanner is currently at the beginning of a line
-	 */
-	private boolean yy_atBOL;
+  /** 
+   * yy_atBOL == true <=> the scanner is currently at the beginning of a line
+   */
+  private boolean yy_atBOL;
 
-	/** yy_atEOF == true <=> the scanner has returned a value for EOF */
-	private boolean yy_atEOF;
+  /** yy_atEOF == true <=> the scanner has returned a value for EOF */
+  private boolean yy_atEOF;
 
-	/** denotes if the user-EOF-code has already been executed */
-	private boolean yy_eof_done;
+  /** denotes if the user-EOF-code has already been executed */
+  private boolean yy_eof_done;
 
-	/* user code: */
+  /* user code: */
 
 
 	private boolean hasMore = true;
+	private boolean hasCharsetAttr = false;
 	private final static int MAX_TO_SCAN = 8000;
 	StringBuffer string = new StringBuffer();
 	// state stack for easier state handling
@@ -131,80 +156,95 @@
 		super();
 	}
 
-	public void reset(Reader in) {
-		/* the input device */
-		yy_reader = in;
+	  public void reset (Reader in) {
+	  	/* the input device */
+	  	yy_reader = in;
 
-		/* the current state of the DFA */
-		yy_state = 0;
+  		/* the current state of the DFA */
+  		yy_state = 0;
 
-		/* the current lexical state */
-		yy_lexical_state = YYINITIAL;
+  		/* the current lexical state */
+  		yy_lexical_state = YYINITIAL;
 
-		/* this buffer contains the current text to be matched and is
-		 the source of the yytext() string */
-		java.util.Arrays.fill(yy_buffer, (char) 0);
+  		/* this buffer contains the current text to be matched and is
+  		 the source of the yytext() string */
+  		java.util.Arrays.fill(yy_buffer, (char)0);
 
-		/* the textposition at the last accepting state */
-		yy_markedPos = 0;
+  		/* the textposition at the last accepting state */
+  		yy_markedPos = 0;
 
-		/* the textposition at the last state to be included in yytext */
-		yy_pushbackPos = 0;
+  		/* the textposition at the last state to be included in yytext */
+  		yy_pushbackPos = 0;
 
-		/* the current text position in the buffer */
-		yy_currentPos = 0;
+  		/* the current text position in the buffer */
+  		yy_currentPos = 0;
 
-		/* startRead marks the beginning of the yytext() string in the buffer */
-		yy_startRead = 0;
+  		/* startRead marks the beginning of the yytext() string in the buffer */
+  		yy_startRead = 0;
 
-		/** 
-		 * endRead marks the last character in the buffer, that has been read
-		 * from input 
-		 */
-		yy_endRead = 0;
+  		/** 
+  		 * endRead marks the last character in the buffer, that has been read
+  		 * from input 
+  		 */
+  		yy_endRead = 0;
+
+  		/* number of newlines encountered up to the start of the matched text */
+  		// yyline = 0;
+
+  		/* the number of characters up to the start of the matched text */
+  		yychar = 0;
+
+  		/**
+  		 * the number of characters from the last newline up to the start
+  		 * of the matched text
+  		 */
+  		// yycolumn = 0; 
+
+  		/** 
+  		 * yy_atBOL == true <=> the scanner is currently at the beginning 
+  		 * of a line
+  		 */
+  		yy_atBOL = false;
+
+  		/* yy_atEOF == true <=> the scanner has returned a value for EOF */
+  		yy_atEOF = false;
+
+  		/* denotes if the user-EOF-code has already been executed */
+  		yy_eof_done = false;
 
 
-		/* the number of characters up to the start of the matched text */
-		yychar = 0;
-
-
-		/** 
-		 * yy_atBOL == true <=> the scanner is currently at the beginning 
-		 * of a line
-		 */
-		yy_atBOL = false;
-
-		/* yy_atEOF == true <=> the scanner has returned a value for EOF */
-		yy_atEOF = false;
-
-		/* denotes if the user-EOF-code has already been executed */
-		yy_eof_done = false;
-
-
-		fStateStack.clear();
-
-		hasMore = true;
-
+  		fStateStack.clear();
+  		
+  		hasMore = true;
+  		hasCharsetAttr = false;
+  		
 		// its a little wasteful to "throw away" first char array generated
 		// by class init (via auto generated code), but we really do want
 		// a small buffer for our head parsers.
 		if (yy_buffer.length != MAX_TO_SCAN) {
 			yy_buffer = new char[MAX_TO_SCAN];
 		}
+  		
 
-
-	}
+  	}
 
 
 	public final HeadParserToken getNextToken() throws IOException {
 		String context = null;
-		context = primGetNextToken();
 		HeadParserToken result = null;
+		try {
+			context = primGetNextToken();
+		}
+		catch (IllegalStateException e) {
+			hasMore = false;
+			result = createToken(HTMLHeadTokenizerConstants.UNDEFINED, yychar, yytext());
+			while(yy_advance() != YYEOF) {}
+			return result;
+		}
 		if (valueText != null) {
 			result = createToken(context, yychar, valueText);
 			valueText = null;
-		}
-		else {
+		} else {
 			result = createToken(context, yychar, yytext());
 		}
 		return result;
@@ -213,1478 +253,1889 @@
 	public final boolean hasMoreTokens() {
 		return hasMore && yychar < MAX_TO_SCAN;
 	}
-
 	private void pushCurrentState() {
 		fStateStack.push(yystate());
 
 	}
+	public final boolean hasCharsetAttr() {
+		return hasCharsetAttr;
+	}
 
 	private void popState() {
 		yybegin(fStateStack.pop());
 	}
-
 	private HeadParserToken createToken(String context, int start, String text) {
 		return new HeadParserToken(context, start, text);
 	}
+	
 
 
 
-	/**
-	 * Creates a new scanner
-	 * There is also a java.io.InputStream version of this constructor.
-	 *
-	 * @param   in  the java.io.Reader to read input from.
-	 */
-	public HTMLHeadTokenizer(java.io.Reader in) {
-		this.yy_reader = in;
-	}
+  /**
+   * Creates a new scanner
+   * There is also a java.io.InputStream version of this constructor.
+   *
+   * @param   in  the java.io.Reader to read input from.
+   */
+  public HTMLHeadTokenizer(java.io.Reader in) {
+    this.yy_reader = in;
+  }
 
-	/**
-	 * Creates a new scanner.
-	 * There is also java.io.Reader version of this constructor.
-	 *
-	 * @param   in  the java.io.Inputstream to read input from.
-	 */
-	public HTMLHeadTokenizer(java.io.InputStream in) {
-		this(new java.io.InputStreamReader(in));
-	}
+  /**
+   * Creates a new scanner.
+   * There is also java.io.Reader version of this constructor.
+   *
+   * @param   in  the java.io.Inputstream to read input from.
+   */
+  public HTMLHeadTokenizer(java.io.InputStream in) {
+    this(new java.io.InputStreamReader(in));
+  }
 
-	/** 
-	 * Unpacks the compressed character translation table.
-	 *
-	 * @param packed   the packed character translation table
-	 * @return         the unpacked character translation table
-	 */
-	private static char[] yy_unpack_cmap(String packed) {
-		char[] map = new char[0x10000];
-		int i = 0; /* index in packed string  */
-		int j = 0; /* index in unpacked array */
-		while (i < 174) {
-			int count = packed.charAt(i++);
-			char value = packed.charAt(i++);
-			do
-				map[j++] = value;
-			while (--count > 0);
-		}
-		return map;
-	}
+  /** 
+   * Unpacks the compressed character translation table.
+   *
+   * @param packed   the packed character translation table
+   * @return         the unpacked character translation table
+   */
+  private static char [] yy_unpack_cmap(String packed) {
+    char [] map = new char[0x10000];
+    int i = 0;  /* index in packed string  */
+    int j = 0;  /* index in unpacked array */
+    while (i < 180) {
+      int  count = packed.charAt(i++);
+      char value = packed.charAt(i++);
+      do map[j++] = value; while (--count > 0);
+    }
+    return map;
+  }
 
 
-	/**
-	 * Gets the next input character.
-	 *
-	 * @return      the next character of the input stream, EOF if the
-	 *              end of the stream is reached.
-	 * @exception   IOException  if any I/O-Error occurs
-	 */
-	private int yy_advance() throws java.io.IOException {
+  /**
+   * Gets the next input character.
+   *
+   * @return      the next character of the input stream, EOF if the
+   *              end of the stream is reached.
+   * @exception   IOException  if any I/O-Error occurs
+   */
+  private int yy_advance() throws java.io.IOException {
 
-		/* standard case */
-		if (yy_currentPos < yy_endRead)
-			return yy_buffer[yy_currentPos++];
+    /* standard case */
+    if (yy_currentPos < yy_endRead) return yy_buffer[yy_currentPos++];
 
-		/* if the eof is reached, we don't need to work hard */
-		if (yy_atEOF)
-			return YYEOF;
+    /* if the eof is reached, we don't need to work hard */ 
+    if (yy_atEOF) return YYEOF;
 
-		/* otherwise: need to refill the buffer */
+    /* otherwise: need to refill the buffer */
 
-		/* first: make room (if you can) */
-		if (yy_startRead > 0) {
-			System.arraycopy(yy_buffer, yy_startRead, yy_buffer, 0, yy_endRead - yy_startRead);
+    /* first: make room (if you can) */
+    if (yy_startRead > 0) {
+      System.arraycopy(yy_buffer, yy_startRead, 
+                       yy_buffer, 0, 
+                       yy_endRead-yy_startRead);
 
-			/* translate stored positions */
-			yy_endRead -= yy_startRead;
-			yy_currentPos -= yy_startRead;
-			yy_markedPos -= yy_startRead;
-			yy_pushbackPos -= yy_startRead;
-			yy_startRead = 0;
-		}
+      /* translate stored positions */
+      yy_endRead-= yy_startRead;
+      yy_currentPos-= yy_startRead;
+      yy_markedPos-= yy_startRead;
+      yy_pushbackPos-= yy_startRead;
+      yy_startRead = 0;
+    }
 
-		/* is the buffer big enough? */
-		if (yy_currentPos >= yy_buffer.length) {
-			/* if not: blow it up */
-			char newBuffer[] = new char[yy_currentPos * 2];
-			System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
-			yy_buffer = newBuffer;
-		}
+    /* is the buffer big enough? */
+    if (yy_currentPos >= yy_buffer.length) {
+      /* if not: blow it up */
+      char newBuffer[] = new char[yy_currentPos*2];
+      System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
+      yy_buffer = newBuffer;
+    }
 
-		/* finally: fill the buffer with new input */
-		int numRead = yy_reader.read(yy_buffer, yy_endRead, yy_buffer.length - yy_endRead);
+    /* finally: fill the buffer with new input */
+    int numRead = yy_reader.read(yy_buffer, yy_endRead, 
+                                            yy_buffer.length-yy_endRead);
 
-		if (numRead == -1)
-			return YYEOF;
+    if ( numRead == -1 ) return YYEOF;
 
-		yy_endRead += numRead;
+    yy_endRead+= numRead;
 
-		return yy_buffer[yy_currentPos++];
-	}
+    return yy_buffer[yy_currentPos++];
+  }
 
+    
+  /**
+   * Closes the input stream.
+   */
+  final public void yyclose() throws java.io.IOException {
+    yy_atEOF = true;            /* indicate end of file */
+    yy_endRead = yy_startRead;  /* invalidate buffer    */
+    yy_reader.close();
+  }
 
-	/**
-	 * Closes the input stream.
-	 */
-	final public void yyclose() throws java.io.IOException {
-		yy_atEOF = true; /* indicate end of file */
-		yy_endRead = yy_startRead; /* invalidate buffer    */
-		yy_reader.close();
-	}
 
+  /**
+   * Returns the current lexical state.
+   */
+  final public int yystate() {
+    return yy_lexical_state;
+  }
 
-	/**
-	 * Returns the current lexical state.
-	 */
-	final public int yystate() {
-		return yy_lexical_state;
-	}
+  /**
+   * Enters a new lexical state
+   *
+   * @param newState the new lexical state
+   */
+  final public void yybegin(int newState) {
+    yy_lexical_state = newState;
+  }
 
-	/**
-	 * Enters a new lexical state
-	 *
-	 * @param newState the new lexical state
-	 */
-	final public void yybegin(int newState) {
-		yy_lexical_state = newState;
-	}
 
+  /**
+   * Returns the text matched by the current regular expression.
+   */
+  final public String yytext() {
+    return new String( yy_buffer, yy_startRead, yy_markedPos-yy_startRead );
+  }
 
-	/**
-	 * Returns the text matched by the current regular expression.
-	 */
-	final public String yytext() {
-		return new String(yy_buffer, yy_startRead, yy_markedPos - yy_startRead);
-	}
+  /**
+   * Returns the length of the matched text region.
+   */
+  final public int yylength() {
+    return yy_markedPos-yy_startRead;
+  }
 
-	/**
-	 * Returns the length of the matched text region.
-	 */
-	final public int yylength() {
-		return yy_markedPos - yy_startRead;
-	}
 
+  /**
+   * Reports an error that occured while scanning.
+   *
+   * @param   errorCode  the code of the errormessage to display
+   */
+  private void yy_ScanError(int errorCode) {
+    try {
+      IllegalStateException ise = new IllegalStateException("Instance: " + System.identityHashCode(this) + " offset:" + yychar + " state:" + yystate());
+      System.out.println(YY_ERROR_MSG[errorCode] + "\n" + ise);
+      throw ise;
+    }
+    catch (ArrayIndexOutOfBoundsException e) {
+      System.out.println(YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
+    }
 
-	/**
-	 * Reports an error that occured while scanning.
-	 *
-	 * @param   errorCode  the code of the errormessage to display
-	 */
-	private void yy_ScanError(int errorCode) {
-		try {
-			System.out.println(YY_ERROR_MSG[errorCode]);
-		}
-		catch (ArrayIndexOutOfBoundsException e) {
-			System.out.println(YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
-		}
+  } 
 
-		System.exit(1);
-	}
 
+  /**
+   * Pushes the specified amount of characters back into the input stream.
+   *
+   * They will be read again by then next call of the scanning method
+   *
+   * @param number  the number of characters to be read again.
+   *                This number must not be greater than yylength()!
+   */
+  private void yypushback(int number) {
+    if ( number > yylength() )
+      yy_ScanError(YY_PUSHBACK_2BIG);
 
-	/**
-	 * Pushes the specified amount of characters back into the input stream.
-	 *
-	 * They will be read again by then next call of the scanning method
-	 *
-	 * @param number  the number of characters to be read again.
-	 *                This number must not be greater than yylength()!
-	 */
-	private void yypushback(int number) {
-		if (number > yylength())
-			yy_ScanError(YY_PUSHBACK_2BIG);
+    yy_markedPos -= number;
+  }
 
-		yy_markedPos -= number;
-	}
 
+  /**
+   * Contains user EOF-code, which will be executed exactly once,
+   * when the end of file is reached
+   */
+  private void yy_do_eof() {
+    if (!yy_eof_done) {
+      yy_eof_done = true;
+    	hasMore=false;
 
-	/**
-	 * Contains user EOF-code, which will be executed exactly once,
-	 * when the end of file is reached
-	 */
-	private void yy_do_eof() {
-		if (!yy_eof_done) {
-			yy_eof_done = true;
-			hasMore = false;
+    }
+  }
 
-		}
-	}
 
+  /**
+   * Resumes scanning until the next regular expression is matched,
+   * the end of input is encountered or an I/O-Error occurs.
+   *
+   * @return      the next token
+   * @exception   IOException  if any I/O-Error occurs
+   */
+  public String primGetNextToken() throws java.io.IOException {
+    int yy_input;
+    int yy_action;
 
-	/**
-	 * Resumes scanning until the next regular expression is matched,
-	 * the end of input is encountered or an I/O-Error occurs.
-	 *
-	 * @return      the next token
-	 * @exception   IOException  if any I/O-Error occurs
-	 */
-	public String primGetNextToken() throws java.io.IOException {
-		int yy_input;
-		int yy_action;
+    yy_pushbackPos = -1;
+    boolean yy_was_pushback;
 
+    while (true) {
 
-		while (true) {
+      yychar+= yylength();
 
-			yychar += yylength();
+      yy_atBOL = yy_markedPos <= 0 || yy_buffer[yy_markedPos-1] == '\n';
+      if (!yy_atBOL && yy_buffer[yy_markedPos-1] == '\r') {
+        yy_atBOL = yy_advance() != '\n';
+        if (!yy_atEOF) yy_currentPos--;
+      }
 
-			yy_atBOL = yy_markedPos <= 0 || yy_buffer[yy_markedPos - 1] == '\n';
-			if (!yy_atBOL && yy_buffer[yy_markedPos - 1] == '\r') {
-				yy_atBOL = yy_advance() != '\n';
-				if (!yy_atEOF)
-					yy_currentPos--;
-			}
+      yy_action = -1;
 
-			yy_action = -1;
+      yy_currentPos = yy_startRead = yy_markedPos;
 
-			yy_currentPos = yy_startRead = yy_markedPos;
+      if (yy_atBOL)
+        yy_state = YY_LEXSTATE[yy_lexical_state+1];
+      else
+        yy_state = YY_LEXSTATE[yy_lexical_state];
 
-			if (yy_atBOL)
-				yy_state = YY_LEXSTATE[yy_lexical_state + 1];
-			else
-				yy_state = YY_LEXSTATE[yy_lexical_state];
+      yy_was_pushback = false;
 
+      yy_forAction: {
+        while (true) {
+    
+          yy_input = yy_advance();
 
-			yy_forAction : {
-				while (true) {
+          if ( yy_input == YYEOF ) break yy_forAction;
 
-					yy_input = yy_advance();
+          yy_input = yycmap[yy_input];
 
-					if (yy_input == YYEOF)
-						break yy_forAction;
+          boolean yy_pushback = false;
+          boolean yy_isFinal = false;
+          boolean yy_noLookAhead = false;
 
-					yy_input = yycmap[yy_input];
+          yy_forNext: { switch (yy_state) {
+            case 0:
+              switch (yy_input) {
+                case 1: yy_isFinal = true; yy_state = 10; break yy_forNext;
+                case 2: yy_isFinal = true; yy_state = 11; break yy_forNext;
+                case 3: yy_isFinal = true; yy_state = 12; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 13; break yy_forNext;
+                case 11: yy_isFinal = true; yy_state = 14; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 9; break yy_forNext;
+              }
 
-					boolean yy_isFinal = false;
-					boolean yy_noLookAhead = false;
+            case 1:
+              switch (yy_input) {
+                case 1: yy_isFinal = true; yy_state = 10; break yy_forNext;
+                case 2: yy_isFinal = true; yy_state = 11; break yy_forNext;
+                case 3: yy_isFinal = true; yy_state = 12; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 15; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 16; break yy_forNext;
+                case 11: yy_isFinal = true; yy_state = 17; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 9; break yy_forNext;
+              }
 
-					yy_forNext : {
-						switch (yy_state) {
-							case 0 :
-								switch (yy_input) {
-									case 1 :
-										yy_isFinal = true;
-										yy_state = 9;
-										break yy_forNext;
-									case 2 :
-										yy_isFinal = true;
-										yy_state = 10;
-										break yy_forNext;
-									case 3 :
-										yy_isFinal = true;
-										yy_state = 11;
-										break yy_forNext;
-									case 10 :
-										yy_isFinal = true;
-										yy_state = 12;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 8;
-										break yy_forNext;
-								}
+            case 2:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_state = 18; break yy_forNext;
+                case 12: yy_isFinal = true; yy_state = 19; break yy_forNext;
+                case 16: yy_isFinal = true; yy_state = 20; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 9; break yy_forNext;
+              }
 
-							case 1 :
-								switch (yy_input) {
-									case 1 :
-										yy_isFinal = true;
-										yy_state = 9;
-										break yy_forNext;
-									case 2 :
-										yy_isFinal = true;
-										yy_state = 10;
-										break yy_forNext;
-									case 3 :
-										yy_isFinal = true;
-										yy_state = 11;
-										break yy_forNext;
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 13;
-										break yy_forNext;
-									case 10 :
-										yy_isFinal = true;
-										yy_state = 14;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 8;
-										break yy_forNext;
-								}
+            case 3:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_state = 21; break yy_forNext;
+                case 20: yy_isFinal = true; yy_state = 22; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 23; break yy_forNext;
+                case 26: yy_isFinal = true; yy_state = 24; break yy_forNext;
+                case 36: yy_isFinal = true; yy_state = 25; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 9; break yy_forNext;
+              }
 
-							case 2 :
-								switch (yy_input) {
-									case 11 :
-										yy_isFinal = true;
-										yy_state = 15;
-										break yy_forNext;
-									case 15 :
-										yy_isFinal = true;
-										yy_state = 16;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 8;
-										break yy_forNext;
-								}
+            case 4:
+              switch (yy_input) {
+                case 6: 
+                case 8: yy_isFinal = true; yy_state = 27; break yy_forNext;
+                case 7: yy_isFinal = true; yy_state = 28; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                case 32: yy_isFinal = true; yy_state = 30; break yy_forNext;
+                case 37: yy_isFinal = true; yy_state = 31; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
+              }
 
-							case 3 :
-								switch (yy_input) {
-									case 25 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 17;
-										break yy_forNext;
-									case 26 :
-										yy_isFinal = true;
-										yy_state = 18;
-										break yy_forNext;
-									case 34 :
-										yy_isFinal = true;
-										yy_state = 19;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 8;
-										break yy_forNext;
-								}
+            case 5:
+              switch (yy_input) {
+                case 7: 
+                case 8: 
+                case 11: 
+                case 25: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 34; break yy_forNext;
+                case 12: 
+                case 36: yy_isFinal = true; yy_state = 35; break yy_forNext;
+                case 32: yy_isFinal = true; yy_state = 36; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 32; break yy_forNext;
+              }
 
-							case 4 :
-								switch (yy_input) {
-									case 6 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 21;
-										break yy_forNext;
-									case 7 :
-										yy_isFinal = true;
-										yy_state = 22;
-										break yy_forNext;
-									case 32 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 23;
-										break yy_forNext;
-									case 35 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 24;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 20;
-										break yy_forNext;
-								}
+            case 6:
+              switch (yy_input) {
+                case 7: 
+                case 8: 
+                case 11: 
+                case 25: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 36: yy_isFinal = true; yy_state = 35; break yy_forNext;
+                case 37: yy_isFinal = true; yy_state = 36; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 37; break yy_forNext;
+                case 38: yy_isFinal = true; yy_state = 38; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 32; break yy_forNext;
+              }
 
-							case 5 :
-								switch (yy_input) {
-									case 7 :
-									case 9 :
-									case 10 :
-									case 25 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 26;
-										break yy_forNext;
-									case 11 :
-									case 34 :
-										yy_isFinal = true;
-										yy_state = 27;
-										break yy_forNext;
-									case 32 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 28;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 25;
-										break yy_forNext;
-								}
+            case 7:
+              switch (yy_input) {
+                case 11: 
+                case 25: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 36: yy_isFinal = true; yy_state = 35; break yy_forNext;
+                case 12: yy_isFinal = true; yy_state = 38; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 39; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 40; break yy_forNext;
+                case 32: 
+                case 37: yy_isFinal = true; yy_state = 41; break yy_forNext;
+                case 39: yy_isFinal = true; yy_pushbackPos = yy_currentPos; yy_pushback = true; yy_state = 42; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 32; break yy_forNext;
+              }
 
-							case 6 :
-								switch (yy_input) {
-									case 7 :
-									case 9 :
-									case 10 :
-									case 25 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 26;
-										break yy_forNext;
-									case 34 :
-										yy_isFinal = true;
-										yy_state = 27;
-										break yy_forNext;
-									case 35 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 28;
-										break yy_forNext;
-									case 36 :
-										yy_isFinal = true;
-										yy_state = 29;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 25;
-										break yy_forNext;
-								}
+            case 8:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 9; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_noLookAhead = true; yy_state = 32; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 43; break yy_forNext;
+              }
 
-							case 7 :
-								switch (yy_input) {
-									case 10 :
-									case 25 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 26;
-										break yy_forNext;
-									case 34 :
-										yy_isFinal = true;
-										yy_state = 27;
-										break yy_forNext;
-									case 11 :
-										yy_isFinal = true;
-										yy_state = 29;
-										break yy_forNext;
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 30;
-										break yy_forNext;
-									case 32 :
-									case 35 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 31;
-										break yy_forNext;
-									case 37 :
-										yy_isFinal = true;
-										yy_state = 32;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 25;
-										break yy_forNext;
-								}
+            case 10:
+              switch (yy_input) {
+                case 2: yy_isFinal = true; yy_noLookAhead = true; yy_state = 44; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 9 :
-								switch (yy_input) {
-									case 2 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 33;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 11:
+              switch (yy_input) {
+                case 1: yy_isFinal = true; yy_noLookAhead = true; yy_state = 45; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 12:
+              switch (yy_input) {
+                case 4: yy_state = 46; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 13:
+              switch (yy_input) {
+                case 11: yy_state = 47; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 14:
+              switch (yy_input) {
+                case 9: yy_state = 48; break yy_forNext;
+                case 14: yy_state = 49; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 15:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 50; break yy_forNext;
+                case 9: yy_state = 51; break yy_forNext;
+                case 11: yy_state = 52; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 16:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 50; break yy_forNext;
+                case 11: yy_state = 53; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 17:
+              switch (yy_input) {
+                case 14: yy_state = 49; break yy_forNext;
+                case 9: yy_state = 54; break yy_forNext;
+                case 12: yy_state = 55; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 18:
+              switch (yy_input) {
+                case 12: yy_state = 56; break yy_forNext;
+                case 16: yy_state = 57; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 19:
+              switch (yy_input) {
+                case 9: yy_state = 58; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 59; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 20:
+              switch (yy_input) {
+                case 9: yy_state = 60; break yy_forNext;
+                case 19: yy_state = 61; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 21:
+              switch (yy_input) {
+                case 25: yy_isFinal = true; yy_state = 23; break yy_forNext;
+                case 20: yy_state = 62; break yy_forNext;
+                case 26: yy_state = 63; break yy_forNext;
+                case 36: yy_state = 64; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 22:
+              switch (yy_input) {
+                case 9: yy_state = 65; break yy_forNext;
+                case 26: yy_state = 66; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 23:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 67; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 24:
+              switch (yy_input) {
+                case 9: yy_state = 68; break yy_forNext;
+                case 17: yy_state = 69; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 25:
+              switch (yy_input) {
+                case 9: yy_state = 70; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 71; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 27:
+              switch (yy_input) {
+                case 6: 
+                case 8: yy_isFinal = true; yy_state = 27; break yy_forNext;
+                case 7: yy_state = 72; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 73; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
+              }
+
+            case 28:
+              switch (yy_input) {
+                case 6: 
+                case 8: yy_isFinal = true; yy_state = 27; break yy_forNext;
+                case 7: yy_state = 72; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 73; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
+              }
+
+            case 29:
+              switch (yy_input) {
+                case 32: yy_isFinal = true; yy_state = 30; break yy_forNext;
+                case 37: yy_isFinal = true; yy_state = 31; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_state = 72; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 30:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 74; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 31:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 75; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 33:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 76; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 34:
+              switch (yy_input) {
+                case 7: 
+                case 8: 
+                case 11: 
+                case 25: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 32: yy_isFinal = true; yy_state = 36; break yy_forNext;
+                case 12: 
+                case 36: yy_state = 77; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 35:
+              switch (yy_input) {
+                case 9: yy_state = 78; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 79; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 36:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 80; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 37:
+              switch (yy_input) {
+                case 7: 
+                case 8: 
+                case 11: 
+                case 25: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 37: yy_isFinal = true; yy_state = 36; break yy_forNext;
+                case 36: yy_state = 77; break yy_forNext;
+                case 38: yy_state = 81; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 38:
+              switch (yy_input) {
+                case 25: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 9: yy_state = 82; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 39:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 83; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 40:
+              switch (yy_input) {
+                case 11: 
+                case 25: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 39; break yy_forNext;
+                case 32: 
+                case 37: yy_isFinal = true; yy_state = 41; break yy_forNext;
+                case 36: yy_state = 77; break yy_forNext;
+                case 12: yy_state = 81; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 41:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 84; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 42:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_pushback = true; yy_state = 85; break yy_forNext;
+                case 9: yy_state = 86; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 46:
+              switch (yy_input) {
+                case 5: yy_isFinal = true; yy_noLookAhead = true; yy_state = 87; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 47:
+              switch (yy_input) {
+                case 9: yy_state = 48; break yy_forNext;
+                case 14: yy_state = 49; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 48:
+              switch (yy_input) {
+                case 14: yy_state = 49; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 49:
+              switch (yy_input) {
+                case 9: yy_state = 88; break yy_forNext;
+                case 16: yy_state = 89; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 50:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 50; break yy_forNext;
+                case 9: yy_state = 51; break yy_forNext;
+                case 11: yy_state = 52; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 51:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 50; break yy_forNext;
+                case 11: yy_state = 52; break yy_forNext;
+                case 9: yy_state = 90; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 52:
+              switch (yy_input) {
+                case 12: yy_state = 55; break yy_forNext;
+                case 9: yy_state = 91; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 53:
+              switch (yy_input) {
+                case 14: yy_state = 49; break yy_forNext;
+                case 9: yy_state = 54; break yy_forNext;
+                case 12: yy_state = 55; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 54:
+              switch (yy_input) {
+                case 14: yy_state = 49; break yy_forNext;
+                case 12: yy_state = 55; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 55:
+              switch (yy_input) {
+                case 9: yy_state = 92; break yy_forNext;
+                case 13: yy_state = 93; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 56:
+              switch (yy_input) {
+                case 9: yy_state = 58; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 59; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 57:
+              switch (yy_input) {
+                case 9: yy_state = 60; break yy_forNext;
+                case 19: yy_state = 61; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 58:
+              switch (yy_input) {
+                case 25: yy_isFinal = true; yy_state = 59; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 59:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 94; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 60:
+              switch (yy_input) {
+                case 19: yy_state = 61; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 61:
+              switch (yy_input) {
+                case 9: yy_state = 95; break yy_forNext;
+                case 20: yy_state = 96; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 62:
+              switch (yy_input) {
+                case 9: yy_state = 65; break yy_forNext;
+                case 26: yy_state = 66; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 63:
+              switch (yy_input) {
+                case 9: yy_state = 68; break yy_forNext;
+                case 17: yy_state = 69; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 64:
+              switch (yy_input) {
+                case 9: yy_state = 70; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 71; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 65:
+              switch (yy_input) {
+                case 26: yy_state = 66; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 66:
+              switch (yy_input) {
+                case 9: yy_state = 97; break yy_forNext;
+                case 18: yy_state = 98; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 68:
+              switch (yy_input) {
+                case 17: yy_state = 69; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 69:
+              switch (yy_input) {
+                case 9: yy_state = 99; break yy_forNext;
+                case 17: yy_state = 100; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 70:
+              switch (yy_input) {
+                case 25: yy_isFinal = true; yy_state = 71; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 71:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 101; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 72:
+              switch (yy_input) {
+                case 6: 
+                case 8: yy_isFinal = true; yy_state = 27; break yy_forNext;
+                case 7: yy_state = 72; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 73; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
+              }
+
+            case 73:
+              switch (yy_input) {
+                case 6: 
+                case 8: yy_isFinal = true; yy_state = 27; break yy_forNext;
+                case 7: yy_state = 72; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 102; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 26; break yy_forNext;
+              }
+
+            case 77:
+              switch (yy_input) {
+                case 9: yy_state = 78; break yy_forNext;
+                case 25: yy_isFinal = true; yy_state = 79; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 78:
+              switch (yy_input) {
+                case 25: yy_isFinal = true; yy_state = 79; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 79:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 103; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 81:
+              switch (yy_input) {
+                case 25: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 9: yy_state = 82; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 82:
+              switch (yy_input) {
+                case 25: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 85:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_pushback = true; yy_state = 85; break yy_forNext;
+                case 9: yy_isFinal = true; yy_pushback = true; yy_state = 104; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 86:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_pushback = true; yy_state = 85; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 88:
+              switch (yy_input) {
+                case 16: yy_state = 89; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 89:
+              switch (yy_input) {
+                case 9: yy_state = 105; break yy_forNext;
+                case 17: yy_state = 106; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 90:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 50; break yy_forNext;
+                case 11: yy_state = 52; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 91:
+              switch (yy_input) {
+                case 12: yy_state = 55; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 92:
+              switch (yy_input) {
+                case 13: yy_state = 93; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 93:
+              switch (yy_input) {
+                case 9: yy_state = 107; break yy_forNext;
+                case 14: yy_state = 108; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 95:
+              switch (yy_input) {
+                case 20: yy_state = 96; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 96:
+              switch (yy_input) {
+                case 9: yy_state = 109; break yy_forNext;
+                case 21: yy_state = 110; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 97:
+              switch (yy_input) {
+                case 18: yy_state = 98; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 98:
+              switch (yy_input) {
+                case 9: yy_state = 111; break yy_forNext;
+                case 34: yy_state = 112; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 99:
+              switch (yy_input) {
+                case 17: yy_state = 100; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 100:
+              switch (yy_input) {
+                case 9: yy_state = 113; break yy_forNext;
+                case 27: yy_state = 114; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 102:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 72; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 104:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_pushback = true; yy_state = 85; break yy_forNext;
+                case 9: yy_state = 86; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 105:
+              switch (yy_input) {
+                case 17: yy_state = 106; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 106:
+              switch (yy_input) {
+                case 9: yy_state = 115; break yy_forNext;
+                case 18: yy_isFinal = true; yy_state = 116; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 107:
+              switch (yy_input) {
+                case 14: yy_state = 108; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 108:
+              switch (yy_input) {
+                case 9: yy_state = 117; break yy_forNext;
+                case 15: yy_state = 118; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 109:
+              switch (yy_input) {
+                case 21: yy_state = 110; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 110:
+              switch (yy_input) {
+                case 9: yy_state = 119; break yy_forNext;
+                case 22: yy_state = 120; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 111:
+              switch (yy_input) {
+                case 34: yy_state = 112; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 112:
+              switch (yy_input) {
+                case 9: yy_state = 121; break yy_forNext;
+                case 35: yy_state = 122; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 113:
+              switch (yy_input) {
+                case 27: yy_state = 114; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 114:
+              switch (yy_input) {
+                case 9: yy_state = 123; break yy_forNext;
+                case 28: yy_state = 124; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 115:
+              switch (yy_input) {
+                case 18: yy_isFinal = true; yy_state = 116; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 116:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 125; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 117:
+              switch (yy_input) {
+                case 15: yy_state = 118; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 118:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 126; break yy_forNext;
+                case 9: yy_state = 127; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 119:
+              switch (yy_input) {
+                case 22: yy_state = 120; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 120:
+              switch (yy_input) {
+                case 9: yy_state = 128; break yy_forNext;
+                case 23: yy_state = 129; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 121:
+              switch (yy_input) {
+                case 35: yy_state = 122; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 122:
+              switch (yy_input) {
+                case 9: yy_state = 130; break yy_forNext;
+                case 16: yy_state = 131; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 123:
+              switch (yy_input) {
+                case 28: yy_state = 124; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 124:
+              switch (yy_input) {
+                case 9: yy_state = 132; break yy_forNext;
+                case 16: yy_state = 133; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 126:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 126; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 134; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 127:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 126; break yy_forNext;
+                case 9: yy_state = 135; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 128:
+              switch (yy_input) {
+                case 23: yy_state = 129; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 129:
+              switch (yy_input) {
+                case 9: yy_state = 136; break yy_forNext;
+                case 19: yy_state = 137; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 130:
+              switch (yy_input) {
+                case 16: yy_state = 131; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 131:
+              switch (yy_input) {
+                case 9: yy_state = 138; break yy_forNext;
+                case 17: yy_state = 139; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 132:
+              switch (yy_input) {
+                case 16: yy_state = 133; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 133:
+              switch (yy_input) {
+                case 9: yy_state = 140; break yy_forNext;
+                case 29: yy_state = 141; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 134:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 126; break yy_forNext;
+                case 9: yy_state = 135; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 135:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 126; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 136:
+              switch (yy_input) {
+                case 19: yy_state = 137; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 137:
+              switch (yy_input) {
+                case 9: yy_state = 142; break yy_forNext;
+                case 24: yy_state = 143; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 138:
+              switch (yy_input) {
+                case 17: yy_state = 139; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 139:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 139; break yy_forNext;
+                case 9: yy_state = 144; break yy_forNext;
+                case 10: yy_isFinal = true; yy_state = 145; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 140:
+              switch (yy_input) {
+                case 29: yy_state = 141; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 141:
+              switch (yy_input) {
+                case 9: yy_state = 146; break yy_forNext;
+                case 30: yy_state = 147; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 142:
+              switch (yy_input) {
+                case 24: yy_state = 143; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 143:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 143; break yy_forNext;
+                case 9: yy_state = 148; break yy_forNext;
+                case 10: yy_isFinal = true; yy_state = 149; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 144:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 139; break yy_forNext;
+                case 10: yy_isFinal = true; yy_state = 145; break yy_forNext;
+                case 9: yy_state = 150; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 10 :
-								switch (yy_input) {
-									case 1 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 34;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 145:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 151; break yy_forNext;
+                case 9: yy_state = 152; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 11 :
-								switch (yy_input) {
-									case 4 :
-										yy_state = 35;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 146:
+              switch (yy_input) {
+                case 30: yy_state = 147; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 12 :
-								switch (yy_input) {
-									case 13 :
-										yy_state = 36;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 147:
+              switch (yy_input) {
+                case 9: yy_state = 153; break yy_forNext;
+                case 23: yy_state = 154; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 13 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_state = 37;
-										break yy_forNext;
-									case 10 :
-										yy_state = 38;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 148:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 143; break yy_forNext;
+                case 10: yy_isFinal = true; yy_state = 149; break yy_forNext;
+                case 9: yy_state = 155; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 14 :
-								switch (yy_input) {
-									case 13 :
-										yy_state = 36;
-										break yy_forNext;
-									case 11 :
-										yy_state = 39;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 149:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 156; break yy_forNext;
+                case 9: yy_state = 157; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 15 :
-								switch (yy_input) {
-									case 25 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 40;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 150:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 139; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 16 :
-								switch (yy_input) {
-									case 19 :
-										yy_state = 41;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 151:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_state = 145; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 151; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 18 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 42;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 152:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 151; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 19 :
-								switch (yy_input) {
-									case 25 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 43;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 153:
+              switch (yy_input) {
+                case 23: yy_state = 154; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 21 :
-								switch (yy_input) {
-									case 6 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 21;
-										break yy_forNext;
-									case 7 :
-										yy_state = 44;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 20;
-										break yy_forNext;
-								}
+            case 154:
+              switch (yy_input) {
+                case 9: yy_state = 158; break yy_forNext;
+                case 31: yy_state = 159; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 22 :
-								switch (yy_input) {
-									case 6 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 21;
-										break yy_forNext;
-									case 7 :
-										yy_state = 44;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 20;
-										break yy_forNext;
-								}
+            case 155:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 143; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 27 :
-								switch (yy_input) {
-									case 25 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 45;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 156:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_state = 149; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 156; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 29 :
-								switch (yy_input) {
-									case 25 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 46;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 157:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 156; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 32 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 32;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 158:
+              switch (yy_input) {
+                case 31: yy_state = 159; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 35 :
-								switch (yy_input) {
-									case 5 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 47;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 159:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 159; break yy_forNext;
+                case 9: yy_state = 160; break yy_forNext;
+                case 10: yy_state = 161; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 36 :
-								switch (yy_input) {
-									case 15 :
-										yy_state = 48;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 160:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 159; break yy_forNext;
+                case 10: yy_state = 161; break yy_forNext;
+                case 9: yy_state = 162; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 37 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_state = 37;
-										break yy_forNext;
-									case 10 :
-										yy_state = 38;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 161:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 163; break yy_forNext;
+                case 9: yy_state = 164; break yy_forNext;
+                case 20: yy_state = 165; break yy_forNext;
+                case 32: yy_state = 166; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 38 :
-								switch (yy_input) {
-									case 11 :
-										yy_state = 39;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 162:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 159; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 39 :
-								switch (yy_input) {
-									case 12 :
-										yy_state = 49;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 163:
+              switch (yy_input) {
+                case 9: yy_state = 161; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_state = 163; break yy_forNext;
+                case 20: yy_state = 165; break yy_forNext;
+                case 32: yy_state = 166; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 41 :
-								switch (yy_input) {
-									case 20 :
-										yy_state = 50;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 164:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 163; break yy_forNext;
+                case 20: yy_state = 165; break yy_forNext;
+                case 32: yy_state = 166; break yy_forNext;
+                case 9: yy_state = 167; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 42 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 51;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 165:
+              switch (yy_input) {
+                case 9: yy_state = 168; break yy_forNext;
+                case 21: yy_state = 169; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 44 :
-								switch (yy_input) {
-									case 6 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 21;
-										break yy_forNext;
-									case 7 :
-										yy_state = 44;
-										break yy_forNext;
-									default :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 20;
-										break yy_forNext;
-								}
+            case 166:
+              switch (yy_input) {
+                case 20: yy_state = 165; break yy_forNext;
+                case 9: yy_state = 167; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 48 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 52;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 167:
+              switch (yy_input) {
+                case 20: yy_state = 165; break yy_forNext;
+                case 9: yy_state = 170; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 49 :
-								switch (yy_input) {
-									case 13 :
-										yy_state = 53;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 168:
+              switch (yy_input) {
+                case 21: yy_state = 169; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 50 :
-								switch (yy_input) {
-									case 21 :
-										yy_state = 54;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 169:
+              switch (yy_input) {
+                case 9: yy_state = 171; break yy_forNext;
+                case 19: yy_state = 172; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 51 :
-								switch (yy_input) {
-									case 27 :
-										yy_state = 55;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 170:
+              switch (yy_input) {
+                case 20: yy_state = 165; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 52 :
-								switch (yy_input) {
-									case 17 :
-										yy_state = 56;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 171:
+              switch (yy_input) {
+                case 19: yy_state = 172; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 53 :
-								switch (yy_input) {
-									case 14 :
-										yy_state = 57;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 172:
+              switch (yy_input) {
+                case 9: yy_state = 173; break yy_forNext;
+                case 17: yy_state = 174; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 54 :
-								switch (yy_input) {
-									case 22 :
-										yy_state = 58;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 173:
+              switch (yy_input) {
+                case 17: yy_state = 174; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 55 :
-								switch (yy_input) {
-									case 28 :
-										yy_state = 59;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 174:
+              switch (yy_input) {
+                case 9: yy_state = 175; break yy_forNext;
+                case 16: yy_state = 176; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 56 :
-								switch (yy_input) {
-									case 18 :
-										yy_isFinal = true;
-										yy_noLookAhead = true;
-										yy_state = 60;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 175:
+              switch (yy_input) {
+                case 16: yy_state = 176; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 57 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 61;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 176:
+              switch (yy_input) {
+                case 9: yy_state = 177; break yy_forNext;
+                case 19: yy_state = 178; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 58 :
-								switch (yy_input) {
-									case 23 :
-										yy_state = 62;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 177:
+              switch (yy_input) {
+                case 19: yy_state = 178; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 59 :
-								switch (yy_input) {
-									case 15 :
-										yy_state = 63;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 178:
+              switch (yy_input) {
+                case 9: yy_state = 179; break yy_forNext;
+                case 17: yy_state = 180; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 61 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 61;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 179:
+              switch (yy_input) {
+                case 17: yy_state = 180; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 62 :
-								switch (yy_input) {
-									case 19 :
-										yy_state = 64;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 180:
+              switch (yy_input) {
+                case 9: yy_state = 181; break yy_forNext;
+                case 28: yy_state = 182; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 63 :
-								switch (yy_input) {
-									case 29 :
-										yy_state = 65;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 181:
+              switch (yy_input) {
+                case 28: yy_state = 182; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 64 :
-								switch (yy_input) {
-									case 24 :
-										yy_state = 66;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 182:
+              switch (yy_input) {
+                case 9: yy_state = 183; break yy_forNext;
+                case 17: yy_state = 184; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 65 :
-								switch (yy_input) {
-									case 30 :
-										yy_state = 67;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 183:
+              switch (yy_input) {
+                case 17: yy_state = 184; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 66 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_state = 66;
-										break yy_forNext;
-									case 8 :
-										yy_isFinal = true;
-										yy_state = 68;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 184:
+              switch (yy_input) {
+                case 9: yy_state = 185; break yy_forNext;
+                case 33: yy_state = 186; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 67 :
-								switch (yy_input) {
-									case 23 :
-										yy_state = 69;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 185:
+              switch (yy_input) {
+                case 33: yy_state = 186; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 68 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 68;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 186:
+              switch (yy_input) {
+                case 9: yy_state = 187; break yy_forNext;
+                case 27: yy_state = 188; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 69 :
-								switch (yy_input) {
-									case 31 :
-										yy_state = 70;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 187:
+              switch (yy_input) {
+                case 27: yy_state = 188; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 70 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_state = 70;
-										break yy_forNext;
-									case 8 :
-										yy_state = 71;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 188:
+              switch (yy_input) {
+                case 9: yy_state = 189; break yy_forNext;
+                case 16: yy_state = 190; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 71 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_state = 71;
-										break yy_forNext;
-									case 20 :
-										yy_state = 72;
-										break yy_forNext;
-									case 32 :
-										yy_state = 73;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 189:
+              switch (yy_input) {
+                case 16: yy_state = 190; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 72 :
-								switch (yy_input) {
-									case 21 :
-										yy_state = 74;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 190:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 191; break yy_forNext;
+                case 9: yy_state = 192; break yy_forNext;
+                case 32: yy_state = 193; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 73 :
-								switch (yy_input) {
-									case 20 :
-										yy_state = 72;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 191:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 191; break yy_forNext;
+                case 9: yy_state = 194; break yy_forNext;
+                case 20: yy_state = 195; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 74 :
-								switch (yy_input) {
-									case 19 :
-										yy_state = 75;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 192:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 191; break yy_forNext;
+                case 32: yy_state = 193; break yy_forNext;
+                case 9: yy_state = 196; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 75 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 76;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 193:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 191; break yy_forNext;
+                case 9: yy_state = 196; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 76 :
-								switch (yy_input) {
-									case 15 :
-										yy_state = 77;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 194:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 191; break yy_forNext;
+                case 20: yy_state = 195; break yy_forNext;
+                case 9: yy_state = 197; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 77 :
-								switch (yy_input) {
-									case 19 :
-										yy_state = 78;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 195:
+              switch (yy_input) {
+                case 9: yy_state = 198; break yy_forNext;
+                case 21: yy_state = 199; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 78 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 79;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 196:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 191; break yy_forNext;
+                case 9: yy_state = 200; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 79 :
-								switch (yy_input) {
-									case 28 :
-										yy_state = 80;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 197:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 191; break yy_forNext;
+                case 20: yy_state = 195; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 80 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 81;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 198:
+              switch (yy_input) {
+                case 21: yy_state = 199; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 81 :
-								switch (yy_input) {
-									case 33 :
-										yy_state = 82;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 199:
+              switch (yy_input) {
+                case 9: yy_state = 201; break yy_forNext;
+                case 19: yy_state = 202; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 82 :
-								switch (yy_input) {
-									case 27 :
-										yy_state = 83;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 200:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 191; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 83 :
-								switch (yy_input) {
-									case 15 :
-										yy_state = 84;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 201:
+              switch (yy_input) {
+                case 19: yy_state = 202; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 84 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_state = 85;
-										break yy_forNext;
-									case 32 :
-										yy_state = 86;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 202:
+              switch (yy_input) {
+                case 9: yy_state = 203; break yy_forNext;
+                case 17: yy_state = 204; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 85 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_state = 85;
-										break yy_forNext;
-									case 20 :
-										yy_state = 87;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 203:
+              switch (yy_input) {
+                case 17: yy_state = 204; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 86 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_state = 85;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 204:
+              switch (yy_input) {
+                case 9: yy_state = 205; break yy_forNext;
+                case 16: yy_state = 206; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 87 :
-								switch (yy_input) {
-									case 21 :
-										yy_state = 88;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 205:
+              switch (yy_input) {
+                case 16: yy_state = 206; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 88 :
-								switch (yy_input) {
-									case 19 :
-										yy_state = 89;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 206:
+              switch (yy_input) {
+                case 9: yy_state = 207; break yy_forNext;
+                case 19: yy_state = 208; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 89 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 90;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 207:
+              switch (yy_input) {
+                case 19: yy_state = 208; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 90 :
-								switch (yy_input) {
-									case 15 :
-										yy_state = 91;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 208:
+              switch (yy_input) {
+                case 9: yy_state = 209; break yy_forNext;
+                case 17: yy_state = 210; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 91 :
-								switch (yy_input) {
-									case 19 :
-										yy_state = 92;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 209:
+              switch (yy_input) {
+                case 17: yy_state = 210; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 92 :
-								switch (yy_input) {
-									case 16 :
-										yy_state = 93;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 210:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 210; break yy_forNext;
+                case 9: yy_state = 211; break yy_forNext;
+                case 10: yy_isFinal = true; yy_state = 212; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 93 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_state = 93;
-										break yy_forNext;
-									case 8 :
-										yy_isFinal = true;
-										yy_state = 94;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 211:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 210; break yy_forNext;
+                case 10: yy_isFinal = true; yy_state = 212; break yy_forNext;
+                case 9: yy_state = 213; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							case 94 :
-								switch (yy_input) {
-									case 6 :
-									case 7 :
-									case 9 :
-									case 18 :
-										yy_isFinal = true;
-										yy_state = 94;
-										break yy_forNext;
-									default :
-										break yy_forAction;
-								}
+            case 212:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 214; break yy_forNext;
+                case 9: yy_state = 215; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-							default :
-								yy_ScanError(YY_ILLEGAL_STATE);
-								break;
-						}
-					}
+            case 213:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 210; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-					if (yy_isFinal) {
-						yy_action = yy_state;
-						yy_markedPos = yy_currentPos;
-						if (yy_noLookAhead)
-							break yy_forAction;
-					}
+            case 214:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_state = 212; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 214; break yy_forNext;
+                default: break yy_forAction;
+              }
 
-				}
-			}
+            case 215:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 214; break yy_forNext;
+                default: break yy_forAction;
+              }
 
+            default:
+              yy_ScanError(YY_ILLEGAL_STATE);
+              break;
+          } }
 
-			switch (yy_action) {
+          if ( yy_isFinal ) {
+            yy_was_pushback = yy_pushback;
+            yy_action = yy_state; 
+            yy_markedPos = yy_currentPos; 
+            if ( yy_noLookAhead ) break yy_forAction;
+          }
 
-				case 26 :
-					{
-						yypushback(1);
-						popState();
-						valueText = string.toString();
-						return EncodingParserConstants.InvalidTerminatedStringValue;
-					}
-				case 96 :
-					break;
-				case 20 :
-				case 21 :
-					{
-						yypushback(1);
-						yybegin(UnDelimitedString);
-						string.setLength(0);
-					}
-				case 97 :
-					break;
-				case 17 :
-					{
-						yybegin(YYINITIAL);
-						if (foundContentTypeValue)
-							hasMore = false;
-						return HTMLHeadTokenizerConstants.MetaTagEnd;
-					}
-				case 98 :
-					break;
-				case 31 :
-					{
-						yypushback(1);
-						popState();
-						valueText = string.toString();
-						return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;
-					}
-				case 99 :
-					break;
-				case 43 :
-					{
-						yybegin(YYINITIAL);
-						if (foundContentTypeValue)
-							hasMore = false;
-						return HTMLHeadTokenizerConstants.MetaTagEnd;
-					}
-				case 100 :
-					break;
-				case 45 :
-					{
-						yypushback(2);
-						popState();
-						valueText = string.toString();
-						return EncodingParserConstants.InvalidTerminatedStringValue;
-					}
-				case 101 :
-					break;
-				case 46 :
-					{
-						yypushback(2);
-						popState();
-						valueText = string.toString();
-						return EncodingParserConstants.InvalidTerminatedStringValue;
-					}
-				case 102 :
-					break;
-				case 61 :
-					{
-						if (yychar == 0) {
-							yybegin(ST_XMLDecl);
-							return XMLHeadTokenizerConstants.XMLDeclStart;
-						}
-					}
-				case 103 :
-					break;
-				case 8 :
-				case 9 :
-				case 10 :
-				case 11 :
-				case 12 :
-				case 13 :
-				case 14 :
-				case 15 :
-				case 16 :
-				case 18 :
-				case 19 :
-				case 22 :
-					{
-						if (yychar > MAX_TO_SCAN) {
-							hasMore = false;
-							return EncodingParserConstants.MAX_CHARS_REACHED;
-						}
-					}
-				case 104 :
-					break;
-				case 60 :
-					{
-						yybegin(ST_META_TAG);
-						return HTMLHeadTokenizerConstants.MetaTagStart;
-					}
-				case 105 :
-					break;
-				case 40 :
-					{
-						yybegin(YYINITIAL);
-						return XMLHeadTokenizerConstants.XMLDeclEnd;
-					}
-				case 106 :
-					break;
-				case 94 :
-					{
-						pushCurrentState();
-						yybegin(QuotedAttributeValue);
-						foundContentTypeValue = true;
-						return HTMLHeadTokenizerConstants.MetaTagContentType;
-					}
-				case 107 :
-					break;
-				case 68 :
-					{
-						pushCurrentState();
-						yybegin(QuotedAttributeValue);
-						return XMLHeadTokenizerConstants.XMLDelEncoding;
-					}
-				case 108 :
-					break;
-				case 33 :
-					{
-						hasMore = false;
-						return EncodingParserConstants.UTF16BE;
-					}
-				case 109 :
-					break;
-				case 34 :
-					{
-						hasMore = false;
-						return EncodingParserConstants.UTF16LE;
-					}
-				case 110 :
-					break;
-				case 47 :
-					{
-						hasMore = false;
-						return EncodingParserConstants.UTF83ByteBOM;
-					}
-				case 111 :
-					break;
-				case 28 :
-					{
-						popState();
-						valueText = string.toString();
-						return EncodingParserConstants.StringValue;
-					}
-				case 112 :
-					break;
-				case 25 :
-				case 27 :
-				case 29 :
-				case 32 :
-					{
-						string.append(yytext());
-					}
-				case 113 :
-					break;
-				case 24 :
-					{
-						yybegin(SQ_STRING);
-						string.setLength(0);
-					}
-				case 114 :
-					break;
-				case 23 :
-					{
-						yybegin(DQ_STRING);
-						string.setLength(0);
-					}
-				case 115 :
-					break;
-				case 30 :
-					{
-						yypushback(1);
-						popState();
-						valueText = string.toString();
-						return EncodingParserConstants.UnDelimitedStringValue;
-					}
-				case 116 :
-					break;
-				default :
-					if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
-						yy_atEOF = true;
-						yy_do_eof();
-						{
-							hasMore = false;
-							return EncodingParserConstants.EOF;
-						}
-					}
-					else {
-						yy_ScanError(YY_NO_MATCH);
-					}
-			}
-		}
-	}
+        }
+      }
 
-	/**
-	 * Runs the scanner on input files.
-	 *
-	 * This main method is the debugging routine for the scanner.
-	 * It prints each returned token to System.out until the end of
-	 * file is reached, or an error occured.
-	 *
-	 * @param argv   the command line, contains the filenames to run
-	 *               the scanner on.
-	 */
-	public static void main(String argv[]) {
-		for (int i = 0; i < argv.length; i++) {
-			HTMLHeadTokenizer scanner = null;
-			try {
-				scanner = new HTMLHeadTokenizer(new java.io.FileReader(argv[i]));
-			}
-			catch (java.io.FileNotFoundException e) {
-				System.out.println("File not found : \"" + argv[i] + "\"");
-				System.exit(1);
-			}
-			catch (ArrayIndexOutOfBoundsException e) {
-				System.out.println("Usage : java HTMLHeadTokenizer <inputfile>");
-				System.exit(1);
-			}
+      if (yy_was_pushback)
+        yy_markedPos = yy_pushbackPos;
 
-			try {
-				do {
-					System.out.println(scanner.primGetNextToken());
-				}
-				while (!scanner.yy_atEOF);
+      switch (yy_action) {    
 
-			}
-			catch (java.io.IOException e) {
-				System.out.println("An I/O error occured while scanning :");
-				System.out.println(e);
-				System.exit(1);
-			}
-			catch (Exception e) {
-				e.printStackTrace();
-				System.exit(1);
-			}
-		}
-	}
+        case 33: 
+        case 76: 
+          {  yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
+        case 217: break;
+        case 26: 
+        case 27: 
+        case 29: 
+        case 73: 
+        case 102: 
+          {  yypushback(1); yybegin(UnDelimitedString); string.setLength(0); }
+        case 218: break;
+        case 23: 
+        case 67: 
+          {  yybegin(YYINITIAL);  if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd; }
+        case 219: break;
+        case 41: 
+        case 84: 
+          {  yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue; }
+        case 220: break;
+        case 71: 
+        case 101: 
+          {  yybegin(YYINITIAL); if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd; }
+        case 221: break;
+        case 79: 
+        case 103: 
+          {  yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
+        case 222: break;
+        case 126: 
+        case 134: 
+          { if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;} }
+        case 223: break;
+        case 9: 
+        case 10: 
+        case 11: 
+        case 12: 
+        case 13: 
+        case 14: 
+        case 15: 
+        case 16: 
+        case 17: 
+        case 18: 
+        case 19: 
+        case 20: 
+        case 21: 
+        case 22: 
+        case 24: 
+        case 25: 
+        case 28: 
+        case 34: 
+        case 37: 
+        case 40: 
+          { if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;} }
+        case 224: break;
+        case 116: 
+        case 125: 
+          { yybegin(ST_META_TAG); return HTMLHeadTokenizerConstants.MetaTagStart; }
+        case 225: break;
+        case 59: 
+        case 94: 
+          { yybegin(YYINITIAL);  return XMLHeadTokenizerConstants.XMLDeclEnd; }
+        case 226: break;
+        case 212: 
+        case 214: 
+          { pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; return HTMLHeadTokenizerConstants.MetaTagContentType; }
+        case 227: break;
+        case 149: 
+        case 156: 
+          { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding; }
+        case 228: break;
+        case 145: 
+        case 151: 
+          { pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; hasCharsetAttr=true; return HTMLHeadTokenizerConstants.MetaTagContentType; }
+        case 229: break;
+        case 87: 
+          { hasMore = false; return EncodingParserConstants.UTF83ByteBOM; }
+        case 230: break;
+        case 44: 
+          { hasMore = false; return EncodingParserConstants.UTF16BE; }
+        case 231: break;
+        case 45: 
+          { hasMore = false; return EncodingParserConstants.UTF16LE; }
+        case 232: break;
+        case 36: 
+        case 80: 
+          {  popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;  }
+        case 233: break;
+        case 32: 
+        case 35: 
+        case 38: 
+          {  string.append( yytext() );  }
+        case 234: break;
+        case 31: 
+        case 75: 
+          {  yybegin(SQ_STRING); string.setLength(0);  }
+        case 235: break;
+        case 30: 
+        case 74: 
+          {  yybegin(DQ_STRING); string.setLength(0);  }
+        case 236: break;
+        case 39: 
+        case 83: 
+          {  yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;  }
+        case 237: break;
+        case 42: 
+        case 85: 
+        case 104: 
+          {  pushCurrentState(); yybegin(UnDelimitedCharset); string.append( yytext() );  }
+        case 238: break;
+        case 43: 
+          { yypushback(1); popState();  }
+        case 239: break;
+        default: 
+          if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
+            yy_atEOF = true;
+            yy_do_eof();
+              { hasMore = false; return EncodingParserConstants.EOF; }
+          } 
+          else {
+            yy_ScanError(YY_NO_MATCH);
+          }
+      }
+    }
+  }    
 
 
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizerConstants.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizerConstants.java
index 938bcde..2600b07 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizerConstants.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizerConstants.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,5 +16,5 @@
 	String MetaTagEnd = "MetaTagEnd"; //$NON-NLS-1$
 	String MetaTagStart = "MetaTagStart"; //$NON-NLS-1$
 	String MetaTagContentType = "MetaTagContentType"; //$NON-NLS-1$
-
+	String UNDEFINED = "UNDEFINED"; //$NON-NLS-1$
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLResourceEncodingDetector.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLResourceEncodingDetector.java
index 4401d90..9754fa8 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLResourceEncodingDetector.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLResourceEncodingDetector.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@
 import java.io.IOException;
 import java.util.regex.Pattern;
 
+import org.eclipse.core.runtime.content.IContentDescription;
 import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
 import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
 import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
@@ -38,15 +39,13 @@
 			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
 			fEncodingMemento.setUTF83ByteBOMUsed(true);
 		}
-		else if (tokenType == EncodingParserConstants.UTF16BE) {
-			canHandleAsUnicodeStream = true;
-			String enc = "UTF-16BE"; //$NON-NLS-1$
-			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
-		}
-		else if (tokenType == EncodingParserConstants.UTF16LE) {
+		else if (tokenType == EncodingParserConstants.UTF16BE || tokenType == EncodingParserConstants.UTF16LE) {
 			canHandleAsUnicodeStream = true;
 			String enc = "UTF-16"; //$NON-NLS-1$
+			byte[] bom = (tokenType == EncodingParserConstants.UTF16BE) ? IContentDescription.BOM_UTF_16BE : IContentDescription.BOM_UTF_16LE;
 			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
+			fEncodingMemento.setUnicodeStream(true);
+			fEncodingMemento.setUnicodeBOM(bom);
 		}
 		return canHandleAsUnicodeStream;
 	}
@@ -147,7 +146,15 @@
 		}
 		while (tokenizer.hasMoreTokens());
 		if (contentTypeValue != null) {
-			parseContentTypeValue(contentTypeValue);
+			if (tokenizer.hasCharsetAttr()) {
+				contentTypeValue = contentTypeValue.trim();
+				if (contentTypeValue.length() > 0) {
+					createEncodingMemento(contentTypeValue, EncodingMemento.FOUND_ENCODING_IN_CONTENT);
+				}
+			}
+			else {
+				parseContentTypeValue(contentTypeValue);
+			}
 		}
 	}
 
@@ -176,7 +183,7 @@
 			}
 		}
 		if (parts.length > 1) {
-			charset = parts[1];
+			charset = parts[1].trim();
 		}
 		
 		if (charset != null && charset.length() > 0) {
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/IntStack.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/IntStack.java
index 88b8ba8..f48f2f0 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/IntStack.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/IntStack.java
@@ -94,6 +94,21 @@
 	}
 
 	public int size() {
-		return list.length;
+		return size;
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	public String toString() {
+		StringBuffer s = new StringBuffer(getClass().getName() + ":" +size + " [");
+		for (int i = 0; i < size; i++) {
+			s.append(list[i]);
+			if(i < size - 1) {
+				s.append(", ");
+			}
+		}
+		s.append("]");
+		return s.toString();
 	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DocumentStyleImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DocumentStyleImpl.java
index eda938f..8efb14b 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DocumentStyleImpl.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DocumentStyleImpl.java
@@ -9,10 +9,7 @@
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
 /*
- * Created on Sep 2, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
+ * http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-DocumentStyle
  */
 package org.eclipse.wst.html.core.internal.document;
 
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java
index 1f806e5..c00fd7e 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -72,9 +72,11 @@
 
 		// find DOCTYPE delcaration and Public ID
 		String publicId = null;
+		String systemId = null;
 		DocumentType newDocumentType = findDocumentType(document);
 		if (newDocumentType != null) {
 			publicId = newDocumentType.getPublicId();
+			systemId = newDocumentType.getSystemId();
 		}
 		else {
 			// lookup default set by contentsettings
@@ -86,6 +88,11 @@
 		if (publicId != null) {
 			newEntry = HTMLDocumentTypeRegistry.getInstance().getEntry(publicId);
 		}
+		else if (systemId == null){
+			if (newDocumentType != null){ // <!DOCTYPE html>
+				newEntry = HTMLDocumentTypeRegistry.getInstance().getDefaultEntry(HTMLDocumentTypeRegistry.DEFAULT_HTML5);
+			}
+		}
 
 		boolean newXMLType = (newEntry != null ? newEntry.isXMLType() : false);
 		boolean newWMLType = (newEntry != null ? newEntry.isWMLType() : false);
@@ -137,7 +144,7 @@
 				if (impl != null) {
 					String name = newEntry.getName();
 					publicId = newEntry.getPublicId();
-					String systemId = newEntry.getSystemId();
+					systemId = newEntry.getSystemId();
 					newDocumentType = impl.createDocumentType(name, publicId, systemId);
 				}
 			}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistry.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistry.java
index 3cd71ff..8f3ca14 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistry.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistry.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,14 +10,28 @@
  *******************************************************************************/
 package org.eclipse.wst.html.core.internal.document;
 
-
-
+import java.text.Collator;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.Enumeration;
 import java.util.Hashtable;
+import java.util.List;
+import java.util.Vector;
 
-/**
- */
 public class HTMLDocumentTypeRegistry {
+	static class HTMLDocumentTypeEntryComparator implements Comparator {
+		static Collator delegate = Collator.getInstance();
+
+		public int compare(Object o1, Object o2) {
+			if (o1 instanceof HTMLDocumentTypeEntry && o2 instanceof HTMLDocumentTypeEntry) {
+				if (((HTMLDocumentTypeEntry) o1).getDisplayName() != null && ((HTMLDocumentTypeEntry) o2).getDisplayName() != null) {
+					return delegate.compare(((HTMLDocumentTypeEntry) o1).getDisplayName(), ((HTMLDocumentTypeEntry) o2).getDisplayName());
+				}
+			}
+			return 0;
+		}
+	}
 
 	private static HTMLDocumentTypeRegistry instance = null;
 	private Hashtable entries = null;
@@ -25,11 +39,15 @@
 	private HTMLDocumentTypeEntry defaultXHTMLEntry = null;
 	private HTMLDocumentTypeEntry defaultWMLEntry = null;
 	private HTMLDocumentTypeEntry defaultCHTMLEntry = null;
+	private HTMLDocumentTypeEntry defaultHTML5Entry = null;
+	private HTMLDocumentTypeEntry defaultXHTML5Entry = null;
 
 	final static int DEFAULT_HTML = 0;
 	final static int DEFAULT_XHTML = 1;
 	final static int DEFAULT_WML = 2;
 	final static int DEFAULT_CHTML = 3;
+	final static int DEFAULT_HTML5 = 4;
+	final static int DEFAULT_XHTML5 = 5;
 
 	public static final String CHTML_PUBLIC_ID = "-//W3C//DTD Compact HTML 1.0 Draft//EN";//$NON-NLS-1$
 
@@ -61,6 +79,18 @@
 		this.defaultCHTMLEntry = new HTMLDocumentTypeEntry(name, publicId, null, null, false, false, displayName, false, false, false, true);
 		this.entries.put(publicId, this.defaultCHTMLEntry);
 
+		//HTML5
+		name = "HTML5";//$NON-NLS-1$
+		publicId = "";
+		displayName = "HTML5"; //$NON-NLS-1$
+		this.defaultHTML5Entry = new HTMLDocumentTypeEntry(name, publicId, null, null, false, false, displayName, false, false, false, true);
+		this.entries.put(publicId, this.defaultHTML5Entry);
+		
+		displayName = "XHTML5"; //$NON-NLS-1$
+		this.defaultXHTML5Entry = new HTMLDocumentTypeEntry(name, publicId, null, null, true, false, displayName, true, false, false, true);
+		this.entries.put("xmlns", this.defaultXHTML5Entry);
+		
+
 		HTMLDocumentTypeRegistryReader reader = new HTMLDocumentTypeRegistryReader();
 		if (reader != null)
 			reader.readRegistry(this);
@@ -88,6 +118,12 @@
 	public HTMLDocumentTypeEntry getDefaultEntry(int type) {
 		HTMLDocumentTypeEntry entry = null;
 		switch (type) {
+			case DEFAULT_HTML5 :
+				entry = this.defaultHTML5Entry;
+				break;
+			case DEFAULT_XHTML5 :
+				entry = this.defaultXHTML5Entry;
+				break;
 			case DEFAULT_XHTML :
 				entry = this.defaultXHTMLEntry;
 				break;
@@ -121,7 +157,9 @@
 	/**
 	 */
 	public Enumeration getEntries() {
-		return this.entries.elements();
+		List values = new ArrayList(this.entries.values());
+		Collections.sort(values, new HTMLDocumentTypeEntryComparator());
+		return new Vector(values).elements();
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapter.java
index 6e30557..4e7ddcb 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapter.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@
 
 
 import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
+import org.eclipse.wst.html.core.internal.contentmodel.HTMLPropertyDeclaration;
 import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
 import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
@@ -62,6 +63,14 @@
 		return false;
 	}
 
+	public boolean isEndTagOmissible(Element element) {
+		CMElementDeclaration dec = CMNodeUtil.getElementDeclaration(element);
+		if (dec == null || !(dec instanceof HTMLPropertyDeclaration))
+			return false;
+		int type = ((HTMLPropertyDeclaration)dec ).getOmitType();
+		return type == HTMLElementDeclaration.OMIT_BOTH || type == HTMLElementDeclaration.OMIT_END || type == HTMLElementDeclaration.OMIT_END_DEFAULT || type == HTMLElementDeclaration.OMIT_END_MUST;
+	}
+
 	/**
 	 */
 	public boolean canContain(Element element, Node child) {
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLElementFormatter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLElementFormatter.java
index abb85b7..ce14df4 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -22,6 +22,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
@@ -315,6 +316,9 @@
 	private void formatStyleAttr(Attr attr) {
 		if (attr == null)
 			return;
+		// if someone's made it a container somehow, CSS can't format it
+		if (((IDOMNode) attr).getValueRegion() instanceof ITextRegionContainer)
+			return;
 		String value = getCSSValue(attr);
 		if (value == null)
 			return;
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapter.java
index cf58aa4..cee65d1 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapter.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,13 +12,13 @@
 
 
 
-import com.ibm.icu.util.StringTokenizer;
-
 import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSelectorAdapter;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSSimpleSelector;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.w3c.dom.Element;
 
+import com.ibm.icu.util.StringTokenizer;
+
 /**
  * Insert the type's description here.
  */
@@ -67,8 +67,7 @@
 		if (i > 0) {
 			if (i > 1)
 				return false;
-			key = element.getAttribute("id");//$NON-NLS-1$
-			if (key == null)
+			if (!element.hasAttribute("id") || (key = element.getAttribute("id")).length() == 0)//$NON-NLS-1$ //$NON-NLS-2$
 				return false;
 			if (!selector.getID(0).equals(key))
 				return false;
@@ -77,8 +76,7 @@
 		// check class
 		i = selector.getNumOfClasses();
 		if (i > 0) {
-			key = element.getAttribute("class");//$NON-NLS-1$
-			if (key == null)
+			if (!element.hasAttribute("class") || (key = element.getAttribute("class")).length() == 0) //$NON-NLS-1$  //$NON-NLS-2$
 				return false;
 			StringTokenizer tokenizer = new StringTokenizer(key);
 			for (i = i - 1; i >= 0; i--) {
@@ -99,8 +97,9 @@
 			StringTokenizer tokenizer = new StringTokenizer(selector.getAttribute(i), "=~| \t\r\n\f");//$NON-NLS-1$
 			int countTokens = tokenizer.countTokens();
 			if (countTokens > 0) {
-				String attrValue = element.getAttribute(tokenizer.nextToken());
-				if (attrValue == null)
+				String attrName = tokenizer.nextToken();
+				String attrValue = null;
+				if (!element.hasAttribute(attrName) || (attrValue = element.getAttribute(attrName)).length() == 0)
 					return false;
 				if (countTokens > 1) {
 					String token = tokenizer.nextToken("= \t\r\n\f");//$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/LinkElementAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/LinkElementAdapter.java
index 0c73ac2..6113d4b 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/LinkElementAdapter.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/LinkElementAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@
 import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter;
 import org.eclipse.wst.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
 import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.util.URIResolver;
@@ -73,8 +74,8 @@
 		URIResolver resolver = baseModel.getResolver();
 
 		// resolve to absolute url : this need not exact location of css file. It is important that absurl is not null. 
-		String ref = getElement().getAttribute(org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ATTR_NAME_HREF);
-		String absurl = (resolver != null && ref != null) ? resolver.getLocationByURI(ref, true) : null;
+		String ref = getElement().getAttribute(HTML40Namespace.ATTR_NAME_HREF);
+		String absurl = (resolver != null && ref != null && ref.length() > 0) ? resolver.getLocationByURI(ref, true) : null;
 		if ((absurl == null) || (absurl.length() == 0)) {
 			IPath basePath = new Path(baseModel.getBaseLocation());
 			URLHelper helper = new URLHelper(basePath.removeLastSegments(1).toString());
@@ -200,14 +201,11 @@
 		Element element = getElement();
 		if (element == null)
 			return false;
-		String rel = element.getAttribute("rel");//$NON-NLS-1$
-		if (rel == null || !rel.equalsIgnoreCase("stylesheet"))//$NON-NLS-1$
+		if (!element.hasAttribute("rel") || !"stylesheet".equalsIgnoreCase(element.getAttribute("rel")))//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 			return false;
-		String type = element.getAttribute("type");//$NON-NLS-1$
-		if (type != null && !type.equalsIgnoreCase("text/css"))//$NON-NLS-1$
+		if (element.hasAttribute("type") && !"text/css".equalsIgnoreCase(element.getAttribute("type")))//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 			return false;
-		String href = element.getAttribute("href");//$NON-NLS-1$
-		if (href == null || href.length() == 0)
+		if (!element.hasAttribute("href") || element.getAttribute("href").length() == 0) //$NON-NLS-1$ //$NON-NLS-2$
 			return false;
 		return true;
 	}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleElementAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleElementAdapter.java
index 3ef97b9..f26c904 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleElementAdapter.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleElementAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004-2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -166,7 +166,9 @@
 				modelProvideAdapter.modelProvided(model);
 
 			// from createModel()
-			IStructuredDocument structuredDocument = model.getStructuredDocument();
+			IStructuredDocument structuredDocument = null;
+			if (model != null)
+				structuredDocument = model.getStructuredDocument();
 			if (structuredDocument == null)
 				return null;
 			structuredDocument.addDocumentChangedListener(this);
@@ -198,7 +200,7 @@
 			return false;
 		}
 		String type = element.getAttribute(HTML40Namespace.ATTR_NAME_TYPE);
-		if (type != null && type.length() > 0 && !type.equalsIgnoreCase("text/css")) { //$NON-NLS-1$
+		if (element.hasAttribute(HTML40Namespace.ATTR_NAME_TYPE) && type.length() > 0 && !type.equalsIgnoreCase("text/css")) { //$NON-NLS-1$
 			return false;
 		}
 		return true;
@@ -217,10 +219,11 @@
 			return null;
 		}
 
-		if (!addListener)
-			return super.createModel(false);
+		ICSSModel model = super.createModel(addListener);
 
-		ICSSModel model = super.createModel();
+		if (!addListener)
+			return model;
+
 		IStructuredDocument structuredDocument = model.getStructuredDocument();
 		if (structuredDocument == null)
 			return null;
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/EmbeddedHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/EmbeddedHTML.java
index 50cdd0f..cf9ffb7 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/EmbeddedHTML.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/EmbeddedHTML.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,7 +23,7 @@
 import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
 import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
 import org.eclipse.wst.sse.core.internal.ltk.parser.BlockTagParser;
-import org.eclipse.wst.sse.core.internal.ltk.parser.JSPCapableParser;
+import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
 import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
 import org.eclipse.wst.sse.core.internal.util.Assert;
@@ -71,9 +71,11 @@
 	/*
 	 * @see EmbeddedContentType#initializeParser(RegionParser)
 	 */
-	public void initializeParser(JSPCapableParser parser) {
-		addHTMLishTag(parser, "script"); //$NON-NLS-1$
-		addHTMLishTag(parser, "style"); //$NON-NLS-1$
+	public void initializeParser(RegionParser parser) {
+		if (parser instanceof BlockTagParser) {
+			addHTMLishTag((BlockTagParser) parser, "script"); //$NON-NLS-1$
+			addHTMLishTag((BlockTagParser) parser, "style"); //$NON-NLS-1$
+		}
 	}
 
 	public List getSupportedMimeTypes() {
@@ -142,11 +144,13 @@
 
 	}
 
-	public void uninitializeParser(JSPCapableParser parser) {
+	public void uninitializeParser(RegionParser parser) {
 		// I'm assuming block markers are unique based on name only
 		// we add these as full BlockMarkers, but remove based on name alone.
-		parser.removeBlockMarker("script"); //$NON-NLS-1$
-		parser.removeBlockMarker("script"); //$NON-NLS-1$
+		if (parser instanceof BlockTagParser) {
+			((BlockTagParser) parser).removeBlockMarker("style"); //$NON-NLS-1$
+			((BlockTagParser) parser).removeBlockMarker("script"); //$NON-NLS-1$
+		}
 	}
 
 	public EmbeddedTypeHandler newInstance() {
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryCMProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryCMProvider.java
index 40e6d3d..80c1ce5 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryCMProvider.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryCMProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -38,6 +38,7 @@
 public class HTMLModelQueryCMProvider implements ModelQueryCMProvider {
 
 
+	private static CMDocument staticHTML5 = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML5_DOC_TYPE);
 	private static CMDocument staticHTML = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
 	private static CMDocument staticCHTML = HTMLCMDocumentFactory.getCMDocument(CMDocType.CHTML_DOC_TYPE);
 	private static HTMLDocumentTypeRegistry doctypeRegistry = HTMLDocumentTypeRegistry.getInstance();
@@ -60,8 +61,10 @@
 			return null;
 
 		String pid = getPublicId(owner);
-		if (pid == null)
-			return staticHTML;
+		// no PID, always return the currently-supported HTML version
+		if (pid == null || "".equals(pid)){
+			return staticHTML5;
+		}
 
 		HTMLDocumentTypeEntry entry = doctypeRegistry.getEntry(pid);
 		if (entry == null)
@@ -112,6 +115,10 @@
 		if (doc == null)
 			return null;
 		DocumentType doctype = doc.getDoctype();
+		//doctype.
 		return (doctype != null) ? doctype.getPublicId() : doc.getDocumentTypeId();
 	}
+	
+	
+	
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryImpl.java
index bee1432..b3b02bd 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryImpl.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryImpl.java
@@ -85,12 +85,15 @@
 		// Now, the time to check exclusion.
 		Vector content = new Vector(candidates.size());
 		for (int i = 0; i < candidates.size(); i++) {
-			CMElementDeclaration candidate = (CMElementDeclaration) candidates.elementAt(i);
-			if (candidate == null)
-				continue;
-			if (isExcluded(candidate, element))
-				continue;
-			content.add(candidate);
+			Object eCandidate = candidates.elementAt(i);
+			if(eCandidate instanceof CMElementDeclaration) {
+				CMElementDeclaration candidate = (CMElementDeclaration) eCandidate;
+				if (candidate == null)
+					continue;
+				if (isExcluded(candidate, element))
+					continue;
+				content.add(candidate);
+			}
 		}
 
 		return content;
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/XHTMLAssociationProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/XHTMLAssociationProvider.java
index 82de2cb..4c44297 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/XHTMLAssociationProvider.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/XHTMLAssociationProvider.java
@@ -11,6 +11,16 @@
 package org.eclipse.wst.html.core.internal.modelquery;
 
 
+import java.lang.ref.Reference;
+import java.lang.ref.SoftReference;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
 import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
@@ -26,6 +36,15 @@
  * This class closely resemble XMLModelQueryAssociationProvider.
  */
 class XHTMLAssociationProvider extends XMLAssociationProvider {
+	
+	/**
+	 * set CACHE_FIXED_DOCUMENTS to false to test effects of not caching certain catalog-contributed schemas.
+	 */
+	private static final boolean CACHE_FIXED_DOCUMENTS = true;
+	private static final String[] STANDARD_SCHEMA_BUNDLES = new String[] {"org.eclipse.wst.standard.schemas","org.eclipse.jst.standard.schemas"};
+	private static final String XML_CATALOG_EXT_POINT = "org.eclipse.wst.xml.core.catalogContributions"; 
+	private static Collection fFixedPublicIDs = null;
+	private static Map fFixedCMDocuments = new HashMap();
 
 	/**
 	 * set USE_QUICK_CACHE to false to test effects of not caching at all.
@@ -59,6 +78,7 @@
 	public CMDocument getXHTMLCMDocument(String publicId, String systemId) {
 		if (idResolver == null)
 			return null;
+		
 		String grammerURI = null;
 		if (USE_QUICK_CACHE) {
 			/*
@@ -84,7 +104,18 @@
 
 		if (grammerURI == null)
 			return null;
-
+		
+		CMDocument cmDocument = null;
+		if (CACHE_FIXED_DOCUMENTS) {
+			Reference ref = (Reference) fFixedCMDocuments.get(publicId);
+			if (ref != null) {
+				cmDocument = (CMDocument) ref.get();
+				if (cmDocument != null) {
+					return cmDocument;
+				}
+			}
+		}
+		
 		/*
 		 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=88896
 		 * 
@@ -105,7 +136,14 @@
 		 * grammerURI); CMDocument cmDocument =
 		 * documentManager.getCMDocument(publicId, grammerURI, "dtd");
 		 */
-		CMDocument cmDocument = documentManager.getCMDocument(publicId, grammerURI, null);
+		synchronized (grammerURI) {
+			cmDocument = documentManager.getCMDocument(publicId, grammerURI, null);
+		}
+		
+		if (CACHE_FIXED_DOCUMENTS && getFixedPublicIDs().contains(publicId)) {
+			fFixedCMDocuments.put(publicId, new SoftReference(cmDocument));
+		}
+		
 		return cmDocument;
 	}
 
@@ -134,4 +172,38 @@
 	public String getCachedGrammerURI() {
 		return fCachedGrammerURI;
 	}
+
+	/**
+	 * @return the fFixedPublicIDs, a collection of contributed Public
+	 *         Identifiers from the known schema plug-ins.
+	 */
+	private static Collection getFixedPublicIDs() {
+		/**
+		 * public:publicId
+		 * TODO: system:systemId and uri:name in their own methods and maps?
+		 */
+		synchronized (STANDARD_SCHEMA_BUNDLES) {
+			if (fFixedPublicIDs == null) {
+				fFixedPublicIDs = new HashSet();
+				for (int i = 0; i < STANDARD_SCHEMA_BUNDLES.length; i++) {
+					IExtension[] extensions = Platform.getExtensionRegistry().getExtensions(STANDARD_SCHEMA_BUNDLES[i]);
+					for (int j = 0; j < extensions.length; j++) {
+						if (XML_CATALOG_EXT_POINT.equals(extensions[j].getExtensionPointUniqueIdentifier())) {
+							IConfigurationElement[] configurationElements = extensions[j].getConfigurationElements();
+							for (int k = 0; k < configurationElements.length; k++) {
+								IConfigurationElement[] publics = configurationElements[k].getChildren("public");
+								for (int l = 0; l < publics.length; l++) {
+									String publicId = publics[l].getAttribute("publicId");
+									if (publicId != null && publicId.length() > 0) {
+										fFixedPublicIDs.add(publicId);
+									}
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+		return fFixedPublicIDs;
+	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java
index 44e2146..e7b5e5b 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -79,13 +79,16 @@
 		node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_DUPLICATE, ValidationMessage.WARNING);
 		node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_MISMATCH, ValidationMessage.ERROR);
 		node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_UNCLOSED, ValidationMessage.WARNING);
+		node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_RESOURCE_NOT_FOUND, ValidationMessage.IGNORE);
+		node.putInt(HTMLCorePreferenceNames.ATTRIBUTE_OBSOLETE_NAME, ValidationMessage.WARNING);
+		
 		
 		// Elements
 		node.putInt(HTMLCorePreferenceNames.ELEM_UNKNOWN_NAME, ValidationMessage.WARNING);
 		node.putInt(HTMLCorePreferenceNames.ELEM_INVALID_NAME, ValidationMessage.ERROR);
 		node.putInt(HTMLCorePreferenceNames.ELEM_START_INVALID_CASE, ValidationMessage.WARNING);
 		node.putInt(HTMLCorePreferenceNames.ELEM_END_INVALID_CASE, ValidationMessage.ERROR);
-		node.putInt(HTMLCorePreferenceNames.ELEM_MISSING_START, ValidationMessage.ERROR);
+		node.putInt(HTMLCorePreferenceNames.ELEM_MISSING_START, ValidationMessage.WARNING);
 		node.putInt(HTMLCorePreferenceNames.ELEM_MISSING_END, ValidationMessage.WARNING);
 		node.putInt(HTMLCorePreferenceNames.ELEM_UNNECESSARY_END, ValidationMessage.WARNING);
 		node.putInt(HTMLCorePreferenceNames.ELEM_INVALID_DIRECTIVE, ValidationMessage.ERROR);
@@ -95,6 +98,8 @@
 		node.putInt(HTMLCorePreferenceNames.ELEM_UNCLOSED_START_TAG, ValidationMessage.ERROR);
 		node.putInt(HTMLCorePreferenceNames.ELEM_UNCLOSED_END_TAG, ValidationMessage.ERROR);
 		node.putInt(HTMLCorePreferenceNames.ELEM_INVALID_EMPTY_TAG, ValidationMessage.WARNING);
+		node.putInt(HTMLCorePreferenceNames.ELEM_OBSOLETE_NAME, ValidationMessage.WARNING);
+		
 		
 		// DOCTYPE
 		node.putInt(HTMLCorePreferenceNames.DOC_DUPLICATE, ValidationMessage.ERROR);
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java
index f4d3644..5c501e3 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -240,6 +240,9 @@
 	public static final String ATTRIBUTE_DUPLICATE = "attrDuplicate";//$NON-NLS-1$
 	public static final String ATTRIBUTE_VALUE_MISMATCH = "attrValueMismatch";//$NON-NLS-1$
 	public static final String ATTRIBUTE_VALUE_UNCLOSED = "attrValueUnclosed";//$NON-NLS-1$
+	public static final String ATTRIBUTE_VALUE_RESOURCE_NOT_FOUND = "resourceNotFound";//$NON-NLS-1$
+	public static final String ATTRIBUTE_OBSOLETE_NAME = "attrObsoleteName";//$NON-NLS-1$
+	
 	
 	public static final String ELEM_UNKNOWN_NAME = "elemUnknownName";//$NON-NLS-1$
 	public static final String ELEM_INVALID_NAME = "elemInvalidName";//$NON-NLS-1$
@@ -255,6 +258,7 @@
 	public static final String ELEM_UNCLOSED_START_TAG = "elemUnclosedStartTag";//$NON-NLS-1$
 	public static final String ELEM_UNCLOSED_END_TAG = "elemUnclosedEndTag";//$NON-NLS-1$
 	public static final String ELEM_INVALID_EMPTY_TAG = "elemInvalidEmptyTag";//$NON-NLS-1$
+	public static final String ELEM_OBSOLETE_NAME = "elemObsoleteName";//$NON-NLS-1$
 	
 	public static final String DOC_DUPLICATE = "docDuplicateTag";//$NON-NLS-1$
 	public static final String DOC_INVALID_CONTENT = "docInvalidContent";//$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML50Namespace.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML50Namespace.java
new file mode 100644
index 0000000..fc8d5be
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML50Namespace.java
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.provisional;
+
+public interface HTML50Namespace extends HTML40Namespace {
+
+	public static interface ElementName extends HTML40Namespace.ElementName {
+		String ARTICLE = "article"; //$NON-NLS-1$
+		String ASIDE = "aside"; //$NON-NLS-1$
+		String AUDIO = "audio";
+		String CANVAS = "canvas";
+		String COMMAND = "command";
+		String DATALIST = "datalist";
+		String DETAILS = "details";
+		String FIGURE = "figure"; //$NON-NLS-1$
+		String FIGCAPTION = "figcaption"; //$NON-NLS-1$
+		String FOOTER = "footer"; //$NON-NLS-1$
+		String HEADER = "header";
+		String HGROUP = "hgroup";
+		String KEYGEN = "keygen";
+		String MARK = "mark";
+		String MATH = "math";
+		String METER = "meter";
+		String NAV = "nav";
+		String OUTPUT = "output";
+		String PROGRESS = "progress";
+		String RP = "rp";
+		String RT = "rt";
+		String RUBY = "ruby";
+		String SECTION = "section"; //$NON-NLS-1$
+		String SOURCE = "source";
+		String SUMMARY = "summary";
+		String SVG = "svg";
+		String TIME = "time";
+		String VIDEO = "video";
+	}
+
+	String HTML50_URI = "http://www.w3.org/TR/html50/";
+	String HTML50_TAG_PREFIX = "";
+
+	// global attribute names
+	String ATTR_NAME_CONTENT_EDITABLE = "contenteditable"; // %coreattrs; //$NON-NLS-1$
+	String ATTR_NAME_CONTEXT_MENU = "contextmenu"; // %coreattrs; //$NON-NLS-1$
+	String ATTR_NAME_DRAGGABLE = "draggable"; // %coreattrs; //$NON-NLS-1$
+	String ATTR_NAME_ROLE = "role"; // %coreattrs; //$NON_NLS-1$
+	String ATTR_NAME_SPELLCHECK = "spellcheck"; // %coreattrs; //$NON-NLS-1$
+	String ATTR_NAME_ONABORT = "onabort"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONCAN_PLAY = "oncanply"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONCAN_PLAY_THROUGH = "oncanplaythrough"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONCONTEXT_MENU = "oncontextmenu"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONDRAG = "ondrag"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONDRAG_END = "ondragend"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONDRAG_OVER = "ondragover"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONDRAG_ENTER = "ondragenter"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONDRAG_LEAVE = "ondragleave"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONDRAG_START = "ondragstart"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONDROP = "ondrop"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONDURATION_CHANGE = "ondurationchange"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONEMPTIED = "onemptied"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONENDED = "onended"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONERROR = "onerror"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONFORM_CHANGE = "onformchange"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONFORM_INPUT = "onform_input"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONINPUT = "oninput"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONINVALID = "oninvalid"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONLOADED_DATA = "onloadeddata"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONLOADED_METADATA = "onloadedmetadeta"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONLOAD_START = "onloadstart"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONMOUSE_WHEEL = "onmousewheel"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONPAUSE = "onpause"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONPLAY = "onplay"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONPLAYING = "onplaying"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONPROGRESS = "onprogress"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONRATE_CHANGE = "onratechange"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONREADY_STATE_CHANGE = "onreadystatechange"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONSCROLL = "onscroll"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONSEEKED = "onseeked"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONSEEKING = "onseeking"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONSHOW = "onshow"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONSTALLED = "onstalled"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONSUSPEND = "onsuspend"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONTIME_UPDATE = "ontimeupdate"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONVOLUME_UPDATE = "onvolumeupdate"; // %event; //$NON-NLS-1$
+	String ATTR_NAME_ONWAITING = "onwaiting"; // %event; //$NON-NLS-1$
+
+	String ATTR_NAME_PING = "ping";
+	String ATTR_NAME_AUTOFOCUS = "autofocus";
+	String ATTR_NAME_CHALLENGE = "challenge";
+	String ATTR_NAME_FORM = "form";
+	String ATTR_NAME_KEYTYPE = "keytype";
+	String ATTR_NAME_REQUIRED = "required";
+	String ATTR_NAME_AUTOCOMPLETE = "autocomplete"; // input
+	String ATTR_NAME_MIN = "min"; // input
+	String ATTR_NAME_MAX = "max"; // input
+	String ATTR_NAME_PATTERN = "pattern"; // input
+	String ATTR_NAME_STEP = "step"; // input
+	String ATTR_NAME_NOVALIDATE = "novalidate"; // form
+	String ATTR_NAME_FORMACTION = "formaction"; // input|button
+	String ATTR_NAME_FORMENCTYPE = "formenctype"; // input|button
+	String ATTR_NAME_FORMMETHOD = "formmethod"; // input|button
+	String ATTR_NAME_FORMNOVALIDATE = "formnovalidate"; // input|button
+	String ATTR_NAME_FORMTARGET = "formtarget"; // input|button
+	String ATTR_NAME_SCOPED = "scoped"; // style
+	String ATTR_NAME_ASYNC = "async"; // script
+	String ATTR_NAME_MANIFEST = "manifest"; // html
+	String ATTR_NAME_SIZES = "sizes"; // link
+	String ATTR_NAME_REVERSED = "reversed"; // ol
+	String ATTR_NAME_SANDBOX = "sandbox"; // iframe
+	String ATTR_NAME_SEAMLESS = "seamless"; // iframe
+	String ATTR_NAME_SRCDOC = "srcdoc"; // iframe
+	String ATTR_NAME_PRELOAD = "preload"; // %mediaElement; //$NON-NLS-1$
+	String ATTR_NAME_AUTOPLAY = "autoplay"; // %mediaElement; //$NON-NLS-1$
+	String ATTR_NAME_LOOP = "loop"; // %mediaElement; //$NON-NLS-1$
+	String ATTR_NAME_CONTROLS = "controls"; // %mediaElement; //$NON-NLS-1$
+	String ATTR_NAME_POSTER = "poster"; // %video; //$NON-NLS-1$
+	String ATTR_NAME_OPEN = "open"; // details //$NON-NLS-1$
+	String ATTR_NAME_PUBDATE = "pubdate"; //time //$NON-NLS-1$
+	String ATTR_NAME_LOW = "low"; //meter //$NON-NLS-1$
+	String ATTR_NAME_HIGH = "high"; //meter //$NON-NLS-1$
+	String ATTR_NAME_OPTIMUM = "optimum"; //meter //$NON-NLS-1$
+	String ATTR_NAME_ICON = "icon"; //command //$NON-NLS-1$
+	String ATTR_NAME_RADIOGROUP = "radiogroup"; //command //$NON-NLS-1$
+	String ATTR_NAME_LIST = "list"; //input //$NON-NLS-1$
+	String ATTR_NAME_PLACEHOLDER = "placeholder"; //input //$NON-NLS-1$
+	String ATTR_NAME_WRAP = "wrap"; //textarea //$NON-NLS-1$
+	String ATTR_NAME_XMLNS = "xmlns"; //html //$NON-NLS-1$
+	
+	// Global attributes properties
+
+	// for contenteditable (EMPTY|TRUE|FALSE|INHERIT)
+	String ATTR_VALUE_EMPTY = ""; // contenteditable //$NON-NLS-1$
+	String ATTR_VALUE_INHERIT = "inherit"; // contenteditable //$NON-NLS-1$
+	
+	// for MediaElement (Audio/Video) 
+	String ATTR_VALUE_METADATA = "metadata"; // mediaelement //$NON-NLS-1$
+	
+	// for Command
+	String ATTR_VALUE_COMMAND = "command"; //command //$NON-NLS-1$
+	
+	//Input type
+	String ATTR_VALUE_SEARCH = "search"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_TEL = "tel"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_URL = "url"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_EMAIL = "email"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_DATE = "date"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_DATETIME = "datetime"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_MONTH = "month"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_WEEK = "week"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_TIME = "time"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_DATETIME_LOCAL = "datetime-local"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_RANGE = "range"; //input type //$NON-NLS-1$
+	String ATTR_VALUE_COLOR = "color"; //input type //$NON-NLS-1$
+	
+	String ATTR_VALUE_ON = "on"; //input autocomplete //$NON-NLS-1$
+	String ATTR_VALUE_OFF = "off"; //input autocomplete //$NON-NLS-1$
+	
+	String ATTR_VALUE_PUT = "PUT"; //input formmethod //$NON-NLS-1$
+	String ATTR_VALUE_DELETE = "DELETE"; //input formmethod //$NON-NLS-1$
+	
+	String ATTR_VALUE_FORM_DATA = "multipart/form-data"; //input formencType //$NON-NLS-1$
+	String ATTR_VALUE_PLAIN = "text/plain"; //input formencType //$NON-NLS-1$
+	
+	String ATTR_VALUE_SOFT = "soft"; //textarea wrap //$NON-NLS-1$
+	String ATTR_VALUE_HARD = "hard"; //textarea wrap //$NON-NLS-1$
+	
+	
+	String ATTR_VALUE_CONTEXT = "context"; //menu type //$NON-NLS-1$
+	String ATTR_VALUE_TOOLBAR = "toolbar"; //menu type //$NON-NLS-1$
+	String ATTR_VALUE_LIST = "list"; //menu type //$NON-NLS-1$
+		
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLCMProperties.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLCMProperties.java
index 1d7a753..8098721 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLCMProperties.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLCMProperties.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -78,6 +78,11 @@
 	 * "isScriptable" returns java.lang.Boolean object.
 	 */
 	public static final String IS_SCRIPTABLE = "isScriptable"; //$NON-NLS-1$
+	/**
+	 * "isObsolete" returns java.lang.Boolean object.
+	 */
+	public static final String IS_OBSOLETE = "isObsolete";//$NON-NLS-1$
+	
 
 	public static interface Values {
 		/*
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java
index fdde5c7..e1b3e38 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -51,7 +51,15 @@
 		HTML40Namespace.ATTR_NAME_ONKEYPRESS,
 		HTML40Namespace.ATTR_NAME_ONKEYDOWN,
 		HTML40Namespace.ATTR_NAME_ONKEYUP,
-		HTML40Namespace.ATTR_NAME_ONHELP};
+		HTML40Namespace.ATTR_NAME_ONHELP,
+		HTML40Namespace.ATTR_NAME_ONBLUR,
+		HTML40Namespace.ATTR_NAME_ONFOCUS,
+		HTML40Namespace.ATTR_NAME_ONLOAD,
+		HTML40Namespace.ATTR_NAME_ONUNLOAD,
+		HTML40Namespace.ATTR_NAME_ONSUBMIT};
+	
+	/** array of style attribute names */
+	private static final String[] STYLE_ATTRIBUTE_NAMES =  {HTML40Namespace.ATTR_NAME_STYLE};
 	
 	public StructuredTextPartitionerForHTML() {
 		super();
@@ -105,6 +113,15 @@
 							language = StringUtils.strip(node.getText(region));
 						else if (attrName.equalsIgnoreCase(HTML40Namespace.ATTR_NAME_TYPE)) {
 							type = StringUtils.strip(node.getText(region));
+							/*
+							 * Avoid partition names built with MIME subtypes,
+							 * e.g. type="text/javascript;e4x=1"
+							 */
+							if (type != null) {
+								int index = type.indexOf(';');
+								if (index > 1)
+									type = type.substring(0, index);
+							}
 							break;
 						}
 						attrNameRegion = null;
@@ -143,12 +160,14 @@
 
 	public String getPartitionType(ITextRegion region, int offset) {
 		String result = null;
-		if (region.getType() == DOMRegionContext.XML_COMMENT_TEXT || region.getType() == DOMRegionContext.XML_COMMENT_OPEN)
+		if (region.getType() == DOMRegionContext.XML_COMMENT_TEXT || region.getType() == DOMRegionContext.XML_COMMENT_OPEN || region.getType() == DOMRegionContext.XML_COMMENT_CLOSE)
 			result = IHTMLPartitions.HTML_COMMENT;
 		else if (region.getType() == DOMRegionContext.XML_DOCTYPE_DECLARATION || region.getType() == DOMRegionContext.XML_DECLARATION_OPEN)
 			result = IHTMLPartitions.HTML_DECLARATION;
 		else if (region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE && isScriptAttributeValue(region, offset))
 			result = IHTMLPartitions.SCRIPT_EVENTHANDLER;
+		else if (isStyleAttributeValue(region, offset))
+			result = ICSSPartitions.STYLE;
 		else
 			result = super.getPartitionType(region, offset);
 		return result;
@@ -198,7 +217,7 @@
 		}
 		else if (tagname.equalsIgnoreCase(HTML40Namespace.ElementName.SCRIPT))
 			result = IHTMLPartitions.SCRIPT;
-		else if (tagname.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE))
+		else if (tagname.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE) || isStyleAttributeValue(region,offset))
 			result = ICSSPartitions.STYLE;
 		else if (region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE && isScriptAttributeValue(region, offset))
 			result = IHTMLPartitions.SCRIPT_EVENTHANDLER;
@@ -227,14 +246,41 @@
 		if (region.getType() != DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
 			return false;
 
-		return isAttributeNameForValueAnEventScript(region, offset);
+		return isAttributeNameForValueInArray(EVENT_ATTRIBUTE_NAMES, region, offset);
 	}
+	
+	/**
+	 * @param region {@link ITextRegion} containing <code>offset</code>
+	 * @param offset offset in the given <code>region</code> to check if it is in
+	 * the attribute value region of a style attribute
+	 * @return <code>true</code> if the given offset in the given region is
+	 * in the value region of a style attribute, <code>false</code> otherwise
+	 */
+	private boolean isStyleAttributeValue(ITextRegion region, int offset) {
+		boolean isStyleAttributeValue = false;
+		if (region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+			isStyleAttributeValue = isAttributeNameForValueInArray(STYLE_ATTRIBUTE_NAMES, region, offset);
+		}
 
-	private boolean isAttributeNameForValueAnEventScript(ITextRegion attrValueRegion, int offset) {
+		return isStyleAttributeValue;
+	}
+	
+	/**
+	 * <p>determines if the attribute name associated with the given attribute region
+	 * is in the given array of attribute names</p>
+	 * 
+	 * @param attributeNames determine if the attribute name associated with the given offset
+	 * is in this array of attribute names
+	 * @param attrValueRegion {@link ITextRegion} of the attribute region containing the given offset
+	 * @param offset offset in an attribute region to determine if it is in the list of given attribute names
+	 * @return <code>true</code> if the attribute name associated with the given offset is in the given
+	 * list of attribute names, <code>false</code> otherwise
+	 */
+	private boolean isAttributeNameForValueInArray(String[] attributeNames, ITextRegion attrValueRegion, int offset) {
 		IStructuredDocumentRegion node = fStructuredDocument.getRegionAtCharacterOffset(offset);
 		ITextRegionList regionList = node.getRegions();
 		int currentIndex = regionList.indexOf(attrValueRegion);
-
+		
 		/*
 		 * 4 is the minimum index allowing for the tag's open, name, attribute
 		 * name and equals character to appear first
@@ -243,17 +289,17 @@
 			return false;
 		ITextRegion tagAttrNameRegion = regionList.get(currentIndex - 2);
 		
-		boolean isEvent = false;
+		boolean foundAttributeName = false;
 		if (fStructuredDocument instanceof IRegionComparible) {
 			int start = node.getStartOffset(tagAttrNameRegion);
-			for (int i = 0; !isEvent && i < EVENT_ATTRIBUTE_NAMES.length; i++) {
-				isEvent = ((IRegionComparible) fStructuredDocument).regionMatchesIgnoreCase(start, tagAttrNameRegion.getTextLength(), EVENT_ATTRIBUTE_NAMES[i]);
+			for (int i = 0; !foundAttributeName && i < attributeNames.length; i++) {
+				foundAttributeName = ((IRegionComparible) fStructuredDocument).regionMatchesIgnoreCase(start, tagAttrNameRegion.getTextLength(), attributeNames[i]);
 			}
 		}
 		else {
 			String tagAttrName = node.getText(tagAttrNameRegion);
-			isEvent = StringUtils.contains(EVENT_ATTRIBUTE_NAMES, tagAttrName, false);
+			foundAttributeName = StringUtils.contains(attributeNames, tagAttrName, false);
 		}
-		return isEvent;
+		return foundAttributeName;
 	}
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CMUtil.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CMUtil.java
index 1809abd..9633916 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CMUtil.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CMUtil.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -197,4 +197,16 @@
 		}
 		return false;
 	}
+	
+	/**
+	 * The method to distinguish HTML and XHTML from other mark up.
+	 * This method returns true if the target is,
+	 * (1) not JSP,
+	 * (2) not SSI.
+	 */
+	public static boolean isObsolete(CMNode decl) {
+		return decl.supports(HTMLCMProperties.IS_OBSOLETE) && ((Boolean)(decl.getProperty(HTMLCMProperties.IS_OBSOLETE))).booleanValue();
+	}
+	
+	
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfoImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfoImpl.java
index 8097da4..4710a1e 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfoImpl.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfoImpl.java
@@ -37,6 +37,7 @@
 					case UNDEFINED_VALUE_ERROR :
 					case MISMATCHED_VALUE_ERROR :
 					case UNCLOSED_ATTR_VALUE :
+					case RESOURCE_NOT_FOUND :
 						//D210422
 						return ((Attr) target).getValue();
 					default :
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorState.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorState.java
index 17af433..f64d50e 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorState.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorState.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,6 +18,9 @@
 	static final int UNDEFINED_NAME_ERROR = 11;
 	static final int UNDEFINED_VALUE_ERROR = 12;
 	static final int MISMATCHED_VALUE_ERROR = 13;
+	static final int OBSOLETE_ATTR_NAME_ERROR = 14;
+	static final int OBSOLETE_TAG_NAME_ERROR = 15;
+	
 	// format error
 	static final int FORMAT_ERROR_LEVEL = 100;
 	static final int INVALID_NAME_ERROR = 101;
@@ -33,6 +36,7 @@
 	static final int UNCLOSED_END_TAG_ERROR = 111;
 	static final int INVALID_EMPTY_ELEMENT_TAG = 112;
 	static final int UNCLOSED_ATTR_VALUE = 113; //D210422
+	static final int RESOURCE_NOT_FOUND = 114; //D210422
 	// layout error
 	static final int LAYOUT_ERROR_LEVEL = 1000;
 	static final int INVALID_CONTENT_ERROR = 1001;
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/FMUtil.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/FMUtil.java
index a548dea..f3ee02a 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/FMUtil.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/FMUtil.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,7 +13,11 @@
 
 
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 
 final class FMUtil {
 
@@ -21,6 +25,8 @@
 	public final static int SEG_WHOLE_TAG = 1;
 	public final static int SEG_START_TAG = 2;
 	public final static int SEG_END_TAG = 3;
+	public final static int SEG_START_TAG_NAME = 4;
+	public final static int SEG_END_TAG_NAME = 5;
 
 	/**
 	 */
@@ -55,7 +61,7 @@
 					seg = new Segment(startTag);
 				}
 				else {
-					seg = new Segment(target.getStartOffset(), 0);
+					seg = new Segment(target.getStartOffset(), 1);
 				}
 				break;
 			case SEG_END_TAG :
@@ -64,7 +70,31 @@
 					seg = new Segment(endTag);
 				}
 				else {
-					seg = new Segment(target.getEndOffset(), 0);
+					seg = new Segment(target.getEndOffset(), 1);
+				}
+				break;
+			case SEG_START_TAG_NAME :
+				startTag = target.getStartStructuredDocumentRegion();
+				if (startTag != null) {
+					ITextRegion nameRegion = getNameRegion(startTag);
+					if (nameRegion != null) {
+						seg = new Segment(startTag.getStartOffset(nameRegion), nameRegion.getTextLength());
+					}
+				}
+				if (seg == null) {
+					seg = getSegment(target, SEG_START_TAG);
+				}
+				break;
+			case SEG_END_TAG_NAME :
+				endTag = target.getEndStructuredDocumentRegion();
+				if (endTag != null) {
+					ITextRegion nameRegion = getNameRegion(endTag);
+					if (nameRegion != null) {
+						seg = new Segment(endTag.getStartOffset(nameRegion), nameRegion.getTextLength());
+					}
+				}
+				if (seg == null) {
+					seg = getSegment(target, SEG_END_TAG);
 				}
 				break;
 			case SEG_NONE :
@@ -74,5 +104,17 @@
 		return seg;
 	}
 
+	private static ITextRegion getNameRegion(ITextRegionCollection containerRegion) {
+		ITextRegionList regions = containerRegion.getRegions();
+		ITextRegion nameRegion = null;
+		for (int i = 0; i < regions.size(); i++) {
+			ITextRegion r = regions.get(i);
+			if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
+				nameRegion = r;
+				break;
+			}
+		}
+		return nameRegion ;
+	}
 
 }
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java
index a4a0279..0551d74 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,14 +10,15 @@
  *******************************************************************************/
 package org.eclipse.wst.html.core.internal.validate;
 
-
-
-import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
-import java.util.Map;
 
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
@@ -26,7 +27,6 @@
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
 import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
 import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
@@ -44,6 +44,8 @@
 	private static final char SINGLE_QUOTE = '\'';
 	private static final char DOUBLE_QUOTE = '\"';
 
+	private static final String ATTR_NAME_DATA = "data-";
+
 	// D210422
 	/**
 	 * HTMLAttributeValidator constructor comment.
@@ -71,13 +73,17 @@
 			if (errorNode instanceof IDOMAttr) {
 				IDOMElement ownerElement = (IDOMElement) ((IDOMAttr) errorNode).getOwnerElement();
 				if (ownerElement != null) {
-					int regionStartOffset = ownerElement.getFirstStructuredDocumentRegion().getStartOffset(rgn);
-					int regionLength = rgn.getLength();
-					return new Segment(regionStartOffset, regionLength);
+					//if editor closed during validation this could be null
+					IStructuredDocumentRegion firstRegion = ownerElement.getFirstStructuredDocumentRegion();
+					if(firstRegion != null) {
+						int regionStartOffset = firstRegion.getStartOffset(rgn);
+						int regionLength = rgn.getTextLength();
+						return new Segment(regionStartOffset, regionLength);
+					}
 				}
 			}
 		}
-		return new Segment(errorNode.getStartOffset(), 0);
+		return new Segment(errorNode.getStartOffset(), 1);
 	}
 
 	/**
@@ -99,38 +105,7 @@
 			return;
 		CMNamedNodeMap declarations = edec.getAttributes();
 
-		CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(declarations) {
-			private Map caseInsensitive;
-			
-			private Map getCaseInsensitiveMap() {
-				if(caseInsensitive == null)
-					caseInsensitive = new HashMap();
-				return caseInsensitive;
-			}
-
-			public CMNode getNamedItem(String name) {
-				CMNode node = super.getNamedItem(name);
-				if (node == null) {
-					node = (CMNode) getCaseInsensitiveMap().get(name.toLowerCase(Locale.US));
-				}
-				return node;
-			}
-
-			public void put(CMNode cmNode) {
-				super.put(cmNode);
-				getCaseInsensitiveMap().put(cmNode.getNodeName().toLowerCase(Locale.US), cmNode);
-			}
-		};
-
-		List nodes = ModelQueryUtil.getModelQuery(target.getOwnerDocument()).getAvailableContent((Element) node, edec, ModelQuery.INCLUDE_ATTRIBUTES);
-		for (int k = 0; k < nodes.size(); k++) {
-			CMNode cmnode = (CMNode) nodes.get(k);
-			if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
-				allAttributes.put(cmnode);
-			}
-		}
-		declarations = allAttributes;
-
+		List modelQueryNodes = null;
 		NamedNodeMap attrs = target.getAttributes();
 		for (int i = 0; i < attrs.getLength(); i++) {
 			int rgnType = REGION_NAME;
@@ -149,7 +124,27 @@
 					continue; // skip futher validation and begin next loop.
 			}
 
+			String attrName = a.getName().toLowerCase(Locale.US);
+			if (attrName.startsWith(ATTR_NAME_DATA) && attrName.length() > ATTR_NAME_DATA.length())
+				continue;
+
 			CMAttributeDeclaration adec = (CMAttributeDeclaration) declarations.getNamedItem(a.getName());
+			
+			/* Check the modelquery if nothing is declared by the element declaration */
+			if (adec == null) {
+				if (modelQueryNodes == null)
+					modelQueryNodes = ModelQueryUtil.getModelQuery(target.getOwnerDocument()).getAvailableContent((Element) node, edec, ModelQuery.INCLUDE_ATTRIBUTES);
+				
+				
+				for (int k = 0; k < modelQueryNodes.size(); k++) {
+					CMNode cmnode = (CMNode) modelQueryNodes.get(k);
+					if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION && cmnode.getNodeName().toLowerCase(Locale.US).equals(attrName)) {
+						adec = (CMAttributeDeclaration) cmnode;
+						break;
+					}
+				}
+			}
+			
 			if (adec == null) {
 				// No attr declaration was found. That is, the attr name is
 				// undefined.
@@ -162,6 +157,9 @@
 			} else {
 				// The attr declaration was found.
 				// At 1st, the name should be checked.
+				if (CMUtil.isObsolete(adec)){
+					state = ErrorState.OBSOLETE_ATTR_NAME_ERROR;
+				}
 				if (CMUtil.isHTML(edec) && (!CMUtil.isXHTML(edec))) {
 					// If the target element is pure HTML (not XHTML), some
 					// attributes
@@ -193,32 +191,67 @@
 							rgnType = REGION_VALUE;
 							state = ErrorState.UNDEFINED_VALUE_ERROR;
 						}
-					} else {
-						String[] candidates = attrType.getEnumeratedValues();
-						if (candidates != null && candidates.length > 0) {
-							// several candidates are found.
-							boolean found = false;
-							for (int index = 0; index < candidates.length; index++) {
-								String candidate = candidates[index];
+					}
+					else if (CMDataType.URI.equals(attrType.getDataTypeName())) {
+						// TODO: URI validation?
+						if (false && actualValue.indexOf('#') < 0 && actualValue.indexOf(":/") == -1 && CMUtil.isHTML(edec)) { //$NON-NLS-1$ //$NON-NLS-2$
+							IStructuredDocumentRegion start = ((IDOMNode) node).getStartStructuredDocumentRegion();
+							if (start != null && start.getFirstRegion().getTextLength() == 1) {
+								IPath basePath = new Path(((IDOMNode) node).getModel().getBaseLocation());
+								if (basePath.segmentCount() > 1) {
+									IPath path = ModuleCoreSupport.resolve(basePath, actualValue);
+									IResource found = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
+									if (found == null || !found.isAccessible()) {
+										rgnType = REGION_VALUE;
+										state = ErrorState.RESOURCE_NOT_FOUND;
+									}
+								}
+							}
+						}
+					}
+					else if (CMDataType.ENUM.equals(attrType.getDataTypeName())) {
+						/*
+						 * Check current value is valid among a known list.
+						 * There may be enumerated values provided even when
+						 * the datatype is not ENUM, but we'll only validate
+						 * against that list if the type matches.
+						 */
+						String[] enumeratedValues = attrType.getEnumeratedValues();
+						// several candidates are found.
+						boolean found = false;
+						for (int j = 0; j < enumeratedValues.length; j++) {
+							// At 1st, compare ignoring case.
+							if (actualValue.equalsIgnoreCase(enumeratedValues[j])) {
+								found = true;
+								if (CMUtil.isCaseSensitive(edec) && (!actualValue.equals(enumeratedValues[j]))) {
+									rgnType = REGION_VALUE;
+									state = ErrorState.MISMATCHED_VALUE_ERROR;
+								}
+								break; // exit the loop.
+							}
+						}
+						if (!found) {
+							// retrieve and check extended values (retrieval can call extensions, which may take longer)
+							String[] modelQueryExtensionValues = ModelQueryUtil.getModelQuery(target.getOwnerDocument()).getPossibleDataTypeValues((Element) node, adec);
+							// copied loop from above
+							for (int j = 0; j < modelQueryExtensionValues.length; j++) {
 								// At 1st, compare ignoring case.
-								if (actualValue.equalsIgnoreCase(candidate)) {
+								if (actualValue.equalsIgnoreCase(modelQueryExtensionValues[j])) {
 									found = true;
-									if (CMUtil.isCaseSensitive(edec) && (!actualValue.equals(candidate))) {
+									if (CMUtil.isCaseSensitive(edec) && (!actualValue.equals(modelQueryExtensionValues[j]))) {
 										rgnType = REGION_VALUE;
 										state = ErrorState.MISMATCHED_VALUE_ERROR;
 									}
 									break; // exit the loop.
 								}
 							}
-							if (!found) {
-								// No candidate was found. That is,
-								// actualValue is invalid.
-								// but not regard it as undefined value if it
-								// includes nested region.
-								if (!hasNestedRegion(((IDOMNode) a).getValueRegion())) {
-									rgnType = REGION_VALUE;
-									state = ErrorState.UNDEFINED_VALUE_ERROR;
-								}
+							// No candidate was found. That is,
+							// actualValue is invalid.
+							// but not regard it as undefined value if it
+							// includes nested region.
+							if (!hasNestedRegion(((IDOMNode) a).getValueRegion())) {
+								rgnType = REGION_VALUE;
+								state = ErrorState.UNDEFINED_VALUE_ERROR;
 							}
 						}
 					}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementContentValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementContentValidator.java
index cd6c07b..d7462fe 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementContentValidator.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementContentValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,13 +10,19 @@
  *******************************************************************************/
 package org.eclipse.wst.html.core.internal.validate;
 
+import java.util.List;
+import java.util.Locale;
+
+import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
+import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
 
 public class HTMLElementContentValidator extends PrimeValidator {
 
@@ -42,17 +48,22 @@
 		if (CMUtil.isForeign(target))
 			return;
 
-		validateContent(target, target.getChildNodes());
+		validateContent(target, target.getFirstChild());
 	}
+	
+	private void validateContent(Element parent, Node child) {
+		if (child == null)
+			return;
 
-	private void validateContent(Element parent, NodeList children) {
-		for (int i = 0; i < children.getLength(); i++) {
-			Node child = children.item(i);
-			if (child == null)
-				continue;
-
+		CMElementDeclaration ed = CMUtil.getDeclaration(parent);
+		if(ed == null || ed.getContentType() == CMElementDeclaration.ANY)
+			return;
+		
+		List[] extendedContent = new List[1];
+		while (child != null) {
 			// perform actual validation
-			validateNode(parent, child);
+			validateNode(parent, child, ed, extendedContent);
+			child = child.getNextSibling();
 		}
 	}
 
@@ -72,25 +83,35 @@
 
 	/*
 	 * The implementation of the following method is practical but accurate.
-	 * The accurate maximum occurence should be retreive from the content
+	 * The accurate maximum occurrence should be retrieve from the content
 	 * model. However, it is useful enough, since almost implicit elements are
 	 * HTML, HEAD, or BODY.
 	 */
 	// private int getMaxOccur(Element parent, String childTag) {
 	// return 1;
 	// }
-	private void validateNode(Element target, Node child) {
+
+//	private boolean containsName(String name, Object[] possible) {
+//		if (name != null && possible != null) {
+//			for (int i = 0; i < possible.length; i++) {
+//				if(name.equals(possible[i]))
+//				return true;
+//			}
+//		}
+//		return false;
+//	}
+
+	private void validateNode(Element target, Node child, CMElementDeclaration edec, List[] extendedContent) {
 		// NOTE: If the target element is 'UNKNOWN', that is, it has no
 		// element declaration, the content type of the element should be
 		// regarded as 'ANY'. -- 9/10/2001
 		int contentType = CMElementDeclaration.ANY;
-		CMElementDeclaration edec = CMUtil.getDeclaration(target);
 		if (edec != null)
 			contentType = edec.getContentType();
 
 		int error = ErrorState.NONE_ERROR;
 		int segType = FMUtil.SEG_WHOLE_TAG;
-
+		
 		switch (child.getNodeType()) {
 			case Node.ELEMENT_NODE :
 				Element childElem = (Element) child;
@@ -107,7 +128,11 @@
 				// type of the parent content model. -- 10/12/2001
 				if (ced == null || CMUtil.isSSI(ced) || (!CMUtil.isHTML(ced)))
 					return;
-
+				if (CMUtil.isObsolete(ced)){
+					error = ErrorState.OBSOLETE_TAG_NAME_ERROR;
+					break;
+				}
+				
 				switch (contentType) {
 					case CMElementDeclaration.ANY :
 						// Keep going.
@@ -126,6 +151,29 @@
 							if (CMUtil.isValidInclusion(ced, target))
 								return;
 						}
+						
+						/*
+						 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=218143 - 
+						 * ModelQuery use not pervasive enough
+						 */
+						if (extendedContent[0] == null) {
+							extendedContent[0] = ModelQueryUtil.getModelQuery(target.getOwnerDocument()).getAvailableContent(target, edec, ModelQuery.INCLUDE_CHILD_NODES);
+						}
+
+						List availableChildElementDeclarations = extendedContent[0];
+						/*
+						 * Retrieve and set aside just the element names for faster checking
+						 * later.
+						 */
+						int availableChildCount = availableChildElementDeclarations.size();
+						String elementName = ced.getElementName().toLowerCase(Locale.US);
+						for (int i = 0; i < availableChildCount; i++) {
+							CMNode cmnode = (CMNode) availableChildElementDeclarations.get(i);
+							if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION && cmnode.getNodeName().toLowerCase(Locale.US).equals(elementName)) {
+								return;
+							}
+						}
+						
 						error = ErrorState.INVALID_CONTENT_ERROR;
 						break;
 					default :
@@ -165,6 +213,13 @@
 				// Mark the whole node as an error segment.
 				segType = FMUtil.SEG_WHOLE_TAG;
 				break;
+			case Node.CDATA_SECTION_NODE :
+				if (edec.supports(HTMLCMProperties.IS_XHTML) && Boolean.TRUE.equals(edec.getProperty(HTMLCMProperties.IS_XHTML)))
+					return;
+				// Mark the whole CDATA section as an error segment
+				error = ErrorState.INVALID_CONTENT_ERROR;
+				segType = FMUtil.SEG_WHOLE_TAG;
+				break;
 			default :
 				error = ErrorState.INVALID_CONTENT_ERROR;
 				// Mark the whole node as an error segment.
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/MessageFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/MessageFactory.java
index 6d0468d..d7ed235 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/MessageFactory.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/MessageFactory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,14 +10,15 @@
  *******************************************************************************/
 package org.eclipse.wst.html.core.internal.validate;
 
-import java.util.HashMap;
 import java.util.Hashtable;
-import java.util.Map;
 
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IPreferencesService;
+import org.eclipse.core.runtime.preferences.IScopeContext;
 import org.eclipse.core.runtime.preferences.InstanceScope;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.wst.html.core.internal.HTMLCoreMessages;
@@ -31,8 +32,9 @@
 public class MessageFactory implements ErrorState {
 
 
-	private static Map fPreferences = new HashMap();
-	private static IProject fProject;
+	private IProject fProject;
+	private IScopeContext[] fLookupOrder;
+	private IPreferencesService fPreferenceService;
 	
 	public MessageFactory() {
 		init();
@@ -59,25 +61,21 @@
 	 * @param msg the message for the error
 	 */
 	private void mapToKey(String key, ErrorTable errorTable, int state, String msg) {
-		boolean useProject = false;
-		IEclipsePreferences prefs = null;
-		
-		if (fProject != null) {
-			prefs = new ProjectScope(fProject).getNode(HTMLCorePlugin.getDefault().getBundle().getSymbolicName());
-			useProject = prefs.getBoolean(HTMLCorePreferenceNames.USE_PROJECT_SETTINGS, false);
-		}
-		
 		int severity = ValidationMessage.WARNING;
-		if(useProject)
-			severity = prefs.getInt(key, ValidationMessage.WARNING);
-		else
-			severity = new InstanceScope().getNode(HTMLCorePlugin.getDefault().getBundle().getSymbolicName()).getInt(key, ValidationMessage.WARNING);
-			
-		ErrorTable.Packet packet = errorTable.put(state, msg, severity);
-		fPreferences.put(key, packet);
+		severity = fPreferenceService.getInt(HTMLCorePlugin.getDefault().getBundle().getSymbolicName(), key, ValidationMessage.WARNING, fLookupOrder);
+		errorTable.put(state, msg, severity);
 	}
 	
 	private void init() {
+		fPreferenceService = Platform.getPreferencesService();
+		fLookupOrder = new IScopeContext[] {new InstanceScope(), new DefaultScope()};
+		
+		if (fProject != null) {
+			ProjectScope projectScope = new ProjectScope(fProject);
+			if(projectScope.getNode(HTMLCorePlugin.getDefault().getBundle().getSymbolicName()).getBoolean(HTMLCorePreferenceNames.USE_PROJECT_SETTINGS, false))
+				fLookupOrder = new IScopeContext[] {projectScope, new InstanceScope(), new DefaultScope()};
+		}
+		
 		for (int i = 0; i < NodeType.MAX_TYPE; i++) {
 			errTables[i] = new ErrorTable();
 		}
@@ -95,16 +93,9 @@
 		mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_DUPLICATE, attrTable, DUPLICATE_ERROR, MSG_DUPLICATE_ATTR_ERROR);
 		mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_MISMATCH, attrTable, MISMATCHED_VALUE_ERROR, MSG_MISMATCHED_ATTR_VALUE_ERROR);
 		mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_UNCLOSED, attrTable, UNCLOSED_ATTR_VALUE, MSG_UNCLOSED_ATTR_VALUE_ERROR);
-		//attrTable.put(UNDEFINED_NAME_ERROR, MSG_UNDEFINED_ATTR_ERROR, ValidationMessage.WARNING);
-		//attrTable.put(UNDEFINED_VALUE_ERROR, MSG_UNDEFINED_VALUE_ERROR, ValidationMessage.WARNING);
-		//attrTable.put(MISMATCHED_ERROR, MSG_MISMATCHED_ATTR_ERROR, ValidationMessage.WARNING);
-		//attrTable.put(INVALID_NAME_ERROR, MSG_INVALID_ATTR_ERROR, ValidationMessage.WARNING);
-		//attrTable.put(INVALID_ATTR_ERROR, MSG_ATTR_NO_VALUE_ERROR, ValidationMessage.WARNING);
-		//attrTable.put(DUPLICATE_ERROR, MSG_DUPLICATE_ATTR_ERROR, ValidationMessage.WARNING);
-		//attrTable.put(MISMATCHED_VALUE_ERROR, MSG_MISMATCHED_ATTR_VALUE_ERROR, ValidationMessage.ERROR);
-		//<<D210422
-		//attrTable.put(UNCLOSED_ATTR_VALUE, MSG_UNCLOSED_ATTR_VALUE_ERROR, ValidationMessage.WARNING);
-		//D210422
+		mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_RESOURCE_NOT_FOUND, attrTable, RESOURCE_NOT_FOUND, MSG_RESOURCE_NOT_FOUND);
+		mapToKey(HTMLCorePreferenceNames.ATTRIBUTE_OBSOLETE_NAME, attrTable, OBSOLETE_ATTR_NAME_ERROR, MSG_OBSOLETE_ATTR_ERROR);
+
 		// element error map
 		ErrorTable elemTable = errTables[NodeType.ELEMENT];// short hand
 		elemTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
@@ -122,20 +113,8 @@
 		mapToKey(HTMLCorePreferenceNames.ELEM_UNCLOSED_START_TAG, elemTable, UNCLOSED_TAG_ERROR, MSG_UNCLOSED_START_TAG_ERROR);
 		mapToKey(HTMLCorePreferenceNames.ELEM_UNCLOSED_END_TAG, elemTable, UNCLOSED_END_TAG_ERROR, MSG_UNCLOSED_END_TAG_ERROR);
 		mapToKey(HTMLCorePreferenceNames.ELEM_INVALID_EMPTY_TAG, elemTable, INVALID_EMPTY_ELEMENT_TAG, MSG_INVALID_EMPTY_ELEMENT_TAG);
-		//elemTable.put(UNDEFINED_NAME_ERROR, MSG_UNDEFINED_TAG_ERROR, ValidationMessage.WARNING);
-		//elemTable.put(INVALID_NAME_ERROR, MSG_INVALID_TAG_ERROR, ValidationMessage.ERROR);
-		//elemTable.put(MISMATCHED_ERROR, MSG_MISMATCHED_TAG_ERROR, ValidationMessage.WARNING);
-		//elemTable.put(MISMATCHED_END_TAG_ERROR, MSG_MISMATCHED_TAG_ERROR, ValidationMessage.ERROR);
-		//elemTable.put(MISSING_START_TAG_ERROR, MSG_MISSING_START_TAG_ERROR, ValidationMessage.ERROR);
-		//elemTable.put(MISSING_END_TAG_ERROR, MSG_MISSING_END_TAG_ERROR, ValidationMessage.WARNING);
-		//elemTable.put(UNNECESSARY_END_TAG_ERROR, MSG_UNNECESSARY_END_TAG_ERROR, ValidationMessage.WARNING);
-		//elemTable.put(INVALID_DIRECTIVE_ERROR, MSG_INVALID_DIRECTIVE_ERROR, ValidationMessage.ERROR);
-		//elemTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-		//elemTable.put(DUPLICATE_ERROR, MSG_DUPLICATE_TAG_ERROR, ValidationMessage.WARNING);
-		//elemTable.put(COEXISTENCE_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-		//elemTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_START_TAG_ERROR, ValidationMessage.ERROR);
-		//elemTable.put(UNCLOSED_END_TAG_ERROR, MSG_UNCLOSED_END_TAG_ERROR, ValidationMessage.ERROR);
-		//elemTable.put(INVALID_EMPTY_ELEMENT_TAG, MSG_INVALID_EMPTY_ELEMENT_TAG, ValidationMessage.WARNING);
+		mapToKey(HTMLCorePreferenceNames.ELEM_OBSOLETE_NAME, elemTable, OBSOLETE_TAG_NAME_ERROR, MSG_OBSOLETE_TAG_ERROR);
+
 
 		// document type error map
 		ErrorTable docTable = errTables[NodeType.DOCUMENT_TYPE];// short hand
@@ -143,49 +122,36 @@
 		mapToKey(HTMLCorePreferenceNames.DOC_DUPLICATE, docTable, DUPLICATE_ERROR, MSG_DUPLICATE_TAG_ERROR);
 		mapToKey(HTMLCorePreferenceNames.DOC_INVALID_CONTENT, docTable, INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR);
 		mapToKey(HTMLCorePreferenceNames.DOC_DOCTYPE_UNCLOSED, docTable, UNCLOSED_TAG_ERROR, MSG_UNCLOSED_DOCTYPE_ERROR);
-		//docTable.put(DUPLICATE_ERROR, MSG_DUPLICATE_TAG_ERROR, ValidationMessage.ERROR);
-		//docTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-		//docTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_DOCTYPE_ERROR, ValidationMessage.ERROR);
 
 		// text error map
 		ErrorTable textTable = errTables[NodeType.TEXT];
 		textTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
 		mapToKey(HTMLCorePreferenceNames.TEXT_INVALID_CONTENT, textTable, INVALID_CONTENT_ERROR, MSG_INVALID_TEXT_ERROR);
 		mapToKey(HTMLCorePreferenceNames.TEXT_INVALID_CHAR, textTable, INVALID_CHAR_ERROR, MSG_INVALID_CHAR_ERROR);
-		//textTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_TEXT_ERROR, ValidationMessage.WARNING);
-		//textTable.put(INVALID_CHAR_ERROR, MSG_INVALID_CHAR_ERROR, ValidationMessage.WARNING);
 
 		// comment error map
 		ErrorTable commTable = errTables[NodeType.COMMENT];
 		commTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
 		mapToKey(HTMLCorePreferenceNames.COMMENT_INVALID_CONTENT, commTable, INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR);
 		mapToKey(HTMLCorePreferenceNames.COMMENT_UNCLOSED, commTable, UNCLOSED_TAG_ERROR, MSG_UNCLOSED_COMMENT_ERROR);
-		//commTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-		//commTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_COMMENT_ERROR, ValidationMessage.ERROR);
 
 		// cdata section error map
 		ErrorTable cdatTable = errTables[NodeType.CDATA_SECTION];
 		cdatTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
 		mapToKey(HTMLCorePreferenceNames.CDATA_INVALID_CONTENT, cdatTable, INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR);
 		mapToKey(HTMLCorePreferenceNames.CDATA_UNCLOSED, cdatTable, UNCLOSED_TAG_ERROR, MSG_UNCLOSED_CDATA_SECTION_ERROR);
-		//cdatTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-		//cdatTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_CDATA_SECTION_ERROR, ValidationMessage.ERROR);
 
 		// processing instruction error map
 		ErrorTable piTable = errTables[NodeType.PROCESSING_INSTRUCTION];
 		piTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
 		mapToKey(HTMLCorePreferenceNames.PI_INVALID_CONTENT, piTable, INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR);
 		mapToKey(HTMLCorePreferenceNames.PI_UNCLOSED, piTable, UNCLOSED_TAG_ERROR, MSG_UNCLOSED_PI_ERROR);
-		//piTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
-		//piTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_PI_ERROR, ValidationMessage.ERROR);
 
 		// entity reference error map
 		ErrorTable erTable = errTables[NodeType.ENTITY_REFERENCE];
 		erTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
 		mapToKey(HTMLCorePreferenceNames.REF_UNDEFINED, erTable, UNDEFINED_NAME_ERROR, MSG_UNDEFINED_TAG_ERROR);
 		mapToKey(HTMLCorePreferenceNames.REF_INVALID_CONTENT, erTable, INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR);
-		//erTable.put(UNDEFINED_NAME_ERROR, MSG_UNDEFINED_TAG_ERROR, ValidationMessage.WARNING);
-		//erTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
 	}
 	
 	private static class ErrorTable {
@@ -273,7 +239,11 @@
 	private static final String MSG_UNCLOSED_CDATA_SECTION_ERROR = HTMLCoreMessages.CDATA_section_not_closed__ERROR_;
 	private static final String MSG_INVALID_EMPTY_ELEMENT_TAG = HTMLCoreMessages._ERROR_Tag___0___should_be_an_empty_element_tag_1;
 	private static final String MSG_UNCLOSED_ATTR_VALUE_ERROR = HTMLCoreMessages._ERROR_Attribute_value___0___not_closed__1;
-	private static ErrorTable[] errTables = new ErrorTable[NodeType.MAX_TYPE];
+	private static final String MSG_RESOURCE_NOT_FOUND = HTMLCoreMessages._ERROR_Resource_not_found_0;
+	private static final String MSG_OBSOLETE_ATTR_ERROR = HTMLCoreMessages.Obsolete_attribute_name___ERROR_;
+	private static final String MSG_OBSOLETE_TAG_ERROR = HTMLCoreMessages.Obsolete_tag___ERROR_;
+	
+	private ErrorTable[] errTables = new ErrorTable[NodeType.MAX_TYPE];
 
 //	static {
 //		for (int i = 0; i < NodeType.MAX_TYPE; i++) {
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupport.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupport.java
new file mode 100644
index 0000000..1bce59a
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupport.java
@@ -0,0 +1,198 @@
+/*******************************************************************************

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

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

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

+ * which accompanies this distribution, and is available at

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

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

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

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

+

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

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

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

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

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

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

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

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

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

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

+

+/**

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

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

+ * runtime.

+ * 

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

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

+ * already been acquired.

+ */

+public final class ModuleCoreSupport {

+	static final boolean _dump_NCDFE = false;

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

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

+

+	/**

+	 * @param project

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

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

+	 *         determined

+	 */

+	public static IPath computeWebContentRootPath(IPath path) {

+		IPath root = null;

+		try {

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

+		}

+		catch (NoClassDefFoundError e) {

+			if (_dump_NCDFE)

+				e.printStackTrace();

+		}

+		if (root == null) {

+			/*

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

+			 * 

+			 * NPE in JSPTaglibDirectiveContentAssistProcessor with

+			 * non-faceted project

+			 */

+			root = getLocalRoot(path);

+		}

+		return root;

+	}

+

+	/**

+	 * @param project

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

+	 */

+	public static IPath getWebContentRootPath(IProject project) {

+		if (project == null)

+			return null;

+

+		IPath path = null;

+		try {

+			path = ModuleCoreSupportDelegate.getWebContentRootPath(project);

+		}

+		catch (NoClassDefFoundError e) {

+			if (_dump_NCDFE)

+				e.printStackTrace();

+		}

+		return path;

+	}

+

+	/**

+	 * @param path

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

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

+	 *         otherwise

+	 */

+	public static IPath getRuntimePath(IPath path) {

+		IPath result = null;

+		try {

+			result = ModuleCoreSupportDelegate.getRuntimePath(path);

+		}

+		catch (NoClassDefFoundError e) {

+			if (_dump_NCDFE)

+				e.printStackTrace();

+		}

+		if (result == null) {

+			IPath root = getLocalRoot(path);

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

+		}

+		return result;

+	}

+

+	/**

+	 * @param basePath

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

+	 * @param reference

+	 *            - the reference string to resolve

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

+	 *         given reference according to the virtual pathing support

+	 */

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

+		IPath resolvedPath = null;

+		try {

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

+		}

+		catch (NoClassDefFoundError e) {

+			if (_dump_NCDFE)

+				e.printStackTrace();

+		}

+

+		if (resolvedPath == null) {

+			IPath rootPath = getLocalRoot(basePath);

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

+				resolvedPath = rootPath.append(reference);

+			}

+			else {

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

+			}

+		}

+

+		return resolvedPath;

+	}

+

+	/**

+	 * @param basePath

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

+	 */

+	private static IPath getLocalRoot(IPath basePath) {

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

+

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

+		IResource file = FileBuffers.getWorkspaceFileAtLocation(basePath);

+

+		// Try the base path as a folder first

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

+			file = workspaceRoot.getFolder(basePath);

+		}

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

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

+			file = workspaceRoot.getFile(basePath);

+		}

+

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

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

+		}

+

+		if (file == null) {

+			/*

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

+			 * 

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

+			 * require that the file exist yet.

+			 */

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

+			if (files.length > 0)

+				file = files[0];

+		}

+

+		while (file != null) {

+			/**

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

+			 * root

+			 */

+			IContainer folder = null;

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

+				folder = (IContainer) file;

+			}

+			else {

+				folder = file.getParent();

+			}

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

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

+				IFolder webinf = folder.getFolder(WEB_INF_PATH);

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

+					return folder.getFullPath();

+				}

+			}

+			file = file.getParent();

+		}

+

+		return basePath.uptoSegment(1);

+	}

+

+

+}

diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupportDelegate.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupportDelegate.java
new file mode 100644
index 0000000..818d340
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ModuleCoreSupportDelegate.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.validate;
+
+import java.lang.ref.Reference;
+import java.lang.ref.SoftReference;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.ModuleCoreNature;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
+import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
+
+/**
+ * Wrapper class for all Facet-related calls. If the Facet or ModuleCore
+ * bundles are not available, this class will not load, or if it does, its
+ * methods will cause NoClassDefFoundErrors. This allows us to
+ * compartmentalize the dependencies.
+ * 
+ */
+final class ModuleCoreSupportDelegate {
+	private static final String SLASH = "/";
+	private static Map fResolvedMap = new HashMap();
+
+	/**
+	 * @param path
+	 *            - the full path to a resource within the workspace
+	 * @return - the runtime path of the resource if one exists, null
+	 *         otherwise
+	 */
+	static IPath getRuntimePath(IPath path) {
+		if (path == null)
+			return null;
+
+		IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0));
+
+		if (!ModuleCoreNature.isFlexibleProject(project))
+			return null;
+
+		IVirtualResource[] virtualResources = ComponentCore.createResources(ResourcesPlugin.getWorkspace().getRoot().getFile(path));
+		if (virtualResources != null && virtualResources.length > 0) {
+			return virtualResources[0].getRuntimePath();
+		}
+		return null;
+	}
+
+	/**
+	 * @param project
+	 * @return the IPath to the "root" of the web contents
+	 */
+	static IPath getWebContentRootPath(IProject project) {
+		if (project == null)
+			return null;
+
+		if (!ModuleCoreNature.isFlexibleProject(project))
+			return null;
+
+		IPath path = null;
+		IVirtualComponent component = ComponentCore.createComponent(project);
+		if (component != null && component.exists()) {
+			path = component.getRootFolder().getWorkspaceRelativePath();
+		}
+		return path;
+	}
+
+	/**
+	 * @param basePath
+	 *            - the full path to a resource within the workspace
+	 * @param reference
+	 *            - the reference string to resolve
+	 * @return - the full path within the workspace that corresponds to the
+	 *         given reference according to the virtual pathing support
+	 */
+	static IPath resolve(IPath basePath, String reference) {
+		if (reference == null || basePath == null || basePath.segmentCount() == 0)
+			return null;
+
+		IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0));
+
+		if (!ModuleCoreNature.isFlexibleProject(project))
+			return null;
+
+		if (basePath.segmentCount() > 1) {
+			/*
+			 * It can take the better part of a full second to do this, so
+			 * cache the result.
+			 */
+			IPath resolved = null;
+			Map mapForBaseResource = null;
+			mapForBaseResource = (Map) fResolvedMap.get(basePath);
+			if (mapForBaseResource != null) {
+				Reference resolvedReference = (Reference) mapForBaseResource.get(reference);
+				if (resolvedReference != null)
+					resolved = (IPath) resolvedReference.get();
+			}
+			else {
+				mapForBaseResource = new HashMap();
+				fResolvedMap.put(basePath, mapForBaseResource);
+			}
+
+			if (resolved == null) {
+				IFile baseFile = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
+				IVirtualResource[] virtualResources = ComponentCore.createResources(baseFile);
+				for (int i = 0; i < virtualResources.length; i++) {
+					IPath baseRuntimePath = virtualResources[i].getRuntimePath();
+					IPath referenceRuntimePath = null;
+					if (reference.startsWith(SLASH)) {
+						referenceRuntimePath = new Path(reference);
+					}
+					else {
+						referenceRuntimePath = baseRuntimePath.removeLastSegments(1).append(reference);
+					}
+					IVirtualFile virtualFile = ComponentCore.createFile(project, referenceRuntimePath);
+					if (virtualFile != null && virtualFile.exists()) {
+						IFile[] underlyingFiles = virtualFile.getUnderlyingFiles();
+						for (int j = 0; j < underlyingFiles.length; j++) {
+							if (underlyingFiles[j].getProject().equals(project) && underlyingFiles[j].exists()) {
+								mapForBaseResource.put(reference, new SoftReference(underlyingFiles[j].getFullPath()));
+								resolved = underlyingFiles[j].getFullPath();
+							}
+
+						}
+					}
+				}
+			}
+			return resolved;
+		}
+		else {
+			IVirtualFile virtualFile = ComponentCore.createFile(project, new Path(reference));
+			if (virtualFile != null && virtualFile.exists()) {
+				return virtualFile.getUnderlyingFile().getFullPath();
+			}
+		}
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NamespaceValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NamespaceValidator.java
index f9e31ac..0df91b7 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NamespaceValidator.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NamespaceValidator.java
@@ -41,7 +41,12 @@
 			IDOMElement e = (IDOMElement) target;
 			if (!isValidPrefix(e.getPrefix(), target) && !e.isCommentTag()) {
 				// report unknown tag error.
-				Segment errorSeg = FMUtil.getSegment(e, FMUtil.SEG_START_TAG);
+				Segment errorSeg = null;
+				if (e.hasStartTag())
+					errorSeg = FMUtil.getSegment(e, FMUtil.SEG_START_TAG);
+				else if (e.hasEndTag())
+					errorSeg = FMUtil.getSegment(e, FMUtil.SEG_END_TAG);
+
 				if (errorSeg != null)
 					reporter.report(new ErrorInfoImpl(UNDEFINED_NAME_ERROR, errorSeg, e));
 			}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SyntaxValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SyntaxValidator.java
index 75cc031..4dd8979 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SyntaxValidator.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SyntaxValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,8 +12,11 @@
 
 import java.util.Iterator;
 
+import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
+import org.eclipse.wst.html.core.internal.contentmodel.HTMLPropertyDeclaration;
 import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
 import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
+import org.eclipse.wst.html.core.internal.provisional.HTML50Namespace;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
@@ -26,8 +29,10 @@
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 
 class SyntaxValidator extends PrimeValidator implements ErrorState {
@@ -75,9 +80,10 @@
 		public CMElementDeclaration decl = null;
 		public IStructuredDocumentRegion startTag = null;
 		public IStructuredDocumentRegion endTag = null;
-		public boolean hasStartTag = false;
-		public boolean hasEndTag = false;
+		public boolean hasStartTag() {return startTag != null;}
+		public boolean hasEndTag() {return endTag != null;}
 		public boolean isXHTML = false;
+		public boolean isXHTML5 = false;
 	}
 
 	public void validate(IndexedRegion indexedNode) {
@@ -95,8 +101,8 @@
 		// gather information to validate from target at once.
 		getInfo(info);
 
+		validateTags(info);
 		if (info.target.isGlobalTag()) {
-			validateTags(info);
 			validateNames(info);
 			if (info.decl != null && info.isXHTML) {
 				validateTagCase(info);
@@ -109,18 +115,45 @@
 		info.startTag = info.target.getStartStructuredDocumentRegion();
 		info.endTag = info.target.getEndStructuredDocumentRegion();
 
-		info.hasStartTag = (info.startTag != null);
-		info.hasEndTag = (info.endTag != null);
-
 		Document doc = info.target.getOwnerDocument();
 		if (!(doc instanceof IDOMDocument))
 			return;
 		String typeid = ((IDOMDocument) doc).getDocumentTypeId();
 		if (typeid != null) {
-			HTMLDocumentTypeEntry entry = HTMLDocumentTypeRegistry.getInstance().getEntry(typeid);
-			info.isXHTML = (entry != null && entry.isXMLType());
+			if (typeid.trim().length()!= 0){
+				HTMLDocumentTypeEntry entry = HTMLDocumentTypeRegistry.getInstance().getEntry(typeid);
+				info.isXHTML = (entry != null && entry.isXMLType());
+			}
+			else {
+				info.isXHTML = getXMLTarget(doc);
+				info.isXHTML5 = info.isXHTML;
+			}
 		}
 	}
+	
+	private boolean getXMLTarget(Document doc) {
+		if (doc == null)
+			return false;
+		Node child = doc.getFirstChild();
+		while (child != null) {
+			if (child.getNodeType() == Node.ELEMENT_NODE) {
+				if (child.getNodeName().equalsIgnoreCase("html")){
+					if (child.getAttributes()!= null){
+						NamedNodeMap attrs = child.getAttributes();
+						for (int i = 0; i < attrs.getLength(); i++) {
+							Attr a = (Attr) attrs.item(i);
+							if (a.getName().equalsIgnoreCase(HTML50Namespace.ATTR_NAME_XMLNS))
+									return true;
+						}
+					}
+					return false;
+				}
+				
+			}
+			child = child.getNextSibling();
+		}
+		return false;
+	}
 
 	class TagErrorInfoImpl extends AbstractErrorInfo {
 		private String hint = null;
@@ -175,7 +208,7 @@
 	}
 
 	private void validateTags(ElementInfo info) {
-		if (info.hasStartTag) {
+		if (info.hasStartTag()) {
 			if (!info.target.isStartTagClosed()) {
 				// Mark the whole START tag as an error segment.
 				Segment errorSeg = new Segment(info.startTag);
@@ -183,29 +216,39 @@
 			}
 		}
 		else {
-			if (info.hasEndTag) {
+			if (info.hasEndTag()) {
 				if (info.decl != null) {
-					if (CMUtil.isHTML(info.decl) && !info.target.hasChildNodes()) {
-						if (info.target.isContainer()) {
-							// Set the error mark to the start of the element.
-							Segment errorSeg = new Segment(info.target.getStartOffset(), 0);
-							report(MISSING_START_TAG_ERROR, errorSeg, info.target);
-						}
-						else {
-							// Mark the whole END tag as an error segment.
-							Segment errorSeg = new Segment(info.endTag);
-							report(UNNECESSARY_END_TAG_ERROR, errorSeg, info.target);
-						}
-					}
-					else if (info.isXHTML) {
-						Segment errorSeg = new Segment(info.target.getStartOffset(), 0);
+					//if xhtml then must have end tag
+					//else determine if end tag is omissible
+					if (info.isXHTML) {
+						Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_END_TAG_NAME);
 						report(MISSING_START_TAG_ERROR, errorSeg, info.target);
+					} else {
+						//determine if the end tag is omissible
+						boolean canOmitStartTag = false;
+						if(info.decl instanceof HTMLPropertyDeclaration) {
+							int omitType = ((HTMLPropertyDeclaration)info.decl).getOmitType();
+							canOmitStartTag = omitType == HTMLElementDeclaration.OMIT_BOTH;
+						}
+					
+						if (!canOmitStartTag && !info.target.hasChildNodes()) {
+							if (info.target.isContainer()) {
+								// Set the error mark to the start of the element.
+								Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_END_TAG);
+								report(MISSING_START_TAG_ERROR, errorSeg, info.target);
+							}
+							else {
+								// Mark the whole END tag as an error segment.
+								Segment errorSeg = new Segment(info.endTag);
+								report(UNNECESSARY_END_TAG_ERROR, errorSeg, info.target);
+							}
+						}
 					}
 				}
 			}
 		}
 
-		if (info.hasEndTag) {
+		if (info.hasEndTag()) {
 			if (!info.target.isClosed()) {
 				// Set the whole END tag as error segment.
 				Segment errorSeg = new Segment(info.endTag);
@@ -214,24 +257,31 @@
 		}
 		else {
 			if (info.isXHTML) { // XHTML
-				if (!info.target.isEmptyTag()) {
+				//if editor closed during validation this could be null
+				IStructuredDocumentRegion structRegion = info.target.getStartStructuredDocumentRegion();
+				if (!info.target.isEmptyTag() && structRegion != null && DOMRegionContext.XML_TAG_OPEN.equals(structRegion.getFirstRegion().getType())) {
+					/*
+					 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=248963 :
+					 * report empty tags not written as such, but only when
+					 * they follow actual XML/HTML syntax
+					 */
 					if (isEmptyContent(info.decl)) {
-						// EMPTY element should be written in <.../> form.
+						// EMPTY element should be written in <.../> form
 						Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_START_TAG);
 						report(INVALID_EMPTY_ELEMENT_TAG, errorSeg, info.target);
 					}
 					else {
 						// end tag is required.
-						Segment errorSeg = new Segment(info.target.getEndOffset(), 0);
+						Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_START_TAG);
 						report(MISSING_END_TAG_ERROR, errorSeg, info.target);
 					}
 				}
 			}
 			else { // HTML
-				if (info.hasStartTag) {
-					if (info.decl != null && CMUtil.isHTML(info.decl) && !info.target.isEmptyTag() && !CMUtil.isEndTagOmissible(info.decl)) {
+				if (info.hasStartTag()) {
+					if (info.decl != null && CMUtil.isHTML(info.decl) && !info.target.isEmptyTag() && !CMUtil.isEndTagOmissible(info.decl) && DOMRegionContext.XML_TAG_OPEN.equals(info.startTag.getFirstRegion().getType())) {
 						// Set the error mark to the end of the element.
-						Segment errorSeg = new Segment(info.target.getEndOffset(), 0);
+						Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_START_TAG);
 						report(MISSING_END_TAG_ERROR, errorSeg, info.target);
 					}
 				}
@@ -241,15 +291,15 @@
 
 	/* perform validation about tag name definition. */
 	private void validateNames(ElementInfo info) {
-		boolean corrupted = info.hasEndTag && isEndTagCorrupted(info);
+		boolean corrupted = info.hasEndTag() && isEndTagCorrupted(info);
 		if (info.decl == null) {
 			// If no declaration is retrieved, the target is really
 			// unknown element.
-			if (!info.hasStartTag && corrupted) {
+			if (!info.hasStartTag() && corrupted) {
 				reportCorruptedEndTagError(info);
 			}
 			else {
-				Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_START_TAG);
+				Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_START_TAG_NAME);
 				report(UNDEFINED_NAME_ERROR, errorSeg, info.target);
 			}
 		}
@@ -271,24 +321,41 @@
 		if (declared == null)
 			return;
 
-		// start tag
-		if (info.hasStartTag) {
-			startTagName = getTagName(info.startTag);
-			if (!declared.equals(startTagName)) {
-				TagErrorInfoImpl error = new TagErrorInfoImpl(MISMATCHED_ERROR, info.startTag, startTagName);
-				this.reporter.report(error);
+		if (info.isXHTML5){
+			if (info.hasStartTag()) {
+				startTagName = getTagName(info.startTag);
+				if (info.hasEndTag()) {
+					endTagName = getTagName(info.endTag);
+					if (!endTagName.equals(startTagName)){
+						TagErrorInfoImpl error = new TagErrorInfoImpl(MISMATCHED_ERROR, info.endTag, endTagName);
+						this.reporter.report(error);
+					}
+				}
 			}
+			
 		}
-		// end tag
-		if (info.hasEndTag) {
-			endTagName = getTagName(info.endTag);
-			if (!info.hasStartTag || (!endTagName.equals(startTagName))) {
-				if (!declared.equals(endTagName)) {
-					TagErrorInfoImpl error = new TagErrorInfoImpl(MISMATCHED_ERROR, info.endTag, endTagName);
+		else
+		{
+			// start tag
+			if (info.hasStartTag()) {
+				startTagName = getTagName(info.startTag);
+				if (!declared.equals(startTagName)) {
+					TagErrorInfoImpl error = new TagErrorInfoImpl(MISMATCHED_ERROR, info.startTag, startTagName);
 					this.reporter.report(error);
 				}
 			}
+			// end tag
+			if (info.hasEndTag()) {
+				endTagName = getTagName(info.endTag);
+				if (!info.hasStartTag() || (!endTagName.equals(startTagName))) {
+					if (!declared.equals(endTagName)) {
+						TagErrorInfoImpl error = new TagErrorInfoImpl(MISMATCHED_ERROR, info.endTag, endTagName);
+						this.reporter.report(error);
+					}
+				}
+			}
 		}
+		
 	}
 
 	private void validateChildren(Node target) {
diff --git a/bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF
index fee978e..2556c77 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.300.qualifier
+Bundle-Version: 1.0.502.qualifier
 Bundle-Activator: org.eclipse.wst.html.ui.internal.HTMLUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
@@ -18,9 +18,9 @@
  org.eclipse.wst.html.ui.internal.edit.ui;x-internal:=true,
  org.eclipse.wst.html.ui.internal.editor;x-internal:=true,
  org.eclipse.wst.html.ui.internal.handlers;x-internal:=true,
+ org.eclipse.wst.html.ui.internal.hyperlink;x-internal:=true,
  org.eclipse.wst.html.ui.internal.preferences;x-internal:=true,
  org.eclipse.wst.html.ui.internal.preferences.ui;x-internal:=true,
- org.eclipse.wst.html.ui.internal.projection;x-internal:=true,
  org.eclipse.wst.html.ui.internal.registry;x-internal:=true,
  org.eclipse.wst.html.ui.internal.search;x-internal:=true,
  org.eclipse.wst.html.ui.internal.style;x-internal:=true,
@@ -29,23 +29,24 @@
  org.eclipse.wst.html.ui.internal.text;x-internal:=true,
  org.eclipse.wst.html.ui.internal.wizard;x-internal:=true,
  org.eclipse.wst.html.ui.views.contentoutline
-Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.forms;bundle-version="[3.3.100,3.4.0)",
- org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.0.400,1.1.0)",
- org.eclipse.wst.css.ui;bundle-version="[1.0.300,1.1.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.200,1.2.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.200,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.0,1.3.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.3.0,2.0.0)";resolution:=optional,
- org.eclipse.wst.common.modulecore;bundle-version="[1.1.200,1.2.0)";resolution:=optional,
- com.ibm.icu;bundle-version="[3.8.1,4.0.0)"
+Import-Package: com.ibm.icu.util; version="3.8",
+ com.ibm.icu.text; version="3.8"
+Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.forms;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.sse.ui;bundle-version="[1.2.0,1.3.0)",
+ org.eclipse.wst.xml.ui;bundle-version="[1.1.100,1.2.0)",
+ org.eclipse.wst.css.ui;bundle-version="[1.0.500,1.1.0)",
+ org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.css.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.wst.html.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.validation;bundle-version="[1.2.100,1.3.0)",
+ org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.0,2.0.0)";resolution:=optional,
+ org.eclipse.wst.common.modulecore;bundle-version="[1.2.0,2.0.0)";resolution:=optional
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.html.ui/about.html b/bundles/org.eclipse.wst.html.ui/about.html
index 73db36e..2199df3 100644
--- a/bundles/org.eclipse.wst.html.ui/about.html
+++ b/bundles/org.eclipse.wst.html.ui/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/bundles/org.eclipse.wst.html.ui/build.properties b/bundles/org.eclipse.wst.html.ui/build.properties
index 3f7ebc2..be98a59 100644
--- a/bundles/org.eclipse.wst.html.ui/build.properties
+++ b/bundles/org.eclipse.wst.html.ui/build.properties
@@ -20,4 +20,3 @@
                temp.folder/**
 source.. = src/,\
            src-html-validation/
-src.includes = build.properties
diff --git a/bundles/org.eclipse.wst.html.ui/plugin.properties b/bundles/org.eclipse.wst.html.ui/plugin.properties
index c48a6b2..3232def 100644
--- a/bundles/org.eclipse.wst.html.ui/plugin.properties
+++ b/bundles/org.eclipse.wst.html.ui/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2005, 2008 IBM Corporation and others.
+# Copyright (c) 2005, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -8,12 +8,13 @@
 # Contributors:
 #     IBM Corporation - initial API and implementation
 ###############################################################################
-providerName=Eclipse.org
+providerName=Eclipse Web Tools Platform
 pluginName=HTML UI Source Editor
 HTML_Source_Page_Editor.name=HTML Editor
 WEB.name=Web
 HTML_Files.name=HTML Files
 HTML_Source.name=Editor
+HTML_Content_Assist.name=Content Assist
 HTML_Templates.name=Templates
 HTML_Styles.name=Styles
 HTML_Syntax_Coloring=Syntax Coloring
@@ -30,8 +31,8 @@
 HTML_Syntax_Validator.name=HTML Syntax Validator
 ###############################################################################
 #org.eclipse.ui.newWizards extension point
-_UI_WIZARD_NAME = HTML
-_UI_WIZARD_CREATE_NEW_FILE = Create a new HTML page
+_UI_WIZARD_NAME = HTML File
+_UI_WIZARD_CREATE_NEW_FILE = Create a new HTML file
 ##
 AddTask.label=Add &Task...
 AddTask.tooltip=Add Task...
@@ -59,14 +60,23 @@
 ##
 preferenceKeywords.files=editor html creating saving files suffix specified encoding iana loading
 preferenceKeywords.source=editor html source formatting line width split multiple attributes new clear blank indent tabs spaces size content assist automatically suggestions prompt characters inserted strategy lax strict markup case code generation tag names capitalization uppercase lowercase
+preferenceKeywords.contentassist=html editor content code assist complete completion insert overwrite single proposal common prefix automatically import fill argument name guess alphabetical hide auto activation trigger category categories separate specific
 preferenceKeywords.templates=editor html templates snippet macros
 preferenceKeywords.styles=editor html style customize syntax highlighting type text content foreground background bold color
 preferenceKeywords.webcontent=editor html web content settings profile style document type doctype public system css
 preferenceKeywords.severities=html errors warnings ignore options severity severities suppress project specific projectspecific
 ##
-HTML_Source_target_name=HTML Source
+HTML_Editors_target_name=HTML Editors
 
 scope.structured.text.editor.html.name=Editing HTML Source
 scope.structured.text.editor.html.description=Editing HTML Source
 scope.structured.text.editor.html.occurrences.name=HTML Source Occurrences
 scope.structured.text.editor.html.occurrences.description=HTML Source Occurrences
+
+Colors.scriptAreaBorder=Script Area Border
+hyperlinkDetector.anchor.name=Anchors
+hyperlink.target.script.name=HTML Client Script
+hyperlink.target.eventhandler.name=HTML Event Handlers
+
+proposalCategory.htmlTags=HTML Tag Proposals
+proposalCategory.htmlTemplates=HTML Template Proposals
diff --git a/bundles/org.eclipse.wst.html.ui/plugin.xml b/bundles/org.eclipse.wst.html.ui/plugin.xml
index f10d6d2..3f0d41b 100644
--- a/bundles/org.eclipse.wst.html.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.html.ui/plugin.xml
@@ -23,6 +23,9 @@
 		<contentOutlineConfiguration
 			class="org.eclipse.wst.html.ui.views.contentoutline.HTMLContentOutlineConfiguration"
 			target="org.eclipse.wst.html.core.htmlsource" />
+		<quickOutlineConfiguration
+			class="org.eclipse.wst.xml.ui.internal.quickoutline.XMLQuickOutlineConfiguration"
+			target="org.eclipse.wst.html.core.htmlsource"/>
 		<propertySheetConfiguration
 			class="org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration"
 			target="org.eclipse.wst.html.core.htmlsource" />
@@ -39,8 +42,8 @@
 			class="org.eclipse.wst.html.ui.internal.text.HTMLDocumentRegionEdgeMatcher"
 			target="org.eclipse.wst.html.core.htmlsource" />
 		<provisionalConfiguration
-			type="structuredtextfoldingprovider"
-			class="org.eclipse.wst.html.ui.internal.projection.StructuredTextFoldingProviderHTML"
+			type="foldingstrategy"
+			class="org.eclipse.wst.xml.ui.internal.projection.XMLFoldingStrategy"
 			target="org.eclipse.wst.html.core.htmlsource" />
 		<provisionalConfiguration
 			type="org.eclipse.jface.text.quickassist.IQuickAssistProcessor"
@@ -52,7 +55,7 @@
 			target="org.eclipse.wst.html.HTML_DEFAULT, org.eclipse.wst.html.HTML_DECLARATION" />
 		<provisionalDefinition
 			type="preferencepages"
-			value="org.eclipse.wst.html.ui.preferences.html, org.eclipse.wst.html.ui.preferences.source, org.eclipse.wst.html.ui.preferences.templates, org.eclipse.wst.html.ui.preferences.styles,org.eclipse.wst.html.ui.preferences.validation"
+			value="org.eclipse.wst.html.ui.preferences.html, org.eclipse.wst.html.ui.preferences.source, org.eclipse.wst.html.ui.preferences.templates, org.eclipse.wst.html.ui.preferences.styles,org.eclipse.wst.html.ui.preferences.validation, org.eclipse.wst.html.ui.preferences.contentassist"
 			target="org.eclipse.wst.html.core.htmlsource" />
 		<provisionalDefinition
 			type="spellingregions"
@@ -97,6 +100,15 @@
 			id="org.eclipse.wst.html.ui.preferences.source">
 			<keywordReference id="org.eclipse.wst.html.ui.source"/>
 		</page>
+  <page
+        category="org.eclipse.wst.html.ui.preferences.source"
+        class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLContentAssistPreferencePage"
+        id="org.eclipse.wst.html.ui.preferences.contentassist"
+        name="%HTML_Content_Assist.name">
+     <keywordReference
+           id="org.eclipse.wst.html.ui.contentassist">
+     </keywordReference>
+  </page>
 		<page
 			name="%HTML_Templates.name"
 			category="org.eclipse.wst.html.ui.preferences.source"
@@ -126,7 +138,7 @@
 	</extension>
 	<!-- Web content settings -->
 	<extension point="org.eclipse.ui.propertyPages">
-		<!-- for j2ee web project -->
+		<!-- for dynamic web project -->
 		<page
 			name="%WebContentSettings.name"
 			class="org.eclipse.wst.html.ui.internal.contentproperties.ui.ProjectWebContentSettingsPropertyPage"
@@ -201,6 +213,9 @@
 			label="%preferenceKeywords.source"
 			id="org.eclipse.wst.html.ui.source"/>
 		<keyword
+			label="%preferenceKeywords.contentassist"
+			id="org.eclipse.wst.html.ui.contentassist"/>
+		<keyword
 			label="%preferenceKeywords.templates"
 			id="org.eclipse.wst.html.ui.templates"/>
 		<keyword
@@ -297,42 +312,27 @@
 	<!--======================================================================================-->
 	<!-- Workbench validation                                       						  -->
 	<!--======================================================================================-->
-	<extension
-		id="HTMLValidator"
-		name="%HTML_Syntax_Validator.name"
-		point="org.eclipse.wst.validation.validator">
-		<validator>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.html">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.htm">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.xhtml">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.htpl">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.wml">
-			</filter>
-         	<contentTypeBinding contentTypeId="org.eclipse.wst.html.core.htmlsource"/>			
-			<helper class="org.eclipse.wst.html.internal.validation.HTMLValidationWorkbenchHelper"/>
-			<run
-				async="true"
-				fullBuild="true"
-				incremental="true"
-				enabled="true"
-				class="org.eclipse.wst.html.internal.validation.HTMLValidator"/>
-         <markerId markerIdValue="org.eclipse.wst.html.core.validationMarker"/>
+   <extension id="HTMLValidator" name="%HTML_Syntax_Validator.name" point="org.eclipse.wst.validation.validatorV2">
+      <validator
+            build="true"
+            class="org.eclipse.wst.html.internal.validation.HTMLValidator"
+            manual="true"
+            sourceid="org.eclipse.wst.html.ui.internal.validation.htmlsyntaxvalidator"
+            version="1"
+            markerId="org.eclipse.wst.html.core.validationMarker">
+         <include>
+            <rules>
+               <contentType id="org.eclipse.wst.html.core.htmlsource"></contentType>
+               <fileext caseSensitive="false" ext="html"/>
+               <fileext caseSensitive="false" ext="xhtml"/>
+               <fileext caseSensitive="false" ext="htm"/>
+               <fileext caseSensitive="false" ext="htpl"/>
+               <fileext caseSensitive="false" ext="wml"/>
+            </rules>
+         </include>
+         <group id="org.eclipse.wst.sse.core.structuredModelGroup"/>
       </validator>
-	</extension>
+   </extension>
 
 	<!--======================================================================================-->
 	<!-- As you type validation                                      						  -->
@@ -340,30 +340,19 @@
 
 	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
 		<validator
-			scope="partial"
+			scope="total"
 			class="org.eclipse.wst.html.internal.validation.HTMLValidator"
 			id="org.eclipse.wst.html.ui.internal.validation.htmlsyntaxvalidator">
 			<contentTypeIdentifier
 				id="org.eclipse.wst.html.core.htmlsource">
 				<partitionType id="org.eclipse.wst.html.HTML_DEFAULT"/>
+				<partitionType id="org.eclipse.wst.html.HTML_DECLARATION"/>
+				<partitionType id="org.eclipse.wst.html.HTML_COMMENT"/>
 				<partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
 				<partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
 			</contentTypeIdentifier>
 		</validator>
 	</extension>
-	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
-		<validator
-			scope="partial"
-			class="org.eclipse.wst.xml.ui.internal.validation.MarkupValidator"
-			id="org.eclipse.wst.html.ui.internal.validation.markupvalidator">
-			<contentTypeIdentifier
-				id="org.eclipse.wst.html.core.htmlsource">
-				<partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
-				<partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
-			</contentTypeIdentifier>
-		</validator>
-	</extension>
-
 
 	<!-- New HTML wizard -->
 	<extension point="org.eclipse.ui.newWizards">
@@ -378,7 +367,7 @@
 		</wizard>
 	</extension>
 
-	<!-- Add new HTML wizard to J2EE Project Navigator -->
+	<!-- Add new HTML wizard to Common Navigator -->
 	<extension
 		id="org.eclipse.wst.html.commonWizard.newHTML"
 		point="org.eclipse.ui.navigator.navigatorContent">
@@ -556,10 +545,26 @@
 		point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTargets">
 		<target
 			id="org.eclipse.wst.html.core.htmlsource"
-			name="%HTML_Source_target_name">
-		</target>
+			name="%HTML_Editors_target_name"/>
+		<target
+			id="org.eclipse.wst.html.SCRIPT"
+			name="%hyperlink.target.script.name"/>
+		<target
+			id="org.eclipse.wst.html.SCRIPT.EVENTHANDLER"
+			name="%hyperlink.target.eventhandler.name"/>
 	</extension>
 	
+	<extension
+		point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
+		<hyperlinkDetector
+			class="org.eclipse.wst.html.ui.internal.hyperlink.AnchorHyperlinkDetector"
+			id="org.eclipse.wst.html.ui.internal.hyperlink.AnchorHyperlinkDetector"
+			name="%hyperlinkDetector.anchor.name"
+			targetId="org.eclipse.core.runtime.xml">
+		</hyperlinkDetector>
+		
+   </extension>
+
 	<extension point="org.eclipse.core.expressions.definitions">
 		<definition id="org.eclipse.wst.html.ui.htmlSourceContributions.definition">
             <with variable="activeContexts">
@@ -579,4 +584,121 @@
             </with>
 		</definition>
 	</extension>
+	
+	<!-- Define theme - Many of the color overrides and definitions come from 
+	     the XML plugin -->
+	<extension
+		point="org.eclipse.ui.themes">
+		<theme
+			id="org.eclipse.ui.ide.systemDefault">
+			<colorOverride
+				id="SCRIPT_AREA_BORDER"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+		</theme>
+		<colorDefinition
+			id="SCRIPT_AREA_BORDER"
+			isEditable="false"
+			label="%Colors.scriptAreaBorder"
+			value="191, 95, 63">
+		</colorDefinition>
+	</extension>
+	
+	<!-- Enable the FormatHandler for HTML Content Type -->
+	<extension point="org.eclipse.ui.handlers">
+		<handler 
+			class="org.eclipse.wst.sse.ui.internal.handlers.FormatHandler"
+			commandId="org.eclipse.wst.sse.ui.format">
+			<activeWhen>
+				<reference definitionId="org.eclipse.wst.html.ui.htmlContentType.definition"></reference>
+			</activeWhen>
+			<enabledWhen>
+				<reference definitionId="org.eclipse.wst.html.ui.htmlContentType.definition"></reference>
+			</enabledWhen>
+		</handler>
+	</extension>
+	
+	<!-- Set up a definition for HTML Content Types -->
+	<extension point="org.eclipse.core.expressions.definitions">
+		<definition id="org.eclipse.wst.html.ui.htmlContentType.definition">
+			<iterate ifEmpty="false">
+				<adapt type="org.eclipse.core.resources.IFile">
+					<!-- Force property tester to load, should not cause entire plug-in to start -->
+					<test property="org.eclipse.wst.sse.core.resources.contentTypeId"
+						value="org.eclipse.wst.html.core.htmlsource" forcePluginActivation="true"/>
+				</adapt>
+			</iterate>
+		</definition>
+	</extension>
+	<extension point="org.eclipse.wst.sse.ui.characterPairing">
+		<inserter class="org.eclipse.wst.html.ui.internal.text.CharacterPairInserter" id="org.eclipse.wst.html.ui.inserter">
+			<contentTypeIdentifier
+				id="org.eclipse.wst.html.core.htmlsource"
+				partitions="org.eclipse.wst.html.HTML_DEFAULT">
+			</contentTypeIdentifier>
+		</inserter>
+	</extension>
+ <extension
+       point="org.eclipse.wst.sse.ui.completionProposal">
+    <proposalCategory
+          icon="icons/full/obj16/tag-generic.gif"
+          id="org.eclipse.wst.html.ui.proposalCategory.htmlTags"
+          name="%proposalCategory.htmlTags">
+    </proposalCategory>
+    <proposalCategory
+          icon="icons/full/obj16/tag-template.gif"
+          id="org.eclipse.wst.html.ui.proposalCategory.htmlTemplates"
+          name="%proposalCategory.htmlTemplates">
+    </proposalCategory>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.wst.html.ui.proposalCategory.htmlTags"
+          class="org.eclipse.wst.html.ui.internal.contentassist.HTMLTagsCompletionProposalComputer"
+          id="org.eclipse.wst.html.ui.proposalComputer.htmlTags">
+       <contentType
+             id="org.eclipse.wst.html.core.htmlsource">
+          <partitionType
+                id="org.eclipse.wst.html.HTML_DEFAULT">
+          </partitionType>
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.wst.html.ui.proposalCategory.htmlTemplates"
+          class="org.eclipse.wst.html.ui.internal.contentassist.HTMLTemplatesCompletionProposalComputer"
+          id="org.eclipse.wst.html.ui.proposalComputer.htmlTemplates">
+       <contentType
+             id="org.eclipse.wst.html.core.htmlsource">
+          <partitionType
+                id="org.eclipse.wst.html.HTML_DEFAULT">
+          </partitionType>
+       </contentType>
+    </proposalComputer>
+    <proposalComputerExtendedActivation
+          id="org.eclipse.wst.css.ui.proposalComputer.css">
+       <contentType
+             id="org.eclipse.wst.html.core.htmlsource">
+          <partitionType
+                id="org.eclipse.wst.css.STYLE">
+          </partitionType>
+       </contentType>
+    </proposalComputerExtendedActivation>
+    <proposalComputerExtendedActivation
+          id="org.eclipse.wst.css.ui.proposalComputer.cssTemplates">
+       <contentType
+             id="org.eclipse.wst.html.core.htmlsource">
+          <partitionType
+                id="org.eclipse.wst.css.STYLE">
+          </partitionType>
+       </contentType>
+    </proposalComputerExtendedActivation>
+ </extension>
+ <extension
+       point="org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration">
+    <categoriesConfiguration
+          class="org.eclipse.wst.html.ui.internal.preferences.HTMLCompletionProposalCategoriesConfiguration"
+          contentTypeID="org.eclipse.wst.html.core.htmlsource">
+    </categoriesConfiguration>
+ </extension>
+	
 </plugin>
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidator.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidator.java
index 37a23c8..dfbf27c 100644
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidator.java
+++ b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidator.java
@@ -25,6 +25,7 @@
 import org.eclipse.core.runtime.IConfigurationElement;
 import org.eclipse.core.runtime.IExecutableExtension;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.OperationCanceledException;
@@ -53,6 +54,9 @@
 import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
 import org.eclipse.wst.sse.core.utils.StringUtils;
 import org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator;
+import org.eclipse.wst.validation.AbstractValidator;
+import org.eclipse.wst.validation.ValidationResult;
+import org.eclipse.wst.validation.ValidationState;
 import org.eclipse.wst.validation.internal.core.Message;
 import org.eclipse.wst.validation.internal.core.ValidationException;
 import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
@@ -66,7 +70,7 @@
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.w3c.dom.Text;
 
-public class HTMLValidator implements IValidatorJob, ISourceValidator, IExecutableExtension {
+public class HTMLValidator extends AbstractValidator implements IValidatorJob, ISourceValidator, IExecutableExtension {
 	private static final String ORG_ECLIPSE_WST_HTML_CORE_HTMLSOURCE = "org.eclipse.wst.html.core.htmlsource"; //$NON-NLS-1$
 
 	static boolean shouldValidate(IFile file) {
@@ -269,7 +273,8 @@
 			}
 
 			if (document == null || !hasHTMLFeature(document)) {
-				model.releaseFromRead();
+				// handled in finally clause
+				// model.releaseFromRead();
 				return; //ignore
 			}
 			
@@ -543,4 +548,13 @@
 			}
 		}
 	}
+
+	public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
+		if (resource.getType() != IResource.FILE)
+			return null;
+		ValidationResult result = new ValidationResult();
+		IReporter reporter = result.getReporter(monitor);
+		validateFile(null, reporter, (IFile) resource);
+		return result;
+	}
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java
index 4da55ee..a38409f 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -25,7 +25,6 @@
 import org.eclipse.jface.text.source.ISourceViewer;
 import org.eclipse.jface.viewers.ILabelProvider;
 import org.eclipse.wst.css.core.text.ICSSPartitions;
-import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
 import org.eclipse.wst.css.ui.internal.style.LineStyleProviderForEmbeddedCSS;
 import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
 import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
@@ -34,8 +33,7 @@
 import org.eclipse.wst.html.core.internal.text.StructuredTextPartitionerForHTML;
 import org.eclipse.wst.html.core.text.IHTMLPartitions;
 import org.eclipse.wst.html.ui.internal.autoedit.AutoEditStrategyForTabs;
-import org.eclipse.wst.html.ui.internal.contentassist.HTMLContentAssistProcessor;
-import org.eclipse.wst.html.ui.internal.contentassist.NoRegionContentAssistProcessorForHTML;
+import org.eclipse.wst.html.ui.internal.contentassist.HTMLStructuredContentAssistProcessor;
 import org.eclipse.wst.html.ui.internal.style.LineStyleProviderForHTML;
 import org.eclipse.wst.sse.core.text.IStructuredPartitions;
 import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
@@ -46,6 +44,7 @@
 import org.eclipse.wst.xml.core.text.IXMLPartitions;
 import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
 import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
+import org.w3c.dom.Attr;
 import org.w3c.dom.Node;
 
 /**
@@ -119,20 +118,12 @@
 		return fConfiguredContentTypes;
 	}
 
-	protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
-		IContentAssistProcessor[] processors = null;
-
-		if ((partitionType == IHTMLPartitions.HTML_DEFAULT) || (partitionType == IHTMLPartitions.HTML_COMMENT)) {
-			processors = new IContentAssistProcessor[]{new HTMLContentAssistProcessor()};
-		}
-		else if (partitionType == ICSSPartitions.STYLE) {
-			processors = new IContentAssistProcessor[]{new CSSContentAssistProcessor()};
-		}
-		else if (partitionType == IStructuredPartitions.UNKNOWN_PARTITION) {
-			processors = new IContentAssistProcessor[]{new NoRegionContentAssistProcessorForHTML()};
-		}
-
-		return processors;
+	protected IContentAssistProcessor[] getContentAssistProcessors(
+			ISourceViewer sourceViewer, String partitionType) {
+		
+		IContentAssistProcessor processor = new HTMLStructuredContentAssistProcessor(
+				this.getContentAssistant(), partitionType, sourceViewer);
+		return new IContentAssistProcessor[]{processor};
 	}
 
 	public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
@@ -203,10 +194,11 @@
 	public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
 		LineStyleProvider[] providers = null;
 
-		if (partitionType == IHTMLPartitions.HTML_DEFAULT || partitionType == IHTMLPartitions.HTML_COMMENT || partitionType == IHTMLPartitions.HTML_DECLARATION) {
+		// workaround IXMLPartitions.XML_PI
+		if (partitionType == IHTMLPartitions.HTML_DEFAULT || partitionType == IHTMLPartitions.HTML_COMMENT || partitionType == IHTMLPartitions.HTML_DECLARATION || partitionType == IXMLPartitions.XML_PI) {
 			providers = new LineStyleProvider[]{getLineStyleProviderForHTML()};
 		}
-		else if (partitionType == ICSSPartitions.STYLE) {
+		else if (partitionType == ICSSPartitions.STYLE || partitionType == ICSSPartitions.COMMENT) {
 			providers = new LineStyleProvider[]{getLineStyleProviderForEmbeddedCSS()};
 		}
 
@@ -231,7 +223,6 @@
 		if (fStatusLineLabelProvider == null) {
 			fStatusLineLabelProvider = new JFaceNodeLabelProvider() {
 				public String getText(Object element) {
-
 					if (element == null)
 						return null;
 
@@ -241,7 +232,12 @@
 						if (node.getNodeType() != Node.DOCUMENT_NODE) {
 							s.insert(0, super.getText(node));
 						}
-						node = node.getParentNode();
+
+						if (node.getNodeType() == Node.ATTRIBUTE_NODE)
+							node = ((Attr) node).getOwnerElement();
+						else
+							node = node.getParentNode();
+					
 						if (node != null && node.getNodeType() != Node.DOCUMENT_NODE) {
 							s.insert(0, IPath.SEPARATOR);
 						}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java
index 6d37c93..71f86b4 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java
@@ -1,5 +1,5 @@
 /**********************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others. All rights reserved.   This
+ * Copyright (c) 2005, 2010 IBM Corporation and others. All rights reserved.   This
  * program and the accompanying materials are made available under the terms of
  * the Eclipse Public License v1.0 which accompanies this distribution, and is
  * available at http://www.eclipse.org/legal/epl-v10.html
@@ -58,6 +58,7 @@
 	public static String NewHTMLTemplatesWizardPage_4;
 	public static String NewHTMLTemplatesWizardPage_5;
 	public static String NewHTMLTemplatesWizardPage_6;
+	public static String NewHTMLTemplatesWizardPage_7;
 	public static String Creating_files_encoding;
 	public static String CleanupDocument_label; // resource bundle
 	public static String CleanupDocument_tooltip; // resource bundle
@@ -83,9 +84,10 @@
 	public static String WebContentSettingsPropertyPage_0;
 	public static String ProjectWebContentSettingsPropertyPage_0;
 	
-	public static String Content_assist_UI_;
+	public static String Auto_Activation_UI_;
 	public static String Automatically_make_suggest_UI_;
 	public static String Prompt_when_these_characte_UI_;
+	public static String Cycling_UI_;
 	public static String Formatting_UI_;
 	public static String Line_width__UI_;
 	public static String Split_multiple_attributes;
@@ -140,6 +142,8 @@
 	public static String HTMLTyping_Complete_Comments;
 	public static String HTMLTyping_Complete_End_Tags;
 	public static String HTMLTyping_Remove_End_Tags;
+	public static String HTMLTyping_Close_Strings;
+	public static String HTMLTyping_Close_Brackets;
 	
 	// below are the strings for the validation page
 	public static String Validation_description;
@@ -184,6 +188,7 @@
 	public static String HTMLValidationPreferencePage_32;
 	public static String HTMLValidationPreferencePage_33;
 	public static String HTMLValidationPreferencePage_34;
+	public static String HTMLValidationPreferencePage_35;
 	public static String HTMLValidationPreferencePage_4;
 	public static String HTMLValidationPreferencePage_5;
 	public static String HTMLValidationPreferencePage_6;
@@ -196,4 +201,8 @@
 	public static String Validation_Workspace;
 	public static String Validation_Project;
 	public static String Validation_jobName;
+	
+	// Hyperlinks
+	public static String Hyperlink_line;
+	public static String Open;
 }
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties
index a069fda..3caf87c 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2008 IBM Corporation and others.
+# Copyright (c) 2004, 2009 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -16,9 +16,9 @@
 
 HTMLFilesPreferencePage_0=Loading files
 #
-_UI_WIZARD_NEW_TITLE = New HTML Page
-_UI_WIZARD_NEW_HEADING = HTML Page
-_UI_WIZARD_NEW_DESCRIPTION = Create a new HTML Page.
+_UI_WIZARD_NEW_TITLE = New HTML File
+_UI_WIZARD_NEW_HEADING = HTML
+_UI_WIZARD_NEW_DESCRIPTION = Create a new HTML file.
 _ERROR_FILENAME_MUST_END_HTML = The file name must end in one of the following extensions {0}.
 _WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT = Files created outside of the Web Content folder will not be included in your deployed Web application. 
 ResourceGroup_nameExists = The same name already exists.
@@ -26,9 +26,10 @@
 NewHTMLTemplatesWizardPage_1=Select a template as initial content in the HTML page.
 NewHTMLTemplatesWizardPage_2=Name
 NewHTMLTemplatesWizardPage_3=Description
-NewHTMLTemplatesWizardPage_4=Use HTML Template
-NewHTMLTemplatesWizardPage_5=Preview
+NewHTMLTemplatesWizardPage_4=&Use HTML Template
+NewHTMLTemplatesWizardPage_5=&Preview:
 NewHTMLTemplatesWizardPage_6=Templates are 'New HTML' templates found in the <a>HTML Templates</a> preference page.
+NewHTMLTemplatesWizardPage_7=&Templates:
 #
 Creating_files_encoding=Creating files encoding preference
 # Copied from sse.ui
@@ -48,9 +49,10 @@
 Creating_files=Creating files
 Encoding_desc=The following encoding will apply:
 ## HTML Source preference page
-Content_assist_UI_=Content assist
+Auto_Activation_UI_=Auto Activation
 Automatically_make_suggest_UI_=Automatically ma&ke suggestions
 Prompt_when_these_characte_UI_=P&rompt when these characters are inserted:
+Cycling_UI_=Cycling
 Formatting_UI_=Formatting
 Line_width__UI_=Line &width:
 Split_multiple_attributes=Split &multiple attributes each on a new line
@@ -93,10 +95,10 @@
 UI_none=none
 UI_CSS_profile___2=CSS profile:
 WebContentSettingsPropertyPage_0=The properties used that cannot or are not specified in web files.  The project setting is used if you specify "none."
-ProjectWebContentSettingsPropertyPage_0=The properties for J2EE Web projects act as "project" default to be looked up when no properties are specified for a particular web file.
+ProjectWebContentSettingsPropertyPage_0=These values are used when the corresponding properties are not specified within a web page.
 SyntaxColoringPage_0=Syntax Element:
 SyntaxColoringPage_2=Enable
-SyntaxColoringPage_3=B&old
+SyntaxColoringPage_3=&Bold
 SyntaxColoringPage_4=&Italic
 SyntaxColoringPage_5=&Strikethrough
 SyntaxColoringPage_6=&Underline
@@ -112,6 +114,8 @@
 HTMLTyping_Auto_Complete=Automatically close
 HTMLTyping_Auto_Remove=Automatically remove
 HTMLTyping_Complete_Comments=&Comments
+HTMLTyping_Close_Strings=A&ttribute values
+HTMLTyping_Close_Brackets=(Parentheses) and [square] brac&kets
 HTMLTyping_Complete_End_Tags=&End tags
 HTMLTyping_Remove_End_Tags=E&nd tags when creating empty self-closing tags
 
@@ -165,8 +169,12 @@
 HTMLValidationPreferencePage_7=Unclosed attribute value:
 HTMLValidationPreferencePage_8=Unknown tag name:
 HTMLValidationPreferencePage_9=Invalid tag name:
+HTMLValidationPreferencePage_35=Attribute value refers to missing resource:
 
 Validation_Title=Validation Settings Changed
 Validation_Workspace=The validation settings have changed. A full validation is required for changes to take effect. Validate now?
 Validation_Project=The validation settings have changed. A validation of the project is required for changes to take effect. Validate the project now?
 Validation_jobName=Validating...
+
+Hyperlink_line={0}={1} : line {2}
+Open=Open ''{0}''
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/StructuredAutoEditStrategyHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/StructuredAutoEditStrategyHTML.java
index 620911b..57e49df 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/StructuredAutoEditStrategyHTML.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/StructuredAutoEditStrategyHTML.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -22,14 +22,26 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.texteditor.ITextEditor;
 import org.eclipse.ui.texteditor.ITextEditorExtension3;
+import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
+import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
+import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
+import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
 import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
 import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
+import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 import org.eclipse.wst.xml.ui.internal.Logger;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
 /**
@@ -51,6 +63,7 @@
 			model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
 			if (model != null) {
 				if (command.text != null) {
+					smartInsertCloseElement(command, document, model);
 					smartInsertForComment(command, document, model);
 					smartInsertForEndTag(command, document, model);
 					smartRemoveEndTag(command, document, model);
@@ -86,13 +99,32 @@
 	private void smartRemoveEndTag(DocumentCommand command, IDocument document, IStructuredModel model) {
 		try {
 			// An opening tag is now a self-terminated end-tag
-			if ("/".equals(command.text) && ">".equals(document.get(command.offset, 1)) && isPreferenceEnabled(HTMLUIPreferenceNames.TYPING_REMOVE_END_TAGS)) { //$NON-NLS-1$ //$NON-NLS-2$
+			if ("/".equals(command.text) && ">".equals(document.get(command.offset, 1)) && command.length == 0 && isPreferenceEnabled(HTMLUIPreferenceNames.TYPING_REMOVE_END_TAGS)) { //$NON-NLS-1$ //$NON-NLS-2$
 				IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset);
 				if (node != null && !node.hasChildNodes()) {
-					IStructuredDocumentRegion region = node.getEndStructuredDocumentRegion();
-
-					if (region != null && region.isEnded())
-						document.replace(region.getStartOffset(), region.getLength(), ""); //$NON-NLS-1$
+					IStructuredDocumentRegion region = node.getFirstStructuredDocumentRegion();
+					if(region.getFirstRegion().getType() == DOMRegionContext.XML_TAG_OPEN && command.offset <= region.getEnd()) {
+						
+						/* if the region before the command offset is a an attribute value region
+						 * check to see if it has both and opening and closing quote
+						 */
+						ITextRegion prevTextRegion = region.getRegionAtCharacterOffset(command.offset-1);
+						boolean inUnclosedAttValueRegion = false;
+						if(prevTextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+							//get the text of the attribute value region
+							String prevText = region.getText(prevTextRegion);
+							inUnclosedAttValueRegion = (prevText.startsWith("'") && ((prevText.length() == 1) || !prevText.endsWith("'"))) ||
+								(prevText.startsWith("\"") && ((prevText.length() == 1) || !prevText.endsWith("\"")));
+						} 
+					
+						//if command offset is in an unclosed attribute value region then done remove the end tag
+						if(!inUnclosedAttValueRegion) {
+							region = node.getEndStructuredDocumentRegion();
+							if (region != null && region.isEnded()) {
+								document.replace(region.getStartOffset(), region.getLength(), ""); //$NON-NLS-1$
+							}
+						}
+					}
 				}
 			}
 		}
@@ -115,6 +147,66 @@
 		}
 
 	}
+	
+	/**
+	 * Attempts to insert the end tag when completing a start-tag with the '&gt;' character.
+	 * 
+	 * @param command
+	 * @param document
+	 * @param model
+	 */
+	private void smartInsertCloseElement(DocumentCommand command, IDocument document, IStructuredModel model) {
+		try {
+			// Check terminating start tag, but ignore empty-element tags
+			if (command.text.equals(">") && document.getLength() > 0 && document.getChar(command.offset - 1) != '/' && isPreferenceEnabled(HTMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS)) { //$NON-NLS-1$
+				IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset - 1);
+				boolean isClosedByParent = false;
+				// Only insert an end-tag if necessary. Because of the way the document is parsed, it is possible for a child tag with the same
+				// name as an ancestor to be paired with the end-tag of an ancestor, so the ancestors must be checked for an unclosed tag.
+				if (node != null && node.getNodeType() == Node.ELEMENT_NODE && (!node.isClosed() || (isClosedByParent = hasUnclosedAncestor(node)))) {
+					IStructuredDocumentRegion region = node.getEndStructuredDocumentRegion();
+					if (region != null && region.getRegions().size() > 0 && region.getRegions().get(0).getType() == DOMRegionContext.XML_END_TAG_OPEN && !isClosedByParent)
+						return;
+					CMElementDeclaration decl = getCMElementDeclaration(node);
+					// If it's XHTML, always generate the end tag
+					if (isXHTML(node) || shouldGenerateEndTag(decl)) {
+						command.text += "</" + getElementName(node, command.offset) + ">"; //$NON-NLS-1$ //$NON-NLS-2$
+						command.shiftsCaret = false;
+						command.caretOffset = command.offset + 1;
+					}
+				}
+				
+			}
+		} catch (BadLocationException e) {
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * Get the element name that will be created by closing the start tag. Defaults
+	 * to the node's nodeName.
+	 * @param node the node that is being edited
+	 * @param offset the offset in the document where the start tag is closed
+	 * @return The element name of the tag
+	 */
+	private String getElementName(IDOMNode node, int offset) {
+		String name = null;
+		
+		IStructuredDocumentRegion region = node.getFirstStructuredDocumentRegion();
+		ITextRegion textRegion = region.getRegionAtCharacterOffset(offset);
+		if (textRegion != null && textRegion.getType() == DOMRegionContext.XML_TAG_NAME) {
+			int nameStart = region.getStartOffset(textRegion);
+			String regionText = region.getText(textRegion);
+			int length = offset - nameStart;
+			if (length <= regionText.length())
+				name = regionText.substring(0, length);
+		}
+		
+		// Default to the node name
+		if (name == null)
+			name = node.getNodeName();
+		return name;
+	}
 
 	private void smartInsertForEndTag(DocumentCommand command, IDocument document, IStructuredModel model) {
 		try {
@@ -131,7 +223,18 @@
 					// only add end tag if one does not already exist or if
 					// add '/' does not create one already
 					IStructuredDocumentRegion endTagStructuredDocumentRegion = parentNode.getEndStructuredDocumentRegion();
-					if (endTagStructuredDocumentRegion == null) {
+					IDOMNode ancestor = parentNode;
+					boolean smartInsertForEnd = false;
+					if(endTagStructuredDocumentRegion != null) {
+						// Look for ancestors by the same name that are missing end tags
+						while((ancestor = (IDOMNode) ancestor.getParentNode()) != null) {
+							if(ancestor.getEndStructuredDocumentRegion() == null && parentNode.getNodeName().equals(ancestor.getNodeName())) {
+								smartInsertForEnd = true;
+								break;
+							}
+						}
+					}
+					if (endTagStructuredDocumentRegion == null || smartInsertForEnd) {
 						StringBuffer toAdd = new StringBuffer(parentNode.getNodeName());
 						if (toAdd.length() > 0) {
 							toAdd.append(">"); //$NON-NLS-1$
@@ -150,6 +253,76 @@
 	}
 
 	/**
+	 * Checks if <code>node</code> has an unclosed ancestor by the same name
+	 * 
+	 * @param node the node to check
+	 * @return true if <code>node</code> has an unclosed parent with the same node name
+	 */
+	private boolean hasUnclosedAncestor(IDOMNode node) {
+		IDOMNode parent = (IDOMNode) node.getParentNode();
+		while (parent != null && parent.getNodeType() != Node.DOCUMENT_NODE && parent.getNodeName().equals(node.getNodeName())) {
+			if (!parent.isClosed())
+				return true;
+			parent = (IDOMNode) parent.getParentNode();
+		}
+		return false;
+	}
+
+	/**
+	 * Based on the content model, determine if an end tag should be generated
+	 * @param elementDecl the content model element declaration
+	 * @return true if the end tag should be generated; false otherwise.
+	 */
+	private boolean shouldGenerateEndTag(CMElementDeclaration elementDecl) {
+		if (elementDecl == null)
+			return false;
+		if (elementDecl instanceof HTMLElementDeclaration) {
+			if (((Boolean) elementDecl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue()) {
+				if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
+					return false;
+			}
+			else {
+				String ommission = (String) elementDecl.getProperty(HTMLCMProperties.OMIT_TYPE);
+				if (ommission.equals(HTMLCMProperties.Values.OMIT_END) || ommission.equals(HTMLCMProperties.Values.OMIT_END_DEFAULT) || ommission.equals(HTMLCMProperties.Values.OMIT_END_MUST)) {
+					return false;
+				}
+			}
+		}
+
+		if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
+			return false;
+		return true;
+	}
+
+	private CMElementDeclaration getCMElementDeclaration(Node node) {
+		CMElementDeclaration result = null;
+		if (node.getNodeType() == Node.ELEMENT_NODE) {
+			ModelQuery modelQuery = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
+			if (modelQuery != null) {
+				result = modelQuery.getCMElementDeclaration((Element) node);
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * Is the node part of an XHTML document
+	 * @param node
+	 * @return
+	 */
+	private boolean isXHTML(Node node) {
+		Document doc = node.getOwnerDocument();
+		if (!(doc instanceof IDOMDocument))
+			return false;
+		String typeid = ((IDOMDocument) doc).getDocumentTypeId();
+		if (typeid != null) {
+			HTMLDocumentTypeEntry entry = HTMLDocumentTypeRegistry.getInstance().getEntry(typeid);
+			return (entry != null && entry.isXMLType());
+		}
+		return false;
+	}
+	
+	/**
 	 * Return the active text editor if possible, otherwise the active editor
 	 * part.
 	 * 
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 10517f6..63c2ced 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, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -42,7 +42,6 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.sse.ui.internal.IReleasable;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
 import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
 import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
@@ -63,6 +62,10 @@
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
+/**
+ * @deprecated This class is no longer used locally and will be removed in the future
+ * @see HTMLStructuredContentAssistProcessor
+ */
 public class HTMLContentAssistProcessor extends AbstractContentAssistProcessor implements IPropertyChangeListener {
 	private INodeAdapterFactory factoryForCSS = null;
 	protected IPreferenceStore fPreferenceStore = null;
@@ -217,7 +220,7 @@
 		// handle blank HTML document case
 		if (treeNode == null || isViewerEmpty(textViewer)) {
 			// cursor is at the EOF
-			ICompletionProposal htmlTagProposal = getHTMLTagProposal((StructuredTextViewer) textViewer, documentPosition);
+			ICompletionProposal htmlTagProposal = getHTMLTagProposal(textViewer, documentPosition);
 			ICompletionProposal[] superResults = super.computeCompletionProposals(textViewer, documentPosition);
 			if (superResults != null && superResults.length > 0 && htmlTagProposal != null) {
 				ICompletionProposal[] blankHTMLDocResults = new ICompletionProposal[superResults.length + 1];
@@ -327,7 +330,7 @@
 	/**
 	 * @return ICompletionProposal
 	 */
-	private ICompletionProposal getHTMLTagProposal(StructuredTextViewer viewer, int documentPosition) {
+	private ICompletionProposal getHTMLTagProposal(ITextViewer viewer, int documentPosition) {
 		IModelManager mm = StructuredModelManager.getModelManager();
 		IStructuredModel model = null;
 		ICompletionProposal result = null;
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java
index 53035f6..0bdd85f 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
  *******************************************************************************/
 package org.eclipse.wst.html.ui.internal.contentassist;
 
-import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
 import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
 import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
@@ -34,10 +34,9 @@
 	}
 
 	private void init() {
-		//IPreferenceStore prefs = CommonPreferencesPlugin.getDefault().getPreferenceStore(ContentType.ContentTypeID_HTML);
-		Preferences prefs = HTMLCorePlugin.getDefault().getPluginPreferences();
-		fTagCase = prefs.getInt(HTMLCorePreferenceNames.TAG_NAME_CASE);
-		fAttrCase = prefs.getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE);
+		String qualifier = HTMLCorePlugin.getDefault().getBundle().getSymbolicName();
+		fTagCase = Platform.getPreferencesService().getInt(qualifier, HTMLCorePreferenceNames.TAG_NAME_CASE, 0, null);
+		fAttrCase = Platform.getPreferencesService().getInt(qualifier, HTMLCorePreferenceNames.ATTR_NAME_CASE, 0, null);
 	}
 
 	protected void generateEndTag(String tagName, Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer) {
@@ -111,6 +110,11 @@
 				}
 			}
 		}
+		
+		//if not an html element and empty, assume start tag needs to be closed
+		else if (elementDecl.getContentType() == CMElementDeclaration.EMPTY) {
+			return "/>"; //$NON-NLS-1$
+		}
 
 		return ">"; //$NON-NLS-1$
 	}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLStructuredContentAssistProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLStructuredContentAssistProcessor.java
new file mode 100644
index 0000000..034615c
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLStructuredContentAssistProcessor.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentassist;
+
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
+import org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor;
+import org.eclipse.wst.xml.ui.internal.contentassist.AttributeContextInformationPresenter;
+
+/**
+ * <p>Implementation of {@link StructuredContentAssistProcessor} for HTML documents</p>
+ * 
+ * <p>This implementation will react to user preference changes for auto activation
+ * characters for HTML pages</p>
+ */
+public class HTMLStructuredContentAssistProcessor extends StructuredContentAssistProcessor {
+	/** the auto activation characters for this processor, set by user preference */
+	private char[] fCompletionPropoaslAutoActivationCharacters;
+
+	/** the context information validator for this processor */
+	private IContextInformationValidator fContextInformationValidator;
+	
+	/**
+	 * <p>Constructor</p>
+	 * 
+	 * @param assistant {@link ContentAssistant} to use
+	 * @param partitionTypeID the partition type this processor is for
+	 * @param viewer {@link ITextViewer} this processor is acting in
+	 */
+	public HTMLStructuredContentAssistProcessor(ContentAssistant assistant,
+			String partitionTypeID, ITextViewer viewer) {
+		
+		super(assistant, partitionTypeID, viewer, HTMLUIPlugin.getDefault().getPreferenceStore());
+		getAutoActivationCharacterPreferences();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#getContextInformationValidator()
+	 */
+	public IContextInformationValidator getContextInformationValidator() {
+		if (this.fContextInformationValidator == null) {
+			this.fContextInformationValidator = new AttributeContextInformationPresenter();
+		}
+		return this.fContextInformationValidator;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
+	 */
+	public char[] getCompletionProposalAutoActivationCharacters() {
+		return this.fCompletionPropoaslAutoActivationCharacters;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#propertyChange(
+	 * 	org.eclipse.jface.util.PropertyChangeEvent)
+	 */
+	public void propertyChange(PropertyChangeEvent event) {
+		if(event.getProperty().equals(HTMLUIPreferenceNames.AUTO_PROPOSE) ||
+				event.getProperty().equals(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE)) {
+			getAutoActivationCharacterPreferences();
+		}
+	}
+	
+	/**
+	 * <p>Gets the auto activation character user preferences and stores them for later use</p>
+	 */
+	private void getAutoActivationCharacterPreferences() {
+		String key = HTMLUIPreferenceNames.AUTO_PROPOSE;
+		boolean doAuto = getPreferenceStore().getBoolean(key);
+		if (doAuto) {
+			key = HTMLUIPreferenceNames.AUTO_PROPOSE_CODE;
+			this.fCompletionPropoaslAutoActivationCharacters = getPreferenceStore().getString(key).toCharArray();
+		}
+		else {
+			this.fCompletionPropoaslAutoActivationCharacters = null;
+		}
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTagsCompletionProposalComputer.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTagsCompletionProposalComputer.java
new file mode 100644
index 0000000..337e2e6
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTagsCompletionProposalComputer.java
@@ -0,0 +1,338 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentassist;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.wst.html.core.internal.contentmodel.HTMLAttributeDeclaration;
+import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocument;
+import org.eclipse.wst.html.core.internal.contentmodel.HTMLPropertyDeclaration;
+import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
+import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
+import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
+import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
+import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMElementDeclarationImpl;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
+import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
+import org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer;
+import org.eclipse.wst.xml.ui.internal.contentassist.AttributeContextInformationPresenter;
+import org.eclipse.wst.xml.ui.internal.contentassist.AttributeContextInformationProvider;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
+import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
+import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.Node;
+
+/**
+ * <p>{@link AbstractXMLModelQueryCompletionProposalComputer} for HTML tag proposals</p>
+ */
+public class HTMLTagsCompletionProposalComputer extends
+		AbstractXMLModelQueryCompletionProposalComputer {
+	
+	/** <code>true</code> if the document the proposal request is on is XHTML */
+	protected boolean isXHTML = false;
+	
+	/** the context information validator for this computer */
+	private IContextInformationValidator fContextInformationValidator;
+	
+	/**
+	 * TODO: IAN: Comment me
+	 */
+	public HTMLTagsCompletionProposalComputer() {
+		this.fContextInformationValidator = null;
+	}
+	
+	/**
+	 * <p>Determine if the document is XHTML or not, then compute the proposals</p>
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeCompletionProposals(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		//determine if the content is XHTML or not
+		IndexedRegion treeNode = ContentAssistUtils.getNodeAt(context.getViewer(),
+				context.getInvocationOffset());
+		IDOMNode node = (IDOMNode) treeNode;
+		boolean isXHTMLNode = isXHTMLNode(node);
+		if(this.isXHTML != isXHTMLNode) {
+			this.isXHTML = isXHTMLNode;
+		}
+		
+		//compute the completion proposals
+		return super.computeCompletionProposals(context, monitor);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeContextInformation(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeContextInformation(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		AttributeContextInformationProvider attributeInfoProvider =
+			new AttributeContextInformationProvider((IStructuredDocument)context.getDocument(),
+					(AttributeContextInformationPresenter) getContextInformationValidator());
+		return Arrays.asList(attributeInfoProvider.getAttributeInformation(context.getInvocationOffset()));
+	}
+	
+	/**
+	 * <p>Dependent on if the document is XHTML or not</p>
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#getContentGenerator()
+	 */
+	protected XMLContentModelGenerator getContentGenerator() {
+		if (isXHTML) {
+			return XHTMLMinimalContentModelGenerator.getInstance();
+		} else {
+			return HTMLMinimalContentModelGenerator.getInstance();
+		}
+	}
+	
+	/**
+	 * <p>Filter out all {@link CMNode}s except those specific to HTML documents</p>
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#validModelQueryNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode)
+	 */
+	protected boolean validModelQueryNode(CMNode node) {
+		boolean isValid = false;
+		Object cmdoc = node.getProperty("CMDocument"); //$NON-NLS-1$
+		if (cmdoc instanceof CMNode) {
+			String name = ((CMNode) cmdoc).getNodeName();
+			isValid = name != null && name.endsWith(".dtd") && name.indexOf("html") != -1; //$NON-NLS-1$ //$NON-NLS-2$
+		} else if (node.supports(HTMLAttributeDeclaration.IS_HTML)) {
+			Boolean isHTML = (Boolean) node.getProperty(HTMLAttributeDeclaration.IS_HTML);
+			isValid = isHTML == null || isHTML.booleanValue();
+		} else if(node instanceof HTMLPropertyDeclaration) {
+			HTMLPropertyDeclaration propDec = (HTMLPropertyDeclaration)node;
+			isValid = !propDec.isJSP();
+		} else if (node instanceof CMAttributeDeclaration || node instanceof CMElementDeclarationImpl) {
+			isValid = true;
+		} else if(node instanceof CMElementDeclaration) {
+			Boolean isXHTML = ((Boolean)node.getProperty(HTMLCMProperties.IS_XHTML));
+			isValid = isXHTML != null && isXHTML.booleanValue();
+		}
+
+		// Do not propose obsolete tags, regardless
+		if (isValid && node.supports(HTMLCMProperties.IS_OBSOLETE)) {
+			Boolean isObsolete = ((Boolean) node.getProperty(HTMLCMProperties.IS_OBSOLETE));
+			isValid = !(isObsolete != null && isObsolete.booleanValue());
+		}
+
+		return isValid;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#addEmptyDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addEmptyDocumentProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		addHTMLTagProposal(contentAssistRequest, context);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#addStartDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addStartDocumentProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		//determine if XMLPI is first element
+		Node aNode = contentAssistRequest.getNode();
+		Document owningDocument = aNode.getOwnerDocument();
+		Node first = owningDocument.getFirstChild();
+		boolean xmlpiIsFirstElement = ((first != null) && (first.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE));
+		
+		//if there is an XMLPI then XHTML doctype, else HTML doctype
+		if (xmlpiIsFirstElement && (owningDocument.getDoctype() == null) &&
+				isCursorAfterXMLPI(contentAssistRequest)) {
+			
+			addDocTypeProposal(contentAssistRequest, true);
+		} else {
+			addDocTypeProposal(contentAssistRequest,  false);
+		}
+	}
+	
+	/**
+	 * 
+	 * @param contentAssistRequest
+	 * @param isXHTML
+	 */
+	private void addDocTypeProposal(ContentAssistRequest contentAssistRequest, boolean isXHTML) {
+		// if a DocumentElement exists, use that for the root Element name
+		String rootname = "unspecified"; //$NON-NLS-1$
+		if (contentAssistRequest.getNode().getOwnerDocument().getDocumentElement() != null) {
+			rootname = contentAssistRequest.getNode().getOwnerDocument().getDocumentElement().getNodeName();
+		}
+		
+		//decide which entry to use
+		HTMLDocumentTypeEntry entry;
+		if(isXHTML) {
+			entry = HTMLDocumentTypeRegistry.getInstance().getXHTMLDefaultEntry();
+		} else {
+			entry = HTMLDocumentTypeRegistry.getInstance().getDefaultEntry();
+		}
+
+		//create the content assist string and proposal
+		String proposedText = "<!DOCTYPE " + rootname + " PUBLIC \"" + //$NON-NLS-1$ //$NON-NLS-2$
+				entry.getPublicId() + "\" \"" + entry.getSystemId() + "\">"; //$NON-NLS-1$ //$NON-NLS-2$
+		ICompletionProposal proposal = new CustomCompletionProposal(
+				proposedText, contentAssistRequest.getReplacementBeginPosition(),
+				contentAssistRequest.getReplacementLength(), 10,
+				XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_DOCTYPE),
+				entry.getDisplayName() + " " + HTMLUIMessages.Expandable_label_document_type, //$NON-NLS-1$ 
+				null, null, XMLRelevanceConstants.R_DOCTYPE);
+		contentAssistRequest.addProposal(proposal);
+	}
+	
+	/**
+	 * <p>adds HTML tag proposal for empty document</p>
+	 * 
+	 * @param contentAssistRequest request to add proposal too
+	 * @param context context of the completion request
+	 */
+	private void addHTMLTagProposal(ContentAssistRequest contentAssistRequest, CompletionProposalInvocationContext context) {
+		IStructuredModel model = null;
+		try {
+			if(context.getDocument() instanceof IStructuredDocument) {
+				model = StructuredModelManager.getModelManager().getModelForRead((IStructuredDocument)context.getDocument());
+			}
+			if (model != null) {
+				IDOMDocument doc = ((IDOMModel) model).getDocument();
+
+				ModelQuery mq = ModelQueryUtil.getModelQuery(doc);
+				if (mq != null) {
+
+					// XHTML requires lowercase tagname for lookup
+					CMDocument correspondingCMDocument = mq.getCorrespondingCMDocument(doc);
+					if (correspondingCMDocument != null) {
+						CMElementDeclaration htmlDecl = (CMElementDeclaration) correspondingCMDocument.getElements().getNamedItem(HTML40Namespace.ElementName.HTML.toLowerCase());
+						if (htmlDecl != null) {
+							StringBuffer proposedTextBuffer = new StringBuffer();
+							getContentGenerator().generateTag(doc, htmlDecl, proposedTextBuffer);
+
+							String proposedText = proposedTextBuffer.toString();
+							String requiredName = getContentGenerator().getRequiredName(doc, htmlDecl);
+							
+							IStructuredDocumentRegion region = contentAssistRequest.getDocumentRegion();
+							if (region != null) {
+								if (region.getFirstRegion() != null && 
+										region.getFirstRegion().getType().equals(DOMRegionContext.XML_TAG_OPEN)) {
+									//in order to differentiate between content assist on 
+									//completely empty document and the one with xml open tag
+									proposedText = proposedText.substring(1);
+								}
+							}
+							if (!beginsWith(proposedText, contentAssistRequest.getMatchString())) {
+								return;
+							}
+							int cursorAdjustment = getCursorPositionForProposedText(proposedText);
+							CustomCompletionProposal proposal = new CustomCompletionProposal(
+									proposedText, contentAssistRequest.getReplacementBeginPosition(),
+									contentAssistRequest.getReplacementLength(), cursorAdjustment, 
+									HTMLEditorPluginImageHelper.getInstance().getImage(HTMLEditorPluginImages.IMG_OBJ_TAG_GENERIC),
+									requiredName, null, null, XMLRelevanceConstants.R_TAG_NAME);
+							contentAssistRequest.addProposal(proposal);
+						}
+					}
+				}
+			}
+		}
+		finally {
+			if (model != null)
+				model.releaseFromRead();
+		}
+	}
+	
+	/**
+	 * Determine if this Document is an XHTML Document. Operates solely off of
+	 * the Document Type declaration
+	 */
+	private static boolean isXHTMLNode(Node node) {
+		if (node == null) {
+			return false;
+		}
+
+		Document doc = null;
+		if (node.getNodeType() != Node.DOCUMENT_NODE)
+			doc = node.getOwnerDocument();
+		else
+			doc = ((Document) node);
+
+		if (doc instanceof IDOMDocument) {
+			return ((IDOMDocument) doc).isXMLType();
+		}
+
+		if (doc instanceof INodeNotifier) {
+			ModelQueryAdapter adapter = (ModelQueryAdapter) ((INodeNotifier) doc).getAdapterFor(ModelQueryAdapter.class);
+			CMDocument cmdoc = null;
+			if (adapter != null && adapter.getModelQuery() != null)
+				cmdoc = adapter.getModelQuery().getCorrespondingCMDocument(doc);
+			if (cmdoc != null) {
+				// treat as XHTML unless we've got the in-code HTML content
+				// model
+				if (cmdoc instanceof HTMLCMDocument)
+					return false;
+				if (cmdoc.supports(HTMLCMProperties.IS_XHTML))
+					return Boolean.TRUE.equals(cmdoc.getProperty(HTMLCMProperties.IS_XHTML));
+			}
+		}
+		// this should never be reached
+		DocumentType docType = doc.getDoctype();
+		return docType != null && docType.getPublicId() != null && docType.getPublicId().indexOf("-//W3C//DTD XHTML ") == 0; //$NON-NLS-1$
+	}
+	
+	/**
+	 * Returns a validator used to determine when displayed context
+	 * information should be dismissed. May only return <code>null</code> if
+	 * the processor is incapable of computing context information.
+	 * 
+	 * a context information validator, or <code>null</code> if the
+	 * processor is incapable of computing context information
+	 */
+	private IContextInformationValidator getContextInformationValidator() {
+		if (fContextInformationValidator == null) {
+			fContextInformationValidator = new AttributeContextInformationPresenter();
+		}
+		return fContextInformationValidator;
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java
index 6d9d6fa..25d9a43 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, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -36,13 +36,9 @@
 
 
 /**
- * Completion processor for HTML Templates. Most of the work is already done
- * by the HTML Content Assist processor, so by the time the
- * HTMLTemplateCompletionProcessor is asked for content assist proposals, the
- * HTML content assist processor has already set the context type for
- * templates.
+ * <p>Completion computer for HTML templates</p>
  */
-class HTMLTemplateCompletionProcessor extends TemplateCompletionProcessor {
+public class HTMLTemplateCompletionProcessor extends TemplateCompletionProcessor {
 	private static final class ProposalComparator implements Comparator {
 		public int compare(Object o1, Object o2) {
 			return ((TemplateProposal) o2).getRelevance() - ((TemplateProposal) o1).getRelevance();
@@ -158,7 +154,7 @@
 		return HTMLUIPlugin.getDefault().getTemplateStore();
 	}
 
-	void setContextType(String contextTypeId) {
+	public void setContextType(String contextTypeId) {
 		fContextTypeId = contextTypeId;
 	}
 }
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplatesCompletionProposalComputer.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplatesCompletionProposalComputer.java
new file mode 100644
index 0000000..2fe72d1
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplatesCompletionProposalComputer.java
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeIdsHTML;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer;
+
+/**
+ * <p>XML type proposal computer to create HTML template proposals</p>
+ */
+public class HTMLTemplatesCompletionProposalComputer extends
+		DefaultXMLCompletionProposalComputer {
+
+	/** template processor used to create template proposals */
+	private HTMLTemplateCompletionProcessor fTemplateProcessor = null;
+
+	/**
+	 * <p>Create the computer</p>
+	 */
+	public HTMLTemplatesCompletionProposalComputer() {
+		fTemplateProcessor = new HTMLTemplateCompletionProcessor();
+	}
+
+	/**
+	 * <p>Calls super to add templates based on context and then
+	 * adds templates not specific to a context</p>
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeCompletionProposals(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		//get the templates specific to the context
+		List proposals = new ArrayList(super.computeCompletionProposals(context, monitor));
+		
+		//get templates not specific to the context
+		proposals.addAll(this.getTemplateProposals(TemplateContextTypeIdsHTML.ALL, context));
+		
+		return proposals;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeNameProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.ATTRIBUTE, context);
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeValueProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.ATTRIBUTE_VALUE, context);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addEmptyDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addEmptyDocumentProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.NEW, context);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addTagInsertionProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addTagInsertionProposals(
+			ContentAssistRequest contentAssistRequest, int childPosition,
+			CompletionProposalInvocationContext context) {
+		
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.TAG, context);
+	}
+	
+	/**
+	 * <p>Get the template proposals from the template processor</p>
+	 * 
+	 * @param templateContext
+	 * @param context
+	 * @return
+	 */
+	private List getTemplateProposals(String templateContext,
+			CompletionProposalInvocationContext context) {
+		
+		List templateProposals = new ArrayList();
+		
+		if (fTemplateProcessor != null) {
+			fTemplateProcessor.setContextType(templateContext);
+			ICompletionProposal[] proposals =
+				fTemplateProcessor.computeCompletionProposals(context.getViewer(), context.getInvocationOffset());
+		
+			templateProposals.addAll(Arrays.asList(proposals));
+		}
+		
+		return templateProposals;
+	}
+	
+	/**
+	 * Adds templates to the list of proposals
+	 * 
+	 * @param contentAssistRequest
+	 * @param templateContext
+	 * @param context
+	 */
+	private void addTemplates(ContentAssistRequest contentAssistRequest, String templateContext,
+			CompletionProposalInvocationContext context) {
+		
+		if (contentAssistRequest != null) {
+			boolean useProposalList = !contentAssistRequest.shouldSeparate();
+			List proposals = this.getTemplateProposals(templateContext, context);
+	
+			for (int i = 0; i < proposals.size(); ++i) {
+				if (useProposalList) {
+					contentAssistRequest.addProposal((ICompletionProposal)proposals.get(i));
+				}
+				else {
+					contentAssistRequest.addMacro((ICompletionProposal)proposals.get(i));
+				}
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/ReplaceNameTemplateContext.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/ReplaceNameTemplateContext.java
index eef8962..764a915 100644
--- 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@
 import org.eclipse.jface.text.templates.TemplateBuffer;
 import org.eclipse.jface.text.templates.TemplateContextType;
 import org.eclipse.jface.text.templates.TemplateException;
+import org.eclipse.jface.text.templates.TemplateVariable;
 
 /**
  * Just like DocumentTemplateContext except if an insert offset is passed in,
@@ -95,7 +96,15 @@
 				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());
+					int prefixSize = prefix.length();
+					TemplateVariable[] newTemplateVar = buffer.getVariables();
+					for (int i =0; i < newTemplateVar.length; i++ ){
+						int[] offsets = newTemplateVar[i].getOffsets();
+						for (int j=0; j<offsets.length ;j++){
+							offsets[j] += prefixSize;
+						}
+					}
+					buffer = new TemplateBuffer(prefix + buffer.getString(), newTemplateVar);
 				}
 			}
 		}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterForHTML.java
index d38bcf4..1b494c5 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterForHTML.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterForHTML.java
@@ -12,6 +12,8 @@
 
 
 
+import java.util.Locale;
+
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
 import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
@@ -42,25 +44,26 @@
 
 		Node node = (Node) object;
 		if (node.getNodeType() == Node.ELEMENT_NODE) {
-			if (node.getNodeName().equalsIgnoreCase("table")) //$NON-NLS-1$
+			String lowerName = node.getNodeName().toLowerCase(Locale.US);
+			if (lowerName.equals("table") || lowerName.endsWith(":table")) //$NON-NLS-1$
 				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TABLE);
-			else if (node.getNodeName().equalsIgnoreCase("a")) //$NON-NLS-1$
+			else if (lowerName.equals("a") || lowerName.endsWith(":a")) //$NON-NLS-1$
 				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_ANCHOR);
-			else if (node.getNodeName().equalsIgnoreCase("body")) //$NON-NLS-1$
+			else if (lowerName.equals("body") || lowerName.endsWith(":body")) //$NON-NLS-1$
 				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_BODY);
-			else if (node.getNodeName().equalsIgnoreCase("button")) //$NON-NLS-1$
+			else if (lowerName.equals("button") || lowerName.endsWith(":button")) //$NON-NLS-1$
 				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_BUTTON);
-			else if (node.getNodeName().equalsIgnoreCase("font")) //$NON-NLS-1$
+			else if (lowerName.equals("font") || lowerName.endsWith(":font")) //$NON-NLS-1$
 				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_FONT);
-			else if (node.getNodeName().equalsIgnoreCase("form")) //$NON-NLS-1$
+			else if (lowerName.equals("form") || lowerName.endsWith(":form")) //$NON-NLS-1$
 				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_FORM);
-			else if (node.getNodeName().equalsIgnoreCase("html")) //$NON-NLS-1$
+			else if (lowerName.equals("html") || lowerName.endsWith(":html")) //$NON-NLS-1$
 				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_HTML);
-			else if (node.getNodeName().equalsIgnoreCase("img")) //$NON-NLS-1$
+			else if (lowerName.equals("img") || lowerName.endsWith(":img")) //$NON-NLS-1$
 				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_IMAGE);
-			else if (node.getNodeName().equalsIgnoreCase("map")) //$NON-NLS-1$
+			else if (lowerName.equals("map") || lowerName.endsWith(":map")) //$NON-NLS-1$
 				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_IMAGE_MAP);
-			else if (node.getNodeName().equalsIgnoreCase("title")) //$NON-NLS-1$
+			else if (lowerName.equals("title") || lowerName.endsWith(":title")) //$NON-NLS-1$
 				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_TITLE);
 			else
 				image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG);
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/WebContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/WebContentSettingsPropertyPage.java
index 1ef88f0..7f0d67e 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/WebContentSettingsPropertyPage.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/WebContentSettingsPropertyPage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -107,7 +107,7 @@
 
 	private void createCSSProfileContents(Composite parent) {
 		// CSS Profile
-		Text languageLabel = new Text(parent, SWT.READ_ONLY);
+		Label languageLabel = new Label(parent, SWT.NONE);
 		languageLabel.setText(HTMLUIMessages.UI_CSS_profile___2);
 		fProfileCombo = new Combo(parent, SWT.READ_ONLY);
 		GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
@@ -125,7 +125,7 @@
 		doctypeLabel.setLayoutData(data);
 
 		// document type
-		Text languageLabel = new Text(parent, SWT.READ_ONLY);
+		Label languageLabel = new Label(parent, SWT.NONE);
 		languageLabel.setText(HTMLUIMessages.UI_Default_HTML_DOCTYPE_ID___1);
 		fDocumentTypeCombo = new Combo(parent, SWT.READ_ONLY);
 		data = new GridData(GridData.FILL, GridData.FILL, true, false);
@@ -133,7 +133,7 @@
 		fDocumentTypeCombo.setLayoutData(data);
 
 		// public ID
-		Text publicIdLabel = new Text(parent, SWT.READ_ONLY);
+		Label publicIdLabel = new Label(parent, SWT.NONE);
 		publicIdLabel.setText(HTMLUIMessages.UI_Public_ID);
 		fPublicIdText = new Text(parent, SWT.READ_ONLY | SWT.BORDER);
 		data = new GridData(GridData.FILL, GridData.FILL, true, false);
@@ -141,7 +141,7 @@
 		fPublicIdText.setLayoutData(data);
 
 		// system ID
-		Text systemIdLabel = new Text(parent, SWT.READ_ONLY);
+		Label systemIdLabel = new Label(parent, SWT.NONE);
 		systemIdLabel.setText(HTMLUIMessages.UI_System_ID);
 		fSystemIdText = new Text(parent, SWT.READ_ONLY | SWT.BORDER);
 		data = new GridData(GridData.FILL, GridData.FILL, true, false);
@@ -155,6 +155,7 @@
 		data.horizontalSpan = 2;
 		data.verticalSpan = 8;
 		label.setLayoutData(data);
+
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDialogHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDialogHTML.java
index 572fe19..9764210 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDialogHTML.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDialogHTML.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -28,6 +28,7 @@
 import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
 import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
 import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
 
 public class CleanupDialogHTML extends Dialog implements SelectionListener {
 
@@ -37,6 +38,7 @@
 	protected Button fRadioButtonAttrNameCaseAsis;
 	protected Button fRadioButtonAttrNameCaseLower;
 	protected Button fRadioButtonAttrNameCaseUpper;
+	protected Button fCheckBoxCompressEmptyElementTags;
 	protected Button fCheckBoxInsertRequiredAttrs;
 	protected Button fCheckBoxInsertMissingTags;
 	protected Button fCheckBoxQuoteAttrValues;
@@ -118,6 +120,11 @@
 		layout.makeColumnsEqualWidth = true;
 		composite.setLayout(layout);
 
+		// Compress empty element tags
+		fCheckBoxCompressEmptyElementTags = new Button(composite, SWT.CHECK);
+		fCheckBoxCompressEmptyElementTags.setText(XMLUIMessages.Compress_empty_element_tags_UI_);
+		fCheckBoxCompressEmptyElementTags.addSelectionListener(this);
+
 		// Insert missing required attrs
 		fCheckBoxInsertRequiredAttrs = new Button(composite, SWT.CHECK);
 		fCheckBoxInsertRequiredAttrs.setText(HTMLUIMessages.Insert_required_attributes_UI_);
@@ -196,6 +203,7 @@
 	protected void initializeOptions() {
 		initializeOptionsForHTML();
 
+		fCheckBoxCompressEmptyElementTags.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS));
 		fCheckBoxInsertRequiredAttrs.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
 		fCheckBoxInsertMissingTags.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.INSERT_MISSING_TAGS));
 		fCheckBoxQuoteAttrValues.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES));
@@ -235,6 +243,7 @@
 	protected void storeOptions() {
 		storeOptionsForHTML();
 
+		getModelPreferences().setValue(HTMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS, fCheckBoxCompressEmptyElementTags.getSelection());
 		getModelPreferences().setValue(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS, fCheckBoxInsertRequiredAttrs.getSelection());
 		getModelPreferences().setValue(HTMLCorePreferenceNames.INSERT_MISSING_TAGS, fCheckBoxInsertMissingTags.getSelection());
 		getModelPreferences().setValue(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES, fCheckBoxQuoteAttrValues.getSelection());
@@ -308,7 +317,13 @@
 		boolean tagNameCaseCheck = ((fRadioButtonTagNameCaseUpper != null && fRadioButtonTagNameCaseUpper.getSelection()) || fRadioButtonTagNameCaseLower.getSelection());
 		boolean attrNameCaseCheck = ((fRadioButtonAttrNameCaseUpper != null && fRadioButtonAttrNameCaseUpper.getSelection()) || fRadioButtonAttrNameCaseLower.getSelection());
 		boolean eolCheck = fCheckBoxConvertEOLCodes.getSelection() && (fRadioButtonConvertEOLUnix.getSelection() || fRadioButtonConvertEOLMac.getSelection() || fRadioButtonConvertEOLWindows.getSelection());
-		boolean buttonEnabled = tagNameCaseCheck || attrNameCaseCheck || fCheckBoxInsertMissingTags.getSelection() || fCheckBoxQuoteAttrValues.getSelection() || fCheckBoxFormatSource.getSelection() || eolCheck;
+		boolean buttonEnabled = false;
+		if (isXHTMLType()){
+			buttonEnabled = fCheckBoxInsertRequiredAttrs.getSelection() || fCheckBoxInsertMissingTags.getSelection() || fCheckBoxQuoteAttrValues.getSelection() || fCheckBoxFormatSource.getSelection() || eolCheck;
+		}
+		else {
+			buttonEnabled = tagNameCaseCheck || attrNameCaseCheck || fCheckBoxInsertRequiredAttrs.getSelection() || fCheckBoxInsertMissingTags.getSelection() || fCheckBoxQuoteAttrValues.getSelection() || fCheckBoxFormatSource.getSelection() || eolCheck;
+		}
 		getButton(IDialogConstants.OK_ID).setEnabled(buttonEnabled);
 	}
 
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java
index 2066141..ab6450a 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java
@@ -14,7 +14,6 @@
 
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
@@ -102,7 +101,7 @@
 	 * @return ImageRegistry - image registry for this plugin
 	 */
 	private ImageRegistry getImageRegistry() {
-		return JFaceResources.getImageRegistry();
+		return HTMLUIPlugin.getInstance().getImageRegistry();
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/handlers/HTMLFindOccurrencesHandler.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/handlers/HTMLFindOccurrencesHandler.java
index 6446ad4..68cc317 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/handlers/HTMLFindOccurrencesHandler.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/handlers/HTMLFindOccurrencesHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -29,6 +29,8 @@
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.texteditor.ITextEditor;
 import org.eclipse.wst.html.ui.internal.search.HTMLFindOccurrencesProcessor;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
 import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
 import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
@@ -69,8 +71,13 @@
 		}
 		else {
 			String errorMessage = SSEUIMessages.FindOccurrencesActionProvider_0; //$NON-NLS-1$
-			PlatformStatusLineUtil.displayErrorMessage(errorMessage);
-			PlatformStatusLineUtil.addOneTimeClearListener();
+			if (textEditor instanceof StructuredTextEditor) {
+				PlatformStatusLineUtil.displayTemporaryErrorMessage(((StructuredTextEditor) textEditor).getTextViewer(), errorMessage);
+			}
+			else {
+				PlatformStatusLineUtil.displayErrorMessage(errorMessage);
+				PlatformStatusLineUtil.addOneTimeClearListener();
+			}
 		}
 		return null;
 	}
@@ -89,12 +96,26 @@
 		String partition = tr != null ? tr.getType() : ""; //$NON-NLS-1$
 
 		Iterator it = getProcessors().iterator();
-		FindOccurrencesProcessor action = null;
+		FindOccurrencesProcessor processor = null;
 		while (it.hasNext()) {
-			action = (FindOccurrencesProcessor) it.next();
+			processor = (FindOccurrencesProcessor) it.next();
 			// we just choose the first action that can handle the partition
-			if (action.enabledForParitition(partition))
-				return action;
+			if (processor.enabledForParitition(partition))
+				return processor;
+		}
+
+		List extendedFindOccurrencesProcessors = ExtendedConfigurationBuilder.getInstance().getConfigurations(FindOccurrencesProcessor.class.getName(), partition);
+		for (int i = 0; i < extendedFindOccurrencesProcessors.size(); i++) {
+			Object o = extendedFindOccurrencesProcessors.get(i);
+			if (o instanceof FindOccurrencesProcessor) {
+				/*
+				 * We just choose the first registered processor that
+				 * explicitly says it can handle the partition
+				 */
+				processor = (FindOccurrencesProcessor) o;
+				if (processor.enabledForParitition(partition))
+					return processor;
+			}
 		}
 		return null;
 	}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/AnchorHyperlinkDetector.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/AnchorHyperlinkDetector.java
new file mode 100644
index 0000000..4d8ab98
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/AnchorHyperlinkDetector.java
@@ -0,0 +1,511 @@
+/*******************************************************************************

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

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

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

+ * which accompanies this distribution, and is available at

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

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

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

+

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

+

+import java.util.ArrayList;

+import java.util.List;

+import java.util.NoSuchElementException;

+

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

+import org.eclipse.ui.IEditorPart;

+import org.eclipse.ui.IWorkbenchPage;

+import org.eclipse.ui.PartInitException;

+import org.eclipse.ui.PlatformUI;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

+import org.w3c.dom.Element;

+import org.w3c.dom.Node;

+import org.w3c.dom.NodeList;

+

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

+

+public class AnchorHyperlinkDetector extends AbstractHyperlinkDetector {

+	static class ExternalElementHyperlink implements IHyperlink {

+		private String fAnchorName = null;

+		private Element fBaseElement = null;

+		private Display fDisplay = null;

+		private IRegion fHyperlinkRegion = null;

+

+		/**

+		 * @param hyperlinkRegion

+		 * @param anchorName

+		 */

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

+			super();

+			fDisplay = display;

+			fHyperlinkRegion = hyperlinkRegion;

+			fAnchorName = anchorName;

+			fBaseElement = baseElement;

+		}

+

+		/*

+		 * (non-Javadoc)

+		 * 

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

+		 */

+		IStatus _open() {

+			if (fBaseElement instanceof IDOMNode) {

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

+				String filename = null;

+				String anchorName = null;

+				if (tokenizer.hasMoreTokens()) {

+					try {

+						filename = tokenizer.nextToken();

+						anchorName = tokenizer.nextToken();

+					}

+					catch (NoSuchElementException e) {

+						// poorly formed value

+					}

+				}

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

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

+					// fBaseElement);

+

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

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

+						IPath resolved = ModuleCoreSupport.resolve(basePath, filename);

+						IFile targetFile = ResourcesPlugin.getWorkspace().getRoot().getFile(resolved);

+						if (targetFile.isAccessible()) {

+							IStructuredModel model = null;

+							int start = -1;

+							int end = -1;

+							try {

+								model = StructuredModelManager.getModelManager().getModelForRead(targetFile);

+								if (model instanceof IDOMModel) {

+									NodeList anchors = ((IDOMModel) model).getDocument().getElementsByTagNameNS("*", HTML40Namespace.ElementName.A); //$NON-NLS-1$

+									for (int i = 0; i < anchors.getLength() && start < 0; i++) {

+										Node item = anchors.item(i);

+										Node nameNode = item.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_NAME);

+										if (nameNode == null)

+											nameNode = item.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_ID);

+										if (nameNode != null) {

+											String name = nameNode.getNodeValue();

+											if (anchorName.equals(name) && nameNode instanceof IndexedRegion) {

+												start = ((IndexedRegion) nameNode).getStartOffset();

+												end = ((IndexedRegion) nameNode).getEndOffset();

+											}

+										}

+									}

+									anchors = ((IDOMModel) model).getDocument().getElementsByTagName(HTML40Namespace.ElementName.A);

+									for (int i = 0; i < anchors.getLength() && start < 0; i++) {

+										Node item = anchors.item(i);

+										Node nameNode = item.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_NAME);

+										if (nameNode == null)

+											nameNode = item.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_ID);

+										if (nameNode != null) {

+											String name = nameNode.getNodeValue();

+											if (anchorName.equals(name) && nameNode instanceof IndexedRegion) {

+												start = ((IndexedRegion) nameNode).getStartOffset();

+												end = ((IndexedRegion) nameNode).getEndOffset();

+											}

+										}

+									}

+

+									anchors = ((IDOMModel) model).getDocument().getElementsByTagName("*"); //$NON-NLS-1$

+									for (int i = 0; i < anchors.getLength() && start < 0; i++) {

+										Node item = anchors.item(i);

+										Node nameNode = item.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_NAME);

+										if (nameNode == null)

+											nameNode = item.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_ID);

+										if (nameNode != null) {

+											String name = nameNode.getNodeValue();

+											if (anchorName.equals(name) && nameNode instanceof IndexedRegion) {

+												start = ((IndexedRegion) nameNode).getStartOffset();

+												end = ((IndexedRegion) nameNode).getEndOffset();

+											}

+										}

+									}

+

+								}

+								return open(basePath.toString(), targetFile, start, end);

+							}

+							catch (Exception e) {

+								Logger.logException(e);

+								return new Status(IStatus.ERROR, HTMLUIPlugin.ID, e.getMessage());

+

+							}

+							finally {

+								if (model != null)

+									model.releaseFromRead();

+							}

+						}

+					}

+				}

+			}

+			return Status.OK_STATUS;

+		}

+

+		/*

+		 * (non-Javadoc)

+		 * 

+		 * @see

+		 * org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkRegion()

+		 */

+		public IRegion getHyperlinkRegion() {

+			return fHyperlinkRegion;

+		}

+

+		/*

+		 * (non-Javadoc)

+		 * 

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

+		 */

+		public String getHyperlinkText() {

+			return NLS.bind(HTMLUIMessages.Open, fAnchorName);

+		}

+

+		/*

+		 * (non-Javadoc)

+		 * 

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

+		 */

+		public String getTypeLabel() {

+			return null;

+		}

+

+		public void open() {

+			scheduleOpen();

+		}

+

+		/**

+		 * @param targetFile

+		 * @param start

+		 * @param end

+		 */

+		private IStatus open(String base, IFile targetFile, int start, int end) throws CoreException, PartInitException {

+			IMarker temporaryMarker = null;

+			try {

+				IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();

+

+				IEditorPart editor = IDE.openEditor(page, targetFile);

+

+				if (0 <= start && start <= end) {

+					temporaryMarker = targetFile.createMarker(IMarker.BOOKMARK);

+					temporaryMarker.setAttribute(IMarker.MESSAGE, base);

+					temporaryMarker.setAttribute(IMarker.CHAR_START, start);

+					temporaryMarker.setAttribute(IMarker.CHAR_END, end);

+					IDE.gotoMarker(editor, temporaryMarker);

+				}

+				return Status.OK_STATUS;

+			}

+			finally {

+				if (temporaryMarker != null)

+					try {

+						temporaryMarker.delete();

+					}

+					catch (CoreException e) {

+						Logger.logException(e);

+					}

+			}

+		}

+

+		void scheduleOpen() {

+			Job opener = new UIJob(fDisplay, fAnchorName) {

+				public IStatus runInUIThread(IProgressMonitor monitor) {

+					return _open();

+				}

+

+			};

+			opener.setSystem(true);

+			opener.setUser(false);

+			opener.schedule();

+		}

+	}

+

+	/**

+	 * Links to the given target node within the text viewer. The target node

+	 * is expected to implement IndexedNode and appear in that text viewer

+	 * (i.e. same editor).

+	 * 

+	 */

+	static class InternalElementHyperlink implements IHyperlink {

+		private IRegion fHyperlinkRegion;

+		private Node fTarget = null;

+		private ITextViewer fViewer = null;

+

+		/**

+		 * 

+		 */

+		public InternalElementHyperlink(ITextViewer textViewer, IRegion hyperlinkRegion, Node targetNode) {

+			fHyperlinkRegion = hyperlinkRegion;

+			fTarget = targetNode;

+			fViewer = textViewer;

+		}

+

+		/*

+		 * (non-Javadoc)

+		 * 

+		 * @see

+		 * org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkRegion()

+		 */

+		public IRegion getHyperlinkRegion() {

+			return fHyperlinkRegion;

+		}

+

+		/*

+		 * (non-Javadoc)

+		 * 

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

+		 */

+		public String getHyperlinkText() {

+			if (fTarget instanceof IndexedRegion) {

+				try {

+					int line = fViewer.getDocument().getLineOfOffset(((IndexedRegion) fTarget).getStartOffset()) + 1;

+					return NLS.bind(HTMLUIMessages.Hyperlink_line, new String[]{fTarget.getNodeName(), fTarget.getNodeValue(), String.valueOf(line)});

+				}

+				catch (BadLocationException e) {

+					Logger.logException(e);

+				}

+			}

+			return NLS.bind(HTMLUIMessages.Open, fTarget.getNodeName());

+		}

+

+		/*

+		 * (non-Javadoc)

+		 * 

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

+		 */

+		public String getTypeLabel() {

+			return null;

+		}

+

+		/*

+		 * (non-Javadoc)

+		 * 

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

+		 */

+		public void open() {

+			if (fTarget instanceof IndexedRegion) {

+				int offset = ((IndexedRegion) fTarget).getStartOffset();

+				if (fViewer instanceof ITextViewerExtension5) {

+					offset = ((ITextViewerExtension5) fViewer).modelOffset2WidgetOffset(offset);

+				}

+				fViewer.getSelectionProvider().setSelection(new TextSelection(offset, 0));

+				fViewer.revealRange(offset, 0);

+			}

+		}

+	}

+

+	public AnchorHyperlinkDetector() {

+		super();

+	}

+

+	private void addHyperLinkForHref(ITextViewer textViewer, IRegion linkRegion, Element element, String hrefValue, List links, Node anchor) {

+		Node nameNode = anchor.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_HREF);

+		if (nameNode != null) {

+			String name = nameNode.getNodeValue();

+			if (hrefValue.equals(name) && nameNode instanceof IndexedRegion) {

+				links.add(new InternalElementHyperlink(textViewer, linkRegion, nameNode));

+			}

+		}

+	}

+

+	private void addHyperLinkForName(ITextViewer textViewer, IRegion linkRegion, Element element, String anchorName, List links, Node anchor) {

+		Node nameNode = anchor.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_NAME);

+		if (nameNode != null) {

+			String name = nameNode.getNodeValue();

+			if (anchorName.equals(name) && nameNode instanceof IndexedRegion) {

+				links.add(new InternalElementHyperlink(textViewer, linkRegion, nameNode));

+			}

+		}

+		nameNode = anchor.getAttributes().getNamedItem(HTML40Namespace.ATTR_NAME_ID);

+		if (nameNode != null) {

+			String name = nameNode.getNodeValue();

+			if (anchorName.equals(name) && nameNode instanceof IndexedRegion) {

+				links.add(new InternalElementHyperlink(textViewer, linkRegion, nameNode));

+			}

+		}

+	}

+

+	/**

+	 * @param documentRegion

+	 * @param valueRegion

+	 * @return

+	 */

+	private IRegion createHyperlinkRegion(IStructuredDocumentRegion documentRegion, ITextRegion valueRegion) {

+		return new Region(documentRegion.getStartOffset(valueRegion), valueRegion.getTextLength());

+	}

+

+	// link to anchors with the given name (value includes the '#')

+	IHyperlink[] createHyperlinksToAnchorNamed(ITextViewer textViewer, IRegion hyperlinkRegion, Element element, String anchorName, boolean canShowMultipleHyperlinks) {

+		List links = new ArrayList(1);

+		// >1 guards the substring-ing

+		if (anchorName.length() > 1 && anchorName.startsWith("#")) { //$NON-NLS-1$

+			// an anchor in this document

+			NodeList anchors = null;//element.getOwnerDocument().getElementsByTagNameNS("*", HTML40Namespace.ElementName.A); //$NON-NLS-1$

+			String internalAnchorName = anchorName.substring(1);

+//			for (int i = 0; i < anchors.getLength(); i++) {

+//				addHyperLinkForName(textViewer, hyperlinkRegion, element, internalAnchorName, links, anchors.item(i));

+//			}

+//			anchors = element.getOwnerDocument().getElementsByTagName(HTML40Namespace.ElementName.A);

+//			for (int i = 0; i < anchors.getLength(); i++) {

+//				addHyperLinkForName(textViewer, hyperlinkRegion, element, internalAnchorName, links, anchors.item(i));

+//			}

+			anchors = element.getOwnerDocument().getElementsByTagName("*"); //$NON-NLS-1$

+			for (int i = 0; i < anchors.getLength(); i++) {

+				addHyperLinkForName(textViewer, hyperlinkRegion, element, internalAnchorName, links, anchors.item(i));

+			}

+		}

+		else {

+			// another file, possibly very slow to compute ahead of time

+			links.add(new ExternalElementHyperlink(textViewer.getTextWidget().getDisplay(), hyperlinkRegion, anchorName, element));

+		}

+		if (!links.isEmpty()) {

+			return (IHyperlink[]) links.toArray(new IHyperlink[links.size()]);

+		}

+		return null;

+	}

+

+	// link to anchors that link to this target

+	IHyperlink[] createReferrerHyperlinks(ITextViewer textViewer, IRegion hyperlinkRegion, Element element, String nameValue, boolean canShowMultipleHyperlinks) {

+		List links = new ArrayList(1);

+		if (nameValue.length() > 0) {

+			String target = "#" + nameValue; //$NON-NLS-1$

+			NodeList anchors = null;//element.getOwnerDocument().getElementsByTagNameNS("*", HTML40Namespace.ElementName.A); //$NON-NLS-1$

+//			for (int i = 0; i < anchors.getLength(); i++) {

+//				addHyperLinkForHref(textViewer, hyperlinkRegion, element, target, links, anchors.item(i));

+//			}

+//			anchors = element.getOwnerDocument().getElementsByTagName(HTML40Namespace.ElementName.A);

+//			for (int i = 0; i < anchors.getLength(); i++) {

+//				addHyperLinkForHref(textViewer, hyperlinkRegion, element, target, links, anchors.item(i));

+//			}

+			anchors = element.getOwnerDocument().getElementsByTagName("*"); //$NON-NLS-1$

+			for (int i = 0; i < anchors.getLength(); i++) {

+				addHyperLinkForHref(textViewer, hyperlinkRegion, element, target, links, anchors.item(i));

+			}

+		}

+		if (!links.isEmpty()) {

+			return (IHyperlink[]) links.toArray(new IHyperlink[links.size()]);

+		}

+		return null;

+	}

+

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

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

+			IDocument document = textViewer.getDocument();

+			if (document != null) {

+				Node currentNode = getCurrentNode(document, region.getOffset());

+				if (currentNode != null && currentNode.getNodeType() == Node.ELEMENT_NODE) {

+					Element element = (Element) currentNode;

+						IStructuredDocumentRegion documentRegion = ((IStructuredDocument) document).getRegionAtCharacterOffset(region.getOffset());

+						ITextRegion textRegion = documentRegion.getRegionAtCharacterOffset(region.getOffset());

+						ITextRegion nameRegion = null;

+						ITextRegion valueRegion = null;

+						String name = null;

+						String value = null;

+						if (DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE.equals(textRegion.getType())) {

+							ITextRegionList regions = documentRegion.getRegions();

+							/*

+							 * Could use 2, but there needs to be the tag open

+							 * and name regions

+							 */

+							int index = regions.indexOf(textRegion);

+							if (index >= 4) {

+								nameRegion = regions.get(index - 2);

+								valueRegion = textRegion;

+								name = documentRegion.getText(nameRegion);

+								value = StringUtils.strip(documentRegion.getText(valueRegion));

+							}

+						}

+						else if (DOMRegionContext.XML_TAG_ATTRIBUTE_NAME.equals(textRegion.getType())) {

+							ITextRegionList regions = documentRegion.getRegions();

+							int index = regions.indexOf(textRegion);

+							// minus 3 to leave equal and value regions

+							if (index <= regions.size() - 3) {

+								nameRegion = textRegion;

+								valueRegion = regions.get(index + 2);

+								name = documentRegion.getText(nameRegion);

+								value = StringUtils.strip(documentRegion.getText(valueRegion));

+							}

+						}

+						if (name != null && value != null) {

+							if (HTML40Namespace.ATTR_NAME_HREF.equalsIgnoreCase(name) && value.indexOf("#") >= 0) { //$NON-NLS-1$

+								return createHyperlinksToAnchorNamed(textViewer, createHyperlinkRegion(documentRegion, valueRegion), element, value, canShowMultipleHyperlinks);

+							}

+							if (HTML40Namespace.ATTR_NAME_NAME.equalsIgnoreCase(name)||HTML40Namespace.ATTR_NAME_ID.equalsIgnoreCase(name)) {

+								return createReferrerHyperlinks(textViewer, createHyperlinkRegion(documentRegion, valueRegion), element, value, canShowMultipleHyperlinks);

+							}

+						}

+				}

+			}

+		}

+		return null;

+	}

+

+	/**

+	 * Returns the node the cursor is currently on in the document. null if no

+	 * node is selected

+	 * 

+	 * @param offset

+	 * @return Node either element, doctype, text, or null

+	 */

+	private Node getCurrentNode(IDocument document, int offset) {

+		// get the current node at the offset (returns either: element,

+		// doctype, text)

+		IndexedRegion inode = null;

+		IStructuredModel sModel = null;

+		try {

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

+			if (sModel != null) {

+				inode = sModel.getIndexedRegion(offset);

+				if (inode == null) {

+					inode = sModel.getIndexedRegion(offset - 1);

+				}

+			}

+		}

+		finally {

+			if (sModel != null)

+				sModel.releaseFromRead();

+		}

+

+		if (inode instanceof Node) {

+			return (Node) inode;

+		}

+		return null;

+	}

+}

diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLCompletionProposalCategoriesConfiguration.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLCompletionProposalCategoriesConfiguration.java
new file mode 100644
index 0000000..11cb1d0
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLCompletionProposalCategoriesConfiguration.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 20109 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration;
+
+/**
+ * <p>The readable and writable completion proposal categories configuration
+ * for the HTML content type</p>
+ */
+public class HTMLCompletionProposalCategoriesConfiguration extends AbstractCompletionProposalCategoriesConfiguration {
+
+	/** the ID of the preference page where users can change the preferences */
+	private static final String PREFERENCES_PAGE_ID = "org.eclipse.wst.html.ui.preferences.contentassist"; //$NON-NLS-1$
+	
+	/**
+	 * <p>Creates the configuration</p>
+	 */
+	public HTMLCompletionProposalCategoriesConfiguration() {
+		//nothing to do.
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getPreferenceStore()
+	 */
+	protected IPreferenceStore getPreferenceStore() {
+		return HTMLUIPlugin.getDefault().getPreferenceStore();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#hasAssociatedPropertiesPage()
+	 */
+	public boolean hasAssociatedPropertiesPage() {
+		return true;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#getPropertiesPageID()
+	 */
+	public String getPropertiesPageID() {
+		return PREFERENCES_PAGE_ID;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnDefaultPagePrefKey()
+	 */
+	protected String getShouldNotDisplayOnDefaultPagePrefKey() {
+		return HTMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnOwnPagePrefKey()
+	 */
+	protected String getShouldNotDisplayOnOwnPagePrefKey() {
+		return HTMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getPageSortOrderPrefKey()
+	 */
+	protected String getPageSortOrderPrefKey() {
+		return HTMLUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getDefaultPageSortOrderPrefKey()
+	 */
+	protected String getDefaultPageSortOrderPrefKey() {
+		return HTMLUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER;
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java
index 8ef13c9..6ddbb67 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,7 +14,8 @@
 
 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
 import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.resource.ColorRegistry;
+import org.eclipse.ui.PlatformUI;
 import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
 import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
 import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
@@ -32,81 +33,97 @@
 	 */
 	public void initializeDefaultPreferences() {
 		IPreferenceStore store = HTMLUIPlugin.getDefault().getPreferenceStore();
-
+		ColorRegistry registry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
+		
 		store.setDefault(HTMLUIPreferenceNames.AUTO_PROPOSE, true);
 		store.setDefault(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE, "<=");//$NON-NLS-1$
 
 		// HTML Style Preferences
 		String NOBACKGROUNDBOLD = " | null | false"; //$NON-NLS-1$
 		String JUSTITALIC = " | null | false | true"; //$NON-NLS-1$
-		String styleValue = ColorHelper.getColorString(127, 0, 127) + NOBACKGROUNDBOLD;
+		String styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_ATTRIBUTE_NAME, 127, 0, 127) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, styleValue);
 
-		styleValue = ColorHelper.getColorString(42, 0, 255) + JUSTITALIC;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, 42, 0, 255) + JUSTITALIC;
 		store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, styleValue);
 
 		styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
 		store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS, styleValue); // specified value is black; leaving as widget default
 
-		styleValue = ColorHelper.getColorString(63, 95, 191) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.COMMENT_BORDER, 63, 95, 191) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.COMMENT_BORDER, styleValue);
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.COMMENT_TEXT, 63, 95, 191) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.COMMENT_TEXT, styleValue);
 
-		styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DECL_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.DECL_BORDER, styleValue);
 
-		styleValue = ColorHelper.getColorString(0, 0, 128) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_NAME, 0, 0, 128) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.DOCTYPE_NAME, styleValue);
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF, 0, 0, 128) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF, styleValue);
 
-		styleValue = ColorHelper.getColorString(128, 128, 128) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, 128, 128, 128) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, styleValue);
 
-		styleValue = ColorHelper.getColorString(63, 127, 95) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF, 63, 127, 95) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF, styleValue);
 
 		styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
 		store.setDefault(IStyleConstantsXML.XML_CONTENT, styleValue);	// specified value is black; leaving as widget default
 
-		styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.TAG_BORDER, styleValue);
 
-		styleValue = ColorHelper.getColorString(63, 127, 127) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_NAME, 63, 127, 127) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.TAG_NAME, styleValue);
 
-		styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.PI_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.PI_BORDER, styleValue);
 
 		styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
 		store.setDefault(IStyleConstantsXML.PI_CONTENT, styleValue);	// specified value is black; leaving as widget default
 
-		styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.CDATA_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.CDATA_BORDER, styleValue);
 
-		styleValue = ColorHelper.getColorString(0, 0, 0) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.CDATA_TEXT, 0, 0, 0) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.CDATA_TEXT, styleValue);
 
-		styleValue = ColorHelper.getColorString(191, 95, 63) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsHTML.SCRIPT_AREA_BORDER, 191, 95, 63) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsHTML.SCRIPT_AREA_BORDER, styleValue);
 
-		styleValue = ColorHelper.getColorString(42, 0, 255) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.ENTITY_REFERENCE, 42, 0, 255) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.ENTITY_REFERENCE, styleValue);
 
 		// set default new html file template to use in new file wizard
 		/*
 		 * Need to find template name that goes with default template id (name
-		 * may change for differnt language)
+		 * may change for different language)
 		 */
-		String templateName = ""; //$NON-NLS-1$
-		Template template = HTMLUIPlugin.getDefault().getTemplateStore().findTemplateById("org.eclipse.wst.html.ui.templates.html"); //$NON-NLS-1$
-		if (template != null)
-			templateName = template.getName();
-		store.setDefault(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
+		store.setDefault(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_ID, "org.eclipse.wst.html.ui.templates.html"); //$NON-NLS-1$
 		
 		// Defaults for the Typing preference page
 		store.setDefault(HTMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS, true);
 		store.setDefault(HTMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS, true);
+		store.setDefault(HTMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS, true);
 		store.setDefault(HTMLUIPreferenceNames.TYPING_REMOVE_END_TAGS, true);
+		store.setDefault(HTMLUIPreferenceNames.TYPING_CLOSE_STRINGS, true);
+		store.setDefault(HTMLUIPreferenceNames.TYPING_CLOSE_BRACKETS, true);
+		
+		// Defaults for Content Assist preference page
+		store.setDefault(HTMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE, "");
+		store.setDefault(HTMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE, "");
+		store.setDefault(HTMLUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER,
+				"org.eclipse.wst.html.ui.proposalCategory.htmlTags\0" +
+				"org.eclipse.wst.css.ui.proposalCategory.css\0" +
+				"org.eclipse.wst.html.ui.proposalCategory.htmlTemplates\0" +
+				"org.eclipse.wst.css.ui.proposalCategory.cssTemplates");
+		store.setDefault(HTMLUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER,
+				"org.eclipse.wst.html.ui.proposalCategory.htmlTemplates\0"+
+				"org.eclipse.wst.css.ui.proposalCategory.cssTemplates\0" +
+				"org.eclipse.wst.html.ui.proposalCategory.htmlTags\0" +
+				"org.eclipse.wst.css.ui.proposalCategory.css");
 	}
 
 }
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java
index fbe9c7b..4f8b012 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -62,7 +62,13 @@
 	 * </p>
 	 */
 	public static final String NEW_FILE_TEMPLATE_NAME = "newFileTemplateName"; //$NON-NLS-1$
-	
+
+	/**
+	 * The initial template ID to be used in the new HTML file wizard. In the absence
+	 * of {@link NEW_FILE_TEMPLATE_NAME}, this ID is used to find a template name
+	 */
+	public static final String NEW_FILE_TEMPLATE_ID = "newFileTemplateId"; //$NON-NLS-1$
+
 	/**
 	 * The key to store the option for auto-completing comments while
 	 * typing.
@@ -82,6 +88,15 @@
 	public static final String TYPING_COMPLETE_END_TAGS = "completeEndTags"; //$NON-NLS-1$
 	
 	/**
+	 * The key to store the option for auto-completing the element after entering
+	 * <code>&gt;</code>
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_COMPLETE_ELEMENTS = "completeElements"; //$NON-NLS-1$
+	
+	/**
 	 * The key to store the option for removing an end-tag if the start tag is
 	 * converted to an empty-tag.
 	 * <p>
@@ -89,4 +104,58 @@
 	 * </p>
 	 */
 	public static final String TYPING_REMOVE_END_TAGS = "removeEndTags"; //$NON-NLS-1$
+
+	/**
+	 * The key to store the option for auto-completing strings (" and ') while
+	 * typing.
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_CLOSE_STRINGS = "closeStrings"; //$NON-NLS-1$
+
+	/**
+	 * The key to store the option for auto-completing brackets ([ and () while
+	 * typing.
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_CLOSE_BRACKETS = "closeBrackets"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key used for saving which categories should not display on the default page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>), ordered is ignored</p>
+	 */
+	public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE = "html_content_assist_display_on_default_page"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key used for saving which categories should not display on their own page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>), order is ignored</p>
+	 */
+	public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE = "html_content_assist_display_on_own_page"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key for saving the sort order of the categories when displaying them on their own page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>) in the desired sort order.</p>
+	 */
+	public static final String CONTENT_ASSIST_OWN_PAGE_SORT_ORDER= "html_content_assist_own_page_sort_order"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key for saving the sort order of the categories when displaying them on the default page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>) in the desired sort order.</p>
+	 */
+	public static final String CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER= "html_content_assist_default_page_sort_order"; //$NON-NLS-1$
 }
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/AbstractValidationSettingsPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/AbstractValidationSettingsPage.java
index af796cf..f2ab08d 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/AbstractValidationSettingsPage.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/AbstractValidationSettingsPage.java
@@ -68,6 +68,7 @@
 		private String fKey;
 		private int[] fSeverities;
 		private int fIndex;
+		int originalSeverity = -2;
 		
 		public ComboData(String key, int[] severities, int index) {
 			fKey = key;
@@ -108,6 +109,9 @@
 			return (fIndex >= 0 && fSeverities != null && fIndex < fSeverities.length) ? fSeverities[fIndex] : -1;
 		}
 		
+		boolean isChanged() {
+			return fSeverities[fIndex] != originalSeverity;
+		}
 	}
 	
 	public AbstractValidationSettingsPage() {
@@ -174,8 +178,10 @@
 		if(key != null)
 			severity = fPreferencesService.getInt(getPreferenceNodeQualifier(), key, ValidationMessage.WARNING, createPreferenceScopes());
 
-		if(severity == ValidationMessage.ERROR || severity == ValidationMessage.WARNING || severity == ValidationMessage.IGNORE)
+		if (severity == ValidationMessage.ERROR || severity == ValidationMessage.WARNING || severity == ValidationMessage.IGNORE) {
 			data.setSeverity(severity);
+			data.originalSeverity = severity;
+		}
 		
 		if(data.getIndex() >= 0)
 			comboBox.select(data.getIndex());
@@ -315,7 +321,16 @@
 		}
 	}
 	
-	protected abstract boolean shouldRevalidateOnSettingsChange();
+	protected boolean shouldRevalidateOnSettingsChange() {
+		Iterator it = fCombos.iterator();
+
+		while (it.hasNext()) {
+			ComboData data = (ComboData) ((Combo) it.next()).getData();
+			if (data.isChanged())
+				return true;
+		}
+		return false;
+	}
 	
 	public boolean performOk() {
 		if(super.performOk() && shouldRevalidateOnSettingsChange()) {
@@ -328,14 +343,16 @@
 				case SWT.CANCEL:
 					return false;
 				case SWT.YES:
+					storeValues();
 					ValidateJob job = new ValidateJob(HTMLUIMessages.Validation_jobName);
 					job.schedule();
 				case SWT.NO:
+					storeValues();
 				default:
 					return true;
 			}
 		}
-		return false;
+		return true;
 	}
 	
 	/**
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLContentAssistPreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLContentAssistPreferencePage.java
new file mode 100644
index 0000000..c1fc2b6
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLContentAssistPreferencePage.java
@@ -0,0 +1,200 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.preferences.ui;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
+import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
+import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
+import org.eclipse.wst.sse.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposoalCatigoriesConfigurationRegistry;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
+import org.eclipse.wst.sse.ui.preferences.CodeAssistCyclingConfigurationBlock;
+import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter;
+
+/**
+ * <p>Defines the preference page for allowing the user to change the content
+ * assist preferences</p>
+ */
+public class HTMLContentAssistPreferencePage extends AbstractPreferencePage implements
+		IWorkbenchPreferencePage {
+
+	private static final String HTML_CONTENT_TYPE_ID = "org.eclipse.wst.html.core.htmlsource"; //$NON-NLS-1$
+	
+	// Auto Activation
+	private Button fAutoPropose;
+	private Label fAutoProposeLabel;
+	private Text fAutoProposeText;
+	
+	/** configuration block for changing preference having to do with the content assist categories */
+	private CodeAssistCyclingConfigurationBlock fConfigurationBlock;
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+	 */
+	protected Control createContents(Composite parent) {
+		final Composite composite = super.createComposite(parent, 1);
+		
+		createContentsForAutoActivationGroup(composite);
+		createContentsForCyclingGroup(composite);
+		
+		setSize(composite);
+		loadPreferences();
+		
+		return composite;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#performDefaults()
+	 */
+	protected void performDefaults() {
+		performDefaultsForAutoActivationGroup();
+		performDefaultsForCyclingGroup();
+
+		validateValues();
+		enableValues();
+
+		super.performDefaults();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#initializeValues()
+	 */
+	protected void initializeValues() {
+		initializeValuesForAutoActivationGroup();
+		initializeValuesForCyclingGroup();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#storeValues()
+	 */
+	protected void storeValues() {
+		storeValuesForAutoActivationGroup();
+		storeValuesForCyclingGroup();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#enableValues()
+	 */
+	protected void enableValues() {
+		if (fAutoPropose != null) {
+			if (fAutoPropose.getSelection()) {
+				fAutoProposeLabel.setEnabled(true);
+				fAutoProposeText.setEnabled(true);
+			}
+			else {
+				fAutoProposeLabel.setEnabled(false);
+				fAutoProposeText.setEnabled(false);
+			}
+		}
+	}
+	
+	/**
+	 * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
+	 */
+	protected IPreferenceStore doGetPreferenceStore() {
+		return HTMLUIPlugin.getDefault().getPreferenceStore();
+	}
+
+	/**
+	 * <p>Create contents for the auto activation preference group</p>
+	 * @param parent {@link Composite} parent of the group
+	 */
+	private void createContentsForAutoActivationGroup(Composite parent) {
+		Group contentAssistGroup = createGroup(parent, 2);
+		contentAssistGroup.setText(HTMLUIMessages.Auto_Activation_UI_);
+
+		fAutoPropose = createCheckBox(contentAssistGroup, HTMLUIMessages.Automatically_make_suggest_UI_);
+		((GridData) fAutoPropose.getLayoutData()).horizontalSpan = 2;
+		fAutoPropose.addSelectionListener(this);
+
+		fAutoProposeLabel = createLabel(contentAssistGroup, HTMLUIMessages.Prompt_when_these_characte_UI_);
+		fAutoProposeText = createTextField(contentAssistGroup);
+	}
+	
+	/**
+	 * <p>Create the contents for the content assist cycling preference group</p>
+	 * @param parent {@link Composite} parent of the group
+	 */
+	private void createContentsForCyclingGroup(Composite parent) {
+		ICompletionProposalCategoriesConfigurationWriter configurationWriter = CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getWritableConfiguration(HTML_CONTENT_TYPE_ID);
+		
+		if(configurationWriter != null) {
+			fConfigurationBlock = new CodeAssistCyclingConfigurationBlock(HTML_CONTENT_TYPE_ID, configurationWriter);
+			fConfigurationBlock.createContents(parent, HTMLUIMessages.Cycling_UI_);
+		} else {
+			Logger.log(Logger.ERROR, "There should be an ICompletionProposalCategoriesConfigurationWriter" + //$NON-NLS-1$
+					" specified for the HTML content type, but can't fine it, thus can't create user" + //$NON-NLS-1$
+					" preference block for editing proposal categories preferences."); //$NON-NLS-1$
+		}
+	}
+	
+	/**
+	 * <p>Store the values for the auto activation group</p>
+	 */
+	private void storeValuesForAutoActivationGroup() {
+		getPreferenceStore().setValue(HTMLUIPreferenceNames.AUTO_PROPOSE, fAutoPropose.getSelection());
+		getPreferenceStore().setValue(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE, fAutoProposeText.getText());
+	}
+	
+	/**
+	 * <p>Store the values for the cycling group</p>
+	 */
+	private void storeValuesForCyclingGroup() {
+		if (fConfigurationBlock != null) {
+			fConfigurationBlock.storeValues();
+		}
+	}
+	
+	/**
+	 * <p>Initialize the values for the auto activation group</p>
+	 */
+	private void initializeValuesForAutoActivationGroup() {
+		// Content Assist
+		fAutoPropose.setSelection(getPreferenceStore().getBoolean(HTMLUIPreferenceNames.AUTO_PROPOSE));
+		fAutoProposeText.setText(getPreferenceStore().getString(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE));
+	}
+	
+	/**
+	 * <p>Initialize the values for the cycling group</p>
+	 */
+	private void initializeValuesForCyclingGroup() {
+		if(fConfigurationBlock != null) {
+			fConfigurationBlock.initializeValues();
+		}
+	}
+	
+	/**
+	 * <p>Load the defaults for the auto activation group</p>
+	 */
+	private void performDefaultsForAutoActivationGroup() {
+		// Content Assist
+		fAutoPropose.setSelection(getPreferenceStore().getDefaultBoolean(HTMLUIPreferenceNames.AUTO_PROPOSE));
+		fAutoProposeText.setText(getPreferenceStore().getDefaultString(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE));
+	}
+	
+	/**
+	 * <p>Load the defaults of the cycling group</p>
+	 */
+	private void performDefaultsForCyclingGroup() {
+		if(fConfigurationBlock != null) {
+			fConfigurationBlock.performDefaults();
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java
index d026ae7..1aa3304 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java
@@ -111,17 +111,4 @@
 	protected void storeValuesForLoadingGroup() {
 		getModelPreferences().setValue(CommonEncodingPreferenceNames.INPUT_CODESET, fInputEncodingSettings.getIANATag());
 	}
-
-	protected void createContentsForCreatingGroup(Composite parent) {
-		super.createContentsForCreatingGroup(parent);
-		// Group creatingGroup = createGroup(parent, 2);
-		// creatingGroup.setText(HTMLUIMessages.Creating_files);
-		//		
-		// // Encoding..
-		// Label label = createLabel(creatingGroup,
-		// HTMLUIMessages.Encoding_desc);
-		// ((GridData)label.getLayoutData()).horizontalSpan = 2;
-		// fEncodingSettings = new EncodingSettings(creatingGroup);
-		// ((GridData)fEncodingSettings.getLayoutData()).horizontalSpan = 2;
-	}
 }
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java
index 9e7120e..a5e711a 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
@@ -30,7 +31,6 @@
 import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
 import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
 import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
 import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
 
 public class HTMLSourcePreferencePage extends AbstractPreferencePage {
@@ -42,10 +42,6 @@
 	private final int MIN_INDENTATION_SIZE = 0;
 	private final int MAX_INDENTATION_SIZE = 16;
 
-	// Content Assist
-	private Button fAutoPropose;
-	private Label fAutoProposeLabel;
-	private Text fAutoProposeText;
 	private Button fClearAllBlankLines;
 
 	// Formatting
@@ -56,21 +52,6 @@
 	private Button fIndentUsingSpaces;
 	private Spinner fIndentationSize;
 
-	private void createContentsForContentAssistGroup(Composite parent) {
-		Group contentAssistGroup = createGroup(parent, 2);
-		contentAssistGroup.setText(HTMLUIMessages.Content_assist_UI_);
-
-		fAutoPropose = createCheckBox(contentAssistGroup, HTMLUIMessages.Automatically_make_suggest_UI_);
-		((GridData) fAutoPropose.getLayoutData()).horizontalSpan = 2;
-		fAutoPropose.addSelectionListener(this);
-
-		fAutoProposeLabel = createLabel(contentAssistGroup, HTMLUIMessages.Prompt_when_these_characte_UI_);
-		fAutoProposeText = createTextField(contentAssistGroup);
-
-		// add one more group of preferences
-		createContentsForPreferredCaseGroup(parent, 2);
-	}
-
 	private Composite createContentsForPreferredCaseGroup(Composite parent, int columnSpan) {
 		Group caseGroup = createGroup(parent, columnSpan);
 		caseGroup.setText(HTMLUIMessages.Preferred_markup_case_UI_);
@@ -111,11 +92,17 @@
 		fClearAllBlankLines = createCheckBox(formattingGroup, HTMLUIMessages.Clear_all_blank_lines_UI_);
 		((GridData) fClearAllBlankLines.getLayoutData()).horizontalSpan = 2;
 
-		fIndentUsingTabs = createRadioButton(formattingGroup, HTMLUIMessages.Indent_using_tabs);
-		((GridData) fIndentUsingTabs.getLayoutData()).horizontalSpan = 2;
+		// [269224] - Place the indent controls in their own composite for proper tab ordering
+		Composite indentComposite = createComposite(formattingGroup, 1);
+		((GridData) indentComposite.getLayoutData()).horizontalSpan = 2;
+		((GridLayout) indentComposite.getLayout()).marginWidth = 0;
+		((GridLayout) indentComposite.getLayout()).marginHeight = 0;
 
-		fIndentUsingSpaces = createRadioButton(formattingGroup, HTMLUIMessages.Indent_using_spaces);
-		((GridData) fIndentUsingSpaces.getLayoutData()).horizontalSpan = 2;
+		fIndentUsingTabs = createRadioButton(indentComposite, HTMLUIMessages.Indent_using_tabs);
+		((GridData) fIndentUsingTabs.getLayoutData()).horizontalSpan = 1;
+
+		fIndentUsingSpaces = createRadioButton(indentComposite, HTMLUIMessages.Indent_using_spaces);
+		((GridData) fIndentUsingSpaces.getLayoutData()).horizontalSpan = 1;
 
 		createLabel(formattingGroup, HTMLUIMessages.Indentation_size);
 		fIndentationSize = new Spinner(formattingGroup, SWT.READ_ONLY | SWT.BORDER);
@@ -136,7 +123,6 @@
 		fAttrNameLower.setSelection(getModelPreferences().getDefaultInt(HTMLCorePreferenceNames.ATTR_NAME_CASE) == HTMLCorePreferenceNames.LOWER);
 
 		performDefaultsForFormattingGroup();
-		performDefaultsForContentAssistGroup();
 
 		validateValues();
 		enableValues();
@@ -144,12 +130,6 @@
 		super.performDefaults();
 	}
 
-	private void performDefaultsForContentAssistGroup() {
-		// Content Assist
-		fAutoPropose.setSelection(getPreferenceStore().getDefaultBoolean(HTMLUIPreferenceNames.AUTO_PROPOSE));
-		fAutoProposeText.setText(getPreferenceStore().getDefaultString(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE));
-	}
-
 	private void performDefaultsForFormattingGroup() {
 		// Formatting
 		fLineWidthText.setText(getModelPreferences().getDefaultString(HTMLCorePreferenceNames.LINE_WIDTH));
@@ -175,13 +155,6 @@
 		fAttrNameLower.setSelection(getModelPreferences().getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE) == HTMLCorePreferenceNames.LOWER);
 
 		initializeValuesForFormattingGroup();
-		initializeValuesForContentAssistGroup();
-	}
-
-	private void initializeValuesForContentAssistGroup() {
-		// Content Assist
-		fAutoPropose.setSelection(getPreferenceStore().getBoolean(HTMLUIPreferenceNames.AUTO_PROPOSE));
-		fAutoProposeText.setText(getPreferenceStore().getString(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE));
 	}
 
 	private void initializeValuesForFormattingGroup() {
@@ -214,13 +187,6 @@
 			getModelPreferences().setValue(HTMLCorePreferenceNames.ATTR_NAME_CASE, HTMLCorePreferenceNames.LOWER);
 
 		storeValuesForFormattingGroup();
-		storeValuesForContentAssistGroup();
-	}
-
-	private void storeValuesForContentAssistGroup() {
-		// Content Assist
-		getPreferenceStore().setValue(HTMLUIPreferenceNames.AUTO_PROPOSE, fAutoPropose.getSelection());
-		getPreferenceStore().setValue(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE, fAutoProposeText.getText());
 	}
 
 	private void storeValuesForFormattingGroup() {
@@ -269,26 +235,13 @@
 		new Label(composite, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create());
 
 		createContentsForFormattingGroup(composite);
-		createContentsForContentAssistGroup(composite);
+		createContentsForPreferredCaseGroup(composite, 2);
 		setSize(composite);
 		loadPreferences();
 
 		return composite;
 	}
 
-	protected void enableValues() {
-		if (fAutoPropose != null) {
-			if (fAutoPropose.getSelection()) {
-				fAutoProposeLabel.setEnabled(true);
-				fAutoProposeText.setEnabled(true);
-			}
-			else {
-				fAutoProposeLabel.setEnabled(false);
-				fAutoProposeText.setEnabled(false);
-			}
-		}
-	}
-
 	protected void validateValues() {
 		boolean isError = false;
 		String widthText = null;
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSyntaxColoringPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSyntaxColoringPage.java
index 0a682c7..ef0f01d 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSyntaxColoringPage.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSyntaxColoringPage.java
@@ -665,6 +665,7 @@
 			styles.add(IStyleConstantsXML.TAG_BORDER);
 			styles.add(IStyleConstantsXML.TAG_NAME);
 			styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
+			styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
 			styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
 			styles.add(IStyleConstantsXML.COMMENT_BORDER);
 			styles.add(IStyleConstantsXML.COMMENT_TEXT);
@@ -773,6 +774,7 @@
 		fContextToStyleMap.put(DOMRegionContext.XML_END_TAG_OPEN, IStyleConstantsXML.TAG_BORDER);
 		fContextToStyleMap.put(DOMRegionContext.XML_TAG_NAME, IStyleConstantsXML.TAG_NAME);
 		fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
+		fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS, IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
 		fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
 		fContextToStyleMap.put(DOMRegionContext.XML_TAG_CLOSE, IStyleConstantsXML.TAG_BORDER);
 		fContextToStyleMap.put(DOMRegionContext.XML_EMPTY_TAG_CLOSE, IStyleConstantsXML.TAG_BORDER);
@@ -811,6 +813,7 @@
 		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_BORDER, XMLUIMessages.Tag_Delimiters_UI_); // =
 		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_NAME, XMLUIMessages.Tag_Names_UI_); // =
 		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, XMLUIMessages.Attribute_Names_UI_); // =
+		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS, XMLUIMessages.Attribute_Equals_UI_);
 		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, XMLUIMessages.Attribute_Values_UI_); // =
 		fStyleToDescriptionMap.put(IStyleConstantsXML.DECL_BORDER, XMLUIMessages.Declaration_Delimiters_UI_); // =
 		fStyleToDescriptionMap.put(IStyleConstantsXML.XML_CONTENT, XMLUIMessages.Content_UI_); // =
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTemplatePreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTemplatePreferencePage.java
index 60d0c85..0700d82 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTemplatePreferencePage.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTemplatePreferencePage.java
@@ -125,7 +125,7 @@
 		SourceViewer viewer = null;
 		String contentTypeID = ContentTypeIdForHTML.ContentTypeID_HTML;
 		viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
-		((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+		viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
 		IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(contentTypeID);
 		IDocument document = scratchModel.getStructuredDocument();
 		viewer.configure(viewerConfiguration);
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTypingPreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTypingPreferencePage.java
index 1aa0676..8942dfe 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTypingPreferencePage.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTypingPreferencePage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -21,16 +21,22 @@
 import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
 import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
 import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
 
 public class HTMLTypingPreferencePage extends AbstractPreferencePage {
 
 	private Button fCloseComment;
 	private Button fCloseEndTag;
 	private Button fRemoveEndTag;
+	private Button fCloseElement;
+	private Button fCloseStrings;
+	private Button fCloseBrackets;
 	
 	protected Control createContents(Composite parent) {
 		Composite composite = super.createComposite(parent, 1);
 		
+		createStartTagGroup(composite);
+		createEndTagGroup(composite);
 		createAutoComplete(composite);
 		createAutoRemove(composite);
 		
@@ -40,17 +46,37 @@
 		return composite;
 	}
 	
+	private void createStartTagGroup(Composite parent) {
+		Group group = createGroup(parent, 2);
+
+		group.setText(XMLUIMessages.XMLTyping_Start_Tag);
+
+		fCloseElement = createCheckBox(group, XMLUIMessages.XMLTyping_Complete_Elements);
+		((GridData) fCloseElement.getLayoutData()).horizontalSpan = 2;
+	}
+	
+	private void createEndTagGroup(Composite parent) {
+		Group group = createGroup(parent, 2);
+
+		group.setText(XMLUIMessages.XMLTyping_End_Tag);
+
+		fCloseEndTag = createCheckBox(group, XMLUIMessages.XMLTyping_Complete_End_Tags);
+		((GridData) fCloseEndTag.getLayoutData()).horizontalSpan = 2;
+	}
+	
 	private void createAutoComplete(Composite parent) {
 		Group group = createGroup(parent, 2);
-		
+
 		group.setText(HTMLUIMessages.HTMLTyping_Auto_Complete);
-		
+
 		fCloseComment = createCheckBox(group, HTMLUIMessages.HTMLTyping_Complete_Comments);
 		((GridData) fCloseComment.getLayoutData()).horizontalSpan = 2;
-		
-		fCloseEndTag = createCheckBox(group, HTMLUIMessages.HTMLTyping_Complete_End_Tags);
-		((GridData) fCloseEndTag.getLayoutData()).horizontalSpan = 2;
-		
+
+		fCloseStrings = createCheckBox(group, HTMLUIMessages.HTMLTyping_Close_Strings);
+		((GridData) fCloseStrings.getLayoutData()).horizontalSpan = 2;
+
+		fCloseBrackets = createCheckBox(group, HTMLUIMessages.HTMLTyping_Close_Brackets);
+		((GridData) fCloseBrackets.getLayoutData()).horizontalSpan = 2;
 	}
 	
 	private void createAutoRemove(Composite parent) {
@@ -73,29 +99,28 @@
 	protected void initializeValues() {
 		initCheckbox(fCloseComment, HTMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS);
 		initCheckbox(fCloseEndTag, HTMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS);
+		initCheckbox(fCloseElement, HTMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS);
 		initCheckbox(fRemoveEndTag, HTMLUIPreferenceNames.TYPING_REMOVE_END_TAGS);
+		initCheckbox(fCloseStrings, HTMLUIPreferenceNames.TYPING_CLOSE_STRINGS);
+		initCheckbox(fCloseBrackets, HTMLUIPreferenceNames.TYPING_CLOSE_BRACKETS);
 	}
 	
 	protected void performDefaults() {
 		defaultCheckbox(fCloseComment, HTMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS);
 		defaultCheckbox(fCloseEndTag, HTMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS);
+		defaultCheckbox(fCloseElement, HTMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS);
 		defaultCheckbox(fRemoveEndTag, HTMLUIPreferenceNames.TYPING_REMOVE_END_TAGS);
-	}
-	
-	private void initCheckbox(Button box, String key) {
-		if(box != null && key != null)
-			box.setSelection(getPreferenceStore().getBoolean(key));
-	}
-	
-	private void defaultCheckbox(Button box, String key) {
-		if(box != null && key != null)
-			box.setSelection(getPreferenceStore().getDefaultBoolean(key));
+		defaultCheckbox(fCloseStrings, HTMLUIPreferenceNames.TYPING_CLOSE_STRINGS);
+		defaultCheckbox(fCloseBrackets, HTMLUIPreferenceNames.TYPING_CLOSE_BRACKETS);
 	}
 	
 	protected void storeValues() {
 		getPreferenceStore().setValue(HTMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS, (fCloseComment != null) ? fCloseComment.getSelection() : false);
 		getPreferenceStore().setValue(HTMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS, (fCloseEndTag != null) ? fCloseEndTag.getSelection() : false);
+		getPreferenceStore().setValue(HTMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS, (fCloseElement != null) ? fCloseElement.getSelection() : false);
 		getPreferenceStore().setValue(HTMLUIPreferenceNames.TYPING_REMOVE_END_TAGS, (fRemoveEndTag != null) ? fRemoveEndTag.getSelection() : false);
+		getPreferenceStore().setValue(HTMLUIPreferenceNames.TYPING_CLOSE_STRINGS, (fCloseStrings != null) ? fCloseStrings.getSelection() : false);
+		getPreferenceStore().setValue(HTMLUIPreferenceNames.TYPING_CLOSE_BRACKETS, (fCloseBrackets != null) ? fCloseBrackets.getSelection() : false);
 	}
 	
 	protected IPreferenceStore doGetPreferenceStore() {
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLValidationPreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLValidationPreferencePage.java
index 14a3135..1a1f612 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLValidationPreferencePage.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLValidationPreferencePage.java
@@ -11,6 +11,7 @@
 package org.eclipse.wst.html.ui.internal.preferences.ui;
 
 import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.layout.PixelConverter;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
@@ -25,7 +26,6 @@
 import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
 import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
 import org.eclipse.wst.sse.ui.internal.preferences.ui.ScrolledPageContent;
-import org.eclipse.wst.sse.ui.internal.util.PixelConverter;
 
 public class HTMLValidationPreferencePage extends AbstractValidationSettingsPage {
 	
@@ -165,6 +165,10 @@
 		label = HTMLUIMessages.HTMLValidationPreferencePage_7;
 		addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_VALUE_UNCLOSED, SEVERITIES, errorWarningIgnoreLabel, 0);
 		
+		label = HTMLUIMessages.HTMLValidationPreferencePage_35;
+		// TODO: validate resources?
+		// addComboBox(inner, label, HTMLCorePreferenceNames.ATTRIBUTE_VALUE_RESOURCE_NOT_FOUND, SEVERITIES, errorWarningIgnoreLabel, 0);
+
 		// End Attribute section
 		
 		
@@ -277,16 +281,6 @@
 	
 	/*
 	 * (non-Javadoc)
-	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractSettingsPage#performOk()
-	 */
-	public boolean performOk() {
-		boolean result = super.performOk();
-		storeValues();
-		return result;
-	}
-	
-	/*
-	 * (non-Javadoc)
 	 * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
 	 */
 	protected void performDefaults() {
@@ -329,8 +323,4 @@
 
 	public void init(IWorkbench workbench) {
 	}
-	
-	protected boolean shouldRevalidateOnSettingsChange() {
-		return true;
-	}
 }
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionAnnotationModelChanges.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionAnnotationModelChanges.java
deleted file mode 100644
index 2273bb7..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionAnnotationModelChanges.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.projection;
-
-import java.util.Map;
-
-import org.eclipse.jface.text.source.Annotation;
-import org.w3c.dom.Node;
-
-/**
- * Contains a set of projection model additions/deletions/modifications
- */
-class ProjectionAnnotationModelChanges {
-	// copies of this class located in:
-	// org.eclipse.wst.xml.ui.internal.projection
-	// org.eclipse.wst.css.ui.internal.projection
-	// org.eclipse.wst.html.ui.internal.projection
-	// org.eclipse.jst.jsp.ui.internal.projection
-	private Node fNode;
-	private Annotation[] fDeletions;
-	private Map fAdditions;
-	private Annotation[] fModifications;
-
-	public ProjectionAnnotationModelChanges(Node node, Annotation[] deletions, Map additions, Annotation[] modifications) {
-		fNode = node;
-		fDeletions = deletions;
-		fAdditions = additions;
-		fModifications = modifications;
-	}
-
-	public Map getAdditions() {
-		return fAdditions;
-	}
-
-	public Annotation[] getDeletions() {
-		return fDeletions;
-	}
-
-	public Annotation[] getModifications() {
-		return fModifications;
-	}
-
-	public Node getNode() {
-		return fNode;
-	}
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java
deleted file mode 100644
index 86752b0..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Tom Turrell-Croft, left@ultrasis.com - [174307] Enable folding for div tags in JSP and HTML files     
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.projection;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Node;
-
-public class ProjectionModelNodeAdapterFactoryHTML extends AbstractAdapterFactory {
-	// copies of this class located in:
-	// org.eclipse.wst.html.ui.internal.projection
-	// org.eclipse.jst.jsp.ui.internal.projection
-
-	/**
-	 * List of projection viewers currently associated with this projection
-	 * model node adapter factory.
-	 */
-	private HashMap fProjectionViewers;
-
-	public ProjectionModelNodeAdapterFactoryHTML(Object adapterKey, boolean registerAdapters) {
-		super(adapterKey, registerAdapters);
-	}
-
-	public ProjectionModelNodeAdapterFactoryHTML(Object adapterKey) {
-		super(adapterKey);
-	}
-
-	public ProjectionModelNodeAdapterFactoryHTML() {
-		this(ProjectionModelNodeAdapterHTML.class);
-	}
-
-	/**
-	 * Actually creates an adapter for the parent of target if target is the
-	 * "adapt-able" node
-	 */
-	protected INodeAdapter createAdapter(INodeNotifier target) {
-		if ((isActive()) && (target instanceof Node) && ((Node) target).getNodeType() == Node.ELEMENT_NODE) {
-			Node node = (Node) target;
-			if (isNodeProjectable(node)) {
-
-				// actually work with the parent node to listen for add,
-				// delete events
-				Node parent = node.getParentNode();
-				if (parent instanceof INodeNotifier) {
-					INodeNotifier parentNotifier = (INodeNotifier) parent;
-					ProjectionModelNodeAdapterHTML parentAdapter = (ProjectionModelNodeAdapterHTML) parentNotifier.getExistingAdapter(ProjectionModelNodeAdapterHTML.class);
-					if (parentAdapter == null) {
-						// create a new adapter for parent
-						parentAdapter = new ProjectionModelNodeAdapterHTML(this);
-						parentNotifier.addAdapter(parentAdapter);
-					}
-					// call update on parent because a new node has just been
-					// added
-					parentAdapter.updateAdapter(parent);
-				}
-			}
-		}
-
-		return null;
-	}
-
-	/**
-	 * Returns true if node is a node type able to fold
-	 * 
-	 * @param node
-	 * @return boolean true if node is projectable, false otherwise
-	 */
-	boolean isNodeProjectable(Node node) {
-		if (node.getNodeType() == Node.ELEMENT_NODE) {
-			String tagName = node.getNodeName();
-			// node is only projectable if it is head, body, script, style,
-			// table, ul, ol, and div tags
-			if (HTML40Namespace.ElementName.HEAD.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.BODY.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.SCRIPT.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.STYLE.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.TABLE.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.UL.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.OL.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.DIV.equalsIgnoreCase(tagName))
-				return true;
-		}
-		return false;
-	}
-
-	/**
-	 * Return true if this factory is currently actively managing projection
-	 * 
-	 * @return
-	 */
-	boolean isActive() {
-		return (fProjectionViewers != null && !fProjectionViewers.isEmpty());
-	}
-
-	/**
-	 * Updates projection annotation model if document is not in flux.
-	 * Otherwise, queues up the changes to be applied when document is ready.
-	 * 
-	 * @param node
-	 * @param deletions
-	 * @param additions
-	 * @param modifications
-	 */
-	void queueAnnotationModelChanges(Node node, Annotation[] deletions, Map additions, Annotation[] modifications) {
-		queueAnnotationModelChanges(node, deletions, additions, modifications, null);
-	}
-
-	/**
-	 * Updates projection annotation model for a specific projection viewer if
-	 * document is not in flux. Otherwise, queues up the changes to be applied
-	 * when document is ready.
-	 * 
-	 * @param node
-	 * @param deletions
-	 * @param additions
-	 * @param modifications
-	 * @param viewer
-	 */
-	void queueAnnotationModelChanges(Node node, Annotation[] deletions, Map additions, Annotation[] modifications, ProjectionViewer viewer) {
-		// create a change object for latest change and add to queue
-		ProjectionAnnotationModelChanges newChange = new ProjectionAnnotationModelChanges(node, deletions, additions, modifications);
-		if (fProjectionViewers != null) {
-			if (viewer != null) {
-				ProjectionViewerInformation info = (ProjectionViewerInformation) fProjectionViewers.get(viewer);
-				if (info != null) {
-					info.queueAnnotationModelChanges(newChange);
-				}
-			}
-			else {
-				Iterator infos = fProjectionViewers.values().iterator();
-				while (infos.hasNext()) {
-					ProjectionViewerInformation info = (ProjectionViewerInformation) infos.next();
-					info.queueAnnotationModelChanges(newChange);
-				}
-			}
-		}
-	}
-
-	public void release() {
-		// go through every projectionviewer and call
-		// removeProjectionViewer(viewer);
-		if (fProjectionViewers != null) {
-			Iterator infos = fProjectionViewers.values().iterator();
-			while (infos.hasNext()) {
-				ProjectionViewerInformation info = (ProjectionViewerInformation) infos.next();
-				info.dispose();
-				infos.remove();
-			}
-			fProjectionViewers = null;
-		}
-		super.release();
-	}
-
-	/**
-	 * Adds viewer to list of projection viewers this factory is associated
-	 * with
-	 * 
-	 * @param viewer -
-	 *            assumes viewer's document and projection annotation model
-	 *            are not null
-	 */
-	void addProjectionViewer(ProjectionViewer viewer) {
-		// remove old entry if it exists
-		removeProjectionViewer(viewer);
-
-		if (fProjectionViewers == null) {
-			fProjectionViewers = new HashMap();
-		}
-
-		// create new object containing projection viewer and its info
-		ProjectionViewerInformation info = new ProjectionViewerInformation(viewer);
-		fProjectionViewers.put(viewer, info);
-		info.initialize();
-	}
-
-	/**
-	 * Removes the given viewer from the list of projection viewers this
-	 * factor is associated with
-	 * 
-	 * @param viewer
-	 */
-	void removeProjectionViewer(ProjectionViewer viewer) {
-		if (fProjectionViewers != null) {
-			// remove entry from list of viewers
-			ProjectionViewerInformation info = (ProjectionViewerInformation) fProjectionViewers.remove(viewer);
-			if (info != null) {
-				info.dispose();
-			}
-			// if removing last projection viewer, clear out everything
-			if (fProjectionViewers.isEmpty()) {
-				fProjectionViewers = null;
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterHTML.java
deleted file mode 100644
index c1ccd2c..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterHTML.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.projection;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.w3c.dom.Node;
-
-/**
- * Updates projection annotation model with projection annotations for this
- * adapter node's children
- */
-public class ProjectionModelNodeAdapterHTML implements INodeAdapter {
-	// copies of this class located in:
-	// org.eclipse.wst.html.ui.internal.projection
-	// org.eclipse.jst.jsp.ui.internal.projection
-	private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.html.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	private class TagProjectionAnnotation extends ProjectionAnnotation {
-		private boolean fIsVisible = false; /* workaround for BUG85874 */
-		private Node fNode;
-
-		public TagProjectionAnnotation(Node node, boolean isCollapsed) {
-			super(isCollapsed);
-			fNode = node;
-		}
-
-		public Node getNode() {
-			return fNode;
-		}
-
-		public void setNode(Node node) {
-			fNode = node;
-		}
-
-		/**
-		 * Does not paint hidden annotations. Annotations are hidden when they
-		 * only span one line.
-		 * 
-		 * @see ProjectionAnnotation#paint(org.eclipse.swt.graphics.GC,
-		 *      org.eclipse.swt.widgets.Canvas,
-		 *      org.eclipse.swt.graphics.Rectangle)
-		 */
-		public void paint(GC gc, Canvas canvas, Rectangle rectangle) {
-			/* workaround for BUG85874 */
-			/*
-			 * only need to check annotations that are expanded because hidden
-			 * annotations should never have been given the chance to
-			 * collapse.
-			 */
-			if (!isCollapsed()) {
-				// working with rectangle, so line height
-				FontMetrics metrics = gc.getFontMetrics();
-				if (metrics != null) {
-					// do not draw annotations that only span one line and
-					// mark them as not visible
-					if ((rectangle.height / metrics.getHeight()) <= 1) {
-						fIsVisible = false;
-						return;
-					}
-				}
-			}
-			fIsVisible = true;
-			super.paint(gc, canvas, rectangle);
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.jface.text.source.projection.ProjectionAnnotation#markCollapsed()
-		 */
-		public void markCollapsed() {
-			/* workaround for BUG85874 */
-			// do not mark collapsed if annotation is not visible
-			if (fIsVisible)
-				super.markCollapsed();
-		}
-	}
-
-	// copies of this class located in:
-	// org.eclipse.wst.html.ui.internal.projection
-	// org.eclipse.jst.jsp.ui.internal.projection
-
-	ProjectionModelNodeAdapterFactoryHTML fAdapterFactory;
-	private Map fTagAnnotations = new HashMap();
-
-	public ProjectionModelNodeAdapterHTML(ProjectionModelNodeAdapterFactoryHTML factory) {
-		fAdapterFactory = factory;
-	}
-
-	/**
-	 * Create a projection position from the given node. Able to get
-	 * projection position if node isNodeProjectable.
-	 * 
-	 * @param node
-	 * @return null if no projection position possible, a Position otherwise
-	 */
-	private Position createProjectionPosition(Node node) {
-		Position pos = null;
-		if (fAdapterFactory.isNodeProjectable(node) && node instanceof IndexedRegion) {
-			// IDocument document =
-			// fAdapterFactory.getProjectionViewer().getDocument();
-			// if (document != null) {
-			IndexedRegion inode = (IndexedRegion) node;
-			int start = inode.getStartOffset();
-			int end = inode.getEndOffset();
-			if (start >= 0 && start < end) {
-				// region-based
-				// extra line when collapsed, but no region
-				// increase when add newline
-				pos = new Position(start, end - start);
-				// try {
-				// // line-based
-				// // extra line when collapsed, but no region
-				// // increase when add newline
-				// IRegion startLineRegion =
-				// document.getLineInformationOfOffset(start);
-				// IRegion endLineRegion =
-				// document.getLineInformationOfOffset(end);
-				// int startOffset = startLineRegion.getOffset();
-				// int endOffset = endLineRegion.getOffset() +
-				// endLineRegion.getLength();
-				// if (endOffset > startOffset) {
-				// pos = new Position(startOffset, endOffset -
-				// startOffset);
-				// }
-				//
-				// // line-based
-				// // no extra line when collapsed, but region increase
-				// // when add newline
-				// int startLine = document.getLineOfOffset(start);
-				// int endLine = document.getLineOfOffset(end);
-				// if (endLine + 1 < document.getNumberOfLines()) {
-				// int offset = document.getLineOffset(startLine);
-				// int endOffset = document.getLineOffset(endLine + 1);
-				// pos = new Position(offset, endOffset - offset);
-				// }
-				// }
-				// catch (BadLocationException x) {
-				// Logger.log(Logger.WARNING_DEBUG, null, x);
-				// }
-			}
-		}
-		// }
-		return pos;
-	}
-
-	/**
-	 * Find TagProjectionAnnotation for node in the current list of projection
-	 * annotations for this adapter
-	 * 
-	 * @param node
-	 * @return TagProjectionAnnotation
-	 */
-	private TagProjectionAnnotation getExistingAnnotation(Node node) {
-		TagProjectionAnnotation anno = null;
-
-		if ((node != null) && (!fTagAnnotations.isEmpty())) {
-			Iterator it = fTagAnnotations.keySet().iterator();
-			while (it.hasNext() && anno == null) {
-				TagProjectionAnnotation a = (TagProjectionAnnotation) it.next();
-				Node n = a.getNode();
-				if (node.equals(n)) {
-					anno = a;
-				}
-			}
-		}
-		return anno;
-	}
-
-	public boolean isAdapterForType(Object type) {
-		return type == ProjectionModelNodeAdapterHTML.class;
-	}
-
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		// check if folding is even enabled, if not, just ignore notifyChanged
-		// events
-		if (!fAdapterFactory.isActive()) {
-			return;
-		}
-
-		if ((eventType == INodeNotifier.STRUCTURE_CHANGED) && (notifier instanceof Node)) {
-			updateAdapter((Node) notifier);
-		}
-	}
-
-	/**
-	 * Update the projection annotation of all the nodes that are children of
-	 * node
-	 * 
-	 * @param node
-	 */
-	void updateAdapter(Node node) {
-		updateAdapter(node, null);
-	}
-
-	/**
-	 * Update the projection annotation of all the nodes that are children of
-	 * node and adds all projection annotations to viewer (for newly added
-	 * viewers)
-	 * 
-	 * @param node
-	 * @param viewer
-	 */
-	void updateAdapter(Node node, ProjectionViewer viewer) {
-		long start = System.currentTimeMillis();
-
-		Map additions = new HashMap();
-		Map projectionAnnotations = new HashMap();
-
-		// go through immediate child nodes and figure out projection
-		// model annotations
-		if (node != null) {
-			Node childNode = node.getFirstChild();
-			while (childNode != null) {
-				Position newPos = createProjectionPosition(childNode);
-				if (newPos != null) {
-					TagProjectionAnnotation newAnnotation = new TagProjectionAnnotation(childNode, false);
-					TagProjectionAnnotation existing = getExistingAnnotation(childNode);
-					if (existing == null) {
-						// add to map containing all annotations for this
-						// adapter
-						projectionAnnotations.put(newAnnotation, newPos);
-						// add to map containing annotations to add
-						additions.put(newAnnotation, newPos);
-					}
-					else {
-						// add to map containing all annotations for this
-						// adapter
-						projectionAnnotations.put(existing, newPos);
-						// remove from map containing annotations to delete
-						fTagAnnotations.remove(existing);
-					}
-				}
-				childNode = childNode.getNextSibling();
-			}
-
-			// in the end, want to delete anything leftover in old list, add
-			// everything in additions, and update everything in
-			// projectionAnnotations
-			ProjectionAnnotation[] oldList = null;
-			if (!fTagAnnotations.isEmpty()) {
-				oldList = (ProjectionAnnotation[]) fTagAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
-			}
-			ProjectionAnnotation[] modifyList = null;
-			if (!projectionAnnotations.isEmpty()) {
-				modifyList = (ProjectionAnnotation[]) projectionAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
-			}
-
-			// specifically add all annotations to viewer
-			if (viewer != null && !projectionAnnotations.isEmpty()) {
-				fAdapterFactory.queueAnnotationModelChanges(node, null, projectionAnnotations, null, viewer);
-			}
-
-			// only update when there is something to update
-			if ((oldList != null && oldList.length > 0) || (!additions.isEmpty()) || (modifyList != null && modifyList.length > 0))
-				fAdapterFactory.queueAnnotationModelChanges(node, oldList, additions, modifyList);
-		}
-
-		// save new list of annotations
-		fTagAnnotations = projectionAnnotations;
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			String nodeName = node != null ? node.getNodeName() : "null"; //$NON-NLS-1$
-			System.out.println("ProjectionModelNodeAdapterHTML.updateAdapter (" + nodeName + "):" + (end - start)); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionViewerInformation.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionViewerInformation.java
deleted file mode 100644
index 675efa5..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionViewerInformation.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.projection;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.html.ui.internal.Logger;
-
-/**
- * Contains information about a projection viewer and also manages updating
- * the viewer's projection annotation model
- */
-class ProjectionViewerInformation {
-	// copies of this class located in:
-	// org.eclipse.wst.xml.ui.internal.projection
-	// org.eclipse.wst.css.ui.internal.projection
-	// org.eclipse.wst.html.ui.internal.projection
-	// org.eclipse.jst.jsp.ui.internal.projection
-
-	/**
-	 * Listens to document to be aware of when to update the projection
-	 * annotation model.
-	 */
-	private class DocumentListener implements IDocumentListener {
-		private ProjectionViewerInformation fInfo;
-
-		public DocumentListener(ProjectionViewerInformation info) {
-			fInfo = info;
-		}
-
-		public void documentAboutToBeChanged(DocumentEvent event) {
-			IDocument document = event.getDocument();
-			if (fInfo.getDocument() == document) {
-				fInfo.setIsDocumentChanging(true);
-			}
-		}
-
-		public void documentChanged(DocumentEvent event) {
-			// register a post notification replace so that projection
-			// annotation model will be updated after all documentChanged
-			// listeners have been notified
-			IDocument document = event.getDocument();
-			if (document instanceof IDocumentExtension && fInfo.getDocument() == document) {
-				if (fInfo.hasChangesQueued())
-					((IDocumentExtension) document).registerPostNotificationReplace(this, new PostDocumentChangedListener(fInfo));
-			}
-		}
-	}
-
-	/**
-	 * Essentially a post document changed listener because it is called after
-	 * documentchanged has been fired.
-	 */
-	private class PostDocumentChangedListener implements IDocumentExtension.IReplace {
-		private ProjectionViewerInformation fInfo;
-
-		public PostDocumentChangedListener(ProjectionViewerInformation info) {
-			fInfo = info;
-		}
-
-		public void perform(IDocument document, IDocumentListener owner) {
-			fInfo.applyAnnotationModelChanges();
-			fInfo.setIsDocumentChanging(false);
-		}
-	}
-
-	/**
-	 * Projection annotation model current associated with this projection
-	 * viewer
-	 */
-	private ProjectionAnnotationModel fProjectionAnnotationModel;
-	/**
-	 * Document currently associated with this projection viewer
-	 */
-	private IDocument fDocument;
-	/**
-	 * Listener to fProjectionViewer's document
-	 */
-	private IDocumentListener fDocumentListener;
-	/**
-	 * Indicates whether or not document is in the middle of changing
-	 */
-	private boolean fIsDocumentChanging = false;
-	/**
-	 * List of projection annotation model changes that need to be applied
-	 */
-	private List fQueuedAnnotationChanges;
-
-	public ProjectionViewerInformation(ProjectionViewer viewer) {
-		fDocument = viewer.getDocument();
-		fProjectionAnnotationModel = viewer.getProjectionAnnotationModel();
-	}
-
-	IDocument getDocument() {
-		return fDocument;
-	}
-
-	private List getQueuedAnnotationChanges() {
-		if (fQueuedAnnotationChanges == null) {
-			fQueuedAnnotationChanges = new ArrayList();
-		}
-		return fQueuedAnnotationChanges;
-	}
-
-	void setIsDocumentChanging(boolean changing) {
-		fIsDocumentChanging = changing;
-	}
-
-	private boolean isDocumentChanging() {
-		return fIsDocumentChanging;
-	}
-
-	/**
-	 * Applies the pending projection annotation model changes to the
-	 * projection annotation model.
-	 */
-	void applyAnnotationModelChanges() {
-		List queuedChanges = getQueuedAnnotationChanges();
-		// go through all the pending annotation changes and apply
-		// them to
-		// the projection annotation model
-		while (!queuedChanges.isEmpty()) {
-			ProjectionAnnotationModelChanges changes = (ProjectionAnnotationModelChanges) queuedChanges.remove(0);
-			try {
-				fProjectionAnnotationModel.modifyAnnotations(changes.getDeletions(), changes.getAdditions(), changes.getModifications());
-			}
-			catch (Exception e) {
-				// if anything goes wrong, log it and continue
-				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-			}
-		}
-	}
-
-	/**
-	 * Returns true if there are annotation changes queued up, false otherwise
-	 * 
-	 * @return boolean
-	 */
-	boolean hasChangesQueued() {
-		return !getQueuedAnnotationChanges().isEmpty();
-	}
-
-	/**
-	 * Updates projection annotation model if document is not in flux.
-	 * Otherwise, queues up the changes to be applied when document is ready.
-	 */
-	public void queueAnnotationModelChanges(ProjectionAnnotationModelChanges newChange) {
-		/*
-		 * future_TODO: maybe improve by checking if annotation projection
-		 * model change already exists for node. if so, throw out old change.
-		 */
-		getQueuedAnnotationChanges().add(newChange);
-
-		// if document isn't changing, go ahead and apply it
-		if (!isDocumentChanging()) {
-			applyAnnotationModelChanges();
-		}
-	}
-
-	public void initialize() {
-		// add document listener
-		if (fDocumentListener == null) {
-			fDocumentListener = new DocumentListener(this);
-		}
-		getDocument().addDocumentListener(fDocumentListener);
-	}
-
-	public void dispose() {
-		// remove document listener
-		if (fDocumentListener != null) {
-			getDocument().removeDocumentListener(fDocumentListener);
-		}
-
-		// clear out list of queued changes since it may no longer
-		// be accurate
-		if (fQueuedAnnotationChanges != null) {
-			fQueuedAnnotationChanges.clear();
-			fQueuedAnnotationChanges = null;
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/StructuredTextFoldingProviderHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/StructuredTextFoldingProviderHTML.java
deleted file mode 100644
index 0018554..0000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/StructuredTextFoldingProviderHTML.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.projection;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.jface.text.source.projection.IProjectionListener;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Updates the projection model of a structured model for HTML.
- */
-public class StructuredTextFoldingProviderHTML implements IStructuredTextFoldingProvider, IProjectionListener, ITextInputListener {
-	private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.html.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	private IDocument fDocument;
-	private ProjectionViewer fViewer;
-	private boolean fProjectionNeedsToBeEnabled = false;
-	/**
-	 * Maximum number of child nodes to add adapters to (limit for performance
-	 * sake)
-	 */
-	private final int MAX_CHILDREN = 10;
-	/**
-	 * Maximum number of sibling nodes to add adapters to (limit for
-	 * performance sake)
-	 */
-	private final int MAX_SIBLINGS = 1000;
-
-	/**
-	 * Adds an adapter to node and its children
-	 * 
-	 * @param node
-	 * @param childLevel
-	 */
-	private void addAdapterToNodeAndChildren(Node node, int childLevel) {
-		// stop adding initial adapters MAX_CHILDREN levels deep for
-		// performance sake
-		if (node instanceof INodeNotifier && childLevel < MAX_CHILDREN) {
-			INodeNotifier notifier = (INodeNotifier) node;
-
-			// try and get the adapter for the current node and update the
-			// adapter with projection information
-			ProjectionModelNodeAdapterHTML adapter = (ProjectionModelNodeAdapterHTML) notifier.getExistingAdapter(ProjectionModelNodeAdapterHTML.class);
-			if (adapter != null) {
-				adapter.updateAdapter(node, fViewer);
-			}
-			else {
-				// just call getadapter so the adapter is created and
-				// automatically initialized
-				notifier.getAdapterFor(ProjectionModelNodeAdapterHTML.class);
-			}
-			int siblingLevel = 0;
-			Node nextChild = node.getFirstChild();
-			while (nextChild != null && siblingLevel < MAX_SIBLINGS) {
-				Node childNode = nextChild;
-				nextChild = childNode.getNextSibling();
-
-				addAdapterToNodeAndChildren(childNode, childLevel + 1);
-				++siblingLevel;
-			}
-		}
-	}
-
-	/**
-	 * Goes through every node and adds an adapter onto each for tracking
-	 * purposes
-	 */
-	private void addAllAdapters() {
-		long start = System.currentTimeMillis();
-
-		if (fDocument != null) {
-			IStructuredModel sModel = null;
-			try {
-				sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-				if (sModel != null) {
-					int startOffset = 0;
-					IndexedRegion startNode = sModel.getIndexedRegion(startOffset);
-					if (startNode instanceof Node) {
-						int siblingLevel = 0;
-						Node nextSibling = (Node) startNode;
-						while (nextSibling != null && siblingLevel < MAX_SIBLINGS) {
-							Node currentNode = nextSibling;
-							nextSibling = currentNode.getNextSibling();
-
-							addAdapterToNodeAndChildren(currentNode, 0);
-							++siblingLevel;
-						}
-					}
-				}
-			}
-			finally {
-				if (sModel != null) {
-					sModel.releaseFromRead();
-				}
-			}
-		}
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderHTML.addAllAdapters: " + (end - start)); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Get the ProjectionModelNodeAdapterFactoryHTML to use with this
-	 * provider.
-	 * 
-	 * @return ProjectionModelNodeAdapterFactoryHTML
-	 */
-	private ProjectionModelNodeAdapterFactoryHTML getAdapterFactory(boolean createIfNeeded) {
-		long start = System.currentTimeMillis();
-
-		ProjectionModelNodeAdapterFactoryHTML factory = null;
-		if (fDocument != null) {
-			IStructuredModel sModel = null;
-			try {
-				sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-				if (sModel != null) {
-					FactoryRegistry factoryRegistry = sModel.getFactoryRegistry();
-
-					// getting the projectionmodelnodeadapter for the first
-					// time
-					// so do some initializing
-					if (!factoryRegistry.contains(ProjectionModelNodeAdapterHTML.class) && createIfNeeded) {
-						ProjectionModelNodeAdapterFactoryHTML newFactory = new ProjectionModelNodeAdapterFactoryHTML();
-
-						// add factory to factory registry
-						factoryRegistry.addFactory(newFactory);
-
-						// add factory to propogating adapter
-						IDOMModel domModel = (IDOMModel) sModel;
-						Document document = domModel.getDocument();
-						PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class);
-						if (propagatingAdapter != null) {
-							propagatingAdapter.addAdaptOnCreateFactory(newFactory);
-						}
-					}
-
-					// try and get the factory
-					factory = (ProjectionModelNodeAdapterFactoryHTML) factoryRegistry.getFactoryFor(ProjectionModelNodeAdapterHTML.class);
-				}
-			}
-			finally {
-				if (sModel != null)
-					sModel.releaseFromRead();
-			}
-		}
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderHTML.getAdapterFactory: " + (end - start)); //$NON-NLS-1$
-		}
-		return factory;
-	}
-
-	/**
-	 * Initialize this provider with the correct document. Assumes projection
-	 * is enabled. (otherwise, only install would have been called)
-	 */
-	public void initialize() {
-		if (!isInstalled()) {
-			return;
-		}
-
-		long start = System.currentTimeMillis();
-		// clear out old info
-		projectionDisabled();
-
-		fDocument = fViewer.getDocument();
-
-		// set projection viewer on new document's adapter factory
-		if (fViewer.getProjectionAnnotationModel() != null) {
-			ProjectionModelNodeAdapterFactoryHTML factory = getAdapterFactory(true);
-			if (factory != null) {
-				factory.addProjectionViewer(fViewer);
-			}
-			try {
-				// https://bugs.eclipse.org/bugs/show_bug.cgi?id=198304
-				// disable redraw while adding all adapters
-				fViewer.setRedraw(false);
-				addAllAdapters();
-			}
-			finally {
-				fViewer.setRedraw(true);
-			}
-		}
-		fProjectionNeedsToBeEnabled = false;
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderHTML.initialize: " + (end - start)); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Associate a ProjectionViewer with this IStructuredTextFoldingProvider
-	 * 
-	 * @param viewer -
-	 *            assumes not null
-	 */
-	public void install(ProjectionViewer viewer) {
-		// uninstall before trying to install new viewer
-		if (isInstalled()) {
-			uninstall();
-		}
-		fViewer = viewer;
-		fViewer.addProjectionListener(this);
-		fViewer.addTextInputListener(this);
-	}
-
-	private boolean isInstalled() {
-		return fViewer != null;
-	}
-
-	public void projectionDisabled() {
-		ProjectionModelNodeAdapterFactoryHTML factory = getAdapterFactory(false);
-		if (factory != null) {
-			factory.removeProjectionViewer(fViewer);
-		}
-
-		// clear out all annotations
-		if (fViewer.getProjectionAnnotationModel() != null)
-			fViewer.getProjectionAnnotationModel().removeAllAnnotations();
-
-		removeAllAdapters();
-
-		fDocument = null;
-		fProjectionNeedsToBeEnabled = false;
-	}
-
-	public void projectionEnabled() {
-		initialize();
-	}
-
-	/**
-	 * Removes an adapter from node and its children
-	 * 
-	 * @param node
-	 * @param level
-	 */
-	private void removeAdapterFromNodeAndChildren(Node node, int level) {
-		if (node instanceof INodeNotifier) {
-			INodeNotifier notifier = (INodeNotifier) node;
-
-			// try and get the adapter for the current node and remove it
-			INodeAdapter adapter = notifier.getExistingAdapter(ProjectionModelNodeAdapterHTML.class);
-			if (adapter != null) {
-				notifier.removeAdapter(adapter);
-			}
-
-			Node nextChild = node.getFirstChild();
-			while (nextChild != null) {
-				Node childNode = nextChild;
-				nextChild = childNode.getNextSibling();
-
-				removeAdapterFromNodeAndChildren(childNode, level + 1);
-			}
-		}
-	}
-
-	/**
-	 * Goes through every node and removes adapter from each for cleanup
-	 * purposes
-	 */
-	private void removeAllAdapters() {
-		long start = System.currentTimeMillis();
-
-		if (fDocument != null) {
-			IStructuredModel sModel = null;
-			try {
-				sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-				if (sModel != null) {
-					int startOffset = 0;
-					IndexedRegion startNode = sModel.getIndexedRegion(startOffset);
-					if (startNode instanceof Node) {
-						Node nextSibling = (Node) startNode;
-						while (nextSibling != null) {
-							Node currentNode = nextSibling;
-							nextSibling = currentNode.getNextSibling();
-
-							removeAdapterFromNodeAndChildren(currentNode, 0);
-						}
-					}
-				}
-			}
-			finally {
-				if (sModel != null) {
-					sModel.releaseFromRead();
-				}
-			}
-		}
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderHTML.removeAllAdapters: " + (end - start)); //$NON-NLS-1$
-		}
-	}
-
-	public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
-		// if folding is enabled and new document is going to be a totally
-		// different document, disable projection
-		if (fDocument != null && fDocument != newInput) {
-			// disable projection and disconnect everything
-			projectionDisabled();
-			fProjectionNeedsToBeEnabled = true;
-		}
-	}
-
-	public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
-		// if projection was previously enabled before input document changed
-		// and new document is different than old document
-		if (fProjectionNeedsToBeEnabled && fDocument == null && newInput != null) {
-			projectionEnabled();
-			fProjectionNeedsToBeEnabled = false;
-		}
-	}
-
-	/**
-	 * Disconnect this IStructuredTextFoldingProvider from projection viewer
-	 */
-	public void uninstall() {
-		if (isInstalled()) {
-			projectionDisabled();
-
-			fViewer.removeProjectionListener(this);
-			fViewer.removeTextInputListener(this);
-			fViewer = null;
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/LineStyleProviderForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/LineStyleProviderForHTML.java
index 943eec5..4db6f64 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/LineStyleProviderForHTML.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/LineStyleProviderForHTML.java
@@ -36,9 +36,14 @@
 		if (region == null) {
 			return (TextAttribute)getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
 		}
-		if (region.getType() == DOMRegionContext.BLOCK_TEXT) {
+		String type = region.getType();
+		if (type == DOMRegionContext.BLOCK_TEXT) {
 			return (TextAttribute)getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
 		}
+		// workaround: make PI edges the same color as tag edges
+		else if ((type == DOMRegionContext.XML_PI_OPEN) || (type == DOMRegionContext.XML_PI_CLOSE)) {
+			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_BORDER);
+		}
 		// first try "standard" tag attributes from super class
 		return super.getAttributeFor(region);
 	}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/CharacterPairInserter.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/CharacterPairInserter.java
new file mode 100644
index 0000000..b418adc
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/CharacterPairInserter.java
@@ -0,0 +1,106 @@
+/*******************************************************************************

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

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

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

+ * which accompanies this distribution, and is available at

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

+ *

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

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

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

+

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

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

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

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

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

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

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

+import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;

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

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

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

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

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

+

+public class CharacterPairInserter extends AbstractCharacterPairInserter implements IPropertyChangeListener {

+

+	// preferences

+	private boolean fCloseStrings = true;

+	private boolean fCloseBrackets = true;

+

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

+		switch (c) {

+			case '\'':

+			case '"':

+				return fCloseStrings ? checkRegion(viewer) : false;

+			default:

+				return fCloseBrackets;

+		}

+	}

+

+	/**

+	 * Checks if the region should support paired quotes

+	 * @param viewer the viewer

+	 * @return true if the region is not in an XML attribute value

+	 */

+	private boolean checkRegion(ISourceViewer viewer) {

+		final IDocument doc = viewer.getDocument();

+		final Point selection = viewer.getSelectedRange();

+		final int offset = selection.x;

+

+		if (doc instanceof IStructuredDocument) {

+			IStructuredDocumentRegion[] regions = ((IStructuredDocument) doc).getStructuredDocumentRegions(offset, 0);

+			if (regions != null && regions.length > 0) {

+				ITextRegion region = regions[0].getRegionAtCharacterOffset(offset);

+				return region != null && region.getType() != DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE;

+			}

+		}

+		return true;

+	}

+

+	public boolean hasPair(char c) {

+		switch (c) {

+			case '"':

+			case '\'':

+			case '[':

+			case '(':

+				return true;

+			default:

+				return false;

+		}

+	}

+

+	protected char getPair(char c) {

+		switch (c) {

+			case '\'':

+			case '"':

+				return c;

+			case '(':

+				return ')';

+			case '[':

+				return ']';

+			default:

+				throw new IllegalArgumentException();

+		}

+	}

+

+	public void initialize() {

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

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

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

+		store.addPropertyChangeListener(this);

+	}

+

+	public void dispose() {

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

+	}

+

+	public void propertyChange(PropertyChangeEvent event) {

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

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

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

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

+	}

+}

diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLTemplatesWizardPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLTemplatesWizardPage.java
index f55aaa4..115042e 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLTemplatesWizardPage.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLTemplatesWizardPage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -230,16 +230,10 @@
 		GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
 		innerParent.setLayoutData(gd);
 
-		// Create linked text to just to templates preference page
-		Link link = new Link(innerParent, SWT.NONE);
-		link.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_6);
+		Label label = new Label(innerParent, SWT.NONE);
+		label.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_7);
 		data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
-		link.setLayoutData(data);
-		link.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				linkClicked();
-			}
-		});
+		label.setLayoutData(data);
 
 		// create table that displays templates
 		Table table = new Table(innerParent, SWT.BORDER | SWT.FULL_SELECTION);
@@ -294,6 +288,17 @@
 		fTemplateStore = HTMLUIPlugin.getDefault().getTemplateStore();
 		fTableViewer.setInput(fTemplateStore);
 
+		// Create linked text to just to templates preference page
+		Link link = new Link(parent, SWT.NONE);
+		link.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_6);
+		data = new GridData(SWT.END, SWT.FILL, true, false, 2, 1);
+		link.setLayoutData(data);
+		link.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				linkClicked();
+			}
+		});
+
 		configureTableResizing(innerParent, table, column1, column2);
 		loadLastSavedPreferences();
 
@@ -324,7 +329,7 @@
 			}
 		};
 		SourceViewer viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
-		((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+		viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
 		IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForHTML.ContentTypeID_HTML);
 		IDocument document = scratchModel.getStructuredDocument();
 		viewer.configure(sourceViewerConfiguration);
@@ -346,6 +351,8 @@
 		data = new GridData(GridData.FILL_BOTH);
 		data.horizontalSpan = 2;
 		data.heightHint = convertHeightInCharsToPixels(5);
+		// [261274] - source viewer was growing to fit the max line width of the template
+		data.widthHint = convertWidthInCharsToPixels(2);
 		control.setLayoutData(data);
 
 		return viewer;
@@ -436,15 +443,24 @@
 	 * Load the last template name used in New HTML File wizard.
 	 */
 	private void loadLastSavedPreferences() {
+		fLastSelectedTemplateName = ""; //$NON-NLS-1$
+		boolean setSelection = false;
 		String templateName = HTMLUIPlugin.getDefault().getPreferenceStore().getString(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
 		if (templateName == null || templateName.length() == 0) {
-			fLastSelectedTemplateName = ""; //$NON-NLS-1$
-			fUseTemplateButton.setSelection(false);
+			templateName = HTMLUIPlugin.getDefault().getPreferenceStore().getString(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_ID);
+			if (templateName != null && templateName.length() > 0) {
+				Template template = fTemplateStore.findTemplateById(templateName);
+				if (template != null) {
+					fLastSelectedTemplateName = template.getName();
+					setSelection = true;
+				}
+			}
 		}
 		else {
 			fLastSelectedTemplateName = templateName;
-			fUseTemplateButton.setSelection(true);
+			setSelection = true;
 		}
+		fUseTemplateButton.setSelection(setSelection);
 		enableTemplates();
 	}
 
diff --git a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.properties b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.properties
index b9b792e..cfa1c62 100644
--- a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.properties
+++ b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2006 IBM Corporation and others.
+# Copyright (c) 2004, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -48,4 +48,7 @@
 Templates.style.desc=style     (commented)
 Templates.style.content=<style>\n<!--\n${cursor}\n-->\n</style>
 Templates.imgmap.name=img
-Templates.imgmap.desc=img     (map)
\ No newline at end of file
+Templates.imgmap.desc=img     (map)
+Templates.html5.name=New HTML File (5)
+Templates.html5.desc=html 5
+Templates.html5.content=<!DOCTYPE html>\n<html>\n<head>\n<meta charset="${encoding}">\n<title>Insert title here</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.xml b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.xml
index b11ffb8..c600c08 100644
--- a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.xml
+++ b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -43,4 +43,6 @@
 
 <template name="%Templates.style.name" description="%Templates.style.desc" id="org.eclipse.wst.html.ui.templates.style" context="html_tag" enabled="true">%Templates.style.content</template>
 
+<template name="%Templates.html5.name" description="%Templates.html5.desc" id="org.eclipse.wst.html.ui.templates.html5" context="html_new" enabled="true">%Templates.html5.content</template>
+
 </templates>
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/.options b/bundles/org.eclipse.wst.jsdt.web.core/.options
index 89a2c96..4ac5072 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/.options
+++ b/bundles/org.eclipse.wst.jsdt.web.core/.options
@@ -1,35 +1,12 @@
-org.eclipse.jst.jsp.core/debug=true
-org.eclipse.jst.jsp.core/debug/tracefilter=
-org.eclipse.jst.jsp.core/debug/jspindexmanager=false
-org.eclipse.jst.jsp.core/debug/jsptranslation=false
-org.eclipse.jst.jsp.core/debug/jsptranslationstodisk=false
-org.eclipse.jst.jsp.core/debug/jspsearch=false
+org.eclipse.wst.jsdt.web.core/debug=true
+org.eclipse.wst.jsdt.web.core/debug/tracefilter=
+org.eclipse.wst.jsdt.web.core/debug/jsindexmanager=false
+org.eclipse.wst.jsdt.web.core/debug/jstranslation=false
+org.eclipse.wst.jsdt.web.core/debug/jstranslationstodisk=false
+org.eclipse.wst.jsdt.web.core/debug/jssearch=false
 
-org.eclipse.jst.jsp.core/taglib/resolve=false
+org.eclipse.wst.jsdt.web.core/taglib/resolve=false
 
+org.eclipse.wst.jsdt.web.core/debug/jsjavamapping=false
 
-# org.eclipse.jst.jsp.core.contentmodel.tld.TLDCMDocumentManager._debug
-org.eclipse.jst.jsp.core/debug/tldcmdocument/manager=false
-org.eclipse.jst.jsp.core/debug/tldcmdocument/cache=false
-
-# org.eclipse.jst.jsp.core.contentmodel.tld.CMDocumentFactoryTLD._debug
-org.eclipse.jst.jsp.core/debug/tldcmdocument/factory=false
-
-#org.eclipse.jst.jsp.core.internal.contentmodel.ProjectDescription._debugIndexCreation
-org.eclipse.jst.jsp.core/taglib/indexcreation=false
-#org.eclipse.jst.jsp.core.internal.contentmodel.ProjectDescription._debugIndexTime
-org.eclipse.jst.jsp.core/taglib/indextime=false
-
-#org.eclipse.jst.jsp.core.internal.contentmodel.TaglibIndex._debugEvents
-org.eclipse.jst.jsp.core/taglib/events=false
-#org.eclipse.jst.jsp.core.internal.contentmodel.TaglibIndex._debugIndexCreation
-org.eclipse.jst.jsp.core/taglib/indexcreation=false
-#org.eclipse.jst.jsp.core.internal.contentmodel.TaglibIndex._debugResolution
-org.eclipse.jst.jsp.core/taglib/resolve=false
-
-org.eclipse.jst.jsp.core/debug/jspjavamapping=false
-
-org.eclipse.jst.jsp.core/debug/jspvalidator=false
-org.eclipse.jst.jsp.core/debug/taglibvars=false
-
-org.eclipse.jst.jsp.core/debug/taglibclassloader
\ No newline at end of file
+org.eclipse.wst.jsdt.web.core/debug/jsvalidator=false
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.jsdt.web.core/META-INF/MANIFEST.MF
index 13ae8b4..48bb144 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.jsdt.web.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name.0
 Bundle-SymbolicName: org.eclipse.wst.jsdt.web.core;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.0.302.qualifier
 Bundle-Activator: org.eclipse.wst.jsdt.web.core.internal.JsCorePlugin
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: plugin
@@ -15,27 +15,21 @@
    org.eclipse.core.resources,
    org.eclipse.core.runtime",
  org.eclipse.wst.jsdt.web.core.internal.provisional.contenttype,
- org.eclipse.wst.jsdt.web.core.internal.provisional.text,
- org.eclipse.wst.jsdt.web.core.internal.tasks,
  org.eclipse.wst.jsdt.web.core.internal.validation,
  org.eclipse.wst.jsdt.web.core.javascript,
  org.eclipse.wst.jsdt.web.core.javascript.search,
  org.eclipse.wst.jsdt.web.core.text
-Require-Bundle: com.ibm.icu;bundle-version="[3.8.1,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.filebuffers;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.200,1.2.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.jface.text;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.jsdt.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.3.0,2.0.0)"
-Eclipse-LazyStart: true
-Import-Package: org.eclipse.swt.widgets,
- org.eclipse.wst.common.componentcore,
- org.eclipse.wst.common.componentcore.internal.util,
- org.eclipse.wst.common.componentcore.resources
+Import-Package: com.ibm.icu.util; version="3.8"
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.filebuffers;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.html.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.wst.validation;bundle-version="[1.2.100,2.0.0)",
+ org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.jsdt.core;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.0,2.0.0)";resolution:=optional,
+ org.eclipse.wst.common.modulecore;bundle-version="[1.1.0,2.0.0)";resolution:=optional
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
-Bundle-ActivationPolicy: lazy
+Bundle-ActivationPolicy: lazy;exclude:="org.eclipse.wst.jsdt.web.core.internal.project"
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/about.html b/bundles/org.eclipse.wst.jsdt.web.core/about.html
new file mode 100644
index 0000000..4602330
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+ 
+<p>June 2, 2006</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise 
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;).  A copy of the EPL is available 
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content.  Check the Redistributor's license that was 
+provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/build.properties b/bundles/org.eclipse.wst.jsdt.web.core/build.properties
index 8491309..0a4269e 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/build.properties
+++ b/bundles/org.eclipse.wst.jsdt.web.core/build.properties
@@ -1,9 +1,20 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
 source.. = src/
 bin.includes = .options,\
                META-INF/,\
                .,\
                plugin.properties,\
                plugin.xml,\
-               component.xml
+               component.xml,\
+               about.html
 src.includes = component.xml
               
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/plugin.properties b/bundles/org.eclipse.wst.jsdt.web.core/plugin.properties
index 708c9f7..f927b2c 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/plugin.properties
+++ b/bundles/org.eclipse.wst.jsdt.web.core/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
+# Copyright (c) 2000, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -10,9 +10,13 @@
 ###############################################################################
 
 pluginName= JavaScript Support
-providerName= Eclipse.org
+providerName= Eclipse Web Tools Platform
 Bundle-Name.0 = JSDT Web Support Core 
 Bundle-Vendor.0 = Eclipse.org
-extension.name.0 = JavaScript Embeded
-extension.name.1 = Embeded JavaScript Builder
-extension-point.name.0 = JavaScript Pre Processing
\ No newline at end of file
+extension.name.0 = JavaScript Embedded
+extension.name.1 = Embedded JavaScript Builder
+extension-point.name.0 = JavaScript Pre Processing
+javascript.validator= Client-side JavaScript
+facet.label=JavaScript
+facet.description=Enables JavaScript development using multiple source files in a configurable Include Path.
+
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/plugin.xml b/bundles/org.eclipse.wst.jsdt.web.core/plugin.xml
index e33d5b1..97393f8 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/plugin.xml
+++ b/bundles/org.eclipse.wst.jsdt.web.core/plugin.xml
@@ -3,27 +3,15 @@
 <plugin>
    <extension-point id="javascriptPreProcessor" name="%extension-point.name.0" schema="schema/javascriptPreProcessor.exsd"/>
    
-   
-   
-   
-   
    <!-- Full blown JSDT FACET -->
-  
    <extension point="org.eclipse.wst.common.project.facet.core.facets">
-	    <category id="jsdt.category">
-	    <label>JavaScript Development Toolkit</label>
-	    <description>Enables advanced JavaScript support.</description>
-	  </category>
-   
    		<project-facet id="wst.jsdt.web">
-			<label>JavaScript Toolkit</label>
-	  	 	<description>Adds advanced JavaScript editing support.</description>
-	  	 	
+			<label>%facet.label</label>
+	  	 	<description>%facet.description</description>
 	  	  	<default-version version="1.0"/>
 		</project-facet>
 	
-		<project-facet-version facet="wst.jsdt.web" version="1.0">
-		</project-facet-version>
+		<project-facet-version facet="wst.jsdt.web" version="1.0" />
 	
 		<action facet="wst.jsdt.web" type="install" id="wst.jsdt.web.install" version="1.0">
 	   		<delegate class="org.eclipse.wst.jsdt.web.core.internal.project.JsNatureInstaller"/>
@@ -40,21 +28,21 @@
 	    <facet id="wst.jsdt.web"/>
 	    <runtime-component any="true"/>
 	  </supported>
+
 	</extension>
    
-   
-   
-   
-   
-   
    <extension point="org.eclipse.wst.jsdt.web.core.javascriptPreProcessor">
    		<javascriptPreProcessor
    			class="org.eclipse.wst.jsdt.web.core.javascript.JsTranslation"
    			priority="1" />
    </extension>
    
-   <!-- Install Handler for web JSDT.. Pigybacks on wst.web facet-->
-  
+   <!-- Install Handler for web JSDT.. Piggybacks on wst.web/jst.web facet-->
+   <extension point="org.eclipse.wst.common.project.facet.core.listeners">
+      <listener class="org.eclipse.wst.jsdt.web.core.internal.project.FacetedProjectListener" eventTypes="POST_INSTALL"/>
+   </extension>
+   
+  <!--
    <extension point="org.eclipse.wst.common.project.facet.core.facets">
    
 		<event-handler facet="wst.web" type="POST_INSTALL" version="[1.0">
@@ -65,17 +53,8 @@
 			<delegate class="org.eclipse.wst.jsdt.web.core.internal.project.JsNatureUninstaller"/>
 		</event-handler>
 
-		<event-handler facet="jst.web" type="POST_INSTALL"  version="[2.0">
-	   		<delegate class="org.eclipse.wst.jsdt.web.core.internal.project.JsNatureInstaller"/>
-		</event-handler>
-	
-		<event-handler facet="jst.web" type="POST_UNINSTALL" version="[2.0">
-			<delegate class="org.eclipse.wst.jsdt.web.core.internal.project.JsNatureUninstaller"/>
-		</event-handler>
-
-	
 	</extension>
-	
+	-->
 	<!-- removed due to JUnit failures during initial WTP build
 	   <extension id="embeded.jsNature" name="%extension.name.0" point="org.eclipse.core.resources.natures"> 
 		   <runtime>          
@@ -90,66 +69,47 @@
 	    -->  
 	   
 	   <extension id="embeded.javascript" name="%extension.name.1" point="org.eclipse.core.resources.builders">       
-		   	<builder hasNature="true" callOnEmptyDelta="true">
-		   	      
+		   	<builder hasNature="true" callOnEmptyDelta="true">		   	      
 		   	<run class="org.eclipse.wst.jsdt.web.core.internal.IncrementalBuilder"/>      
 		   </builder>    
 	   </extension>
-	
-	
-	
-	
-	
-	<extension point="org.eclipse.wst.sse.core.taskscanner">
-		<scanner
-			id="org.eclipse.wst.jsdt.web.core.internal.tasks.JsFileTaskScanner"
-			class="org.eclipse.wst.jsdt.web.core.internal.tasks.JsFileTaskScanner"
-			contentTypeIds="org.eclipse.wst.html.core.htmlsource" />
-	</extension>
-	
-	
-	<extension point="org.eclipse.wst.sse.core.formatProcessors">
-		<processor
-			class="org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl"
-			contentTypeId="org.eclipse.wst.html.core.htmlsource">
-		</processor>
-	</extension>
-	
 
+	
 	<!--======================================================================================-->
-	<!-- JSP batch validation                                       						  -->
+	<!-- JS batch validation in Web files                                                     -->
 	<!--======================================================================================-->
 	<extension
 		id="JsBatchValidator"
-		name="JavaScript Syntax Validation"
-		point="org.eclipse.wst.validation.validator">
-		<validator>
-			<projectNature id="org.eclipse.wst.jsdt.core.jsNature" />
-
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.html">
-			</filter>
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.htm">
-			</filter>
-			
-			<filter
-				objectClass="org.eclipse.core.resources.IFile"
-				nameFilter="*.jsp">
-			</filter>
-			 
-
-			<helper
-				class="org.eclipse.wst.validation.internal.operations.WorkbenchContext">
-			</helper>
-
-			<run
-				enabled="false"
-				class="org.eclipse.wst.jsdt.web.core.internal.validation.JsBatchValidator">
-			</run>
-		</validator>
+		name="%javascript.validator"
+		point="org.eclipse.wst.validation.validatorV2">
+      <validator
+            build="false"
+			class="org.eclipse.wst.jsdt.web.core.internal.validation.JsValidator"
+            manual="false"
+            sourceid="org.eclipse.wst.jsdt.web.jssourcevalidator"
+            version="1"
+            markerId="org.eclipse.wst.jsdt.core.problem">
+         <include>
+            <rules>
+				<projectNature id="org.eclipse.wst.jsdt.core.jsNature" />
+			</rules>
+         </include>
+         <include>
+            <rules>
+				<fileext caseSensitive="false" ext="html"/>
+				<fileext caseSensitive="false" ext="xhtml"/>
+				<fileext caseSensitive="false" ext="htm"/>
+				<fileext caseSensitive="false" ext="htpl"/>
+				<fileext caseSensitive="false" ext="jsp"/>
+				<fileext caseSensitive="false" ext="jsf"/>
+				<fileext caseSensitive="false" ext="jsv"/>
+				<fileext caseSensitive="false" ext="jtpl"/>
+				<contentType id="org.eclipse.wst.html.core.htmlsource"/>
+				<contentType id="org.eclipse.jst.jsp.core.jspsource"/>
+			</rules>
+         </include>
+         <group id="org.eclipse.wst.sse.core.structuredModelGroup"/>
+      </validator>
 	</extension>
 	
 	<extension  point="org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer">
@@ -159,4 +119,9 @@
 	      </JsGlobalScopeContainerInitializer>
   	 </extension>
 	
+	<extension
+		id="webSourcePathProvider"
+		point="org.eclipse.wst.jsdt.core.sourcePathProvider">
+		<provider class="org.eclipse.wst.jsdt.web.core.internal.project.ModuleSourcePathProvider"/>
+	</extension>
 </plugin>
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/IncrementalBuilder.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/IncrementalBuilder.java
index 18ed63f..443bdb7 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/IncrementalBuilder.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/IncrementalBuilder.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -11,14 +21,12 @@
 import org.eclipse.core.runtime.IProgressMonitor;
 
 /**
- * @author childsb
- * 
- * Project builder-- I thought having a builder would activate the plugin, but
- * it doesn't.
- * 
- * I'm leaving it here incase we need it later.
- * 
- */
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class IncrementalBuilder extends IncrementalProjectBuilder {
 	public IncrementalBuilder() {
 		System.out.println("Unimplemented method:IncrementalProjectBuilder()"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JSPCorePluginResources.properties b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JSPCorePluginResources.properties
index 42d7e2d..f3918c6 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JSPCorePluginResources.properties
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JSPCorePluginResources.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
+# Copyright (c) 2004, 2008 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCoreMessages.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCoreMessages.java
index b3f05e6..287fc1f 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCoreMessages.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCoreMessages.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,12 +11,13 @@
 package org.eclipse.wst.jsdt.web.core.internal;
 
 import org.eclipse.osgi.util.NLS;
-
 /**
- * Strings used by JSP Core
- * 
- * @plannedfor 1.0
- */
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JsCoreMessages extends NLS {
 	private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.core.internal.JSPCorePluginResources"; //$NON-NLS-1$
 	public static String JSP_Search;
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCorePlugin.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCorePlugin.java
index d78e4cf..ef6801a 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCorePlugin.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCorePlugin.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,8 +15,12 @@
 import org.osgi.framework.BundleContext;
 
 /**
- * The main plugin class to be used in the desktop.
- */
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JsCorePlugin extends Plugin {
 	// The shared instance.
 	private static JsCorePlugin plugin;
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/Logger.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/Logger.java
index bb730e3..50ac416 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/Logger.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/Logger.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,10 +18,12 @@
 import com.ibm.icu.util.StringTokenizer;
 
 /**
- * Small convenience class to log messages to plugin's log file and also, if
- * desired, the console. This class should only be used by classes in this
- * plugin. Other plugins should make their own copy, with appropriate ID.
- */
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class Logger {
 	public static final int ERROR = IStatus.ERROR; // 4
 	public static final int ERROR_DEBUG = 200 + Logger.ERROR;
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebDocumentChangeListener.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebDocumentChangeListener.java
index 3a66250..9d4edd7 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebDocumentChangeListener.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebDocumentChangeListener.java
@@ -1,12 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
 package org.eclipse.wst.jsdt.web.core.internal.modelhandler;
 
 /**
- * @author childsb
- * 
- */
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public interface IWebDocumentChangeListener extends IWebResourceChangedListener {
 	public static final int BORING = 0;
 	public static final int DIRTY_DOC = 1;
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebResourceChangedListener.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebResourceChangedListener.java
index 1fbbfa9..4084e8b 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebResourceChangedListener.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebResourceChangedListener.java
@@ -1,12 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
 package org.eclipse.wst.jsdt.web.core.internal.modelhandler;
 
 /**
- * @author childsb
- * 
- */
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public interface IWebResourceChangedListener {
 	public void resourceChanged();
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/Messages.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/Messages.java
index adeac4e..889438f 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/Messages.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/Messages.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -5,11 +15,13 @@
 
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
-
 /**
- * @author childsb
- *
- */
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class Messages {
 	private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.core.internal.modelhandler.messages"; //$NON-NLS-1$
 
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/WebResourceChangeHandler.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/WebResourceChangeHandler.java
index 9195d32..106843f 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/WebResourceChangeHandler.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/WebResourceChangeHandler.java
@@ -14,23 +14,23 @@
 import java.util.Enumeration;
 import java.util.Hashtable;
 
+import org.eclipse.core.filebuffers.FileBuffers;
 import org.eclipse.core.resources.IResourceChangeEvent;
 import org.eclipse.core.resources.IResourceChangeListener;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.jface.text.DocumentEvent;
 import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent;
 import org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
 /**
- * Copyright IBM 2007. All rights reserved. This class maintains resource change
- * events for web document moedels. Author Bradley Childs. (childsb@us.ibm.com)
- */
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class WebResourceChangeHandler implements IResourceChangeListener, IDocumentListener, IModelLifecycleListener {
 	/*
 	 * Check the level of dirty regions when signaling for document events.
@@ -42,7 +42,7 @@
 	 * setting to true may speed things up.
 	 * 
 	 */
-	private static final boolean CHECK_INTREST_LEVEL = false;
+//	private static final boolean CHECK_INTREST_LEVEL = false;
 	private static Hashtable instances = new Hashtable();
 	private static final boolean SIGNAL_MODEL = false;
 	
@@ -77,7 +77,7 @@
 			if (!WebResourceChangeHandler.SIGNAL_MODEL) {
 				return;
 			}
-			IDOMModel xmlModel = null;
+			IStructuredModel xmlModel = null;
 			Object modelRef = getModel();
 			if (modelRef == null) {
 				return;
@@ -86,19 +86,23 @@
 // for(int i =0;i<fchangeListener.size();i++) {
 // ((IWebResourceChangedListener)fchangeListener.get(i)).resourceChanged();
 // }
-				xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForEdit(((IStructuredModel) modelRef).getBaseLocation());
+				xmlModel = (IStructuredModel) modelRef;//(IDOMModel) StructuredModelManager.getModelManager().getExistingModelForEdit(((IStructuredModel) modelRef).getBaseLocation());
 				if (xmlModel != null) {
 					IStructuredDocument doc = xmlModel.getStructuredDocument();
-					xmlModel.aboutToChangeModel();
+					try {
+						xmlModel.aboutToChangeModel();
 					// xmlModel.setReinitializeNeeded(true);
 					// (doc).replace(0, doc.getLength(),doc.get());
-					xmlModel.changedModel();
+					}
+					finally {
+						xmlModel.changedModel();
+					}
 				}
 			} catch (Exception e) {
 				System.out.println(Messages.getString("WebResourceChangeHandler.0")); //$NON-NLS-1$
 			} finally {
 				if (xmlModel != null) {
-					xmlModel.releaseFromEdit();
+//					xmlModel.releaseFromEdit();
 				}
 			}
 		}
@@ -202,6 +206,6 @@
 	public void processPreModelEvent(ModelLifecycleEvent event) {}
 	
 	public void resourceChanged(IResourceChangeEvent event) {
-		Display.getDefault().asyncExec(irritator);
+		FileBuffers.getTextFileBufferManager().execute(irritator);
 	}
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/messages.properties b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/messages.properties
index 1cd7d16..c06bf5d 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/messages.properties
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/messages.properties
@@ -1 +1,11 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
 WebResourceChangeHandler.0=Error when updating the model.
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ConvertJob.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ConvertJob.java
new file mode 100644
index 0000000..5824025
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ConvertJob.java
@@ -0,0 +1,86 @@
+/*******************************************************************************

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

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

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

+ * which accompanies this distribution, and is available at

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

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

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

+

+package org.eclipse.wst.jsdt.web.core.internal.project;

+

+import java.util.HashSet;

+import java.util.Set;

+

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

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

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

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

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

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

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

+import org.eclipse.wst.common.project.facet.core.IFacetedProject;

+import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;

+import org.eclipse.wst.common.project.facet.core.IProjectFacet;

+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;

+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;

+import org.eclipse.wst.jsdt.internal.core.util.Messages;

+import org.eclipse.wst.jsdt.web.core.internal.Logger;

+

+/**

+ * Installs the JSDT facet, if asked, and setting it as a "fixed" facet.

+ * 

+ */

+class ConvertJob extends WorkspaceJob {

+	final static String JSDT_FACET = "wst.jsdt.web";

+	private IProject fProject;

+	private boolean fInstall = true;

+	private boolean fUseExplicitWorkingCopy = false;

+

+	ConvertJob(IProject project, boolean install, boolean useExplicitWorkingCopy) {

+		super(Messages.converter_ConfiguringForJavaScript);

+		fProject = project;

+		fInstall = install;

+		fUseExplicitWorkingCopy = useExplicitWorkingCopy;

+	}

+

+	public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {

+		try {

+			IProjectFacet projectFacet = ProjectFacetsManager.getProjectFacet(JSDT_FACET);

+			IFacetedProject facetedProject = ProjectFacetsManager.create(fProject);

+

+			if (facetedProject != null && fProject.isAccessible()) {

+				if (fInstall) {

+					IProjectFacetVersion latestVersion = projectFacet.getLatestVersion();

+					facetedProject.installProjectFacet(latestVersion, null, monitor);

+				}

+

+

+				if (fUseExplicitWorkingCopy) {

+					IFacetedProjectWorkingCopy copy = facetedProject.createWorkingCopy();

+					Set fixed = new HashSet(facetedProject.getFixedProjectFacets());

+					fixed.add(projectFacet);

+					copy.setFixedProjectFacets(fixed);

+					copy.commitChanges(new NullProgressMonitor());

+				}

+				else {

+					Set fixed = new HashSet(facetedProject.getFixedProjectFacets());

+					if (!fixed.contains(projectFacet)) {

+						fixed.add(projectFacet);

+						facetedProject.setFixedProjectFacets(fixed);

+					}

+				}

+			}

+		}

+		catch (IllegalArgumentException e) {

+			// unknown facet ID, bad installation configuration?

+		}

+		catch (Exception e) {

+			Logger.logException(e);

+		}

+		return Status.OK_STATUS;

+	}

+

+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/FacetedProjectListener.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/FacetedProjectListener.java
new file mode 100644
index 0000000..d1a9abc
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/FacetedProjectListener.java
@@ -0,0 +1,47 @@
+/*******************************************************************************

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

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

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

+ * which accompanies this distribution, and is available at

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

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

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

+

+package org.eclipse.wst.jsdt.web.core.internal.project;

+

+import java.util.Arrays;

+import java.util.Collection;

+

+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;

+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;

+import org.eclipse.wst.common.project.facet.core.events.IProjectFacetActionEvent;

+

+public class FacetedProjectListener implements IFacetedProjectListener {

+	final static Collection INTERESTING_FACETS = Arrays.asList(new Object[]{"wst.web", "jst.web"});

+

+	/**

+	 * 

+	 */

+	public FacetedProjectListener() {

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see

+	 * org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener

+	 * #handleEvent(org.eclipse.wst.common.project.facet.core.events.

+	 * IFacetedProjectEvent)

+	 */

+	public void handleEvent(IFacetedProjectEvent event) {

+		if (event.getType() == IFacetedProjectEvent.Type.POST_INSTALL) {

+			IProjectFacetActionEvent actionEvent = (IProjectFacetActionEvent) event;

+			if (INTERESTING_FACETS.contains(actionEvent.getProjectFacet().getId())) {

+				new ConvertJob(event.getProject().getProject(), true, true).schedule(1000);

+			}

+		}

+	}

+

+}

diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureInstaller.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureInstaller.java
index eb601ec..8877270 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureInstaller.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureInstaller.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.core.internal.project;
 
 import org.eclipse.core.resources.IProject;
@@ -6,11 +16,16 @@
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.wst.common.project.facet.core.IDelegate;
 import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
 import org.eclipse.wst.jsdt.web.core.internal.JsCorePlugin;
-
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JsNatureInstaller implements IDelegate {
 	public void execute(IProject project, IProjectFacetVersion fv, Object config, IProgressMonitor monitor) throws CoreException {
 		if (monitor == null) {
@@ -27,13 +42,14 @@
 	public void installNature(IProject project, IProgressMonitor monitor) throws CoreException {
 		monitor.beginTask(Messages.getString("JsNatureInstaller.1"), 100); //$NON-NLS-1$
 		monitor.subTask(Messages.getString("JsNatureInstaller.2")); //$NON-NLS-1$
-		SubProgressMonitor sub = new SubProgressMonitor(monitor, 25);
 		try {
 			monitor.worked(20);
 			JsWebNature jsNature = new JsWebNature(project, monitor);
 			monitor.worked(20);
 			jsNature.configure();
 			monitor.worked(40);
+			
+			new ConvertJob(project, false, true).schedule(1000);
 		} catch (Exception e) {
 			throw new CoreException(new Status(IStatus.ERROR, JsCorePlugin.PLUGIN_ID, IStatus.OK, Messages.getString("JsNatureInstaller.3"), e)); //$NON-NLS-1$
 		}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureUninstaller.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureUninstaller.java
index 0da8478..c59fc6d 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureUninstaller.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureUninstaller.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.core.internal.project;
 
 import org.eclipse.core.resources.IProject;
@@ -7,11 +17,16 @@
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.wst.common.project.facet.core.IDelegate;
 import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
 import org.eclipse.wst.jsdt.web.core.internal.JsCorePlugin;
-
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JsNatureUninstaller implements IDelegate {
 	public void execute(IProject project, IProjectFacetVersion fv, Object config, IProgressMonitor monitor) throws CoreException {
 		if (monitor == null) {
@@ -29,7 +44,6 @@
 		monitor.beginTask(Messages.getString("JsNatureUninstaller.1"), 100); //$NON-NLS-1$
 		// by using natures we can leverage the precondition support
 		monitor.subTask(Messages.getString("JsNatureUninstaller.2")); //$NON-NLS-1$
-		SubProgressMonitor sub = new SubProgressMonitor(monitor, 25);
 		if (!JsWebNature.hasNature(project)) {
 			return;
 		}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsWebNature.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsWebNature.java
index d113269..d8c3448 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsWebNature.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsWebNature.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.core.internal.project;
 
 import java.util.Arrays;
@@ -13,23 +23,31 @@
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.OperationCanceledException;
 import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.IClasspathEntry;
-import org.eclipse.wst.jsdt.core.JavaCore;
+import org.eclipse.wst.jsdt.core.IAccessRule;
+import org.eclipse.wst.jsdt.core.IIncludePathAttribute;
+import org.eclipse.wst.jsdt.core.IIncludePathEntry;
+import org.eclipse.wst.jsdt.core.JavaScriptCore;
 import org.eclipse.wst.jsdt.core.LibrarySuperType;
-
 import org.eclipse.wst.jsdt.internal.core.JavaProject;
+import org.eclipse.wst.jsdt.internal.core.util.ConvertUtility;
 //import org.eclipse.wst.jsdt.ui.PreferenceConstants;
-
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JsWebNature implements IProjectNature {
 	//private static final String FILENAME_CLASSPATH = ".classpath"; //$NON-NLS-1$
 	// private static final String NATURE_IDS[] =
-	// {"org.eclipse.wst.jsdt.web.core.embeded.jsNature",JavaCore.NATURE_ID};
+	// {"org.eclipse.wst.jsdt.web.core.embeded.jsNature",JavaScriptCore.NATURE_ID};
 	// //$NON-NLS-1$
-	private static final String NATURE_IDS[] = { JavaCore.NATURE_ID };
+	private static final String NATURE_IDS[] = { JavaScriptCore.NATURE_ID };
 
 	public static final IPath VIRTUAL_BROWSER_CLASSPATH = new Path("org.eclipse.wst.jsdt.launching.baseBrowserLibrary"); //$NON-NLS-1$
 	public static final String VIRTUAL_CONTAINER = "org.eclipse.wst.jsdt.launching.WebProject"; //$NON-NLS-1$
-	public static final IClasspathEntry VIRTUAL_SCOPE_ENTRY = JavaCore.newContainerEntry(new Path(VIRTUAL_CONTAINER));
+	public static final IIncludePathEntry VIRTUAL_SCOPE_ENTRY = JavaScriptCore.newContainerEntry(new Path(VIRTUAL_CONTAINER),  new IAccessRule[0], new IIncludePathAttribute[] {IIncludePathAttribute.HIDE}, false);
 	private static final String SUPER_TYPE_NAME = "Window"; //$NON-NLS-1$
 	private static final String SUPER_TYPE_LIBRARY = "org.eclipse.wst.jsdt.launching.baseBrowserLibrary"; //$NON-NLS-1$
 	
@@ -45,7 +63,7 @@
 			String[] prevNatures = description.getNatureIds();
 			String[] newNatures = new String[prevNatures.length + JsWebNature.NATURE_IDS.length];
 			System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
-			// newNatures[prevNatures.length] = JavaCore.NATURE_ID;
+			// newNatures[prevNatures.length] = JavaScriptCore.NATURE_ID;
 			for (int i = 0; i < JsWebNature.NATURE_IDS.length; i++) {
 				newNatures[prevNatures.length + i] = JsWebNature.NATURE_IDS[i];
 			}
@@ -82,7 +100,7 @@
 			int k = 0;
 			head: for (int i = 0; i < prevNatures.length; i++) {
 				for (int j = 0; j < JsWebNature.NATURE_IDS.length; j++) {
-					if (prevNatures[i] == JsWebNature.NATURE_IDS[j]) {
+					if (prevNatures[i].equals(JsWebNature.NATURE_IDS[j])) {
 						continue head;
 					}
 				}
@@ -124,7 +142,7 @@
 		initLocalClassPath();
 		
 		if (hasProjectClassPathFile()) {
-			IClasspathEntry[] entries = getRawClassPath();
+			IIncludePathEntry[] entries = getRawClassPath();
 			if (entries != null && entries.length > 0) {
 				classPathEntries.removeAll(Arrays.asList(entries));
 				classPathEntries.addAll(Arrays.asList(entries));
@@ -132,14 +150,14 @@
 		}
 		
 		JsWebNature.addJsNature(fCurrProject, monitor);
-		fJavaProject = (JavaProject) JavaCore.create(fCurrProject);
+		fJavaProject = (JavaProject) JavaScriptCore.create(fCurrProject);
 		fJavaProject.setProject(fCurrProject);
 		try {
 			// , fOutputLocation
 			if (!hasProjectClassPathFile()) {
-				fJavaProject.setRawClasspath((IClasspathEntry[]) classPathEntries.toArray(new IClasspathEntry[] {}), fOutputLocation, monitor);
+				fJavaProject.setRawIncludepath((IIncludePathEntry[]) classPathEntries.toArray(new IIncludePathEntry[] {}), fOutputLocation, monitor);
 			}else{
-				fJavaProject.setRawClasspath((IClasspathEntry[]) classPathEntries.toArray(new IClasspathEntry[] {}), monitor);
+				fJavaProject.setRawIncludepath((IIncludePathEntry[]) classPathEntries.toArray(new IIncludePathEntry[] {}), monitor);
 			}
 		} catch (Exception e) {
 			System.out.println(e);
@@ -154,17 +172,21 @@
 		if (hasAValidSourcePath()) {
 			return;
 		}
+		IIncludePathEntry[] entries = new ConvertUtility(fCurrProject).getDefaultSourcePaths(fCurrProject);
+		for (int i = 0; i < entries.length; i++) {
+			classPathEntries.add(entries[i]);
+		}
 		// IPath projectPath = fCurrProject.getFullPath();
-		// classPathEntries.add(JavaCore.newSourceEntry(projectPath));
+		// classPathEntries.add(JavaScriptCore.newSourceEntry(projectPath));
 	}
 	
 	public void deconfigure() throws CoreException {
 		Vector badEntries = new Vector();
-		IClasspathEntry defaultJRELibrary =  getJreEntry();
-		IClasspathEntry[] localEntries = initLocalClassPath();
+		IIncludePathEntry defaultJRELibrary =  getJreEntry();
+		IIncludePathEntry[] localEntries = initLocalClassPath();
 		badEntries.add(defaultJRELibrary);
 		badEntries.addAll(Arrays.asList(localEntries));
-		IClasspathEntry[] entries = getRawClassPath();
+		IIncludePathEntry[] entries = getRawClassPath();
 		Vector goodEntries = new Vector();
 		for (int i = 0; i < entries.length; i++) {
 			if (!badEntries.contains(entries[i])) {
@@ -173,7 +195,7 @@
 		}
 		// getJavaProject().removeFromBuildSpec(BUILDER_ID);
 		IPath outputLocation = getJavaProject().getOutputLocation();
-		getJavaProject().setRawClasspath((IClasspathEntry[]) goodEntries.toArray(new IClasspathEntry[] {}), outputLocation, monitor);
+		getJavaProject().setRawIncludepath((IIncludePathEntry[]) goodEntries.toArray(new IIncludePathEntry[] {}), outputLocation, monitor);
 		getJavaProject().deconfigure();
 		JsWebNature.removeJsNature(fCurrProject, monitor);
 		fCurrProject.refreshLocal(IResource.DEPTH_INFINITE, monitor);
@@ -181,7 +203,7 @@
 	
 	public JavaProject getJavaProject() {
 		if (fJavaProject == null) {
-			fJavaProject = (JavaProject) JavaCore.create(fCurrProject);
+			fJavaProject = (JavaProject) JavaScriptCore.create(fCurrProject);
 			fJavaProject.setProject(fCurrProject);
 		}
 		return fJavaProject;
@@ -191,18 +213,18 @@
 		return this.fCurrProject;
 	}
 	
-	private IClasspathEntry[] getRawClassPath() {
+	private IIncludePathEntry[] getRawClassPath() {
 		JavaProject proj = new JavaProject();
 		proj.setProject(fCurrProject);
-		return proj.readRawClasspath();
+		return proj.readRawIncludepath();
 	}
 	
 	private boolean hasAValidSourcePath() {
 		if (hasProjectClassPathFile()) {
 			try {
-				IClasspathEntry[] entries = getRawClassPath();
+				IIncludePathEntry[] entries = getRawClassPath();
 				for (int i = 0; i < entries.length; i++) {
-					if (entries[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) {
+					if (entries[i].getEntryKind() == IIncludePathEntry.CPE_SOURCE) {
 						return true;
 					}
 				}
@@ -222,14 +244,14 @@
 		return fCurrProject.getFolder(JavaProject.DEFAULT_PREFERENCES_DIRNAME).getFile(JavaProject.CLASSPATH_FILENAME).exists();
 	}
 	
-	private IClasspathEntry getJreEntry() {
-		return JavaCore.newContainerEntry(new Path(DEFAULT_JRE_PATH));
+	private IIncludePathEntry getJreEntry() {
+		return JavaScriptCore.newContainerEntry(new Path(DEFAULT_JRE_PATH));
 	}
 	
 	private void initJREEntry() {
-		IClasspathEntry defaultJRELibrary =  getJreEntry();
+		IIncludePathEntry defaultJRELibrary =  getJreEntry();
 		try {
-			IClasspathEntry[] entries = getRawClassPath();
+			IIncludePathEntry[] entries = getRawClassPath();
 			for (int i = 0; i < entries.length; i++) {
 				if (entries[i] == defaultJRELibrary) {
 					return;
@@ -243,15 +265,15 @@
 		}
 	}
 	
-	private IClasspathEntry[] initLocalClassPath() {
+	private IIncludePathEntry[] initLocalClassPath() {
 		
 		classPathEntries.add(JsWebNature.VIRTUAL_SCOPE_ENTRY);
-		IClasspathEntry browserLibrary = JavaCore.newContainerEntry( VIRTUAL_BROWSER_CLASSPATH);
+		IIncludePathEntry browserLibrary = JavaScriptCore.newContainerEntry( VIRTUAL_BROWSER_CLASSPATH);
 		classPathEntries.add(browserLibrary);
 		//IPath webRoot = WebRootFinder.getWebContentFolder(fCurrProject);
-	//	IClasspathEntry source = JavaCore.newSourceEntry(fCurrProject.getFullPath().append(webRoot).append("/"));
+	//	IIncludePathEntry source = JavaScriptCore.newSourceEntry(fCurrProject.getFullPath().append(webRoot).append("/"));
 	//	classPathEntries.add(source);
-		return new IClasspathEntry[] { JsWebNature.VIRTUAL_SCOPE_ENTRY , browserLibrary/*,source*/};
+		return new IIncludePathEntry[] { JsWebNature.VIRTUAL_SCOPE_ENTRY , browserLibrary/*,source*/};
 	}
 	
 	private void initOutputPath() {
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/Messages.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/Messages.java
index a00b64f..3c2697f 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/Messages.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/Messages.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -7,9 +17,12 @@
 import java.util.ResourceBundle;
 
 /**
- * @author childsb
- *
- */
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class Messages {
 	private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.core.internal.project.messages"; //$NON-NLS-1$
 
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupport.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupport.java
new file mode 100644
index 0000000..a17da6a
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupport.java
@@ -0,0 +1,198 @@
+/*******************************************************************************

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

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

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

+ * which accompanies this distribution, and is available at

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

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

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

+package org.eclipse.wst.jsdt.web.core.internal.project;

+

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

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

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

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

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

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

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

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

+import org.eclipse.core.runtime.IPath;

+import org.eclipse.core.runtime.Path;

+

+/**

+ * This class encapsulates any used Module Core APIs along with fallbacks for

+ * use on non-compliant projects and when those services are not available at

+ * runtime.

+ * 

+ * Because ModuleCore API calls can result in locks needing to be acquired,

+ * none of these methods should be called while other thread locks have

+ * already been acquired.

+ */

+public final class ModuleCoreSupport {

+	static final boolean _dump_NCDFE = false;

+	private static final String WEB_INF = "WEB-INF"; //$NON-NLS-1$

+	private static final IPath WEB_INF_PATH = new Path(WEB_INF);

+

+	/**

+	 * @param project

+	 * @return the computed IPath to the "root" of the web contents, either

+	 *         from facet knowledge or hueristics, or null if one can not be

+	 *         determined

+	 */

+	public static IPath computeWebContentRootPath(IPath path) {

+		IPath root = null;

+		try {

+			root = ModuleCoreSupportDelegate.getWebContentRootPath(ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0)));

+		}

+		catch (NoClassDefFoundError e) {

+			if (_dump_NCDFE)

+				e.printStackTrace();

+		}

+		if (root == null) {

+			/*

+			 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=213245

+			 * 

+			 * NPE in JSPTaglibDirectiveContentAssistProcessor with

+			 * non-faceted project

+			 */

+			root = getLocalRoot(path);

+		}

+		return root;

+	}

+

+	/**

+	 * @param project

+	 * @return the IPath to the "root" of the web contents

+	 */

+	public static IPath getWebContentRootPath(IProject project) {

+		if (project == null)

+			return null;

+

+		IPath path = null;

+		try {

+			path = ModuleCoreSupportDelegate.getWebContentRootPath(project);

+		}

+		catch (NoClassDefFoundError e) {

+			if (_dump_NCDFE)

+				e.printStackTrace();

+		}

+		return path;

+	}

+

+	/**

+	 * @param path

+	 *            - the full path to a resource within the workspace

+	 * @return - the runtime path of the resource if one exists, null

+	 *         otherwise

+	 */

+	public static IPath getRuntimePath(IPath path) {

+		IPath result = null;

+		try {

+			result = ModuleCoreSupportDelegate.getRuntimePath(path);

+		}

+		catch (NoClassDefFoundError e) {

+			if (_dump_NCDFE)

+				e.printStackTrace();

+		}

+		if (result == null) {

+			IPath root = getLocalRoot(path);

+			result = path.removeFirstSegments(root.segmentCount()).makeAbsolute();

+		}

+		return result;

+	}

+

+	/**

+	 * @param basePath

+	 *            - the full path to a resource within the workspace

+	 * @param reference

+	 *            - the reference string to resolve

+	 * @return - the full path within the workspace that corresponds to the

+	 *         given reference according to the virtual pathing support

+	 */

+	public static IPath resolve(IPath basePath, String reference) {

+		IPath resolvedPath = null;

+		try {

+			resolvedPath = ModuleCoreSupportDelegate.resolve(basePath, reference);

+		}

+		catch (NoClassDefFoundError e) {

+			if (_dump_NCDFE)

+				e.printStackTrace();

+		}

+

+		if (resolvedPath == null) {

+			IPath rootPath = getLocalRoot(basePath);

+			if (reference.startsWith(Path.ROOT.toString())) {

+				resolvedPath = rootPath.append(reference);

+			}

+			else {

+				resolvedPath = basePath.removeLastSegments(1).append(reference);

+			}

+		}

+

+		return resolvedPath;

+	}

+

+	/**

+	 * @param basePath

+	 * @return the applicable Web context root path, if one exists

+	 */

+	private static IPath getLocalRoot(IPath basePath) {

+		IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();

+

+		// existing workspace resources - this is the 93% case

+		IResource file = FileBuffers.getWorkspaceFileAtLocation(basePath);

+

+		// Try the base path as a folder first

+		if (file == null && basePath.segmentCount() > 1) {

+			file = workspaceRoot.getFolder(basePath);

+		}

+		// If not a folder, then try base path as a file

+		if (file != null && !file.exists() && basePath.segmentCount() > 1) {

+			file = workspaceRoot.getFile(basePath);

+		}

+

+		if (file == null && basePath.segmentCount() == 1) {

+			file = workspaceRoot.getProject(basePath.segment(0));

+		}

+

+		if (file == null) {

+			/*

+			 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=116529

+			 * 

+			 * This method produces a less accurate result, but doesn't

+			 * require that the file exist yet.

+			 */

+			IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(basePath);

+			if (files.length > 0)

+				file = files[0];

+		}

+

+		while (file != null) {

+			/**

+			 * Treat any parent folder with a WEB-INF subfolder as a web-app

+			 * root

+			 */

+			IContainer folder = null;

+			if ((file.getType() & IResource.FOLDER) != 0) {

+				folder = (IContainer) file;

+			}

+			else {

+				folder = file.getParent();

+			}

+			// getFolder on a workspace root must use a full path, skip

+			if (folder != null && (folder.getType() & IResource.ROOT) == 0) {

+				IFolder webinf = folder.getFolder(WEB_INF_PATH);

+				if (webinf != null && webinf.exists()) {

+					return folder.getFullPath();

+				}

+			}

+			file = file.getParent();

+		}

+

+		return basePath.uptoSegment(1);

+	}

+

+

+}

diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupportDelegate.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupportDelegate.java
new file mode 100644
index 0000000..e8b6112
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleCoreSupportDelegate.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.core.internal.project;
+
+import java.lang.ref.Reference;
+import java.lang.ref.SoftReference;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.ModuleCoreNature;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
+import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
+
+/**
+ * Wrapper class for all Facet and ModuleCore-related calls. If the Facet or
+ * ModuleCore bundles are not available, this class will not load, or if it
+ * does, its methods will cause NoClassDefFoundErrors. This allows us to
+ * compartmentalize the dependencies.
+ * 
+ */
+final class ModuleCoreSupportDelegate {
+	private static final String SLASH = "/";
+	private static Map fResolvedMap = new HashMap();
+
+	/**
+	 * @param path
+	 *            - the full path to a resource within the workspace
+	 * @return - the runtime path of the resource if one exists, null
+	 *         otherwise
+	 */
+	static IPath getRuntimePath(IPath path) {
+		if (path == null)
+			return null;
+
+		IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0));
+
+		if (!ModuleCoreNature.isFlexibleProject(project))
+			return null;
+
+		IVirtualResource[] virtualResources = ComponentCore.createResources(ResourcesPlugin.getWorkspace().getRoot().getFile(path));
+		if (virtualResources != null && virtualResources.length > 0) {
+			return virtualResources[0].getRuntimePath();
+		}
+		return null;
+	}
+
+	/**
+	 * @param project
+	 * @return the IPath to the "root" of the web contents
+	 */
+	static IPath getWebContentRootPath(IProject project) {
+		if (project == null)
+			return null;
+
+		if (!ModuleCoreNature.isFlexibleProject(project))
+			return null;
+
+		IPath path = null;
+		IVirtualComponent component = ComponentCore.createComponent(project);
+		if (component != null && component.exists()) {
+			path = component.getRootFolder().getWorkspaceRelativePath();
+		}
+		return path;
+	}
+
+	/**
+	 * @param basePath
+	 *            - the full path to a resource within the workspace
+	 * @param reference
+	 *            - the reference string to resolve
+	 * @return - the full path within the workspace that corresponds to the
+	 *         given reference according to the virtual pathing support
+	 */
+	static IPath resolve(IPath basePath, String reference) {
+		if (reference == null || basePath == null || basePath.segmentCount() == 0)
+			return null;
+
+		IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0));
+
+		if (!ModuleCoreNature.isFlexibleProject(project))
+			return null;
+
+		if (basePath.segmentCount() > 1) {
+			/*
+			 * It can take the better part of a full second to do this, so
+			 * cache the result.
+			 */
+			IPath resolved = null;
+			Map mapForBaseResource = null;
+			mapForBaseResource = (Map) fResolvedMap.get(basePath);
+			if (mapForBaseResource != null) {
+				Reference resolvedReference = (Reference) mapForBaseResource.get(reference);
+				if (resolvedReference != null)
+					resolved = (IPath) resolvedReference.get();
+			}
+			else {
+				mapForBaseResource = new HashMap();
+				fResolvedMap.put(basePath, mapForBaseResource);
+			}
+
+			if (resolved == null) {
+				IFile baseFile = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
+				IVirtualResource[] virtualResources = ComponentCore.createResources(baseFile);
+				for (int i = 0; i < virtualResources.length; i++) {
+					IPath baseRuntimePath = virtualResources[i].getRuntimePath();
+					IPath referenceRuntimePath = null;
+					if (reference.startsWith(SLASH)) {
+						referenceRuntimePath = new Path(reference);
+					}
+					else {
+						referenceRuntimePath = baseRuntimePath.removeLastSegments(1).append(reference);
+					}
+					IVirtualFile virtualFile = ComponentCore.createFile(project, referenceRuntimePath);
+					if (virtualFile != null && virtualFile.exists()) {
+						IFile[] underlyingFiles = virtualFile.getUnderlyingFiles();
+						for (int j = 0; j < underlyingFiles.length; j++) {
+							if (underlyingFiles[j].getProject().equals(project) && underlyingFiles[j].exists()) {
+								mapForBaseResource.put(reference, new SoftReference(underlyingFiles[j].getFullPath()));
+								resolved = underlyingFiles[j].getFullPath();
+							}
+
+						}
+					}
+				}
+			}
+			return resolved;
+		}
+		else {
+			IVirtualFile virtualFile = ComponentCore.createFile(project, new Path(reference));
+			if (virtualFile != null && virtualFile.exists()) {
+				return virtualFile.getUnderlyingFile().getFullPath();
+			}
+		}
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleSourcePathProvider.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleSourcePathProvider.java
new file mode 100644
index 0000000..3a98b89
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/ModuleSourcePathProvider.java
@@ -0,0 +1,52 @@
+/*******************************************************************************

+ * Copyright (c) 2010 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+package org.eclipse.wst.jsdt.web.core.internal.project;

+

+import org.eclipse.core.resources.IProject;

+import org.eclipse.core.resources.IResource;

+import org.eclipse.core.runtime.IPath;

+import org.eclipse.core.runtime.Path;

+import org.eclipse.wst.common.componentcore.ComponentCore;

+import org.eclipse.wst.common.componentcore.ModuleCoreNature;

+import org.eclipse.wst.common.componentcore.resources.IVirtualFile;

+import org.eclipse.wst.jsdt.core.IIncludePathEntry;

+import org.eclipse.wst.jsdt.core.JavaScriptCore;

+import org.eclipse.wst.jsdt.internal.core.util.DefaultSourcePathProvider;

+

+public class ModuleSourcePathProvider extends DefaultSourcePathProvider {

+

+	public ModuleSourcePathProvider() {

+	}

+

+	public IIncludePathEntry[] getDefaultSourcePaths(IProject p) {

+		if (ModuleCoreNature.isFlexibleProject(p)) {

+			IVirtualFile root = ComponentCore.createFile(p, Path.ROOT);

+			IResource[] underlyingResources = root.getUnderlyingResources();

+			if (underlyingResources == null || underlyingResources.length == 0) {

+				underlyingResources = new IResource[]{root.getUnderlyingResource()};

+			}

+			if (underlyingResources.length > 0 && underlyingResources[0] != null) {

+				IPath[] paths = new IPath[underlyingResources.length];

+				for (int i = 0; i < underlyingResources.length; i++) {

+					paths[i] = underlyingResources[i].getFullPath();

+				}

+				if (paths.length > 0) {

+					IIncludePathEntry[] entries = new IIncludePathEntry[paths.length];

+					for (int i = 0; i < paths.length; i++) {

+						entries[i] = JavaScriptCore.newSourceEntry(paths[i]);

+					}

+					return entries;

+				}

+			}

+		}

+		return super.getDefaultSourcePaths(p);

+	}

+}

diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/WebProjectJsGlobalScopeContainerInitializer.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/WebProjectJsGlobalScopeContainerInitializer.java
index fb456f3..f5c4960 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/WebProjectJsGlobalScopeContainerInitializer.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/WebProjectJsGlobalScopeContainerInitializer.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -8,8 +18,8 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.IClasspathEntry;
-import org.eclipse.wst.jsdt.core.IJavaProject;
+import org.eclipse.wst.jsdt.core.IIncludePathEntry;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
 import org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer;
 import org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer;
 import org.eclipse.wst.jsdt.core.compiler.libraries.LibraryLocation;
@@ -17,9 +27,12 @@
 import org.eclipse.wst.jsdt.web.core.javascript.WebRootFinder;
 
 /**
- * @author childsb
- * 
- */
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class WebProjectJsGlobalScopeContainerInitializer extends JsGlobalScopeContainerInitializer  {
 	private static final String CONTAINER_DESCRIPTION = Messages.getString("WebProjectJsGlobalScopeContainerInitializer.0"); //$NON-NLS-1$
 	
@@ -28,7 +41,7 @@
 	private static final String MANGLED_BUTT1 = "htm"; //$NON-NLS-1$
 	private static final String MANGLED_BUTT2 = ".js"; //$NON-NLS-1$
 	
-	//private IJavaProject javaProject;
+	//private IJavaScriptProject javaProject;
 	
 	
 	private static String getUnmangedHtmlPath(String containerPathString) {
@@ -50,16 +63,16 @@
 	 * (non-Javadoc)
 	 * 
 	 * @see org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer#canUpdateJsGlobalScopeContainer(org.eclipse.core.runtime.IPath,
-	 *      org.eclipse.wst.jsdt.core.IJavaProject)
+	 *      org.eclipse.wst.jsdt.core.IJavaScriptProject)
 	 */
 	
-	public boolean canUpdateJsGlobalScopeContainer(IPath containerPath, IJavaProject project) {
+	public boolean canUpdateJsGlobalScopeContainer(IPath containerPath, IJavaScriptProject project) {
 		/* dont remove from this project */
 		return false;
 	}
 	
 	
-	protected IJsGlobalScopeContainer getContainer(IPath containerPath, IJavaProject project) {
+	protected IJsGlobalScopeContainer getContainer(IPath containerPath, IJavaScriptProject project) {
 		return this;
 	}
 	
@@ -72,10 +85,10 @@
 	 * (non-Javadoc)
 	 * 
 	 * @see org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer#getDescription(org.eclipse.core.runtime.IPath,
-	 *      org.eclipse.wst.jsdt.core.IJavaProject)
+	 *      org.eclipse.wst.jsdt.core.IJavaScriptProject)
 	 */
 	
-	public String getDescription(IPath containerPath, IJavaProject javaProject) {
+	public String getDescription(IPath containerPath, IJavaScriptProject javaProject) {
 		if (containerPath.equals(new Path(JsWebNature.VIRTUAL_CONTAINER))) {
 			return WebProjectJsGlobalScopeContainerInitializer.CONTAINER_DESCRIPTION;
 		}
@@ -104,7 +117,7 @@
 	 * @see org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer#getHostPath(org.eclipse.core.runtime.IPath)
 	 */
 	
-	public URI getHostPath(IPath path, IJavaProject project) {
+	public URI getHostPath(IPath path, IJavaScriptProject project) {
 		// TODO Auto-generated method stub
 		String htmlPath = WebProjectJsGlobalScopeContainerInitializer.getUnmangedHtmlPath(path.toString());
 		if (htmlPath != null) {
@@ -137,22 +150,28 @@
 		return new Path(JsWebNature.VIRTUAL_CONTAINER);
 	}
 
-	public IClasspathEntry[] getClasspathEntries() {
+	/**
+	 * @deprecated Use {@link #getIncludepathEntries()} instead
+	 */
+	public IIncludePathEntry[] getClasspathEntries() {
+		return getIncludepathEntries();
+	}
+	public IIncludePathEntry[] getIncludepathEntries() {
 		
-		//IClasspathEntry entry=null;
+		//IIncludePathEntry entry=null;
 		
-	return new IClasspathEntry[0];
+	return new IIncludePathEntry[0];
 //		try {
 //		
 //			
 //			
 //			IPath contextPath = getWebContextRoot(javaProject);
-//			//entry =JavaCore.newLibraryEntry(contextPath.makeAbsolute(), null,null, new IAccessRule[0], new IClasspathAttribute[0], true);
-//			//entry =JavaCore.newLibraryEntry(contextPath.makeAbsolute(), null, null, new IAccessRule[0], new IClasspathAttribute[0], true);
-//			//entry =JavaCore.newSourceEntry(contextPath.makeAbsolute());
+//			//entry =JavaScriptCore.newLibraryEntry(contextPath.makeAbsolute(), null,null, new IAccessRule[0], new IIncludePathAttribute[0], true);
+//			//entry =JavaScriptCore.newLibraryEntry(contextPath.makeAbsolute(), null, null, new IAccessRule[0], new IIncludePathAttribute[0], true);
+//			//entry =JavaScriptCore.newSourceEntry(contextPath.makeAbsolute());
 //			entry = new ClasspathEntry(
 //					IPackageFragmentRoot.K_SOURCE,
-//					IClasspathEntry.CPE_SOURCE,
+//					IIncludePathEntry.CPE_SOURCE,
 //					contextPath.makeAbsolute(),
 //					ClasspathEntry.INCLUDE_ALL, ClasspathEntry.EXCLUDE_NONE,
 //					null, // source attachment
@@ -161,23 +180,23 @@
 //					false,
 //					null,
 //					false, // no access rules to combine
-//					new IClasspathAttribute[] {ClasspathEntry.EXCLUDE_VALIDATE}); 
+//					new IIncludePathAttribute[] {ClasspathEntry.EXCLUDE_VALIDATE}); 
 //			
 //		} catch (RuntimeException ex) {
 //			// TODO Auto-generated catch block
 //			ex.printStackTrace();
 //		}
 //		
-//		if(entry!=null) return new IClasspathEntry[] {entry};
-//		return new IClasspathEntry[0];
+//		if(entry!=null) return new IIncludePathEntry[] {entry};
+//		return new IIncludePathEntry[0];
 	}
-	public void initialize(IPath containerPath, IJavaProject project) throws CoreException {
+	public void initialize(IPath containerPath, IJavaScriptProject project) throws CoreException {
 		//this.javaProject = project;
 		super.initialize(containerPath, project);
 		
 	}
 	
-	public static IPath getWebContextRoot(IJavaProject javaProject) {
+	public static IPath getWebContextRoot(IJavaScriptProject javaProject) {
 		String webRoot = WebRootFinder.getWebContentFolder(javaProject.getProject()).toString();	
 		IPath webRootPath = javaProject.getPath().append(webRoot);
 		return webRootPath;
@@ -194,7 +213,7 @@
 //					{
 //						IPath path = proxy.requestResource().getLocation();
 //						found.add(path);
-//						//IClasspathEntry newLibraryEntry = JavaCore.newLibraryEntry( path,null, null, new IAccessRule[ 0 ], new IClasspathAttribute[ 0 ], true );
+//						//IIncludePathEntry newLibraryEntry = JavaScriptCore.newLibraryEntry( path,null, null, new IAccessRule[ 0 ], new IIncludePathAttribute[ 0 ], true );
 //						//entries.add( newLibraryEntry );
 //						return false;
 //					}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/messages.properties b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/messages.properties
index fefe5d3..52bc405 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/messages.properties
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/messages.properties
@@ -1,3 +1,13 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
 JsNatureUninstaller.1=Uninstalling JavaScript Development Tools...
 JsNatureUninstaller.2=Removing JavaScript Development Toolking Nature...
 JsNatureUninstaller.3=Error installing runtime\! JavaScript Development Tools could not be removed, or is not present in target project..
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/ContentTypeIdForEmbededJs.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/ContentTypeIdForEmbededJs.java
index 29a1e6f..f4f8734 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/ContentTypeIdForEmbededJs.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/ContentTypeIdForEmbededJs.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,12 +10,13 @@
  *     
  *******************************************************************************/
 package org.eclipse.wst.jsdt.web.core.internal.provisional.contenttype;
-
 /**
- * This class, with its one field, is a convience to provide compile-time safety
- * when refering to a contentType ID. The value of the contenttype id field must
- * match what is specified in plugin.xml file.
- */
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class ContentTypeIdForEmbededJs {
 	/**
 	 * The value of the contenttype id field must match what is specified in
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/IContentDescriptionForJSP.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/IContentDescriptionForJSP.java
index 85bc972..2b48f85 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/IContentDescriptionForJSP.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/IContentDescriptionForJSP.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,7 +12,13 @@
 
 import org.eclipse.core.runtime.QualifiedName;
 import org.eclipse.wst.sse.core.internal.encoding.ICodedResourcePlugin;
-
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public interface IContentDescriptionForJSP {
 	public final static QualifiedName CONTENT_FAMILY_ATTRIBUTE = new QualifiedName(ICodedResourcePlugin.ID, "contentFamilyAttribute"); //$NON-NLS-1$;
 	/**
@@ -20,4 +26,4 @@
 	 */
 	public final static QualifiedName CONTENT_TYPE_ATTRIBUTE = new QualifiedName(ICodedResourcePlugin.ID, "contentTypeAttribute"); //$NON-NLS-1$
 	public final static QualifiedName LANGUAGE_ATTRIBUTE = new QualifiedName(ICodedResourcePlugin.ID, "languageAttribute"); //$NON-NLS-1$
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/text/IJSPPartitionTypes.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/text/IJSPPartitionTypes.java
deleted file mode 100644
index 9ced77a..0000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/text/IJSPPartitionTypes.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.eclipse.wst.jsdt.web.core.internal.provisional.text;
-
-/**
- * This interface is not intended to be implemented. It defines the partition
- * types for JSP. Clients should reference the partition type Strings defined
- * here directly.
- * 
- * @deprecated use
- *             org.eclipse.wst.jsdt.web.core.internal.provisional.text.IJSPPartitions
- */
-
-public interface IJSPPartitionTypes {
-	String JSP_COMMENT = "org.eclipse.wst.jsdt.web.JSP_COMMENT"; //$NON-NLS-1$
-	String JSP_CONTENT_DELIMITER = IJSPPartitionTypes.JSP_SCRIPT_PREFIX + "DELIMITER"; //$NON-NLS-1$
-	String JSP_CONTENT_JAVA = IJSPPartitionTypes.JSP_SCRIPT_PREFIX + "JAVA"; //$NON-NLS-1$
-	String JSP_CONTENT_JAVASCRIPT = IJSPPartitionTypes.JSP_SCRIPT_PREFIX + "JAVASCRIPT"; //$NON-NLS-1$
-	String JSP_DEFAULT = "org.eclipse.wst.jsdt.web.DEFAULT_JSP"; //$NON-NLS-1$
-	String JSP_DEFAULT_EL = IJSPPartitionTypes.JSP_SCRIPT_PREFIX + "JSP_EL"; //$NON-NLS-1$
-	String JSP_DEFAULT_EL2 = IJSPPartitionTypes.JSP_SCRIPT_PREFIX + "JSP_EL2"; //$NON-NLS-1$
-	String JSP_DIRECTIVE = "org.eclipse.wst.jsdt.web.JSP_DIRECTIVE"; //$NON-NLS-1$
-	String JSP_SCRIPT_PREFIX = "org.eclipse.wst.jsdt.web.SCRIPT."; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/tasks/JsFileTaskScanner.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/tasks/JsFileTaskScanner.java
deleted file mode 100644
index f42afa6..0000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/tasks/JsFileTaskScanner.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.core.internal.tasks;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.tasks.XMLFileTaskScanner;
-
-public class JsFileTaskScanner extends XMLFileTaskScanner {
-	
-	protected boolean isCommentRegion(IStructuredDocumentRegion region, ITextRegion textRegion) {
-		return super.isCommentRegion(region, textRegion);
-	}
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/JsBatchValidator.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/JsBatchValidator.java
deleted file mode 100644
index 9c3b86e..0000000
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/JsBatchValidator.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.core.internal.validation;
-
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.jsdt.core.IClasspathAttribute;
-import org.eclipse.wst.jsdt.core.IClasspathEntry;
-import org.eclipse.wst.jsdt.core.IJavaProject;
-import org.eclipse.wst.jsdt.core.JavaCore;
-import org.eclipse.wst.jsdt.core.JavaModelException;
-import org.eclipse.wst.jsdt.web.core.internal.JsCoreMessages;
-import org.eclipse.wst.jsdt.web.core.internal.Logger;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.validation.internal.ConfigurationManager;
-import org.eclipse.wst.validation.internal.ProjectConfiguration;
-import org.eclipse.wst.validation.internal.ValidationRegistryReader;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
-import org.eclipse.wst.validation.internal.operations.WorkbenchReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob;
-
-/**
- * Performs JSP validation tasks for batch validation. The individual validator
- * classes will still be used for source validation.
- */
-public final class JsBatchValidator implements IValidatorJob, IExecutableExtension {
-	// for debugging
-	static final boolean DEBUG = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jspvalidator")).booleanValue(); //$NON-NLS-1$
-	private static final String PLUGIN_ID_JSP_CORE = "org.eclipse.wst.jsdt.web.core"; //$NON-NLS-1$
-	private IPath[] excludeLibPaths;
-	
-	private final static String [] rhinoValidator = {"org.eclipse.atf.javascript.internal.validation.JSSyntaxValidator"}; //$NON-NLS-1$
-      static { 
-              // Temp code to clear Rhino Syntax validation markers.
-              IWorkspace workspace = ResourcesPlugin.getWorkspace();
-              IProject[] projects = workspace.getRoot().getProjects();
-              for (int j = 0; j < projects.length; j++) {
-                      IProject project = projects[j];
-                      //try {
-                              if (project.isOpen()) {
-                                      try {
-                                              if (project.hasNature(JavaCore.NATURE_ID)) {
-                                                    WorkbenchReporter.removeAllMessages(project, rhinoValidator, null);
-                                              }
-                                      } catch (CoreException e) {
-                                              // Do nothing
-                                      }
-                              }
-              }
-              
-      } 
-      
-	/**
-	 * Gets current validation project configuration based on current project
-	 * (which is based on current document)
-	 * 
-	 * @return ProjectConfiguration
-	 */
-	static private ProjectConfiguration getProjectConfiguration(IFile file) {
-		ProjectConfiguration projectConfiguration = null;
-		if (file != null) {
-			IProject project = file.getProject();
-			if (project != null) {
-				try {
-					projectConfiguration = ConfigurationManager.getManager().getProjectConfiguration(project);
-				} catch (InvocationTargetException e) {
-					Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-				}
-			}
-		}
-		return projectConfiguration;
-	}
-	
-	/**
-	 * Checks if validator is enabled according in Validation preferences
-	 * 
-	 * @param vmd
-	 * @return
-	 */
-	static boolean isBatchValidatorPreferenceEnabled(IFile file) {
-		if (file == null) {
-			return true;
-		}
-		boolean enabled = true;
-		ProjectConfiguration configuration = JsBatchValidator.getProjectConfiguration(file);
-		if (configuration != null) {
-			org.eclipse.wst.validation.internal.ValidatorMetaData metadata = ValidationRegistryReader.getReader().getValidatorMetaData(JsBatchValidator.class.getName());
-			if (configuration != null && metadata != null) {
-				if (!configuration.isBuildEnabled(metadata) && !configuration.isManualEnabled(metadata)) {
-					enabled = false;
-				}
-			}
-		}
-		return enabled;
-	}
-	class JSPFileVisitor implements IResourceProxyVisitor {
-		private List fFiles = new ArrayList();
-		private IReporter fReporter = null;
-		
-		public JSPFileVisitor(IReporter reporter) {
-			fReporter = reporter;
-		}
-		
-		final IFile[] getFiles() {
-			return (IFile[]) fFiles.toArray(new IFile[fFiles.size()]);
-		}
-		
-		public boolean visit(IResourceProxy proxy) throws CoreException {
-			// check validation
-			if (fReporter.isCancelled()) {
-				return false;
-			}
-			if (proxy.getType() == IResource.FILE) {
-				if (Util.isJsType(proxy.getName()) && proxy.isAccessible()) {
-					IFile file = (IFile) proxy.requestResource();
-					if (JsBatchValidator.DEBUG) {
-						System.out.println("(+) JSPValidator adding file: " + file.getName()); //$NON-NLS-1$
-					}
-					fFiles.add(file);
-					// don't search deeper for files
-					return false;
-				}
-			}
-			return true;
-		}
-	}
-	class LocalizedMessage extends Message {
-		private String _message = null;
-		
-		public LocalizedMessage(int severity, String messageText) {
-			this(severity, messageText, null);
-		}
-		
-		public LocalizedMessage(int severity, String messageText, IResource targetObject) {
-			this(severity, messageText, (Object) targetObject);
-		}
-		
-		public LocalizedMessage(int severity, String messageText, Object targetObject) {
-			super(null, severity, null);
-			setLocalizedMessage(messageText);
-			setTargetObject(targetObject);
-		}
-		
-		private String getLocalizedText() {
-			return _message;
-		}
-		
-		
-		public String getText() {
-			return getLocalizedText();
-		}
-		
-		
-		public String getText(ClassLoader cl) {
-			return getLocalizedText();
-		}
-		
-		
-		public String getText(Locale l) {
-			return getLocalizedText();
-		}
-		
-		
-		public String getText(Locale l, ClassLoader cl) {
-			return getLocalizedText();
-		}
-		
-		public void setLocalizedMessage(String message) {
-			_message = message;
-		}
-	}
-	//String fAdditionalContentTypesIDs[] = null;
-	private IContentType[] fContentTypes = null;
-	private IContentType fJSPFContentType = null;
-	private JsValidator fJSPJavaValidator = new JsValidator(this);
-	
-	public void cleanup(IReporter reporter) {
-		fJSPJavaValidator.cleanup(reporter);
-	}
-	private IPath[] getLibraryPaths(IFile file) {
-		
-		if(excludeLibPaths!=null) return excludeLibPaths;
-		
-		IProject project = file.getProject();
-		IJavaProject javaProject= JavaCore.create(project);
-		
-		if(javaProject==null) return new IPath[0];
-		
-		IClasspathEntry[] entries = new IClasspathEntry[0];
-		try {
-			entries = javaProject.getResolvedClasspath(true);
-		} catch (JavaModelException ex) {
-			// May run into an exception if the project isn't jsdt.
-		}
-		ArrayList ignorePaths = new ArrayList();
-		nextEntry: for(int i = 0;i<entries.length;i++) {
-			if(entries[i].getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
-				IClasspathAttribute[] attribs = entries[i].getExtraAttributes();
-				for(int k=0; attribs!=null && k<attribs.length;k++) {
-					if(attribs[k].getName().equalsIgnoreCase("validate") && attribs[k].getValue().equalsIgnoreCase("false")) { //$NON-NLS-1$ //$NON-NLS-2$
-						ignorePaths.add(entries[i].getPath());
-						continue nextEntry;
-					}
-				}
-			}
-		}
-		
-		excludeLibPaths =  (Path[])ignorePaths.toArray(new Path[ignorePaths.size()]);
-		return excludeLibPaths;
-	}
-	
-	
-	void doValidate(IValidationContext helper, IReporter reporter) throws ValidationException {
-		
-		String[] uris = helper.getURIs();
-		if (uris.length > 0) {
-			IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
-			IFile currentFile = null;
-			
-			for (int i = 0; i < uris.length && !reporter.isCancelled(); i++) {
-				currentFile = wsRoot.getFile(new Path(uris[i]));
-				if (currentFile != null && currentFile.exists()) {
-					if (shouldValidate(currentFile) ) {
-						Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, "" + (i + 1) + "/" + uris.length + " - " + currentFile.getFullPath().toString().substring(1)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-						reporter.displaySubtask(this, message);
-						reporter.removeAllMessages(this, currentFile);
-						validateFile(currentFile, reporter);
-					}
-					if (JsBatchValidator.DEBUG) {
-						System.out.println("validating: [" + uris[i] + "]"); //$NON-NLS-1$ //$NON-NLS-2$
-					}
-				}
-			}
-		} else {
-			// if uris[] length 0 -> validate() gets called for each project
-			if (helper instanceof IWorkbenchContext) {
-				IProject project = ((IWorkbenchContext) helper).getProject();
-				Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, NLS.bind(JsCoreMessages.JSPBatchValidator_0, project.getFullPath()));
-				reporter.displaySubtask(this, message);
-				JSPFileVisitor visitor = new JSPFileVisitor(reporter);
-				try {
-					// collect all jsp files for the project
-					project.accept(visitor, IResource.DEPTH_INFINITE);
-				} catch (CoreException e) {
-					if (JsBatchValidator.DEBUG) {
-						e.printStackTrace();
-					}
-				}
-				IFile[] files = visitor.getFiles();
-				for (int i = 0; i < files.length && !reporter.isCancelled(); i++) {
-					if (shouldValidate(files[i]) ) {
-						message = new LocalizedMessage(IMessage.LOW_SEVERITY, "" + (i + 1) + "/" + files.length + " - " + files[i].getFullPath().toString().substring(1)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-						reporter.displaySubtask(this, message);
-						validateFile(files[i], reporter);
-					}
-					if (JsBatchValidator.DEBUG) {
-						System.out.println("validating: [" + files[i] + "]"); //$NON-NLS-1$ //$NON-NLS-2$
-					}
-				}
-			}
-		}
-	}
-	
-//	/**
-//	 * Checks if file is a jsp fragment or not. If so, check if the fragment
-//	 * should be validated or not.
-//	 * 
-//	 * @param file
-//	 *            Assumes shouldValidate was already called on file so it should
-//	 *            not be null and does exist
-//	 * @return false if file is a fragment and it should not be validated, true
-//	 *         otherwise
-//	 */
-//	private boolean fragmentCheck(IFile file) {
-//		return isFragment(file);
-//	}
-	
-	public ISchedulingRule getSchedulingRule(IValidationContext helper) {
-		if (helper instanceof IWorkbenchContext) {
-			/*
-			 * Use a single build rule when running batch validation.
-			 */
-			return ResourcesPlugin.getWorkspace().getRuleFactory().buildRule();
-		}
-		/*
-		 * For other kinds of validation, use no specific rule
-		 */
-		return null;
-	}
-	
-
-
-
-	
-	private void performValidation(IFile f, IReporter reporter, IStructuredModel model) {
-		if (!reporter.isCancelled()) {
-			fJSPJavaValidator.performValidation(f, reporter, model,true);
-		}
-	}
-	
-	/**
-	 * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement,
-	 *      java.lang.String, java.lang.Object)
-	 */
-	public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
-		
-	}
-	
-	private boolean shouldValidate(IFile file) {
-		//if(true) return true;
-		IResource resource = file;
-		IPath[] libPaths = getLibraryPaths(file);
-		IPath filePath = file.getFullPath().removeLastSegments(1);
-		for(int i = 0;i<libPaths.length;i++) {
-			if(libPaths[i].isPrefixOf(filePath)){
-				return false;
-			}
-		}
-		
-		do {
-			if (resource.isDerived() || resource.isTeamPrivateMember() || !resource.isAccessible() || resource.getName().charAt(0) == '.') {
-				return false;
-			}
-			resource = resource.getParent();
-		} while ((resource.getType() & IResource.PROJECT) == 0);
-		return true;
-	}
-	
-	public void validate(IValidationContext helper, IReporter reporter) throws ValidationException {
-		doValidate(helper, reporter);
-	}
-	
-	/**
-	 * Validate one file. It's assumed that the file has JSP content type.
-	 * 
-	 * @param f
-	 * @param reporter
-	 */
-	void validateFile(IFile f, IReporter reporter) {
-		IStructuredModel model = null;
-		try {
-			// get JSP model on behalf of all JSP validators
-			model = StructuredModelManager.getModelManager().getExistingModelForRead(f);
-			if(model==null) {
-				model = StructuredModelManager.getModelManager().getModelForRead(f);
-			}
-			if (!reporter.isCancelled() && model != null) {
-				reporter.removeAllMessages(this, f);
-				performValidation(f, reporter, model);
-			}
-		} catch (IOException e) {
-			Logger.logException(e);
-		} catch (CoreException e) {
-			Logger.logException(e);
-		} finally {
-			if (model != null) {
-				model.releaseFromRead();
-			}
-		}
-	}
-	
-	public IStatus validateInJob(final IValidationContext helper, final IReporter reporter) throws ValidationException {
-		Job currentJob = Platform.getJobManager().currentJob();
-		ISchedulingRule rule = null;
-		if (currentJob != null) {
-			rule = currentJob.getRule();
-		}
-		IWorkspaceRunnable validationRunnable = new IWorkspaceRunnable() {
-			public void run(IProgressMonitor monitor) throws CoreException {
-				try {
-					doValidate(helper, reporter);
-				} catch (ValidationException e) {
-					throw new CoreException(new Status(IStatus.ERROR, JsBatchValidator.PLUGIN_ID_JSP_CORE, 0, JsBatchValidator.PLUGIN_ID_JSP_CORE, e));
-				}
-			}
-		};
-		try {
-			JavaCore.run(validationRunnable, rule, new NullProgressMonitor());
-		} catch (CoreException e) {
-			if (e.getCause() instanceof ValidationException) {
-				throw (ValidationException) e.getCause();
-			}
-			throw new ValidationException(new LocalizedMessage(IMessage.ERROR_AND_WARNING, e.getMessage()), e);
-		}
-		return Status.OK_STATUS;
-	}
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/JsValidator.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/JsValidator.java
index e9204f8..30dc484 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/JsValidator.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/JsValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,8 +13,10 @@
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Locale;
+import java.util.Set;
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
@@ -24,18 +26,27 @@
 import org.eclipse.core.resources.IWorkspaceRoot;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
 import org.eclipse.wst.jsdt.core.compiler.IProblem;
 import org.eclipse.wst.jsdt.web.core.internal.Logger;
-
 import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
 import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
 import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapterFactory;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
+import org.eclipse.wst.validation.AbstractValidator;
+import org.eclipse.wst.validation.ValidationResult;
+import org.eclipse.wst.validation.ValidationState;
 import org.eclipse.wst.validation.internal.core.Message;
 import org.eclipse.wst.validation.internal.core.ValidationException;
 import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
@@ -46,11 +57,12 @@
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 
-public class JsValidator implements IValidator{
-	private static final boolean DEBUG = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jspvalidator")).booleanValue(); //$NON-NLS-1$
+public class JsValidator extends AbstractValidator implements IValidator, IExecutableExtension {
+	private static final boolean DEBUG = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsvalidator")).booleanValue(); //$NON-NLS-1$
 	private IValidator fMessageOriginator;
+	private Set fValidFileExts = new HashSet();
 	
-	private static String [] jsdtValidator = {"org.eclipse.wst.jsdt.web.core.internal.validation.JsBatchValidator"}; //$NON-NLS-1$
+//	private static String [] jsdtValidator = {"org.eclipse.wst.jsdt.web.core.internal.validation.JsBatchValidator"}; //$NON-NLS-1$
 
 	
 	protected class LocalizedMessage extends Message {
@@ -102,34 +114,52 @@
 		this.fMessageOriginator = this;
 	}
 	
-	public JsValidator(IValidator validator) {
-		this.fMessageOriginator = validator;
-	}
-	
 	/**
 	 * Creates an IMessage from an IProblem
 	 * 
 	 * @param problem
 	 * @param f
 	 * @param translation
-	 * @param structuredDoc
+	 * @param textDoc
 	 * @return message representation of the problem, or null if it could not
 	 *         create one
 	 */
-	private IMessage createMessageFromProblem(IProblem problem, IFile f, IJsTranslation translation, IStructuredDocument structuredDoc) {
+	private IMessage createMessageFromProblem(IProblem problem, IFile f, IJsTranslation translation, IDocument textDoc) {
 		int sourceStart = problem.getSourceStart();
 		int sourceEnd = 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;
-		int sev = problem.isError() ? IMessage.HIGH_SEVERITY : IMessage.NORMAL_SEVERITY;
+		
+		/*
+		 * Bug 241794 - Validation shows errors when using JSP Expressions
+		 * inside JavaScript code
+		 */
+		IStructuredDocument doc = (IStructuredDocument) textDoc;
+		IStructuredDocumentRegion documentRegion = doc.getRegionAtCharacterOffset(sourceStart);
+		if (documentRegion != null) {
+			ITextRegion textRegion = documentRegion.getRegionAtCharacterOffset(sourceStart);
+			/*
+			 * Filter out problems from areas that aren't simple JavaScript,
+			 * e.g. JSP.
+			 */
+			if (textRegion != null && textRegion instanceof ITextRegionCollection)
+				return null;
+		}
+
+		int sev = problem.isError() ? IMessage.HIGH_SEVERITY : (problem.isWarning() ? IMessage.NORMAL_SEVERITY : IMessage.LOW_SEVERITY);
 		IMessage m = new LocalizedMessage(sev, problem.getMessage(), f);
-		m.setLineNo(lineNo);
-		m.setOffset(sourceStart);
-		m.setLength(sourceEnd - sourceStart + 1);
+		// line numbers for marker starts @ 1
+		// line numbers from document starts @ 0
+		try {
+			int lineNo = textDoc.getLineOfOffset(sourceStart) + 1;
+			m.setLineNo(lineNo);
+			m.setOffset(sourceStart);
+			m.setLength(sourceEnd - sourceStart + 1);
+		}
+		catch (BadLocationException e) {
+			Logger.logException(e);
+		}
 		return m;
 	}
 	
@@ -140,13 +170,13 @@
 			IDOMDocument xmlDoc = domModel.getDocument();
 			JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
 			//translationAdapter.resourceChanged();
-			IJsTranslation translation = translationAdapter.getJSPTranslation(false);
+			IJsTranslation translation = translationAdapter.getJsTranslation(false);
 			if (!reporter.isCancelled()) {
 				translation.setProblemCollectingActive(true);
 				translation.reconcileCompilationUnit();
 				List problems = translation.getProblems();
+//				if(!inBatch) reporter.removeAllMessages(this, f);
 				// add new messages
-				if(!inBatch) reporter.removeAllMessages(this, f);
 				for (int i = 0; i < problems.size() && !reporter.isCancelled(); i++) {
 					IMessage m = createMessageFromProblem((IProblem) problems.get(i), f, translation, domModel.getStructuredDocument());
 					if (m != null) {
@@ -157,9 +187,24 @@
 		}
 	}
 	
+	/* Read the definition for this validator and the declared valid file extensions
+	 * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+	 */
+	public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+		IConfigurationElement[] includes = config.getChildren("include"); //$NON-NLS-1$
+		for (int i = 0; i < includes.length; i++) {
+			IConfigurationElement[] fileexts = includes[i].getChildren("fileext"); //$NON-NLS-1$
+			for (int j = 0; j < fileexts.length; j++) {
+				String fileext = fileexts[j].getAttribute("ext"); //$NON-NLS-1$
+				if (fileext != null) {
+					fValidFileExts.add(fileext);
+				}
+			}
+		}
+	}
+	
 	/**
-	 * When loading model from a file, you need to explicitly add adapter
-	 * factory.
+	 * Ensures that our translation adapter is present before we try to use it
 	 * 
 	 * @param sm
 	 */
@@ -169,7 +214,8 @@
 			sm.getFactoryRegistry().addFactory(factory);
 		}
 	}
-	private boolean shouldValidate(IFile file) {
+	
+	boolean shouldValidate(IFile file) {
 		IResource resource = file;
 		do {
 			if (resource.isDerived() || resource.isTeamPrivateMember() || !resource.isAccessible() || resource.getName().charAt(0) == '.') {
@@ -177,16 +223,17 @@
 			}
 			resource = resource.getParent();
 		} while ((resource.getType() & IResource.PROJECT) == 0);
-		return true;
+		return fValidFileExts.isEmpty() || fValidFileExts.contains(file.getFileExtension());
 	}
+	
 	public void validate(IValidationContext helper, IReporter reporter) throws ValidationException {
 		/* Added by BC ---- */
 		// if(true) return;
 		/* end Added by BC ---- */
 		
 		String[] uris = helper.getURIs();
-		IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
 		if (uris.length > 0) {
+			IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
 			IFile currentFile = null;
 			for (int i = 0; i < uris.length && !reporter.isCancelled(); i++) {
 				currentFile = wsRoot.getFile(new Path(uris[i]));
@@ -194,7 +241,7 @@
 				if (currentFile != null && currentFile.exists()) {
 					if (shouldValidate(currentFile) ){ //&& fragmentCheck(currentFile)) {
 						int percent = (i * 100) / uris.length + 1;
-						Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, percent + "% " + uris[i]); //$NON-NLS-1$
+						IMessage message = new LocalizedMessage(IMessage.LOW_SEVERITY, percent + "% " + uris[i]); //$NON-NLS-1$
 						reporter.displaySubtask(this, message);
 						validateFile(currentFile, reporter);
 					}
@@ -207,7 +254,7 @@
 			// if uris[] length 0 -> validate() gets called for each project
 			if (helper instanceof IWorkbenchContext) {
 				IProject project = ((IWorkbenchContext) helper).getProject();
-				JSPFileVisitor visitor = new JSPFileVisitor(reporter);
+				JSFileVisitor visitor = new JSFileVisitor(reporter);
 				try {
 					// collect all jsp files for the project
 					project.accept(visitor, IResource.DEPTH_INFINITE);
@@ -218,12 +265,10 @@
 				}
 				IFile[] files = visitor.getFiles();
 				for (int i = 0; i < files.length && !reporter.isCancelled(); i++) {
-					if (shouldValidate(files[i])) {
-						int percent = (i * 100) / files.length + 1;
-						Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, percent + "% " + files[i].getFullPath().toString()); //$NON-NLS-1$
-						reporter.displaySubtask(this, message);
-						validateFile(files[i], reporter);
-					}
+					int percent = (i * 100) / files.length + 1;
+					IMessage message = new LocalizedMessage(IMessage.LOW_SEVERITY, percent + "% " + files[i].getFullPath().toString()); //$NON-NLS-1$
+					reporter.displaySubtask(this, message);
+					validateFile(files[i], reporter);
 					if (DEBUG) {
 						System.out.println("validating: [" + files[i] + "]"); //$NON-NLS-1$ //$NON-NLS-2$
 					}
@@ -232,12 +277,11 @@
 		}
 	}
 
-	protected class JSPFileVisitor implements IResourceProxyVisitor {
-		private IContentType[] fContentTypes = null;
+	protected class JSFileVisitor implements IResourceProxyVisitor {
 		private List fFiles = new ArrayList();
 		private IReporter fReporter = null;
 		
-		public JSPFileVisitor(IReporter reporter) {
+		public JSFileVisitor(IReporter reporter) {
 			fReporter = reporter;
 		}
 		
@@ -254,7 +298,7 @@
 			if (proxy.getType() == IResource.FILE) {
 				if (Util.isJsType(proxy.getName())) {
 					IFile file = (IFile) proxy.requestResource();
-					if (file.exists()) {
+					if (file.exists() && shouldValidate(file)) {
 						if (DEBUG) {
 							System.out.println("(+) JSPValidator adding file: " + file.getName()); //$NON-NLS-1$
 						}
@@ -284,17 +328,12 @@
 		IStructuredModel model = null;
 		try {
 			// get jsp model, get tranlsation
-			model = StructuredModelManager.getModelManager().getExistingModelForRead(f);
-			if(model==null) {
-				model = StructuredModelManager.getModelManager().getModelForRead(f);
-			}
+			model = StructuredModelManager.getModelManager().getModelForRead(f);
 			if (!reporter.isCancelled() && model != null) {
-				// get jsp model, get translation
-				if (model instanceof IDOMModel) {
-					//WorkbenchReporter.removeAllMessages(f.getProject(), jsdtValidator, f.toString());
-					//reporter.removeAllMessages(fMessageOriginator, f);
-					performValidation(f, reporter, model, false);
-				}
+				// get DOM model then translation
+				//WorkbenchReporter.removeAllMessages(f.getProject(), jsdtValidator, f.toString());
+				//reporter.removeAllMessages(fMessageOriginator, f);
+				performValidation(f, reporter, model, false);
 			}
 		} catch (IOException e) {
 			Logger.logException(e);
@@ -306,4 +345,12 @@
 			}
 		}
 	}
+	public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
+		if (resource.getType() != IResource.FILE)
+			return null;
+		ValidationResult result = new ValidationResult();
+		IReporter reporter = result.getReporter(monitor);
+		validateFile((IFile) resource, reporter);
+		return result;
+	}
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/Util.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/Util.java
index 92a03a0..5e84a72 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/Util.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/Util.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -8,14 +18,18 @@
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.content.IContentType;
 import org.eclipse.wst.jsdt.web.core.internal.provisional.contenttype.ContentTypeIdForEmbededJs;
-
 /**
- * @author childsb
- *
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class Util {
 	
 	public static boolean isJsType(String fileName) {
+		if(fileName==null) return false;
 		boolean valid = false;
 		IContentType[] types =getJavascriptContentTypes();
 		int i = 0;
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/CompilationUnitHelper.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/CompilationUnitHelper.java
index c8e35af..8dbeb85 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/CompilationUnitHelper.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/CompilationUnitHelper.java
@@ -1,12 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.core.javascript;
 
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
+import org.eclipse.wst.jsdt.core.IProblemRequestor;
 import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
 
 /**
- * To ensure there is only one instance of ProblemRequestor and WorkingCopyOwner
- * for JSP plugins. These were removed from JSPTranslation to ensure that the
- * JSPTranslation was not held in memory by any type of JDT lists (caching
- * search results, etc...)
+
+
+
+
+ * Provisional API: This class/interface is part of an interim API that is still under development and expected to
+ * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+ * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+ * (repeatedly) as the API evolves.
+ * 
+ * <br><br> this code was taken from the JSP plugin.  This class is to ensure only one copy of the compilation unit exits.
  * 
  * @author pavery
  */
@@ -36,9 +54,15 @@
 	public WorkingCopyOwner getWorkingCopyOwner() {
 		if (fWorkingCopyOwner == null) {
 			fWorkingCopyOwner = new WorkingCopyOwner() {
+				/* (non-Javadoc)
+				 * @see org.eclipse.wst.jsdt.core.WorkingCopyOwner#getProblemRequestor(org.eclipse.wst.jsdt.core.IJavaScriptUnit)
+				 */
+				public IProblemRequestor getProblemRequestor(IJavaScriptUnit workingCopy) {
+					return CompilationUnitHelper.this.getProblemRequestor();
+				}
 				
 				public String toString() {
-					return "JSP Working copy owner"; //$NON-NLS-1$
+					return "Client JavaScript WorkingCopyOwner"; //$NON-NLS-1$
 				}
 			};
 		}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/DocumentChangeListenerToTextEdit.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/DocumentChangeListenerToTextEdit.java
index 0db1088..7320ba9 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/DocumentChangeListenerToTextEdit.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/DocumentChangeListenerToTextEdit.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -11,9 +21,19 @@
 import org.eclipse.text.edits.ReplaceEdit;
 
 /**
- * @author childsb
- * 
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+* <br><br>
+* 
+* this class attaches to a "cloned" document, listens for changes to that document then translates
+* the changes to text edits.  these changes can then be applied back to the original document.
+* 
+*
+*/
 public class DocumentChangeListenerToTextEdit implements IDocumentListener {
 	private MultiTextEdit textEdit;
 	
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/HTML40Namespace.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/HTML40Namespace.java
index 25aad85..e34d226 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/HTML40Namespace.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/HTML40Namespace.java
Binary files differ
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslation.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslation.java
index faec080..5a6dd23 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslation.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslation.java
@@ -23,58 +23,145 @@
 
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.Position;
-import org.eclipse.wst.jsdt.core.ICompilationUnit;
-import org.eclipse.wst.jsdt.core.IJavaElement;
-import org.eclipse.wst.jsdt.core.IJavaProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 
 
 
 /**
- * @author childsb
- *
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.<br>
+* 
+*/
 public interface IJsTranslation {
 
-	public IJavaProject getJavaProject();
+	/**
+	 * @return IJavaScriptProject that this translation belongs to
+	 */
+	public IJavaScriptProject getJavaProject();
 
+	/**
+	 * @return Original HTML document from the translation.
+	 */
 	public IDocument getHtmlDocument();
 
+	/**
+	 * @return integer position of a missing </script> tag (the document isn't well formed and resulted in translation error.).
+	 * 
+	 */
 	public int getMissingTagStart();
 
-	public IJavaElement[] getAllElementsInJsRange(int javaPositionStart, int javaPositionEnd);
+	/**
+	 * @param javaPositionStart
+	 * @param javaPositionEnd
+	 * @return all javascript elements within the given range
+	 */
+	public IJavaScriptElement[] getAllElementsInJsRange(int javaPositionStart, int javaPositionEnd);
 
-	public ICompilationUnit getCompilationUnit();
+	/**
+	 * @return the javascript unit from the jsdt.core
+	 */
+	public IJavaScriptUnit getCompilationUnit();
 
-	public IJavaElement[] getElementsFromJsRange(int javaPositionStart, int javaPositionEnd);
+	/**
+	 * @param javaPositionStart
+	 * @param javaPositionEnd
+	 * @return
+	 */
+	public IJavaScriptElement[] getElementsFromJsRange(int javaPositionStart, int javaPositionEnd);
 
+	/**
+	 * @return string of the document.
+	 */
 	public String getHtmlText();
 
-	public IJavaElement getJsElementAtOffset(int jsOffset);
+	/**
+	 * @param jsOffset
+	 * @return a single javascript element at the given offset.
+	 */
+	public IJavaScriptElement getJsElementAtOffset(int jsOffset);
 
+	/**
+	 * @return only the translated javascript text
+	 */
 	public String getJsText();
 
+	/**
+	 * @return a list of the script regions within the translation.
+	 */
 	public Position[] getScriptPositions();
 
+	/**
+	 * @param text
+	 */
 	public void insertInFirstScriptRegion(String text);
 
+	/**
+	 * insert javascript at the given offset.  method should ensure the documents well-formedness and proper script region.
+	 * 
+	 * @param offset
+	 * @param text
+	 */
 	public void insertScript(int offset, String text);
 
+	/**
+	 * @return a list of javascript errors
+	 */
 	public List getProblems();
 
+	/**
+	 * @param offset
+	 * @return if the offset is within a script import node.
+	 */
 	public boolean ifOffsetInImportNode(int offset);
 
+	/**
+	 * checks the CU for errors/consistancy.
+	 */
 	public void reconcileCompilationUnit();
 
+	/**
+	 * release the translation.  always a good idea to do when you're done.  you may notice document and model locks if not.
+	 */
 	public void release();
 	
+	/**
+	 * fixes a mangled html--> pure js name.
+	 * @param displayString
+	 * @return
+	 */
 	public String fixupMangledName(String displayString); 
 	
+	/**
+	 * start/stop collecting problems within the javascript unit.
+	 * @param collect
+	 */
 	public void setProblemCollectingActive(boolean collect);
 	
+	/**
+	 * @return
+	 */
 	public String getJavaPath();
 	
-	public IJsTranslation getInstance(IStructuredDocument htmlDocument, IJavaProject javaProj, boolean listenForChanges) ;
+	/**
+	 * 
+	 * 
+	 * @param htmlDocument
+	 * @param javaProj
+	 * @param listenForChanges
+	 * @return
+	 */
+	public IJsTranslation getInstance(IStructuredDocument htmlDocument, IJavaScriptProject javaProj, boolean listenForChanges) ;
 
+	/**
+	 * notify the translation to update any external dependancies that are created during translation
+	 * 
+	 */
 	public void classpathChange() ;
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslator.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslator.java
index 6ece9f9..8726cab 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslator.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslator.java
@@ -27,31 +27,74 @@
 
 
 /**
- * @author childsb
- *
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public interface IJsTranslator extends IDocumentListener{
 
+	/**
+	 * @return string of javascript from the document
+	 */
 	public String getJsText();
 
+	/**
+	 * sets the javascript unit buffer
+	 * @param buffer
+	 */
 	public void setBuffer(IBuffer buffer);
 
+	/**
+	 * 
+	 * @return a list of html locations within the docuemnt.
+	 */
 	public Position[] getHtmlLocations();
 
+	/**
+	 * @return the region of a missing </script> tag
+	 */
 	public int getMissingEndTagRegionStart();
 
+	/**
+	 * @return position array of <script src=".."> within the doc.
+	 */
 	public Position[] getImportHtmlRanges();
 
+	/**
+	 * @return raw/unresolved <script imports>
+	 */
 	public String[] getRawImports();
 
+	/**
+	 *  begin translating the document.
+	 */
 	public void translate();
 
+	/**
+	 * translates an inline (event="..") js container region and adds it to the document text.  must be called in order
+	 * @param container
+	 */
 	public void translateInlineJSNode(IStructuredDocumentRegion container);
 
+	/**
+	 * translates a script block.  must be called in the order it appears within the document.
+	 * @param container
+	 */
 	public void translateJSNode(IStructuredDocumentRegion container);
 
+	/**
+	 * translates a <script src=".."> element, parsing out an import.
+	 * @param region
+	 */
 	public void translateScriptImportNode(IStructuredDocumentRegion region);
 
+	/**
+	 * release any resources the translation is holding onto.
+	 * 
+	 */
 	public void release();
 
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsDataTypes.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsDataTypes.java
index 1c79fa9..8bd2ae1 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsDataTypes.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsDataTypes.java
@@ -1,8 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.core.javascript;
 
 
 import org.eclipse.wst.html.core.text.IHTMLPartitions;
+/**
+*
 
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public interface JsDataTypes extends HTML40Namespace {
 	/*
 	 * remove when when we refactor (need to add this content type to many
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsNameManglerUtil.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsNameManglerUtil.java
index 469a423..40cee8f 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsNameManglerUtil.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsNameManglerUtil.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,8 +13,13 @@
 import java.io.File;
 
 /**
- * @author pavery
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JsNameManglerUtil {
 	/**
 	 * Determine if given string is a valid Hex representation of an ASCII
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsProblemRequestor.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsProblemRequestor.java
index 9e3f2fe..ac94dd0 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsProblemRequestor.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsProblemRequestor.java
@@ -1,8 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.core.javascript;
 
 /**
- * @author pavery
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 import java.util.ArrayList;
 import java.util.List;
 
@@ -16,13 +31,12 @@
 	
 	public void acceptProblem(IProblem problem) {
 		if (isActive()) {
-			fCollectedProblems.add(problem);
+			getCollectedProblems().add(problem);
 		}
 	}
 	
 	public void beginReporting() {
 		fIsRunning = true;
-		fCollectedProblems = new ArrayList();
 	}
 	
 	public void endReporting() {
@@ -33,11 +47,13 @@
 	 * @return the list of collected problems
 	 */
 	public List getCollectedProblems() {
+		if (fCollectedProblems == null)
+			fCollectedProblems = new ArrayList();
 		return fCollectedProblems;
 	}
 	
 	public boolean isActive() {
-		return fIsActive && fCollectedProblems != null;
+		return fIsActive;
 	}
 	
 	public boolean isRunning() {
@@ -51,21 +67,14 @@
 	 *            the state of this problem requestor
 	 */
 	public void setIsActive(boolean isActive) {
-		if (fIsActive != isActive) {
-			fIsActive = isActive;
-			if (fIsActive) {
-				startCollectingProblems();
-			} else {
-				stopCollectingProblems();
-			}
-		}
+		fIsActive = isActive;
 	}
 	
 	/**
 	 * Tells this annotation model to collect temporary problems from now on.
 	 */
 	private void startCollectingProblems() {
-		fCollectedProblems = new ArrayList();
+		getCollectedProblems().clear();
 	}
 	
 	/**
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslation.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslation.java
index 2bedd64..74fd5d3 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslation.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslation.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     bug:244839 - eugene@genuitec.com
  *     
  * Provisional API: This class/interface is part of an interim API that is still under development and expected to 
  * change significantly before reaching stability. It is being made available at this early stage to solicit feedback 
@@ -21,34 +22,31 @@
 
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Vector;
 
-import org.eclipse.core.filebuffers.FileBuffers; // import
-													// org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile; // import
-											// org.eclipse.core.resources.IProject;
-// import org.eclipse.core.resources.IResource;
+import org.eclipse.core.filebuffers.FileBuffers;
+import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
-
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.Region;
 import org.eclipse.wst.jsdt.core.IBuffer;
-import org.eclipse.wst.jsdt.core.ICompilationUnit;
-import org.eclipse.wst.jsdt.core.IJavaElement;
-import org.eclipse.wst.jsdt.core.IJavaProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
 import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
 import org.eclipse.wst.jsdt.core.ISourceRange;
-import org.eclipse.wst.jsdt.core.JavaModelException; // import
-														// org.eclipse.wst.jsdt.core.LibrarySuperType;
+import org.eclipse.wst.jsdt.core.JavaScriptModelException;
 import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
+import org.eclipse.wst.jsdt.core.compiler.IProblem;
 import org.eclipse.wst.jsdt.internal.core.DocumentContextFragmentRoot;
+import org.eclipse.wst.jsdt.internal.core.Member;
 import org.eclipse.wst.jsdt.internal.core.SourceRefElement;
 import org.eclipse.wst.jsdt.web.core.internal.Logger;
 import org.eclipse.wst.jsdt.web.core.internal.project.JsWebNature;
@@ -57,27 +55,32 @@
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 
 /**
- * @author brad childs
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JsTranslation implements IJsTranslation {
 
 	private static final boolean DEBUG;
 	static {
-		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsptranslation"); //$NON-NLS-1$
-		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jstranslation"); //$NON-NLS-1$
+ 		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
 	}
 
-	private ICompilationUnit fCompilationUnit = null;
+	private IJavaScriptUnit fCompilationUnit = null;
 	private DocumentContextFragmentRoot fDocumentScope;
-	private IJavaProject fJavaProject = null;
+	private IJavaScriptProject fJavaProject = null;
 	private byte[] fLock = null;
 	private IProgressMonitor fProgressMonitor = null;
 	protected IStructuredDocument fHtmlDocument;
 	protected String fModelBaseLocation;
 
 
-	private static final String SUPER_TYPE_NAME = "Window"; //$NON-NLS-1$
-	private static final String SUPER_TYPE_LIBRARY = "org.eclipse.wst.jsdt.launching.baseBrowserLibrary"; //$NON-NLS-1$
+//	private static final String SUPER_TYPE_NAME = "Window"; //$NON-NLS-1$
+//	private static final String SUPER_TYPE_LIBRARY = "org.eclipse.wst.jsdt.launching.baseBrowserLibrary"; //$NON-NLS-1$
 
 	protected IJsTranslator fTranslator;
 
@@ -99,7 +102,7 @@
 	
 
 	
-	protected JsTranslation(IStructuredDocument htmlDocument, IJavaProject javaProj, boolean listenForChanges) {
+	protected JsTranslation(IStructuredDocument htmlDocument, IJavaScriptProject javaProj, boolean listenForChanges) {
 		fLock = new byte[0];
 		fJavaProject = javaProj;
 		fHtmlDocument = htmlDocument;
@@ -108,14 +111,14 @@
 		this.listenForChanges=listenForChanges;
 	}
 
-	public IJsTranslation getInstance(IStructuredDocument htmlDocument, IJavaProject javaProj, boolean listenForChanges) {
+	public IJsTranslation getInstance(IStructuredDocument htmlDocument, IJavaScriptProject javaProj, boolean listenForChanges) {
 		return new JsTranslation(htmlDocument,javaProj, listenForChanges);
 	}
 	
 	/* (non-Javadoc)
 	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getJavaProject()
 	 */
-	public IJavaProject getJavaProject() {
+	public IJavaScriptProject getJavaProject() {
 		return fJavaProject;
 	}
 
@@ -183,19 +186,19 @@
 	}
 
 	/**
-	 * Originally from ReconcileStepForJava. Creates an ICompilationUnit from
+	 * Originally from ReconcileStepForJava. Creates an IJavaScriptUnit from
 	 * the contents of the JSP document.
 	 * 
-	 * @return an ICompilationUnit from the contents of the JSP document
+	 * @return an IJavaScriptUnit from the contents of the JSP document
 	 */
-	private ICompilationUnit createCompilationUnit() throws JavaModelException {
+	private IJavaScriptUnit createCompilationUnit() throws JavaScriptModelException {
 		IPackageFragmentRoot root = getDocScope(true);
-		ICompilationUnit cu = root.getPackageFragment("").getCompilationUnit(getMangledName() + JsDataTypes.BASE_FILE_EXTENSION).getWorkingCopy(getWorkingCopyOwner(), getProblemRequestor(), getProgressMonitor()); //$NON-NLS-1$
+		IJavaScriptUnit cu = root.getPackageFragment("").getJavaScriptUnit(getMangledName() + JsDataTypes.BASE_FILE_EXTENSION).getWorkingCopy(getWorkingCopyOwner(), getProgressMonitor()); //$NON-NLS-1$
 		IBuffer buffer;
 		try {
 			buffer = cu.getBuffer();
 		}
-		catch (JavaModelException e) {
+		catch (JavaScriptModelException e) {
 			e.printStackTrace();
 			buffer = null;
 		}
@@ -215,29 +218,27 @@
 	/* (non-Javadoc)
 	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getAllElementsInJsRange(int, int)
 	 */
-	public IJavaElement[] getAllElementsInJsRange(int javaPositionStart, int javaPositionEnd) {
-		IJavaElement[] EMTPY_RESULT_SET = new IJavaElement[0];
-		IJavaElement[] result = EMTPY_RESULT_SET;
-		IJavaElement[] allChildren = null;
+	public IJavaScriptElement[] getAllElementsInJsRange(int javaPositionStart, int javaPositionEnd) {
+		IJavaScriptElement[] EMTPY_RESULT_SET = new IJavaScriptElement[0];
+		IJavaScriptElement[] result = EMTPY_RESULT_SET;
+		IJavaScriptElement[] allChildren = null;
 		try {
 			allChildren = getCompilationUnit().getChildren();
 		}
-		catch (JavaModelException e) {
+		catch (JavaScriptModelException e) {
 		}
 		Vector validChildren = new Vector();
 		for (int i = 0; i < allChildren.length; i++) {
-			if (allChildren[i].getElementType() != IJavaElement.PACKAGE_DECLARATION) {
-				ISourceRange range = getJSSourceRangeOf(allChildren[i]);
-				if (javaPositionStart <= range.getOffset() && range.getLength() + range.getOffset() <= (javaPositionEnd)) {
-					validChildren.add(allChildren[i]);
-				}
-				else if (allChildren[i].getElementType() == IJavaElement.TYPE) {
-					validChildren.add(allChildren[i]);
-				}
+			ISourceRange range = getJSSourceRangeOf(allChildren[i]);
+			if (javaPositionStart <= range.getOffset() && range.getLength() + range.getOffset() <= (javaPositionEnd)) {
+				validChildren.add(allChildren[i]);
+			}
+			else if (allChildren[i].getElementType() == IJavaScriptElement.TYPE) {
+				validChildren.add(allChildren[i]);
 			}
 		}
 		if (validChildren.size() > 0) {
-			result = (IJavaElement[]) validChildren.toArray(new IJavaElement[]{});
+			result = (IJavaScriptElement[]) validChildren.toArray(new IJavaScriptElement[]{});
 		}
 		if (result == null || result.length == 0) {
 			return EMTPY_RESULT_SET;
@@ -248,7 +249,12 @@
 	/* (non-Javadoc)
 	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getCompilationUnit()
 	 */
-	public ICompilationUnit getCompilationUnit() {
+	public IJavaScriptUnit getCompilationUnit() {
+        // Genuitec Begin Fix 6149: Exception opening external HTML file
+	    if (!getJavaProject().exists()) {
+	        return null;
+	    }
+	    // Genuitec End Fix 6149: Exception opening external HTML file
 		synchronized (fLock) {
 			try {
 				if (fCompilationUnit == null) {
@@ -257,7 +263,7 @@
 				}
 
 			}
-			catch (JavaModelException jme) {
+			catch (JavaScriptModelException jme) {
 				if (JsTranslation.DEBUG) {
 					Logger.logException("error creating JSP working copy... ", jme); //$NON-NLS-1$
 				}
@@ -266,10 +272,10 @@
 		}
 		getDocScope(true);
 		try {
-			fCompilationUnit = fCompilationUnit.getWorkingCopy(getWorkingCopyOwner(), getProblemRequestor(), getProgressMonitor());
+			fCompilationUnit = fCompilationUnit.getWorkingCopy(getWorkingCopyOwner(), getProgressMonitor());
 			// fCompilationUnit.makeConsistent(getProgressMonitor());
 		}
-		catch (JavaModelException ex) {
+		catch (JavaScriptModelException ex) {
 			// TODO Auto-generated catch block
 			ex.printStackTrace();
 		}
@@ -279,11 +285,11 @@
 	/* (non-Javadoc)
 	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getElementsFromJsRange(int, int)
 	 */
-	public IJavaElement[] getElementsFromJsRange(int javaPositionStart, int javaPositionEnd) {
-		IJavaElement[] EMTPY_RESULT_SET = new IJavaElement[0];
-		IJavaElement[] result = EMTPY_RESULT_SET;
+	public IJavaScriptElement[] getElementsFromJsRange(int javaPositionStart, int javaPositionEnd) {
+		IJavaScriptElement[] EMTPY_RESULT_SET = new IJavaScriptElement[0];
+		IJavaScriptElement[] result = EMTPY_RESULT_SET;
 		try {
-			ICompilationUnit cu = getCompilationUnit();
+			IJavaScriptUnit cu = getCompilationUnit();
 			if (cu != null) {
 				synchronized (fLock) {
 					int cuDocLength = cu.getBuffer().getLength();
@@ -297,7 +303,7 @@
 				return EMTPY_RESULT_SET;
 			}
 		}
-		catch (JavaModelException x) {
+		catch (JavaScriptModelException x) {
 			Logger.logException(x);
 		}
 		return result;
@@ -325,12 +331,12 @@
 	/* (non-Javadoc)
 	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getJsElementAtOffset(int)
 	 */
-	public IJavaElement getJsElementAtOffset(int jsOffset) {
-		IJavaElement elements = null;
+	public IJavaScriptElement getJsElementAtOffset(int jsOffset) {
+		IJavaScriptElement elements = null;
 		try {
 			elements = getCompilationUnit().getElementAt(jsOffset);
 		}
-		catch (JavaModelException e) {
+		catch (JavaScriptModelException e) {
 			// TODO Auto-generated catch block
 			if (JsTranslation.DEBUG) {
 				Logger.logException("error retrieving java elemtnt from compilation unit... ", e); //$NON-NLS-1$
@@ -340,14 +346,21 @@
 		return elements;
 	}
 
-	private ISourceRange getJSSourceRangeOf(IJavaElement element) {
+	private ISourceRange getJSSourceRangeOf(IJavaScriptElement element) {
 		// returns the offset in html of given element
 		ISourceRange range = null;
-		if (element instanceof SourceRefElement) {
+		if (element instanceof Member) {
+			try {
+				range = ((Member) element).getNameRange();
+			} catch (JavaScriptModelException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}else if (element instanceof SourceRefElement) {
 			try {
 				range = ((SourceRefElement) element).getSourceRange();
 			}
-			catch (JavaModelException e) {
+			catch (JavaScriptModelException e) {
 				e.printStackTrace();
 			}
 		}
@@ -449,8 +462,8 @@
 
 	/**
 	 * 
-	 * @return the problem requestor for the CompilationUnit in this
-	 *         JSPTranslation
+	 * @return the problem requestor for the JavaScriptUnit in this
+	 *         JsTranslation
 	 */
 	private JsProblemRequestor getProblemRequestor() {
 		return CompilationUnitHelper.getInstance().getProblemRequestor();
@@ -460,9 +473,27 @@
 	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#getProblems()
 	 */
 	public List getProblems() {
-		List problems = getProblemRequestor().getCollectedProblems();
+		List problemList = getProblemRequestor().getCollectedProblems();
 		getProblemRequestor().endReporting();
-		return problems != null ? problems : new ArrayList();
+		IProblem[] problems = null;
+		if (problemList == null)
+			problems = new IProblem[0];
+		else 
+			problems = (IProblem[]) problemList.toArray(new IProblem[problemList.size()]);
+		
+		IJsTranslator translator = getTranslator();
+		if (translator instanceof JsTranslator && problems.length > 0) {
+			Region[] generatedRanges = ((JsTranslator) translator).getGeneratedRanges();
+			for (int i = 0; i < problems.length; i++) {
+				for (int j = 0; j < generatedRanges.length; j++) {
+					// remove any problems that are fully reported within a region generated by the translator
+					if (problems[i].getSourceStart() >= generatedRanges[j].getOffset() && problems[i].getSourceEnd() <= (generatedRanges[j].getOffset() + generatedRanges[j].getLength())) {
+						problemList.remove(problems[i]);
+					}
+				}
+			}
+		}
+		return problemList;
 	}
 
 	private IProgressMonitor getProgressMonitor() {
@@ -494,19 +525,22 @@
 	 */
 	public void reconcileCompilationUnit() {
 		// if(true) return;
-		ICompilationUnit cu = getCompilationUnit();
+		IJavaScriptUnit cu = getCompilationUnit();
 		if (fCompilationUnit == null) {
 			return;
 		}
 		if (cu != null) {
 			try {
 				synchronized (fLock) {
-					// if(false)
-					// cu.makeConsistent(getProgressMonitor());
-					cu.reconcile(ICompilationUnit.NO_AST, true, getWorkingCopyOwner(), getProgressMonitor());
+					// clear out old validation messages
+					WorkingCopyOwner workingCopyOwner = getWorkingCopyOwner();
+					JsProblemRequestor problemRequestor = (JsProblemRequestor) workingCopyOwner.getProblemRequestor(cu.getWorkingCopy(getProgressMonitor()));
+					if(problemRequestor != null && problemRequestor.getCollectedProblems() != null)
+						problemRequestor.getCollectedProblems().clear();
+					cu.reconcile(IJavaScriptUnit.NO_AST, true, true, getWorkingCopyOwner(), getProgressMonitor());
 				}
 			}
-			catch (JavaModelException e) {
+			catch (JavaScriptModelException e) {
 				Logger.logException(e);
 			}
 		}
@@ -524,12 +558,12 @@
 				try {
 					if (JsTranslation.DEBUG) {
 						System.out.println("------------------------------------------------------------------"); //$NON-NLS-1$
-						System.out.println("(-) JSPTranslation [" + this + "] discarding CompilationUnit: " + fCompilationUnit); //$NON-NLS-1$ //$NON-NLS-2$
+						System.out.println("(-) JsTranslation [" + this + "] discarding JavaScriptUnit: " + fCompilationUnit); //$NON-NLS-1$ //$NON-NLS-2$
 						System.out.println("------------------------------------------------------------------"); //$NON-NLS-1$
 					}
 					fCompilationUnit.discardWorkingCopy();
 				}
-				catch (JavaModelException e) {
+				catch (JavaScriptModelException e) {
 					// we're done w/ it anyway
 				}
 			}
@@ -540,7 +574,7 @@
 	 * @see org.eclipse.wst.jsdt.web.core.internal.java.IJsTranslation#setProblemCollectingActive(boolean)
 	 */
 	public void setProblemCollectingActive(boolean collect) {
-		ICompilationUnit cu = getCompilationUnit();
+		IJavaScriptUnit cu = getCompilationUnit();
 		if (cu != null) {
 			getProblemRequestor().setIsActive(collect);
 		}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapter.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapter.java
index d8082a5..61aa63d 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapter.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -30,29 +30,35 @@
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.jsdt.core.IJavaProject;
-import org.eclipse.wst.jsdt.core.JavaCore;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.JavaScriptCore;
+import org.eclipse.wst.jsdt.web.core.internal.Logger;
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 
 /**
- * An adapter for getting a JSPTranslation of the document.
- * 
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+
+ * <br><br> this adapter loads translation information from extension points.  this is to allow more complicated html/js translations through extensions.
  * @author pavery
  */
 public class JsTranslationAdapter implements INodeAdapter, IResourceChangeListener {
 
-	private static final boolean DEBUG = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsptranslation")); //$NON-NLS-1$  //$NON-NLS-2$
+	private static final boolean DEBUG = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jstranslation")); //$NON-NLS-1$  //$NON-NLS-2$
 	private IStructuredDocument fHtmlDocument = null;
-	private IJsTranslation fJSPTranslation = null;
+	private IJsTranslation fJSTranslation = null;
 	private NullProgressMonitor fTranslationMonitor = null;
 	private String baseLocation;
 	private boolean listenForChanges=false;
 	private static final String PRIORITY_ATTRIB = "priority";
-	private static final String CLASS_ATTRIB = "class";
-	private IJsTranslation fTranslationElement;
+	private IJsTranslation fTranslationAsFactory;
 	
 	public JsTranslationAdapter(IDOMModel xmlModel) {
 		fHtmlDocument = xmlModel.getStructuredDocument();
@@ -67,8 +73,8 @@
 		}
 	}
 
-	public IJavaProject getJavaProject() {
-		IJavaProject javaProject = null;
+	public IJavaScriptProject getJavaProject() {
+		IJavaScriptProject javaProject = null;
 		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
 		IPath filePath = new Path(baseLocation);
 		IProject project = null;
@@ -76,56 +82,64 @@
 			project = root.getProject(filePath.segment(0));
 		}
 		if (project != null) {
-			javaProject = JavaCore.create(project);
+			javaProject = JavaScriptCore.create(project);
 		}
 		
 		return javaProject;
 	}
 	
 	/**
-	 * Returns the JSPTranslation for this adapter.
+	 * Returns the IJsTranslation for this adapter.
 	 * 
-	 * @return a JSPTranslationExtension
+	 * @return a IJsTranslation
 	 */
-	public IJsTranslation getJSPTranslation(boolean listenForChanges) {
-		if (fJSPTranslation == null || (!this.listenForChanges && listenForChanges)) {
-			if(fJSPTranslation!=null) fJSPTranslation.release();
-			if(fTranslationElement==null) {
+	public IJsTranslation getJsTranslation(boolean listenForChanges) {
+		/*
+		 * If no translation exists or switching from not listening to
+		 * listening
+		 */
+		if (fJSTranslation == null || (!this.listenForChanges && listenForChanges)) {
+			if (fJSTranslation != null)
+				fJSTranslation.release();
+			if (fTranslationAsFactory == null) {
 				/* load the translation factory from the extension point */
 				try {
 					IExtensionRegistry registry = Platform.getExtensionRegistry();
-				    IExtensionPoint extensionPoint =  registry.getExtensionPoint("org.eclipse.wst.jsdt.web.core.javascriptPreProcessor");
-				    IConfigurationElement points[] = extensionPoint.getConfigurationElements();
-				 //   int[] priorities = new int[points.length];
-				   
-				    int highestPriorityValue = -1;
-				    int highestPriorityIndex = -1;
-				    
-				    for(int i = 0;i < points.length;i++){
-				    	String priority = points[i].getAttribute(PRIORITY_ATTRIB);
-				    	int value = Integer.parseInt(priority);
-				    	if(value>highestPriorityValue) {
-				    		highestPriorityIndex = i;
-				    		highestPriorityValue = value;
-				    	}
-				       
-				    }
-				    fTranslationElement = (IJsTranslation)points[highestPriorityIndex].createExecutableExtension("class");
-				}catch(Exception e) {
-					System.out.println(e);
+					IExtensionPoint extensionPoint = registry.getExtensionPoint("org.eclipse.wst.jsdt.web.core.javascriptPreProcessor");
+					IConfigurationElement points[] = extensionPoint.getConfigurationElements();
+
+					int highestPriorityValue = -1;
+					int highestPriorityIndex = -1;
+
+					for (int i = 0; i < points.length; i++) {
+						String priority = points[i].getAttribute(PRIORITY_ATTRIB);
+						int value = Integer.parseInt(priority);
+						if (value > highestPriorityValue) {
+							highestPriorityIndex = i;
+							highestPriorityValue = value;
+						}
+					}
+					fTranslationAsFactory = (IJsTranslation) points[highestPriorityIndex].createExecutableExtension("class");
+				}
+				catch (Exception e) {
+					Logger.logException(e);
 				}
 			}
-			//fJSPTranslation = new JsTranslation(fHtmlDocument, getJavaProject(),listenForChanges);
-			fJSPTranslation = fTranslationElement.getInstance(fHtmlDocument, getJavaProject(), listenForChanges);
-			this.listenForChanges=listenForChanges;
+			if (fTranslationAsFactory != null) {
+				fJSTranslation = fTranslationAsFactory.getInstance(fHtmlDocument, getJavaProject(), listenForChanges);
+			}
+			else {
+				fJSTranslation = new JsTranslation(fHtmlDocument, getJavaProject(), listenForChanges);
+			}
+			this.listenForChanges = listenForChanges;
 		}
 		shouldListenForChanges(listenForChanges);
-		return fJSPTranslation;
+		return fJSTranslation;
 	}
 	
 	
 	private void initializeJavaPlugins() {
-		JavaCore.getPlugin();
+		JavaScriptCore.getPlugin();
 	}
 	
 	public boolean isAdapterForType(Object type) {
@@ -139,11 +153,11 @@
 			fTranslationMonitor.setCanceled(true);
 		}
 		ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
-		if (fJSPTranslation != null) {
+		if (fJSTranslation != null) {
 			if (JsTranslationAdapter.DEBUG) {
-				System.out.println("JSPTranslationAdapter releasing:" + fJSPTranslation); //$NON-NLS-1$
+				System.out.println("JSTranslationAdapter releasing:" + fJSTranslation); //$NON-NLS-1$
 			}
-			fJSPTranslation.release();
+			fJSTranslation.release();
 		}
 	}
 
@@ -152,8 +166,8 @@
 	 */
 	public void resourceChanged(IResourceChangeEvent event) {
 		IProject changedProject = (event==null || event.getResource()==null)?null:event.getResource().getProject();
-		if(changedProject!=null && getJavaProject().getProject().equals(changedProject) && fJSPTranslation!=null){
-			fJSPTranslation.classpathChange();
+		if(changedProject!=null && getJavaProject().getProject().equals(changedProject) && fJSTranslation!=null){
+			fJSTranslation.classpathChange();
 		}	
 	}
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapterFactory.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapterFactory.java
index 8c27037..b621153 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapterFactory.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapterFactory.java
@@ -24,28 +24,32 @@
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 
 /**
- * Factory for JSPTranslationAdapters.
- * 
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+
  * @author pavery
  * 
  */
 public class JsTranslationAdapterFactory extends AbstractAdapterFactory {
 	// for debugging
 	private static final boolean DEBUG;
-	private boolean listenForProjectChanges;
 	
 	static {
-		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsptranslation"); //$NON-NLS-1$
-		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jstranslation"); //$NON-NLS-1$
+ 		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
 	}
 	private JsTranslationAdapter fAdapter = null;
 	
 	public JsTranslationAdapterFactory() {
 		super(IJsTranslation.class, true);
-		listenForProjectChanges = true;
 	}
 	
 	
@@ -74,4 +78,12 @@
 		}
 		super.release();
 	}
+	
+	public static void setupAdapterFactory(IStructuredModel sm) {
+		if (sm.getFactoryRegistry().getFactoryFor(IJsTranslation.class) == null) {
+			JsTranslationAdapterFactory factory = new JsTranslationAdapterFactory();
+			sm.getFactoryRegistry().addFactory(factory);
+		}
+	}
+	
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslator.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslator.java
index 1681d88..50abda8 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslator.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,7 +13,6 @@
  * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken 
  * (repeatedly) as the API evolves.
  *     
- *     
  *******************************************************************************/
 
 
@@ -25,8 +24,10 @@
 import java.io.IOException;
 import java.io.PrintStream;
 import java.util.ArrayList;
-
 import java.util.Iterator;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IResource;
@@ -41,8 +42,14 @@
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.DocumentRewriteSessionEvent;
+import org.eclipse.jface.text.IDocumentExtension4;
+import org.eclipse.jface.text.IDocumentListener;
+import org.eclipse.jface.text.IDocumentRewriteSessionListener;
 import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.Region;
 import org.eclipse.wst.jsdt.core.IBuffer;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
@@ -51,36 +58,67 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.core.utils.StringUtils;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
 /**
- * Translates a JSP/HTML document into its JavaScript pieces. 
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+
+ * Translates a web page into its JavaScript pieces. 
  * 
- * @author childsb
  */
-public class JsTranslator extends Job implements IJsTranslator{
+public class JsTranslator extends Job implements IJsTranslator, IDocumentListener {
 	
 	protected static final boolean DEBUG;
-	private static final boolean DEBUG_SAVE_OUTPUT = false;  //"true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsptranslationstodisk")); //$NON-NLS-1$  //$NON-NLS-2$
-	protected static final String ENDL = "\n"; //$NON-NLS-1$
+	private static final boolean DEBUG_SAVE_OUTPUT = false;  //"true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jstranslationstodisk")); //$NON-NLS-1$  //$NON-NLS-2$
+//	private static final String ENDL = "\n"; //$NON-NLS-1$
 	
-	protected static final boolean REMOVE_XML_COMMENT = true;
-	protected static final String XML_COMMENT_START = "<!--"; //$NON-NLS-1$
-	protected static final String XML_COMMENT_END = "-->"; //$NON-NLS-1$
+	private static final String XML_COMMENT_START = "<!--"; //$NON-NLS-1$
+//	private static final String XML_COMMENT_END = "-->"; //$NON-NLS-1$
+	
+	private static final String CDATA_START = "<![CDATA["; //$NON-NLS-1$
+	private static final String CDATA_START_PAD = new String(Util.getPad(CDATA_START.length()));
+	private static final String CDATA_END = "]]>"; //$NON-NLS-1$
+	private static final String CDATA_END_PAD = new String(Util.getPad(CDATA_END.length()));
+	
+	
+	//TODO: should be an inclusive rule rather than exclusive
+	private static final Pattern fClientSideTagPattern = Pattern.compile("<[^<%?)!>]+/?>"); //$NON-NLS-1$
+
+	// FIXME: Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=307401
+	private String[][] fServerSideDelimiters = new String[][]{{"<%","%>"},{"<?","?>"}};
+	private int fShortestServerSideDelimiterPairLength = 4;
 	
 	static {
-		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jspjavamapping"); //$NON-NLS-1$
-		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsjavamapping"); //$NON-NLS-1$
+ 		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+	}
+	
+	private class DocumentRewriteSessionListener implements IDocumentRewriteSessionListener {
+		public void documentRewriteSessionChanged(DocumentRewriteSessionEvent event) {
+			if (DocumentRewriteSessionEvent.SESSION_START.equals(event.getChangeType())) {
+				fIsInRewriteSession = true;
+			}
+			else if (DocumentRewriteSessionEvent.SESSION_STOP.equals(event.getChangeType())) {
+				fIsInRewriteSession = false;
+				schedule();
+			}
+		}		
 	}
 
 	private IStructuredDocumentRegion fCurrentNode;
+	boolean fIsInRewriteSession = false;
 	protected StringBuffer fScriptText = new StringBuffer();
 	protected IStructuredDocument fStructuredDocument = null;
 	protected ArrayList importLocationsInHtml = new ArrayList();
 	/* use java script by default */
 	protected boolean fIsGlobalJs = true;
-	protected ArrayList rawImports = new ArrayList(); // traslated
+	protected ArrayList rawImports = new ArrayList(); // translated
 	protected ArrayList scriptLocationInHtml = new ArrayList();
 	protected int scriptOffset = 0;
 	
@@ -91,6 +129,13 @@
 	protected boolean cancelParse = false;
 	protected int missingEndTagRegionStart = -1;
 	protected static final boolean ADD_SEMICOLON_AT_INLINE=true;
+	private IDocumentRewriteSessionListener fDocumentRewriteSessionListener = new DocumentRewriteSessionListener();
+
+	/*
+	 * org.eclipse.jface.text.Regions that contain purely generated code, for
+	 * which no validation messages should be reported to the user
+	 */
+	private List fGeneratedRanges = new ArrayList();
 	
 	protected boolean isGlobalJs() {
 		return fIsGlobalJs;
@@ -111,47 +156,27 @@
 	
 	protected void advanceNextNode() {
 		setCurrentNode(getCurrentNode().getNext());
-	}
-	
-	protected void cleanupXmlQuotes() {
-		if(REMOVE_XML_COMMENT) {
-			int index = -1;
-			int replaceLength  = XML_COMMENT_START.length();
-			while((index = fScriptText.indexOf(XML_COMMENT_START, index)) > -1) {
-				fScriptText.replace(index, index + replaceLength, new String(Util.getPad(replaceLength)));
-			}
-			
-			index = -1;
-			replaceLength  = XML_COMMENT_END.length();
-			while((index = fScriptText.indexOf(XML_COMMENT_END, index)) > -1) {
-				fScriptText.replace(index, index + replaceLength, new String(Util.getPad(replaceLength)));
-			}
-		}
-	}
-	
-	
-	
+	}	
 	
 	public JsTranslator(IStructuredDocument document, 	String fileName) {
-		super("JavaScript translation for : "  + fileName); //$NON-NLS-1$
-		fStructuredDocument = document;
-		
-		fStructuredDocument.addDocumentListener(this);
-		setPriority(Job.LONG);
-		setSystem(true);
-		schedule();
-		reset();
+		this(document, fileName, false);
 	}
 	
+	/**
+	 * @deprecated
+	 */
 	public JsTranslator() {
 		super("JavaScript Translation");
 	}
 	
 	public JsTranslator(IStructuredDocument document, 	String fileName, boolean listenForChanges) {
-		super("JavaScript translation for : "  + fileName); //$NON-NLS-1$
+		super("JavaScript translation for : " + fileName); //$NON-NLS-1$
 		fStructuredDocument = document;
-		if(listenForChanges) {
+		if (listenForChanges) {
 			fStructuredDocument.addDocumentListener(this);
+			if (fStructuredDocument instanceof IDocumentExtension4) {
+				((IDocumentExtension4) fStructuredDocument).addDocumentRewriteSessionListener(fDocumentRewriteSessionListener);
+			}
 			setPriority(Job.LONG);
 			setSystem(true);
 			schedule();
@@ -164,6 +189,14 @@
 	 */
 	public String getJsText() {
 		synchronized(finished) {
+			/* if mid re-write session doc changes have been ignored,
+			 * but if jsText is specifically request we should re-translate
+			 * to pick up any changes thus far
+			 */
+			if(this.fIsInRewriteSession) {
+				this.reset();
+			}
+			
 			return fScriptText.toString();
 		}
 	}
@@ -240,13 +273,14 @@
 		synchronized(fLock) {
 			scriptOffset = 0;
 			// reset progress monitor
-			cancelParse = false;
 			fScriptText = new StringBuffer();
 			fCurrentNode = fStructuredDocument.getFirstStructuredDocumentRegion();
 			rawImports.clear();
 			importLocationsInHtml.clear();
 			scriptLocationInHtml.clear();
 			missingEndTagRegionStart = -1;
+			cancelParse = false;
+			fGeneratedRanges.clear();
 		}
 		translate();
 	}
@@ -266,13 +300,16 @@
 		//setCurrentNode(fStructuredDocument.getFirstStructuredDocumentRegion());
 		
 		synchronized(finished) {
+			if(getCurrentNode() != null) {
+			NodeHelper nh = new NodeHelper(getCurrentNode());
 			while (getCurrentNode() != null && !isCanceled()) {
+				nh.setDocumentRegion(getCurrentNode());
+				
 				// System.out.println("Translator Looking at Node
 				// type:"+getCurrentNode().getType()+"---------------------------------:");
 				// System.out.println(new NodeHelper(getCurrentNode()));
 				// i.println("/---------------------------------------------------");
 				if (getCurrentNode().getType() == DOMRegionContext.XML_TAG_NAME) {
-					NodeHelper nh = new NodeHelper(getCurrentNode());
 					if ((!nh.isEndTag() || nh.isSelfClosingTag()) && nh.nameEquals("script")) { //$NON-NLS-1$
 						/*
 						 * Handles the following cases: <script
@@ -281,7 +318,7 @@
 						 * language=javascripttype <script src=''> global js type.
 						 * <script> (global js type)
 						 */
-						if (NodeHelper.isInArray(JsDataTypes.JSVALIDDATATYPES, nh.getAttributeValue("type")) || NodeHelper.isInArray(JsDataTypes.JSVALIDDATATYPES, nh.getAttributeValue("language")) || isGlobalJs()) { //$NON-NLS-1$ //$NON-NLS-2$
+						if (NodeHelper.isInArray(JsDataTypes.JSVALIDDATATYPES, nh.getAttributeValue("type")) || NodeHelper.isInArray(JsDataTypes.JSVALIDDATATYPES, nh.getAttributeValue("language")) || (nh.getAttributeValue("type")==null && nh.getAttributeValue("language")==null && isGlobalJs())) { //$NON-NLS-1$ //$NON-NLS-2$
 							if (nh.containsAttribute(new String[] { "src" })) { //$NON-NLS-1$
 								// Handle import
 								translateScriptImportNode(getCurrentNode());
@@ -294,7 +331,7 @@
 							}
 						} // End search for <script> sections
 					} else if (nh.containsAttribute(JsDataTypes.HTMLATREVENTS)) {
-						/* Check for embeded JS events in any tags */
+						/* Check for embedded JS events in any tags */
 						translateInlineJSNode(getCurrentNode());
 					} else if (nh.nameEquals("META") && nh.attrEquals("http-equiv", "Content-Script-Type") && nh.containsAttribute(new String[] { "content" })) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 						// <META http-equiv="Content-Script-Type" content="type">
@@ -308,7 +345,7 @@
 			if(getCompUnitBuffer()!=null) getCompUnitBuffer().setContents(fScriptText.toString());
 		}
 		finishedTranslation();
-	
+		}
 	}
 	
 	protected void finishedTranslation() {
@@ -362,9 +399,6 @@
 			}
 			
 		}
-		
-		cleanupXmlQuotes();
-	
 	}
 	
 	/* (non-Javadoc)
@@ -376,7 +410,7 @@
 		// w/ScriptOffset:"
 		// + scriptOffset);
 		
-			NodeHelper nh = new NodeHelper(container);
+			//NodeHelper nh = new NodeHelper(container);
 			// System.out.println("inline js node looking at:\n" + nh);
 			/* start a function header.. will amend later */
 			ITextRegionList t = container.getRegions();
@@ -464,28 +498,190 @@
 			// region
 			
 			//System.out.println("Region text: " + container.getText().substring(region.getStart(), region.getEnd()));
-			boolean isBlockRegion = region instanceof ITextRegionContainer;
+			boolean isContainerRegion = region instanceof ITextRegionContainer;
 			/* make sure its not a sub container region, probably JSP */
 			if (type == DOMRegionContext.BLOCK_TEXT ) {
 				int scriptStart = container.getStartOffset();
-				int scriptTextEnd = container.getEndOffset() - container.getStartOffset();
-				String regionText = container.getText().substring(region.getStart(), region.getEnd());
-				int regionLength = regionText.length();
-				// /Position inScript = new Position(scriptOffset,
-				// regionLength);
-				Position inHtml = new Position(scriptStart, scriptTextEnd);
-				scriptLocationInHtml.add(inHtml);
+				int scriptTextLength = container.getLength();
+				String regionText = container.getFullText(region);
+				regionText = StringUtils.replace(regionText, CDATA_START, CDATA_START_PAD);
+				regionText = StringUtils.replace(regionText, CDATA_END, CDATA_END_PAD);
+				int regionLength = region.getLength();
+				
 				spaces = Util.getPad(scriptStart - scriptOffset);
 				fScriptText.append(spaces); 	
-				// fJsToHTMLRanges.put(inScript, inHtml);
-				if(isBlockRegion) {
-					spaces = Util.getPad(regionLength);
-					fScriptText.append(spaces); 	
-				}else {
-					fScriptText.append(regionText);
+				// skip over XML/HTML comment starts
+				if (regionText.indexOf(XML_COMMENT_START) >= 0) {
+					int index = regionText.indexOf(XML_COMMENT_START);
+					int leadingTrimPlusCommentStart = index + XML_COMMENT_START.length();
+					boolean replaceCommentStart = true;
+					for (int i = 0; i < index; i++) {
+						/*
+						 * replace the comment start in the translation when
+						 * it's preceded only by white space
+						 */
+						replaceCommentStart = replaceCommentStart && Character.isWhitespace(regionText.charAt(i));
+					}
+					if (replaceCommentStart) {
+						StringBuffer newRegionText = new StringBuffer(regionText.substring(0, index));
+						spaces = Util.getPad(XML_COMMENT_START.length());
+						newRegionText.append(spaces);
+						newRegionText.append(regionText.substring(leadingTrimPlusCommentStart));
+						regionText = newRegionText.toString();
+					}
 				}
-				
-				
+				// server-side code
+//				else {
+					/*
+					 * Fix for
+					 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=284774
+					 * end of last valid JS source, start of next content to
+					 * skip
+					 */
+					// last offset of valid JS source, after which there's server-side stuff
+					int validJSend = 0;
+					// start of next valid JS source, last offset of content that was skipped
+					int validJSstart = 0;
+
+					Matcher matcher = fClientSideTagPattern.matcher(regionText);
+					// note the start of a HTML tag if one's present
+					int clientMatchStart = matcher.find() ? matcher.start() : -1;
+
+					StringBuffer contents = new StringBuffer();
+					
+					int serverSideStart = -1;
+					int serverSideDelimiter = 0;
+
+					// find any instance of server code blocks in the region text
+					for (int i = 0; i < fServerSideDelimiters.length; i++) {
+						int index = regionText.indexOf(fServerSideDelimiters[i][0]);
+						if (serverSideStart < 0) {
+							serverSideStart = index;
+							serverSideDelimiter = i;
+						}
+						else if (index >= 0) {
+							serverSideStart = Math.min(serverSideStart, index);
+							if (serverSideStart == index) {
+								serverSideDelimiter = i;
+							}
+						}
+					}
+					// contains something other than pure JavaScript
+					while (serverSideStart > -1 || clientMatchStart > -1) { //$NON-NLS-1$
+						validJSend = validJSstart;
+						boolean biasClient = false;
+						boolean biasServer = false;
+						// update the start of content to skip
+						if (clientMatchStart > -1 && serverSideStart > -1) {
+							validJSend = Math.min(clientMatchStart, serverSideStart);
+							biasClient = validJSend == clientMatchStart;
+							biasServer = validJSend == serverSideStart;
+						}
+						else if (clientMatchStart > -1 && serverSideStart < 0) {
+							validJSend = clientMatchStart;
+							biasClient = true;
+						}
+						else if (clientMatchStart < 0 && serverSideStart > -1) {
+							validJSend = serverSideStart;
+							biasServer = true;
+						}
+						
+						// append if there's something we want to include
+						if (-1 < validJSstart && -1 < validJSend) {
+							// append what we want to include
+							contents.append(regionText.substring(validJSstart, validJSend));
+							
+							// change the skipped content to a valid variable name and append it as a placeholder
+							int startOffset = container.getStartOffset(region) + validJSend;
+
+							String serverEnd = fServerSideDelimiters[serverSideDelimiter][1];
+							int serverSideEnd = (regionLength > validJSend + serverEnd.length()) ? regionText.indexOf(serverEnd, validJSend + fServerSideDelimiters[serverSideDelimiter][1].length()) : -1;
+							if (serverSideEnd > -1)
+								serverSideEnd += serverEnd.length();
+							int clientMatchEnd = matcher.find(validJSend) ? matcher.end() : -1;
+							// update end of what we skipped
+							validJSstart = -1;
+							if (clientMatchEnd > validJSend && serverSideEnd > validJSend) {
+								if (biasClient)
+									validJSstart = clientMatchEnd;
+								else if (biasServer)
+									validJSstart = serverSideEnd;
+								else
+									validJSstart = Math.min(clientMatchEnd, serverSideEnd);
+							}
+							if (clientMatchEnd >= validJSend && serverSideEnd < 0)
+								validJSstart = matcher.end();
+							if (clientMatchEnd < 0 && serverSideEnd >= validJSend)
+								validJSstart = serverSideEnd;
+							int line = container.getParentDocument().getLineOfOffset(startOffset);
+							int column;
+							try {
+								column = startOffset - container.getParentDocument().getLineOffset(line);
+							}
+							catch (BadLocationException e) {
+								column = -1;
+							}
+							// substituted text length much match original length exactly, find text of the right length
+							int start = validJSend + container.getStartOffset(region);
+							contents.append('_');
+							for (int i = validJSend + 1; i < validJSstart; i++) {
+								switch (i - validJSend) {
+									case 1 :
+										contents.append('$');
+										break;
+									case 2 :
+										contents.append('t');
+										break;
+									case 3 :
+										contents.append('a');
+										break;
+									case 4 :
+										contents.append('g');
+										break;
+									default :
+										contents.append('_');
+								}
+							}
+							int end = validJSstart + container.getStartOffset(region);
+							// remember that this source range w
+							fGeneratedRanges.add(new Region(start, end - start));
+						}
+						// set up to end while if no end for valid
+						if (validJSstart > 0) {
+							int serverSideStartGuess = -1;
+							for (int i = 0; i < fServerSideDelimiters.length; i++) {
+								int index = regionText.indexOf(fServerSideDelimiters[i][0], validJSstart);
+								if (serverSideStartGuess < 0) {
+									serverSideStartGuess = index;
+									serverSideDelimiter = i;
+								}
+								else if (index >= 0) {
+									serverSideStartGuess = Math.min(serverSideStartGuess, index);
+									if (serverSideStartGuess == index) {
+										serverSideDelimiter = i;
+									}
+								}
+							}
+							serverSideStart = validJSstart < regionLength - fShortestServerSideDelimiterPairLength ? serverSideStartGuess : -1;
+							clientMatchStart = validJSstart < regionLength ? (matcher.find(validJSstart) ? matcher.start() : -1) : -1;
+						}
+						else {
+							serverSideStart = clientMatchStart = -1;
+						}
+					}
+					if (validJSstart >= 0) {
+						contents.append(regionText.substring(validJSstart));
+					}
+					if (contents.length() != 0) {
+						fScriptText.append(contents.toString());
+					}
+					else {
+						fScriptText.append(regionText);
+					}
+					Position inHtml = new Position(scriptStart, scriptTextLength);
+					scriptLocationInHtml.add(inHtml);
+//				}
+								
 				scriptOffset = fScriptText.length();
 			}
 		}
@@ -517,7 +713,7 @@
 		}
 	}
 
-	
+
 
 	/* (non-Javadoc)
 	 * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
@@ -537,6 +733,10 @@
 	 * @see org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator#documentChanged(org.eclipse.jface.text.DocumentEvent)
 	 */
 	public void documentChanged(DocumentEvent event) {
+		if (fIsInRewriteSession) {
+			return;
+		}
+
 		reset();
 	}
 
@@ -544,6 +744,7 @@
 	 * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
 	 */
 	protected IStatus run(IProgressMonitor monitor) {
+		reset();
 		return Status.OK_STATUS;
 	}
 	
@@ -552,6 +753,15 @@
 	 */
 	public void release() {
 		fStructuredDocument.removeDocumentListener(this);
+		if (fStructuredDocument instanceof IDocumentExtension4) {
+			((IDocumentExtension4) fStructuredDocument).removeDocumentRewriteSessionListener(fDocumentRewriteSessionListener);
+		}
 	}
-	
+
+	/**
+	 * @return the fGeneratedRanges
+	 */
+	public Region[] getGeneratedRanges() {
+		return (Region[]) fGeneratedRanges.toArray(new Region[fGeneratedRanges.size()]);
+	}
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Messages.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Messages.java
index bb2228f..4b0baff 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Messages.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Messages.java
@@ -1,29 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
 package org.eclipse.wst.jsdt.web.core.javascript;
 
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
+import org.eclipse.osgi.util.NLS;
 
 /**
- * @author childsb
- *
+ * 
+ * 
+ * Provisional API: This class/interface is part of an interim API that is
+ * still under development and expected to change significantly before
+ * reaching stability. It is being made available at this early stage to
+ * solicit feedback from pioneering adopters on the understanding that any
+ * code that uses this API will almost certainly be broken (repeatedly) as the
+ * API evolves.
+ * 
  */
-public class Messages {
+public class Messages extends NLS {
 	private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.core.internal.java.messages"; //$NON-NLS-1$
 
-	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
 	private Messages() {
 	}
 
-	public static String getString(String key) {
-		try {
-			return RESOURCE_BUNDLE.getString(key);
-		}
-		catch (MissingResourceException e) {
-			return '!' + key + '!';
-		}
+	static {
+		// initialize resource bundle
+		NLS.initializeMessages(Messages.BUNDLE_NAME, Messages.class);
 	}
+
+	public static String NodeHelper00;
+	public static String NodeHelper01;
+	public static String NodeHelper03;
+	public static String NodeHelper11;
+	public static String NodeHelper12;
+
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/NodeHelper.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/NodeHelper.java
index 9b35fe9..8afd83e 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/NodeHelper.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/NodeHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -25,7 +25,14 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+/**
+*
 
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class NodeHelper {
 	protected static final char DOUBLE_QUOTE_CHAR = '\"';
 	protected static final String DOUBLE_QUOTE_ENTITY = "&quot;"; //$NON-NLS-1$
@@ -53,7 +60,7 @@
 		char lastChar = string.charAt(lastIndex);
 		return (((firstChar == NodeHelper.SINGLE_QUOTE_CHAR) && (lastChar == NodeHelper.SINGLE_QUOTE_CHAR)) || ((firstChar == NodeHelper.DOUBLE_QUOTE_CHAR) && (lastChar == NodeHelper.DOUBLE_QUOTE_CHAR)));
 	}
-	protected final IStructuredDocumentRegion region;
+	protected IStructuredDocumentRegion region;
 	
 	public NodeHelper(IStructuredDocumentRegion region) {
 		this.region = region;
@@ -69,17 +76,15 @@
 		if (region == null) {
 			return null;
 		}
-		// For debuging
+		// For debugging
 		ITextRegionList t = region.getRegions();
 		ITextRegion r;
 		Iterator regionIterator = t.iterator();
-		String StructuredValue = Messages.getString("NodeHelper.0") + getTagName() + Messages.getString("NodeHelper.1"); //$NON-NLS-1$ //$NON-NLS-2$
+		String StructuredValue = Messages.NodeHelper00 + getTagName() + Messages.NodeHelper01; //$NON-NLS-1$ //$NON-NLS-2$
 		while (regionIterator.hasNext()) {
 			r = (ITextRegion) regionIterator.next();
 			if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
-				int start = r.getStart();
-				int offset = r.getTextEnd();
-				StructuredValue += "\t\t" + region.getText().substring(start, offset); //$NON-NLS-1$
+				StructuredValue += "\t\t" + region.getText(r); //$NON-NLS-1$
 				/*
 				 * Theres a XML_TAG_ATTRIBUTE_EQUALS after the
 				 * XML_TAG_ATTRIBUTE_NAME we have to get rid of
@@ -87,14 +92,13 @@
 				if (regionIterator.hasNext()) {
 					regionIterator.next();
 				}
-				if (regionIterator.hasNext()) {
-					r = ((ITextRegion) regionIterator.next());
-				}
-				System.out.println(Messages.getString("NodeHelper.3")); //$NON-NLS-1$
-				if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
-					int valStart = r.getStart();
-					int valOffset = r.getTextEnd();
-					StructuredValue += "\t\t" + stripEndQuotes(region.getText().substring(valStart, valOffset)) + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
+				if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
+					if (regionIterator.hasNext()) {
+						r = ((ITextRegion) regionIterator.next());
+					}
+					if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+						StructuredValue += "\t\t" + stripEndQuotes(region.getText(r)) + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
+					}
 				}
 			}
 		}
@@ -114,9 +118,7 @@
 		while (regionIterator.hasNext()) {
 			r = (ITextRegion) regionIterator.next();
 			if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
-				int start = r.getStart();
-				int offset = r.getTextEnd();
-				String tagname = region.getText().substring(start, offset).trim();
+				String tagname = region.getText(r).trim();
 				/* Attribute values aren't case sensative */
 				if (NodeHelper.isInArray(name, tagname)) {
 					return true;
@@ -139,9 +141,7 @@
 		while (regionIterator.hasNext()) {
 			r = (ITextRegion) regionIterator.next();
 			if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
-				int start = r.getStart();
-				int offset = r.getTextEnd();
-				String tagname = region.getText().substring(start, offset).trim();
+				String tagname = region.getText(r).trim();
 				/*
 				 * Attribute values aren't case sensative, also make sure next
 				 * region is attrib value
@@ -154,9 +154,7 @@
 						r = ((ITextRegion) regionIterator.next());
 					}
 					if (r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
-						int valStart = r.getStart();
-						int valOffset = r.getTextEnd();
-						return stripEndQuotes(region.getText().substring(valStart, valOffset));
+						return stripEndQuotes(region.getText(r));
 					}
 				}
 			}
@@ -189,9 +187,7 @@
 		while (regionIterator.hasNext()) {
 			r = (ITextRegion) regionIterator.next();
 			if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
-				int start = r.getStart();
-				int offset = r.getTextEnd();
-				return region.getText().substring(start, offset);
+				return region.getText(r);
 			}
 		}
 		return null;
@@ -201,36 +197,27 @@
 		if (region == null) {
 			return false;
 		}
-		ITextRegionList t = region.getRegions();
-		ITextRegion r;
-		Iterator regionIterator = t.iterator();
-		while (regionIterator.hasNext()) {
-			r = (ITextRegion) regionIterator.next();
-			if (r.getType() == DOMRegionContext.XML_END_TAG_OPEN) {
-				return true;
-			}
-		}
-		return false;
+		return DOMRegionContext.XML_END_TAG_OPEN.equals(region.getFirstRegion().getType());
 	}
 	
 	public boolean isSelfClosingTag() {
 		if (region == null) {
 			return false;
 		}
-		if (region == null) {
-			return false;
-		}
-		ITextRegionList regions = region.getRegions();
-		ITextRegion r = regions.get(regions.size() - 1);
-		return r.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE;
+		return DOMRegionContext.XML_EMPTY_TAG_CLOSE.equals(region.getLastRegion().getType());
 	}
 	
 	public boolean nameEquals(String name) {
-		if (region == null) {
+		if (region == null || name == null) {
 			return false;
 		}
-		String tagName;
-		return ((tagName = getTagName()) != null && tagName.equalsIgnoreCase(name));
+		return name.equalsIgnoreCase(getTagName());
+	}
+	
+	public void setDocumentRegion(IStructuredDocumentRegion newRegion) {
+		if (newRegion == null)
+			throw new IllegalArgumentException();
+		region = newRegion;
 	}
 	
 	public String stripEndQuotes(String text) {
@@ -251,7 +238,7 @@
 		while (regionIterator.hasNext()) {
 			ITextRegion r = (ITextRegion) regionIterator.next();
 			String nodeType = r.getType();
-			nodeText += (Messages.getString("NodeHelper.11") + nodeType + Messages.getString("NodeHelper.12") + region.getText().substring(r.getStart(), r.getTextEnd()) + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			nodeText += (Messages.NodeHelper11 + nodeType + Messages.NodeHelper12 + region.getText(r) + "\n"); //$NON-NLS-1$
 		}
 		return nodeText;
 	}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Util.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Util.java
index 0a1b3d9..a42aead 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Util.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Util.java
@@ -22,6 +22,13 @@
 import java.util.Arrays;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author childsb
  *
  */
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/WebRootFinder.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/WebRootFinder.java
index 0415ee7..24cc871 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/WebRootFinder.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/WebRootFinder.java
@@ -23,31 +23,28 @@
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.eclipse.wst.jsdt.web.core.internal.project.ModuleCoreSupport;
+/**
+*
 
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class WebRootFinder {
 	public static IPath getServerContextRoot(IProject project) {
-		String contextRoot = ComponentUtilities.getServerContextRoot(project);
-		if(contextRoot==null) {
-			contextRoot = project.getName();
-		}
-		return new Path(contextRoot);
-	}
-	
-	private static String getProjectRoot(IProject project) {
-		return project.getLocation().toString();
+		IPath root = ModuleCoreSupport.getWebContentRootPath(project);
+		if (root != null)
+			return root;
+		return Path.ROOT;
 	}
 	
 	public static IPath getWebContentFolder(IProject project) {
-		IVirtualComponent comp = ComponentCore.createComponent(project);
-		if (comp != null) {
-			IVirtualFolder rootFolder = comp.getRootFolder();
-			return rootFolder.getUnderlyingFolder().getProjectRelativePath();
-		}
-		return new Path(""); //$NON-NLS-1$
+		IPath root = ModuleCoreSupport.getWebContentRootPath(project);
+		if (root != null)
+			return root.removeFirstSegments(1);
+		return Path.ROOT;
 	}
 	
 	public static String getWebContext(IProject project) {
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/messages.properties b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/messages.properties
index 5ea948b..ebccdda 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/messages.properties
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/messages.properties
@@ -1,3 +1,13 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
 NodeHelper.0=Tag name:
 NodeHelper.1=\tAttribute\tValue\n
 NodeHelper.3=attrib type
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/IndexWorkspaceJob.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/IndexWorkspaceJob.java
index 84945d0..a259283 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/IndexWorkspaceJob.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/IndexWorkspaceJob.java
@@ -1,10 +1,10 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
@@ -23,68 +23,77 @@
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Status;
-//import org.eclipse.core.runtime.content.IContentType;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.wst.jsdt.web.core.internal.JsCoreMessages;
 import org.eclipse.wst.jsdt.web.core.internal.validation.Util;
 
 /**
- * Re-indexes the entire workspace. Ensures the JSP Index is in a stable state
- * before performing a search. (like after a crash or if previous indexing was
- * canceled)
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+* (copied from JSP)
+ * Re-indexes the entire workspace.
+ * Ensures the JSP Index is in a stable state before performing a search.
+ * (like after a crash or if previous indexing was canceled)
  * 
  * @author pavery
  */
 public class IndexWorkspaceJob extends Job {
+
 	// for debugging
 	static final boolean DEBUG;
 	static {
-		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jspindexmanager"); //$NON-NLS-1$
-		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsindexmanager"); //$NON-NLS-1$
+ 		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
 	}
+	
 	/**
-	 * Visitor that retrieves jsp project paths for all jsp files in the
-	 * workspace, and adds the files to be indexed as they are encountered
+	 * Visitor that retrieves jsp project paths for all jsp files in the workspace,
+	 * and adds the files to be indexed as they are encountered
 	 */
 	private class JSPFileVisitor implements IResourceProxyVisitor {
-		private List files = new ArrayList();
+	    private List files = new ArrayList(); 
+		
 		// monitor from the Job
 		IProgressMonitor fInnerMonitor = null;
-		
 		public JSPFileVisitor(IProgressMonitor monitor) {
 			this.fInnerMonitor = monitor;
 		}
 		
-		public final IFile[] getFiles() {
-			return (IFile[]) this.files.toArray(new IFile[this.files.size()]);
-		}
-		
 		public boolean visit(IResourceProxy proxy) throws CoreException {
+			
 			// check job canceled
-			if (this.fInnerMonitor != null && this.fInnerMonitor.isCanceled()) {
+			if ((this.fInnerMonitor != null) && this.fInnerMonitor.isCanceled()) {
 				setCanceledState();
 				return false;
 			}
+			
 			// check search support canceled
-			if (JsSearchSupport.getInstance().isCanceled()) {
+			if(JsSearchSupport.getInstance().isCanceled()) {
 				setCanceledState();
 				return false;
 			}
+			
 			if (proxy.getType() == IResource.FILE) {
+				
 				// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3553
 				// check this before description
 				// check name before actually getting the file (less work)
-				if (Util.isJsType(proxy.getName())) {
+				if(Util.isJsType(proxy.getName())) {
 					IFile file = (IFile) proxy.requestResource();
-					if (file.exists()) {
-						if (IndexWorkspaceJob.DEBUG) {
+					if(file.exists()) {
+						
+						if(DEBUG) {
 							System.out.println("(+) IndexWorkspaceJob adding file: " + file.getName()); //$NON-NLS-1$
 						}
-						// this call will check the ContentTypeDescription, so
-						// don't need to do it here.
-						// JSPSearchSupport.getInstance().addJspFile(file);
+						// this call will check the ContentTypeDescription, so don't need to do it here.
+						//JSPSearchSupport.getInstance().addJspFile(file);
 						this.files.add(file);
 						this.fInnerMonitor.subTask(proxy.getName());
+						
 						// don't search deeper for files
 						return false;
 					}
@@ -92,50 +101,68 @@
 			}
 			return true;
 		}
+		
+		public final IFile[] getFiles() {
+		    return (IFile[])this.files.toArray(new IFile[this.files.size()]);
+		}
 	}
+	
 	//private IContentType fContentTypeJSP = null;
 	
 	public IndexWorkspaceJob() {
-		// pa_TODO may want to say something like "Rebuilding JSP Index" to be
-		// more
-		// descriptive instead of "Updating JSP Index" since they are 2
-		// different things
+		// pa_TODO may want to say something like "Rebuilding JSP Index" to be more
+		// descriptive instead of "Updating JSP Index" since they are 2 different things
 		super(JsCoreMessages.JSPIndexManager_0);
 		setPriority(Job.LONG);
 		setSystem(true);
 	}
-	
 
+//	IContentType getJspContentType() {
+//		if(this.fContentTypeJSP == null)
+//			this.fContentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
+//		return this.fContentTypeJSP;
+//	}
 	
+	/**
+	 * @see org eclipse.core.internal.jobs.InternalJob#run(org.eclipse.core.runtime.IProgressMonitor) 
+	 * for similar method
+	 */
 	protected IStatus run(IProgressMonitor monitor) {
+		
 		IStatus status = Status.OK_STATUS;
-		if (monitor.isCanceled()) {
+		
+		if(monitor.isCanceled()) {
 			setCanceledState();
 			return Status.CANCEL_STATUS;
 		}
-		if (IndexWorkspaceJob.DEBUG) {
+		
+		if(DEBUG) {
 			System.out.println(" ^ IndexWorkspaceJob started: "); //$NON-NLS-1$
 		}
+		
 		long start = System.currentTimeMillis();
+		
 		try {
-			JSPFileVisitor visitor = new JSPFileVisitor(monitor);
-			// collect all jsp files
+		    JSPFileVisitor visitor = new JSPFileVisitor(monitor);
+		    // collect all jsp files
 			ResourcesPlugin.getWorkspace().getRoot().accept(visitor, IResource.DEPTH_INFINITE);
 			// request indexing
-			// this is pretty much like faking an entire workspace resource
-			// delta
+			// this is pretty much like faking an entire workspace resource delta
 			JsIndexManager.getInstance().indexFiles(visitor.getFiles());
-		} catch (CoreException e) {
-			if (IndexWorkspaceJob.DEBUG) {
+		}
+		catch (CoreException e) {
+			if(DEBUG) {
 				e.printStackTrace();
 			}
-		} finally {
+		}
+		finally {
 			monitor.done();
 		}
 		long finish = System.currentTimeMillis();
-		if (IndexWorkspaceJob.DEBUG) {
+		if(DEBUG) {
 			System.out.println(" ^ IndexWorkspaceJob finished\n   total time running: " + (finish - start)); //$NON-NLS-1$
 		}
+		
 		return status;
 	}
 	
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JSDTSearchDocumentDelegate.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JSDTSearchDocumentDelegate.java
index 438d818..0862b4b 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JSDTSearchDocumentDelegate.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JSDTSearchDocumentDelegate.java
@@ -1,80 +1,84 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
 package org.eclipse.wst.jsdt.web.core.javascript.search;
 
 import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 import org.eclipse.wst.jsdt.internal.core.search.JavaSearchDocument;
 import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
 
-
 /**
- * Wrapper method to set getPath() path to be the path of the compilation unit
- * for the jsp file. (since it's a final method, it needs to be set via
- * constructor)
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*(copied from JSP)
+ * Wrapper method to set getPath() path to be the path of the compilation unit 
+ * for the jsp file. (since it's a final method, it needs to be set via constructor)
  * 
  * @author pavery
  */
-/* Used to extend SearchDocument */
 public class JSDTSearchDocumentDelegate extends JavaSearchDocument {
+	
 	private JsSearchDocument fJSPSearchDoc = null;
 	
 	public JSDTSearchDocumentDelegate(JsSearchDocument jspSearchDoc) {
+		
 		super(jspSearchDoc.getPath(), jspSearchDoc.getParticipant());
 		this.fJSPSearchDoc = jspSearchDoc;
 	}
-	
-	
+
 	public byte[] getByteContents() {
+		
 		return this.fJSPSearchDoc.getByteContents();
 	}
-	
-	
+
 	public char[] getCharContents() {
+		
 		return this.fJSPSearchDoc.getCharContents();
 	}
 	
-	
-	public String getEncoding() {
-		return this.fJSPSearchDoc.getEncoding();
-	}
-	
-	public IFile getFile() {
-		return this.fJSPSearchDoc.getFile();
-	}
-	
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.jsdt.core.search.SearchDocument#getJavaElement()
-	 */
-	
-	public IJavaElement getJavaElement() {
-		return getJspTranslation().getCompilationUnit();
-	}
-	
 	public String getJavaText() {
 		return this.fJSPSearchDoc.getJavaText();
 	}
+
+	public String getEncoding() {
+		
+		return this.fJSPSearchDoc.getEncoding();
+	}
+	
+	public IFile getFile() {
+		
+		return this.fJSPSearchDoc.getFile();
+	}
 	
 	public IJsTranslation getJspTranslation() {
-		return this.fJSPSearchDoc.getJSPTranslation();
+		
+		return this.fJSPSearchDoc.getJSTranslation();
 	}
 	
-	
-	public boolean isVirtual() {
-		return true;
-	}
+//	public int getJspOffset(int javaOffset) {
+//		
+//		return this.fJSPSearchDoc.getJspOffset(javaOffset);
+//	}
 	
 	public void release() {
 		this.fJSPSearchDoc.release();
 	}
+	public IJavaScriptElement getJavaElement() {
+		return getJspTranslation().getCompilationUnit();
+	}
+	public boolean isVirtual() {
+		return true;
+	}
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsIndexManager.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsIndexManager.java
index 2b19077..11b1149 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsIndexManager.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsIndexManager.java
@@ -1,10 +1,10 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
@@ -31,12 +31,14 @@
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Plugin;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
 import org.eclipse.core.runtime.jobs.IJobChangeEvent;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.core.runtime.jobs.JobChangeAdapter;
 import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.JavaScriptCore;
 import org.eclipse.wst.jsdt.internal.core.JavaModelManager;
+import org.eclipse.wst.jsdt.internal.core.index.Index;
 import org.eclipse.wst.jsdt.internal.core.search.indexing.IndexManager;
 import org.eclipse.wst.jsdt.web.core.internal.JsCoreMessages;
 import org.eclipse.wst.jsdt.web.core.internal.JsCorePlugin;
@@ -46,17 +48,33 @@
 import org.osgi.framework.Bundle;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*(copied from JSP)
  * Responsible for keeping the JSP index up to date.
  * 
  * @author pavery
  */
 public class JsIndexManager {
+
 	// for debugging
 	// TODO move this to Logger, as we have in SSE
 	static final boolean DEBUG;
-	private static JsIndexManager fSingleton = null;
-	static long fTotalTime = 0;
+	static {
+		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsindexmanager"); //$NON-NLS-1$
+ 		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+	}
+
 	private static final String PKEY_INDEX_STATE = "jspIndexState"; //$NON-NLS-1$
+
+	private IndexWorkspaceJob indexingJob = new IndexWorkspaceJob();
+
+
+
 	// TODO: consider enumeration for these int constants
 	// set to S_UPDATING once a resource change comes in
 	// set to S_STABLE if:
@@ -64,130 +82,24 @@
 	// - or the ProcessFilesJob completes
 	// set to S_CANCELED if an indexing job is canceled
 	// set to S_REBUILDING if re-indexing the entire workspace
-	/**
-	 * indexing job was canceled in the middle of it, index needs to be rebuilt
-	 */
-	public static final int S_CANCELED = 4;
-	/** entire index is being rebuilt */
-	public static final int S_REBUILDING = 3;
+
 	// the int '0' is reserved for the default value if a preference is not
 	// there
 	/** index is reliable to use */
 	public static final int S_STABLE = 1;
 	/** index is being updated (from a resource delta) */
 	public static final int S_UPDATING = 2;
-	static {
-		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jspindexmanager"); //$NON-NLS-1$
-		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
-	}
-	
-	public synchronized static JsIndexManager getInstance() {
-		if (JsIndexManager.fSingleton == null) {
-			JsIndexManager.fSingleton = new JsIndexManager();
-		}
-		return JsIndexManager.fSingleton;
-	}
-	// end class JSPResourceVisitor
-	private class IndexJobCoordinator extends JobChangeAdapter {
-		
-		public void aboutToRun(IJobChangeEvent event) {
-			Job jobToCoordinate = event.getJob();
-			if (isJobToAvoid(jobToCoordinate)) {
-				// job will be rescheduled when the job we
-				// are avoiding (eg. build) is done
-				getProcessFilesJob().cancel();
-				// System.out.println("cancel:" + jobToCoordinate.getName());
-			}
-		}
-		
-		
-		public void done(IJobChangeEvent event) {
-			Job jobToCoordinate = event.getJob();
-			if (isJobToAvoid(jobToCoordinate)) {
-				if (getProcessFilesJob().getFiles().length > 0) {
-					getProcessFilesJob().schedule(500);
-					// System.out.println("schedule:" +
-					// jobToCoordinate.getName());
-				}
-			}
-		}
-		
-		private boolean isJobToAvoid(Job jobToCoordinate) {
-			boolean result = false;
-			if (jobToCoordinate.belongsTo(ResourcesPlugin.FAMILY_AUTO_BUILD) || jobToCoordinate.belongsTo(ResourcesPlugin.FAMILY_MANUAL_BUILD) || jobToCoordinate.belongsTo(ResourcesPlugin.FAMILY_AUTO_REFRESH)) {
-				result = true;
-			}
-			return result;
-		}
-	}
-	// end class ProcessFilesJob
-	private class JSPResourceChangeListener implements IResourceChangeListener {
-		/**
-		 * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
-		 */
-		public void resourceChanged(IResourceChangeEvent event) {
-			if (isInitializing()) {
-				return;
-			}
-			// ignore resource changes if already rebuilding
-			if (getIndexState() == JsIndexManager.S_REBUILDING) {
-				return;
-			}
-			// previously canceled, needs entire index rebuild
-			if (getIndexState() == JsIndexManager.S_CANCELED) {
-				// rebuildIndex();
-				// just resume indexing
-				getProcessFilesJob().schedule(500);
-				// System.out.println("schedule: resource changed, previously
-				// canceled");
-				return;
-			}
-			IResourceDelta delta = event.getDelta();
-			if (delta != null) {
-				// only care about adds or changes right now...
-				int kind = delta.getKind();
-				boolean added = (kind & IResourceDelta.ADDED) == IResourceDelta.ADDED;
-				boolean changed = (kind & IResourceDelta.CHANGED) == IResourceDelta.CHANGED;
-				if (added || changed) {
-					// only analyze the full (starting at root) delta
-					// hierarchy
-					if (delta.getFullPath().toString().equals("/")) { //$NON-NLS-1$
-						try {
-							JSPResourceVisitor v = getVisitor();
-							// clear from last run
-							v.reset();
-							// count files, possibly do this in a job too...
-							// don't include PHANTOM resources
-							delta.accept(v, false);
-							// process files from this delta
-							IFile[] files = v.getFiles();
-							if (files.length > 0) {
-								/*
-								 * Job change listener should set back to stable
-								 * when finished
-								 */
-								setUpdatingState();
-								// processFiles(files);
-								indexFiles(files);
-							}
-						} catch (CoreException e) {
-							// need to set state here somehow, and reindex
-							// otherwise index will be unreliable
-							if (JsIndexManager.DEBUG) {
-								Logger.logException(e);
-							}
-						} catch (Exception e) {
-							// need to set state here somehow, and reindex
-							// otherwise index will be unreliable
-							if (JsIndexManager.DEBUG) {
-								Logger.logException(e);
-							}
-						}
-					}
-				}
-			}
-		}
-	}
+	/** entire index is being rebuilt */
+	public static final int S_REBUILDING = 3;
+	/**
+	 * indexing job was canceled in the middle of it, index needs to be
+	 * rebuilt
+	 */
+	public static final int S_CANCELED = 4;
+
+	/** symbolic name for OSGI framework */
+	private final String OSGI_FRAMEWORK_ID = "org.eclipse.osgi"; //$NON-NLS-1$
+
 	/**
 	 * Collects JSP files from a resource delta.
 	 */
@@ -195,11 +107,87 @@
 		// using hash map ensures only one of each file
 		// must be reset before every use
 		private HashMap jspFiles = null;
-		
+
 		public JSPResourceVisitor() {
 			this.jspFiles = new HashMap();
 		}
-		
+
+		public boolean visit(IResourceDelta delta) throws CoreException {
+
+			// in case JSP search was canceled (eg. when closing the editor)
+			if (JsSearchSupport.getInstance().isCanceled() || frameworkIsShuttingDown()) {
+				setCanceledState();
+				return false;
+			}
+
+			try {
+				if (!isHiddenResource(delta.getFullPath())) {
+
+					int kind = delta.getKind();
+					boolean added = (kind & IResourceDelta.ADDED) == IResourceDelta.ADDED;
+					boolean isInterestingChange = false;
+					if ((kind & IResourceDelta.CHANGED) == IResourceDelta.CHANGED) {
+						int flags = delta.getFlags();
+						// ignore things like marker changes
+						isInterestingChange = ((flags & IResourceDelta.CONTENT) == IResourceDelta.CONTENT) || ((flags & IResourceDelta.REPLACED) == IResourceDelta.REPLACED);
+					}
+					boolean removed = (kind & IResourceDelta.REMOVED) == IResourceDelta.REMOVED;
+					if (added || isInterestingChange) {
+
+						visitAdded(delta);
+					}
+					else if (removed) {
+						visitRemoved(delta);
+					}
+				}
+			}
+			catch (Exception e) {
+				// need to set state here somehow, and reindex
+				// otherwise index will be unreliable
+				if (DEBUG) {
+					Logger.logException("Delta analysis may not be complete", e); //$NON-NLS-1$
+				}
+			}
+			// if the delta has children, continue to add/remove files
+			return true;
+		}
+
+		private void visitRemoved(IResourceDelta delta) {
+			// handle cleanup
+			if (delta.getResource() != null) {
+				IResource r = delta.getResource();
+				if ((r.getType() == IResource.FOLDER) && r.exists()) {
+					deleteIndex((IFile) r);
+				}
+			}
+		}
+
+		private void visitAdded(IResourceDelta delta) {
+			// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3553
+			// quick check if it's even JSP related to improve
+			// performance
+			// checking name from the delta before getting
+			// resource because it's lighter
+			String filename = delta.getFullPath().lastSegment();
+			if ((filename != null) && Util.isJsType(filename)) {
+				IResource r = delta.getResource();
+				if ((r != null) && r.exists() && (r.getType() == IResource.FILE)) {
+					this.jspFiles.put(r.getFullPath(), r);
+				}
+			}
+		}
+
+		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=93463
+		private boolean isHiddenResource(IPath p) {
+			String[] segments = p.segments();
+			for (int i = 0; i < segments.length; i++) {
+				if (segments[i].startsWith(".")) {
+					return true;
+				}
+			}
+			return false;
+		}
+
 		private void deleteIndex(IFile folder) {
 			// cleanup index
 			IndexManager im = JavaModelManager.getJavaModelManager().getIndexManager();
@@ -211,86 +199,18 @@
 			File f = indexLocation.toFile();
 			f.delete();
 		}
-		
+
 		public IFile[] getFiles() {
 			return (IFile[]) this.jspFiles.values().toArray(new IFile[this.jspFiles.size()]);
 		}
-		
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=93463
-		private boolean isHiddenResource(IPath p) {
-			String[] segments = p.segments();
-			for (int i = 0; i < segments.length; i++) {
-				if (segments[i].startsWith(".")) { //$NON-NLS-1$
-					return true;
-				}
-			}
-			return false;
-		}
-		
+
 		public void reset() {
 			this.jspFiles.clear();
 		}
-		
-		public boolean visit(IResourceDelta delta) throws CoreException {
-			// in case JSP search was canceled (eg. when closing the editor)
-			if (JsSearchSupport.getInstance().isCanceled() || frameworkIsShuttingDown()) {
-				setCanceledState();
-				return false;
-			}
-			try {
-				if (!isHiddenResource(delta.getFullPath())) {
-					int kind = delta.getKind();
-					boolean added = (kind & IResourceDelta.ADDED) == IResourceDelta.ADDED;
-					boolean isInterestingChange = false;
-					if ((kind & IResourceDelta.CHANGED) == IResourceDelta.CHANGED) {
-						int flags = delta.getFlags();
-						// ignore things like marker changes
-						isInterestingChange = (flags & IResourceDelta.CONTENT) == IResourceDelta.CONTENT || (flags & IResourceDelta.REPLACED) == IResourceDelta.REPLACED;
-					}
-					boolean removed = (kind & IResourceDelta.REMOVED) == IResourceDelta.REMOVED;
-					if (added || isInterestingChange) {
-						visitAdded(delta);
-					} else if (removed) {
-						visitRemoved(delta);
-					}
-				}
-			} catch (Exception e) {
-				// need to set state here somehow, and reindex
-				// otherwise index will be unreliable
-				if (JsIndexManager.DEBUG) {
-					Logger.logException("Delta analysis may not be complete", e); //$NON-NLS-1$
-				}
-			}
-			// if the delta has children, continue to add/remove files
-			return true;
-		}
-		
-		private void visitAdded(IResourceDelta delta) {
-			// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3553
-			// quick check if it's even JSP related to improve
-			// performance
-			// checking name from the delta before getting
-			// resource because it's lighter
-			int numSegments = delta.getFullPath().segmentCount();
-			String filename = delta.getFullPath().segment(numSegments - 1);
-			if (Util.isJsType(filename)) {
-				IResource r = delta.getResource();
-				if (r != null && r.exists() && r.getType() == IResource.FILE) {
-					this.jspFiles.put(r.getFullPath(), r);
-				}
-			}
-		}
-		
-		private void visitRemoved(IResourceDelta delta) {
-			// handle cleanup
-			if (delta.getResource() != null) {
-				IResource r = delta.getResource();
-				if (r.getType() == IResource.FOLDER && r.exists()) {
-					deleteIndex((IFile) r);
-				}
-			}
-		}
 	}
+
+	// end class JSPResourceVisitor
+
 	/**
 	 * schedules JSP files for indexing by Java core
 	 */
@@ -298,79 +218,74 @@
 		List fileList = null;
 		// keep track of how many files we've indexed
 		int lastFileCursor = 0;
-		
+
 		ProcessFilesJob(String taskName) {
 			super(taskName);
 			fileList = new ArrayList();
 		}
-		
-		synchronized void clearFiles() {
-			fileList.clear();
-			lastFileCursor = 0;
-			// System.out.println("cleared files");
-		}
-		
-		synchronized IFile[] getFiles() {
-			return (IFile[]) fileList.toArray(new IFile[fileList.size()]);
-		}
-		
-		private boolean isCanceled(IProgressMonitor runMonitor) {
-			boolean canceled = false;
-			// check specific monitor passed into run method (the progress
-			// group in this case)
-			// check main search support canceled
-			if (runMonitor != null && runMonitor.isCanceled()) {
-				canceled = true;
-			} else if (JsSearchSupport.getInstance().isCanceled()) {
-				canceled = true;
-				if (runMonitor != null) {
-					runMonitor.setCanceled(true);
-				}
-			}
-			return canceled;
-		}
-		
+
 		synchronized void process(IFile[] files) {
 			for (int i = 0; i < files.length; i++) {
 				fileList.add(files[i]);
 			}
-			if (JsIndexManager.DEBUG) {
+			if (DEBUG) {
 				System.out.println("JSPIndexManager queuing " + files.length + " files"); //$NON-NLS-2$ //$NON-NLS-1$
 			}
 		}
-		
-		
+
+		synchronized IFile[] getFiles() {
+			return (IFile[]) fileList.toArray(new IFile[fileList.size()]);
+		}
+
+		synchronized void clearFiles() {
+			fileList.clear();
+			lastFileCursor = 0;
+			//System.out.println("cleared files");
+		}
+
 		protected IStatus run(IProgressMonitor monitor) {
 			// System.out.println("indexer monitor" + monitor);
 			if (isCanceled(monitor) || frameworkIsShuttingDown()) {
 				setCanceledState();
 				return Status.CANCEL_STATUS;
 			}
+
 			long start = System.currentTimeMillis();
+
 			try {
 				IFile[] filesToBeProcessed = getFiles();
-				if (JsIndexManager.DEBUG) {
+
+				if (DEBUG) {
 					System.out.println("JSPIndexManager indexing " + filesToBeProcessed.length + " files"); //$NON-NLS-2$ //$NON-NLS-1$
 				}
 				// API indicates that monitor is never null
 				monitor.beginTask("", filesToBeProcessed.length); //$NON-NLS-1$
 				JsSearchSupport ss = JsSearchSupport.getInstance();
 				String processingNFiles = ""; //$NON-NLS-1$
-				for (; lastFileCursor < filesToBeProcessed.length; lastFileCursor++) {
+
+
+				for (;lastFileCursor < filesToBeProcessed.length; lastFileCursor++) {
+
 					if (isCanceled(monitor) || frameworkIsShuttingDown()) {
 						setCanceledState();
 						return Status.CANCEL_STATUS;
 					}
+					IFile file = filesToBeProcessed[lastFileCursor];
 					try {
-						ss.addJspFile(filesToBeProcessed[lastFileCursor]);
-						// JSP Indexer processing n files
-						processingNFiles = NLS.bind(JsCoreMessages.JSPIndexManager_2, new String[] { Integer.toString((filesToBeProcessed.length - lastFileCursor)) });
-						monitor.subTask(processingNFiles + " - " + filesToBeProcessed[lastFileCursor].getName()); //$NON-NLS-1$
-						monitor.worked(1);
-						if (JsIndexManager.DEBUG) {
-							System.out.println("JSPIndexManager Job added file: " + filesToBeProcessed[lastFileCursor].getName()); //$NON-NLS-1$
+						IJavaScriptProject project = JavaScriptCore.create(file.getProject());
+						if (project.exists()) {
+							ss.addJspFile(file);
+							// JSP Indexer processing n files
+							processingNFiles = NLS.bind(JsCoreMessages.JSPIndexManager_2, new String[]{Integer.toString((filesToBeProcessed.length - lastFileCursor))});
+							monitor.subTask(processingNFiles + " - " + file.getName()); //$NON-NLS-1$
+							monitor.worked(1);
+
+							if (DEBUG) {
+								System.out.println("JSPIndexManager Job added file: " + file.getName()); //$NON-NLS-1$
+							}
 						}
-					} catch (Exception e) {
+					}
+					catch (Exception e) {
 						// RATLC00284776
 						// ISSUE: we probably shouldn't be catching EVERY
 						// exception, but
@@ -385,150 +300,187 @@
 						// and only log a certain amt of the same one,
 						// otherwise skip it.
 						if (!frameworkIsShuttingDown()) {
-							String filename = filesToBeProcessed[lastFileCursor] != null ? filesToBeProcessed[lastFileCursor].getFullPath().toString() : ""; //$NON-NLS-1$
+							String filename = file != null ? file.getFullPath().toString() : ""; //$NON-NLS-1$
 							Logger.logException("JSPIndexer problem indexing:" + filename, e); //$NON-NLS-1$
 						}
 					}
 				} // end for
-			} finally {
+			}
+			finally {
 				// just in case something didn't follow API (monitor is null)
 				if (monitor != null) {
 					monitor.done();
 				}
 			}
+
 			// successfully finished, clear files list
 			clearFiles();
+			
 			long finish = System.currentTimeMillis();
 			long diff = finish - start;
-			if (JsIndexManager.DEBUG) {
-				JsIndexManager.fTotalTime += diff;
+			if (DEBUG) {
+				fTotalTime += diff;
 				System.out.println("============================================================================"); //$NON-NLS-1$
-				System.out.println("this time: " + diff + " cumulative time for resource changed: " + JsIndexManager.fTotalTime); //$NON-NLS-1$ //$NON-NLS-2$
+				System.out.println("this time: " + diff + " cumulative time for resource changed: " + fTotalTime); //$NON-NLS-1$ //$NON-NLS-2$
 				System.out.println("============================================================================"); //$NON-NLS-1$
 			}
 			return Status.OK_STATUS;
 		}
+
+		private boolean isCanceled(IProgressMonitor runMonitor) {
+
+			boolean canceled = false;
+			// check specific monitor passed into run method (the progress
+			// group in this case)
+			// check main search support canceled
+			if ((runMonitor != null) && runMonitor.isCanceled()) {
+				canceled = true;
+			} else if (JsSearchSupport.getInstance().isCanceled()) {
+				canceled = true;
+				if (runMonitor != null) {
+					runMonitor.setCanceled(true);
+				}
+			}
+			return canceled;
+		}
+		
 	}
-	private IContentType fContentTypeJSP = null;
-	private JSPResourceVisitor fVisitor = null;
-	private IndexWorkspaceJob indexingJob = new IndexWorkspaceJob();
-	private IndexJobCoordinator indexJobCoordinator;
+
+	// end class ProcessFilesJob
+
+	private static JsIndexManager fSingleton = null;
 	private boolean initialized;
 	private boolean initializing = true;
+
+	private IndexJobCoordinator indexJobCoordinator;
 	private IResourceChangeListener jspResourceChangeListener;
-	/** symbolic name for OSGI framework */
-	private final String OSGI_FRAMEWORK_ID = "org.eclipse.osgi"; //$NON-NLS-1$
+
+	private JSPResourceVisitor fVisitor = null;
+	static long fTotalTime = 0;
+
 	// Job for processing resource delta
 	private ProcessFilesJob processFilesJob = null;
-	
+
 	private JsIndexManager() {
 		processFilesJob = new ProcessFilesJob(JsCoreMessages.JSPIndexManager_0);
 		// only show in verbose mode
 		processFilesJob.setSystem(true);
 		processFilesJob.setPriority(Job.LONG);
 		processFilesJob.addJobChangeListener(new JobChangeAdapter() {
-			
 			public void done(IJobChangeEvent event) {
 				super.done(event);
 				setStableState();
 			}
 		});
 	}
-	
-	/**
-	 * A check to see if the OSGI framework is shutting down.
-	 * 
-	 * @return true if the System Bundle is stopped (ie. the framework is
-	 *         shutting down)
-	 */
-	boolean frameworkIsShuttingDown() {
-		// in the Framework class there's a note:
-		// set the state of the System Bundle to STOPPING.
-		// this must be done first according to section 4.19.2 from the OSGi
-		// R3 spec.
-		boolean shuttingDown = Platform.getBundle(OSGI_FRAMEWORK_ID).getState() == Bundle.STOPPING;
-		if (JsIndexManager.DEBUG && shuttingDown) {
-			System.out.println("JSPIndexManager: system is shutting down!"); //$NON-NLS-1$
-		}
-		return shuttingDown;
-	}
-	
-	IndexWorkspaceJob getIndexingJob() {
-		return indexingJob;
-	}
-	
-	int getIndexState() {
-		return JsCorePlugin.getDefault().getPluginPreferences().getInt(JsIndexManager.PKEY_INDEX_STATE);
-	}
-	
 
-	
-	ProcessFilesJob getProcessFilesJob() {
-		return processFilesJob;
-	}
-	
-	/**
-	 * Package protected for access by inner Job class in resourceChanged(...)
-	 * 
-	 * @return
-	 */
-	JSPResourceVisitor getVisitor() {
-		if (this.fVisitor == null) {
-			this.fVisitor = new JSPResourceVisitor();
+	public synchronized static JsIndexManager getInstance() {
+
+		if (fSingleton == null) {
+			fSingleton = new JsIndexManager();
 		}
-		return this.fVisitor;
+		return fSingleton;
 	}
-	
-	/**
-	 * Creates and schedules a Job to process collected files. All JSP indexing
-	 * should be done through this method or processFiles(IFile file)
-	 * 
-	 * @param files
-	 */
-	final void indexFiles(IFile[] files) {
-		// don't use this rule
-		// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4931
-		// processFiles.setRule(new IndexFileRule());
-		processFilesJob.process(files);
-	}
-	
+
 	public void initialize() {
-		JsIndexManager singleInstance = JsIndexManager.getInstance();
+
+		JsIndexManager singleInstance = getInstance();
+
+
 		if (!singleInstance.initialized) {
 			singleInstance.initialized = true;
+
 			singleInstance.indexJobCoordinator = new IndexJobCoordinator();
 			singleInstance.jspResourceChangeListener = new JSPResourceChangeListener();
+
 			// added as JobChange listener so JSPIndexManager can be smarter
 			// about when it runs
 			Platform.getJobManager().addJobChangeListener(singleInstance.indexJobCoordinator);
+
 			// add JSPIndexManager to keep JSP Index up to date
 			// listening for IResourceChangeEvent.PRE_DELETE and
 			// IResourceChangeEvent.POST_CHANGE
 			ResourcesPlugin.getWorkspace().addResourceChangeListener(jspResourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+
 			// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5091
 			// makes sure IndexManager is aware of our indexes
 			saveIndexes();
-			rebuildIndexIfNeeded();
+			//rebuildIndexIfNeeded();
 			singleInstance.initializing = false;
+
+		}
+
+	}
+	
+	synchronized void setIndexState(int state) {
+		if (DEBUG) {
+			System.out.println("JSPIndexManager setting index state to: " + state2String(state)); //$NON-NLS-1$
+		}
+		Plugin jspModelPlugin = JsCorePlugin.getDefault();
+		jspModelPlugin.getPluginPreferences().setValue(PKEY_INDEX_STATE, state);
+		jspModelPlugin.savePluginPreferences();
+
+	}
+
+	private String state2String(int state) {
+		String s = "UNKNOWN"; //$NON-NLS-1$
+		switch (state) {
+			case (S_STABLE) :
+				s = "S_STABLE"; //$NON-NLS-1$
+				break;
+			case (S_UPDATING) :
+				s = "S_UPDATING"; //$NON-NLS-1$
+				break;
+			case (S_CANCELED) :
+				s = "S_CANCELED"; //$NON-NLS-1$
+				break;
+			case (S_REBUILDING) :
+				s = "S_REBUILDING"; //$NON-NLS-1$
+				break;
+		}
+		return s;
+	}
+
+	int getIndexState() {
+		return JsCorePlugin.getDefault().getPluginPreferences().getInt(PKEY_INDEX_STATE);
+	}
+
+	void setUpdatingState() {
+		//if (getIndexState() != S_CANCELED)
+		setIndexState(S_UPDATING);
+	}
+
+	void setCanceledState() {
+		setIndexState(JsIndexManager.S_CANCELED);
+	}
+
+	void setStableState() {
+		//if (getIndexState() != S_CANCELED)
+		setIndexState(S_STABLE);
+	}
+
+	void setRebuildingState() {
+		setIndexState(S_REBUILDING);
+	}
+
+	synchronized void rebuildIndexIfNeeded() {
+		if (getIndexState() != S_STABLE) {
+			rebuildIndex();
 		}
 	}
-	
-	boolean isInitializing() {
-		return initializing;
-	}
-	
+
 	void rebuildIndex() {
-		if (JsIndexManager.DEBUG) {
+
+		if (DEBUG) {
 			System.out.println("*** JSP Index unstable, requesting re-indexing"); //$NON-NLS-1$
 		}
+
 		getIndexingJob().addJobChangeListener(new JobChangeAdapter() {
-			
 			public void aboutToRun(IJobChangeEvent event) {
 				super.aboutToRun(event);
 				setRebuildingState();
 			}
-			
-			
+
 			public void done(IJobChangeEvent event) {
 				super.done(event);
 				setStableState();
@@ -538,16 +490,35 @@
 		// we're about to reindex everything anyway
 		getProcessFilesJob().clearFiles();
 		getIndexingJob().schedule();
+
 	}
-	
-	synchronized void rebuildIndexIfNeeded() {
-		if (getIndexState() != JsIndexManager.S_STABLE) {
-			rebuildIndex();
+
+	/**
+	 * Creates and schedules a Job to process collected files. All JSP
+	 * indexing should be done through this method or processFiles(IFile file)
+	 * 
+	 * @param files
+	 */
+	final void indexFiles(IFile[] files) {
+		// don't use this rule
+		// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4931
+		// processFiles.setRule(new IndexFileRule());
+		processFilesJob.process(files);
+	}
+
+
+	/**
+	 * Package protected for access by inner Job class in resourceChanged(...)
+	 * 
+	 * @return
+	 */
+	JSPResourceVisitor getVisitor() {
+
+		if (this.fVisitor == null) {
+			this.fVisitor = new JSPResourceVisitor();
 		}
+		return this.fVisitor;
 	}
-	
-	// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5091
-	// makes sure IndexManager is aware of our indexes
 	void saveIndexes() {
 		IndexManager indexManager = JavaModelManager.getJavaModelManager().getIndexManager();
 		IProject[] allProjects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
@@ -579,42 +550,72 @@
 			}
 		}
 	}
-	
-	void setCanceledState() {
-		setIndexState(JsIndexManager.S_CANCELED);
-	}
-	
-	synchronized void setIndexState(int state) {
-		if (JsIndexManager.DEBUG) {
-			System.out.println("JSPIndexManager setting index state to: " + state2String(state)); //$NON-NLS-1$
+	// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5091
+	// makes sure IndexManager is aware of our indexes
+	void saveIndexesORIGINAL() {
+		IndexManager indexManager = JavaModelManager.getJavaModelManager().getIndexManager();
+		IPath jspModelWorkingLocation = JsSearchSupport.getInstance().getModelJspPluginWorkingLocation();
+
+		File folder = new File(jspModelWorkingLocation.toOSString());
+		String[] files = folder.list();
+		String locay = ""; //$NON-NLS-1$
+		Index index = null;
+		try {
+			for (int i = 0; i < files.length; i++) {
+				if (files[i].toLowerCase().endsWith(".index")) { //$NON-NLS-1$
+					locay = jspModelWorkingLocation.toString() + "/" + files[i]; //$NON-NLS-1$
+					// reuse index file
+					index = new Index(locay, "Index for " + locay, true); //$NON-NLS-1$
+					indexManager.saveIndex(index);
+				}
+			}
 		}
-		Plugin jspModelPlugin = JsCorePlugin.getDefault();
-		jspModelPlugin.getPluginPreferences().setValue(JsIndexManager.PKEY_INDEX_STATE, state);
-		jspModelPlugin.savePluginPreferences();
+		catch (Exception e) {
+			// we should be shutting down, want to shut down quietly
+			if (DEBUG) {
+				e.printStackTrace();
+			}
+		}
 	}
-	
-	void setRebuildingState() {
-		setIndexState(JsIndexManager.S_REBUILDING);
+
+//	IContentType getJspContentType() {
+//		if (this.fContentTypeJSP == null)
+//			this.fContentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
+//		return this.fContentTypeJSP;
+//	}
+
+	/**
+	 * A check to see if the OSGI framework is shutting down.
+	 * 
+	 * @return true if the System Bundle is stopped (ie. the framework is
+	 *         shutting down)
+	 */
+	boolean frameworkIsShuttingDown() {
+		// in the Framework class there's a note:
+		// set the state of the System Bundle to STOPPING.
+		// this must be done first according to section 4.19.2 from the OSGi
+		// R3 spec.
+		boolean shuttingDown = Platform.getBundle(OSGI_FRAMEWORK_ID).getState() == Bundle.STOPPING;
+		if (DEBUG && shuttingDown) {
+			System.out.println("JSPIndexManager: system is shutting down!"); //$NON-NLS-1$
+		}
+		return shuttingDown;
 	}
-	
-	void setStableState() {
-		// if (getIndexState() != S_CANCELED)
-		setIndexState(JsIndexManager.S_STABLE);
-	}
-	
-	void setUpdatingState() {
-		// if (getIndexState() != S_CANCELED)
-		setIndexState(JsIndexManager.S_UPDATING);
-	}
-	
+
+
 	public void shutdown() {
+
 		// stop listening
 		ResourcesPlugin.getWorkspace().removeResourceChangeListener(jspResourceChangeListener);
-		// saveIndexes();
+
+
 		// stop any searching
 		JsSearchSupport.getInstance().setCanceled(true);
+
 		// stop listening to jobs
 		Platform.getJobManager().removeJobChangeListener(indexJobCoordinator);
+
+
 		int maxwait = 5000;
 		if (processFilesJob != null) {
 			processFilesJob.cancel();
@@ -622,43 +623,153 @@
 		// attempt to make sure this indexing job is litterally
 		// done before continuing, since we are shutting down
 		waitTillNotRunning(maxwait, processFilesJob);
+
 		if (indexingJob != null) {
 			indexingJob.cancel();
 		}
 		waitTillNotRunning(maxwait, processFilesJob);
 	}
-	
-	private String state2String(int state) {
-		String s = "UNKNOWN"; //$NON-NLS-1$
-		switch (state) {
-			case (JsIndexManager.S_STABLE):
-				s = "S_STABLE"; //$NON-NLS-1$
-			break;
-			case (JsIndexManager.S_UPDATING):
-				s = "S_UPDATING"; //$NON-NLS-1$
-			break;
-			case (JsIndexManager.S_CANCELED):
-				s = "S_CANCELED"; //$NON-NLS-1$
-			break;
-			case (JsIndexManager.S_REBUILDING):
-				s = "S_REBUILDING"; //$NON-NLS-1$
-			break;
-		}
-		return s;
-	}
-	
+
 	private void waitTillNotRunning(int maxSeconds, Job job) {
 		int pauseTime = 10;
 		int maxtries = maxSeconds / pauseTime;
 		int count = 0;
-		while (count++ < maxtries && job.getState() == Job.RUNNING) {
+		while ((count++ < maxtries) && (job.getState() == Job.RUNNING)) {
 			try {
 				Thread.sleep(pauseTime);
 				// System.out.println("count: " + count + " max: " +
 				// maxtries);
-			} catch (InterruptedException e) {
+			}
+			catch (InterruptedException e) {
 				Logger.logException(e);
 			}
 		}
 	}
-}
\ No newline at end of file
+
+	private class IndexJobCoordinator extends JobChangeAdapter {
+		
+		public void aboutToRun(IJobChangeEvent event) {
+			Job jobToCoordinate = event.getJob();
+			if (isJobToAvoid(jobToCoordinate)) {
+				// job will be rescheduled when the job we
+				// are avoiding (eg. build) is done
+				getProcessFilesJob().cancel();
+				//System.out.println("cancel:" + jobToCoordinate.getName());
+			}
+		}
+
+		public void done(IJobChangeEvent event) {
+
+			Job jobToCoordinate = event.getJob();
+			if (isJobToAvoid(jobToCoordinate)) {
+				if (getProcessFilesJob().getFiles().length > 0) {
+					getProcessFilesJob().schedule(500);
+					//System.out.println("schedule:" + jobToCoordinate.getName());
+				}
+					
+
+			}
+		}
+
+		private boolean isJobToAvoid(Job jobToCoordinate) {
+			boolean result = false;
+			if (jobToCoordinate.belongsTo(ResourcesPlugin.FAMILY_AUTO_BUILD) || jobToCoordinate.belongsTo(ResourcesPlugin.FAMILY_MANUAL_BUILD) || jobToCoordinate.belongsTo(ResourcesPlugin.FAMILY_AUTO_REFRESH)) {
+				result = true;
+			}
+			return result;
+
+		}
+
+	}
+
+	private class JSPResourceChangeListener implements IResourceChangeListener {
+
+
+		/**
+		 * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
+		 */
+		public void resourceChanged(IResourceChangeEvent event) {
+
+			if (isInitializing()) {
+				return;
+			}
+
+			// ignore resource changes if already rebuilding
+			if (getIndexState() == S_REBUILDING) {
+				return;
+			}
+			// previously canceled, needs entire index rebuild
+			if (getIndexState() == S_CANCELED) {
+				// rebuildIndex();
+				// just resume indexing
+				getProcessFilesJob().schedule(500);
+				//System.out.println("schedule: resource changed, previously canceled");
+				return;
+			}
+
+			IResourceDelta delta = event.getDelta();
+			if (delta != null) {
+				// only care about adds or changes right now...
+				int kind = delta.getKind();
+				boolean added = (kind & IResourceDelta.ADDED) == IResourceDelta.ADDED;
+				boolean changed = (kind & IResourceDelta.CHANGED) == IResourceDelta.CHANGED;
+				if (added || changed) {
+
+					// only analyze the full (starting at root) delta
+					// hierarchy
+					if (delta.getFullPath().toString().equals("/")) { //$NON-NLS-1$
+						try {
+							JSPResourceVisitor v = getVisitor();
+							// clear from last run
+							v.reset();
+							// count files, possibly do this in a job too...
+							// don't include PHANTOM resources
+							delta.accept(v, false);
+
+							// process files from this delta
+							IFile[] files = v.getFiles();
+							if (files.length > 0) {
+								/*
+								 * Job change listener should set back to
+								 * stable when finished
+								 */
+								setUpdatingState();
+								// processFiles(files);
+								indexFiles(files);
+							}
+						}
+						catch (CoreException e) {
+							// need to set state here somehow, and reindex
+							// otherwise index will be unreliable
+							if (DEBUG) {
+								Logger.logException(e);
+							}
+						}
+						catch (Exception e) {
+							// need to set state here somehow, and reindex
+							// otherwise index will be unreliable
+							if (DEBUG) {
+								Logger.logException(e);
+							}
+						}
+					}
+				}
+
+			}
+		}
+
+	}
+
+	IndexWorkspaceJob getIndexingJob() {
+		return indexingJob;
+	}
+
+	ProcessFilesJob getProcessFilesJob() {
+		return processFilesJob;
+	}
+
+	boolean isInitializing() {
+		return initializing;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsPathIndexer.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsPathIndexer.java
index 664df65..b1ebaad 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsPathIndexer.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsPathIndexer.java
@@ -1,14 +1,15 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
 package org.eclipse.wst.jsdt.web.core.javascript.search;
+
 import java.util.HashMap;
 
 import org.eclipse.core.resources.IFile;
@@ -19,62 +20,75 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.wst.jsdt.core.search.IJavaSearchScope;
+import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
 import org.eclipse.wst.jsdt.core.search.SearchPattern;
 import org.eclipse.wst.jsdt.web.core.internal.validation.Util;
 
 /**
- * pa_TODO Still need to take into consideration: - focus in workspace - search
- * pattern
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*(copied from JSP)
+ * pa_TODO Still need to take into consideration:
+ * 	- focus in workspace
+ *  - search pattern
  * 
  * @author pavery
  */
 public class JsPathIndexer {
+
 	// for debugging
 	static final boolean DEBUG;
 	static {
-		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jspsearch"); //$NON-NLS-1$
-		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+		
+		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jssearch"); //$NON-NLS-1$
+ 		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+
 	}
-	// visitor that retrieves jsp project paths for all jsp files in the
-	// workspace
+	
+	// visitor that retrieves jsp project paths for all jsp files in the workspace
 	class JSPFileVisitor implements IResourceProxyVisitor {
 		// hash map forces only one of each file
 		private HashMap fPaths = new HashMap();
+		IJavaScriptSearchScope fScope = null;
 		SearchPattern fPattern = null;
-		IJavaSearchScope fScope = null;
-		
-		public JSPFileVisitor(SearchPattern pattern, IJavaSearchScope scope) {
+
+		public JSPFileVisitor(SearchPattern pattern, IJavaScriptSearchScope scope) {
 			this.fPattern = pattern;
 			this.fScope = scope;
 		}
-		
-		public IPath[] getPaths() {
-			return (IPath[]) fPaths.values().toArray(new IPath[fPaths.size()]);
-		}
-		
+
 		public boolean visit(IResourceProxy proxy) throws CoreException {
-			if (JsSearchSupport.getInstance().isCanceled()) {
+			
+			if(JsSearchSupport.getInstance().isCanceled()) {
 				return false;
 			}
+			
 			if (proxy.getType() == IResource.FILE) {
-				//IContentType contentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeIdHtml);
+
+				//IContentType contentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
 				// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3553
 				// check this before description
 				// check name before actually getting the file (less work)
-				if (Util.isJsType(proxy.getName())) {
-					IFile file = (IFile) proxy.requestResource();
-					IContentDescription contentDescription = file.getContentDescription();
-					String ctId = null;
-					if (contentDescription != null) {
-						ctId = contentDescription.getContentType().getId();
-					}
-					//if (ContentTypeIdForJSP.ContentTypeIdHtml.equals(ctId)) {
+				//if(contentTypeJSP.isAssociatedWith(proxy.getName())) {
+				if(Util.isJsType(proxy.getName())){	
+					IFile file = (IFile)proxy.requestResource();
+					//IContentDescription contentDescription = file.getContentDescription();
+					//String ctId = null;
+//					if (contentDescription != null) {
+//						ctId = contentDescription.getContentType().getId();
+//					}
+					//if (ContentTypeIdForJSP.ContentTypeID_JSP.equals(ctId)) {
+					//if(Util.isJsType(file.getName())){
 						if (this.fScope.encloses(proxy.requestFullPath().toString())) {
-							if (JsPathIndexer.DEBUG) {
+	
+							if (DEBUG) {
 								System.out.println("adding selected index path:" + file.getParent().getFullPath()); //$NON-NLS-1$
 							}
+
 							fPaths.put(file.getParent().getFullPath(), JsSearchSupport.getInstance().computeIndexLocation(file.getParent().getFullPath()));
 						}
 					//}
@@ -84,15 +98,22 @@
 			}
 			return true;
 		}
+
+		public IPath[] getPaths() {
+			return (IPath[]) fPaths.values().toArray(new IPath[fPaths.size()]);
+		}
 	}
-	
-	public IPath[] getVisibleJspPaths(SearchPattern pattern, IJavaSearchScope scope) {
+
+	public IPath[] getVisibleJspPaths(SearchPattern pattern, IJavaScriptSearchScope scope) {
+
 		JSPFileVisitor jspFileVisitor = new JSPFileVisitor(pattern, scope);
 		try {
 			ResourcesPlugin.getWorkspace().getRoot().accept(jspFileVisitor, 0);
-		} catch (CoreException e) {
+		}
+		catch (CoreException e) {
 			e.printStackTrace();
 		}
 		return jspFileVisitor.getPaths();
 	}
 }
+
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchDocument.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchDocument.java
index a44f810..ce87bb1 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchDocument.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchDocument.java
@@ -1,10 +1,10 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
@@ -13,14 +13,15 @@
 import java.io.IOException;
 
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.IWorkspaceRoot;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.wst.jsdt.core.search.SearchParticipant;
 import org.eclipse.wst.jsdt.web.core.internal.Logger;
-
 import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
 import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
 import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapterFactory;
@@ -32,22 +33,29 @@
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*(copied from JSP)
  * Created with a .jsp file, but should appear to be a .java file for indexing
  * and searching purposes. There are purposely few fields in this class, and
  * those fields are lightweight since it's possible for many JSP search
- * documents to exist in memory at one time (eg. after importing a project with
- * a large number of JSP files)
+ * documents to exist in memory at one time (eg. after importing a project
+ * with a large number of JSP files)
  * 
  * @author pavery
  */
 public class JsSearchDocument {
+
 	private String UNKNOWN_PATH = "**path unknown**"; //$NON-NLS-1$
-	private char[] fCachedCharContents;
-	private String fCUPath = UNKNOWN_PATH;
 	private String fJSPPathString = UNKNOWN_PATH;
-	private long fLastModifiedStamp;
+	private String fCUPath = UNKNOWN_PATH;
 	private SearchParticipant fParticipant = null;
-	
+	private long fLastModifiedStamp;
+	private char[] fCachedCharContents;
 	
 	/**
 	 * @param file
@@ -55,42 +63,146 @@
 	 * @throws CoreException
 	 */
 	public JsSearchDocument(String filePath, SearchParticipant participant) {
+
 		this.fJSPPathString = filePath;
 		this.fParticipant = participant;
 	}
-	
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.jsdt.core.search.SearchDocument#getByteContents()
-	 */
-	public byte[] getByteContents() {
-		// TODO Auto-generated method stub
-		return null;
+
+	public SearchParticipant getParticipant() {
+		return this.fParticipant;
 	}
-	
+
 	/**
-	 * @see org.eclipse.wst.jsdt.core.search.SearchDocument#getCharContents()
+	 * @see org.eclipse.jdt.core.search.SearchDocument#getCharContents()
 	 */
 	public char[] getCharContents() {
-		if (fCachedCharContents == null || isDirty()) {
-			IJsTranslation trans = getJSPTranslation();
-			fCachedCharContents = trans != null ? trans.getJsText().toCharArray() : new char[0];
-			fCUPath = trans.getJavaPath();
+		
+		if((fCachedCharContents == null) || isDirty()) {
+		    IJsTranslation trans = getJSTranslation();    
+		    fCachedCharContents = trans != null ? trans.getJsText().toCharArray() : new char[0];
+		    fCUPath = trans.getJavaPath();
 		}
 		return fCachedCharContents;
 	}
-	
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.jsdt.core.search.SearchDocument#getEncoding()
-	 */
-	public String getEncoding() {
-		// TODO Auto-generated method stub
-		return null;
+
+	public String getJavaText() {
+		return new String(getCharContents());
 	}
-	
+
+	private IModelManager getModelManager() {
+		return StructuredModelManager.getModelManager();
+	}
+
+	/**
+	 * It's not recommended for clients to hold on to this JSPTranslation
+	 * since it's kind of large. If possible, hold on to the
+	 * JSPSearchDocument, which is more of a lightweight proxy.
+	 * 
+	 * @return the JSPTranslation for the jsp file, or null if it's an
+	 *         unsupported file.
+	 */
+	public final IJsTranslation getJSTranslation() {
+		IJsTranslation translation = null;
+		IFile jspFile = getFile();
+		if (!JsSearchSupport.isJsp(jspFile)) {
+			return translation;
+		}
+
+		IStructuredModel model = null;
+		try {
+			// get existing model for read, then get document from it
+			IModelManager modelManager = getModelManager();
+			if (modelManager != null) {
+				jspFile.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
+				model = modelManager.getModelForRead(jspFile);
+			}
+			// handle unsupported
+			if (model instanceof IDOMModel) {
+				IDOMModel xmlModel = (IDOMModel)model;
+				setupAdapterFactory(xmlModel);
+				IDOMDocument doc = xmlModel.getDocument();
+				JsTranslationAdapter adapter = (JsTranslationAdapter) doc.getAdapterFor(IJsTranslation.class);
+				translation = adapter.getJsTranslation(false);
+			}
+		}
+		catch (IOException e) {
+			Logger.logException(e);
+		}
+		catch (CoreException e) {
+			Logger.logException(e);
+		}
+		catch (UnsupportedCharsetExceptionWithDetail e) {
+			// no need to log this. Just consider it an invalid file for our
+			// purposes.
+			// Logger.logException(e);
+		}
+		finally {
+			if (model != null) {
+				model.releaseFromRead();
+			}
+		}
+		return translation;
+	}
+
+	/**
+	 * add the factory for JSPTranslationAdapter here
+	 * 
+	 * @param sm
+	 */
+	private void setupAdapterFactory(IStructuredModel sm) {
+		JsTranslationAdapterFactory.setupAdapterFactory(sm);
+	}
+
+	/**
+	 * the path to the Java compilation unit
+	 * 
+	 * @see org.eclipse.jdt.core.search.SearchDocument#getPath()
+	 */
+	public String getPath() {
+	    // caching the path since it's expensive to get translation
+		// important that isDirty() check is second to cache modification stamp
+	    if((this.fCUPath == null) || isDirty() || (this.fCUPath == UNKNOWN_PATH)) {
+	        IJsTranslation trans = getJSTranslation();
+	        if(trans != null) {
+	            this.fCUPath = trans.getJavaPath();
+	            // save since it's expensive to calculate again later
+	            fCachedCharContents = trans.getJsText().toCharArray();
+	        }
+	    }
+		return fCUPath != null ? fCUPath : UNKNOWN_PATH;
+	}
+
+//	public int getJspOffset(int javaOffset) {
+//		// copied from JSPTranslation
+//		int result = -1;
+//		int offsetInRange = 0;
+//		Position jspPos, javaPos = null;
+//		IJsTranslation trans = getJSPTranslation();
+//		if (trans != null) {
+//			HashMap java2jspMap = trans.getJava2JspMap();
+//
+//			// iterate all mapped java ranges
+//			Iterator it = java2jspMap.keySet().iterator();
+//			while (it.hasNext()) {
+//				javaPos = (Position) it.next();
+//				// need to count the last position as included
+//				if (!javaPos.includes(javaOffset) && !(javaPos.offset + javaPos.length == javaOffset))
+//					continue;
+//
+//				offsetInRange = javaOffset - javaPos.offset;
+//				jspPos = (Position) java2jspMap.get(javaPos);
+//
+//				if (jspPos != null)
+//					result = jspPos.offset + offsetInRange;
+//				else {
+//					Logger.log(Logger.ERROR, "jspPosition was null!" + javaOffset); //$NON-NLS-1$
+//				}
+//				break;
+//			}
+//		}
+//		return result;
+//	}
+
 	public IFile getFile() {
 		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
 		IPath jspPath = new Path(this.fJSPPathString);
@@ -101,93 +213,14 @@
 		}
 		return jspFile;
 	}
-	
-	public String getJavaText() {
-		return new String(getCharContents());
-	}
-	
-	/**
-	 * It's not recommended for clients to hold on to this JSPTranslation since
-	 * it's kind of large. If possible, hold on to the JSPSearchDocument, which
-	 * is more of a lightweight proxy.
-	 * 
-	 * @return the JSPTranslation for the jsp file, or null if it's an
-	 *         unsupported file.
-	 */
-	public final IJsTranslation getJSPTranslation() {
-		IJsTranslation translation = null;
-		IFile jspFile = getFile();
-		if (!JsSearchSupport.isJsp(jspFile)) {
-			return translation;
-		}
-		IStructuredModel model = null;
-		try {
-			// get existing model for read, then get document from it
-			IModelManager modelManager = StructuredModelManager.getModelManager();
-			if (modelManager != null) {
-				model = modelManager.getExistingModelForRead(jspFile);
-				if(model==null)
-					model = modelManager.getModelForRead(jspFile);
-			}
-			// handle unsupported
-			if (model instanceof IDOMModel) {
-				IDOMModel xmlModel = (IDOMModel) model;
-				JsTranslationAdapterFactory factory = new JsTranslationAdapterFactory();
-				xmlModel.getFactoryRegistry().addFactory(factory);
-				IDOMDocument doc = xmlModel.getDocument();
-				JsTranslationAdapter adapter = (JsTranslationAdapter) doc.getAdapterFor(IJsTranslation.class);
-				translation = adapter.getJSPTranslation(false);
-			}
-		} catch (IOException e) {
-			Logger.logException(e);
-		} catch (CoreException e) {
-			Logger.logException(e);
-		} catch (UnsupportedCharsetExceptionWithDetail e) {
-			// no need to log this. Just consider it an invalid file for our
-			// purposes.
-			// Logger.logException(e);
-		} finally {
-			if (model != null) {
-				model.releaseFromRead();
-			}
-		}
-		return translation;
-	}
-	
-	public SearchParticipant getParticipant() {
-		return this.fParticipant;
-	}
-	
-	/**
-	 * the path to the Java compilation unit
-	 * 
-	 * @see org.eclipse.wst.jsdt.core.search.SearchDocument#getPath()
-	 */
-	public String getPath() {
-		// caching the path since it's expensive to get translation
-		// important that isDirty() check is second to cache modification stamp
-		if (this.fCUPath == null || isDirty() || this.fCUPath == UNKNOWN_PATH) {
-			IJsTranslation trans = getJSPTranslation();
-			if (trans != null) {
-				try {
-					this.fCUPath = trans.getJavaPath();
-				} catch (RuntimeException ex) {
-					// TODO Auto-generated catch block
-					ex.printStackTrace();
-				}
-				// save since it's expensive to calculate again later
-				fCachedCharContents = trans.getJsText().toCharArray();
-			}
-		}
-		return fCUPath != null ? fCUPath : UNKNOWN_PATH;
-	}
+
 	
 	private boolean isDirty() {
 		boolean modified = false;
 		IFile f = getFile();
-		if (f != null) {
+		if(f != null) {
 			long currentStamp = f.getModificationStamp();
-			if (currentStamp != fLastModifiedStamp) {
+			if(currentStamp != fLastModifiedStamp) {
 				modified = true;
 			}
 			fLastModifiedStamp = currentStamp;
@@ -196,14 +229,33 @@
 	}
 	
 	public void release() {
-	// nothing to do now since JSPTranslation is created on the fly
+		// nothing to do now since JSPTranslation is created on the fly
 	}
-	
+
 	/**
 	 * for debugging
 	 */
-	
 	public String toString() {
 		return "[JSPSearchDocument:" + this.fJSPPathString + "]"; //$NON-NLS-1$ //$NON-NLS-2$ 
 	}
-}
\ No newline at end of file
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jdt.core.search.SearchDocument#getEncoding()
+	 */
+	public String getEncoding() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jdt.core.search.SearchDocument#getByteContents()
+	 */
+	public byte[] getByteContents() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchParticipant.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchParticipant.java
index 8421a64..88ac3a1 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchParticipant.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchParticipant.java
@@ -1,10 +1,10 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
@@ -18,7 +18,7 @@
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.jsdt.core.search.IJavaSearchScope;
+import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
 import org.eclipse.wst.jsdt.core.search.SearchDocument;
 import org.eclipse.wst.jsdt.core.search.SearchEngine;
 import org.eclipse.wst.jsdt.core.search.SearchParticipant;
@@ -26,85 +26,92 @@
 import org.eclipse.wst.jsdt.core.search.SearchRequestor;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*(copied from JSP)
  * Integration of JSP w/ java search.
  * 
  * @author pavery
  */
 public class JsSearchParticipant extends SearchParticipant {
+
 	// for debugging
-	private static final boolean DEBUG = JsSearchParticipant.calculateValue();
-	
+	private static final boolean DEBUG = calculateValue();
+
 	private static boolean calculateValue() {
-		String value = Platform.getDebugOption("org.eclipse.jstd.jsp.core/debug/jspsearch"); //$NON-NLS-1$
-		boolean debug = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+		String value = Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspsearch"); //$NON-NLS-1$
+		boolean debug = (value != null) && value.equalsIgnoreCase("true"); //$NON-NLS-1$
 		return debug;
 	}
-	
-	
-	public String getDescription() {
-		return "Embeded JavaScript"; //$NON-NLS-1$
-	}
-	
-	/**
-	 * @see org.eclipse.wst.jsdt.core.search.SearchParticipant#getDocument(org.eclipse.core.resources.IFile)
-	 */
-	public SearchDocument getDocument(IFile file) {
-		// never gets called?
-		return null;
-	}
-	
+
 	/**
 	 * Important to never return null here or else Java search participation
 	 * will break.
 	 */
-	
 	public SearchDocument getDocument(String documentPath) {
 		SearchDocument sDoc = JsSearchSupport.getInstance().getSearchDocument(documentPath);
+
 		if (sDoc == null) {
 			// return a dummy doc here so search participation doesn't break
 			return new NullSearchDocument(documentPath);
 		}
 		return sDoc;
 	}
-	
-	
+
+	public String getDescription() {
+		return "Embeded JavaScript"; //$NON-NLS-1$
+	}
+
+	public IPath[] selectIndexes(SearchPattern pattern, IJavaScriptSearchScope scope) {
+		JsPathIndexer indexer = new JsPathIndexer();
+		return indexer.getVisibleJspPaths(pattern, scope);
+	}
+
 	public void indexDocument(SearchDocument document, IPath indexPath) {
 		if (!(document instanceof JSDTSearchDocumentDelegate)) {
 			return;
 		}
+
 		// use Java search indexing
 		SearchEngine.getDefaultSearchParticipant().indexDocument(document, indexPath);
 	}
-	
-	
-	public void locateMatches(SearchDocument[] indexMatches, SearchPattern pattern, IJavaSearchScope scope, SearchRequestor requestor, IProgressMonitor monitor)
-			throws CoreException {
-		if (monitor != null && monitor.isCanceled()) {
+
+	public void locateMatches(SearchDocument[] indexMatches, SearchPattern pattern, IJavaScriptSearchScope scope, SearchRequestor requestor, IProgressMonitor monitor) throws CoreException {
+
+		if ((monitor != null) && monitor.isCanceled()) {
 			return;
 		}
+
 		// filter out null matches
 		List filtered = new ArrayList();
 		SearchDocument match = null;
 		for (int i = 0; i < indexMatches.length; i++) {
-			if (JsSearchParticipant.DEBUG) {
+			if (DEBUG) {
 				System.out.println("found possible matching JavaSearchDocumentDelegate: " + indexMatches[i]); //$NON-NLS-1$
 			}
 			match = indexMatches[i];
 			if (match != null) {
 				// some matches may be null, or if the index is out of date,
 				// the file may not even exist
-				if (match instanceof JSDTSearchDocumentDelegate && ((JSDTSearchDocumentDelegate) match).getFile().exists()) {
+				if ((match instanceof JSDTSearchDocumentDelegate) && ((JSDTSearchDocumentDelegate) match).getFile().exists()) {
 					filtered.add(match);
 				}
 			}
 		}
+
 		indexMatches = (SearchDocument[]) filtered.toArray(new SearchDocument[filtered.size()]);
 		SearchEngine.getDefaultSearchParticipant().locateMatches(indexMatches, pattern, scope, requestor, monitor);
 	}
-	
-	
-	public IPath[] selectIndexes(SearchPattern pattern, IJavaSearchScope scope) {
-		JsPathIndexer indexer = new JsPathIndexer();
-		return indexer.getVisibleJspPaths(pattern, scope);
+
+	/**
+	 * @see org.eclipse.jdt.core.search.SearchParticipant#getDocument(org.eclipse.core.resources.IFile)
+	 */
+	public SearchDocument getDocument(IFile file) {
+		// never gets called?
+		return null;
 	}
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchScope.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchScope.java
index a3bfd01..815e7f7 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchScope.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchScope.java
@@ -1,10 +1,10 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
@@ -16,71 +16,89 @@
 
 import org.eclipse.core.resources.IResourceProxy;
 import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.jsdt.core.IJavaElement;
-import org.eclipse.wst.jsdt.core.search.IJavaSearchScope;
-
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*(copied from JSP)
  * Used to constrain JSP/java search to certain paths and elements.
- * 
  * @author pavery
  */
-public class JsSearchScope implements IJavaSearchScope {
+public class JsSearchScope implements IJavaScriptSearchScope {
+
 	private boolean fEnclosesAll = false;
-	private List fJavaElements = null;
 	private List fResourcePaths = null;
-	
+	private List fJavaElements = null;
+
 	public JsSearchScope() {
 		// empty constructor just returns true for everything
 		// everything is in scope
 		this.fEnclosesAll = true;
 		init();
 	}
-	
-	public JsSearchScope(IJavaElement[] javaElement) {
-		init();
-		fJavaElements.addAll(Arrays.asList(javaElement));
-	}
-	
+
 	public JsSearchScope(String[] resourceStringPath) {
 		init();
 		fResourcePaths.addAll(Arrays.asList(resourceStringPath));
 	}
-	
-	public void addElement(IJavaElement element) {
-		this.fJavaElements.add(element);
+
+	public JsSearchScope(IJavaScriptElement[] javaElement) {
+		init();
+		fJavaElements.addAll(Arrays.asList(javaElement));
 	}
-	
-	public void addPath(String path) {
-		this.fResourcePaths.add(path);
+
+	private void init() {
+		this.fResourcePaths = new ArrayList();
+		this.fJavaElements = new ArrayList();
 	}
-	
-	public boolean encloses(IJavaElement element) {
-		// pa_TOD implement
-		if (this.fEnclosesAll) {
-			return true;
-		}
-		return true;
-	}
-	
-	public boolean encloses(IResourceProxy element) {
-		if (this.fEnclosesAll) {
-			return true;
-		} else if (enclosesPath(element.requestFullPath().toOSString())) {
-			return true;
-		}
-		return true;
-	}
-	
+
 	public boolean encloses(String resourcePathString) {
+
 		if (this.fEnclosesAll) {
 			return true;
 		} else if (enclosesPath(resourcePathString)) {
 			return true;
 		}
+
 		return false;
 	}
-	
+
+	public boolean encloses(IJavaScriptElement element) {
+
+		// pa_TOD implement
+		if (this.fEnclosesAll) {
+			return true;
+		}
+
+		return true;
+	}
+
+	public boolean encloses(IResourceProxy element) {
+
+		if (this.fEnclosesAll) {
+			return true;
+		} else if (enclosesPath(element.requestFullPath().toOSString())) {
+			return true;
+		}
+
+		return true;
+	}
+
+	public void addPath(String path) {
+		this.fResourcePaths.add(path);
+	}
+
+	public void addElement(IJavaScriptElement element) {
+		this.fJavaElements.add(element);
+	}
+
 	private boolean enclosesPath(String possible) {
+
 		String[] paths = (String[]) fResourcePaths.toArray(new String[fResourcePaths.size()]);
 		for (int i = 0; i < paths.length; i++) {
 			if (possible.equals(paths[i])) {
@@ -89,46 +107,18 @@
 		}
 		return false;
 	}
-	
-	public IPath[] enclosingProjectsAndJars() {
-		// pa_TODO
-		return null;
-	}
-	
+
 	public String getDescription() {
-		return "JSPSearchScope"; //$NON-NLS-1$
-	}
-	
-	public boolean includesBinaries() {
-		/* TEMP CHANGE BC may 30 */
-		return false;
-	}
-	
-	public boolean includesClasspaths() {
-		/* TEMP CHANGE BC may 30 */
-		return false;
-	}
-	
-	private void init() {
-		this.fResourcePaths = new ArrayList();
-		this.fJavaElements = new ArrayList();
-	}
-	
-	public void setIncludesBinaries(boolean includesBinaries) {
-	// do nothing
-	}
-	
-	public void setIncludesClasspaths(boolean includesClasspaths) {
-	// do nothing
+
+		return "JavaScript Search Scope"; //$NON-NLS-1$
 	}
 
-	/* (non-Javadoc)
-	 * @see org.eclipse.wst.jsdt.core.search.IJavaSearchScope#shouldExclude(java.lang.String, java.lang.String)
-	 */
+	public IPath[] enclosingProjectsAndJars() {
+		return (IPath[]) fResourcePaths.toArray(new IPath[fResourcePaths.size()]);
+	}
+
 	public boolean shouldExclude(String container, String resourceName) {
-		// TODO Auto-generated method stub
-		//System.out.println("Unimplemented method:JsSearchScope.shouldExclude"); //$NON-NLS-1$
+		/* auto gen */
 		return false;
 	}
-
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchSupport.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchSupport.java
index a81a197..80f03f0 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchSupport.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchSupport.java
@@ -1,10 +1,10 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
@@ -15,8 +15,6 @@
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
 import org.eclipse.core.resources.IWorkspaceRunnable;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
@@ -28,9 +26,9 @@
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.jsdt.core.IJavaElement;
-import org.eclipse.wst.jsdt.core.search.IJavaSearchConstants;
-import org.eclipse.wst.jsdt.core.search.IJavaSearchScope;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchConstants;
+import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
 import org.eclipse.wst.jsdt.core.search.SearchDocument;
 import org.eclipse.wst.jsdt.core.search.SearchEngine;
 import org.eclipse.wst.jsdt.core.search.SearchPattern;
@@ -41,8 +39,14 @@
 import org.eclipse.wst.jsdt.web.core.internal.Logger;
 import org.eclipse.wst.jsdt.web.core.internal.validation.Util;
 import org.eclipse.wst.jsdt.web.core.javascript.JsNameManglerUtil;
-
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*(copied from JSP)
  * Central access to java indexing and search. All contact between JDT indexing
  * and Searching should be done through here.
  * 
@@ -52,316 +56,471 @@
  * @author pavery
  */
 public class JsSearchSupport {
-	// for debugging
-	static final boolean DEBUG;
-	private static JsSearchSupport singleton = null;
-	static {
-		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jspsearch"); //$NON-NLS-1$
-		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
-	}
-	
-	/**
-	 * Clients should access the methods of this class via the single instance
-	 * via getInstance()
-	 * 
-	 * @return
-	 */
-	public synchronized static JsSearchSupport getInstance() {
-		if (JsSearchSupport.singleton == null) {
-			JsSearchSupport.singleton = new JsSearchSupport();
-		}
-		return JsSearchSupport.singleton;
-	}
-	
-	// private IPath fJspPluginLocation = null;
-	/**
-	 * Utility method to check if a file is a jsp file (since this is done
-	 * frequently)
-	 */
-	public static boolean isJsp(IFile file) {
-		
-		if (file != null && file.exists()) {
-			return Util.isJsType(file.getName());
-		}
-		return false;
-	}
-	/**
-	 * This operation ensures that the live resource's search markers show up in
-	 * the open editor. It also allows the ability to pass in a ProgressMonitor
-	 */
-	private class SearchJob extends Job implements IJavaSearchConstants {
-		IJavaElement fElement = null;
-		boolean fIsCaseSensitive = false;
-		int fLimitTo = IJavaSearchConstants.ALL_OCCURRENCES;
-		int fMatchMode = SearchPattern.R_PATTERN_MATCH;
-		SearchRequestor fRequestor = null;
-		IJavaSearchScope fScope = null;
-		int fSearchFor = IJavaSearchConstants.FIELD;
-		String fSearchText = ""; //$NON-NLS-1$
-		
-		// constructor w/ java element
-		public SearchJob(IJavaElement element, IJavaSearchScope scope, SearchRequestor requestor) {
-			super(JsCoreMessages.JSP_Search + element.getElementName());
-			this.fElement = element;
-			this.fScope = scope;
-			this.fRequestor = requestor;
-		}
-		
-		// constructor w/ search text
-		public SearchJob(String searchText, IJavaSearchScope scope, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive,
-				SearchRequestor requestor) {
-			super(JsCoreMessages.JSP_Search + searchText);
-			this.fSearchText = searchText;
-			this.fScope = scope;
-			this.fSearchFor = searchFor;
-			this.fLimitTo = limitTo;
-			this.fMatchMode = matchMode;
-			this.fIsCaseSensitive = isCaseSensitive;
-			this.fRequestor = requestor;
-		}
-		
-		
-		public IStatus run(IProgressMonitor jobMonitor) {
-			if (jobMonitor != null && jobMonitor.isCanceled()) {
+
+    // for debugging
+    static final boolean DEBUG;
+    static {
+    	String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jssearch"); //$NON-NLS-1$
+ 		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+    }
+
+    private static JsSearchSupport singleton = null;
+
+    private JsSearchParticipant fParticipant = null;
+
+    private IPath fJsPluginLocation = null;
+
+    // pa_TODO may be slow (esp for indexing entire workspace)
+    private final CRC32 fChecksumCalculator = new CRC32();
+
+    /** main cancel montior for all search support */
+    private final IProgressMonitor fMonitor = new NullProgressMonitor();
+
+    private JsSearchSupport() {
+        // force use of single instance
+    }
+
+    /**
+     * This operation ensures that the live resource's search markers show up in
+     * the open editor. It also allows the ability to pass in a ProgressMonitor
+     */
+    private class SearchJob extends Job implements IJavaScriptSearchConstants {
+
+        String fSearchText = ""; //$NON-NLS-1$
+
+        IJavaScriptSearchScope fScope = null;
+
+        int fSearchFor = FIELD;
+
+        int fLimitTo = ALL_OCCURRENCES;
+
+        int fMatchMode = SearchPattern.R_PATTERN_MATCH;
+
+       // boolean fIsCaseSensitive = false;
+
+        SearchRequestor fRequestor = null;
+
+        IJavaScriptElement fElement = null;
+
+        // constructor w/ java element
+        public SearchJob(IJavaScriptElement element, IJavaScriptSearchScope scope, SearchRequestor requestor) {
+
+            super(JsCoreMessages.JSP_Search + element.getElementName());
+            this.fElement = element;
+            this.fScope = scope;
+            this.fRequestor = requestor;
+        }
+
+        // constructor w/ search text
+        public SearchJob(String searchText, IJavaScriptSearchScope scope, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive, SearchRequestor requestor) {
+
+            super(JsCoreMessages.JSP_Search + searchText);
+            this.fSearchText = searchText;
+            this.fScope = scope;
+            this.fSearchFor = searchFor;
+            this.fLimitTo = limitTo;
+            this.fMatchMode = matchMode;
+           // this.fIsCaseSensitive = isCaseSensitive;
+            this.fRequestor = requestor;
+        }
+
+        public IStatus run(IProgressMonitor jobMonitor) {
+
+            if ((jobMonitor != null) && jobMonitor.isCanceled()) {
 				return Status.CANCEL_STATUS;
 			}
-			if (JsSearchSupport.getInstance().isCanceled()) {
+            if (JsSearchSupport.getInstance().isCanceled()) {
 				return Status.CANCEL_STATUS;
 			}
-			SearchPattern javaSearchPattern = null;
-			// if an element is available, use that to create search pattern
-			// (eg. LocalVariable)
-			// otherwise use the text and other paramters
-			if (this.fElement != null) {
+
+            SearchPattern javaSearchPattern = null;
+            // if an element is available, use that to create search pattern
+            // (eg. LocalVariable)
+            // otherwise use the text and other paramters
+            if (this.fElement != null) {
 				javaSearchPattern = SearchPattern.createPattern(this.fElement, this.fLimitTo);
 			} else {
 				javaSearchPattern = SearchPattern.createPattern(this.fSearchText, this.fSearchFor, this.fLimitTo, this.fMatchMode);
 			}
-			if (javaSearchPattern != null) {
-				JsSearchParticipant[] participants = { getSearchParticipant() };
-				SearchEngine engine = new SearchEngine();
-				try {
-					if (jobMonitor != null) {
+
+            if (javaSearchPattern != null) {
+                JsSearchParticipant[] participants = { getSearchParticipant() };
+                SearchEngine engine = new SearchEngine();
+                try {
+                    if (jobMonitor != null) {
 						jobMonitor.beginTask("", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
 					}
-					engine.search(javaSearchPattern, participants, this.fScope, this.fRequestor, jobMonitor);
-				} catch (CoreException e) {
-					if (JsSearchSupport.DEBUG) {
+                    engine.search(javaSearchPattern, participants, this.fScope, this.fRequestor, jobMonitor);
+                } catch (CoreException e) {
+                    if (DEBUG) {
 						Logger.logException(e);
 					}
-				}
-				// non-CoreExceptions will permanently stall the Worker thread
-				catch (Exception e) {
-					if (JsSearchSupport.DEBUG) {
+                }
+                // non-CoreExceptions will permanently stall the Worker thread
+                catch (Exception e) {
+                    if (DEBUG) {
 						Logger.logException(e);
 					}
-				} finally {
-					if (jobMonitor != null) {
+                } finally {
+                    if (jobMonitor != null) {
 						jobMonitor.done();
 					}
-				}
-			}
-			return Status.OK_STATUS;
-		}
-	}
-	// end SearchJob
-	/**
-	 * Runnable forces caller to wait until finished (as opposed to using a Job)
-	 */
-	private class SearchRunnable implements IWorkspaceRunnable, IJavaSearchConstants {
-		IJavaElement fElement = null;
-		boolean fIsCaseSensitive = false;
-		int fLimitTo = IJavaSearchConstants.ALL_OCCURRENCES;
-		int fMatchMode = SearchPattern.R_PATTERN_MATCH;
-		SearchRequestor fRequestor = null;
-		IJavaSearchScope fScope = null;
-		int fSearchFor = IJavaSearchConstants.FIELD;
-		String fSearchText = ""; //$NON-NLS-1$
-		
-		// constructor w/ java element
-		public SearchRunnable(IJavaElement element, IJavaSearchScope scope, SearchRequestor requestor) {
-			this.fElement = element;
-			this.fScope = scope;
-			this.fRequestor = requestor;
-		}
-		
-		// constructor w/ search text
-		public SearchRunnable(String searchText, IJavaSearchScope scope, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive,
-				SearchRequestor requestor) {
-			this.fSearchText = searchText;
-			this.fScope = scope;
-			this.fSearchFor = searchFor;
-			this.fLimitTo = limitTo;
-			this.fMatchMode = matchMode;
-			this.fIsCaseSensitive = isCaseSensitive;
-			this.fRequestor = requestor;
-		}
-		
-		public void run(IProgressMonitor monitor) throws CoreException {
-			if (monitor != null && monitor.isCanceled()) {
+                }
+            }
+            return Status.OK_STATUS;
+        }
+    }
+
+    // end SearchJob
+    /**
+     * Runnable forces caller to wait until finished (as opposed to using a Job)
+     */
+    private class SearchRunnable implements IWorkspaceRunnable, IJavaScriptSearchConstants {
+
+        String fSearchText = ""; //$NON-NLS-1$
+
+        IJavaScriptSearchScope fScope = null;
+
+        int fSearchFor = FIELD;
+
+        int fLimitTo = ALL_OCCURRENCES;
+
+        int fMatchMode = SearchPattern.R_PATTERN_MATCH;
+
+        //boolean fIsCaseSensitive = false;
+
+        SearchRequestor fRequestor = null;
+
+        IJavaScriptElement fElement = null;
+
+        // constructor w/ java element
+        public SearchRunnable(IJavaScriptElement element, IJavaScriptSearchScope scope, SearchRequestor requestor) {
+
+            this.fElement = element;
+            this.fScope = scope;
+            this.fRequestor = requestor;
+        }
+
+        // constructor w/ search text
+//        public SearchRunnable(String searchText, IJavaScriptSearchScope scope, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive, SearchRequestor requestor) {
+//
+//            this.fSearchText = searchText;
+//            this.fScope = scope;
+//            this.fSearchFor = searchFor;
+//            this.fLimitTo = limitTo;
+//            this.fMatchMode = matchMode;
+//            this.fIsCaseSensitive = isCaseSensitive;
+//            this.fRequestor = requestor;
+//        }
+
+        public void run(IProgressMonitor monitor) throws CoreException {
+
+            if ((monitor != null) && monitor.isCanceled()) {
 				return;
 			}
-			if (JsSearchSupport.getInstance().isCanceled()) {
+            if (JsSearchSupport.getInstance().isCanceled()) {
 				return;
 			}
-			SearchPattern javaSearchPattern = null;
-			// if an element is available, use that to create search pattern
-			// (eg. LocalVariable)
-			// otherwise use the text and other paramters
-			if (this.fElement != null) {
+
+            SearchPattern javaSearchPattern = null;
+            // if an element is available, use that to create search pattern
+            // (eg. LocalVariable)
+            // otherwise use the text and other paramters
+            if (this.fElement != null) {
 				javaSearchPattern = SearchPattern.createPattern(this.fElement, fLimitTo);
 			} else {
 				javaSearchPattern = SearchPattern.createPattern(fSearchText, fSearchFor, fLimitTo, fMatchMode);
 			}
-			if (javaSearchPattern != null) {
-				JsSearchParticipant[] participants = { getSearchParticipant() };
-				SearchEngine engine = new SearchEngine();
-				try {
-					if (monitor != null) {
+
+            if (javaSearchPattern != null) {
+                JsSearchParticipant[] participants = { getSearchParticipant() };
+                SearchEngine engine = new SearchEngine();
+                try {
+                    if (monitor != null) {
 						monitor.beginTask("", 0); //$NON-NLS-1$
 					}
-					engine.search(javaSearchPattern, participants, fScope, fRequestor, monitor);
-				} catch (CoreException e) {
-					Logger.logException(e);
-					// throw e;
-				}
-				// non-CoreExceptions will permanently stall the Worker thread
-				catch (Exception e) {
-					Logger.logException(e);
-				} finally {
-					if (monitor != null) {
+                    engine.search(javaSearchPattern, participants, fScope, fRequestor, monitor);
+                } catch (CoreException e) {
+                    Logger.logException(e);
+                    //throw e;
+                }
+                // non-CoreExceptions will permanently stall the Worker thread
+                catch (Exception e) {
+                    Logger.logException(e);
+                } finally {
+                    if (monitor != null) {
 						monitor.done();
 					}
-				}
-			}
+                }
+            }
+        }
+    }
+
+    // end SearchRunnable
+
+    /**
+     * Clients should access the methods of this class via the single instance
+     * via getInstance()
+     * 
+     * @return
+     */
+    public synchronized static JsSearchSupport getInstance() {
+
+        if (singleton == null) {
+			singleton = new JsSearchSupport();
 		}
-	}
-	// pa_TODO may be slow (esp for indexing entire workspace)
-	private final CRC32 fChecksumCalculator = new CRC32();
-	/** main cancel montior for all search support */
-	private final IProgressMonitor fMonitor = new NullProgressMonitor();
-	// end SearchRunnable
-	private JsSearchParticipant fParticipant = null;
-	
-	private JsSearchSupport() {
-	// force use of single instance
-	}
-	
-	/**
-	 * schedules a search document representing this JSP file for indexing (by
-	 * the java indexer)
-	 * 
-	 * @param file
-	 *            the JSP file
-	 * @return true if indexing was successful, false otherwise
-	 * @throws CoreException
-	 */
-	public SearchDocument addJspFile(IFile file) {
-		if (JsSearchSupport.getInstance().isCanceled() || !file.isAccessible()) {
-			return null;
-		}
-		if (JsSearchSupport.DEBUG) {
+        return singleton;
+    }
+
+    /**
+     * Utility method to check if a file is a jsp file (since this is done
+     * frequently)
+     */
+    public static boolean isJsp(IFile file) {
+    	return Util.isJsType(file.getName());
+    	// (pa) 20051025 removing deep content type check
+    	// because this method is called frequently
+    	// and IO is expensive
+//        boolean isJsp = false;
+//
+//        if (file != null && file.exists()) {
+//        	
+//            IContentType contentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
+//            // check this before description, it's less expensive
+//            if (contentTypeJSP.isAssociatedWith(file.getName())) {
+//            	isJsp = true;
+//            }
+//        }
+//
+//        return isJsp;
+    }
+
+    /**
+     * schedules a search document representing this JSP file for indexing (by
+     * the java indexer)
+     * 
+     * @param file
+     *            the JSP file
+     * @return true if indexing was successful, false otherwise
+     * @throws CoreException
+     */
+    public SearchDocument addJspFile(IFile file) {
+        if (JsSearchSupport.getInstance().isCanceled() || !file.isAccessible()) {
+            return null;
+        }
+
+        if (DEBUG) {
 			System.out.println("adding JSP file:" + file.getFullPath()); //$NON-NLS-1$
 		}
-		// create
-		SearchDocument delegate = createSearchDocument(file);
-		// null if not a jsp file
-		if (delegate != null) {
-			try {
-				getSearchParticipant().scheduleDocumentIndexing(delegate, computeIndexLocation(file.getParent().getFullPath()));
-			} catch (Exception e) {
-				// ensure that failure here doesn't keep other documents from
-				// being indexed
-				// if peformed in a batch call (like JSPIndexManager)
-				if (JsSearchSupport.DEBUG) {
+
+        // create
+        SearchDocument delegate = createSearchDocument(file);
+        // null if not a jsp file
+        if (delegate != null) {
+            try {
+                getSearchParticipant().scheduleDocumentIndexing(delegate, computeIndexLocation(file.getParent().getFullPath()));
+            } catch (Exception e) {
+                // ensure that failure here doesn't keep other documents from
+                // being indexed
+                // if peformed in a batch call (like JSPIndexManager)
+                if (DEBUG) {
 					e.printStackTrace();
 				}
-			}
-		}
-		if (JsSearchSupport.DEBUG) {
+            }
+        }
+
+        if (DEBUG) {
 			System.out.println("scheduled" + delegate + "for indexing"); //$NON-NLS-1$ //$NON-NLS-2$
 		}
-		return delegate;
-	}
-	
-	public final IPath computeContainerLocation(IPath indexLocation) {
-		return null;
-	}
-	
-	// This is called from JSPPathIndexer
-	// pa_TODO
-	// how can we make sure participant indexLocations are updated at startup?
-	public final IPath computeIndexLocation(IPath containerPath) {
-		String indexLocation = null;
-		// we don't want to inadvertently use a JDT Index
-		// we want to be sure to use the Index from the JSP location
-		// Object obj = indexLocations.get(containerPath);
-		// if (obj != null) {
-		// indexLocation = (String) obj;
-		// } else {
-		// create index entry
-		String pathString = containerPath.toOSString();
-		this.fChecksumCalculator.reset();
-		this.fChecksumCalculator.update(pathString.getBytes());
-		String fileName = Long.toString(this.fChecksumCalculator.getValue()) + ".index"; //$NON-NLS-1$
-		// this is the only difference from
-		// IndexManager#computeIndexLocation(...)
-		indexLocation = getModelJspPluginWorkingLocation(getProject(containerPath)).append(fileName).toOSString();
-		// pa_TODO need to add to java path too, so JDT search support knows
-		// there should be a non internal way to do this.
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=77564
-		JavaModelManager.getJavaModelManager().getIndexManager().indexLocations.put(containerPath, new Path(indexLocation));
-		// }
-		return new Path(indexLocation);
-	}
-	
-	/**
-	 * @param jspFile
-	 * @return SearchDocument if the file is not null, exists, and is a JSP
-	 *         file, otherwise null.
-	 */
-	private SearchDocument createSearchDocument(IFile jspFile) {
-		JSDTSearchDocumentDelegate delegate = null;
-		if (jspFile != null && jspFile.exists() && JsSearchSupport.isJsp(jspFile)) {
-			delegate = new JSDTSearchDocumentDelegate(new JsSearchDocument(jspFile.getFullPath().toString(), getSearchParticipant()));
+
+        return delegate;
+    }
+    
+    /**
+     * Perform a java search w/ the given parameters. Runs in a background Job
+     * (results may still come in after this method call)
+     * 
+     * @param searchText
+     *            the string of text to search on
+     * @param searchFor
+     *            IJavaScriptSearchConstants.TYPE, METHOD, FIELD, PACKAGE, etc...
+     * @param limitTo
+     *            IJavaScriptSearchConstants.DECLARATIONS,
+     *            IJavaScriptSearchConstants.REFERENCES,
+     *            IJavaScriptSearchConstants.IMPLEMENTORS, or
+     *            IJavaScriptSearchConstants.ALL_OCCURRENCES
+     * @param matchMode
+     *            allow * wildcards or not
+     * @param isCaseSensitive
+     * @param requestor
+     *            passed in to accept search matches (and do "something" with
+     *            them)
+     */
+    public void search(String searchText, IJavaScriptSearchScope scope, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive, SearchRequestor requestor) {
+
+        JsIndexManager.getInstance().rebuildIndexIfNeeded();
+
+        SearchJob job = new SearchJob(searchText, scope, searchFor, limitTo, matchMode, isCaseSensitive, requestor);
+        setCanceled(false);
+        job.setUser(true);
+        // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5032
+        // pops up user operation blocked dialog if you perform a long search,
+        // then open a file because it locks the workspace
+        //job.setRule(ResourcesPlugin.getWorkspace().getRoot());
+        job.schedule();
+    }
+
+    /**
+     * Search for an IJavaScriptElement, constrained by the given parameters. Runs in
+     * a background Job (results may still come in after this method call)
+     * 
+     * @param element
+     * @param scope
+     * @param requestor
+     */
+    public void search(IJavaScriptElement element, IJavaScriptSearchScope scope, SearchRequestor requestor) {
+
+        JsIndexManager.getInstance().rebuildIndexIfNeeded();
+
+        SearchJob job = new SearchJob(element, scope, requestor);
+        setCanceled(false);
+        job.setUser(true);
+        // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5032
+        //job.setRule(ResourcesPlugin.getWorkspace().getRoot());
+        job.schedule();
+    }
+
+    /**
+     * Search for an IJavaScriptElement, constrained by the given parameters. Runs in
+     * an IWorkspace runnable (results will be reported by the end of this
+     * method)
+     * 
+     * @param element
+     * @param scope
+     * @param requestor
+     */
+    public void searchRunnable(IJavaScriptElement element, IJavaScriptSearchScope scope, SearchRequestor requestor) {
+
+        JsIndexManager.getInstance().rebuildIndexIfNeeded();
+
+        SearchRunnable searchRunnable = new SearchRunnable(element, scope, requestor);
+        try {
+            setCanceled(false);
+            ResourcesPlugin.getWorkspace().run(searchRunnable, JsSearchSupport.getInstance().getProgressMonitor());
+        } catch (CoreException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * @param jspFile
+     * @return SearchDocument if the file is not null, exists, and is a JSP
+     *         file, otherwise null.
+     */
+    private SearchDocument createSearchDocument(IFile jspFile) {
+
+        JSDTSearchDocumentDelegate delegate = null;
+        if ((jspFile != null) && jspFile.exists() && isJsp(jspFile)) {
+
+            delegate = new JSDTSearchDocumentDelegate(new JsSearchDocument(jspFile.getFullPath().toString(), getSearchParticipant()));
+        }
+        return delegate;
+
+    }
+
+    /**
+     * Centralized place to access JSPSearchDocuments (used by
+     * JSPSearchParticipant and JSPSearchRequestor)
+     * 
+     * @param searchDocPath
+     * @param doc
+     * @return the JSPSearchDocument or null if one is not found
+     */
+    public SearchDocument getSearchDocument(String searchDocPath) {
+         
+        SearchDocument delegate = null;
+        IFile f = fileForCUPath(searchDocPath);
+        if (f != null) {
+            delegate = createSearchDocument(f);
+        } else {
+            // handle failure case... (file deleted maybe?)
+        }
+        return delegate;
+    }
+
+    /**
+     * Unmangles the searchDocPath and returns the corresponding JSP file.
+     * 
+     * @param searchDocPath
+     */
+    private IFile fileForCUPath(String searchDocPath) {
+    
+        String[] split = searchDocPath.split("/"); //$NON-NLS-1$
+        String classname = split[split.length - 1];
+
+        // ignore anything but .java matches (like .class binary matches)
+        if(!searchDocPath.endsWith(".js")) { //$NON-NLS-1$
+            return null;
+        }
+
+        String filePath = JsNameManglerUtil.unmangle(classname);
+       
+        // try absolute path
+        IFile f = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(filePath));
+        // workspace relative then
+        if(f == null) {
+            // https://bugs.eclipse.org/bugs/show_bug.cgi?id=86009
+            // must have a project name as well
+            // which would mean >= 2 path segments
+            IPath path = new Path(filePath);
+            if(path.segmentCount() >= 2) {
+                f = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+            }
+        }
+        return f;
+    }
+
+    JsSearchParticipant getSearchParticipant() {
+
+        if (this.fParticipant == null) {
+			this.fParticipant = new JsSearchParticipant();
 		}
-		return delegate;
-	}
-	
-	/**
-	 * Unmangles the searchDocPath and returns the corresponding JSP file.
-	 * 
-	 * @param searchDocPath
-	 */
-	private IFile fileForCUPath(String searchDocPath) {
-		String[] split = searchDocPath.split("/"); //$NON-NLS-1$
-		String classname = split[split.length - 1];
-		// ignore anything but .java matches (like .class binary matches)
-		if (!searchDocPath.endsWith(".js")) { //$NON-NLS-1$
-			return null;
-		}
-		String filePath = JsNameManglerUtil.unmangle(classname);
-		// try absolute path
-		IFile f = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(filePath));
-		// workspace relative then
-		if (f == null) {
-			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=86009
-			// must have a project name as well
-			// which would mean >= 2 path segments
-			IPath path = new Path(filePath);
-			if (path.segmentCount() >= 2) {
-				f = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
-			}
-		}
-		return f;
-	}
-	
-	// copied from JDT IndexManager
+        return this.fParticipant;
+    }
+
+    // This is called from JSPPathIndexer
+    // pa_TODO
+    //how can we make sure participant indexLocations are updated at startup?
+    public final IPath computeIndexLocation(IPath containerPath) {
+
+        IPath indexLocation = null;
+        // we don't want to inadvertently use a JDT Index
+        // we want to be sure to use the Index from the JSP location
+        //Object obj = indexLocations.get(containerPath);
+        //if (obj != null) {
+        //    indexLocation = (String) obj;
+        //} else {
+            // create index entry
+            String pathString = containerPath.toOSString();
+            this.fChecksumCalculator.reset();
+            this.fChecksumCalculator.update(pathString.getBytes());
+            String fileName = Long.toString(this.fChecksumCalculator.getValue()) + ".index"; //$NON-NLS-1$
+            // this is the only difference from
+            // IndexManager#computeIndexLocation(...)
+            indexLocation = getModelJspPluginWorkingLocation().append(fileName);
+
+            // pa_TODO need to add to java path too, so JDT search support knows
+            // there should be a non internal way to do this.
+            // https://bugs.eclipse.org/bugs/show_bug.cgi?id=77564
+            JavaModelManager.getJavaModelManager().getIndexManager().indexLocations.put(containerPath, indexLocation);
+        //}
+        return indexLocation;
+    }
 	public IPath getModelJspPluginWorkingLocation(IProject project) {
 		if (project == null) {
 			System.out.println("Null project"); //$NON-NLS-1$
 		}
-		IPath workingLocationFile = project.getWorkingLocation(JsCorePlugin.PLUGIN_ID).append("jspsearch"); //$NON-NLS-1$
+		IPath workingLocationFile = project.getWorkingLocation(JsCorePlugin.PLUGIN_ID).append("jssearch"); //$NON-NLS-1$
 		// ensure that it exists on disk
 		File folder = new File(workingLocationFile.toOSString());
 		if (!folder.isDirectory()) {
@@ -372,139 +531,64 @@
 		}
 		return workingLocationFile;
 	}
-	
-	/**
-	 * JSP Indexing and Search jobs check this
-	 * 
-	 * @return
-	 */
-	public final IProgressMonitor getProgressMonitor() {
-		return this.fMonitor;
-	}
-	
-	private IProject getProject(IPath path) {
-		// Return the project containing the given path
-		IWorkspace workspace = ResourcesPlugin.getWorkspace();
-		IResource resource = workspace.getRoot().findMember(path.toString());
-		if (resource == null) {
-			return null;
+    // copied from JDT IndexManager
+    public IPath getModelJspPluginWorkingLocation() {
+
+        if (this.fJsPluginLocation != null) {
+			return this.fJsPluginLocation;
 		}
-		IProject project = resource.getProject();
-		return project;
-	}
-	
-	/**
-	 * Centralized place to access JSPSearchDocuments (used by
-	 * JSPSearchParticipant and JSPSearchRequestor)
-	 * 
-	 * @param searchDocPath
-	 * @param doc
-	 * @return the JSPSearchDocument or null if one is not found
-	 */
-	public SearchDocument getSearchDocument(String searchDocPath) {
-		SearchDocument delegate = null;
-		IFile f = fileForCUPath(searchDocPath);
-		if (f != null) {
-			delegate = createSearchDocument(f);
-		} else {
-			// handle failure case... (file deleted maybe?)
+
+        // Append the folder name "jssearch" to keep the state location area cleaner
+        IPath stateLocation = JsCorePlugin.getDefault().getStateLocation().addTrailingSeparator().append("jssearch"); //$NON-NLS-1$
+
+        // pa_TODO workaround for
+        // https://bugs.eclipse.org/bugs/show_bug.cgi?id=62267
+        // copied from IndexManager
+        String device = stateLocation.getDevice();
+        if ((device != null) && (device.charAt(0) == '/')) {
+			stateLocation = stateLocation.setDevice(device.substring(1));
 		}
-		return delegate;
-	}
-	
-	JsSearchParticipant getSearchParticipant() {
-		if (this.fParticipant == null) {
-			this.fParticipant = new JsSearchParticipant();
+
+        // ensure that it exists on disk
+        File folder = new File(stateLocation.toOSString());
+		if (!folder.isDirectory()) {
+			try {
+				folder.mkdir();
+			}
+			catch (SecurityException e) {
+			}
 		}
-		return this.fParticipant;
-	}
-	
-	/**
-	 * JSP Indexing and Search jobs check this
-	 * 
-	 * @return
-	 */
-	public synchronized final boolean isCanceled() {
-		return fMonitor.isCanceled();
-	}
-	
-	/**
-	 * Search for an IJavaElement, constrained by the given parameters. Runs in
-	 * a background Job (results may still come in after this method call)
-	 * 
-	 * @param element
-	 * @param scope
-	 * @param requestor
-	 */
-	public void search(IJavaElement element, IJavaSearchScope scope, SearchRequestor requestor) {
-		JsIndexManager.getInstance().rebuildIndexIfNeeded();
-		SearchJob job = new SearchJob(element, scope, requestor);
-		setCanceled(false);
-		job.setUser(true);
-		// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5032
-		// job.setRule(ResourcesPlugin.getWorkspace().getRoot());
-		job.schedule();
-	}
-	
-	/**
-	 * Perform a java search w/ the given parameters. Runs in a background Job
-	 * (results may still come in after this method call)
-	 * 
-	 * @param searchText
-	 *            the string of text to search on
-	 * @param searchFor
-	 *            IJavaSearchConstants.TYPE, METHOD, FIELD, PACKAGE, etc...
-	 * @param limitTo
-	 *            IJavaSearchConstants.DECLARATIONS,
-	 *            IJavaSearchConstants.REFERENCES,
-	 *            IJavaSearchConstants.IMPLEMENTORS, or
-	 *            IJavaSearchConstants.ALL_OCCURRENCES
-	 * @param matchMode
-	 *            allow * wildcards or not
-	 * @param isCaseSensitive
-	 * @param requestor
-	 *            passed in to accept search matches (and do "something" with
-	 *            them)
-	 */
-	public void search(String searchText, IJavaSearchScope scope, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive, SearchRequestor requestor) {
-		JsIndexManager.getInstance().rebuildIndexIfNeeded();
-		SearchJob job = new SearchJob(searchText, scope, searchFor, limitTo, matchMode, isCaseSensitive, requestor);
-		setCanceled(false);
-		job.setUser(true);
-		// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5032
-		// pops up user operation blocked dialog if you perform a long search,
-		// then open a file because it locks the workspace
-		// job.setRule(ResourcesPlugin.getWorkspace().getRoot());
-		job.schedule();
-	}
-	
-	/**
-	 * Search for an IJavaElement, constrained by the given parameters. Runs in
-	 * an IWorkspace runnable (results will be reported by the end of this
-	 * method)
-	 * 
-	 * @param element
-	 * @param scope
-	 * @param requestor
-	 */
-	public void searchRunnable(IJavaElement element, IJavaSearchScope scope, SearchRequestor requestor) {
-		JsIndexManager.getInstance().rebuildIndexIfNeeded();
-		SearchRunnable searchRunnable = new SearchRunnable(element, scope, requestor);
-		try {
-			setCanceled(false);
-			ResourcesPlugin.getWorkspace().run(searchRunnable, JsSearchSupport.getInstance().getProgressMonitor());
-		} catch (CoreException e) {
-			e.printStackTrace();
-		}
-	}
-	
-	/**
-	 * JSP Indexing and Search jobs check this
-	 * 
-	 * @return
-	 */
-	public synchronized final void setCanceled(boolean cancel) {
-		// System.out.println("search support monitor" + fMonitor);
-		fMonitor.setCanceled(cancel);
-	}
-}
\ No newline at end of file
+
+        return this.fJsPluginLocation = stateLocation;
+    }
+
+    /**
+     * JSP Indexing and Search jobs check this
+     * 
+     * @return
+     */
+    public synchronized final void setCanceled(boolean cancel) {
+    	//System.out.println("search support monitor" + fMonitor);
+        fMonitor.setCanceled(cancel);
+    }
+
+    /**
+     * JSP Indexing and Search jobs check this
+     * 
+     * @return
+     */
+    public synchronized final boolean isCanceled() {
+
+        return fMonitor.isCanceled();
+    }
+
+    /**
+     * JSP Indexing and Search jobs check this
+     * 
+     * @return
+     */
+    public final IProgressMonitor getProgressMonitor() {
+
+        return this.fMonitor;
+    }
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/NullSearchDocument.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/NullSearchDocument.java
index 3f0dec7..7f1ce79 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/NullSearchDocument.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/NullSearchDocument.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,31 +12,38 @@
 
 import org.eclipse.wst.jsdt.core.search.SearchDocument;
 
+
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * An empty servlet, safe for Java search participation
  * 
  * @author pavery
  */
 public class NullSearchDocument extends SearchDocument {
+	
 	StringBuffer fEmptyServletBuffer = null;
 	
 	public NullSearchDocument(String documentPath) {
-		super(documentPath, new JsSearchParticipant());
+		super(documentPath, new JsSearchParticipant()); 
 		this.fEmptyServletBuffer = new StringBuffer();
 	}
 	
-	
 	public byte[] getByteContents() {
 		return this.fEmptyServletBuffer.toString().getBytes();
 	}
 	
-	
 	public char[] getCharContents() {
 		return this.fEmptyServletBuffer.toString().toCharArray();
 	}
 	
-	
 	public String getEncoding() {
 		return null;
 	}
+
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/text/IJsPartitions.java b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/text/IJsPartitions.java
index 92068a2..44ab14b 100644
--- a/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/text/IJsPartitions.java
+++ b/bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/text/IJsPartitions.java
@@ -1,14 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.core.text;
 
 import org.eclipse.wst.html.core.text.IHTMLPartitions;
 
 /**
- * This interface is not intended to be implemented. It defines the partition
- * types for JSP. Clients should reference the partition type Strings defined
- * here directly.
- * 
- * @since 1.1
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public interface IJsPartitions {
 	String HtmlJsPartition = IHTMLPartitions.SCRIPT;
 	//$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/.cvsignore b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.cvsignore
new file mode 100644
index 0000000..c7e8ba8
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/.cvsignore
@@ -0,0 +1,4 @@
+@dot
+build.xml
+javaCompiler...args
+org.eclipse.wst.jsdt.web.support.jsp_1.0.0.200806031304.jar
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.jsdt.web.support.jsp/META-INF/MANIFEST.MF
index d8dffa0..4f552a3 100644
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/META-INF/MANIFEST.MF
@@ -2,23 +2,24 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name.0
 Bundle-SymbolicName: org.eclipse.wst.jsdt.web.support.jsp;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.0.301.qualifier
 Bundle-Activator: org.eclipse.wst.jsdt.web.support.jsp.Activator
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.jsdt.web.ui;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jst.jsp.ui;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jface.text;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jface;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.html.ui;bundle-version="[1.0.300,1.1.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.200,1.2.0)",
- org.eclipse.jst.jsp.core;bundle-version="[1.2.100,1.3.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.200,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.jsdt.web.core;bundle-version="[1.0.0,2.0.0)"
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.jsdt.web.ui;bundle-version="[1.0.200,2.0.0)",
+ org.eclipse.jst.jsp.ui;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.sse.ui;bundle-version="[1.1.200,1.3.0)",
+ org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.jface;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.html.ui;bundle-version="[1.0.500,1.1.0)",
+ org.eclipse.wst.html.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.jst.jsp.core;bundle-version="[1.2.300,1.3.0)",
+ org.eclipse.wst.css.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.jsdt.web.core;bundle-version="[1.0.300,2.0.0)"
 Eclipse-LazyStart: true
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: plugin
 Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.wst.jsdt.web.support.jsp
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/about.html b/bundles/org.eclipse.wst.jsdt.web.support.jsp/about.html
new file mode 100644
index 0000000..4602330
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+ 
+<p>June 2, 2006</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise 
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;).  A copy of the EPL is available 
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content.  Check the Redistributor's license that was 
+provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/build.properties b/bundles/org.eclipse.wst.jsdt.web.support.jsp/build.properties
index 0dc34f7..bc3b0f2 100644
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/build.properties
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/build.properties
@@ -3,4 +3,5 @@
 bin.includes = META-INF/,\
                .,\
                plugin.xml,\
-               plugin.properties
+               plugin.properties,\
+               about.html
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.properties b/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.properties
index f0465d1..8189ecb 100644
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.properties
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.properties
@@ -1,3 +1,14 @@
+###############################################################################

+# Copyright (c) 2000, 2010 IBM Corporation and others.

+# All rights reserved. This program and the accompanying materials

+# are made available under the terms of the Eclipse Public License v1.0

+# which accompanies this distribution, and is available at

+# http://www.eclipse.org/legal/epl-v10.html

+#

+# Contributors:

+#     IBM Corporation - initial API and implementation

+###############################################################################

+

 #Properties file for org.eclipse.wst.jsdt.web.support.jsp

-Bundle-Vendor.0 = Eclipse.org

+Bundle-Vendor.0 = Eclipse Web Tools Platform

 Bundle-Name.0 = JSDT support for JSP Plug-in
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.xml b/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.xml
index d1bb9c3..ea1b7a6 100644
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.xml
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/plugin.xml
@@ -6,25 +6,23 @@
 		<sourceViewerConfiguration
 			class="org.eclipse.wst.jsdt.web.support.jsp.JSDTStructuredTextViewerConfigurationJSP"
 			target="org.eclipse.jst.jsp.core.jspsource.source" />
-		
-		
-		<contentOutlineConfiguration
-			class="org.eclipse.jst.jsp.ui.views.contentoutline.JSPContentOutlineConfiguration"
-			target="org.eclipse.jst.jsp.core.jspsource" />
-		
-		
+		<provisionalConfiguration
+			type="contentassistprocessor"
+			class="org.eclipse.wst.jsdt.web.ui.internal.contentassist.JSDTContentAssistant"
+			target="org.eclipse.jst.jsp.SCRIPT.JAVASCRIPT" />
+		<documentationTextHover
+			class="org.eclipse.wst.jsdt.web.ui.internal.taginfo.JSDTHoverProcessor"
+			target="org.eclipse.jst.jsp.SCRIPT.JAVASCRIPT" />
+		<provisionalConfiguration
+			type="org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor"
+			class="org.eclipse.wst.jsdt.web.ui.internal.java.search.JsFindOccurrencesProcessor"
+			target="org.eclipse.jst.jsp.SCRIPT,org.eclipse.jst.jsp.SCRIPT.EVENTHANDLER" />
+		<provisionalConfiguration
+			type="slaveformattingstrategy"
+			class="org.eclipse.wst.jsdt.web.ui.internal.format.FormattingStrategyJSDT"
+			target="org.eclipse.jst.jsp.SCRIPT.JAVASCRIPT" />
 	</extension>
 
-	
-	<extension
-		point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
-		<adapterFactoryDescription
-			class="org.eclipse.wst.jsdt.web.support.jsp.JSDTAdapterFactoryProviderForJSP">
-			<contentType id="org.eclipse.jst.jsp.core.jspsource" />
-		</adapterFactoryDescription>
-	</extension>
-	
-	
 	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
 		<validator
 			scope="total"
@@ -36,5 +34,15 @@
 			</contentTypeIdentifier>
 		</validator>
 	</extension>
+
+   <!--
+   <extension point="org.eclipse.wst.common.project.facet.core.facets">
+		<event-handler facet="jst.web" type="POST_INSTALL"  version="[2.0">
+	   		<delegate class="org.eclipse.wst.jsdt.web.core.internal.project.JsNatureInstaller"/>
+		</event-handler>
 	
+		<event-handler facet="jst.web" type="POST_UNINSTALL" version="[2.0">
+			<delegate class="org.eclipse.wst.jsdt.web.core.internal.project.JsNatureUninstaller"/>
+		</event-handler>
+	</extension>-->
 </plugin>
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/Activator.java b/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/Activator.java
index 0eb9dc7..dd179c0 100644
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/Activator.java
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/Activator.java
@@ -1,3 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ ******************************************************************************
+ *
+ **/
 package org.eclipse.wst.jsdt.web.support.jsp;
 
 import org.eclipse.core.runtime.Plugin;
@@ -6,6 +18,14 @@
 /**
  * The activator class controls the plug-in life cycle
  */
+
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class Activator extends Plugin {
 
 	// The plug-in ID
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/JSDTAdapterFactoryProviderForJSP.java b/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/JSDTAdapterFactoryProviderForJSP.java
deleted file mode 100644
index da995c1..0000000
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/JSDTAdapterFactoryProviderForJSP.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.eclipse.wst.jsdt.web.support.jsp;
-
-import org.eclipse.jst.jsp.core.internal.modelhandler.ModelHandlerForJSP;
-import org.eclipse.wst.jsdt.web.ui.internal.registry.AdapterFactoryProviderForJSDT;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
-
-public class JSDTAdapterFactoryProviderForJSP extends
-		AdapterFactoryProviderForJSDT {
-
-	public boolean isFor(IDocumentTypeHandler contentTypeDescription) {
-		return (contentTypeDescription instanceof ModelHandlerForJSP);
-	}
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/JSDTStructuredTextViewerConfigurationJSP.java b/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/JSDTStructuredTextViewerConfigurationJSP.java
index ca0f0e5..661e60d 100644
--- a/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/JSDTStructuredTextViewerConfigurationJSP.java
+++ b/bundles/org.eclipse.wst.jsdt.web.support.jsp/src/org/eclipse/wst/jsdt/web/support/jsp/JSDTStructuredTextViewerConfigurationJSP.java
@@ -1,215 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/**
+ * 
+ */
 package org.eclipse.wst.jsdt.web.support.jsp;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.ITextDoubleClickStrategy;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.formatter.IContentFormatter;
-import org.eclipse.jface.text.formatter.IFormattingStrategy;
-import org.eclipse.jface.text.formatter.MultiPassContentFormatter;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.text.information.IInformationPresenter;
-import org.eclipse.jface.text.information.IInformationProvider;
 import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jst.jsp.core.internal.text.StructuredTextPartitionerForJSP;
 import org.eclipse.jst.jsp.core.text.IJSPPartitions;
 import org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP;
-import org.eclipse.jst.jsp.ui.internal.autoedit.StructuredAutoEditStrategyJSP;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-import org.eclipse.wst.css.core.text.ICSSPartitions;
 import org.eclipse.wst.html.core.text.IHTMLPartitions;
 import org.eclipse.wst.jsdt.web.ui.StructuredTextViewerConfigurationJSDT;
-import org.eclipse.wst.jsdt.web.ui.StructuredTextViewerConfigurationJSDT.externalTypeExtension;
+import org.eclipse.wst.jsdt.web.ui.internal.autoedit.AutoEditStrategyForJs;
 import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
 import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-
+/**
+*
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JSDTStructuredTextViewerConfigurationJSP extends StructuredTextViewerConfigurationJSP{
 
-	private String[] fConfiguredContentTypes;
-	
 	private StructuredTextViewerConfiguration fHTMLSourceViewerConfiguration;
 
-	private StructuredTextViewerConfiguration getHTMLSourceViewerConfiguration() {
+	private StructuredTextViewerConfiguration getJSDTHTMLSourceViewerConfiguration() {
 		if (fHTMLSourceViewerConfiguration == null) {
 			fHTMLSourceViewerConfiguration = new StructuredTextViewerConfigurationJSDT();
 		}
 		return fHTMLSourceViewerConfiguration;
 	}
 	
-	/*
-	 * From here down, had to copy code from the JSP because the class decided to make the two members above private
-	 */
-	public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
-		IAutoEditStrategy[] strategies = null;
-
-		if (contentType == IHTMLPartitions.HTML_DEFAULT || contentType == IHTMLPartitions.HTML_DECLARATION) {
-			// html and jsp autoedit strategies
-			List allStrategies = new ArrayList(0);
-
-			// add the jsp autoedit strategy first then add all html's
-			allStrategies.add(new StructuredAutoEditStrategyJSP());
-
-			IAutoEditStrategy[] htmlStrategies = getHTMLSourceViewerConfiguration().getAutoEditStrategies(sourceViewer, contentType);
-			for (int i = 0; i < htmlStrategies.length; i++) {
-				allStrategies.add(htmlStrategies[i]);
-			}
-
-			strategies = (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[allStrategies.size()]);
-		}
-		else {
-			strategies = super.getAutoEditStrategies(sourceViewer, contentType);
-		}
-
-		return strategies;
-	}
-	
-	public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
-		if (fConfiguredContentTypes == null) {
-			/*
-			 * A little bit of cheating because assuming html's configured
-			 * content types will add default, unknown, and all xml configured
-			 * content types
-			 */
-			String[] htmlTypes = getHTMLSourceViewerConfiguration().getConfiguredContentTypes(sourceViewer);
-			String[] jspTypes = StructuredTextPartitionerForJSP.getConfiguredContentTypes();
-			fConfiguredContentTypes = new String[htmlTypes.length + jspTypes.length];
-
-			int index = 0;
-			System.arraycopy(htmlTypes, 0, fConfiguredContentTypes, index, htmlTypes.length);
-			System.arraycopy(jspTypes, 0, fConfiguredContentTypes, index += htmlTypes.length, jspTypes.length);
-		}
-
-		return fConfiguredContentTypes;
-	}
-	
-	protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
-		IContentAssistProcessor[] processors = null;
-
-		if (partitionType == IHTMLPartitions.SCRIPT) {
-			// HTML JavaScript
-			IContentAssistant htmlContentAssistant = getHTMLSourceViewerConfiguration().getContentAssistant(sourceViewer);
-			IContentAssistProcessor processor = htmlContentAssistant.getContentAssistProcessor(IHTMLPartitions.SCRIPT);
-			processors = new IContentAssistProcessor[]{processor};
-		}
-		else if (partitionType == ICSSPartitions.STYLE) {
-			// HTML CSS
-			IContentAssistant htmlContentAssistant = getHTMLSourceViewerConfiguration().getContentAssistant(sourceViewer);
-			IContentAssistProcessor processor = htmlContentAssistant.getContentAssistProcessor(ICSSPartitions.STYLE);
-			processors = new IContentAssistProcessor[]{processor};
-		}
-		else{
-			processors = super.getContentAssistProcessors(sourceViewer, partitionType);
-		}
-
-		return processors;
-	}
-	
-	public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
-		final IContentFormatter formatter = super.getContentFormatter(sourceViewer);
-		/*
-		 * Check for any externally supported auto edit strategies from EP.
-		 * [Bradley Childs - childsb@us.ibm.com]
-		 */
-		String[] contentTypes = getConfiguredContentTypes(sourceViewer);
-		for (int i = 0; i < contentTypes.length; i++) {
-			IFormattingStrategy cf = (IFormattingStrategy) ExtendedConfigurationBuilder.getInstance().getConfiguration(externalTypeExtension.CONTENT_FORMATER, contentTypes[i]);
-			if (cf != null && formatter instanceof MultiPassContentFormatter) {
-				((MultiPassContentFormatter) formatter).setSlaveStrategy(cf, contentTypes[i]);
-			}
-		}
-		return formatter;
-	}
-	
-	public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
-		ITextDoubleClickStrategy strategy = null;
-
-		// html or javascript
-		if (contentType == IHTMLPartitions.HTML_DEFAULT || contentType == IHTMLPartitions.SCRIPT)
-			strategy = getHTMLSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, contentType);
-		else if (contentType == IJSPPartitions.JSP_DEFAULT)
-			// JSP (just treat like html)
-			strategy = getHTMLSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, IHTMLPartitions.HTML_DEFAULT);
-		else
-			strategy = super.getDoubleClickStrategy(sourceViewer, contentType);
-
-		return strategy;
-	}
-	
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.editors.text.TextSourceViewerConfiguration#getHyperlinkDetectors(org.eclipse.jface.text.source.ISourceViewer)
-	 */
-	
-	public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
-		if (sourceViewer == null || !fPreferenceStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED)) {
-			return null;
-		}
-		List allDetectors = new ArrayList(0);
-		IHyperlinkDetector[] superDetectors = super.getHyperlinkDetectors(sourceViewer);
-		for (int m = 0; m < superDetectors.length; m++) {
-			IHyperlinkDetector detector = superDetectors[m];
-			if (!allDetectors.contains(detector)) {
-				allDetectors.add(detector);
-			}
-		}
-		/* Check for external HyperLink Detectors */
-		String[] contentTypes = getConfiguredContentTypes(sourceViewer);
-		for (int i = 0; i < contentTypes.length; i++) {
-			IHyperlinkDetector hl = (IHyperlinkDetector) ExtendedConfigurationBuilder.getInstance().getConfiguration(externalTypeExtension.HYPERLINK_DETECTOR, contentTypes[i]);
-			if (hl != null) {
-				allDetectors.add(hl);
-			}
-		}
-		return (IHyperlinkDetector[]) allDetectors.toArray(new IHyperlinkDetector[0]);
-	}
-	
 	public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) {
 		String[] indentations = null;
-
-		if (contentType == IXMLPartitions.XML_DEFAULT)
-			indentations = super.getIndentPrefixes(sourceViewer, contentType);
+		if (IHTMLPartitions.SCRIPT.equals(contentType) || IJSPPartitions.JSP_CONTENT_JAVASCRIPT.equals(contentType) || IHTMLPartitions.SCRIPT_EVENTHANDLER.equals(contentType))
+			indentations = getJSDTHTMLSourceViewerConfiguration().getIndentPrefixes(sourceViewer, contentType);
 		else
-			indentations = getHTMLSourceViewerConfiguration().getIndentPrefixes(sourceViewer, contentType);
-
+			indentations = super.getIndentPrefixes(sourceViewer, contentType);
 		return indentations;
 	}
 	
-	protected IInformationProvider getInformationProvider(ISourceViewer sourceViewer, String partitionType) {
-		IInformationProvider provider = null;
-		if (partitionType == IHTMLPartitions.HTML_DEFAULT) {
-			// HTML
-			IInformationPresenter htmlPresenter = getHTMLSourceViewerConfiguration().getInformationPresenter(sourceViewer);
-			provider = htmlPresenter.getInformationProvider(IHTMLPartitions.HTML_DEFAULT);
-		}
-		else if (partitionType == IHTMLPartitions.SCRIPT) {
-			// HTML JavaScript
-			IInformationPresenter htmlPresenter = getHTMLSourceViewerConfiguration().getInformationPresenter(sourceViewer);
-			provider = htmlPresenter.getInformationProvider(IHTMLPartitions.SCRIPT);
-		}
-		else{
-			provider = super.getInformationProvider(sourceViewer, partitionType);
-		}
-		return provider;
-	}
-	
 	public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
 		LineStyleProvider[] providers = null;
-
-		if (partitionType == IHTMLPartitions.HTML_DEFAULT || partitionType == IHTMLPartitions.HTML_COMMENT || partitionType == IHTMLPartitions.HTML_DECLARATION) {
-			providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, IHTMLPartitions.HTML_DEFAULT);
-		}
-		else if (partitionType == IHTMLPartitions.SCRIPT || partitionType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT) {
-			providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, IHTMLPartitions.SCRIPT);
-		}
-		else if (partitionType == ICSSPartitions.STYLE) {
-			providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, ICSSPartitions.STYLE);
+		if (IHTMLPartitions.SCRIPT.equals(partitionType) || IJSPPartitions.JSP_CONTENT_JAVASCRIPT.equals(partitionType) || IHTMLPartitions.SCRIPT_EVENTHANDLER.equals(partitionType)) {
+			providers = getJSDTHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, IHTMLPartitions.SCRIPT);
 		}
 		else{
 			providers = super.getLineStyleProviders(sourceViewer, partitionType);
@@ -218,17 +61,16 @@
 		return providers;
 	}
 	
-	public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
-		ITextHover hover = null;
-
-		if (contentType == IHTMLPartitions.HTML_DEFAULT || contentType == IHTMLPartitions.SCRIPT) {
-			// html and javascript regions
-			hover = getHTMLSourceViewerConfiguration().getTextHover(sourceViewer, contentType, stateMask);
+	/**
+	 * @see org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
+	 */
+	public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
+		if(contentType.equals(IHTMLPartitions.SCRIPT) || contentType.equals(IHTMLPartitions.SCRIPT_EVENTHANDLER)) {
+			IAutoEditStrategy[] strategies = new IAutoEditStrategy[1];
+			strategies[0] = new AutoEditStrategyForJs();
+			return strategies;
+		} else {
+			return super.getAutoEditStrategies(sourceViewer, contentType);
 		}
-		else {
-			hover = super.getTextHover(sourceViewer, contentType);
-		}
-	
-		return hover;
 	}
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.pde.prefs
index fc522bb..262b0ab 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.pde.prefs
@@ -1,16 +1,28 @@
-#Mon Apr 17 02:01:33 EDT 2006
+#Fri Feb 27 12:45:35 EST 2009
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
 compilers.incompatible-environment=0
 compilers.p.build=0
 compilers.p.deprecated=1
+compilers.p.discouraged-class=1
 compilers.p.illegal-att-value=0
+compilers.p.internal=1
+compilers.p.missing-packages=2
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=2
+compilers.p.missing-version-require-bundle=2
 compilers.p.no-required-att=0
 compilers.p.not-externalized-att=0
 compilers.p.unknown-attribute=0
 compilers.p.unknown-class=0
 compilers.p.unknown-element=0
+compilers.p.unknown-identifier=1
 compilers.p.unknown-resource=0
 compilers.p.unresolved-ex-points=0
 compilers.p.unresolved-import=0
 compilers.p.unused-element-or-attribute=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
 compilers.use-project=true
 eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.jsdt.web.ui/META-INF/MANIFEST.MF
index 99d245e..6fee1c7 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/META-INF/MANIFEST.MF
@@ -2,11 +2,11 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name.0
 Bundle-SymbolicName: org.eclipse.wst.jsdt.web.ui; singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.0.302.qualifier
 Bundle-Activator: org.eclipse.wst.jsdt.web.ui.internal.JsUIPlugin
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.jsdt.web.ui,
+Export-Package: org.eclipse.wst.jsdt.web.ui;x-internal:=true,
  org.eclipse.wst.jsdt.web.ui.internal;x-internal:=true,
  org.eclipse.wst.jsdt.web.ui.internal.autoedit;x-internal:=true,
  org.eclipse.wst.jsdt.web.ui.internal.contentassist;x-internal:=true,
@@ -23,27 +23,31 @@
  org.eclipse.wst.jsdt.web.ui.internal.taginfo;x-internal:=true,
  org.eclipse.wst.jsdt.web.ui.internal.text;x-internal:=true,
  org.eclipse.wst.jsdt.web.ui.views.contentoutline
-Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.0.400,1.1.0)",
- org.eclipse.wst.jsdt.web.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.debug.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.search;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ltk.core.refactoring;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- com.ibm.icu;bundle-version="[3.8.1,4.0.0)",
- org.eclipse.wst.jsdt.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.wst.jsdt.ui;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.wst.html.ui;bundle-version="[1.0.300,1.1.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.200,1.2.0)",
- org.eclipse.wst.jsdt.manipulation;bundle-version="[1.0.0,2.0.0)"
-Eclipse-LazyStart: true
+Import-Package: com.ibm.icu.util; version="3.8",
+ com.ibm.icu.text; version="3.8",
+ org.eclipse.core.filesystem,
+ org.eclipse.ui.views.contentoutline
+Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.workbench;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.sse.ui;bundle-version="[1.2.0,1.3.0)",
+ org.eclipse.wst.xml.ui;bundle-version="[1.1.100,1.2.0)",
+ org.eclipse.wst.jsdt.web.core;bundle-version="[1.0.300,2.0.0)",
+ org.eclipse.wst.css.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.debug.core;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.search;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ltk.core.refactoring;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.common.uriresolver;bundle-version="[1.1.300,1.2.0)",
+ org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.jsdt.core;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.wst.jsdt.ui;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.wst.html.ui;bundle-version="[1.0.500,1.1.0)",
+ org.eclipse.wst.html.core;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.wst.jsdt.manipulation;bundle-version="[1.0.200,2.0.0)"
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-ActivationPolicy: lazy
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/about.html b/bundles/org.eclipse.wst.jsdt.web.ui/about.html
new file mode 100644
index 0000000..4602330
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+ 
+<p>June 2, 2006</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise 
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;).  A copy of the EPL is available 
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content.  Check the Redistributor's license that was 
+provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/build.properties b/bundles/org.eclipse.wst.jsdt.web.ui/build.properties
index d6eb746..01667d8 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/build.properties
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/build.properties
@@ -1,6 +1,17 @@
+###############################################################################
+# Copyright (c) 2007, 2009 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
 source.. = src/
 bin.includes = META-INF/,\
                .,\
+               icons/,\
                plugin.properties,\
-               plugin.xml
-src.includes = build.properties
+               plugin.xml,\
+               about.html
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/icons/eye_icon.gif b/bundles/org.eclipse.wst.jsdt.web.ui/icons/eye_icon.gif
new file mode 100644
index 0000000..078398e
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/icons/eye_icon.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/icons/full/elcl16/javaassist_co.gif b/bundles/org.eclipse.wst.jsdt.web.ui/icons/full/elcl16/javaassist_co.gif
new file mode 100644
index 0000000..e9a6bd9
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/icons/full/elcl16/javaassist_co.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/plugin.properties b/bundles/org.eclipse.wst.jsdt.web.ui/plugin.properties
index ee6c00d..09d199d 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/plugin.properties
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
+# Copyright (c) 2000, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -9,13 +9,10 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 
-Bundle-Vendor.0 = Eclipse.org
+Bundle-Vendor.0 = Eclipse Web Tools Platform
 Bundle-Name.0 = JSDT Web Support UI
-target.name.0 = JavaScirpt Source
-target.name.1 = JavaScirpt Event Source
-hyperlinkDetector.name.0 = Java Element HyperLink Detector
-hyperlinkDetector.name.1 = Java Element HyperLink Detector
-menu.label.0 = Declerations
+hyperlinkDetector.name.0 = JavaScript Element
+menu.label.0 = Declarations
 action.tooltip.0 = Working Set
 action.label.0 = Working Set
 action.label.1 = Hierarchy
@@ -23,7 +20,7 @@
 action.label.2 = Project
 action.tooltip.2 = Project
 action.label.3 = Workspace
-action.tooltip.3 = 
+action.tooltip.3 = Declarations
 menu.label.1 = References
 action.label.4 = Working Set
 action.tooltip.4 = Working Set
@@ -66,7 +63,5 @@
 renameParticipant.name.1 = JSDT Web Rename Participant
 renameParticipant.name.2 = JSDT Web Rename Participant
 renameParticipant.name.3 = JSDT Web Rename Participant
-menu.label.5 = Web Development Tools
-action.label.21 = Add JavaScript Support
 queryParticipant.name.0 = JavaScript Query Participant
-hyperlinkDetector.name.2 = JSDT HyperLink Detector
\ No newline at end of file
+javaScriptProposals = JavaScript Proposals
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/plugin.xml b/bundles/org.eclipse.wst.jsdt.web.ui/plugin.xml
index d44e576..604fd98 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/plugin.xml
@@ -3,23 +3,12 @@
 <plugin>
 
  	<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
- 	
- 		<!--
- 		<sourceViewerConfiguration
-			class="org.eclipse.wst.jsdt.web.ui.StructuredTextViewerConfigurationJSDT"
-			target="org.eclipse.wst.html.core.htmlsource.source" />
-			
-		-->
-		
  		<contentOutlineConfiguration
 			class="org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline.JsContentOutlineConfig"
-			target="org.eclipse.wst.html.core.htmlsource.source" />		
-		<provisionalConfiguration
-			type="contentassistprocessor"
-			class="org.eclipse.wst.jsdt.web.ui.internal.contentassist.JSDTContentAssistant"
-			target="org.eclipse.wst.html.SCRIPT,org.eclipse.wst.html.SCRIPT.EVENTHANDLER" />
-	
-		
+			target="org.eclipse.wst.html.core.htmlsource.source" />	
+		<sourceViewerConfiguration
+			class="org.eclipse.wst.jsdt.web.ui.StructuredTextViewerConfigurationJSDT"
+			target="org.eclipse.wst.html.core.htmlsource.source" />	
 		<provisionalConfiguration
 			type="linestyleprovider"
 			class="org.eclipse.wst.jsdt.web.ui.internal.style.java.LineStyleProviderForJSDT"
@@ -27,12 +16,6 @@
 		<documentationTextHover
 			class="org.eclipse.wst.jsdt.web.ui.internal.taginfo.JSDTHoverProcessor"
 			target="org.eclipse.wst.html.SCRIPT,org.eclipse.wst.html.SCRIPT.EVENTHANDLER" />
-	<!-- Not sure on information provider extension -->
-		<provisionalConfiguration
-			type="informationpresenter"
-			class="org.eclipse.wst.jsdt.web.ui.internal.taginfo.JSDTInformationProvider"
-			target="org.eclipse.wst.html.SCRIPT,org.eclipse.wst.html.SCRIPT.EVENTHANDLER" />
-
 		<provisionalConfiguration
 			type="characterpairmatcher"
 			class="org.eclipse.wst.jsdt.web.ui.internal.text.JsDocumentRegionEdgeMatcher"
@@ -42,75 +25,32 @@
 			class="org.eclipse.wst.jsdt.web.ui.internal.autoedit.AutoEditStrategyForJs"
 			target="org.eclipse.wst.html.SCRIPT,org.eclipse.wst.html.SCRIPT.EVENTHANDLER" />
 		<provisionalConfiguration
+			type="org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor"
+			class="org.eclipse.wst.jsdt.web.ui.internal.java.search.JsFindOccurrencesProcessor"
+			target="org.eclipse.wst.html.SCRIPT,org.eclipse.wst.html.SCRIPT.EVENTHANDLER" />
+		<provisionalConfiguration
 			type="slaveformattingstrategy"
 			class="org.eclipse.wst.jsdt.web.ui.internal.format.FormattingStrategyJSDT"
 			target="org.eclipse.wst.html.SCRIPT" />
-		<!--
-		<provisionalConfiguration
-			type="hyperlinkdetector"
-			class="org.eclipse.wst.jsdt.web.ui.internal.hyperlink.JSDTHyperlinkDetector"
-			target="org.eclipse.wst.html.SCRIPT" />
-			
-		-->
-	</extension>
-	
-	<extension
-		point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
-		<hyperlinkDetector
-			class="org.eclipse.wst.jsdt.web.ui.internal.hyperlink.JSDTHyperlinkDetector"
-			id="org.eclipse.wst.jsdt.web.ui.internal.hyperlink.JSDTHyperlinkDetector"
-			name="%hyperlinkDetector.name.2"
-			targetId="org.eclipse.wst.html.core.htmlsource">
-		</hyperlinkDetector>
-		
-   </extension>
-	
-	
-	
-	<extension point = "org.eclipse.wst.sse.ui.extendedEditorActions">
-		<editorContribution 
-            targetID="com.ibm.sse.editor.StructuredTextEditor" 
-            id="com.ibm.sse.editor.extendedActions2"> 
-         <action 
-               popupmenuPath="group.add" 
-               label="Preferences2" 
-               class="com.ibm.sse.editor.preferences.ui.EditStructuredTextEditorPreferencesAction" 
-               id="com.ibm.sse.editor.preferences.ui.EditStructuredTextEditorPreferencesAction2"> 
-         </action> 
-      </editorContribution> 
-		
-	
-	</extension>
-	<extension
-		point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTargets">
-		<target
-			id="org.eclipse.wst.html.SCRIPT"
-			name="%target.name.0">
-		</target>
-	</extension>
-	
-	<extension
-		point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTargets">
-		<target
-			id="org.eclipse.wst.html.SCRIPT.EVENTHANDLER"
-			name="%target.name.1">
-		</target>
-	</extension>
+	</extension>		
 	
 	 <extension
          point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
-      <hyperlinkDetector
+      <hyperlinkDetector 
             class="org.eclipse.wst.jsdt.web.ui.internal.hyperlink.JSDTHyperlinkDetector"
-            id="org.eclipse.wst.jsdt.web.ui.internal.hyperlink.script.JSPJavaHyperlinkDetector"
+            id="org.eclipse.wst.jsdt.web.ui.JSDTHyperlinkDetector.SCRIPT"
             name="%hyperlinkDetector.name.0"
-            targetId="org.eclipse.wst.html.SCRIPT">
-      </hyperlinkDetector>
+            targetId="org.eclipse.wst.html.SCRIPT"/>
       <hyperlinkDetector
             class="org.eclipse.wst.jsdt.web.ui.internal.hyperlink.JSDTHyperlinkDetector"
-            id="org.eclipse.wst.jsdt.web.ui.internal.hyperlink.script.event.JSPJavaHyperlinkDetector"
-            name="%hyperlinkDetector.name.1"
-            targetId="org.eclipse.wst.html.SCRIPT.EVENTHANDLER">
-      </hyperlinkDetector>  
+            id="org.eclipse.wst.jsdt.web.ui.JSDTHyperlinkDetector.SCRIPT.events"
+            name="%hyperlinkDetector.name.0"
+            targetId="org.eclipse.wst.html.SCRIPT.EVENTHANDLER"/>  
+      <hyperlinkDetector
+			class="org.eclipse.wst.jsdt.web.ui.internal.hyperlink.JSDTHyperlinkDetector"
+			id="org.eclipse.wst.jsdt.web.ui.JSDTHyperlinkDetector.HTML"
+			name="%hyperlinkDetector.name.0"
+			targetId="org.eclipse.wst.html.core.htmlsource"/>
    </extension>
   
   
@@ -120,7 +60,7 @@
       <objectContribution
             objectClass="org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode"
             id="org.eclipse.wst.jsdt.web.ui.JavaActions">
-            <!-- Declerations Search Menu -->
+            <!-- Declarations Search Menu -->
             <menu
                 id="org.eclipse.wst.jsdt.web.declerations"
          		label="%menu.label.0"
@@ -374,14 +314,16 @@
 		<validator
 			scope="total"
 			class="org.eclipse.wst.jsdt.web.core.internal.validation.JsValidator"
-			id="org.eclipse.wst.jsdt.web.jspsourcevalidator">
+			id="org.eclipse.wst.jsdt.web.jssourcevalidator">
 			<contentTypeIdentifier id="org.eclipse.wst.html.core.htmlsource">
-				<partitionType id="org.eclipse.wst.html.SCRIPT"></partitionType>
-				<partitionType id="org.eclipse.wst.html.SCRIPT.EVENTHANDLER"></partitionType>
+				<partitionType id="org.eclipse.wst.html.SCRIPT"/>
+				<partitionType id="org.eclipse.wst.html.SCRIPT.EVENTHANDLER"/>
+			</contentTypeIdentifier>
+			<contentTypeIdentifier id="org.eclipse.jst.jsp.core.jspsource">
+				<partitionType id="org.eclipse.wst.html.SCRIPT"/>
+				<partitionType id="org.eclipse.wst.html.SCRIPT.EVENTHANDLER"/>
 			</contentTypeIdentifier>
 		</validator>
-
-		
 	</extension>
 	
 	<!--======================================================================================-->
@@ -665,7 +607,7 @@
 					</iterate>
 				</with>
 				<with variable="element">
-					<instanceof value="org.eclipse.wst.jsdt.core.IMethod" />
+					<instanceof value="org.eclipse.wst.jsdt.core.IFunction" />
 
 				</with>
 			</enablement>
@@ -689,36 +631,46 @@
 		</renameParticipant>
 
 	  </extension>
+
+	  <!--
   <extension point="org.eclipse.wst.jsdt.ui.JsGlobalScopeUIInitializer">
      <JsGlobalScopeUIInitializer
      	id="org.eclipse.wst.jsdt.launching.WebProject"
      	class="org.eclipse.wst.jsdt.web.ui.WebProjectJsGlobalScopeUIInitializer">
      </JsGlobalScopeUIInitializer>
    </extension>
+-->
 
-
+  	 <!--
   	 <extension
          point="org.eclipse.ui.popupMenus">
   		<objectContribution
             objectClass="org.eclipse.core.resources.IProject"
             adaptable="true"
             id="org.eclipse.wst.jsdt.web.ui.jsdtSetup">
-            <menu
-               label="%menu.label.5"
-               id="org.eclipse.wst.jsdt.web.ui.project.tools">
-            <separator
-               name="group0">
-            </separator>
-         </menu>
+       	 <visibility>
+        	<not>
+	        	<or>
+		            <objectState 
+			            name="projectNature" 
+			            value="org.eclipse.wst.jsdt.core.jsNature"/>
+			        <objectState
+			        	name="open"
+			        	value="false"/>
+	            </or>
+            </not>
+       	 </visibility>
          <action
             class="org.eclipse.wst.jsdt.web.ui.SetupProjectsWizzard"
             label="%action.label.21"
-            menubarPath="org.eclipse.wst.jsdt.web.ui.project.tools/group0"
+            menubarPath="org.eclipse.ui.projectConfigure/additions"
             enablesFor="+"
             id="org.eclipse.wst.jsdt.internal.web.ui.convertProjects">
       	</action>
    		</objectContribution>
    </extension> 
+-->
+
   	 <!-- Uncomment for Standalone + HTML as seperate options -->
   	 <!--
   	 <extension
@@ -737,4 +689,47 @@
    		</objectContribution>
    </extension>  
    -->
+ <extension point="org.eclipse.wst.sse.ui.completionProposal">
+  <proposalCategory
+      id="org.eclipse.wst.jsdt.web.ui.ContentAssistProposals"
+      name="%javaScriptProposals"
+      icon="icons/full/elcl16/javaassist_co.gif">
+  </proposalCategory>
+  <proposalComputer
+      activate="true"
+      categoryId="org.eclipse.wst.jsdt.web.ui.ContentAssistProposals"
+      class="org.eclipse.wst.jsdt.web.ui.internal.contentassist.JSDTContentAssistant"
+      id="org.eclipse.wst.jsdt.web.ui.ContentAssistProposals">
+     <contentType
+        id="org.eclipse.jst.jsp.core.jspsource">
+      <partitionType
+          id="org.eclipse.wst.html.SCRIPT">
+      </partitionType>
+            <partitionType
+          id="org.eclipse.wst.html.SCRIPT.EVENTHANDLER">
+      </partitionType>
+    </contentType>
+     <contentType
+        id="org.eclipse.wst.html.core.htmlsource">
+      <partitionType
+          id="org.eclipse.wst.html.SCRIPT">
+      </partitionType>
+            <partitionType
+          id="org.eclipse.wst.html.SCRIPT.EVENTHANDLER">
+      </partitionType>
+    </contentType>
+  </proposalComputer>
+</extension>
+<extension point="org.eclipse.wst.sse.ui.characterPairing">
+	<inserter class="org.eclipse.wst.jsdt.web.ui.internal.text.JsCharacterPairInserter" id="org.eclipse.wst.jsdt.web.ui.inserter">
+  <contentTypeIdentifier
+        id="org.eclipse.wst.html.core.htmlsource"
+        partitions="org.eclipse.wst.html.SCRIPT, org.eclipse.wst.html.SCRIPT.EVENTHANDLER">
+  </contentTypeIdentifier>
+  <contentTypeIdentifier
+        id="org.eclipse.jst.jsp.core.jspsource"
+        partitions="org.eclipse.wst.html.SCRIPT, org.eclipse.wst.html.SCRIPT.EVENTHANDLER">
+  </contentTypeIdentifier>
+	</inserter>
+</extension>
 </plugin>
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/Messages.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/Messages.java
index 086f679..3c7655f 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/Messages.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/Messages.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -7,6 +17,13 @@
 import java.util.ResourceBundle;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author childsb
  *
  */
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/SetupProjectsWizzard.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/SetupProjectsWizzard.java
index a92cc20..298210c 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/SetupProjectsWizzard.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/SetupProjectsWizzard.java
@@ -1,91 +1,219 @@
-/**
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
  * 
- */
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
 package org.eclipse.wst.jsdt.web.ui;
 
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
 import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.preference.PreferenceDialog;
 import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IActionDelegate;
 import org.eclipse.ui.IObjectActionDelegate;
 import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.jsdt.core.IClasspathEntry;
-import org.eclipse.wst.jsdt.core.JavaCore;
-import org.eclipse.wst.jsdt.core.JavaModelException;
-import org.eclipse.wst.jsdt.internal.core.JavaProject;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.ui.progress.IProgressService;
+import org.eclipse.wst.jsdt.core.IIncludePathEntry;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.JavaScriptCore;
+import org.eclipse.wst.jsdt.core.JavaScriptModelException;
+import org.eclipse.wst.jsdt.web.core.internal.Logger;
 import org.eclipse.wst.jsdt.web.core.internal.project.JsWebNature;
+import org.eclipse.wst.jsdt.web.ui.internal.JsUIPlugin;
 
 /**
- * @author childsb
- *
+ * Not API
  */
 public class SetupProjectsWizzard implements IObjectActionDelegate, IActionDelegate {
-	
+	IWorkbenchPart fPart;
 	Object[] fTarget;
 
-	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
-		//throw new UnimplementedException("setActivePart(IAction action, IWorkbenchPart targetPart)");
+	private void doInstall(IProject project, final boolean openProperties, IProgressMonitor monitor) {
+		boolean configured = false;
+		JsWebNature nature = new JsWebNature(project, monitor);
+		try {
+			boolean hadBasicNature = JsWebNature.hasNature(project);
+
+			nature.configure();
+
+			if (!hadBasicNature) {
+				/*
+				 * No nature before, so no existing build path. Define the
+				 * project itself as an include folder.
+				 */
+				IJavaScriptProject jp = JavaScriptCore.create(project);
+				IIncludePathEntry[] oldEntries = null;
+				try {
+					oldEntries = jp.getRawIncludepath();
+				}
+				catch (JavaScriptModelException ex1) {
+					Logger.log(Logger.ERROR_DEBUG, null, ex1);
+				}
+				
+				IPath projectPath = project.getFullPath();
+				IIncludePathEntry projectPathEntry = JavaScriptCore.newSourceEntry(projectPath);
+				
+				if (! Arrays.asList(oldEntries).contains(projectPathEntry)) {
+					IIncludePathEntry[] newEntries = new IIncludePathEntry[oldEntries.length + 1];
+					System.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);
+					
+					newEntries[oldEntries.length] = projectPathEntry;
+					jp.setRawIncludepath(newEntries, monitor);
+				}
+			}
+			configured = true;
+		}
+		catch (CoreException ex) {
+			Logger.logException(ex);
+		}
+
+		if (configured && openProperties) {
+			showPropertiesOn(project, monitor);
+		}
+	}
+	
+	private void doUninstall(IProject project, IProgressMonitor monitor) {
+		JsWebNature nature = new JsWebNature(project, monitor);
+		try {
+			nature.deconfigure();
+		} catch (CoreException ex) {
+			Logger.logException(ex);
+		}
+	}
+
+	private void install(final IProject project, final boolean openProperties) {
+		IProgressService service = null;
+		if (fPart != null) {
+			service = (IProgressService) fPart.getSite().getService(IProgressService.class);
+		}
+		if (service == null) {
+			doInstall(project, openProperties, null);
+		}
+		else {
+			IRunnableWithProgress runnable = new IRunnableWithProgress() {
+				public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+					doInstall(project, openProperties, monitor);
+				}
+			};
+			try {
+				service.run(false, false, runnable);
+			}
+			catch (InvocationTargetException e) {
+				Logger.logException(e);
+			}
+			catch (InterruptedException e) {
+				Logger.logException(e);
+			}
+		}
 	}
 
 	public void run(IAction action) {
-		if(fTarget==null) return;
-		
-		for(int i=0;i<fTarget.length;i++) {
-			if(fTarget[i] instanceof IProject) {
-				IProject project = (IProject)fTarget[i];
-				
-					if(!JsWebNature.hasNature(project)) {
-						JsWebNature nature = new JsWebNature(project,null);
-						try {
-							nature.configure();
-							
-						} catch (CoreException ex) {
-							// TODO Auto-generated catch block
-							ex.printStackTrace();
-						}
-					}else {
-						JavaProject jp = (JavaProject)JavaCore.create(project);
-						IClasspathEntry[] rawClasspath = null;
-						try {
-							rawClasspath = jp.getRawClasspath();
-						} catch (JavaModelException ex1) {
-							// TODO Auto-generated catch block
-							ex1.printStackTrace();
-						}
-						
-						
-						/* see if project has web cp entry and if it does leave */
-						for(int k = 0;rawClasspath!=null && k<rawClasspath.length;k++) {
-							if(rawClasspath[k].getPath().equals(JsWebNature.VIRTUAL_BROWSER_CLASSPATH)) {
-								return;
-							}
-						}
-						JsWebNature nature = new JsWebNature(project,null);
-						try {
-							nature.configure();
-							
-						} catch (CoreException ex) {
-							// TODO Auto-generated catch block
-							ex.printStackTrace();
+		if (fTarget == null)
+			return;
+
+		for (int i = 0; i < fTarget.length; i++) {
+			if (fTarget[i] instanceof IResource) {
+				final IProject project = ((IResource) fTarget[i]).getProject();
+
+				if (!JsWebNature.hasNature(project)) {
+					/* Doesn't have nature, do a full install. */
+					install(project, i == fTarget.length - 1);
+				}
+				else {
+					/*
+					 * Has nature, check for browser library on include path
+					 * and setup if not found.
+					 */
+					IJavaScriptProject jp = JavaScriptCore.create(project);
+					IIncludePathEntry[] rawClasspath = null;
+					try {
+						rawClasspath = jp.getRawIncludepath();
+					}
+					catch (JavaScriptModelException ex1) {
+						Logger.log(Logger.ERROR_DEBUG, null, ex1);
+					}
+
+					boolean browserFound = false;
+					for (int k = 0; rawClasspath != null && !browserFound && k < rawClasspath.length; k++) {
+						if (rawClasspath[k].getPath().equals(JsWebNature.VIRTUAL_BROWSER_CLASSPATH)) {
+							browserFound = true;
 						}
 					}
-					
-				
+					if (!browserFound) {
+						install(project, false);
+					}
+				}
 			}
 		}
-		
+
 	}
 
 	public void selectionChanged(IAction action, ISelection selection) {
-		
-		if(selection instanceof StructuredSelection) {
-			fTarget = ((StructuredSelection)selection).toArray();
-		}else {
+		if (selection instanceof IStructuredSelection) {
+			fTarget = ((IStructuredSelection) selection).toArray();
+		}
+		else {
 			fTarget = null;
 		}
 	}
-	
 
+	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+		fPart = targetPart;
+	}
+
+	private void showPropertiesOn(final IProject project, final IProgressMonitor monitor) {
+		IExtension[] extensions = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.ui.propertyPages").getExtensions(); //$NON-NLS-1$
+		final List pageIds = new ArrayList(8);
+		for (int i = 0; i < extensions.length; i++) {
+			if (extensions[i].getNamespaceIdentifier().startsWith("org.eclipse.wst.jsdt.")) { //$NON-NLS-1$
+				IConfigurationElement[] configurationElements = extensions[i].getConfigurationElements();
+				for (int j = 0; j < configurationElements.length; j++) {
+					if ("page".equals(configurationElements[j].getName())) {
+						pageIds.add(configurationElements[j].getAttribute("id")); //$NON-NLS-1$
+					}
+				}
+			}
+		}
+		Shell shell = (Shell) fPart.getAdapter(Shell.class);
+		if (shell == null) {
+			IWorkbenchWindow activeWorkbenchWindow = JsUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
+			if (activeWorkbenchWindow != null)
+				shell = activeWorkbenchWindow.getShell();
+		}
+		final Shell finalShell = shell;
+		if (finalShell != null) {
+			finalShell.getDisplay().asyncExec(new Runnable() {
+				public void run() {
+					PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn(finalShell, project, "org.eclipse.wst.jsdt.ui.propertyPages.BuildPathsPropertyPage", (String[]) pageIds.toArray(new String[pageIds.size()]), null); //$NON-NLS-1$
+					if (dialog.open() == Window.CANCEL) {
+						doUninstall(project, monitor);
+					}
+				}
+			});
+		}
+	}
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/StructuredTextViewerConfigurationJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/StructuredTextViewerConfigurationJSDT.java
index 7b0288d..a1d8070 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/StructuredTextViewerConfigurationJSDT.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/StructuredTextViewerConfigurationJSDT.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,32 +10,20 @@
  *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.ITextDoubleClickStrategy;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.formatter.IContentFormatter;
-import org.eclipse.jface.text.formatter.IFormattingStrategy;
-import org.eclipse.jface.text.formatter.MultiPassContentFormatter;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.text.information.IInformationProvider;
 import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
 import org.eclipse.wst.html.core.text.IHTMLPartitions;
 import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
-import org.eclipse.wst.jsdt.web.ui.internal.autoedit.AutoEditStrategyForTabs;
-import org.eclipse.wst.jsdt.web.ui.internal.contentassist.JSDTContentAssistant;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
+import org.eclipse.wst.jsdt.web.ui.internal.autoedit.AutoEditStrategyForJs;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+* 
  * Configuration for a source viewer which shows Html and supports JSDT.
  * <p>
  * Clients can subclass and override just those methods which must be specific
@@ -46,26 +34,6 @@
  * @since 1.0
  */
 public class StructuredTextViewerConfigurationJSDT extends StructuredTextViewerConfigurationHTML {
-	/*
-	 * Extension point identifications for externalalized content providers
-	 * [Bradley Childs - childsb@us.ibm.com]
-	 */
-	public static final class externalTypeExtension {
-		public static final String AUTOEDIT_ID = "autoeditstrategy";
-		public static final String CONTENT_ASSIST = "contentassistprocessor";
-		public static final String CONTENT_FORMATER = "contentformater";
-		public static final String HOVER_ID = "texthover";
-		public static final String HYPERLINK_DETECTOR = "hyperlinkdetector";
-		public static final String HYPERLINK_DETECTOR_TARGETS = "hyperlinkdetector";
-		public static final String INFORMATIONPROVIDER_ID = "informationpresenter";
-	}
-	/*
-	 * One instance per configuration because not sourceviewer-specific and it's
-	 * a String array
-	 */
-	private String[] fConfiguredContentTypes;
-	private ILabelProvider fStatusLineLabelProvider;
-	
 	/**
 	 * Create new instance of StructuredTextViewerConfigurationHTML
 	 */
@@ -74,175 +42,16 @@
 		super();
 	}
 	
-	
-	public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
-		List allStrategies = new ArrayList(0);
-		Object externalAutoEditProvider = ExtendedConfigurationBuilder.getInstance().getConfiguration(externalTypeExtension.AUTOEDIT_ID, contentType);
-		if (externalAutoEditProvider != null) {
-			allStrategies.add(externalAutoEditProvider);
-		} else {
-			IAutoEditStrategy[] superStrategies = super.getAutoEditStrategies(sourceViewer, contentType);
-			for (int i = 0; i < superStrategies.length; i++) {
-				allStrategies.add(superStrategies[i]);
-			}
-		}
-		// be sure this is added last in list, so it has a change to modify
-		// previous results.
-		// add auto edit strategy that handles when tab key is pressed
-		allStrategies.add(new AutoEditStrategyForTabs());
-		return (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[allStrategies.size()]);
-	}
-	
-	
-	public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
-		if (fConfiguredContentTypes == null) {
-			fConfiguredContentTypes = super.getConfiguredContentTypes(sourceViewer);
-		}
-		return fConfiguredContentTypes;
-	}
-	
-	/* Content assist procesors are contributed by extension for SSE now */
-	
-	protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
-		
-		IContentAssistProcessor[] processors = null;
-
-		if (partitionType == IHTMLPartitions.SCRIPT) {
-			processors = new IContentAssistProcessor[]{new JSDTContentAssistant()};
-		}
-		else{
-			processors = super.getContentAssistProcessors(sourceViewer, partitionType);
-		}
-		
-		return processors;
-	}
-	
-	public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
-		final IContentFormatter formatter = super.getContentFormatter(sourceViewer);
-		/*
-		 * Check for any externally supported auto edit strategies from EP.
-		 * [Bradley Childs - childsb@us.ibm.com]
-		 */
-		String[] contentTypes = getConfiguredContentTypes(sourceViewer);
-		for (int i = 0; i < contentTypes.length; i++) {
-			IFormattingStrategy cf = (IFormattingStrategy) ExtendedConfigurationBuilder.getInstance().getConfiguration(externalTypeExtension.CONTENT_FORMATER, contentTypes[i]);
-			if (cf != null && formatter instanceof MultiPassContentFormatter) {
-				((MultiPassContentFormatter) formatter).setSlaveStrategy(cf, contentTypes[i]);
-			}
-		}
-		return formatter;
-	}
-	
-	
-	public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
-		return super.getDoubleClickStrategy(sourceViewer, contentType);
-	}
-	
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.editors.text.TextSourceViewerConfiguration#getHyperlinkDetectors(org.eclipse.jface.text.source.ISourceViewer)
+	/**
+	 * @see org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
 	 */
-	
-	public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
-		if (sourceViewer == null || !fPreferenceStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED)) {
-			return null;
-		}
-		List allDetectors = new ArrayList(0);
-		IHyperlinkDetector[] superDetectors = super.getHyperlinkDetectors(sourceViewer);
-		for (int m = 0; m < superDetectors.length; m++) {
-			IHyperlinkDetector detector = superDetectors[m];
-			if (!allDetectors.contains(detector)) {
-				allDetectors.add(detector);
-			}
-		}
-		/* Check for external HyperLink Detectors */
-		String[] contentTypes = getConfiguredContentTypes(sourceViewer);
-		for (int i = 0; i < contentTypes.length; i++) {
-			IHyperlinkDetector hl = (IHyperlinkDetector) ExtendedConfigurationBuilder.getInstance().getConfiguration(externalTypeExtension.HYPERLINK_DETECTOR, contentTypes[i]);
-			if (hl != null) {
-				allDetectors.add(hl);
-			}
-		}
-		return (IHyperlinkDetector[]) allDetectors.toArray(new IHyperlinkDetector[0]);
-	}
-	
-	
-	public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) {
-		return super.getIndentPrefixes(sourceViewer, contentType);
-	}
-	
-	
-	protected IInformationProvider getInformationProvider(ISourceViewer sourceViewer, String partitionType) {
-		IInformationProvider provider = null;
-		/*
-		 * IInformationProvider now provided by extension point [Bradley Childs -
-		 * childsb@us.ibm.com]
-		 */
-		Object externalInfoProvider = ExtendedConfigurationBuilder.getInstance().getConfiguration(externalTypeExtension.INFORMATIONPROVIDER_ID, partitionType);
-		if (externalInfoProvider != null) {
-			provider = (IInformationProvider) externalInfoProvider;
+	public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
+		if(contentType.equals(IHTMLPartitions.SCRIPT) || contentType.equals(IHTMLPartitions.SCRIPT_EVENTHANDLER)) {
+			IAutoEditStrategy[] strategies = new IAutoEditStrategy[1];
+			strategies[0] = new AutoEditStrategyForJs();
+			return strategies;
 		} else {
-			provider = super.getInformationProvider(sourceViewer, partitionType);
+			return super.getAutoEditStrategies(sourceViewer, contentType);
 		}
-		return provider;
-	}
-	
-	
-	public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
-		LineStyleProvider[] providers = super.getLineStyleProviders(sourceViewer, partitionType);
-		return providers;
-	}
-	
-	
-	public ILabelProvider getStatusLineLabelProvider(ISourceViewer sourceViewer) {
-		if (fStatusLineLabelProvider == null) {
-			fStatusLineLabelProvider = super.getStatusLineLabelProvider(sourceViewer);
-		}
-		return fStatusLineLabelProvider;
-	}
-	
-	
-	public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
-		ITextHover textHover = null;
-		// look for appropriate text hover processor to return based on
-		// content type and state mask
-		TextHoverManager manager = SSEUIPlugin.getDefault().getTextHoverManager();
-		TextHoverManager.TextHoverDescriptor[] hoverDescs = manager.getTextHovers();
-		int i = 0;
-		while (i < hoverDescs.length && textHover == null) {
-			if (hoverDescs[i].isEnabled() && EditorUtility.computeStateMask(hoverDescs[i].getModifierString()) == stateMask) {
-				String hoverType = hoverDescs[i].getId();
-				if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType)) {
-					/*
-					 * Check extension for TextHover providers [Bradley Childs -
-					 * childsb@us.ibm.com]
-					 */
-					Object externalHover = ExtendedConfigurationBuilder.getInstance().getConfiguration(externalTypeExtension.HOVER_ID, contentType);
-					if (externalHover != null) {
-						textHover = manager.createBestMatchHover((ITextHover) externalHover);
-					} else {
-						textHover = super.getTextHover(sourceViewer, contentType, stateMask);
-					}
-				} else if (TextHoverManager.DOCUMENTATION_HOVER.equalsIgnoreCase(hoverType)) {
-					/*
-					 * Check extension for TextHover providers [Bradley Childs -
-					 * childsb@us.ibm.com]
-					 */
-					Object externalHover = ExtendedConfigurationBuilder.getInstance().getConfiguration(externalTypeExtension.HOVER_ID, contentType);
-					if (externalHover != null) {
-						textHover = manager.createBestMatchHover((ITextHover) externalHover);
-					} else {
-						textHover = super.getTextHover(sourceViewer, contentType, stateMask);
-					}
-				}
-			}
-			i++;
-		}
-		// no appropriate text hovers found, try super
-		if (textHover == null) {
-			textHover = super.getTextHover(sourceViewer, contentType, stateMask);
-		}
-		return textHover;
 	}
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/WebProjectJsGlobalScopeUIInitializer.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/WebProjectJsGlobalScopeUIInitializer.java
index f0eb5a5..03aecce 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/WebProjectJsGlobalScopeUIInitializer.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/WebProjectJsGlobalScopeUIInitializer.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -5,18 +15,24 @@
 
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.jsdt.core.IJavaProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
 import org.eclipse.wst.jsdt.internal.ui.IJsGlobalScopeContainerInitializerExtension;
-
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author childsb
  *
  */
 public class WebProjectJsGlobalScopeUIInitializer implements IJsGlobalScopeContainerInitializerExtension{
 	/* (non-Javadoc)
-	 * @see org.eclipse.wst.jsdt.internal.ui.IJsGlobalScopeContainerInitialzerExtension#getImage(org.eclipse.core.runtime.IPath, java.lang.String, org.eclipse.wst.jsdt.core.IJavaProject)
+	 * @see org.eclipse.wst.jsdt.internal.ui.IJsGlobalScopeContainerInitialzerExtension#getImage(org.eclipse.core.runtime.IPath, java.lang.String, org.eclipse.wst.jsdt.core.IJavaScriptProject)
 	 */
-	public ImageDescriptor getImage(IPath containerPath, String element, IJavaProject project) {
+	public ImageDescriptor getImage(IPath containerPath, String element, IJavaScriptProject project) {
 		return ImageDescriptor.createFromFile(this.getClass(),"web1.JPG"); //$NON-NLS-1$
 	}
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubAction.java
index 4973731..560444c 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubAction.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubAction.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -13,14 +23,20 @@
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.IWorkbenchPartSite;
 import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.jsdt.core.ICompilationUnit;
-import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 import org.eclipse.wst.jsdt.core.IMember;
 import org.eclipse.wst.jsdt.internal.ui.actions.WorkbenchRunnableAdapter;
 import org.eclipse.wst.jsdt.internal.ui.util.ExceptionHandler;
 import org.eclipse.wst.jsdt.web.ui.views.contentoutline.JsJfaceNode;
-
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author childsb
  * 
  */
@@ -41,13 +57,13 @@
 	}
 	
 	public void run(IAction action) {
-		IJavaElement[] elements = JsElementActionProxy.getJsElementsFromSelection(selection);
+		IJavaScriptElement[] elements = JsElementActionProxy.getJsElementsFromSelection(selection);
 		if (elements == null || elements.length < 1) {
 			return;
 		}
-		IJavaElement parent = elements[0].getParent();
+		IJavaScriptElement parent = elements[0].getParent();
 		/* find the cu */
-		while (parent != null && !(parent instanceof ICompilationUnit)) {
+		while (parent != null && !(parent instanceof IJavaScriptUnit)) {
 			
 		}
 		if (parent != null) {
@@ -59,11 +75,11 @@
 			}
 			JsJfaceNode node[] = SimpleJSDTActionProxy.getJsJfaceNodesFromSelection(selection);
 			/* only should be one node */
-			run((ICompilationUnit) parent, (IMember[]) members.toArray(new IMember[members.size()]), node[0]);
+			run((IJavaScriptUnit) parent, (IMember[]) members.toArray(new IMember[members.size()]), node[0]);
 		}
 	}
 	
-	public void run(ICompilationUnit cu, IMember[] members, JsJfaceNode node) {
+	public void run(IJavaScriptUnit cu, IMember[] members, JsJfaceNode node) {
 		try {
 			AddJavaDocStubOperation op = new AddJavaDocStubOperation(members, node);
 			PlatformUI.getWorkbench().getProgressService().runInUI(PlatformUI.getWorkbench().getProgressService(), new WorkbenchRunnableAdapter(op, op.getScheduleRule()), op.getScheduleRule());
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubOperation.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubOperation.java
index 06df4ea..edde605 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubOperation.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubOperation.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -11,7 +21,7 @@
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.text.edits.MalformedTreeException;
 import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.wst.jsdt.core.ICompilationUnit;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
 import org.eclipse.wst.jsdt.core.IMember;
 import org.eclipse.wst.jsdt.web.core.javascript.DocumentChangeListenerToTextEdit;
 import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
@@ -21,8 +31,14 @@
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author childsb
  * 
  */
@@ -67,11 +83,11 @@
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @see org.eclipse.wst.jsdt.internal.corext.codemanipulation.AddJavaDocStubOperation#getDocument(org.eclipse.wst.jsdt.core.ICompilationUnit,
+	 * @see org.eclipse.wst.jsdt.internal.corext.codemanipulation.AddJavaDocStubOperation#getDocument(org.eclipse.wst.jsdt.core.IJavaScriptUnit,
 	 *      org.eclipse.core.runtime.IProgressMonitor)
 	 */
 	
-	protected IDocument getDocument(ICompilationUnit cu, IProgressMonitor monitor) throws CoreException {
+	protected IDocument getDocument(IJavaScriptUnit cu, IProgressMonitor monitor) throws CoreException {
 		return getJavaDocumentFromNode();
 	}
 	
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesAction.java
index d921f9b..28a4c70 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesAction.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesAction.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -5,9 +15,16 @@
 
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author childsb
  * 
  */
@@ -19,7 +36,7 @@
 	 */
 	
 	public Object[] getRunArgs(IAction action) {
-		IJavaElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
+		IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
 		if (elements != null && elements.length > 0) {
 			return new Object[] { elements[0] };
 		}
@@ -33,7 +50,7 @@
 	 */
 	
 	public Class[] getRunArgTypes() {
-		return new Class[] { IJavaElement.class };
+		return new Class[] { IJavaScriptElement.class };
 	}
 	
 	
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesInWorkingSetAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesInWorkingSetAction.java
index e80577a..0c8f424 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesInWorkingSetAction.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesInWorkingSetAction.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -6,9 +16,15 @@
 import java.lang.reflect.InvocationTargetException;
 
 import org.eclipse.jface.action.IAction;
-import org.eclipse.wst.jsdt.core.IJavaElement;
-
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author childsb
  * 
  */
@@ -17,11 +33,11 @@
 	public void run(IAction action) {
 		try {
 			Object handler = getActionHandler(action);
-			IJavaElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
+			IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
 			if (elements == null || elements.length == 0) {
 				return;
 			}
-			SimpleJSDTActionProxy.executeMethod(handler, "run", new Class[] { IJavaElement.class }, new Object[] { elements[0] }); //$NON-NLS-1$
+			SimpleJSDTActionProxy.executeMethod(handler, "run", new Class[] { IJavaScriptElement.class }, new Object[] { elements[0] }); //$NON-NLS-1$
 		} catch (IllegalArgumentException ex) {
 			// TODO Auto-generated catch block
 			ex.printStackTrace();
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/JsElementActionProxy.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/JsElementActionProxy.java
index 95ada0e..00771fa 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/JsElementActionProxy.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/JsElementActionProxy.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -9,41 +19,48 @@
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 import org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author childsb
  * 
  */
 public class JsElementActionProxy extends SimpleJSDTActionProxy {
 	/* Util method to get all the java elements in a selection */
-	public static IJavaElement[] getJsElementsFromSelection(ISelection selection) {
+	public static IJavaScriptElement[] getJsElementsFromSelection(ISelection selection) {
 		if (selection == null) {
-			return new IJavaElement[0];
+			return new IJavaScriptElement[0];
 		}
 		ArrayList elements = new ArrayList();
 		if (selection instanceof IStructuredSelection) {
 			Iterator itt = ((IStructuredSelection) selection).iterator();
 			while (itt.hasNext()) {
 				Object element = itt.next();
-				if (element instanceof IJavaElement) {
+				if (element instanceof IJavaScriptElement) {
 					elements.add(element);
 				}
 				if (element instanceof IJavaWebNode) {
 					elements.add(((IJavaWebNode) element).getJavaElement());
 				}
 			}
-			return (IJavaElement[]) elements.toArray(new IJavaElement[elements.size()]);
+			return (IJavaScriptElement[]) elements.toArray(new IJavaScriptElement[elements.size()]);
 		}
-		return new IJavaElement[0];
+		return new IJavaScriptElement[0];
 	}
 	
 	
 	public Object[] getRunArgs(IAction action) {
 		/*
 		 * Needs to return an array of IJavaElements. Since its one arg of type
-		 * IJavaElement[] need to put into an object array
+		 * IJavaScriptElement[] need to put into an object array
 		 */
 		return new Object[] { JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection()) };
 	}
@@ -55,6 +72,6 @@
 	 */
 	
 	public Class[] getRunArgTypes() {
-		return new Class[] { (new IJavaElement[0]).getClass() };
+		return new Class[] { (new IJavaScriptElement[0]).getClass() };
 	}
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/Messages.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/Messages.java
index 3998466..0bfa17b 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/Messages.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/Messages.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -5,8 +15,14 @@
 
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
-
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author childsb
  *
  */
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenCallHierarchyAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenCallHierarchyAction.java
index 560e6a3..06083a3 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenCallHierarchyAction.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenCallHierarchyAction.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -5,9 +15,16 @@
 
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author childsb
  * 
  */
@@ -20,10 +37,10 @@
 	 */
 	
 	public void selectionChanged(IAction action, ISelection selection) {
-		IJavaElement[] elements = JsElementActionProxy.getJsElementsFromSelection(selection);
+		IJavaScriptElement[] elements = JsElementActionProxy.getJsElementsFromSelection(selection);
 		/* Open call hierarchy needs to be disabled for TYPEs */
 		for (int i = 0; i < elements.length; i++) {
-			if (elements[i].getElementType() == IJavaElement.TYPE) {
+			if (elements[i].getElementType() == IJavaScriptElement.TYPE) {
 				action.setEnabled(false);
 				return;
 			}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenTypeHierarchy.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenTypeHierarchy.java
index cd85638..405a4c6 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenTypeHierarchy.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenTypeHierarchy.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -5,19 +15,25 @@
 
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.wst.jsdt.core.IJavaElement;
-
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author childsb
  * 
  */
 public class OpenTypeHierarchy extends JsElementActionProxy {
 	
 	public void selectionChanged(IAction action, ISelection selection) {
-		IJavaElement[] elements = JsElementActionProxy.getJsElementsFromSelection(selection);
+		IJavaScriptElement[] elements = JsElementActionProxy.getJsElementsFromSelection(selection);
 		/* Open call hierarchy needs to be disabled for TYPEs */
 		for (int i = 0; i < elements.length; i++) {
-			if (elements[i].getElementType() != IJavaElement.TYPE) {
+			if (elements[i].getElementType() != IJavaScriptElement.TYPE) {
 				action.setEnabled(false);
 				return;
 			}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowHistoryAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowHistoryAction.java
index deb2a67..678c02f 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowHistoryAction.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowHistoryAction.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -15,10 +25,16 @@
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.part.ISetSelectionTarget;
-import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 import org.eclipse.wst.jsdt.internal.ui.util.ExceptionHandler;
-
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author childsb
  * 
  */
@@ -28,8 +44,8 @@
 	 * 
 	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
 	 */
-	private IResource getHostResource(IJavaElement virtualElement) {
-		IProject project = virtualElement.getJavaProject().getProject();
+	private IResource getHostResource(IJavaScriptElement virtualElement) {
+		IProject project = virtualElement.getJavaScriptProject().getProject();
 		IPath path = new Path(virtualElement.getHostPath().getPath());
 		IResource host = project.getWorkspace().getRoot().findMember(path);
 		return host;
@@ -37,7 +53,7 @@
 	
 	
 	public void run(IAction action) {
-		IJavaElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
+		IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
 		if (elements == null || elements.length == 0) {
 			return;
 		}
@@ -65,7 +81,7 @@
 	
 	public void selectionChanged(IAction action, ISelection selection) {
 		setSelection(selection);
-		IJavaElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
+		IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
 		for (int i = 0; i < elements.length; i++) {
 			if (elements[i].isVirtual()) {
 				IResource resource = getHostResource(elements[i]);
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInNavigatorAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInNavigatorAction.java
index bd1a2c7..628b942 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInNavigatorAction.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInNavigatorAction.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -15,10 +25,16 @@
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.part.ISetSelectionTarget;
-import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 import org.eclipse.wst.jsdt.internal.ui.util.ExceptionHandler;
-
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author childsb
  * 
  */
@@ -28,8 +44,8 @@
 	 * 
 	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
 	 */
-	private IResource getHostResource(IJavaElement virtualElement) {
-		IProject project = virtualElement.getJavaProject().getProject();
+	private IResource getHostResource(IJavaScriptElement virtualElement) {
+		IProject project = virtualElement.getJavaScriptProject().getProject();
 		IPath path = new Path(virtualElement.getHostPath().getPath());
 		IResource host = project.getWorkspace().getRoot().findMember(path);
 		return host;
@@ -37,7 +53,7 @@
 	
 	
 	public void run(IAction action) {
-		IJavaElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
+		IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
 		if (elements == null || elements.length == 0) {
 			return;
 		}
@@ -65,7 +81,7 @@
 	
 	public void selectionChanged(IAction action, ISelection selection) {
 		setSelection(selection);
-		IJavaElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
+		IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
 		for (int i = 0; i < elements.length; i++) {
 			if (elements[i].isVirtual()) {
 				IResource resource = getHostResource(elements[i]);
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInScriptExplorerAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInScriptExplorerAction.java
index 0f44ff1..799ea1f 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInScriptExplorerAction.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInScriptExplorerAction.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -11,10 +21,17 @@
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.ui.part.ISetSelectionTarget;
-import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 import org.eclipse.wst.jsdt.internal.ui.packageview.PackageExplorerPart;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author childsb
  * 
  */
@@ -24,8 +41,8 @@
 	 * 
 	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
 	 */
-	private IResource getHostResource(IJavaElement virtualElement) {
-		IProject project = virtualElement.getJavaProject().getProject();
+	private IResource getHostResource(IJavaScriptElement virtualElement) {
+		IProject project = virtualElement.getJavaScriptProject().getProject();
 		IPath path = new Path(virtualElement.getHostPath().getPath());
 		IResource host = project.getWorkspace().getRoot().findMember(path);
 		return host;
@@ -38,7 +55,7 @@
 	 */
 	
 	public Object[] getRunArgs(IAction action) {
-		IJavaElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
+		IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
 		if (elements != null && elements.length > 0) {
 			return new Object[] { elements[0] };
 		}
@@ -52,12 +69,12 @@
 	 */
 	
 	public Class[] getRunArgTypes() {
-		return new Class[] { IJavaElement.class };
+		return new Class[] { IJavaScriptElement.class };
 	}
 	
 	
 	public void run(IAction action) {
-		IJavaElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
+		IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
 		if (elements == null || elements.length == 0) {
 			return;
 		}
@@ -90,7 +107,7 @@
 	
 	public void selectionChanged(IAction action, ISelection selection) {
 		setSelection(selection);
-		IJavaElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
+		IJavaScriptElement elements[] = JsElementActionProxy.getJsElementsFromSelection(getCurrentSelection());
 		for (int i = 0; i < elements.length; i++) {
 			if (elements[i].isVirtual()) {
 				IResource resource = getHostResource(elements[i]);
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SimpleJSDTActionProxy.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SimpleJSDTActionProxy.java
index 00f64d4..3d24b70 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SimpleJSDTActionProxy.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SimpleJSDTActionProxy.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -18,6 +28,13 @@
 import org.eclipse.wst.jsdt.web.ui.views.contentoutline.JsJfaceNode;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author childsb
  * 
  */
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SourceActionsAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SourceActionsAction.java
index a3e70ba..75815ea 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SourceActionsAction.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SourceActionsAction.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -9,6 +19,13 @@
 import org.eclipse.ui.IWorkbenchPart;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author childsb
  * 
  */
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/StandardEditorActionsAction.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/StandardEditorActionsAction.java
index d6fceeb..8677ee4 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/StandardEditorActionsAction.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/StandardEditorActionsAction.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -16,7 +26,7 @@
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IObjectActionDelegate;
 import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 import org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode;
 import org.eclipse.wst.jsdt.web.ui.views.contentoutline.JsJfaceNode;
 import org.eclipse.wst.sse.core.StructuredModelManager;
@@ -25,6 +35,13 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author childsb
  * 
  */
@@ -131,7 +148,7 @@
 			Iterator itt = ((IStructuredSelection) selection).iterator();
 			while (itt.hasNext()) {
 				Object element = itt.next();
-				if (element instanceof IJavaElement) {
+				if (element instanceof IJavaScriptElement) {
 					elements.add(element);
 				}
 				if (element instanceof IJavaWebNode) {
@@ -148,7 +165,6 @@
 		if (nodes == null || nodes.length == 0) {
 			return;
 		}
-		StringBuffer text = new StringBuffer();
 		int startOfPaste = -1;
 		IStructuredDocument doc = null;
 		/* Figure out where to paste the content */
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/messages.properties b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/messages.properties
index 237ac6b..c89b761 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/messages.properties
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/messages.properties
@@ -1,3 +1,13 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
 StandardEditorActionsAction.8=Error in Standard Editor Action : 
 StandardEditorActionsAction.9=Insert Text 
 StandardEditorActionsAction.10=before
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionConstantsJs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionConstantsJs.java
index a615e20..7d1af51 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionConstantsJs.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionConstantsJs.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,8 +9,14 @@
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.internal;
-
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author pavery
  */
 public interface IActionConstantsJs {
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionDefinitionIdsJs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionDefinitionIdsJs.java
index 74d8c19..9161681 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionDefinitionIdsJs.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionDefinitionIdsJs.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,6 +13,13 @@
 import org.eclipse.wst.jsdt.ui.actions.IJavaEditorActionDefinitionIds;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author pavery
  */
 public interface IActionDefinitionIdsJs {
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JSPUIPluginResources.properties b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JSPUIPluginResources.properties
index 85cfe32..2cb5d27 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JSPUIPluginResources.properties
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JSPUIPluginResources.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
+# Copyright (c) 2004, 2007 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIMessages.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIMessages.java
index 580fc89..fbd9cf8 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIMessages.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIMessages.java
@@ -1,5 +1,5 @@
 /**********************************************************************
- * Copyright (c) 2005 IBM Corporation and others. All rights reserved.   This
+ * Copyright (c) 2005, 2007 IBM Corporation and others. All rights reserved.   This
  * program and the accompanying materials are made available under the terms of
  * the Eclipse Public License v1.0 which accompanies this distribution, and is
  * available at http://www.eclipse.org/legal/epl-v10.html
@@ -15,9 +15,14 @@
 import org.eclipse.osgi.util.NLS;
 
 /**
- * Strings used by JSP UI
- * 
- * @plannedfor 1.0
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
+ 
  */
 public class JsUIMessages extends NLS {
 	public static String _ERROR_FILENAME_MUST_END_JSP;
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIPlugin.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIPlugin.java
index 56473ef..70b836d 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIPlugin.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIPlugin.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,13 +15,19 @@
 import org.eclipse.jface.text.templates.ContextTypeRegistry;
 import org.eclipse.jface.text.templates.persistence.TemplateStore;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.jsdt.internal.ui.JavaPlugin;
+import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
 import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistry;
 import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistryImpl;
+import org.osgi.framework.BundleContext;
 
 /**
- * The main plugin class to be used in the desktop.
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JsUIPlugin extends AbstractUIPlugin {
 	public final static String ID = "org.eclipse.wst.jsdt.web.ui"; //$NON-NLS-1$
 	protected static JsUIPlugin instance = null;
@@ -65,7 +71,7 @@
 // registry.addContextType(TemplateContextTypeIdsJSP.TAG);
 // registry.addContextType(TemplateContextTypeIdsJSP.ATTRIBUTE);
 // registry.addContextType(TemplateContextTypeIdsJSP.ATTRIBUTE_VALUE);
-			fContextTypeRegistry = JavaPlugin.getDefault().getCodeTemplateContextRegistry();
+			fContextTypeRegistry = JavaScriptPlugin.getDefault().getCodeTemplateContextRegistry();
 		}
 		return fContextTypeRegistry;
 	}
@@ -80,7 +86,7 @@
 // fTemplateStore = new ContributionTemplateStore(
 // getTemplateContextRegistry(), getPreferenceStore(),
 // JSPUIPreferenceNames.TEMPLATES_KEY);
-			JavaPlugin jp = JavaPlugin.getDefault();
+			JavaScriptPlugin jp = JavaScriptPlugin.getDefault();
 			fTemplateStore = jp.getTemplateStore();
 			try {
 				fTemplateStore.load();
@@ -90,4 +96,20 @@
 		}
 		return fTemplateStore;
 	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		instance = this;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		super.stop(context);
+		instance = null;
+	}
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/Logger.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/Logger.java
index 792cc6c..f79c751 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/Logger.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/Logger.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,10 +18,13 @@
 import com.ibm.icu.util.StringTokenizer;
 
 /**
- * Small convenience class to log messages to plugin's log file and also, if
- * desired, the console. This class should only be used by classes in this
- * plugin. Other plugins should make their own copy, with appropriate ID.
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class Logger {
 	public static final int ERROR = IStatus.ERROR; // 4
 	public static final int ERROR_DEBUG = 200 + Logger.ERROR;
@@ -150,4 +153,4 @@
 	public static void traceException(String category, Throwable exception) {
 		Logger._trace(category, exception.getMessage(), exception);
 	}
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForJs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForJs.java
index 70186b6..9c1f97c 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForJs.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForJs.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.internal.autoedit;
 
 import org.eclipse.core.resources.IProject;
@@ -9,14 +19,21 @@
 import org.eclipse.jface.text.IAutoEditStrategy;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.wst.html.core.text.IHTMLPartitions;
-import org.eclipse.wst.jsdt.core.IJavaProject;
-import org.eclipse.wst.jsdt.core.JavaCore;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.JavaScriptCore;
 import org.eclipse.wst.jsdt.internal.ui.text.java.JavaAutoIndentStrategy;
 import org.eclipse.wst.jsdt.internal.ui.text.java.SmartSemicolonAutoEditStrategy;
 import org.eclipse.wst.jsdt.internal.ui.text.javadoc.JavaDocAutoIndentStrategy;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+/**
+*
 
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class AutoEditStrategyForJs implements IAutoEditStrategy {
 	private IAutoEditStrategy[] fStrategies;
 	
@@ -36,15 +53,15 @@
 			return fStrategies;
 		}
 		String partitioning = IHTMLPartitions.SCRIPT;
-		fStrategies = new IAutoEditStrategy[] { new JavaDocAutoIndentStrategy(partitioning), new SmartSemicolonAutoEditStrategy(partitioning),
-				new JavaAutoIndentStrategy(partitioning, getJavaProject(document)) };
+		fStrategies = new IAutoEditStrategy[] { new SmartSemicolonAutoEditStrategy(partitioning),
+				new JavaAutoIndentStrategy(partitioning, getJavaProject(document), null), new JavaDocAutoIndentStrategy(partitioning) };
 		/* new AutoEditStrategyForTabs() */
 		return fStrategies;
 	}
 	
-	private IJavaProject getJavaProject(IDocument document) {
+	private IJavaScriptProject getJavaProject(IDocument document) {
 		IDOMModel model = null;
-		IJavaProject javaProject = null;
+		IJavaScriptProject javaProject = null;
 		try {
 			model = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(document);
 			String baseLocation = model.getBaseLocation();
@@ -55,7 +72,7 @@
 				project = root.getProject(filePath.segment(0));
 			}
 			if (project != null) {
-				javaProject = JavaCore.create(project);
+				javaProject = JavaScriptCore.create(project);
 			}
 		} finally {
 			if (model != null) {
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForTabs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForTabs.java
index 21cb26d..50ab442 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForTabs.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForTabs.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -31,8 +31,13 @@
 import org.eclipse.wst.jsdt.web.ui.internal.Logger;
 
 /**
- * AutoEditStrategy to handle characters inserted when Tab key is pressed
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class AutoEditStrategyForTabs implements IAutoEditStrategy {
 	private final String TAB_CHARACTER = "\t"; //$NON-NLS-1$
 	
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTCompletionProposal.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTCompletionProposal.java
index 26c7fd0..a42e3fd 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTCompletionProposal.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTCompletionProposal.java
@@ -1,20 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.internal.contentassist;
 
+import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
 import org.eclipse.jface.text.contentassist.IContextInformation;
 import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
 import org.eclipse.wst.jsdt.internal.ui.text.java.JavaCompletionProposal;
 import org.eclipse.wst.jsdt.internal.ui.text.java.LazyJavaCompletionProposal;
+import org.eclipse.wst.jsdt.internal.ui.text.java.LazyJavaTypeCompletionProposal;
 import org.eclipse.wst.jsdt.ui.text.java.IJavaCompletionProposal;
 
 /**
- * Implements IJavaCompletionProposal for use with JSPProposalCollector.
- * 
- * @plannedfor 1.0
- */
-// public class JSPCompletionProposal extends CustomCompletionProposal
-// implements
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JSDTCompletionProposal extends JavaCompletionProposal implements IJavaCompletionProposal {
 	/*
 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=124483
@@ -38,17 +52,32 @@
 	}
 	
 	/**
-	 * Sets cursor position after applying.
+	 * <p>Uses the wrapped proposal if its lazy</p>
 	 */
-	
 	public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
-		if (this.fJavaCompletionProposal instanceof LazyJavaCompletionProposal)
-		{
-			((LazyJavaCompletionProposal)this.fJavaCompletionProposal).apply(viewer.getDocument(), trigger, offset);
+		if (this.fJavaCompletionProposal instanceof LazyJavaCompletionProposal) {
+			((LazyJavaCompletionProposal) this.fJavaCompletionProposal).apply(viewer, trigger, stateMask, offset);
 		}
-		super.apply(viewer, trigger, stateMask, offset);
+		else {
+			super.apply(viewer, trigger, stateMask, offset);
+		}
 	}
 	
+	/**
+	 * <p>Uses the wrapped proposal if its lazy</p>
+	 *
+	 * @return the selection after the proposal has been applied
+	 */
+	public Point getSelection(IDocument document) {
+		Point selection;
+		if (this.fJavaCompletionProposal instanceof LazyJavaCompletionProposal) {
+			selection = this.fJavaCompletionProposal.getSelection(document);
+		}
+		else {
+			selection = super.getSelection(document);
+		}
+		return selection;
+	}
 	
 	public String getAdditionalProposalInfo() {
 		String additionalInfo = super.getAdditionalProposalInfo();
@@ -66,4 +95,11 @@
 	final public void setJavaCompletionProposal(ICompletionProposal javaCompletionProposal) {
 		fJavaCompletionProposal = javaCompletionProposal;
 	}
+	
+	protected boolean isValidPrefix(String prefix) {
+		if (this.fJavaCompletionProposal instanceof LazyJavaTypeCompletionProposal) {
+			return ((LazyJavaTypeCompletionProposal) this.fJavaCompletionProposal).isValidTypePrefix(prefix);
+		}
+		return super.isValidPrefix(prefix);
+	}
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistant.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistant.java
index 25e088b..3e383b4 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistant.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistant.java
@@ -1,22 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.internal.contentassist;
 
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.List;
 import java.util.Vector;
 
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
-
 import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
 import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
 import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
+/**
+*
 
-public class JSDTContentAssistant extends AbstractContentAssistProcessor {
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JSDTContentAssistant extends AbstractContentAssistProcessor implements ICompletionProposalComputer {
 	private JSDTContentAssistantProcessor fContentAssistProcessor;
 	private JSDTTemplateAssistProcessor fTemplateAssistProcessor;
-	private JsTranslationAdapter fTranslationAdapter;
 	private JSDTHtmlCompletionProcessor fHhtmlcomp;
 	
 	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentPosition) {
@@ -31,6 +51,8 @@
 		/* add end script tag if needed */
 
 		/* --------- Content Assistant --------- */
+		if(theCollector==null) return new ICompletionProposal[0];
+		
 		getContentAssistProcessor().setProposalCollector(theCollector);
 		completionProposals = getContentAssistProcessor().computeCompletionProposals(viewer, documentPosition);
 		proposals.addAll(Arrays.asList(completionProposals));
@@ -62,11 +84,11 @@
 		try {
 			xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(viewer.getDocument());
 			IDOMDocument xmlDoc = xmlModel.getDocument();
-			if (fTranslationAdapter == null) {
-				fTranslationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
-			}
-			if (fTranslationAdapter != null) {
-				return fTranslationAdapter.getJSPTranslation(true);
+
+			JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
+			
+			if (translationAdapter != null) {
+				return translationAdapter.getJsTranslation(true);
 			}
 		} catch (Exception e) {
 			// TODO Auto-generated catch block
@@ -81,6 +103,7 @@
 	
 	protected JSDTProposalCollector getProposalCollector(ITextViewer viewer, int offset) {
 		IJsTranslation tran = getJSPTranslation(viewer, offset);
+		if(tran==null) return null;
 		return new JSDTProposalCollector(tran);
 	}
 	
@@ -90,4 +113,50 @@
 		}
 		return fTemplateAssistProcessor;
 	}
+
+	public void sessionStarted() {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public List computeCompletionProposals(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		Vector proposals = new Vector();
+		ICompletionProposal[] completionProposals;
+		ICompletionProposal endScript = getHtmlContentAssistProcessor().getEndScriptProposal(context.getViewer(), context.getInvocationOffset());
+		if(endScript!=null) {
+			return new ArrayList(0);
+			//proposals.add(endScript);
+		}
+		JSDTProposalCollector theCollector = getProposalCollector(context.getViewer(), context.getInvocationOffset());
+		/* add end script tag if needed */
+
+		/* --------- Content Assistant --------- */
+		if(theCollector==null) return new ArrayList(0);
+		
+		getContentAssistProcessor().setProposalCollector(theCollector);
+		completionProposals = getContentAssistProcessor().computeCompletionProposals(context.getViewer(), context.getInvocationOffset());
+		proposals.addAll(Arrays.asList(completionProposals));
+		/* HTML Proposals */
+		completionProposals = getHtmlContentAssistProcessor().computeCompletionProposals(context.getViewer(), context.getInvocationOffset());
+		proposals.addAll(Arrays.asList(completionProposals));
+		/* --------- template completions --------- */
+		getTemplateCompletionProcessor().setProposalCollector(theCollector);
+		completionProposals = getTemplateCompletionProcessor().computeCompletionProposals(context.getViewer(), context.getInvocationOffset());
+		proposals.addAll(Arrays.asList(completionProposals));
+		return proposals;
+	}
+
+	public List computeContextInformation(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		return Arrays.asList(computeContextInformation(context.getViewer(), context.getInvocationOffset()));
+	}
+
+	public void sessionEnded() {
+		fContentAssistProcessor = null;
+		fTemplateAssistProcessor = null;
+		fHhtmlcomp = null;
+	}
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistantProcessor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistantProcessor.java
index 50e8e0b..29b5e26 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistantProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistantProcessor.java
@@ -1,33 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.internal.contentassist;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.jsdt.core.ICompilationUnit;
-
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
 import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
 import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
 import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
 import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
 import org.osgi.framework.Bundle;
 
+/**
+ * Provisional API: This class/interface is part of an interim API that is
+ * still under development and expected to change significantly before
+ * reaching stability. It is being made available at this early stage to
+ * solicit feedback from pioneering adopters on the understanding that any
+ * code that uses this API will almost certainly be broken (repeatedly) as the
+ * API evolves.
+ * 
+ * This class is not intended to be subclassed.
+ */
 public class JSDTContentAssistantProcessor extends AbstractContentAssistProcessor {
-	private static final boolean DEBUG;
 	private static final String JSDT_CORE_PLUGIN_ID = "org.eclipse.wst.jsdt.core"; //$NON-NLS-1$
-	static {
-		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsptranslation"); //$NON-NLS-1$
-		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
-	}
+//	static {
+//		String value = Platform.getDebugOption("org.eclipse.wst.jsdt.web.core/debug/jsptranslation"); //$NON-NLS-1$
+//		//DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+//	}
 	protected String fErrorMessage = null;
 	protected int fJspSourcePosition, fJavaPosition;
 	private JSDTProposalCollector fProposalCollector;
-	private JsTranslationAdapter fTranslationAdapter = null;
-	protected StructuredTextViewer fViewer = null;
+	protected ITextViewer fViewer = null;
 	
 	public JSDTContentAssistantProcessor() {
 		super();
@@ -52,19 +68,16 @@
 		JSDTProposalCollector collector = null;
 		IDOMModel xmlModel = null;
 		try {
-			if (viewer instanceof StructuredTextViewer) {
-				fViewer = (StructuredTextViewer) viewer;
-			}
+			fViewer = viewer;
 			xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(fViewer.getDocument());
 			IDOMDocument xmlDoc = xmlModel.getDocument();
-			if (fTranslationAdapter == null) {
-				fTranslationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
-			}
-			if (fTranslationAdapter != null) {
-				IJsTranslation translation = fTranslationAdapter.getJSPTranslation(true);
+			JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
+			
+			if (translationAdapter != null) {
+				IJsTranslation translation = translationAdapter.getJsTranslation(true);
 				fJavaPosition = getDocumentPosition();
 				try {
-					ICompilationUnit cu = translation.getCompilationUnit();
+					IJavaScriptUnit cu = translation.getCompilationUnit();
 					// can't get java proposals w/out a compilation unit
 					// or without a valid position
 					if (cu == null || -1 == fJavaPosition) {
@@ -225,11 +238,6 @@
 		}
 	}
 	
-	
-	public void release() {
-		fTranslationAdapter = null;
-	}
-	
 	public void setProposalCollector(JSDTProposalCollector translation) {
 		this.fProposalCollector = translation;
 	}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContetAssistInvocationContext.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContetAssistInvocationContext.java
index f524a5d..dcd07a8 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContetAssistInvocationContext.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContetAssistInvocationContext.java
@@ -1,18 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.internal.contentassist;
 
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.wst.jsdt.ui.text.java.JavaContentAssistInvocationContext;
-
 import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
 import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+/**
+*
 
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JSDTContetAssistInvocationContext extends JavaContentAssistInvocationContext {
 	public static JSDTContetAssistInvocationContext getInstance(ITextViewer viewer, int offset, JSDTProposalCollector theCollector) {
-		IJsTranslation tran = JSDTContetAssistInvocationContext.getJSPTranslation(viewer);
+		JSDTContetAssistInvocationContext.getJSPTranslation(viewer);
 		return new JSDTContetAssistInvocationContext(viewer, offset, theCollector);
 	}
 	
@@ -25,7 +41,7 @@
 			IDOMDocument xmlDoc = xmlModel.getDocument();
 			JsTranslationAdapter fTranslationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
 			if (fTranslationAdapter != null) {
-				fTranslation = fTranslationAdapter.getJSPTranslation(true);
+				fTranslation = fTranslationAdapter.getJsTranslation(true);
 			}
 		} catch (Exception e) {
 			// TODO Auto-generated catch block
@@ -61,7 +77,7 @@
 	public IDocument getDocument() {
 		return viewer.getDocument();
 	}
-// public ICompilationUnit getCompilationUnit() {
+// public IJavaScriptUnit getCompilationUnit() {
 // return getJSPTranslation(viewer).getCompilationUnit();
 // }
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTHtmlCompletionProcessor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTHtmlCompletionProcessor.java
index f51a037..21727a6 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTHtmlCompletionProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTHtmlCompletionProcessor.java
@@ -1,9 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.internal.contentassist;
 import java.util.ArrayList;
 
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
-
 import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
 import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
 import org.eclipse.wst.sse.core.StructuredModelManager;
@@ -12,12 +21,13 @@
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 
 /**
- * 
- */
-/**
- * @author childsb
- *
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JSDTHtmlCompletionProcessor {
 	
 	public JSDTHtmlCompletionProcessor() {}
@@ -27,8 +37,7 @@
 	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
 		/* add </script if necisary */
 		ArrayList allProposals = new ArrayList();
-		IJsTranslation tran = getJSPTranslation(viewer);
-		int missingAtOffset = tran.getMissingTagStart();
+		getJSPTranslation(viewer);
 		
 		return (ICompletionProposal[])allProposals.toArray(new ICompletionProposal[allProposals.size()]);
 	}
@@ -37,6 +46,8 @@
 		/* add </script if necisary */
 	
 		IJsTranslation tran = getJSPTranslation(viewer);
+		if(tran==null) return null;
+		
 		int missingAtOffset = tran.getMissingTagStart();
 		
 		if(offset>=missingAtOffset&& missingAtOffset>-1) {
@@ -45,7 +56,6 @@
 			String text = "</script>"; //$NON-NLS-1$
 			
 			int startInTag = -1;
-			int replaceLength =0;
 			
 			for(int i=0;i<text.length() && allText.length()>offset-1;i++) {
 				if(allText.charAt(offset-1)==text.charAt(i)) {
@@ -79,7 +89,7 @@
 			JsTranslationAdapter fTranslationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
 			
 			if (fTranslationAdapter != null) {
-				return fTranslationAdapter.getJSPTranslation(true);
+				return fTranslationAdapter.getJsTranslation(true);
 			}
 		} catch (Exception e) {
 			// TODO Auto-generated catch block
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTProposalCollector.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTProposalCollector.java
index 6d5561f..c59550d 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTProposalCollector.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTProposalCollector.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.internal.contentassist;
 
 import java.util.ArrayList;
@@ -16,13 +26,13 @@
 
 
 /**
- * Passed into ICodeComplete#codeComplete(int offset, CompletionRequestor
- * requestor). Adapts IJavaCompletionProposals to JSPCompletion proposals. This
- * includes: - translating offsets - "fixing" up display strings - filtering
- * some unwanted proposals
- * 
- * @plannedfor 1.0
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JSDTProposalCollector extends CompletionProposalCollector {
 	static char[] getTypeTriggers() {
 		return CompletionProposalCollector.TYPE_TRIGGERS;
@@ -37,7 +47,7 @@
 // return fGeneratedFunctionNames;
 // }
 	public JSDTProposalCollector(IJsTranslation translation) {
-		super(translation.getCompilationUnit());
+		super(translation!=null?translation.getCompilationUnit():null);
 		if (translation == null) {
 			throw new IllegalArgumentException("JSPTranslation cannot be null"); //$NON-NLS-1$
 		}
@@ -50,21 +60,17 @@
 	 * 
 	 * @param proposal
 	 * @param completion
-	 * @param currentCursorOffset
 	 * @return
 	 */
-	private int calculatePositionAfter(CompletionProposal proposal, String completion, int currentCursorOffset) {
-		// calculate cursor position after
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=118398
-		// int positionAfter = currentCursorOffset+completion.length();
+	private int calculatePositionAfter(CompletionProposal proposal, String completion) {
 		int positionAfter = completion.length();
 		int kind = proposal.getKind();
 		// may need better logic here...
 		// put cursor inside parenthesis if there's params
 		// only checking for any kind of declaration
 		if (kind == CompletionProposal.ANONYMOUS_CLASS_DECLARATION || kind == CompletionProposal.METHOD_DECLARATION || kind == CompletionProposal.POTENTIAL_METHOD_DECLARATION || kind == CompletionProposal.METHOD_REF) {
-			String[] params = Signature.getParameterTypes(String.valueOf(proposal.getSignature()));
-			if (completion.length() > 0 && params.length > 0) {
+			int paramCount = Signature.getParameterCount(proposal.getSignature());
+			if (completion.length() > 0 && paramCount > 0) {
 				positionAfter--;
 			}
 		}
@@ -162,7 +168,7 @@
 		int length = proposal.getReplaceEnd() - offset;
 		// translate offset from Java > JSP
 		// cursor position after must be calculated
-		int positionAfter = calculatePositionAfter(proposal, completion, offset);
+		int positionAfter = calculatePositionAfter(proposal, completion);
 		// from java proposal
 		IJavaCompletionProposal javaProposal = super.createJavaCompletionProposal(proposal);
 		proposal.getDeclarationSignature();
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTTemplateAssistProcessor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTTemplateAssistProcessor.java
index 11c5226..1f98178 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTTemplateAssistProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTTemplateAssistProcessor.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.internal.contentassist;
 
 import java.util.List;
@@ -9,7 +19,14 @@
 import org.eclipse.wst.jsdt.internal.ui.text.java.TemplateCompletionProposalComputer;
 import org.eclipse.wst.jsdt.ui.text.java.JavaContentAssistInvocationContext;
 import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
+/**
+*
 
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JSDTTemplateAssistProcessor {
 	TemplateCompletionProposalComputer fJavaTemplateCompletion;
 	JSDTProposalCollector fProposalCollector;
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/Messages.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/Messages.java
index b6d635a..d59e216 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/Messages.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/Messages.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -5,11 +15,14 @@
 
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
-
 /**
- * @author childsb
- *
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class Messages {
 	private static final String BUNDLE_NAME = "org.eclipse.wst.jsdt.web.ui.internal.contentassist.messages"; //$NON-NLS-1$
 
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/messages.properties b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/messages.properties
index e3b0f1f..fbdf808 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/messages.properties
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/messages.properties
@@ -1,3 +1,13 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
 JSDTHtmlCompletionProcessor.1=<> end with </script>
 JSDTHtmlCompletionProcessor.4=Close the script tag.
 JSDTHtmlCompletionProcessor.5=<> end with </script>
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/derived/SingleCharReader.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/derived/SingleCharReader.java
index 2baaff7..e893d44 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/derived/SingleCharReader.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/derived/SingleCharReader.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,11 +14,14 @@
 import java.io.IOException;
 import java.io.Reader;
 
-/*
- * Copied from org.eclipse.wst.jsdt.internal.corext.javadoc.SingleCharReader.
- * Modification was made to fix statement unnecessarily nested within else
- * clause warning in read(..).
- */
+/**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public abstract class SingleCharReader extends Reader {
 	/**
 	 * Gets the content as a String
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/ActionContributorJSP.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/ActionContributorJSP.java
index 9bbc4ea..7a9f5d9 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/ActionContributorJSP.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/ActionContributorJSP.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -26,18 +26,13 @@
 import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants;
 
 /**
- * ActionContributorJSP
- * 
- * This class should not be used inside multi page editor's
- * ActionBarContributor, since cascaded init() call from the
- * ActionBarContributor will causes exception and it leads to lose whole
- * toolbars.
- * 
- * Instead, use SourcePageActionContributor for source page contributor of multi
- * page editor.
- * 
- * Note that this class is still valid for single page editor.
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class ActionContributorJSP extends ActionContributorHTML {
 	private static final String[] EDITOR_IDS = { "org.eclipse.wst.html.core.htmlsource.source", "org.eclipse.wst.sse.ui.StructuredTextEditor" }; //$NON-NLS-1$ //$NON-NLS-2$
 	private RetargetTextEditorAction moveElementAction = null;
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/IHelpContextIds.java
index 0ca92e2..c4418fb 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/IHelpContextIds.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/IHelpContextIds.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,12 +13,13 @@
 import org.eclipse.wst.jsdt.web.ui.internal.JsUIPlugin;
 
 /**
- * Help context ids for the JSP Source Editor.
- * <p>
- * This interface contains constants only; it is not intended to be implemented.
- * </p>
- * 
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public interface IHelpContextIds {
 	// JSP Fragment Property Page
 	public static final String JSP_FRAGMENT_HELPID = IHelpContextIds.PREFIX + "jspf1000"; //$NON-NLS-1$
@@ -41,4 +42,4 @@
 	public static final String JSP_REFACTORRENAME_HELPID = IHelpContextIds.PREFIX + "jspr0010"; //$NON-NLS-1$
 	// org.eclipse.wst.jsdt.web.ui.
 	public static final String PREFIX = JsUIPlugin.ID + "."; //$NON-NLS-1$
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/format/FormattingStrategyJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/format/FormattingStrategyJSDT.java
index fa82d6b..6ff69e0 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/format/FormattingStrategyJSDT.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/format/FormattingStrategyJSDT.java
@@ -1,7 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.internal.format;
 
 import java.util.LinkedList;
 import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IWorkspaceRoot;
@@ -12,29 +24,47 @@
 import org.eclipse.jface.text.Document;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IDocumentPartitioningListener;
+import org.eclipse.jface.text.Region;
 import org.eclipse.jface.text.TextUtilities;
 import org.eclipse.jface.text.TypedPosition;
 import org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy;
 import org.eclipse.jface.text.formatter.FormattingContextProperties;
 import org.eclipse.jface.text.formatter.IFormattingContext;
+import org.eclipse.text.edits.ReplaceEdit;
 import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.jsdt.core.ICompilationUnit;
-import org.eclipse.wst.jsdt.core.IJavaProject;
-import org.eclipse.wst.jsdt.core.JavaCore;
-import org.eclipse.wst.jsdt.core.JavaModelException;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.JavaScriptCore;
 import org.eclipse.wst.jsdt.core.formatter.CodeFormatter;
 import org.eclipse.wst.jsdt.internal.corext.util.CodeFormatterUtil;
 import org.eclipse.wst.jsdt.internal.formatter.DefaultCodeFormatter;
-
 import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
+import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslator;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslation;
 import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
+import org.eclipse.wst.jsdt.web.core.javascript.JsTranslator;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+/**
+*
 
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class FormattingStrategyJSDT extends ContextBasedFormattingStrategy {
+	private static final String XML_COMMENT_START = "<!--"; //$NON-NLS-1$
+	private static final String XML_COMMENT_END = "//-->"; //$NON-NLS-1$
+	
+	/** matches on <!-- at beginning of script region */
+	private static final Pattern START_PATTERN = Pattern.compile("(\\A(\\s*<!--))");
+	
+	/** matches on //--> or --> at end of script region */
+	private static final Pattern END_PATTERN = Pattern.compile("(((//\\s*)?-->\\s*)\\z)");
+	
 	private static final int regionStartIndentLevel = 1;
 	/** Documents to be formatted by this strategy */
 	private final LinkedList fDocuments = new LinkedList();
@@ -74,33 +104,66 @@
 		final IStructuredDocument document = (IStructuredDocument) fDocuments.removeFirst();
 		final TypedPosition partition = (TypedPosition) fPartitions.removeFirst();
 		if (document != null) {
+			String lineDelim = TextUtilities.getDefaultLineDelimiter(document);
 			try {
-				// JSPTranslationUtil translationUtil = new
-				// JSPTranslationUtil(document);
-				IJsTranslation translation = getTranslation(document);
-				ICompilationUnit cu = translation.getCompilationUnit();
-				if (cu != null) {
-					String cuSource = cu.getSource();
-					int javaStart = partition.getOffset();
-					int javaLength = partition.getLength();
-					TextEdit edit = CodeFormatterUtil.format2(CodeFormatter.K_COMPILATION_UNIT, cuSource, javaStart, javaLength, startIndentLevel, TextUtilities.getDefaultLineDelimiter(document), getPreferences());
-					IDocument doc = new Document(translation.getJsText());
-					/* error formating the code so abort */
-					if(edit==null) return;
-					edit.apply(doc);
-					String replaceText = TextUtilities.getDefaultLineDelimiter(document) + getIndentationString(getPreferences(), startIndentLevel) + (doc.get(edit.getOffset(), edit.getLength())).trim() + TextUtilities.getDefaultLineDelimiter(document);
-					/*
-					 * this is necisary since SSE disconnects document
-					 * partitioners.. Because of that, the replaced regions are
-					 * considered 'partitionless' when the linestyle provider
-					 * trys to color them.
-					 * 
-					 */
-					document.replaceText(document, partition.getOffset(), partition.getLength(), replaceText);
-				//	document.addDocumentPartitioningListener(new ModelIrritant(document));
+				//get the JS text from the document (not translated)
+				String jsTextNotTranslated = document.get(partition.getOffset(), partition.getLength());
+				
+				//deal with getting the JS text and unwrapping it from any <!-- //--> statements
+				String preText = "";
+				String postText = lineDelim;
+
+				//find start comment tag
+				Matcher matcher = START_PATTERN.matcher(jsTextNotTranslated);
+				if(matcher.find()) {
+					jsTextNotTranslated = matcher.replaceAll("");
+					preText = lineDelim + XML_COMMENT_START;
 				}
+				
+				//find end tag
+				matcher = END_PATTERN.matcher(jsTextNotTranslated);
+				if(matcher.find()) {
+					jsTextNotTranslated = matcher.replaceAll("");
+					postText = lineDelim + XML_COMMENT_END + lineDelim;
+				}
+				
+				//replace the text in the document with the none-translated JS text but without HTML leading and trailing comments
+				TextEdit replaceEdit = new ReplaceEdit(partition.getOffset(), partition.getLength(), jsTextNotTranslated);
+				replaceEdit.apply(document);
+				int jsRegionLength = jsTextNotTranslated.length();
+				
+				//translate the updated document
+				IJsTranslation translation = getTranslation(document);
+				String jsTextTranslated = translation.getJsText();
+				
+				//format the text translated text
+				TextEdit edit = CodeFormatterUtil.format2(CodeFormatter.K_JAVASCRIPT_UNIT, jsTextTranslated, partition.getOffset(), jsRegionLength, startIndentLevel, lineDelim, getPreferences());
+				IDocument jsDoc = new Document(jsTextTranslated);
+				
+				//Undo the text replacements done by the translator so that it could build a CU for the JS region
+				if(translation instanceof JsTranslation) {
+					IJsTranslator translator = ((JsTranslation)translation).getTranslator();
+					
+					if(translator instanceof JsTranslator) {
+						Region[] regions = ((JsTranslator)translator).getGeneratedRanges();
+						//for each generated range, replace it with the original text
+						for(int r = 0; r < regions.length; ++r) {
+							jsDoc.replace(regions[r].getOffset(), regions[r].getLength(),
+									document.get(regions[r].getOffset(), regions[r].getLength()));
+						}
+					}
+				}
+				
+				/* error formating the code so abort */
+				if(edit==null) return;
+				edit.apply(jsDoc);
+				String replaceText = lineDelim + getIndentationString(getPreferences(), startIndentLevel) + (jsDoc.get(edit.getOffset(), edit.getLength())).trim();
+				
+				//apply edit to html doc using the formated translated text and the possible leading and trailing html comments
+				replaceText = preText + replaceText + postText;
+				replaceEdit = new ReplaceEdit(partition.getOffset(), jsRegionLength, replaceText);
+				replaceEdit.apply(document);
 			} catch (BadLocationException e) {
-			} catch (JavaModelException e) {
 			}
 		}
 	}
@@ -138,7 +201,7 @@
 	}
 	
 	private Map getProjectOptions(IDocument baseDocument) {
-		IJavaProject javaProject = null;
+		IJavaScriptProject javaProject = null;
 		IDOMModel xmlModel = null;
 		Map options = null;
 		try {
@@ -151,7 +214,7 @@
 				project = root.getProject(filePath.segment(0));
 			}
 			if (project != null) {
-				javaProject = JavaCore.create(project);
+				javaProject = JavaScriptCore.create(project);
 			}
 		} finally {
 			if (xmlModel != null) {
@@ -172,7 +235,7 @@
 			IDOMDocument xmlDoc = xmlModel.getDocument();
 			JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
 			if (translationAdapter != null) {
-				tran = translationAdapter.getJSPTranslation(true);
+				tran = translationAdapter.getJsTranslation(true);
 			}
 		} finally {
 			if (xmlModel != null) {
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileEditorInput.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileEditorInput.java
index 929cd56..018c424 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileEditorInput.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileEditorInput.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.internal.hyperlink;
 
 import java.io.File;
@@ -13,9 +23,13 @@
 import org.eclipse.ui.model.IWorkbenchAdapter;
 
 /**
- * EditorInput for external files. Copied from
- * org.eclipse.ui.internal.editors.text.JavaFileEditorInput
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 class ExternalFileEditorInput implements IEditorInput, ILocationProvider {
 	// copies of this class exist in:
 	// org.eclipse.wst.xml.ui.internal.hyperlink
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileHyperlink.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileHyperlink.java
index 07b5068..d8905ef 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileHyperlink.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileHyperlink.java
@@ -1,20 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.internal.hyperlink;
 
 import java.io.File;
 
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.ui.IEditorDescriptor;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
 import org.eclipse.wst.jsdt.web.ui.internal.Logger;
 
 /**
- * Hyperlink for external files.
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 class ExternalFileHyperlink implements IHyperlink {
 	// copies of this class exist in:
 	// org.eclipse.wst.xml.ui.internal.hyperlink
@@ -33,7 +50,11 @@
 	}
 	
 	public String getHyperlinkText() {
-		return null;
+		String path = fHyperlinkFile.getPath();
+		if (path.length() > 60) {
+			path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
+		}
+		return NLS.bind(HTMLUIMessages.Open, path);
 	}
 	
 	public String getTypeLabel() {
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlink.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlink.java
index 90ca387..b0c8096 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlink.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlink.java
@@ -1,20 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.internal.hyperlink;
 
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.hyperlink.IHyperlink;
 import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.jsdt.core.IJavaElement;
-import org.eclipse.wst.jsdt.ui.JavaUI;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.internal.ui.actions.ActionMessages;
+import org.eclipse.wst.jsdt.ui.JavaScriptUI;
 import org.eclipse.wst.jsdt.web.ui.internal.Logger;
-
 /**
- * Hyperlink for JSP Java elements
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 class JSDTHyperlink implements IHyperlink {
-	private IJavaElement fElement;
+	private IJavaScriptElement fElement;
 	private IRegion fRegion;
 	
-	public JSDTHyperlink(IRegion region, IJavaElement element) {
+	public JSDTHyperlink(IRegion region, IJavaScriptElement element) {
 		fRegion = region;
 		fElement = element;
 	}
@@ -34,8 +49,7 @@
 	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
 	 */
 	public String getHyperlinkText() {
-		// TODO Auto-generated method stub
-		return null;
+		return ActionMessages.OpenAction_declaration_label;
 	}
 	
 	/*
@@ -55,9 +69,9 @@
 	 */
 	public void open() {
 		try {
-			IEditorPart editor = JavaUI.openInEditor(fElement);
+			IEditorPart editor = JavaScriptUI.openInEditor(fElement);
 			if (editor != null) {
-				JavaUI.revealInEditor(editor, fElement);
+				JavaScriptUI.revealInEditor(editor, fElement);
 			}
 		} catch (Exception e) {
 			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlinkDetector.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlinkDetector.java
index 50e64d6..2193098 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlinkDetector.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlinkDetector.java
@@ -1,12 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.internal.hyperlink;
 
 import java.util.ArrayList;
 import java.util.List;
 
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IRegion;
@@ -15,29 +25,33 @@
 import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;
 import org.eclipse.jface.text.hyperlink.IHyperlink;
 import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.ICompilationUnit;
 import org.eclipse.wst.jsdt.core.IField;
-import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
 import org.eclipse.wst.jsdt.core.ILocalVariable;
-import org.eclipse.wst.jsdt.core.IMethod;
 import org.eclipse.wst.jsdt.core.ISourceRange;
 import org.eclipse.wst.jsdt.core.ISourceReference;
-import org.eclipse.wst.jsdt.core.JavaModelException;
+import org.eclipse.wst.jsdt.core.JavaScriptModelException;
 import org.eclipse.wst.jsdt.internal.core.JavaElement;
 import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
 import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
 import org.eclipse.wst.jsdt.web.ui.internal.Logger;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-//import org.eclipse.wst.sse.core.internal.util.URIResolver;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 
 /**
- * Detects hyperlinks in JSP Java content
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JSDTHyperlinkDetector extends AbstractHyperlinkDetector {
-	private IHyperlink createHyperlink(IJavaElement element, IRegion region, IDocument document) {
+	private IHyperlink createHyperlink(IJavaScriptElement element, IRegion region, IDocument document) {
 		IHyperlink link = null;
 		if (region != null) {
 			// open local variable in the JSP file...
@@ -65,19 +79,19 @@
 				// get Java range, translate coordinate to JSP
 				try {
 					ISourceRange range = null;
-					IJsTranslation jspTranslation = getJSPTranslation(document);
+					IJsTranslation jspTranslation = getJsTranslation(document);
 					if (jspTranslation != null) {
 						// link to local variable definitions
 						if (element instanceof ILocalVariable) {
 							range = ((ILocalVariable) element).getNameRange();
-							IJavaElement unit=((ILocalVariable) element).getParent();
-							ICompilationUnit myUnit = jspTranslation.getCompilationUnit();
+							IJavaScriptElement unit=((ILocalVariable) element).getParent();
+							IJavaScriptUnit myUnit = jspTranslation.getCompilationUnit();
 							
-							while(!(unit instanceof ICompilationUnit || unit instanceof IClassFile || unit==null)) {
+							while(!(unit instanceof IJavaScriptUnit || unit instanceof IClassFile || unit==null)) {
 								unit = ((JavaElement) unit).getParent();
 							}
-							if(unit instanceof ICompilationUnit) {
-								ICompilationUnit cu = (ICompilationUnit)unit;
+							if(unit instanceof IJavaScriptUnit) {
+								IJavaScriptUnit cu = (IJavaScriptUnit)unit;
 								if(cu!=myUnit) {
 									file = getFile(cu.getPath().toString());
 									if(file==null) {
@@ -96,15 +110,15 @@
 							
 						}
 						// linking to fields of the same compilation unit
-						else if (element.getElementType() == IJavaElement.FIELD) {
-							Object cu = ((IField) element).getCompilationUnit();
+						else if (element.getElementType() == IJavaScriptElement.FIELD) {
+							Object cu = ((IField) element).getJavaScriptUnit();
 							if (cu != null && cu.equals(jspTranslation.getCompilationUnit())) {
 								range = ((ISourceReference) element).getSourceRange();
 							}
 						}
 						// linking to methods of the same compilation unit
-						else if (element.getElementType() == IJavaElement.METHOD) {
-							Object cu = ((IMethod) element).getCompilationUnit();
+						else if (element.getElementType() == IJavaScriptElement.METHOD) {
+							Object cu = ((IFunction) element).getJavaScriptUnit();
 							if (cu != null && cu.equals(jspTranslation.getCompilationUnit())) {
 								range = ((ISourceReference) element).getSourceRange();
 							}
@@ -121,7 +135,7 @@
 							link = new ExternalFileHyperlink(region,outsidePath.toFile());
 						}
 					}
-				} catch (JavaModelException jme) {
+				} catch (JavaScriptModelException jme) {
 					Logger.log(Logger.WARNING_DEBUG, jme.getMessage(), jme);
 				}
 			}
@@ -142,18 +156,13 @@
 		List hyperlinks = new ArrayList(0);
 		if (region != null && textViewer != null) {
 			IDocument document = textViewer.getDocument();
-			// check and make sure this is a valid Java type
-			IJsTranslation jspTranslation = getJSPTranslation(document);
-			if (jspTranslation != null) {
-				// check if we are in JSP Java content
-				// check that we are not in indirect Java content (like
-				// included files)
-				// get Java elements
-				IJavaElement[] elements = jspTranslation.getElementsFromJsRange(region.getOffset(), region.getOffset() + region.getLength());
+			IJsTranslation jsTranslation = getJsTranslation(document);
+			if (jsTranslation != null) {
+				IJavaScriptElement[] elements = jsTranslation.getElementsFromJsRange(region.getOffset(), region.getOffset() + region.getLength());
 				if (elements != null && elements.length > 0) {
-					// create a JSPJavaHyperlink for each Java element
+					// create a hyperlink for each JavaScript element
 					for (int i = 0; i < elements.length; ++i) {
-						IJavaElement element = elements[i];
+						IJavaScriptElement element = elements[i];
 						// find hyperlink range for Java element
 						IRegion hyperlinkRegion = selectWord(document, region.getOffset());
 						IHyperlink link = createHyperlink(element, hyperlinkRegion, document);
@@ -181,11 +190,9 @@
 	private IFile getFile(String fileString) {
 		IFile file = null;
 		if (fileString != null) {
-			IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(new Path(fileString));
-			for (int i = 0; i < files.length && file == null; i++) {
-				if (files[i].exists()) {
-					file = files[i];
-				}
+			IResource resource  = ResourcesPlugin.getWorkspace().getRoot().findMember(fileString);
+			if(resource!=null && resource instanceof IFile) {
+				file = (IFile)resource;
 			}
 		}
 		return file;
@@ -196,7 +203,7 @@
 	 * 
 	 * @return JSPTranslation if one exists, null otherwise
 	 */
-	private IJsTranslation getJSPTranslation(IDocument document) {
+	private IJsTranslation getJsTranslation(IDocument document) {
 		IJsTranslation translation = null;
 		IDOMModel xmlModel = null;
 		try {
@@ -205,7 +212,7 @@
 				IDOMDocument xmlDoc = xmlModel.getDocument();
 				JsTranslationAdapter adapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
 				if (adapter != null) {
-					translation = adapter.getJSPTranslation(true);
+					translation = adapter.getJsTranslation(true);
 				}
 			}
 		} finally {
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/WorkspaceFileHyperlink.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/WorkspaceFileHyperlink.java
index 5093ad2..ea48fbb 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/WorkspaceFileHyperlink.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/WorkspaceFileHyperlink.java
@@ -1,20 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.internal.hyperlink;
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.ide.IDE;
 import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
 import org.eclipse.wst.jsdt.web.ui.internal.Logger;
 
-/**
- * Hyperlink for files within the workspace. (As long as there is an IFile, this
- * can be used) Opens the default editor for the file.
- */
 class WorkspaceFileHyperlink implements IHyperlink {
 	// copies of this class exist in:
 	// org.eclipse.wst.xml.ui.internal.hyperlink
@@ -45,8 +53,11 @@
 	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
 	 */
 	public String getHyperlinkText() {
-		// TODO Auto-generated method stub
-		return null;
+		String path = fFile.getFullPath().toString();
+		if (path.length() > 60) {
+			path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
+		}
+		return NLS.bind(HTMLUIMessages.Open, path);
 	}
 	
 	/*
@@ -66,7 +77,7 @@
 				IEditorPart editor = IDE.openEditor(page, fFile, true);
 				// highlight range in editor if possible
 				if (fHighlightRange != null && editor instanceof ITextEditor) {
-					((ITextEditor) editor).setHighlightRange(fHighlightRange.getOffset(), fHighlightRange.getLength(), true);
+					((ITextEditor) editor).selectAndReveal(fHighlightRange.getOffset(), fHighlightRange.getLength());
 				}
 			} catch (PartInitException pie) {
 				Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/XMLHyperlinkDetector.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/XMLHyperlinkDetector.java
index 02dcebf..bf603d0 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/XMLHyperlinkDetector.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/XMLHyperlinkDetector.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.internal.hyperlink;
 
 import java.io.File;
@@ -39,11 +49,13 @@
 import com.ibm.icu.util.StringTokenizer;
 
 /**
- * Detects hyperlinks in XML tags. Includes detection in DOCTYPE and attribute
- * values. Resolves references to schemas, dtds, etc using the Common URI
- * Resolver.
- * 
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class XMLHyperlinkDetector implements IHyperlinkDetector {
 	// copies of this class exist in:
 	// org.eclipse.wst.xml.ui.internal.hyperlink
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java
index b8afc1f..e165f7d 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -42,7 +42,7 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.actions.WorkspaceModifyOperation;
 import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 import org.eclipse.wst.jsdt.core.search.SearchDocument;
 import org.eclipse.wst.jsdt.core.search.SearchMatch;
 import org.eclipse.wst.jsdt.core.search.SearchRequestor;
@@ -54,9 +54,13 @@
 import org.eclipse.wst.sse.core.internal.encoding.CodedStreamCreator;
 
 /**
- * Creates document change(s) for an IJavaElement rename. Changes are created
- * for every type "match" in the workspace
- * 
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author pavery
  */
 public class BasicRefactorSearchRequestor extends SearchRequestor {
@@ -229,13 +233,13 @@
 	}
 	// end inner class RenameChange
 	/** The type being renamed (the old type) */
-	IJavaElement fElement = null;
+	IJavaScriptElement fElement = null;
 	/** The new name of the type being renamed */
 	private String fNewName = ""; //$NON-NLS-1$
 	/** maps a JSPSearchDocument path -> MultiTextEdit for the java file */
 	private HashMap fSearchDocPath2JavaEditMap = null;
 	
-	public BasicRefactorSearchRequestor(IJavaElement element, String newName) {
+	public BasicRefactorSearchRequestor(IJavaScriptElement element, String newName) {
 		this.fNewName = newName;
 		this.fElement = element;
 		this.fSearchDocPath2JavaEditMap = new HashMap();
@@ -322,7 +326,7 @@
 		return ""; //$NON-NLS-1$
 	}
 	
-	public IJavaElement getElement() {
+	public IJavaScriptElement getElement() {
 		return this.fElement;
 	}
 	
@@ -340,4 +344,4 @@
 	protected String getRenameText(JSDTSearchDocumentDelegate searchDoc, SearchMatch javaMatch) {
 		return getNewName();
 	}
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPJavaSelectionProvider.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPJavaSelectionProvider.java
index 9e5a20b..d671fcf 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPJavaSelectionProvider.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPJavaSelectionProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,18 +15,24 @@
 import org.eclipse.jface.text.ITextSelection;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.jsdt.core.IJavaElement;
-
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
 import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+/**
+*
 
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 class JSPJavaSelectionProvider {
-	static IJavaElement[] getSelection(ITextEditor textEditor) {
-		IJavaElement[] elements = null;
+	static IJavaScriptElement[] getSelection(ITextEditor textEditor) {
+		IJavaScriptElement[] elements = null;
 		IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
 		ISelection selection = textEditor.getSelectionProvider().getSelection();
 		if (selection instanceof ITextSelection) {
@@ -40,7 +46,7 @@
 					IDOMDocument xmlDoc = xmlModel.getDocument();
 					JsTranslationAdapter adapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
 					if (adapter != null) {
-						IJsTranslation translation = adapter.getJSPTranslation(true);
+						IJsTranslation translation = adapter.getJsTranslation(true);
 						elements = translation.getElementsFromJsRange(textSelection.getOffset(), textSelection.getOffset() + textSelection.getLength());
 					}
 				}
@@ -51,7 +57,7 @@
 			}
 		}
 		if (elements == null) {
-			elements = new IJavaElement[0];
+			elements = new IJavaScriptElement[0];
 		}
 		return elements;
 	}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameChange.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameChange.java
index 2fc34b1..447afce 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameChange.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameChange.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,16 +14,22 @@
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.ltk.core.refactoring.Change;
 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.wst.jsdt.core.IMethod;
+import org.eclipse.wst.jsdt.core.IFunction;
 import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchScope;
 import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
 import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author pavery
  */
 public class JSPMethodRenameChange extends Change {
-	public static Change[] createChangesFor(IMethod method, String newName) {
+	public static Change[] createChangesFor(IFunction method, String newName) {
 		JsSearchSupport support = JsSearchSupport.getInstance();
 		// should be handled by JSPIndexManager
 		// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3036
@@ -65,4 +71,4 @@
 		// pa_TODO return the "undo" change here
 		return null;
 	}
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameParticipant.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameParticipant.java
index 9dfd3ce..27f7ddb 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameParticipant.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameParticipant.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,17 +23,24 @@
 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
 import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
 import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
-import org.eclipse.wst.jsdt.core.IMethod;
-import org.eclipse.wst.jsdt.core.JavaModelException;
+import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.JavaScriptModelException;
 import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
 import org.eclipse.wst.jsdt.web.ui.internal.Logger;
 import org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author pavery
  */
 public class JSPMethodRenameParticipant extends RenameParticipant {
-	private IMethod fMethod = null;
+	private IFunction fMethod = null;
 	
 	/*
 	 * (non-Javadoc)
@@ -71,7 +78,7 @@
 		if (this.fMethod != null) {
 			try {
 				name = this.fMethod.getSource();
-			} catch (JavaModelException e) {
+			} catch (JavaScriptModelException e) {
 				Logger.logException(e);
 			}
 		}
@@ -83,12 +90,12 @@
 	 */
 	
 	protected boolean initialize(Object element) {
-		if (element instanceof IMethod) {
-			this.fMethod = (IMethod) element;
+		if (element instanceof IFunction) {
+			this.fMethod = (IFunction) element;
 			return true;
 		}else if (element instanceof IJavaWebNode) {
-			if(((IJavaWebNode)element).getJavaElement() instanceof IMethod) {
-				this.fMethod = (IMethod) ((IJavaWebNode)element).getJavaElement();
+			if(((IJavaWebNode)element).getJavaElement() instanceof IFunction) {
+				this.fMethod = (IFunction) ((IJavaWebNode)element).getJavaElement();
 				return true;
 			}
 		}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameRequestor.java
index 0a3817f..11e6833 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameRequestor.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameRequestor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,16 +12,22 @@
 
 import java.text.MessageFormat;
 
-import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 import org.eclipse.wst.jsdt.core.search.SearchMatch;
 import org.eclipse.wst.jsdt.web.core.javascript.search.JSDTSearchDocumentDelegate;
 import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author pavery
  */
 public class JSPMethodRenameRequestor extends BasicRefactorSearchRequestor {
-	public JSPMethodRenameRequestor(IJavaElement element, String newName) {
+	public JSPMethodRenameRequestor(IJavaScriptElement element, String newName) {
 		super(element, newName);
 	}
 	
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java
index 3a3fb28..0679a10 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,6 +23,13 @@
 import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * An action delegate that launches JDT move element wizard
  * 
  * Still relies heavily on internal API will change post 3.0 with public move
@@ -51,7 +58,7 @@
 	// eclipse 3.2M5
 	// public move support:
 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=61817
-	// IJavaElement[] elements = getSelectedElements();
+	// IJavaScriptElement[] elements = getSelectedElements();
 	// if (elements.length > 0) {
 	//
 	// // need to check if it's movable
@@ -90,7 +97,7 @@
 	// PlatformStatusLineUtil.clearStatusLine();
 	//
 	// }
-	// catch (JavaModelException e) {
+	// catch (JavaScriptModelException e) {
 	// Logger.logException(e);
 	// }
 	// }
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameChange.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameChange.java
index 59bad6a..8a8a378 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameChange.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameChange.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,8 +18,14 @@
 import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchScope;
 import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
 import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author pavery
  */
 public class JSPPackageRenameChange extends Change {
@@ -65,4 +71,4 @@
 		// TODO return the "undo" change here
 		return null;
 	}
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameParticipant.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameParticipant.java
index e34ef9a..161f73a 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameParticipant.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameParticipant.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -21,6 +21,13 @@
 import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * Remember to change the plugin.xml file if the name of this class changes.
  * 
  * @author pavery
@@ -74,4 +81,4 @@
 		}
 		return false;
 	}
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameRequestor.java
index 4a7738d..6fa4592 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameRequestor.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameRequestor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,12 +11,16 @@
 package org.eclipse.wst.jsdt.web.ui.internal.java.refactoring;
 
 import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-
 /**
- * Overrides get description
- * 
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author pavery
  */
 public class JSPPackageRenameRequestor extends BasicRefactorSearchRequestor {
@@ -26,7 +30,7 @@
 	 * @param element
 	 * @param newName
 	 */
-	public JSPPackageRenameRequestor(IJavaElement element, String newName) {
+	public JSPPackageRenameRequestor(IJavaScriptElement element, String newName) {
 		super(element, newName);
 	}
 	
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java
index 7676a7d..7fd2fb5 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -22,8 +22,8 @@
 import org.eclipse.ui.IViewPart;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.jsdt.core.IJavaElement;
-import org.eclipse.wst.jsdt.core.IMethod;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IFunction;
 import org.eclipse.wst.jsdt.core.IPackageFragment;
 import org.eclipse.wst.jsdt.core.IType;
 import org.eclipse.wst.jsdt.ui.refactoring.RenameSupport;
@@ -32,8 +32,13 @@
 import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
 
 /**
- * An action delegate that launches JDT rename element wizard
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JSPRenameElementActionDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
 	private IEditorPart fEditor;
 	
@@ -42,10 +47,10 @@
 		fEditor = null;
 	}
 	
-	private IJavaElement getSelectedElement() {
-		IJavaElement element = null;
+	private IJavaScriptElement getSelectedElement() {
+		IJavaScriptElement element = null;
 		if (fEditor instanceof ITextEditor) {
-			IJavaElement[] elements = JSPJavaSelectionProvider.getSelection((ITextEditor) fEditor);
+			IJavaScriptElement[] elements = JSPJavaSelectionProvider.getSelection((ITextEditor) fEditor);
 			if (elements.length == 1) {
 				element = elements[0];
 			}
@@ -65,18 +70,18 @@
 	}
 	
 	public void run(IAction action) {
-		IJavaElement element = getSelectedElement();
+		IJavaScriptElement element = getSelectedElement();
 		if (element != null) {
 			RenameSupport renameSupport = null;
 			try {
 				switch (element.getElementType()) {
-					case IJavaElement.TYPE:
+					case IJavaScriptElement.TYPE:
 						renameSupport = RenameSupport.create((IType) element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
 					break;
-					case IJavaElement.METHOD:
-						renameSupport = RenameSupport.create((IMethod) element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
+					case IJavaScriptElement.METHOD:
+						renameSupport = RenameSupport.create((IFunction) element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
 					break;
-					case IJavaElement.PACKAGE_FRAGMENT:
+					case IJavaScriptElement.PACKAGE_FRAGMENT:
 						renameSupport = RenameSupport.create((IPackageFragment) element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
 					break;
 				}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveChange.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveChange.java
index 0fb1f69..6eaa39b 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveChange.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveChange.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -20,8 +20,13 @@
 import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
 
 /**
- * @author pavery
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JSPTypeMoveChange extends Change {
 	public static Change[] createChangesFor(IType type, String newName) {
 		JsSearchSupport support = JsSearchSupport.getInstance();
@@ -64,4 +69,4 @@
 		// TODO return the "undo" change here
 		return null;
 	}
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveParticipant.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveParticipant.java
index 4e108ba..8088e46 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveParticipant.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveParticipant.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -20,10 +20,14 @@
 import org.eclipse.wst.jsdt.core.IPackageFragment;
 import org.eclipse.wst.jsdt.core.IType;
 import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-
 /**
- * @author pavery
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JSPTypeMoveParticipant extends MoveParticipant {
 	IType fType = null;
 	
@@ -87,4 +91,4 @@
 		}
 		return false;
 	}
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveRequestor.java
index f601903..e760809 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveRequestor.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveRequestor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,13 +12,20 @@
 
 import java.text.MessageFormat;
 
-import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 import org.eclipse.wst.jsdt.core.search.SearchMatch;
 //import org.eclipse.wst.jsdt.web.core.internal.java.JsTranslation;
 import org.eclipse.wst.jsdt.web.core.javascript.search.JSDTSearchDocumentDelegate;
 import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author pavery
  */
 public class JSPTypeMoveRequestor extends BasicRefactorSearchRequestor {
@@ -26,7 +33,7 @@
 	 * @param element
 	 * @param newName
 	 */
-	public JSPTypeMoveRequestor(IJavaElement element, String newPackage) {
+	public JSPTypeMoveRequestor(IJavaScriptElement element, String newPackage) {
 		super(element, newPackage);
 	}
 	
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameChange.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameChange.java
index a5f837c..10ad88a 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameChange.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameChange.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,8 +18,14 @@
 import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchScope;
 import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
 import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
-
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author pavery
  */
 public class JSPTypeRenameChange extends Change {
@@ -65,4 +71,4 @@
 		// TODO return the "undo" change here
 		return null;
 	}
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameParticipant.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameParticipant.java
index a068ceb..56a46dd 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameParticipant.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameParticipant.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,12 +18,18 @@
 import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
 import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
 import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.JavaModelException;
+import org.eclipse.wst.jsdt.core.JavaScriptModelException;
 import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
 import org.eclipse.wst.jsdt.web.ui.internal.Logger;
 import org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode;
-
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * Remember to change the plugin.xml file if the name of this class changes.
  * 
  * @author pavery
@@ -63,7 +69,7 @@
 		if (this.fType != null) {
 			try {
 				name = this.fType.getSource();
-			} catch (JavaModelException e) {
+			} catch (JavaScriptModelException e) {
 				Logger.logException(e);
 			}
 		}
@@ -86,4 +92,4 @@
 		}
 		return false;
 	}
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameRequestor.java
index 74235cd..fbce86e 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameRequestor.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameRequestor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -19,6 +19,13 @@
 import org.eclipse.wst.jsdt.web.ui.internal.JsUIMessages;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * Creates document change(s) for a type rename. Changes are created for every
  * type "match" in the workspace
  * 
@@ -60,7 +67,7 @@
 		return renameText;
 	}
 	
-	private IType getType() {
-		return (IType) getElement();
-	}
+//	private IType getType() {
+//		return (IType) getElement();
+//	}
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/BasicJsSearchRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/BasicJsSearchRequestor.java
index 32d3adb..31d10ba 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/BasicJsSearchRequestor.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/BasicJsSearchRequestor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -25,9 +25,13 @@
 import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
 
 /**
- * Accepts matches from JSPSearchSupport.search(...) request. Adapts the results
- * from java to JSP and displays in the SearchResultView.
- * 
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author pavery
  */
 public class BasicJsSearchRequestor extends SearchRequestor {
@@ -141,4 +145,4 @@
 			System.out.println("JSP Search requestor: exitParticipant()"); //$NON-NLS-1$
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesActionDelegate.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesActionDelegate.java
index b87dd14..bbfc633 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesActionDelegate.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesActionDelegate.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,8 +18,13 @@
 import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesActionDelegate;
 
 /**
- * Sets up FindOccurrencesActionDelegate for jsp find occurrences processors
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JsFindOccurrencesActionDelegate extends FindOccurrencesActionDelegate {
 	private List fProcessors;
 	
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesProcessor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesProcessor.java
index 35e4ac9..7a0d93d 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,8 +15,7 @@
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.ITextSelection;
 import org.eclipse.search.ui.ISearchQuery;
-import org.eclipse.wst.jsdt.core.IJavaElement;
-
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
 import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
 import org.eclipse.wst.jsdt.web.core.text.IJsPartitions;
@@ -27,13 +26,17 @@
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
 /**
- * Configures a FindOccurrencesProcessor with JSP partitions and regions
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JsFindOccurrencesProcessor extends FindOccurrencesProcessor {
-	private IJavaElement getJavaElement(IDocument document, ITextSelection textSelection) {
-		IJavaElement[] elements = getJavaElementsForCurrentSelection(document, textSelection);
+	private IJavaScriptElement getJavaElement(IDocument document, ITextSelection textSelection) {
+		IJavaScriptElement[] elements = getJavaElementsForCurrentSelection(document, textSelection);
 		return elements.length > 0 ? elements[0] : null;
 	}
 	
@@ -42,8 +45,8 @@
 	 * 
 	 * @return currently selected IJavaElements
 	 */
-	private IJavaElement[] getJavaElementsForCurrentSelection(IDocument document, ITextSelection selection) {
-		IJavaElement[] elements = new IJavaElement[0];
+	private IJavaScriptElement[] getJavaElementsForCurrentSelection(IDocument document, ITextSelection selection) {
+		IJavaScriptElement[] elements = new IJavaScriptElement[0];
 		// get JSP translation object for this viewer's document
 		IStructuredModel model = null;
 		try {
@@ -52,7 +55,7 @@
 				IDOMDocument xmlDoc = ((IDOMModel) model).getDocument();
 				JsTranslationAdapter adapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
 				if (adapter != null) {
-					IJsTranslation translation = adapter.getJSPTranslation(true);
+					IJsTranslation translation = adapter.getJsTranslation(false);
 					// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102211
 					elements = translation.getElementsFromJsRange(selection.getOffset(), selection.getOffset() + selection.getLength());
 				}
@@ -77,6 +80,10 @@
 	
 	
 	protected ISearchQuery getSearchQuery(IFile file, IStructuredDocument document, String regionText, String regionType, ITextSelection textSelection) {
-		return new JsSearchQuery(file, getJavaElement(document, textSelection));
+		IJavaScriptElement javaScriptElement = getJavaElement(document, textSelection);
+		if (javaScriptElement != null) {
+			return new JsSearchQuery(file, javaScriptElement);
+		}
+		return null;
 	}
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsOccurrencesSearchResult.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsOccurrencesSearchResult.java
index 9a3e7fa..504987e 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsOccurrencesSearchResult.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsOccurrencesSearchResult.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,8 +13,14 @@
 import org.eclipse.search.ui.ISearchQuery;
 import org.eclipse.search.ui.text.Match;
 import org.eclipse.wst.sse.ui.internal.search.OccurrencesSearchResult;
-
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author pavery
  */
 public class JsOccurrencesSearchResult extends OccurrencesSearchResult {
@@ -24,6 +30,6 @@
 	
 	
 	public Match[] getMatches() {
-		return ((JsSearchQuery) getQuery()).getMatches();
+		return super.getMatches();
 	}
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchQuery.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchQuery.java
index c241255..d3807e0 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchQuery.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchQuery.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,7 +15,7 @@
 import org.eclipse.core.runtime.Status;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.search.ui.ISearchResult;
-import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 import org.eclipse.wst.jsdt.core.search.SearchDocument;
 import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchScope;
 import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
@@ -23,16 +23,20 @@
 import org.eclipse.wst.sse.ui.internal.search.BasicSearchQuery;
 
 /**
- * Implementation of <code>ISearchQuery</code> for <code>IJavaElement</code>s
- * in JSP files.
- * 
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author pavery
  */
 public class JsSearchQuery extends BasicSearchQuery {
-	/** the IJavaElement we are searching for in the file * */
-	private IJavaElement fElement = null;
+	/** the IJavaScriptElement we are searching for in the file * */
+	private IJavaScriptElement fElement = null;
 	
-	public JsSearchQuery(IFile file, IJavaElement element) {
+	public JsSearchQuery(IFile file, IJavaScriptElement element) {
 		super(file);
 		this.fElement = element;
 	}
@@ -52,7 +56,6 @@
 	
 	
 	protected IStatus doQuery() {
-		clearMatches();
 		IStatus status = Status.OK_STATUS;
 		try {
 			JsSearchSupport support = JsSearchSupport.getInstance();
@@ -84,7 +87,7 @@
 		return this;
 	}
 	
-	public IJavaElement getJavaElement() {
+	public IJavaScriptElement getJavaElement() {
 		return this.fElement;
 	}
 	
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchRequestor.java
index 05149e7..33feb50 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchRequestor.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchRequestor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -21,8 +21,14 @@
 import org.eclipse.search.ui.text.Match;
 import org.eclipse.wst.jsdt.ui.search.ISearchRequestor;
 import org.eclipse.wst.jsdt.web.ui.internal.Logger;
-
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author pavery
  */
 public class JsSearchRequestor extends BasicJsSearchRequestor {
@@ -72,4 +78,4 @@
 			Logger.logException(e);
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSingleFileSearchRequestor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSingleFileSearchRequestor.java
index 60fc490..9556525 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSingleFileSearchRequestor.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSingleFileSearchRequestor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,11 +14,13 @@
 import org.eclipse.jface.text.IDocument;
 
 /**
- * <p>
- * Special requestor that adds search results for single file search (Used for
- * JSPFindOccurrences action). It groups each match as it's own result.
- * </p>
- * 
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author pavery
  */
 public class JsSingleFileSearchRequestor extends BasicJsSearchRequestor {
@@ -33,4 +35,4 @@
 		// add match to JSP query...
 		this.fQuery.addMatch(jspDocument, jspStart, jspEnd);
 	}
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsMatchPresentation.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsMatchPresentation.java
index b85da44..aaa8880 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsMatchPresentation.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsMatchPresentation.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,8 +15,14 @@
 import org.eclipse.ui.PartInitException;
 import org.eclipse.wst.jsdt.ui.search.IMatchPresentation;
 import org.eclipse.wst.sse.ui.internal.search.BasicSearchLabelProvider;
-
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author pavery
  */
 public class JsMatchPresentation implements IMatchPresentation {
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsQueryParticipant.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsQueryParticipant.java
index 2d28421..faf5291 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsQueryParticipant.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsQueryParticipant.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,7 +13,7 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 import org.eclipse.wst.jsdt.core.search.SearchPattern;
 import org.eclipse.wst.jsdt.core.search.SearchRequestor;
 import org.eclipse.wst.jsdt.ui.search.ElementQuerySpecification;
@@ -25,8 +25,14 @@
 import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchScope;
 import org.eclipse.wst.jsdt.web.core.javascript.search.JsSearchSupport;
 import org.eclipse.wst.jsdt.web.ui.internal.java.search.JsSearchRequestor;
-
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author pavery
  */
 public class JsQueryParticipant implements IQueryParticipant {
@@ -63,7 +69,7 @@
 		if (querySpecification instanceof ElementQuerySpecification) {
 			// element search (eg. from global find references in Java file)
 			ElementQuerySpecification elementQuery = (ElementQuerySpecification) querySpecification;
-			IJavaElement element = elementQuery.getElement();
+			IJavaScriptElement element = elementQuery.getElement();
 			if (JsQueryParticipant.DEBUG) {
 				System.out.println("JSP Query Participant searching on ELEMENT: " + element); //$NON-NLS-1$
 			}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/registry/AdapterFactoryProviderForJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/registry/AdapterFactoryProviderForJSDT.java
index 4f6e759..f4b6a69 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/registry/AdapterFactoryProviderForJSDT.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/registry/AdapterFactoryProviderForJSDT.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,7 +11,6 @@
 package org.eclipse.wst.jsdt.web.ui.internal.registry;
 
 import org.eclipse.wst.html.core.internal.modelhandler.ModelHandlerForHTML;
-import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
 import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapterFactory;
 import org.eclipse.wst.jsdt.web.ui.views.contentoutline.JFaceNodeAdapterFactoryForJSDT;
 import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
@@ -21,7 +20,14 @@
 import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
 import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryProvider;
 import org.eclipse.wst.sse.ui.internal.util.Assert;
+/**
+*
 
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class AdapterFactoryProviderForJSDT implements AdapterFactoryProvider {
 	/*
 	 * @see AdapterFactoryProvider#addAdapterFactories(IStructuredModel)
@@ -44,11 +50,8 @@
 			factory = new JFaceNodeAdapterFactoryForJSDT(IJFaceNodeAdapter.class, true);
 			factoryRegistry.addFactory(factory);
 		}
-		factory = factoryRegistry.getFactoryFor(IJsTranslation.class);
-		if (factory == null) {
-			factory = new JsTranslationAdapterFactory();
-			factoryRegistry.addFactory(factory);
-		}
+		
+		JsTranslationAdapterFactory.setupAdapterFactory(structuredModel);
 	}
 	
 	protected void addPropagatingAdapters(IStructuredModel structuredModel) {}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/IStyleConstantsJs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/IStyleConstantsJs.java
index 35eabe4..4a237d6 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/IStyleConstantsJs.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/IStyleConstantsJs.java
@@ -1,5 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.internal.style;
+/**
+*
 
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public interface IStyleConstantsJs {
 	public static final String JSP_CONTENT = "jsp_content"; //$NON-NLS-1$
 }
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/IStyleConstantsJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/IStyleConstantsJSDT.java
index 4b7813d..625fec6 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/IStyleConstantsJSDT.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/IStyleConstantsJSDT.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,7 +10,14 @@
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
  *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.internal.style.java;
+/**
+*
 
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public interface IStyleConstantsJSDT {
 	String JAVA_DEFAULT = "default"; //$NON-NLS-1$
 	String JAVA_KEYWORD = "keyword"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JSDTCodeScanner.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JSDTCodeScanner.java
index 32db531..f74f1b0 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JSDTCodeScanner.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JSDTCodeScanner.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,8 +23,13 @@
 import org.eclipse.wst.jsdt.web.core.javascript.JsDataTypes;
 
 /**
- * A Java code scanner.
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 class JSDTCodeScanner extends org.eclipse.jface.text.rules.RuleBasedScanner {
 	private static String[] fgConstants = JsDataTypes.CONSTANTS;
 	private static String[] fgKeywords = JsDataTypes.KEYWORDS;
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JavaWordDetector.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JavaWordDetector.java
index 0e7c57f..a16268a 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JavaWordDetector.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JavaWordDetector.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,8 +11,13 @@
 package org.eclipse.wst.jsdt.web.ui.internal.style.java;
 
 /**
- * A Java aware word detector.
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JavaWordDetector implements org.eclipse.jface.text.rules.IWordDetector {
 	/**
 	 * @see org.eclipse.jface.text.rules.IWordDetector#isWordIdentifierPart
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/LineStyleProviderForJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/LineStyleProviderForJSDT.java
index 05277c1..fe6ad6d 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/LineStyleProviderForJSDT.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/LineStyleProviderForJSDT.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,13 +11,9 @@
 package org.eclipse.wst.jsdt.web.ui.internal.style.java;
 
 import java.util.Collection;
-import java.util.HashMap;
 
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.ITypedRegion;
 import org.eclipse.jface.text.TextAttribute;
 import org.eclipse.jface.text.rules.IToken;
@@ -32,17 +28,23 @@
 import org.eclipse.wst.jsdt.ui.PreferenceConstants;
 import org.eclipse.wst.jsdt.web.ui.internal.JsUIPlugin;
 import org.eclipse.wst.jsdt.web.ui.internal.style.IStyleConstantsJs;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider;
 import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
 import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
+/**
+*
 
-// Note: many of the methods in this class were based on (or copied from) those
-// found in the example Java Editor
-public class LineStyleProviderForJSDT implements LineStyleProvider {
-	private class PropertyChangeListener implements IPropertyChangeListener {
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class LineStyleProviderForJSDT extends AbstractLineStyleProvider implements LineStyleProvider {
+	/** The scanner it uses */
+	private JSDTCodeScanner fScanner;
+	
+	private IPropertyChangeListener fPreferenceListener = new IPropertyChangeListener() {
 		/*
 		 * (non-Javadoc)
 		 * 
@@ -52,15 +54,7 @@
 			// have to do it this way so others can override the method
 			handlePropertyChange(event);
 		}
-	}
-	private IDocument fDocument;
-	private Highlighter fHighlighter;
-	private boolean fIsInitialized = false;
-	private PropertyChangeListener fPreferenceListener = new PropertyChangeListener();
-	/** The scanner it uses */
-	private JSDTCodeScanner fScanner;
-	/** Contains all text attributes pretaining to this line style provider */
-	private HashMap fTextAttributes = null;
+	};
 	
 	public LineStyleProviderForJSDT() {
 		super();
@@ -198,47 +192,7 @@
 		presentation.add(result);
 	}
 	
-	/**
-	 * Looks up the colorKey in the preference store and adds the style
-	 * information to list of TextAttributes
-	 * 
-	 * @param colorKey
-	 */
-	private void addTextAttribute(String colorKey) {
-		if (getColorPreferences() != null) {
-			String prefString = getColorPreferences().getString(colorKey);
-			String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
-			if (stylePrefs != null) {
-				RGB foreground = ColorHelper.toRGB(stylePrefs[0]);
-				RGB background = ColorHelper.toRGB(stylePrefs[1]);
-				boolean bold = Boolean.valueOf(stylePrefs[2]).booleanValue();
-				boolean italic = Boolean.valueOf(stylePrefs[3]).booleanValue();
-				boolean strikethrough = Boolean.valueOf(stylePrefs[4]).booleanValue();
-				boolean underline = Boolean.valueOf(stylePrefs[5]).booleanValue();
-				int style = SWT.NORMAL;
-				if (bold) {
-					style = style | SWT.BOLD;
-				}
-				if (italic) {
-					style = style | SWT.ITALIC;
-				}
-				if (strikethrough) {
-					style = style | TextAttribute.STRIKETHROUGH;
-				}
-				if (underline) {
-					style = style | TextAttribute.UNDERLINE;
-				}
-				TextAttribute createTextAttribute = createTextAttribute(foreground, background, style);
-				getTextAttributes().put(colorKey, createTextAttribute);
-			}
-		}
-	}
-	
-	private TextAttribute createTextAttribute(RGB foreground, RGB background, int style) {
-		return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, style);
-	}
-	
-	private IPreferenceStore getColorPreferences() {
+	protected IPreferenceStore getColorPreferences() {
 		return JsUIPlugin.getDefault().getPreferenceStore();
 	}
 	
@@ -247,21 +201,6 @@
 	}
 	
 	/**
-	 * Returns the hashtable containing all the text attributes for this line
-	 * style provider. Lazily creates a hashtable if one has not already been
-	 * created.
-	 * 
-	 * @return
-	 */
-	private HashMap getTextAttributes() {
-		if (fTextAttributes == null) {
-			fTextAttributes = new HashMap();
-			loadColors();
-		}
-		return fTextAttributes;
-	}
-	
-	/**
 	 * Returns a text attribute encoded in the given token. If the token's data
 	 * is not <code>null</code> and a text attribute it is assumed that it is
 	 * the encoded text attribute. It returns the default text attribute if
@@ -317,21 +256,11 @@
 		}
 		if (styleKey != null || javaStyleKey != null) {
 			// force a full update of the text viewer
-			fHighlighter.refreshDisplay();
+			super.getHighlighter().refreshDisplay();
 		}
 	}
 	
-	public void init(IStructuredDocument document, Highlighter highlighter) {
-		fDocument = document;
-		fHighlighter = highlighter;
-		if (fIsInitialized) {
-			return;
-		}
-		registerPreferenceListener();
-		fIsInitialized = true;
-	}
-	
-	private void loadColors() {
+	protected void loadColors() {
 		addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
 		addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
 		addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
@@ -345,23 +274,21 @@
 	
 	public boolean prepareRegions(ITypedRegion typedRegion, int ssssrequestedStart, int ssssrequestedLength, Collection holdResults) {
 		boolean result = true;
+		/* Initialize the text attributes. Also load the colors and initialize the rules of the scanner */
+		getTextAttributes();
 		try {
 			// ideally, eventually, we'll have a "virtualDocument" we can
 			// refer to, but for now ... we'll simple rescan the one region.
 			// use simple adjustment (since "sub-content" starts at 0
-			int offsetAdjustment = typedRegion.getOffset();
-			String content = fDocument.get(typedRegion.getOffset(), typedRegion.getLength());
-			IDocument document = new Document(content);
-			int lastStart = 0;
+			int lastStart = typedRegion.getOffset();
 			int length = 0;
 			IToken lastToken = Token.UNDEFINED;
-			int remainingLength = typedRegion.getLength();
-			fScanner.setRange(document, lastStart, remainingLength);
+			fScanner.setRange(getDocument(), lastStart, typedRegion.getLength());
 			while (true) {
 				IToken token = fScanner.nextToken();
 				if (token.isEOF()) {
 					if (!lastToken.isUndefined() && length != 0) {
-						addRange(holdResults, lastStart + offsetAdjustment, length, getTokenTextAttribute(lastToken));
+						addRange(holdResults, lastStart, length, getTokenTextAttribute(lastToken));
 					}
 					break;
 				}
@@ -375,7 +302,7 @@
 					continue;
 				}
 				if (token != lastToken) {
-					addRange(holdResults, lastStart + offsetAdjustment, length, getTokenTextAttribute(lastToken));
+					addRange(holdResults, lastStart, length, getTokenTextAttribute(lastToken));
 					lastToken = token;
 					lastStart = fScanner.getTokenOffset();
 					length = fScanner.getTokenLength();
@@ -383,29 +310,30 @@
 				}
 				length += fScanner.getTokenLength();
 			}
-		} catch (BadLocationException e) {
+		} catch (Exception e) {
 			// shouldn't happen, but we don't want it to stop other
 			// highlighting, if it does.
 			result = false;
 		}
 		return result;
 	}
+
+	protected TextAttribute getAttributeFor(ITextRegion region) {
+		return null;
+	}
 	
-	private void registerPreferenceListener() {
+	protected void registerPreferenceManager() {
 		getColorPreferences().addPropertyChangeListener(fPreferenceListener);
 		getJavaColorPreferences().addPropertyChangeListener(fPreferenceListener);
 	}
 	
 	public void release() {
-		unregisterPreferenceManager();
-		if (fTextAttributes != null) {
-			fTextAttributes.clear();
-			fTextAttributes = null;
-		}
+		super.release();
+		fScanner = null;
 	}
 	
-	private void unregisterPreferenceManager() {
+	protected void unRegisterPreferenceManager() {
 		getColorPreferences().removePropertyChangeListener(fPreferenceListener);
 		getJavaColorPreferences().removePropertyChangeListener(fPreferenceListener);
 	}
-}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/HTMLPrinter.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/HTMLPrinter.java
index 860beb7..bd00e78 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/HTMLPrinter.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/HTMLPrinter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -21,10 +21,13 @@
 import org.eclipse.wst.jsdt.web.ui.internal.Logger;
 
 /**
- * Provides a set of convenience methods for creating HTML pages.
- * 
- * Based on org.eclipse.wst.jsdt.internal.ui.text.HTMLPrinter
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 class HTMLPrinter {
 	static RGB BG_COLOR_RGB = null;
 	static {
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JSDTHoverProcessor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JSDTHoverProcessor.java
index 64d3fcd..d5e1669 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JSDTHoverProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JSDTHoverProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,12 +14,11 @@
 
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 import org.eclipse.wst.jsdt.core.IMember;
-import org.eclipse.wst.jsdt.core.JavaModelException;
-import org.eclipse.wst.jsdt.ui.JavaElementLabels;
-import org.eclipse.wst.jsdt.ui.JavadocContentAccess;
-
+import org.eclipse.wst.jsdt.core.JavaScriptModelException;
+import org.eclipse.wst.jsdt.ui.JSdocContentAccess;
+import org.eclipse.wst.jsdt.ui.JavaScriptElementLabels;
 import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
 import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
 import org.eclipse.wst.sse.core.StructuredModelManager;
@@ -28,17 +27,22 @@
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 
 /**
- * Provides javadoc hover help documentation for java code inside JSPs
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JSDTHoverProcessor extends AbstractHoverProcessor {
 	/*
 	 * Bulk of the work was copied from
 	 * org.eclipse.wst.jsdt.internal.ui.text.java.hover.JavadocHover
 	 */
-	private final long LABEL_FLAGS = JavaElementLabels.ALL_FULLY_QUALIFIED | JavaElementLabels.M_PRE_RETURNTYPE | JavaElementLabels.M_PARAMETER_TYPES | JavaElementLabels.M_PARAMETER_NAMES | JavaElementLabels.M_EXCEPTIONS | JavaElementLabels.F_PRE_TYPE_SIGNATURE | JavaElementLabels.M_PRE_TYPE_PARAMETERS | JavaElementLabels.T_TYPE_PARAMETERS | JavaElementLabels.USE_RESOLVED;
-	private final long LOCAL_VARIABLE_FLAGS = LABEL_FLAGS & ~JavaElementLabels.F_FULLY_QUALIFIED | JavaElementLabels.F_POST_QUALIFIED;
+	private final long LABEL_FLAGS = JavaScriptElementLabels.ALL_FULLY_QUALIFIED | JavaScriptElementLabels.M_PRE_RETURNTYPE | JavaScriptElementLabels.M_PARAMETER_TYPES | JavaScriptElementLabels.M_PARAMETER_NAMES | JavaScriptElementLabels.M_EXCEPTIONS | JavaScriptElementLabels.F_PRE_TYPE_SIGNATURE | JavaScriptElementLabels.M_PRE_TYPE_PARAMETERS | JavaScriptElementLabels.T_TYPE_PARAMETERS | JavaScriptElementLabels.USE_RESOLVED;
+	private final long LOCAL_VARIABLE_FLAGS = LABEL_FLAGS & ~JavaScriptElementLabels.F_FULLY_QUALIFIED | JavaScriptElementLabels.F_POST_QUALIFIED;
 	
-	private String getHoverInfo(IJavaElement[] result) {
+	private String getHoverInfo(IJavaScriptElement[] result) {
 		StringBuffer buffer = new StringBuffer();
 		int nResults = result.length;
 		if (nResults == 0) {
@@ -47,14 +51,14 @@
 		if (nResults > 1) {
 			for (int i = 0; i < result.length; i++) {
 				HTMLPrinter.startBulletList(buffer);
-				IJavaElement curr = result[i];
-				if (curr instanceof IMember || curr.getElementType() == IJavaElement.LOCAL_VARIABLE) {
+				IJavaScriptElement curr = result[i];
+				if (curr instanceof IMember || curr.getElementType() == IJavaScriptElement.LOCAL_VARIABLE) {
 					HTMLPrinter.addBullet(buffer, getInfoText(curr));
 				}
 				HTMLPrinter.endBulletList(buffer);
 			}
 		} else {
-			IJavaElement curr = result[0];
+			IJavaScriptElement curr = result[0];
 			if (curr == null) {
 				return null;
 			}
@@ -63,14 +67,14 @@
 				HTMLPrinter.addSmallHeader(buffer, getInfoText(member));
 				Reader reader;
 				try {
-					reader = JavadocContentAccess.getHTMLContentReader(member, true, true);
-				} catch (JavaModelException ex) {
+					reader = JSdocContentAccess.getHTMLContentReader(member, true, true);
+				} catch (JavaScriptModelException ex) {
 					return null;
 				}
 				if (reader != null) {
 					HTMLPrinter.addParagraph(buffer, reader);
 				}
-			} else if (curr.getElementType() == IJavaElement.LOCAL_VARIABLE || curr.getElementType() == IJavaElement.TYPE_PARAMETER) {
+			} else if (curr.getElementType() == IJavaScriptElement.LOCAL_VARIABLE) {
 				HTMLPrinter.addSmallHeader(buffer, getInfoText(curr));
 			}
 		}
@@ -97,16 +101,16 @@
 				IDOMDocument xmlDoc = xmlModel.getDocument();
 				JsTranslationAdapter adapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
 				if (adapter != null) {
-					IJsTranslation translation = adapter.getJSPTranslation(true);
-					IJavaElement[] result = translation.getElementsFromJsRange(hoverRegion.getOffset(), hoverRegion.getOffset() + hoverRegion.getLength());
+					IJsTranslation translation = adapter.getJsTranslation(true);
+					IJavaScriptElement[] result = translation.getElementsFromJsRange(hoverRegion.getOffset(), hoverRegion.getOffset() + hoverRegion.getLength());
 // Vector filteredResults = new Vector();
 // List badFunctions = translation.getGeneratedFunctionNames();
 // boolean bad = false;
 // for(int i = 0;i<result.length;i++){
 // bad=false;
-// if(result[i] instanceof IMethod){
+// if(result[i] instanceof IFunction){
 // for(int j=0;j<badFunctions.size() && ! bad;j++){
-// if(((IMethod)result[i]).getElementName().equalsIgnoreCase((String)badFunctions.get(j))){
+// if(((IFunction)result[i]).getElementName().equalsIgnoreCase((String)badFunctions.get(j))){
 // bad=true;
 // continue;
 // }
@@ -117,8 +121,8 @@
 // if(filteredResults.size()<1) return new String();
 //					
 // String filteredResult =
-// translation.fixupMangledName(getHoverInfo((IJavaElement[])filteredResults.toArray(new
-// IJavaElement[]{})));
+// translation.fixupMangledName(getHoverInfo((IJavaScriptElement[])filteredResults.toArray(new
+// IJavaScriptElement[]{})));
 // for(int i = 0;i<badFunctions.size();i++){
 // filteredResult.replace((String)badFunctions.get(i), "");
 // }
@@ -144,9 +148,9 @@
 		return JsWordFinder.findWord(textViewer.getDocument(), offset);
 	}
 	
-	private String getInfoText(IJavaElement member) {
-		long flags = member.getElementType() == IJavaElement.LOCAL_VARIABLE ? LOCAL_VARIABLE_FLAGS : LABEL_FLAGS;
-		String label = JavaElementLabels.getElementLabel(member, flags);
+	private String getInfoText(IJavaScriptElement member) {
+		long flags = member.getElementType() == IJavaScriptElement.LOCAL_VARIABLE ? LOCAL_VARIABLE_FLAGS : LABEL_FLAGS;
+		String label = JavaScriptElementLabels.getElementLabel(member, flags);
 		StringBuffer buf = new StringBuffer();
 		for (int i = 0; i < label.length(); i++) {
 			char ch = label.charAt(i);
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JSDTInformationProvider.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JSDTInformationProvider.java
deleted file mode 100644
index 8c30fa1..0000000
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JSDTInformationProvider.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.jsdt.web.ui.internal.taginfo;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.information.IInformationProviderExtension;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * Provides javadoc context information for java code inside JSPs (Shows tooltip
- * description)
- */
-public class JSDTInformationProvider implements IInformationProvider, IInformationProviderExtension {
-	private ITextHover fTextHover = null;
-	
-	public JSDTInformationProvider() {
-		fTextHover = SSEUIPlugin.getDefault().getTextHoverManager().createBestMatchHover(new JSDTHoverProcessor());
-	}
-	
-	public String getInformation(ITextViewer textViewer, IRegion subject) {
-		return (String) getInformation2(textViewer, subject);
-	}
-	
-	public Object getInformation2(ITextViewer textViewer, IRegion subject) {
-		return fTextHover.getHoverInfo(textViewer, subject);
-	}
-	
-	public IRegion getSubject(ITextViewer textViewer, int offset) {
-		return fTextHover.getHoverRegion(textViewer, offset);
-	}
-}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JsWordFinder.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JsWordFinder.java
index b8a6dd4..b9311af 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JsWordFinder.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JsWordFinder.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,8 +16,13 @@
 import org.eclipse.jface.text.Region;
 
 /**
- * Copied from org.eclipse.wst.jsdt.internal.ui.text.JavaWordFinder
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 class JsWordFinder {
 	public static IRegion findWord(IDocument document, int offset) {
 		int start = -1;
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCharacterPairInserter.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCharacterPairInserter.java
new file mode 100644
index 0000000..38d02d7
--- /dev/null
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCharacterPairInserter.java
@@ -0,0 +1,293 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.jsdt.web.ui.internal.text;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.link.ILinkedModeListener;
+import org.eclipse.jface.text.link.LinkedModeModel;
+import org.eclipse.jface.text.link.LinkedModeUI.ExitFlags;
+import org.eclipse.jface.text.link.LinkedModeUI.IExitPolicy;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.wst.jsdt.core.JavaScriptCore;
+import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
+import org.eclipse.wst.jsdt.internal.ui.text.JavaHeuristicScanner;
+import org.eclipse.wst.jsdt.internal.ui.text.Symbols;
+import org.eclipse.wst.jsdt.ui.PreferenceConstants;
+import org.eclipse.wst.jsdt.web.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter;
+
+/**
+ * <p>Inserts character pairs in script regions in HTML and JSP documents based on the Javascript
+ * character pairing preferences.</p>
+ */
+public class JsCharacterPairInserter extends AbstractCharacterPairInserter implements IPropertyChangeListener{
+
+	private boolean fCloseStrings;
+	private boolean fCloseBrackets;
+	private boolean fCloseBraces;
+	private boolean fCloseAngularBrackets;
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter#hasPair(char)
+	 */
+	public boolean hasPair(char c) {
+		switch (c) {
+			case '(':
+			case '<':
+			case '[':
+			case '\'':
+			case '\"':
+			case '{':
+				return true;
+			default:
+				return false;
+		}
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter#shouldPair(org.eclipse.jface.text.source.ISourceViewer, char)
+	 */
+	protected boolean shouldPair(ISourceViewer viewer, char c) {
+		IDocument document= viewer.getDocument();
+
+		final Point selection= viewer.getSelectedRange();
+		final int offset= selection.x;
+		final int length= selection.y;
+
+		try {
+			IRegion startLine= document.getLineInformationOfOffset(offset);
+			IRegion endLine= document.getLineInformationOfOffset(offset + length);
+
+			JavaHeuristicScanner scanner= new JavaHeuristicScanner(document);
+			int nextToken= scanner.nextToken(offset + length, endLine.getOffset() + endLine.getLength());
+			String next= nextToken == Symbols.TokenEOF ? null : document.get(offset, scanner.getPosition() - offset).trim();
+			int prevToken= scanner.previousToken(offset - 1, startLine.getOffset());
+			int prevTokenOffset= scanner.getPosition() + 1;
+			String previous= prevToken == Symbols.TokenEOF ? null : document.get(prevTokenOffset, offset - prevTokenOffset).trim();
+
+			switch (c) {
+				case '(':
+					if (!fCloseBrackets
+							|| nextToken == Symbols.TokenLPAREN
+							|| nextToken == Symbols.TokenIDENT
+							|| next != null && next.length() > 1)
+						return false;
+					break;
+
+				case '<':
+					if (!(fCloseAngularBrackets && fCloseBrackets)
+							|| nextToken == Symbols.TokenLESSTHAN
+							|| 		   prevToken != Symbols.TokenLBRACE
+									&& prevToken != Symbols.TokenRBRACE
+									&& prevToken != Symbols.TokenSEMICOLON
+									&& prevToken != Symbols.TokenSYNCHRONIZED
+									&& prevToken != Symbols.TokenSTATIC
+									&& (prevToken != Symbols.TokenIDENT || !isAngularIntroducer(previous))
+									&& prevToken != Symbols.TokenEOF)
+						return false;
+					break;
+
+				case '{':
+					if (!fCloseBraces
+							|| nextToken == Symbols.TokenIDENT
+							|| next != null && next.length() > 1)
+						return false;
+					break;
+				case '[':
+					if (!fCloseBrackets
+							|| nextToken == Symbols.TokenIDENT
+							|| next != null && next.length() > 1)
+						return false;
+					break;
+
+				case '\'':
+				case '"':
+					if (!fCloseStrings
+							|| nextToken == Symbols.TokenIDENT
+							|| prevToken == Symbols.TokenIDENT
+							|| next != null && next.length() > 1
+							|| previous != null && previous.length() > 1)
+						return false;
+					break;
+
+				default:
+					return false;
+			}
+		} catch (BadLocationException e) {
+			return false;
+		}
+		
+		return true;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter#getPair(char)
+	 */
+	protected char getPair(char c) {
+		switch (c) {
+			case '(':
+				return ')';
+			case '<':
+				return '>';
+			case '[':
+				return ']';
+			case '{':
+				return '}';
+			case '\'':
+				return c;
+			case '\"':
+				return c;
+			default:
+				throw new IllegalArgumentException();
+		}
+	}
+	
+	/**
+	 * <p>Initialize the preference listener</p>
+	 * 
+	 * @see org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter#initialize()
+	 */
+	public void initialize() {
+		super.initialize();
+		IPreferenceStore preferenceStore = JavaScriptPlugin.getDefault().getPreferenceStore();
+		this.fCloseStrings = preferenceStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_STRINGS);
+		this.fCloseBrackets = preferenceStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_BRACKETS);
+		this.fCloseBraces = preferenceStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_BRACES);
+		this.fCloseAngularBrackets = JavaScriptCore.VERSION_1_5.compareTo(
+				preferenceStore.getString(JavaScriptCore.COMPILER_SOURCE)) <= 0;
+		preferenceStore.addPropertyChangeListener(this);
+	}
+	
+	/**
+	 * <p>Dispose the preference listener</p>
+	 * 
+	 * @see org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter#dispose()
+	 */
+	public void dispose() {
+		JavaScriptPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
+		super.dispose();
+	}
+
+	/**
+	 * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+	 */
+	public void propertyChange(PropertyChangeEvent event) {
+		if (PreferenceConstants.EDITOR_CLOSE_STRINGS.equals(event.getProperty())){
+			this.fCloseStrings = ((Boolean) event.getNewValue()).booleanValue();
+		} else if (PreferenceConstants.EDITOR_CLOSE_BRACKETS.equals(event.getProperty())) {
+			this.fCloseBrackets = ((Boolean) event.getNewValue()).booleanValue();
+		} else if (PreferenceConstants.EDITOR_CLOSE_BRACES.equals(event.getProperty())) {
+			this.fCloseBraces = ((Boolean) event.getNewValue()).booleanValue();
+		} else if (JavaScriptCore.COMPILER_SOURCE.equals(event.getProperty())) {
+			IPreferenceStore preferenceStore = JavaScriptPlugin.getDefault().getPreferenceStore();
+			this.fCloseAngularBrackets = JavaScriptCore.VERSION_1_5.compareTo(preferenceStore.getString(
+						JavaScriptCore.COMPILER_SOURCE)) <= 0;
+		}
+	}
+	
+	/**
+	 * TODO: IAN: comment me
+	 * @param identifier
+	 * @return
+	 */
+	private boolean isAngularIntroducer(String identifier) {
+		return identifier.length() > 0
+				&& (Character.isUpperCase(identifier.charAt(0))
+						|| identifier.startsWith("final") //$NON-NLS-1$
+						|| identifier.startsWith("public") //$NON-NLS-1$
+						|| identifier.startsWith("public") //$NON-NLS-1$
+						|| identifier.startsWith("protected") //$NON-NLS-1$
+						|| identifier.startsWith("private")); //$NON-NLS-1$
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter#getExitPolicy(char, char, org.eclipse.jface.text.IDocument)
+	 */
+	protected IExitPolicy getExitPolicy(char exit, char escape, IDocument document) {
+		return new ExitPolicy(exit, escape, document);
+	}
+	
+	/**
+	 * <p>An exit policy that deals with a user adding a carriage return between {}.
+	 * In that case rather then exiting to the exit position the linked mode is exited
+	 * and the carriage return inserted.</p>
+	 */
+	private static class ExitPolicy implements IExitPolicy {
+
+		/** exit character */
+		private char fExit;
+		
+		/** escape character for the exit character */
+		private char fEscape;
+		
+		/** document to execute this exit policy on */
+		private IDocument fDocument;
+
+		/**
+		 * <p>Default constructor</p>
+		 * 
+		 * @param exit exit character
+		 * @param escape escape character for the exit character
+		 * @param document document to execute this exit policy on
+		 */
+		public ExitPolicy(char exit, char escape, IDocument document) {
+			fExit = exit;
+			fEscape = escape;
+			fDocument = document;
+		}
+
+		/**
+		 * @see org.eclipse.jface.text.link.LinkedModeUI.IExitPolicy#doExit(org.eclipse.jface.text.link.LinkedModeModel, org.eclipse.swt.events.VerifyEvent, int, int)
+		 */
+		public ExitFlags doExit(LinkedModeModel model, VerifyEvent event, int offset, int length) {
+			if(!isMasked(offset)) {
+				// if exit character then exit to exit location
+				if (event.character == fExit) {
+					return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
+				}
+				
+				// if carriage return and previous character is { then exit linked mode and insert return
+				if (event.character == SWT.CR && offset > 0) {
+					try {
+						if (this.fDocument.getChar(offset - 1) == '{') {
+							return new ExitFlags(ILinkedModeListener.EXIT_ALL, true);
+						}
+					} catch (BadLocationException e) {
+						Logger.logException("Error while trying to exit linked mode", e); //$NON-NLS-1$
+					}
+				}
+			}
+			return null;
+		}
+
+		/**
+		 * <p>Determine if the exit character has been escaped.<p>
+		 * 
+		 * @param offset current offset in the document
+		 * @return <code>true</code> if exit character escaped, <code>false</code> otherwise
+		 */
+		private boolean isMasked(int offset) {
+			try {
+				return fEscape == fDocument.getChar(offset - 1);
+			} catch (BadLocationException e) {
+			}
+			return false;
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCodeReader.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCodeReader.java
index a2ad050..29937d0 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCodeReader.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCodeReader.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,14 +23,13 @@
 import org.eclipse.wst.jsdt.web.ui.internal.derived.SingleCharReader;
 
 /**
- * Reads from a document either forwards or backwards. May be configured to skip
- * comments and strings.
- * 
- * Copied from org.eclipse.wst.jsdt.internal.ui.text so we don't have to depend
- * on the org.eclipse.wst.jsdt.ui plugin.
- * 
- * No modifications were made.
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 class JsCodeReader extends SingleCharReader {
 	/** The EOF character */
 	public static final int EOF = -1;
@@ -223,4 +222,4 @@
 		}
 		return JsCodeReader.EOF;
 	}
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsDocumentRegionEdgeMatcher.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsDocumentRegionEdgeMatcher.java
index 0c6d868..86c10d8 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsDocumentRegionEdgeMatcher.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsDocumentRegionEdgeMatcher.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,7 +12,14 @@
 
 import org.eclipse.wst.sse.ui.internal.text.DocumentRegionEdgeMatcher;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+/**
+*
 
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JsDocumentRegionEdgeMatcher extends DocumentRegionEdgeMatcher {
 	protected final static char[] BRACKETS = { '{', '}', '(', ')', '[', ']' };
 	
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsPairMatcher.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsPairMatcher.java
index 882cbea..a1965a0 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsPairMatcher.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsPairMatcher.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -19,13 +19,13 @@
 import org.eclipse.jface.text.source.ICharacterPairMatcher;
 
 /**
- * Helper class for match pairs of characters.
- * 
- * Copied from org.eclipse.wst.jsdt.internal.ui.text so we don't have to depend
- * on the org.eclipse.wst.jsdt.ui plugin.
- * 
- * No modifications were made.
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 class JsPairMatcher implements ICharacterPairMatcher {
 	protected int fAnchor;
 	protected IDocument fDocument;
@@ -182,4 +182,4 @@
 		}
 		return -1;
 	}
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/messages.properties b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/messages.properties
index 9476cc8..c6061c4 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/messages.properties
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/messages.properties
@@ -1 +1,11 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
 WebProjectJsGlobalScopeContainerInitializer.0=Web Project support for JSDT
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/IJavaWebNode.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/IJavaWebNode.java
index 492b85d..b69918f 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/IJavaWebNode.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/IJavaWebNode.java
@@ -1,17 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
 package org.eclipse.wst.jsdt.web.ui.views.contentoutline;
 
-import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
 import org.w3c.dom.Node;
-
 /**
- * @author childsb
- * 
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public interface IJavaWebNode {
-	public IJavaElement getJavaElement();
+	public IJavaScriptElement getJavaElement();
 	
 	public Node getParentNode();
 		
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterFactoryForJSDT.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterFactoryForJSDT.java
index f511ea1..9afa956 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterFactoryForJSDT.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterFactoryForJSDT.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,11 +16,14 @@
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
 import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapterFactory;
-
 /**
- * An adapter factory to create JFaceNodeAdapters. Use this adapter factory with
- * a JFaceAdapterContentProvider to display DOM nodes in a tree.
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JFaceNodeAdapterFactoryForJSDT extends JFaceNodeAdapterFactory {
 	public JFaceNodeAdapterFactoryForJSDT() {
 		this(IJFaceNodeAdapter.class, true);
@@ -49,4 +52,4 @@
 		}
 		return singletonAdapter;
 	}
-}
\ No newline at end of file
+}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterForJs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterForJs.java
index 81f7670..456ef6f 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterForJs.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterForJs.java
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     bug:244839 - eugene@genuitec.com
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.views.contentoutline;
 
 import java.util.Vector;
@@ -7,18 +18,20 @@
 import org.eclipse.jface.text.Position;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.wst.html.ui.internal.contentoutline.JFaceNodeAdapterForHTML;
-import org.eclipse.wst.jsdt.core.ICompilationUnit;
-import org.eclipse.wst.jsdt.core.IJavaElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
+import org.eclipse.wst.jsdt.core.IMember;
 import org.eclipse.wst.jsdt.core.ISourceRange;
+import org.eclipse.wst.jsdt.core.ISourceReference;
 import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.JavaModelException;
+import org.eclipse.wst.jsdt.core.JavaScriptModelException;
 import org.eclipse.wst.jsdt.internal.core.JavaElement;
+import org.eclipse.wst.jsdt.internal.core.Member;
 import org.eclipse.wst.jsdt.internal.core.SourceRefElement;
-import org.eclipse.wst.jsdt.ui.JavaElementLabelProvider;
-import org.eclipse.wst.jsdt.ui.StandardJavaElementContentProvider;
+import org.eclipse.wst.jsdt.ui.JavaScriptElementLabelProvider;
+import org.eclipse.wst.jsdt.ui.StandardJavaScriptElementContentProvider;
 import org.eclipse.wst.jsdt.web.core.internal.Logger;
 import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
-import org.eclipse.wst.jsdt.web.core.javascript.JsTranslation;
 import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
@@ -31,40 +44,58 @@
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapterFactory;
 import org.w3c.dom.Node;
+/**
+*
 
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JFaceNodeAdapterForJs extends JFaceNodeAdapterForHTML {
 	
 	public JFaceNodeAdapterForJs(JFaceNodeAdapterFactory adapterFactory) {
 		super(adapterFactory);
 	}
 	
-	private ICompilationUnit lazyCu;
+	private IJavaScriptUnit lazyCu;
 	private IProgressMonitor monitor;
-	private JavaElementLabelProvider javaElementLabelProvider;
+	private JavaScriptElementLabelProvider javaElementLabelProvider;
 	
 	public Object[] getChildren(Object object) {
-		if (object instanceof IJavaElement) {
+		if (object instanceof IJavaScriptElement) {
 			return getJavaElementProvider().getChildren(object);
 		}
 		if (object instanceof IJavaWebNode) {
 			JavaElement enclosedElement = (JavaElement) ((IJavaWebNode) object).getJavaElement();
 			if (enclosedElement != null) {
 				try {
-					IJavaElement[] children = enclosedElement.getChildren();
+					IJavaScriptElement[] children = enclosedElement.getChildren();
 					if (children == null) {
-						return new IJavaElement[0];
+						return new IJavaScriptElement[0];
 					}
 					Object[] nodes = new Object[children.length];
 					Node parent = ((IJavaWebNode) object).getParentNode();
 					
 					for (int i = 0; i < children.length; i++) {
-						int htmllength = ((SourceRefElement) (children[i])).getSourceRange().getLength();
-						int htmloffset = ((SourceRefElement) (children[i])).getSourceRange().getOffset();
+					//	int htmllength = ((SourceRefElement) (children[i])).getSourceRange().getLength();
+					//	int htmloffset = ((SourceRefElement) (children[i])).getSourceRange().getOffset();
+						IJavaScriptElement javaElement = children[i];
+						ISourceRange range = null;
+						if (javaElement instanceof Member) {
+								range = ((IMember) javaElement).getNameRange();
+						} else {
+								range = ((ISourceReference) javaElement).getSourceRange();
+						}
+						int htmllength = range.getLength();
+						int htmloffset = range.getOffset();
+
+						
 						Position position = new Position(htmloffset, htmllength);
-						nodes[i] = getJsNode(parent, children[i], position);
+						nodes[i] = getJsNode(parent, javaElement, position);
 					}
 					return nodes;
-				} catch (JavaModelException ex) {
+				} catch (JavaScriptModelException ex) {
 				}
 			}
 		}
@@ -84,13 +115,13 @@
 	protected boolean matches(Object elementObj) {
 		
 		if( elementObj instanceof IJavaWebNode ){
-			IJavaElement element = ((IJavaWebNode)elementObj).getJavaElement();
-			if (element.getElementType() == IJavaElement.TYPE && element.getParent().getElementType() == IJavaElement.COMPILATION_UNIT ) {
+			IJavaScriptElement element = ((IJavaWebNode)elementObj).getJavaElement();
+			if (element.getElementType() == IJavaScriptElement.TYPE && element.getParent().getElementType() == IJavaScriptElement.JAVASCRIPT_UNIT ) {
 				
 				IType type = (IType)element;
 				try {
 					return type.isAnonymous();
-				} catch (JavaModelException e) {
+				} catch (JavaScriptModelException e) {
 					// TODO Auto-generated catch block
 					e.printStackTrace();
 				}
@@ -129,85 +160,103 @@
 	}
 	
 	public Object[] getElements(Object object) {
-		if (object instanceof IJavaElement) {
+		if (object instanceof IJavaScriptElement) {
 			return getJavaElementProvider().getElements(object);
 		}
 		return super.getElements(object);
 	}
 	
-	private JavaElementLabelProvider getJavaElementLabelProvider() {
+	private JavaScriptElementLabelProvider getJavaElementLabelProvider() {
 		if(javaElementLabelProvider==null) {
-			javaElementLabelProvider = new JavaElementLabelProvider();
+			javaElementLabelProvider = new JavaScriptElementLabelProvider();
 		}
 		return javaElementLabelProvider;
 	}
 	
-	private StandardJavaElementContentProvider getJavaElementProvider() {
-		return new StandardJavaElementContentProvider(true);
+	private StandardJavaScriptElementContentProvider getJavaElementProvider() {
+		return new StandardJavaScriptElementContentProvider(true);
 	}
 	
-	private Object[] filterChildrenForRange(IJavaElement[] allChildren, Node node) {
+	private Object[] filterChildrenForRange(IJavaScriptElement[] allChildren, Node node) {
+	//	int javaPositionStart = ((NodeImpl) node).getStartOffset();
+	//	int javaPositionEnd   = ((NodeImpl) node).getEndOffset();
+		
+	//	Object[] result =new Object[0];
+		
+		int javaPositionEnd = ((NodeImpl) node).getEndOffset();
 		int javaPositionStart = ((NodeImpl) node).getStartOffset();
-		int javaPositionEnd   = ((NodeImpl) node).getEndOffset();
-		
-		Object[] result =new Object[0];
-		
-		
+
 		Vector validChildren = new Vector();
 		for (int i = 0; i < allChildren.length; i++) {
-			if (allChildren[i] instanceof IJavaElement && allChildren[i].getElementType() != IJavaElement.PACKAGE_DECLARATION) {
+			if (allChildren[i] instanceof IJavaScriptElement) {
 				ISourceRange range = null;
-				if (allChildren[i]  instanceof SourceRefElement) {
+				if (allChildren[i] instanceof Member) {
+					try {
+						range = ((Member) allChildren[i]).getNameRange();
+					} catch (JavaScriptModelException e) {
+											// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+				} else if (allChildren[i]  instanceof SourceRefElement) {
 					try {
 						range = ((SourceRefElement)allChildren[i] ).getSourceRange();
-					} catch (JavaModelException e) {
+					} catch (JavaScriptModelException e) {
 						// TODO Auto-generated catch block
 						e.printStackTrace();
 					}
 				}
-				if (allChildren[i].getElementType() == IJavaElement.TYPE || (javaPositionStart <= range.getOffset() && range.getLength() + range.getOffset() <= (javaPositionEnd))) {
+				if (allChildren[i].getElementType() == IJavaScriptElement.TYPE || (javaPositionStart <= range.getOffset() && range.getLength() + range.getOffset() <= (javaPositionEnd))) {
 					
-				int htmllength = range==null?0:range.getLength();
-				int htmloffset = range==null?0:range.getOffset();
-				if(htmllength<0 || htmloffset<0) {
-					continue;
-				}
-				Position position = new Position(htmloffset, htmllength);
-				validChildren.add( getJsNode(node.getParentNode(), allChildren[i], position));
+					
+							int htmllength = range == null ? 0 : range.getLength();
+							int htmloffset = range == null ? 0 : range.getOffset();
+							if (htmllength < 0 || htmloffset < 0) {
+								continue;
+							}
+							Position position = new Position(htmloffset, htmllength);
+							validChildren.add(getJsNode(node.getParentNode(), allChildren[i], position));
 					
 				
 				}
 			}
 		}
+		Object[] result = new Object[0];
+
+
 		if (validChildren.size() > 0) {
 			result = validChildren.toArray();
 		}
 		if (result == null || result.length == 0) {
-			return new IJavaElement[0];
+			return new IJavaScriptElement[0];
 		}
 		return result;
 	}
 	
 	private synchronized Object[] getJSElementsFromNode(Node node, boolean ensureConsistant) {
 				
-		int startOffset = 0;
-		int endOffset = 0;
-		int type = node.getNodeType();
+//		int startOffset = 0;
+//		int endOffset = 0;
+//		int type = node.getNodeType();
 		Object[] result = null;
-		JsTranslation translation = null;
+		//JsTranslation translation = null;
 		if (node.getNodeType() == Node.TEXT_NODE && (node instanceof NodeImpl)) {
-			startOffset = ((NodeImpl) node).getStartOffset();
-			endOffset = ((NodeImpl) node).getEndOffset();
-			ICompilationUnit unit = getLazyCu(node);
+//			startOffset = ((NodeImpl) node).getStartOffset();
+//			endOffset = ((NodeImpl) node).getEndOffset();
+			IJavaScriptUnit unit = getLazyCu(node);
+	        // Genuitec Begin Fix 6149: Exception opening external HTML file
+			if (unit == null) {
+			    return new Object[0];
+			}
+	        // Genuitec End Fix 6149: Exception opening external HTML file
 			try {
 				if(ensureConsistant) unit.makeConsistent(getProgressMonitor());
-			} catch (JavaModelException ex1) {
+			} catch (JavaScriptModelException ex1) {
 				// TODO Auto-generated catch block
 				ex1.printStackTrace();
 			}
 			try {
 				result = filterChildrenForRange(unit.getChildren(),node);
-			} catch (JavaModelException ex) {
+			} catch (JavaScriptModelException ex) {
 				// TODO Auto-generated catch block
 				ex.printStackTrace();
 				result = new Object[0];
@@ -229,11 +278,11 @@
 		
 	}
 	
-	private Object getJsNode(Node parent, IJavaElement root, Position position) {
+	private Object getJsNode(Node parent, IJavaScriptElement root, Position position) {
 		JsJfaceNode instance = null;
-		if (root.getElementType() == IJavaElement.TYPE) {
+		if (root.getElementType() == IJavaScriptElement.TYPE) {
 			instance = new JsJfaceNode(parent, root, position, ((SourceRefElement) root).getElementName());
-		} else if (root.getElementType() == IJavaElement.FIELD) {
+		} else if (root.getElementType() == IJavaScriptElement.FIELD) {
 			/* Field refrence, possibly to a type may need to implement later */
 			instance = new JsJfaceNode(parent, root,  position);
 		} else {
@@ -255,7 +304,7 @@
 		if (node instanceof JsJfaceNode) {
 			return ((JsJfaceNode) node).getImage();
 		}
-		if (node instanceof IJavaElement) {
+		if (node instanceof IJavaScriptElement) {
 			return getJavaElementLabelProvider().getImage(node);
 		}
 		return super.getLabelImage(node);
@@ -266,7 +315,7 @@
 //		if (node instanceof JsJfaceNode) {
 //			return ((JsJfaceNode) node).getName();
 //		}
-		if (node instanceof IJavaElement) {
+		if (node instanceof IJavaScriptElement) {
 			return getJavaElementLabelProvider().getText(node);
 		}
 		return super.getLabelText(node);
@@ -274,18 +323,22 @@
 	
 	
 	public Object getParent(Object element) {
-		if (element instanceof IJavaElement) {
+		if (element instanceof IJavaScriptElement) {
 			return getJavaElementProvider().getParent(element);
 		}
 		return super.getParent(element);
 	}
 	
-	private ICompilationUnit getLazyCu(Node node) {
+	private IJavaScriptUnit getLazyCu(Node node) {
 		if(lazyCu==null) {
-			lazyCu = getTranslation(node).getCompilationUnit();
+			IJsTranslation tran = getTranslation(node);
+			if(tran== null) return null;
+			lazyCu = tran.getCompilationUnit();
+			if(lazyCu==null) return null;
+			
 			try {
 				lazyCu.makeConsistent( new NullProgressMonitor() );
-			} catch (JavaModelException e) {
+			} catch (JavaScriptModelException e) {
 				// TODO Auto-generated catch block
 				e.printStackTrace();
 			}
@@ -304,6 +357,7 @@
 				// model = modelManager.getModelForRead(doc);
 			}
 			IDOMModel domModel = (IDOMModel) model;
+			if(domModel == null) return null;
 			xmlDoc = domModel.getDocument();
 		} catch (Exception e) {
 			Logger.logException(e);
@@ -317,12 +371,12 @@
 			return null;
 		}
 		JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
-		return translationAdapter.getJSPTranslation(true);
+		return translationAdapter.getJsTranslation(true);
 	}
 	
 	
 	public boolean hasChildren(Object object) {
-		if (object instanceof IJavaElement) {
+		if (object instanceof IJavaScriptElement) {
 			return getJavaElementProvider().hasChildren(object);
 		}
 		Node node = (Node) object;
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JsJfaceNode.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JsJfaceNode.java
index 1f5f4f6..0f5b341 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JsJfaceNode.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JsJfaceNode.java
@@ -1,15 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.views.contentoutline;
 
 import java.util.Collection;
 
 import org.eclipse.jface.text.Position;
 import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.jsdt.core.IJavaElement;
-import org.eclipse.wst.jsdt.core.JavaModelException;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.JavaScriptModelException;
 import org.eclipse.wst.jsdt.internal.core.JavaElement;
-import org.eclipse.wst.jsdt.ui.JavaElementLabelProvider;
+import org.eclipse.wst.jsdt.ui.JavaScriptElementLabelProvider;
 import org.eclipse.wst.jsdt.web.core.internal.Logger;
-
 import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
 import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
 import org.eclipse.wst.sse.core.StructuredModelManager;
@@ -25,7 +34,14 @@
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.w3c.dom.Node;
+/**
+*
 
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JsJfaceNode extends ElementImpl implements IndexedRegion, INodeNotifier, Node, IJavaWebNode {
 	private class JsAdaptableNode extends AbstractNotifier {
 		
@@ -38,16 +54,16 @@
 	private Position fDocPosition;
 //	private Node parent;
 	private String typeName;
-	//private IJavaElement dirtyElement;
+	//private IJavaScriptElement dirtyElement;
 	private boolean hasChildren;
 	//private String name;
 	private Image me;
 	
-	public JsJfaceNode(Node parent, IJavaElement originalElement, Position structureDocLocation) {
+	public JsJfaceNode(Node parent, IJavaScriptElement originalElement, Position structureDocLocation) {
 		this(parent, originalElement, structureDocLocation, null);
 	}
 	
-	public JsJfaceNode(Node parent, IJavaElement originalElement, Position structureDocLocation, String typeName) {
+	public JsJfaceNode(Node parent, IJavaScriptElement originalElement, Position structureDocLocation, String typeName) {
 		//super();
 		super(((ElementImpl)parent));
 		// super(parentObject, parentObject.getElementName());
@@ -56,11 +72,11 @@
 		this.typeName = typeName;
 		try {
 			hasChildren=((JavaElement)originalElement).hasChildren();
-		} catch (JavaModelException ex) {
+		} catch (JavaScriptModelException ex) {
 			hasChildren=false;
 		}
 		removeAttributes();
-		me = (new JavaElementLabelProvider()).getImage(originalElement);
+		me = (new JavaScriptElementLabelProvider(JavaScriptElementLabelProvider.SHOW_DEFAULT|JavaScriptElementLabelProvider.SHOW_SMALL_ICONS)).getImage(originalElement);
 	}
 	
 	public Image getImage() {
@@ -70,7 +86,7 @@
 	public boolean hasChildren() {
 //		try {
 //			return ((JavaElement)this.dirtyElement).hasChildren();
-//		} catch (JavaModelException ex) {
+//		} catch (JavaScriptModelException ex) {
 //			// TODO Auto-generated catch block
 //			ex.printStackTrace();
 //		}
@@ -137,7 +153,7 @@
 		return adaptableDomNode.getExistingAdapter(type);
 	}
 	
-	public synchronized IJavaElement getJavaElement() {
+	public synchronized IJavaScriptElement getJavaElement() {
 		/*
 		 * since this may become 'stale' we need to rediscover our element every
 		 * time we're asked
@@ -146,10 +162,10 @@
 		int startOffset = getStartOffset();
 		int endOffset = getLength();
 		if (typeName != null) {
-			IJavaElement myType = tran.getCompilationUnit().getType(typeName);
+			IJavaScriptElement myType = tran.getCompilationUnit().getType(typeName);
 			return myType;
 		}
-		IJavaElement elements[] = tran.getAllElementsInJsRange(startOffset, startOffset + endOffset);
+		IJavaScriptElement elements[] = tran.getAllElementsInJsRange(startOffset, startOffset + endOffset);
 		if (elements != null) {
 			return elements[0];
 		} else {
@@ -245,7 +261,7 @@
 			return null;
 		}
 		JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
-		return translationAdapter.getJSPTranslation(true);
+		return translationAdapter.getJsTranslation(true);
 	}
 	
 	
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/Messages.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/Messages.java
index 0811704..8a44813 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/Messages.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/Messages.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -7,6 +17,13 @@
 import java.util.ResourceBundle;
 
 /**
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*
  * @author childsb
  *
  */
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/messages.properties b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/messages.properties
index b12a983..b36e5be 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/messages.properties
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/messages.properties
@@ -1 +1,11 @@
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
 JsJfaceNode.1=error in JsJfaceNode... I couldn't retrieve my java element from the original page
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JFaceNodeAdapterForJs.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JFaceNodeAdapterForJs.java
index a510e5c..6e47c34 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JFaceNodeAdapterForJs.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JFaceNodeAdapterForJs.java
@@ -1,12 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline;
 
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.wst.html.ui.internal.contentoutline.JFaceNodeAdapterForHTML;
-import org.eclipse.wst.jsdt.core.IJavaElement;
-import org.eclipse.wst.jsdt.ui.JavaElementLabelProvider;
-import org.eclipse.wst.jsdt.ui.StandardJavaElementContentProvider;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.ui.JavaScriptElementLabelProvider;
+import org.eclipse.wst.jsdt.ui.StandardJavaScriptElementContentProvider;
 import org.eclipse.wst.jsdt.web.core.internal.Logger;
-
 import org.eclipse.wst.jsdt.web.core.javascript.IJsTranslation;
 import org.eclipse.wst.jsdt.web.core.javascript.JsTranslationAdapter;
 import org.eclipse.wst.sse.core.StructuredModelManager;
@@ -18,7 +27,14 @@
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapterFactory;
 import org.w3c.dom.Node;
+/**
+*
 
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JFaceNodeAdapterForJs extends JFaceNodeAdapterForHTML {
 	public JFaceNodeAdapterForJs(JFaceNodeAdapterFactory adapterFactory) {
 		super(adapterFactory);
@@ -26,7 +42,7 @@
 	
 	
 	public Object[] getChildren(Object object) {
-		if (object instanceof IJavaElement) {
+		if (object instanceof IJavaScriptElement) {
 			return getJavaElementProvider().getChildren(object);
 		}
 		Node node = (Node) object;
@@ -45,18 +61,18 @@
 	
 	
 	public Object[] getElements(Object object) {
-		if (object instanceof IJavaElement) {
+		if (object instanceof IJavaScriptElement) {
 			return getJavaElementProvider().getElements(object);
 		}
 		return super.getElements(object);
 	}
 	
-	private JavaElementLabelProvider getJavaElementLabelProvider() {
-		return new JavaElementLabelProvider();
+	private JavaScriptElementLabelProvider getJavaElementLabelProvider() {
+		return new JavaScriptElementLabelProvider();
 	}
 	
-	private StandardJavaElementContentProvider getJavaElementProvider() {
-		return new StandardJavaElementContentProvider(true);
+	private StandardJavaScriptElementContentProvider getJavaElementProvider() {
+		return new StandardJavaScriptElementContentProvider(true);
 	}
 	
 	private synchronized Object[] getJSElementsFromNode(Node node) {
@@ -65,8 +81,7 @@
 		}
 		int startOffset = 0;
 		int endOffset = 0;
-		int type = node.getNodeType();
-		IJavaElement[] result = null;
+		IJavaScriptElement[] result = null;
 		IJsTranslation translation = null;
 		if (node.getNodeType() == Node.TEXT_NODE && (node instanceof NodeImpl)) {
 			startOffset = ((NodeImpl) node).getStartOffset();
@@ -87,10 +102,10 @@
 // htmloffset = translation.getJspOffset(((SourceRefElement)
 // (result[i])).getSourceRange().getOffset());
 // position = new Position(htmloffset, htmllength);
-// } catch (JavaModelException e) {
+// } catch (JavaScriptModelException e) {
 // e.printStackTrace();
 // }
-// newResults[i] = getJsNode(node.getParentNode(), (IJavaElement) result[i],
+// newResults[i] = getJsNode(node.getParentNode(), (IJavaScriptElement) result[i],
 // position);
 // }
 // return newResults;
@@ -98,7 +113,7 @@
 	
 	
 	public Image getLabelImage(Object node) {
-		if (node instanceof IJavaElement) {
+		if (node instanceof IJavaScriptElement) {
 			return getJavaElementLabelProvider().getImage(node);
 		}
 		return super.getLabelImage(node);
@@ -106,7 +121,7 @@
 	
 	
 	public String getLabelText(Object node) {
-		if (node instanceof IJavaElement) {
+		if (node instanceof IJavaScriptElement) {
 			return getJavaElementLabelProvider().getText(node);
 		}
 		return super.getLabelText(node);
@@ -114,7 +129,7 @@
 	
 	
 	public Object getParent(Object element) {
-		if (element instanceof IJavaElement) {
+		if (element instanceof IJavaScriptElement) {
 			return getJavaElementProvider().getParent(element);
 		}
 		return super.getParent(element);
@@ -144,12 +159,12 @@
 			return null;
 		}
 		JsTranslationAdapter translationAdapter = (JsTranslationAdapter) xmlDoc.getAdapterFor(IJsTranslation.class);
-		return translationAdapter.getJSPTranslation(true);
+		return translationAdapter.getJsTranslation(true);
 	}
 	
 	
 	public boolean hasChildren(Object object) {
-		if (object instanceof IJavaElement) {
+		if (object instanceof IJavaScriptElement) {
 			return getJavaElementProvider().hasChildren(object);
 		}
 		Node node = (Node) object;
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsContentOutlineConfig.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsContentOutlineConfig.java
index 1cca95c..8889631 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsContentOutlineConfig.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsContentOutlineConfig.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -9,9 +19,13 @@
 import org.eclipse.wst.html.ui.views.contentoutline.HTMLContentOutlineConfiguration;
 
 /**
- * @author childsb
- * 
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JsContentOutlineConfig extends HTMLContentOutlineConfiguration {
 	public static final boolean USE_ADVANCED = false;
 	ILabelProvider fLabelProvider = null;
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsLabelProvider.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsLabelProvider.java
index 162ec4f..9c30f15 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsLabelProvider.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsLabelProvider.java
@@ -4,33 +4,37 @@
 package org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline;
 
 import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.jsdt.core.IJavaElement;
-import org.eclipse.wst.jsdt.ui.JavaElementLabelProvider;
-
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.ui.JavaScriptElementLabelProvider;
 /**
- * @author childsb copyright ibm 2007
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JsLabelProvider extends XMLLabelProvider {
-	JavaElementLabelProvider fLabelProvider = null;
+	JavaScriptElementLabelProvider fLabelProvider = null;
 	
 	
 	public Image getImage(Object o) {
-		if (o instanceof IJavaElement) {
+		if (o instanceof IJavaScriptElement) {
 			return getJavaElementLabelProvider().getImage(o);
 		}
 		return super.getImage(o);
 	}
 	
-	private JavaElementLabelProvider getJavaElementLabelProvider() {
+	private JavaScriptElementLabelProvider getJavaElementLabelProvider() {
 		if (fLabelProvider == null) {
-			fLabelProvider = new JavaElementLabelProvider();
+			fLabelProvider = new JavaScriptElementLabelProvider();
 		}
 		return fLabelProvider;
 	}
 	
 	
 	public String getText(Object o) {
-		if (o instanceof IJavaElement) {
+		if (o instanceof IJavaScriptElement) {
 			return getJavaElementLabelProvider().getText(o);
 		}
 		return super.getText(o);
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsMenuListener.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsMenuListener.java
index ff56b97..1a0fd0b 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsMenuListener.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsMenuListener.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -5,7 +15,6 @@
 
 import org.eclipse.jface.action.GroupMarker;
 import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
 import org.eclipse.jface.action.IMenuListener;
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.action.Separator;
@@ -13,19 +22,20 @@
 import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.jface.viewers.TreeSelection;
 import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.internal.InternalHandlerUtil;
 import org.eclipse.wst.jsdt.internal.ui.javaeditor.CompilationUnitEditorActionContributor;
 import org.eclipse.wst.jsdt.ui.IContextMenuConstants;
 import org.eclipse.wst.jsdt.web.ui.views.contentoutline.IJavaWebNode;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.ui.internal.IReleasable;
 import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
-
 /**
- * @author childsb
- * 
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class JsMenuListener extends XMLNodeActionManager implements IMenuListener, IReleasable {
 	public static final String EDIT_GROUP_ID = "group.edit"; //$NON-NLS-1$
 	CompilationUnitEditorActionContributor contrib;
@@ -50,9 +60,9 @@
 		return null;
 	}
 	
-	private IWorkbenchSite getWorkbenchSite() {
-		return InternalHandlerUtil.getActiveSite(fTreeViewer);
-	}
+//	private IWorkbenchSite getWorkbenchSite() {
+//		return InternalHandlerUtil.getActiveSite(fTreeViewer);
+//	}
 	
 	public void menuAboutToShow(IMenuManager manager) {
 		ISelection selection = fTreeViewer.getSelection();
@@ -65,7 +75,7 @@
 					javaCount++;
 				}
 			}
-			IContributionItem[] items = manager.getItems();
+			//IContributionItem[] items = manager.getItems();
 // manager.add(new Separator(IContextMenuConstants.GROUP_NEW));
 // menu.add(new GroupMarker(IContextMenuConstants.GROUP_GOTO));
 // menu.add(new Separator(IContextMenuConstants.GROUP_OPEN));
@@ -119,7 +129,7 @@
 //					
 //					
 //					
-// JavaPlugin.createStandardGroups(manager);
+// JavaScriptPlugin.createStandardGroups(manager);
 // String[] actionSets = JSDTActionSetUtil.getAllActionSets();
 //
 // IAction[] actions = JSDTActionSetUtil.getActionsFromSet(actionSets);
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsWebElementProvider.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsWebElementProvider.java
index 6eeb8cd..1c0db53 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsWebElementProvider.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsWebElementProvider.java
@@ -1,12 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
 package org.eclipse.wst.jsdt.web.ui.views.provisional.contentoutline;
 
-import org.eclipse.wst.jsdt.ui.StandardJavaElementContentProvider;
-
+import org.eclipse.wst.jsdt.ui.StandardJavaScriptElementContentProvider;
 /**
- * @author childsb
- * 
- */
-public class JsWebElementProvider extends StandardJavaElementContentProvider {}
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
+public class JsWebElementProvider extends StandardJavaScriptElementContentProvider {}
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/XMLLabelProvider.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/XMLLabelProvider.java
index c527497..cf5c62c 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/XMLLabelProvider.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/XMLLabelProvider.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
 /**
  * 
  */
@@ -15,9 +25,13 @@
 import org.w3c.dom.Node;
 
 /**
- * @author childsb
- * 
- */
+*
+
+* Provisional API: This class/interface is part of an interim API that is still under development and expected to
+* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+* (repeatedly) as the API evolves.
+*/
 public class XMLLabelProvider extends JFaceNodeLabelProvider {
 	boolean fShowAttributes = false;
 	
diff --git a/bundles/org.eclipse.wst.sse.core/.options b/bundles/org.eclipse.wst.sse.core/.options
index 94d01b5..50b0b16 100644
--- a/bundles/org.eclipse.wst.sse.core/.options
+++ b/bundles/org.eclipse.wst.sse.core/.options
@@ -3,6 +3,7 @@
 org.eclipse.wst.sse.core/dom/adapter/notification/time/criteria=10
 org.eclipse.wst.sse.core/structureddocument=false
 org.eclipse.wst.sse.core/filebuffers/modelmanagement=false
+org.eclipse.wst.sse.core/filebuffers/leaks=true
 org.eclipse.wst.sse.core/filebuffers/lifecycle=false
 org.eclipse.wst.sse.core/structuredmodel/lifecycle=false
 org.eclipse.wst.sse.core/structuredmodel/state=false
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jFlex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jFlex
index 96fe58a..bd7272a 100644
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jFlex
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jFlex
@@ -1,286 +1,279 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.wst.common.encoding.contentspecific.css;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.common.encoding.contentspecific.EncodingParserConstants;
-import org.eclipse.wst.common.encoding.contentspecific.HeadParserToken;
-import org.eclipse.wst.common.encoding.contentspecific.IntStack;
-import org.eclipse.wst.common.encoding.contentspecific.xml.XMLHeadTokenizerConstants;
-
-
-
-%%
-
-%{
-
-
-	private boolean hasMore = true;
-	private final static int MAX_TO_SCAN = 8000;
-	StringBuffer string = new StringBuffer();
-	// state stack for easier state handling
-	private IntStack fStateStack = new IntStack();
-	private String valueText = null;
-
-
-
-	public CSSHeadTokenizer() {
-		super();
-	}
-
-	  public void reset (Reader in) {
-	  	/* the input device */
-	  	yy_reader = in;
-
-  		/* the current state of the DFA */
-  		yy_state = 0;
-
-  		/* the current lexical state */
-  		yy_lexical_state = YYINITIAL;
-
-  		/* this buffer contains the current text to be matched and is
-  		 the source of the yytext() string */
-  		java.util.Arrays.fill(yy_buffer, (char)0);
-
-  		/* the textposition at the last accepting state */
-  		yy_markedPos = 0;
-
-  		/* the textposition at the last state to be included in yytext */
-  		yy_pushbackPos = 0;
-
-  		/* the current text position in the buffer */
-  		yy_currentPos = 0;
-
-  		/* startRead marks the beginning of the yytext() string in the buffer */
-  		yy_startRead = 0;
-
-  		/** 
-  		 * endRead marks the last character in the buffer, that has been read
-  		 * from input 
-  		 */
-  		yy_endRead = 0;
-
-  		/* number of newlines encountered up to the start of the matched text */
-  		yyline = 0;
-
-  		/* the number of characters up to the start of the matched text */
-  		yychar = 0;
-
-  		/**
-  		 * the number of characters from the last newline up to the start
-  		 * of the matched text
-  		 */
-  		yycolumn = 0; 
-
-  		/** 
-  		 * yy_atBOL == true <=> the scanner is currently at the beginning 
-  		 * of a line
-  		 */
-  		yy_atBOL = false;
-
-  		/* yy_atEOF == true <=> the scanner has returned a value for EOF */
-  		yy_atEOF = false;
-
-  		/* denotes if the user-EOF-code has already been executed */
-  		yy_eof_done = false;
-
-
-  		fStateStack.clear();
-  		
-  		hasMore = true;
-  		
-		// its a little wasteful to "throw away" first char array generated
-		// by class init (via auto generated code), but we really do want
-		// a small buffer for our head parsers.
-		if (yy_buffer.length != MAX_TO_SCAN) {
-			yy_buffer = new char[MAX_TO_SCAN];
-		}
-  		
-
-  	}
-
-
-	public final HeadParserToken getNextToken() throws IOException {
-		String context = null;
-		context = primGetNextToken();
-		HeadParserToken result = null;
-		if (valueText != null) {
-			result = createToken(context, yychar, valueText);
-			valueText = null;
-		} else {
-			result = createToken(context, yychar, yytext());
-		}
-		return result;
-	}
-
-	public final boolean hasMoreTokens() {
-		return hasMore && yychar < MAX_TO_SCAN;
-	}
-	private void pushCurrentState() {
-		fStateStack.push(yystate());
-
-	}
-
-	private void popState() {
-		yybegin(fStateStack.pop());
-	}
-	private HeadParserToken createToken(String context, int start, String text) {
-		return new HeadParserToken(context, start, text);
-	}
-	
-
-%}
-
-%eof{
-	hasMore=false;
-%eof}
-
-%public
-%class CSSHeadTokenizer
-%function primGetNextToken
-%type String
-%char
-%unicode
-%ignorecase 
-%debug
-%switch
-
-
-UTF16BE = \xFE\xFF
-UTF16LE = \xFF\xFE
-UTF83ByteBOM = \xEF\xBB\xBF
-
-//SpaceChar = [\x20\x09]
-
-
-
-// [3] S ::= (0x20 | 0x9 | 0xD | 0xA)+
-S = [\x20\x09\x0D\x0A]
-
-BeginAttribeValue = {S}* \= {S}*
-
-LineTerminator = \r|\n
-
-
-%state ST_XMLDecl
-%state CHARSET_RULE
-%state QuotedAttributeValue
-%state DQ_STRING
-%state SQ_STRING
-%state UnDelimitedString
-
-%%
-
-
-<YYINITIAL>  
-{
-	{UTF16BE}   		{hasMore = false; return EncodingParserConstants.UTF16BE;}
-	{UTF16LE}   		{hasMore = false; return EncodingParserConstants.UTF16LE;}
-	{UTF83ByteBOM}   	{hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}
-
-	// force to be started on first line, but we do allow preceeding spaces
-	^ {S}* "<\?xml" {S}+ {if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}}
-	
-	^ {S}* "@charset"     {if (yychar == 0 )  {yybegin(CHARSET_RULE); return CSSHeadTokenizerConstants.CHARSET_RULE;}}
-	
-
-}	
-
-// I don't think there's really an XML form of CSS files ... but will leave here for consistency	
-<ST_XMLDecl> 
-{
-	//"version" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;}
-	"encoding" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;}
-	// note this "forced end" once end of XML Declaration found
-	"\?>"    {yybegin(YYINITIAL);  return XMLHeadTokenizerConstants.XMLDeclEnd;}
-}	
-
-<CHARSET_RULE> 
-{
-
-	{S}*  {pushCurrentState(); yybegin(QuotedAttributeValue);}
-	";"    { yybegin(YYINITIAL);  hasMore = false; return CSSHeadTokenizerConstants.RuleEnd;}
-}
-	
-
-<QuotedAttributeValue>
-{
-	\"                      { yybegin(DQ_STRING); string.setLength(0); }
-	\'			{ yybegin(SQ_STRING); string.setLength(0); }
-	// in this state, anything other than a space character can start an undelimited string
-	{S}*.           { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);}
-
-}	
-
-
-<DQ_STRING>
-{
-
-	\"                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\?>"			{ yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"<"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	
-	">"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\/>"			{ yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	";"                      { yypushback(1); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
-	
-	.			{ string.append( yytext() ); }
-
-
-}
-
-<SQ_STRING>
-{
-
-	\'                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;}
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"%>"			{ yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"<"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	">"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\/>"			{ yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	";"                      { yypushback(1); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
-	.			{ string.append( yytext() ); }
-
-
-}
-
-<UnDelimitedString>
-{
-
-
-	{S}                     { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\?>"			{ yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"<"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	// these are a bit special, since we started an undelimit string, but found a quote ... probably indicates a missing beginning quote
-	\'			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-	\"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-	
-	">"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\/>"			{ yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	";"                      { yypushback(1); popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
-	.			{ string.append( yytext() ); }
-
-}
-
-// The "match anything" rule should always be in effect except for when looking for end of string
-// (That is, remember to update state list if/when new states added)
-<YYINITIAL, ST_XMLDecl, QuotedAttributeValue, CHARSET_RULE>
-{
-// this is the fallback (match "anything") rule  (for this scanner, input is ignored, and position advanced, if not recognized)
-.|\n              {if (yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}}
-}
-
-// this rule always in effect
-<<EOF>>         {hasMore = false; return EncodingParserConstants.EOF;}
+/*******************************************************************************

+ * Copyright (c) 2004, 2008 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+/*nlsXXX*/

+package org.eclipse.wst.css.core.internal.contenttype;

+import java.io.IOException;

+import java.io.Reader;

+

+import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;

+import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;

+

+

+

+%%

+

+%{

+

+

+	private boolean hasMore = true;

+	private final static int MAX_TO_SCAN = 8000;

+	StringBuffer string = new StringBuffer();

+	// state stack for easier state handling

+	private IntStack fStateStack = new IntStack();

+	private String valueText = null;

+

+

+

+	public CSSHeadTokenizer() {

+		super();

+	}

+

+	  public void reset (Reader in) {

+	  	/* the input device */

+	  	yy_reader = in;

+

+  		/* the current state of the DFA */

+  		yy_state = 0;

+

+  		/* the current lexical state */

+  		yy_lexical_state = YYINITIAL;

+

+  		/* this buffer contains the current text to be matched and is

+  		 the source of the yytext() string */

+  		java.util.Arrays.fill(yy_buffer, (char)0);

+

+  		/* the textposition at the last accepting state */

+  		yy_markedPos = 0;

+

+  		/* the textposition at the last state to be included in yytext */

+  		yy_pushbackPos = 0;

+

+  		/* the current text position in the buffer */

+  		yy_currentPos = 0;

+

+  		/* startRead marks the beginning of the yytext() string in the buffer */

+  		yy_startRead = 0;

+

+  		/** 

+  		 * endRead marks the last character in the buffer, that has been read

+  		 * from input 

+  		 */

+  		yy_endRead = 0;

+

+  		/* number of newlines encountered up to the start of the matched text */

+  		yyline = 0;

+

+  		/* the number of characters up to the start of the matched text */

+  		yychar = 0;

+

+  		/**

+  		 * the number of characters from the last newline up to the start

+  		 * of the matched text

+  		 */

+  		yycolumn = 0; 

+

+  		/** 

+  		 * yy_atBOL == true <=> the scanner is currently at the beginning 

+  		 * of a line

+  		 */

+  		yy_atBOL = false;

+

+  		/* yy_atEOF == true <=> the scanner has returned a value for EOF */

+  		yy_atEOF = false;

+

+  		/* denotes if the user-EOF-code has already been executed */

+  		yy_eof_done = false;

+

+

+  		fStateStack.clear();

+  		

+  		hasMore = true;

+  		

+		// its a little wasteful to "throw away" first char array generated

+		// by class init (via auto generated code), but we really do want

+		// a small buffer for our head parsers.

+		if (yy_buffer.length != MAX_TO_SCAN) {

+			yy_buffer = new char[MAX_TO_SCAN];

+		}

+  		

+

+  	}

+

+

+	public final HeadParserToken getNextToken() throws IOException {

+		String context = null;

+		context = primGetNextToken();

+		HeadParserToken result = null;

+		if (valueText != null) {

+			result = createToken(context, yychar, valueText);

+			valueText = null;

+		} else {

+			result = createToken(context, yychar, yytext());

+		}

+		return result;

+	}

+

+	public final boolean hasMoreTokens() {

+		return hasMore && yychar < MAX_TO_SCAN;

+	}

+	private void pushCurrentState() {

+		fStateStack.push(yystate());

+

+	}

+

+	private void popState() {

+		yybegin(fStateStack.pop());

+	}

+	private HeadParserToken createToken(String context, int start, String text) {

+		return new HeadParserToken(context, start, text);

+	}

+	

+

+%}

+

+%eof{

+	hasMore=false;

+%eof}

+

+%public

+%class CSSHeadTokenizer

+%function primGetNextToken

+%type String

+%char

+%unicode

+%ignorecase 

+%debug

+%switch

+

+

+UTF16BE = \xFE\xFF

+UTF16LE = \xFF\xFE

+UTF83ByteBOM = \xEF\xBB\xBF

+

+//SpaceChar = [\x20\x09]

+

+

+

+// [3] S ::= (0x20 | 0x9 | 0xD | 0xA)+

+S = [\x20\x09\x0D\x0A]

+

+//BeginAttribeValue = {S}* \= {S}*

+

+LineTerminator = \r|\n

+

+// Z is the single-byte zero character to be used in parsing double-byte files

+Z = (\x00)?

+S_UTF = {Z}{S}{Z}

+BeginAttributeValueUTF = {S_UTF}* \= {S_UTF}*

+

+%state ST_XMLDecl

+%state CHARSET_RULE

+%state QuotedAttributeValue

+%state DQ_STRING

+%state SQ_STRING

+%state UnDelimitedString

+

+%%

+

+

+<YYINITIAL>  

+{

+	{UTF16BE}   		{hasMore = false; return EncodingParserConstants.UTF16BE;}

+	{UTF16LE}   		{hasMore = false; return EncodingParserConstants.UTF16LE;}

+	{UTF83ByteBOM}   	{hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}

+

+	// force to be started on first line, but we do allow preceeding spaces

+	^ {Z}({S}{Z})* ({Z}<{Z}\?{Z}x{Z}m{Z}l{Z}){S_UTF}+ {if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}}

+	

+	^ {Z}({S}{Z})*({Z}@{Z}c{Z}h{Z}a{Z}r{Z}s{Z}e{Z}t{Z})   {if (yychar == 0 )  {yybegin(CHARSET_RULE); return CSSHeadTokenizerConstants.CHARSET_RULE;}}

+}	

+

+// I don't think there's really an XML form of CSS files ... but will leave here for consistency	

+<ST_XMLDecl> 

+{

+	//"version" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;}

+	{Z}e{Z}n{Z}c{Z}o{Z}d{Z}i{Z}n{Z}g{Z} {BeginAttributeValueUTF} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;}

+	// note this "forced end" once end of XML Declaration found

+	{Z}\?{Z}>{Z}    {yybegin(YYINITIAL);  return XMLHeadTokenizerConstants.XMLDeclEnd;}

+}	

+

+<CHARSET_RULE> 

+{

+

+	{S_UTF}*  {pushCurrentState(); yybegin(QuotedAttributeValue);}

+	{Z};{Z}    { yybegin(YYINITIAL);  hasMore = false; return CSSHeadTokenizerConstants.RuleEnd;}

+}

+	

+

+<QuotedAttributeValue>

+{

+	{Z}\"{Z}                     { yybegin(DQ_STRING); string.setLength(0); }

+	{Z}\'{Z}			{ yybegin(SQ_STRING); string.setLength(0); }

+	// in this state, anything other than a space character can start an undelimited string

+	{S_UTF}*.           { yypushback(yylength()); yybegin(UnDelimitedString); string.setLength(0);}

+

+}	

+

+

+<DQ_STRING>

+{

+

+	{Z}\"{Z}                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }

+  	{Z}{LineTerminator}{Z}        { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}\?{Z}>{Z}			{ yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}<{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	

+	{Z}>{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}\/{Z}>{Z}			{ yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z};{Z}                      { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }

+	[^\x00]			{ string.append( yytext() ); }

+

+

+}

+

+<SQ_STRING>

+{

+

+	{Z}\'{Z}                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;}

+  	{Z}{LineTerminator}{Z}        { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}%{Z}>{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}<{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}>{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}\/{Z}>{Z}			{ yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z};{Z}                      { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }

+	[^\x00]			{ string.append( yytext() ); }

+

+}

+

+<UnDelimitedString>

+{

+

+

+	{S_UTF}                     { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }

+  	{Z}{LineTerminator}{Z}        { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}\?{Z}>{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}<{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	// these are a bit special, since we started an undelimit string, but found a quote ... probably indicates a missing beginning quote

+	{Z}\'{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}

+	{Z}\"{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}

+	

+	{Z}>{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}\/{Z}>{Z}			{ yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z};{Z}                      { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }

+	[^\x00]			{ string.append( yytext() ); }

+}

+

+// The "match anything" rule should always be in effect except for when looking for end of string

+// (That is, remember to update state list if/when new states added)

+.|\n	{if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}}

+

+// this rule always in effect

+<<EOF>>         {hasMore = false; return EncodingParserConstants.EOF;}

diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.java b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.java
index 4dfc385..d2309dd 100644
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.java
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.java
@@ -1,5 +1,7 @@
+/* The following code was generated by JFlex 1.2.2 on 7/28/08 5:19 PM */
+
 /*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,20 +9,14 @@
  * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
  *******************************************************************************/
-/* The following code was generated by JFlex 1.2.2 on 1/27/04 6:42 PM */
-
 /*nlsXXX*/
-package org.eclipse.wst.common.encoding.contentspecific.css;
+package org.eclipse.wst.css.core.internal.contenttype;
 import java.io.IOException;
 import java.io.Reader;
 
-import org.eclipse.wst.common.encoding.contentspecific.EncodingParserConstants;
-import org.eclipse.wst.common.encoding.contentspecific.HeadParserToken;
-import org.eclipse.wst.common.encoding.contentspecific.IntStack;
-import org.eclipse.wst.common.encoding.contentspecific.xml.XMLHeadTokenizerConstants;
+import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
+import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;
 
 
 
@@ -28,8 +24,8 @@
 /**
  * This class is a scanner generated by 
  * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 1/27/04 6:42 PM from the specification file
- * <tt>file:/D:/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jflex</tt>
+ * on 7/28/08 5:19 PM from the specification file
+ * <tt>file:/D:/workspaces/wtp301/workspace/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jFlex</tt>
  */
 public class CSSHeadTokenizer {
 
@@ -59,14 +55,14 @@
    * Translates characters to character classes
    */
   final private static String yycmap_packed = 
-    "\11\0\1\6\1\11\2\0\1\10\22\0\1\6\1\0\1\36\2\0"+
-    "\1\41\1\0\1\37\7\0\1\40\13\0\1\35\1\12\1\7\1\34"+
-    "\1\13\1\17\1\22\1\0\1\20\1\31\1\25\1\0\1\33\1\21"+
-    "\1\32\2\0\1\16\1\15\1\27\1\30\2\0\1\23\1\24\1\26"+
-    "\3\0\1\14\10\0\1\22\1\0\1\20\1\31\1\25\1\0\1\33"+
-    "\1\21\1\32\2\0\1\16\1\15\1\27\1\30\2\0\1\23\1\24"+
-    "\1\26\3\0\1\14\102\0\1\4\3\0\1\5\17\0\1\3\16\0"+
-    "\1\1\20\0\1\3\16\0\1\1\1\2\170\0\1\2\ufe87\0";
+    "\1\11\10\0\1\6\1\10\2\0\1\7\22\0\1\6\1\0\1\37"+
+    "\2\0\1\42\1\0\1\40\7\0\1\41\13\0\1\36\1\13\1\12"+
+    "\1\35\1\14\1\20\1\23\1\0\1\21\1\32\1\26\1\0\1\34"+
+    "\1\22\1\33\2\0\1\17\1\16\1\30\1\31\2\0\1\24\1\25"+
+    "\1\27\3\0\1\15\10\0\1\23\1\0\1\21\1\32\1\26\1\0"+
+    "\1\34\1\22\1\33\2\0\1\17\1\16\1\30\1\31\2\0\1\24"+
+    "\1\25\1\27\3\0\1\15\102\0\1\4\3\0\1\5\17\0\1\3"+
+    "\16\0\1\1\20\0\1\3\16\0\1\1\1\2\170\0\1\2\ufe87\0";
 
   /** 
    * Translates characters to character classes
@@ -144,7 +140,7 @@
 
 
 	private boolean hasMore = true;
-	private final static int MAX_TO_SCAN = 1000;
+	private final static int MAX_TO_SCAN = 8000;
 	StringBuffer string = new StringBuffer();
 	// state stack for easier state handling
 	private IntStack fStateStack = new IntStack();
@@ -289,7 +285,7 @@
     char [] map = new char[0x10000];
     int i = 0;  /* index in packed string  */
     int j = 0;  /* index in unpacked array */
-    while (i < 158) {
+    while (i < 160) {
       int  count = packed.charAt(i++);
       char value = packed.charAt(i++);
       do map[j++] = value; while (--count > 0);
@@ -496,324 +492,775 @@
                 case 2: yy_isFinal = true; yy_state = 10; break yy_forNext;
                 case 3: yy_isFinal = true; yy_state = 11; break yy_forNext;
                 case 6: 
-                case 8: 
-                case 9: yy_isFinal = true; yy_state = 12; break yy_forNext;
-                case 10: yy_isFinal = true; yy_state = 13; break yy_forNext;
-                case 15: yy_isFinal = true; yy_state = 14; break yy_forNext;
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 12; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 13; break yy_forNext;
+                case 11: yy_isFinal = true; yy_state = 14; break yy_forNext;
+                case 16: yy_isFinal = true; yy_state = 15; break yy_forNext;
                 default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
               }
 
             case 2:
               switch (yy_input) {
-                case 11: yy_isFinal = true; yy_state = 15; break yy_forNext;
-                case 21: yy_isFinal = true; yy_state = 16; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 16; break yy_forNext;
+                case 12: yy_isFinal = true; yy_state = 17; break yy_forNext;
+                case 22: yy_isFinal = true; yy_state = 18; break yy_forNext;
                 default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
               }
 
             case 3:
               switch (yy_input) {
                 case 6: 
-                case 8: 
-                case 9: yy_isFinal = true; yy_state = 17; break yy_forNext;
-                case 29: yy_isFinal = true; yy_noLookAhead = true; yy_state = 18; break yy_forNext;
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 20; break yy_forNext;
+                case 30: yy_isFinal = true; yy_state = 21; break yy_forNext;
                 default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
               }
 
             case 4:
               switch (yy_input) {
                 case 6: 
-                case 8: yy_isFinal = true; yy_state = 20; break yy_forNext;
-                case 9: yy_isFinal = true; yy_state = 21; break yy_forNext;
-                case 30: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
-                case 31: yy_isFinal = true; yy_noLookAhead = true; yy_state = 23; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 19; break yy_forNext;
+                case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
+                case 8: yy_isFinal = true; yy_state = 24; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 25; break yy_forNext;
+                case 31: yy_isFinal = true; yy_state = 26; break yy_forNext;
+                case 32: yy_isFinal = true; yy_state = 27; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
               }
 
             case 5:
               switch (yy_input) {
+                case 7: 
                 case 8: 
-                case 9: 
-                case 10: 
-                case 28: yy_isFinal = true; yy_noLookAhead = true; yy_state = 25; break yy_forNext;
                 case 11: 
-                case 32: yy_isFinal = true; yy_state = 26; break yy_forNext;
-                case 29: yy_isFinal = true; yy_noLookAhead = true; yy_state = 27; break yy_forNext;
-                case 30: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 24; break yy_forNext;
+                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 30; break yy_forNext;
+                case 12: 
+                case 33: yy_isFinal = true; yy_state = 31; break yy_forNext;
+                case 30: yy_isFinal = true; yy_state = 32; break yy_forNext;
+                case 31: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
               }
 
             case 6:
               switch (yy_input) {
+                case 7: 
                 case 8: 
-                case 9: 
-                case 10: 
-                case 28: yy_isFinal = true; yy_noLookAhead = true; yy_state = 25; break yy_forNext;
-                case 32: yy_isFinal = true; yy_state = 26; break yy_forNext;
-                case 29: yy_isFinal = true; yy_noLookAhead = true; yy_state = 27; break yy_forNext;
-                case 31: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
-                case 33: yy_isFinal = true; yy_state = 29; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 24; break yy_forNext;
+                case 11: 
+                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                case 33: yy_isFinal = true; yy_state = 31; break yy_forNext;
+                case 30: yy_isFinal = true; yy_state = 32; break yy_forNext;
+                case 32: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 34; break yy_forNext;
+                case 34: yy_isFinal = true; yy_state = 35; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
               }
 
             case 7:
               switch (yy_input) {
-                case 10: 
-                case 28: yy_isFinal = true; yy_noLookAhead = true; yy_state = 25; break yy_forNext;
-                case 32: yy_isFinal = true; yy_state = 26; break yy_forNext;
-                case 11: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                case 11: 
+                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                case 33: yy_isFinal = true; yy_state = 31; break yy_forNext;
+                case 12: yy_isFinal = true; yy_state = 35; break yy_forNext;
                 case 6: 
-                case 8: 
-                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 30; break yy_forNext;
-                case 29: yy_isFinal = true; yy_noLookAhead = true; yy_state = 31; break yy_forNext;
-                case 30: 
-                case 31: yy_isFinal = true; yy_noLookAhead = true; yy_state = 32; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 24; break yy_forNext;
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 36; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 37; break yy_forNext;
+                case 30: yy_isFinal = true; yy_state = 38; break yy_forNext;
+                case 31: 
+                case 32: yy_isFinal = true; yy_state = 39; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
               }
 
             case 9:
               switch (yy_input) {
-                case 2: yy_isFinal = true; yy_noLookAhead = true; yy_state = 33; break yy_forNext;
+                case 2: yy_isFinal = true; yy_noLookAhead = true; yy_state = 40; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 10:
               switch (yy_input) {
-                case 1: yy_isFinal = true; yy_noLookAhead = true; yy_state = 34; break yy_forNext;
+                case 1: yy_isFinal = true; yy_noLookAhead = true; yy_state = 41; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 11:
               switch (yy_input) {
-                case 4: yy_state = 35; break yy_forNext;
+                case 4: yy_state = 42; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 12:
               switch (yy_input) {
                 case 6: 
-                case 8: 
-                case 9: yy_state = 36; break yy_forNext;
-                case 10: yy_state = 37; break yy_forNext;
-                case 15: yy_state = 38; break yy_forNext;
+                case 7: 
+                case 8: yy_state = 43; break yy_forNext;
+                case 9: yy_state = 44; break yy_forNext;
+                case 11: yy_state = 45; break yy_forNext;
+                case 16: yy_state = 46; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 13:
               switch (yy_input) {
-                case 11: yy_state = 39; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_state = 43; break yy_forNext;
+                case 11: yy_state = 45; break yy_forNext;
+                case 16: yy_state = 46; break yy_forNext;
+                case 9: yy_state = 47; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 14:
               switch (yy_input) {
-                case 16: yy_state = 40; break yy_forNext;
+                case 9: yy_state = 48; break yy_forNext;
+                case 12: yy_state = 49; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 15:
               switch (yy_input) {
-                case 28: yy_isFinal = true; yy_noLookAhead = true; yy_state = 41; break yy_forNext;
+                case 9: yy_state = 50; break yy_forNext;
+                case 17: yy_state = 51; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 16:
               switch (yy_input) {
-                case 23: yy_state = 42; break yy_forNext;
+                case 12: yy_state = 52; break yy_forNext;
+                case 22: yy_state = 53; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 17:
               switch (yy_input) {
+                case 9: yy_state = 54; break yy_forNext;
+                case 29: yy_isFinal = true; yy_state = 55; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 18:
+              switch (yy_input) {
+                case 9: yy_state = 56; break yy_forNext;
+                case 24: yy_state = 57; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 19:
+              switch (yy_input) {
                 case 6: 
-                case 8: 
-                case 9: yy_isFinal = true; yy_state = 17; break yy_forNext;
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 58; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 20:
               switch (yy_input) {
                 case 6: 
-                case 8: yy_isFinal = true; yy_state = 20; break yy_forNext;
-                case 9: yy_state = 43; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 19; break yy_forNext;
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
+                case 30: yy_isFinal = true; yy_state = 21; break yy_forNext;
+                default: break yy_forAction;
               }
 
             case 21:
               switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 59; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 23:
+              switch (yy_input) {
                 case 6: 
-                case 8: yy_isFinal = true; yy_state = 20; break yy_forNext;
-                case 9: yy_state = 43; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 19; break yy_forNext;
+                case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
+                case 8: yy_state = 60; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 61; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
+              }
+
+            case 24:
+              switch (yy_input) {
+                case 6: 
+                case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
+                case 8: yy_state = 60; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 61; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
+              }
+
+            case 25:
+              switch (yy_input) {
+                case 31: yy_isFinal = true; yy_state = 26; break yy_forNext;
+                case 32: yy_isFinal = true; yy_state = 27; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_state = 60; break yy_forNext;
+                default: break yy_forAction;
               }
 
             case 26:
               switch (yy_input) {
-                case 28: yy_isFinal = true; yy_noLookAhead = true; yy_state = 44; break yy_forNext;
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 62; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 27:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 63; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 29:
               switch (yy_input) {
-                case 28: yy_isFinal = true; yy_noLookAhead = true; yy_state = 45; break yy_forNext;
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 64; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 30:
+              switch (yy_input) {
+                case 7: 
+                case 8: 
+                case 11: 
+                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                case 30: yy_isFinal = true; yy_state = 32; break yy_forNext;
+                case 31: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 12: 
+                case 33: yy_state = 65; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 31:
+              switch (yy_input) {
+                case 29: yy_isFinal = true; yy_state = 32; break yy_forNext;
+                case 9: yy_state = 66; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 32:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 67; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 33:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 68; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 34:
+              switch (yy_input) {
+                case 7: 
+                case 8: 
+                case 11: 
+                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                case 30: yy_isFinal = true; yy_state = 32; break yy_forNext;
+                case 32: yy_isFinal = true; yy_state = 33; break yy_forNext;
+                case 33: yy_state = 65; break yy_forNext;
+                case 34: yy_state = 69; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 35:
               switch (yy_input) {
-                case 5: yy_isFinal = true; yy_noLookAhead = true; yy_state = 46; break yy_forNext;
+                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                case 9: yy_state = 70; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 36:
               switch (yy_input) {
-                case 6: 
-                case 8: 
-                case 9: yy_state = 36; break yy_forNext;
-                case 10: yy_state = 37; break yy_forNext;
-                case 15: yy_state = 38; break yy_forNext;
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 71; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 37:
               switch (yy_input) {
-                case 11: yy_state = 39; break yy_forNext;
+                case 11: 
+                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 36; break yy_forNext;
+                case 30: yy_isFinal = true; yy_state = 38; break yy_forNext;
+                case 31: 
+                case 32: yy_isFinal = true; yy_state = 39; break yy_forNext;
+                case 33: yy_state = 65; break yy_forNext;
+                case 12: yy_state = 69; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 38:
               switch (yy_input) {
-                case 16: yy_state = 40; break yy_forNext;
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 72; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 39:
               switch (yy_input) {
-                case 12: yy_state = 47; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 40:
-              switch (yy_input) {
-                case 17: yy_state = 48; break yy_forNext;
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 73; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 42:
               switch (yy_input) {
-                case 16: yy_state = 49; break yy_forNext;
+                case 5: yy_isFinal = true; yy_noLookAhead = true; yy_state = 74; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 43:
               switch (yy_input) {
                 case 6: 
-                case 8: yy_isFinal = true; yy_state = 20; break yy_forNext;
-                case 9: yy_state = 43; break yy_forNext;
-                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 19; break yy_forNext;
+                case 7: 
+                case 8: yy_state = 43; break yy_forNext;
+                case 9: yy_state = 44; break yy_forNext;
+                case 11: yy_state = 45; break yy_forNext;
+                case 16: yy_state = 46; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 44:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 43; break yy_forNext;
+                case 11: yy_state = 45; break yy_forNext;
+                case 16: yy_state = 46; break yy_forNext;
+                case 9: yy_state = 47; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 45:
+              switch (yy_input) {
+                case 9: yy_state = 48; break yy_forNext;
+                case 12: yy_state = 49; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 46:
+              switch (yy_input) {
+                case 9: yy_state = 50; break yy_forNext;
+                case 17: yy_state = 51; break yy_forNext;
+                default: break yy_forAction;
               }
 
             case 47:
               switch (yy_input) {
-                case 13: yy_state = 50; break yy_forNext;
+                case 11: yy_state = 45; break yy_forNext;
+                case 16: yy_state = 46; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 48:
               switch (yy_input) {
-                case 18: yy_state = 51; break yy_forNext;
+                case 12: yy_state = 49; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 49:
               switch (yy_input) {
-                case 24: yy_state = 52; break yy_forNext;
+                case 9: yy_state = 75; break yy_forNext;
+                case 13: yy_state = 76; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 50:
               switch (yy_input) {
-                case 14: yy_state = 53; break yy_forNext;
+                case 17: yy_state = 51; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 51:
               switch (yy_input) {
-                case 19: yy_state = 54; break yy_forNext;
+                case 9: yy_state = 77; break yy_forNext;
+                case 18: yy_state = 78; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 52:
               switch (yy_input) {
-                case 25: yy_state = 55; break yy_forNext;
+                case 9: yy_state = 54; break yy_forNext;
+                case 29: yy_isFinal = true; yy_state = 55; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 53:
               switch (yy_input) {
-                case 6: 
-                case 8: 
-                case 9: yy_isFinal = true; yy_state = 56; break yy_forNext;
+                case 9: yy_state = 56; break yy_forNext;
+                case 24: yy_state = 57; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 54:
               switch (yy_input) {
-                case 20: yy_state = 57; break yy_forNext;
+                case 29: yy_isFinal = true; yy_state = 55; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 55:
               switch (yy_input) {
-                case 26: yy_state = 58; break yy_forNext;
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 79; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 56:
               switch (yy_input) {
-                case 6: 
-                case 8: 
-                case 9: yy_isFinal = true; yy_state = 56; break yy_forNext;
+                case 24: yy_state = 57; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 57:
               switch (yy_input) {
-                case 21: yy_state = 59; break yy_forNext;
+                case 9: yy_state = 80; break yy_forNext;
+                case 17: yy_state = 81; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 58:
               switch (yy_input) {
-                case 23: yy_state = 60; break yy_forNext;
-                default: break yy_forAction;
-              }
-
-            case 59:
-              switch (yy_input) {
-                case 22: yy_isFinal = true; yy_noLookAhead = true; yy_state = 61; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
+                case 9: yy_state = 82; break yy_forNext;
                 default: break yy_forAction;
               }
 
             case 60:
               switch (yy_input) {
-                case 27: yy_state = 62; break yy_forNext;
+                case 6: 
+                case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
+                case 8: yy_state = 60; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 61; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
+              }
+
+            case 61:
+              switch (yy_input) {
+                case 6: 
+                case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
+                case 8: yy_state = 60; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 83; break yy_forNext;
+                default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
+              }
+
+            case 65:
+              switch (yy_input) {
+                case 29: yy_isFinal = true; yy_state = 32; break yy_forNext;
+                case 9: yy_state = 66; break yy_forNext;
                 default: break yy_forAction;
               }
 
-            case 62:
+            case 66:
               switch (yy_input) {
-                case 6: 
-                case 8: 
-                case 9: yy_state = 62; break yy_forNext;
-                case 7: yy_isFinal = true; yy_state = 63; break yy_forNext;
+                case 29: yy_isFinal = true; yy_state = 32; break yy_forNext;
                 default: break yy_forAction;
               }
 
-            case 63:
+            case 69:
+              switch (yy_input) {
+                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                case 9: yy_state = 70; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 70:
+              switch (yy_input) {
+                case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 75:
+              switch (yy_input) {
+                case 13: yy_state = 76; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 76:
+              switch (yy_input) {
+                case 9: yy_state = 84; break yy_forNext;
+                case 14: yy_state = 85; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 77:
+              switch (yy_input) {
+                case 18: yy_state = 78; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 78:
+              switch (yy_input) {
+                case 9: yy_state = 86; break yy_forNext;
+                case 19: yy_state = 87; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 80:
+              switch (yy_input) {
+                case 17: yy_state = 81; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 81:
+              switch (yy_input) {
+                case 9: yy_state = 88; break yy_forNext;
+                case 25: yy_state = 89; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 82:
               switch (yy_input) {
                 case 6: 
-                case 8: 
-                case 9: yy_isFinal = true; yy_state = 63; break yy_forNext;
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 83:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 60; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 84:
+              switch (yy_input) {
+                case 14: yy_state = 85; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 85:
+              switch (yy_input) {
+                case 9: yy_state = 90; break yy_forNext;
+                case 15: yy_state = 91; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 86:
+              switch (yy_input) {
+                case 19: yy_state = 87; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 87:
+              switch (yy_input) {
+                case 9: yy_state = 92; break yy_forNext;
+                case 20: yy_state = 93; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 88:
+              switch (yy_input) {
+                case 25: yy_state = 89; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 89:
+              switch (yy_input) {
+                case 9: yy_state = 94; break yy_forNext;
+                case 26: yy_state = 95; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 90:
+              switch (yy_input) {
+                case 15: yy_state = 91; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 91:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
+                case 9: yy_state = 97; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 92:
+              switch (yy_input) {
+                case 20: yy_state = 93; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 93:
+              switch (yy_input) {
+                case 9: yy_state = 98; break yy_forNext;
+                case 21: yy_state = 99; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 94:
+              switch (yy_input) {
+                case 26: yy_state = 95; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 95:
+              switch (yy_input) {
+                case 9: yy_state = 100; break yy_forNext;
+                case 27: yy_state = 101; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 96:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
+                case 9: yy_isFinal = true; yy_state = 102; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 97:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
+                case 9: yy_state = 103; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 98:
+              switch (yy_input) {
+                case 21: yy_state = 99; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 99:
+              switch (yy_input) {
+                case 9: yy_state = 104; break yy_forNext;
+                case 22: yy_state = 105; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 100:
+              switch (yy_input) {
+                case 27: yy_state = 101; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 101:
+              switch (yy_input) {
+                case 9: yy_state = 106; break yy_forNext;
+                case 24: yy_state = 107; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 102:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
+                case 9: yy_state = 103; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 103:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 104:
+              switch (yy_input) {
+                case 22: yy_state = 105; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 105:
+              switch (yy_input) {
+                case 9: yy_state = 108; break yy_forNext;
+                case 23: yy_isFinal = true; yy_state = 109; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 106:
+              switch (yy_input) {
+                case 24: yy_state = 107; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 107:
+              switch (yy_input) {
+                case 9: yy_state = 110; break yy_forNext;
+                case 28: yy_state = 111; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 108:
+              switch (yy_input) {
+                case 23: yy_isFinal = true; yy_state = 109; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 109:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 112; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 110:
+              switch (yy_input) {
+                case 28: yy_state = 111; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 111:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 111; break yy_forNext;
+                case 9: yy_state = 113; break yy_forNext;
+                case 10: yy_isFinal = true; yy_state = 114; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 113:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 111; break yy_forNext;
+                case 10: yy_isFinal = true; yy_state = 114; break yy_forNext;
+                case 9: yy_state = 115; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 114:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 116; break yy_forNext;
+                case 9: yy_state = 117; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 115:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_state = 111; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 116:
+              switch (yy_input) {
+                case 9: yy_isFinal = true; yy_state = 114; break yy_forNext;
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 116; break yy_forNext;
+                default: break yy_forAction;
+              }
+
+            case 117:
+              switch (yy_input) {
+                case 6: 
+                case 7: 
+                case 8: yy_isFinal = true; yy_state = 116; break yy_forNext;
                 default: break yy_forAction;
               }
 
@@ -834,31 +1281,33 @@
 
       switch (yy_action) {    
 
-        case 45: 
-          {  yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
-        case 65: break;
+        case 29: 
+        case 64: 
+          {  yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
+        case 119: break;
+        case 22: 
+        case 23: 
         case 25: 
-          {  yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
-        case 66: break;
-        case 19: 
-        case 20: 
-          {  yypushback(1); yybegin(UnDelimitedString); string.setLength(0); }
-        case 67: break;
-        case 18: 
-          {  yybegin(YYINITIAL);  hasMore = false; return CSSHeadTokenizerConstants.RuleEnd; }
-        case 68: break;
-        case 32: 
-          {  yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue; }
-        case 69: break;
-        case 44: 
-          {  yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
-        case 70: break;
         case 61: 
+        case 83: 
+          {  yypushback(yylength()); yybegin(UnDelimitedString); string.setLength(0); }
+        case 120: break;
+        case 21: 
+        case 59: 
+          {  yybegin(YYINITIAL);  hasMore = false; return CSSHeadTokenizerConstants.RuleEnd; }
+        case 121: break;
+        case 39: 
+        case 73: 
+          {  yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue; }
+        case 122: break;
+        case 109: 
+        case 112: 
           { if (yychar == 0 )  {yybegin(CHARSET_RULE); return CSSHeadTokenizerConstants.CHARSET_RULE;} }
-        case 71: break;
-        case 56: 
+        case 123: break;
+        case 96: 
+        case 102: 
           { if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;} }
-        case 72: break;
+        case 124: break;
         case 8: 
         case 9: 
         case 10: 
@@ -868,51 +1317,66 @@
         case 14: 
         case 15: 
         case 16: 
-        case 21: 
-          { if (yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;} }
-        case 73: break;
-        case 41: 
-          { yybegin(YYINITIAL);  return XMLHeadTokenizerConstants.XMLDeclEnd; }
-        case 74: break;
-        case 63: 
-          { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding; }
-        case 75: break;
-        case 3: 
         case 17: 
-          { pushCurrentState(); yybegin(QuotedAttributeValue); }
-        case 76: break;
-        case 46: 
-          { hasMore = false; return EncodingParserConstants.UTF83ByteBOM; }
-        case 77: break;
-        case 33: 
-          { hasMore = false; return EncodingParserConstants.UTF16BE; }
-        case 78: break;
-        case 34: 
-          { hasMore = false; return EncodingParserConstants.UTF16LE; }
-        case 79: break;
+        case 18: 
+        case 20: 
         case 24: 
-        case 26: 
-        case 29: 
-          {  string.append( yytext() );  }
-        case 80: break;
-        case 23: 
-          {  yybegin(SQ_STRING); string.setLength(0);  }
-        case 81: break;
-        case 22: 
-          {  yybegin(DQ_STRING); string.setLength(0);  }
-        case 82: break;
-        case 27: 
-          {  yypushback(1); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;  }
-        case 83: break;
-        case 28: 
-          {  popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;  }
-        case 84: break;
         case 30: 
-          {  yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;  }
-        case 85: break;
+        case 34: 
+        case 37: 
+          { if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;} }
+        case 125: break;
+        case 55: 
+        case 79: 
+          { yybegin(YYINITIAL);  return XMLHeadTokenizerConstants.XMLDeclEnd; }
+        case 126: break;
+        case 114: 
+        case 116: 
+          { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding; }
+        case 127: break;
+        case 3: 
+        case 19: 
+        case 58: 
+          { pushCurrentState(); yybegin(QuotedAttributeValue); }
+        case 128: break;
+        case 40: 
+          { hasMore = false; return EncodingParserConstants.UTF16BE; }
+        case 129: break;
+        case 41: 
+          { hasMore = false; return EncodingParserConstants.UTF16LE; }
+        case 130: break;
+        case 74: 
+          { hasMore = false; return EncodingParserConstants.UTF83ByteBOM; }
+        case 131: break;
+        case 28: 
         case 31: 
-          {  yypushback(1); popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;  }
-        case 86: break;
+        case 35: 
+          {  string.append( yytext() );  }
+        case 132: break;
+        case 27: 
+        case 63: 
+          {  yybegin(SQ_STRING); string.setLength(0);  }
+        case 133: break;
+        case 26: 
+        case 62: 
+          {  yybegin(DQ_STRING); string.setLength(0);  }
+        case 134: break;
+        case 32: 
+        case 67: 
+          {  yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;  }
+        case 135: break;
+        case 33: 
+        case 68: 
+          {  popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;  }
+        case 136: break;
+        case 36: 
+        case 71: 
+          {  yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;  }
+        case 137: break;
+        case 38: 
+        case 72: 
+          {  yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;  }
+        case 138: break;
         default: 
           if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
             yy_atEOF = true;
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex
index 2bc923d..8a11a4e 100644
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex
@@ -1,285 +1,306 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.wst.common.encoding.contentspecific.html;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.common.encoding.contentspecific.EncodingParserConstants;
-import org.eclipse.wst.common.encoding.contentspecific.HeadParserToken;
-import org.eclipse.wst.common.encoding.contentspecific.IntStack;
-import org.eclipse.wst.common.encoding.contentspecific.xml.XMLHeadTokenizerConstants;
-
-
-
-%%
-
-%{
-
-
-	private boolean hasMore = true;
-	private final static int MAX_TO_SCAN = 8000;
-	StringBuffer string = new StringBuffer();
-	// state stack for easier state handling
-	private IntStack fStateStack = new IntStack();
-	private String valueText = null;
-	boolean foundContentTypeValue = false;
-
-
-
-	public HTMLHeadTokenizer() {
-		super();
-	}
-
-	  public void reset (Reader in) {
-	  	/* the input device */
-	  	yy_reader = in;
-
-  		/* the current state of the DFA */
-  		yy_state = 0;
-
-  		/* the current lexical state */
-  		yy_lexical_state = YYINITIAL;
-
-  		/* this buffer contains the current text to be matched and is
-  		 the source of the yytext() string */
-  		java.util.Arrays.fill(yy_buffer, (char)0);
-
-  		/* the textposition at the last accepting state */
-  		yy_markedPos = 0;
-
-  		/* the textposition at the last state to be included in yytext */
-  		yy_pushbackPos = 0;
-
-  		/* the current text position in the buffer */
-  		yy_currentPos = 0;
-
-  		/* startRead marks the beginning of the yytext() string in the buffer */
-  		yy_startRead = 0;
-
-  		/** 
-  		 * endRead marks the last character in the buffer, that has been read
-  		 * from input 
-  		 */
-  		yy_endRead = 0;
-
-  		/* number of newlines encountered up to the start of the matched text */
-  		yyline = 0;
-
-  		/* the number of characters up to the start of the matched text */
-  		yychar = 0;
-
-  		/**
-  		 * the number of characters from the last newline up to the start
-  		 * of the matched text
-  		 */
-  		yycolumn = 0; 
-
-  		/** 
-  		 * yy_atBOL == true <=> the scanner is currently at the beginning 
-  		 * of a line
-  		 */
-  		yy_atBOL = false;
-
-  		/* yy_atEOF == true <=> the scanner has returned a value for EOF */
-  		yy_atEOF = false;
-
-  		/* denotes if the user-EOF-code has already been executed */
-  		yy_eof_done = false;
-
-
-  		fStateStack.clear();
-  		
-  		hasMore = true;
-  		
-		// its a little wasteful to "throw away" first char array generated
-		// by class init (via auto generated code), but we really do want
-		// a small buffer for our head parsers.
-		if (yy_buffer.length != MAX_TO_SCAN) {
-			yy_buffer = new char[MAX_TO_SCAN];
-		}
-  		
-
-  	}
-
-
-	public final HeadParserToken getNextToken() throws IOException {
-		String context = null;
-		context = primGetNextToken();
-		HeadParserToken result = null;
-		if (valueText != null) {
-			result = createToken(context, yychar, valueText);
-			valueText = null;
-		} else {
-			result = createToken(context, yychar, yytext());
-		}
-		return result;
-	}
-
-	public final boolean hasMoreTokens() {
-		return hasMore && yychar < MAX_TO_SCAN;
-	}
-	private void pushCurrentState() {
-		fStateStack.push(yystate());
-
-	}
-
-	private void popState() {
-		yybegin(fStateStack.pop());
-	}
-	private HeadParserToken createToken(String context, int start, String text) {
-		return new HeadParserToken(context, start, text);
-	}
-	
-
-%}
-
-%eof{
-	hasMore=false;
-%eof}
-
-%public
-%class HTMLHeadTokenizer
-%function primGetNextToken
-%type String
-%char
-%unicode
-%ignorecase 
-%debug
-%switch
-
-
-UTF16BE = \xFE\xFF
-UTF16LE = \xFF\xFE
-UTF83ByteBOM = \xEF\xBB\xBF
-
-SpaceChar = [\x20\x09]
-
-
-
-// [3] S ::= (0x20 | 0x9 | 0xD | 0xA)+
-S = [\x20\x09\x0D\x0A]
-
-BeginAttribeValue = {S}* \= {S}*
-
-LineTerminator = \r|\n
-
-
-%state ST_XMLDecl
-%state ST_META_TAG
-%state QuotedAttributeValue
-%state DQ_STRING
-%state SQ_STRING
-%state UnDelimitedString
-
-%%
-
-
-<YYINITIAL>  
-{
-	{UTF16BE}   		{hasMore = false; return EncodingParserConstants.UTF16BE;}
-	{UTF16LE}   		{hasMore = false; return EncodingParserConstants.UTF16LE;}
-	{UTF83ByteBOM}   	{hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}
-
-	// force to be started on first line, but we do allow preceeding spaces
-	^ {S}* "<\?xml" {S}+ {if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}}
-	
-	"<META "       {yybegin(ST_META_TAG); return HTMLHeadTokenizerConstants.MetaTagStart;}
-	
-
-}	
-	
-<ST_XMLDecl> 
-{
-	//"version" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;}
-	"encoding" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;}
-	// note this "forced end" once end of XML Declaration found
-	"\?>"    {yybegin(YYINITIAL);  return XMLHeadTokenizerConstants.XMLDeclEnd;}
-}	
-
-<ST_META_TAG> 
-{
-
-	"http-equiv" {S}* \= {S}* \"? "Content-Type" \"? {S}+ "content" {BeginAttribeValue}  {pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; return HTMLHeadTokenizerConstants.MetaTagContentType;}
-	">"    { yybegin(YYINITIAL);  if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd;}
-	"\/>"    { yybegin(YYINITIAL); if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd;}
-}
-	
-
-<QuotedAttributeValue>
-{
-	\"                      { yybegin(DQ_STRING); string.setLength(0); }
-	\'			{ yybegin(SQ_STRING); string.setLength(0); }
-	// in this state, anything other than a space character can start an undelimited string
-	{S}*.           { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);}
-
-}	
-
-
-<DQ_STRING>
-{
-
-	\"                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\?>"			{ yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"<"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	
-	">"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\/>"			{ yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	.			{ string.append( yytext() ); }
-
-
-}
-
-<SQ_STRING>
-{
-
-	\'                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;}
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"%>"			{ yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"<"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	">"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\/>"			{ yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	.			{ string.append( yytext() ); }
-
-
-}
-
-<UnDelimitedString>
-{
-
-
-	// note this initial special case for HTTP contenttype values
-	";"{S}*			{ string.append( yytext() ); }
-	{S}                     { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\?>"			{ yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"<"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	// these are a bit special, since we started an undelimit string, but found a quote ... probably indicates a missing beginning quote
-	\'			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-	\"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-	
-	">"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\/>"			{ yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	.			{ string.append( yytext() ); }
-
-}
-
-// The "match anything" rule should always be in effect except for when looking for end of string
-// (That is, remember to update state list if/when new states added)
-<YYINITIAL, ST_XMLDecl, QuotedAttributeValue, ST_META_TAG>
-{
-// this is the fallback (match "anything") rule  (for this scanner, input is ignored, and position advanced, if not recognized)
-.|\n              {if (yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}}
-}
-
-// this rule always in effect
-<<EOF>>         {hasMore = false; return EncodingParserConstants.EOF;}
+/*******************************************************************************

+ * Copyright (c) 2004, 2010 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+/*nlsXXX*/

+package org.eclipse.wst.html.core.internal.contenttype;

+import java.io.IOException;

+import java.io.Reader;

+

+import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;

+import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;

+

+

+

+%%

+

+%{

+

+

+	private boolean hasMore = true;

+	private boolean hasCharsetAttr = false;

+	private final static int MAX_TO_SCAN = 8000;

+	StringBuffer string = new StringBuffer();

+	// state stack for easier state handling

+	private IntStack fStateStack = new IntStack();

+	private String valueText = null;

+	boolean foundContentTypeValue = false;

+

+

+

+	public HTMLHeadTokenizer() {

+		super();

+	}

+

+	  public void reset (Reader in) {

+	  	/* the input device */

+	  	yy_reader = in;

+

+  		/* the current state of the DFA */

+  		yy_state = 0;

+

+  		/* the current lexical state */

+  		yy_lexical_state = YYINITIAL;

+

+  		/* this buffer contains the current text to be matched and is

+  		 the source of the yytext() string */

+  		java.util.Arrays.fill(yy_buffer, (char)0);

+

+  		/* the textposition at the last accepting state */

+  		yy_markedPos = 0;

+

+  		/* the textposition at the last state to be included in yytext */

+  		yy_pushbackPos = 0;

+

+  		/* the current text position in the buffer */

+  		yy_currentPos = 0;

+

+  		/* startRead marks the beginning of the yytext() string in the buffer */

+  		yy_startRead = 0;

+

+  		/** 

+  		 * endRead marks the last character in the buffer, that has been read

+  		 * from input 

+  		 */

+  		yy_endRead = 0;

+

+  		/* number of newlines encountered up to the start of the matched text */

+  		// yyline = 0;

+

+  		/* the number of characters up to the start of the matched text */

+  		yychar = 0;

+

+  		/**

+  		 * the number of characters from the last newline up to the start

+  		 * of the matched text

+  		 */

+  		// yycolumn = 0; 

+

+  		/** 

+  		 * yy_atBOL == true <=> the scanner is currently at the beginning 

+  		 * of a line

+  		 */

+  		yy_atBOL = false;

+

+  		/* yy_atEOF == true <=> the scanner has returned a value for EOF */

+  		yy_atEOF = false;

+

+  		/* denotes if the user-EOF-code has already been executed */

+  		yy_eof_done = false;

+

+

+  		fStateStack.clear();

+  		

+  		hasMore = true;

+  		hasCharsetAttr = false;

+  		

+		// its a little wasteful to "throw away" first char array generated

+		// by class init (via auto generated code), but we really do want

+		// a small buffer for our head parsers.

+		if (yy_buffer.length != MAX_TO_SCAN) {

+			yy_buffer = new char[MAX_TO_SCAN];

+		}

+  		

+

+  	}

+

+

+	public final HeadParserToken getNextToken() throws IOException {

+		String context = null;

+		HeadParserToken result = null;

+		try {

+			context = primGetNextToken();

+		}

+		catch (IllegalStateException e) {

+			hasMore = false;

+			result = createToken(HTMLHeadTokenizerConstants.UNDEFINED, yychar, yytext());

+			while(yy_advance() != YYEOF) {}

+			return result;

+		}

+		if (valueText != null) {

+			result = createToken(context, yychar, valueText);

+			valueText = null;

+		} else {

+			result = createToken(context, yychar, yytext());

+		}

+		return result;

+	}

+

+	public final boolean hasMoreTokens() {

+		return hasMore && yychar < MAX_TO_SCAN;

+	}

+	private void pushCurrentState() {

+		fStateStack.push(yystate());

+

+	}

+	public final boolean hasCharsetAttr() {

+		return hasCharsetAttr;

+	}

+

+	private void popState() {

+		yybegin(fStateStack.pop());

+	}

+	private HeadParserToken createToken(String context, int start, String text) {

+		return new HeadParserToken(context, start, text);

+	}

+	

+

+%}

+

+%eof{

+	hasMore=false;

+%eof}

+

+%public

+%class HTMLHeadTokenizer

+%function primGetNextToken

+%type String

+%char

+%unicode

+%ignorecase 

+//%debug

+%switch

+

+

+UTF16BE = \xFE\xFF

+UTF16LE = \xFF\xFE

+UTF83ByteBOM = \xEF\xBB\xBF

+

+SpaceChar = [\x20\x09]

+

+

+

+// [3] S ::= (0x20 | 0x9 | 0xD | 0xA)+

+S = [\x20\x09\x0D\x0A]

+

+// BeginAttribeValue = {S}* \= {S}*

+

+LineTerminator = \r|\n

+

+Z = (\x00)?

+S_UTF = {Z}{S}{Z}

+BeginAttributeValueUTF = {S_UTF}* \= {S_UTF}*

+

+%state ST_XMLDecl

+%state ST_META_TAG

+%state QuotedAttributeValue

+%state DQ_STRING

+%state SQ_STRING

+%state UnDelimitedString

+%state UnDelimitedCharset

+

+%%

+

+

+<YYINITIAL>  

+{

+	{UTF16BE}   		{hasMore = false; return EncodingParserConstants.UTF16BE;}

+	{UTF16LE}   		{hasMore = false; return EncodingParserConstants.UTF16LE;}

+	{UTF83ByteBOM}   	{hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}

+

+	// force to be started on first line, but we do allow preceeding spaces

+	^ {S_UTF}* ({Z}<{Z}\?{Z}x{Z}m{Z}l{Z}){S_UTF}+ {if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}}

+	({Z}<{Z}M{Z}E{Z}T{Z}A{Z})       {yybegin(ST_META_TAG); return HTMLHeadTokenizerConstants.MetaTagStart;}

+	

+

+}	

+	

+<ST_XMLDecl> 

+{

+	//"version" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;}

+	({Z}e{Z}n{Z}c{Z}o{Z}d{Z}i{Z}n{Z}g{Z}) {BeginAttributeValueUTF} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;}

+	// note this "forced end" once end of XML Declaration found

+	({Z}\?{Z}>{Z})    {yybegin(YYINITIAL);  return XMLHeadTokenizerConstants.XMLDeclEnd;}

+}	

+

+<ST_META_TAG> 

+{

+

+//	"http-equiv" {S}* \= {S}* \"? "Content-Type" \"? {S}+ "content" {BeginAttribeValue}  {pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; return HTMLHeadTokenizerConstants.MetaTagContentType;}

+	{Z}h{Z}t{Z}t{Z}p{Z}-{Z}e{Z}q{Z}u{Z}i{Z}v{Z} {S_UTF}* \= {S_UTF}* {Z}\"?{Z} ({Z}C{Z}o{Z}n{Z}t{Z}e{Z}n{Z}t{Z}-{Z}T{Z}y{Z}p{Z}e{Z}) \"?{Z} ({S_UTF})+ ({Z}c{Z}o{Z}n{Z}t{Z}e{Z}n{Z}t{Z}) {BeginAttributeValueUTF}  {pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; return HTMLHeadTokenizerConstants.MetaTagContentType;}

+	{Z}c{Z}h{Z}a{Z}r{Z}s{Z}e{Z}t{Z} {BeginAttributeValueUTF} {pushCurrentState(); yybegin(QuotedAttributeValue); foundContentTypeValue=true; hasCharsetAttr=true; return HTMLHeadTokenizerConstants.MetaTagContentType;}

+	{Z}>{Z}    { yybegin(YYINITIAL);  if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd;}

+	{Z}\/{Z}>{Z}    { yybegin(YYINITIAL); if (foundContentTypeValue) hasMore = false; return HTMLHeadTokenizerConstants.MetaTagEnd;}

+}

+	

+

+<QuotedAttributeValue>

+{

+	{Z}\"{Z}            { yybegin(DQ_STRING); string.setLength(0); }

+	{Z}\'{Z}			{ yybegin(SQ_STRING); string.setLength(0); }

+	// in this state, anything other than a space character can start an undelimited string

+	{S_UTF}*.           { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);}

+

+}	

+

+

+<DQ_STRING>

+{

+

+	{Z}\"{Z}                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }

+  	{Z}{LineTerminator}{Z}        { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}\?{Z}>{Z}			{ yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}<{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	

+	{Z}>{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}\/{Z}>{Z}			{ yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	[^\x00]			{ string.append( yytext() ); }

+

+

+}

+

+<SQ_STRING>

+{

+

+	{Z}\'{Z}                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;}

+  	{Z}{LineTerminator}{Z}        { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}%{Z}>{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}<{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}>{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}\/{Z}>{Z}			{ yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	[^\x00]			{ string.append( yytext() ); }

+

+

+}

+

+<UnDelimitedString>

+{

+

+

+	// note this initial special case for HTTP contenttype values

+	// Look ahead and see if there are spaces, but don't append the spaces as they may be double-byte

+	// Let the next state handle removal of the \x00 and properly append spaces

+	";"/{S_UTF}*			{ pushCurrentState(); yybegin(UnDelimitedCharset); string.append( yytext() ); }

+	{S_UTF}                     { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }

+  	{Z}{LineTerminator}{Z}        { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}\?{Z}>{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}<{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	// these are a bit special, since we started an undelimit string, but found a quote ... probably indicates a missing beginning quote

+	{Z}\'{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}

+	{Z}\"{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}

+	

+	{Z}>{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}\/{Z}>{Z}			{ yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	[^\x00]			{ string.append( yytext() ); }

+

+}

+

+<UnDelimitedCharset>

+{

+	{S} { string.append( yytext() ); }

+	// For non \x00 characters, let the previous state handle it

+	[^\x00] {yypushback(1); popState(); }

+}

+

+// The "match anything" rule should always be in effect except for when looking for end of string

+// (That is, remember to update state list if/when new states added)

+.|\n	{if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}}

+

+// this rule always in effect

+<<EOF>>         {hasMore = false; return EncodingParserConstants.EOF;}

diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton
new file mode 100644
index 0000000..4a9b3f7
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton
@@ -0,0 +1,268 @@
+

+  /** this character denotes the end of file */

+  final public static int YYEOF = -1;

+

+  /** lexical states */

+---  lexical states, charmap

+

+  /* error codes */

+  final private static int YY_UNKNOWN_ERROR = 0;

+  final private static int YY_ILLEGAL_STATE = 1;

+  final private static int YY_NO_MATCH = 2;

+  final private static int YY_PUSHBACK_2BIG = 3;

+

+  /* error messages for the codes above */

+  final private static String YY_ERROR_MSG[] = {

+    "Unkown internal scanner error",

+    "Internal error: unknown state",

+    "Error: could not match input",

+    "Error: pushback value was too large"

+  };

+

+--- isFinal list

+  /** the input device */

+  private java.io.Reader yy_reader;

+

+  /** the current state of the DFA */

+  private int yy_state;

+

+  /** the current lexical state */

+  private int yy_lexical_state = YYINITIAL;

+

+  /** this buffer contains the current text to be matched and is

+      the source of the yytext() string */

+  private char yy_buffer[] = new char[16384];

+

+  /** the textposition at the last accepting state */

+  private int yy_markedPos;

+

+  /** the textposition at the last state to be included in yytext */

+  private int yy_pushbackPos;

+

+  /** the current text position in the buffer */

+  private int yy_currentPos;

+

+  /** startRead marks the beginning of the yytext() string in the buffer */

+  private int yy_startRead;

+

+  /** endRead marks the last character in the buffer, that has been read

+      from input */

+  private int yy_endRead;

+

+  /** number of newlines encountered up to the start of the matched text */

+  //private int yyline;

+

+  /** the number of characters up to the start of the matched text */

+  private int yychar;

+

+  /**

+   * the number of characters from the last newline up to the start of the 

+   * matched text

+   */

+  //private int yycolumn; 

+

+  /** 

+   * yy_atBOL == true <=> the scanner is currently at the beginning of a line

+   */

+  private boolean yy_atBOL;

+

+  /** yy_atEOF == true <=> the scanner has returned a value for EOF */

+  private boolean yy_atEOF;

+

+--- user class code

+

+  /**

+   * Creates a new scanner

+   * There is also a java.io.InputStream version of this constructor.

+   *

+   * @param   in  the java.io.Reader to read input from.

+   */

+--- constructor declaration

+

+

+  /**

+   * Gets the next input character.

+   *

+   * @return      the next character of the input stream, EOF if the

+   *              end of the stream is reached.

+   * @exception   IOException  if any I/O-Error occurs

+   */

+  private int yy_advance() throws java.io.IOException {

+

+    /* standard case */

+    if (yy_currentPos < yy_endRead) return yy_buffer[yy_currentPos++];

+

+    /* if the eof is reached, we don't need to work hard */ 

+    if (yy_atEOF) return YYEOF;

+

+    /* otherwise: need to refill the buffer */

+

+    /* first: make room (if you can) */

+    if (yy_startRead > 0) {

+      System.arraycopy(yy_buffer, yy_startRead, 

+                       yy_buffer, 0, 

+                       yy_endRead-yy_startRead);

+

+      /* translate stored positions */

+      yy_endRead-= yy_startRead;

+      yy_currentPos-= yy_startRead;

+      yy_markedPos-= yy_startRead;

+      yy_pushbackPos-= yy_startRead;

+      yy_startRead = 0;

+    }

+

+    /* is the buffer big enough? */

+    if (yy_currentPos >= yy_buffer.length) {

+      /* if not: blow it up */

+      char newBuffer[] = new char[yy_currentPos*2];

+      System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);

+      yy_buffer = newBuffer;

+    }

+

+    /* finally: fill the buffer with new input */

+    int numRead = yy_reader.read(yy_buffer, yy_endRead, 

+                                            yy_buffer.length-yy_endRead);

+

+    if ( numRead == -1 ) return YYEOF;

+

+    yy_endRead+= numRead;

+

+    return yy_buffer[yy_currentPos++];

+  }

+

+    

+  /**

+   * Closes the input stream.

+   */

+  final public void yyclose() throws java.io.IOException {

+    yy_atEOF = true;            /* indicate end of file */

+    yy_endRead = yy_startRead;  /* invalidate buffer    */

+    yy_reader.close();

+  }

+

+

+  /**

+   * Returns the current lexical state.

+   */

+  final public int yystate() {

+    return yy_lexical_state;

+  }

+

+  /**

+   * Enters a new lexical state

+   *

+   * @param newState the new lexical state

+   */

+  final public void yybegin(int newState) {

+    yy_lexical_state = newState;

+  }

+

+

+  /**

+   * Returns the text matched by the current regular expression.

+   */

+  final public String yytext() {

+    return new String( yy_buffer, yy_startRead, yy_markedPos-yy_startRead );

+  }

+

+  /**

+   * Returns the length of the matched text region.

+   */

+  final public int yylength() {

+    return yy_markedPos-yy_startRead;

+  }

+

+

+  /**

+   * Reports an error that occured while scanning.

+   *

+   * @param   errorCode  the code of the errormessage to display

+   */

+  private void yy_ScanError(int errorCode) {

+    try {

+      IllegalStateException ise = new IllegalStateException("Instance: " + System.identityHashCode(this) + " offset:" + yychar + " state:" + yystate());

+      System.out.println(YY_ERROR_MSG[errorCode] + "\n" + ise);

+      throw ise;

+    }

+    catch (ArrayIndexOutOfBoundsException e) {

+      System.out.println(YY_ERROR_MSG[YY_UNKNOWN_ERROR]);

+    }

+

+  } 

+

+

+  /**

+   * Pushes the specified amount of characters back into the input stream.

+   *

+   * They will be read again by then next call of the scanning method

+   *

+   * @param number  the number of characters to be read again.

+   *                This number must not be greater than yylength()!

+   */

+  private void yypushback(int number) {

+    if ( number > yylength() )

+      yy_ScanError(YY_PUSHBACK_2BIG);

+

+    yy_markedPos -= number;

+  }

+

+

+--- yy_doEof

+  /**

+   * Resumes scanning until the next regular expression is matched,

+   * the end of input is encountered or an I/O-Error occurs.

+   *

+   * @return      the next token

+   * @exception   IOException  if any I/O-Error occurs

+   */

+--- yylex declaration

+    int yy_input;

+    int yy_action;

+

+--- local declarations

+

+    while (true) {

+

+--- start admin (line, char, col count)

+      yy_action = -1;

+

+      yy_currentPos = yy_startRead = yy_markedPos;

+

+--- start admin (lexstate etc)

+

+      yy_forAction: {

+        while (true) {

+    

+          yy_input = yy_advance();

+

+          if ( yy_input == YYEOF ) break yy_forAction;

+

+--- line, col, char count, next transition, isFinal action

+            yy_action = yy_state; 

+            yy_markedPos = yy_currentPos; 

+--- line count update

+          }

+

+        }

+      }

+

+--- char count update

+

+      switch (yy_action) {    

+

+--- actions

+        default: 

+          if (yy_input == YYEOF && yy_startRead == yy_currentPos) {

+            yy_atEOF = true;

+--- eofvalue

+          } 

+          else {

+--- no match

+          }

+      }

+    }

+  }    

+

+--- main

+

+}

diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton.readme b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton.readme
new file mode 100644
index 0000000..eb89700
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton.readme
@@ -0,0 +1,6 @@
+The skeleton.sed file contains the modified JFlex 1.2.2 skeleton file with

+changes for use with the tokenizers within the org.eclipse.wst.sse.core.xml and

+org.eclipse.wst.sse.core.jsp plugins.

+

+The skeleton file's method definitions are copied into the generated output

+directly.

diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.jFlex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.jFlex
index be78e6a..d307389 100644
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.jFlex
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.jFlex
@@ -1,9 +1,9 @@
 /*******************************************************************************
  * Copyright (c) 2004,2008 IBM Corporation, and others.
  * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
+ * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
+ * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.java b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.java
index 2bc49ef..fe91212 100644
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.java
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.java
@@ -3,9 +3,9 @@
 /*******************************************************************************
  * Copyright (c) 2004,2008 IBM Corporation, and others.
  * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
+ * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
+ * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.java b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.java
deleted file mode 100644
index b30ce69..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.java
+++ /dev/null
@@ -1,1948 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
- *******************************************************************************/
-/* The following code was generated by JFlex 1.2.2 on 04/10/01 22:53 */
-
-/*nlsXXX*/
-package org.eclipse.wst.sse.core.css.internal.parser;
-
-import java.io.CharArrayReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.sse.core.css.internal.parser.regions.CSSTextRegionFactory;
-import org.eclipse.wst.sse.core.css.parser.CSSRegionContexts;
-import org.eclipse.wst.sse.core.css.parser.CSSTextToken;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-
-/**
- * This class is a scanner generated by 
- * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- */
-public class CSSTokenizer implements CSSRegionContexts {
-
-  /** this character denotes the end of file */
-  final public static int YYEOF = -1;
-
-  /** lexical states */
-  final public static int ST_SELECTOR_ATTRIBUTE_NAME = 11;
-  final public static int ST_IMPORT_DELIMITER = 5;
-  final public static int ST_DECLARATION_PRE_VALUE = 17;
-  final public static int ST_SELECTOR = 0;
-  final public static int ST_CHARSET_DELIMITER = 2;
-  final public static int ST_DECLARATION_VALUE = 18;
-  final public static int ST_PAGE_PSEUDO_PAGE = 8;
-  final public static int ST_IMPORT_URI = 3;
-  final public static int ST_SELECTOR_ATTRIBUTE_END = 14;
-  final public static int ST_SELECTOR_ATTRIBUTE_OPERATOR = 12;
-  final public static int ST_DECLARATION = 15;
-  final public static int ST_PAGE_DELIMITER = 9;
-  final public static int ST_SELECTOR_ATTRIBUTE_VALUE = 13;
-  final public static int ST_MEDIA_MEDIUM = 6;
-  final public static int ST_CHARSET_NAME = 1;
-  final public static int ST_IMPORT_MEDIUM = 4;
-  final public static int ST_DECLARATION_SEPARATOR = 16;
-  final public static int ST_FONT_FACE_DELIMITER = 9;
-  final public static int ST_MEDIA_DELIMITER = 7;
-  final public static int ST_SELECTOR_MODIFIER = 10;
-  final public static int YYINITIAL = 0;
-
-  /** 
-   * Translates characters to character classes
-   */
-  final private static String yycmap_packed = 
-    "\11\0\1\11\1\17\1\0\1\4\1\20\22\0\1\6\1\31\1\10"+
-    "\1\22\1\16\1\72\1\16\1\5\1\26\1\12\1\35\1\14\1\55"+
-    "\1\13\1\15\1\34\12\1\1\62\1\50\1\30\1\67\1\32\1\21"+
-    "\1\36\1\43\1\27\1\40\1\57\1\46\1\64\1\61\1\41\1\51"+
-    "\2\2\1\25\1\52\1\65\1\54\1\53\1\2\1\24\1\44\1\47"+
-    "\1\23\5\2\1\66\1\3\1\71\1\16\1\2\1\16\1\42\1\7"+
-    "\1\37\1\56\1\45\1\63\1\61\1\41\1\51\2\2\1\25\1\52"+
-    "\1\65\1\54\1\53\1\2\1\24\1\44\1\47\1\23\5\2\1\60"+
-    "\1\70\1\33\1\70\1\0\uff80\2";
-
-  /** 
-   * Translates characters to character classes
-   */
-  final private static char [] yycmap = yy_unpack_cmap(yycmap_packed);
-
-  /** 
-   * Translates a state to a row index in the transition table
-   */
-  final private static int yy_rowMap [] = { 
-        0,    59,   118,   177,   236,   295,   354,   413,   472,   531, 
-      590,   649,   708,   767,   826,   885,   944,  1003,  1062,  1121, 
-     1180,  1239,  1298,  1357,  1416,  1475,  1534,  1121,  1593,  1121, 
-     1652,  1711,  1121,  1770,  1829,  1888,  1121,  1947,  2006,  2065, 
-     2124,  2183,  2242,  1121,  2301,  2360,  2419,  1121,  1121,  2478, 
-     2537,  2596,  1121,  2655,  2714,  1121,  1121,  2773,  2832,  2891, 
-     1121,  2950,  1121,  3009,  3068,  3127,  3186,  3245,  3304,  3363, 
-     3422,  1121,  1121,  3481,  3540,  3599,  3658,  3717,  1121,  3776, 
-     3835,  3894,  3953,  4012,  4071,  1593,  1121,  4130,  1239,  4189, 
-     4248,  1416,  4307,  1475,  4366,  4425,  4484,  4543,  4602,  4661, 
-     4720,  4779,  4838,  4897,  1770,  4956,  1121,  1829,  5015,  5074, 
-     1947,  5133,  1121,  2006,  5192,  5251,  2183,  5310,  5369,  2360, 
-     5428,  5487,  2537,  5546,  5605,  1121,  2714,  2832,  5664,  5723, 
-     3068,  5782,  3127,  5841,  1121,  3186,  5900,  5959,  3363,  6018, 
-     6077,  6136,  6195,  3894,  1121,  3599,  1121,  6254,  3658,  6313, 
-     1121,  3717,  6372,  6431,  6490,  6549,  3953,  6608,  6667,  6726, 
-     4071,  6785,  1121,  4130,  6844,  1121,  6903,  6962,  7021,  7080, 
-     7139,  7198,  7257,  7316,  7375,  7434,  7493,  7552,  1770,  7611, 
-     7670,  1829,  7729,  7788,  1947,  7847,  7906,  2006,  7965,  8024, 
-     8083,  8142,  8201,  8260,  8319,  8378,  3127,  8437,  8496,  3186, 
-     8555,  8614,  8673,  8732,  8791,  3658,  8850,  8909,  3717,  8968, 
-     9027,  9086,  9145,  9204,  9263,  9322,  9381,  1121,  1121,  9440, 
-     9499,  9558,  9617,  9676,  9735,  9794,  9853,  9912,  9971, 10030, 
-    10089, 10148, 10207, 10266, 10325, 10384, 10443, 10502, 10561, 10620, 
-    10679, 10738, 10797, 10856, 10915, 10974, 11033, 11092, 11151, 11210, 
-    11269, 11328, 11387, 11446, 11505,  1121, 11564, 11623,  1121, 11682, 
-    11741, 11800, 11859, 11918, 11977, 12036, 12095, 12154, 12213,  1121, 
-    12272, 12331, 12390, 12449, 12508, 12567, 12626, 12685, 12744, 12803, 
-    12862, 12921, 12980, 13039, 13098, 13157, 13216, 11092, 13275, 13334, 
-     1121, 13393, 13452, 13511, 13570, 13629, 13688,  1121, 13747, 13806, 
-    13865, 13924, 13983, 14042, 14101, 14160, 14219, 12036, 14278, 14337, 
-    14396, 14455, 14514, 14573, 14632, 14691, 14750, 14809, 14868, 14927, 
-    14986, 15045, 15104, 15163, 15222, 15281, 15340, 13157, 15399, 15458, 
-    15517, 15576, 15635, 15694, 15753,  1121, 15812, 15871, 15930, 15989, 
-    16048, 16107, 16166, 16225, 16284, 16343, 16402, 16461, 16520, 16579, 
-    16638, 16697, 16756, 16815, 16874, 16933, 16992, 17051, 17110, 17169, 
-    17228, 17287, 17346, 17405, 17464, 17523, 17582, 17641, 17700, 17759, 
-    17818, 17877, 17936, 17995, 18054,  1121, 18113, 18172, 18231, 18290, 
-    18349, 18408, 18467, 18526, 18585, 12154, 18644, 12213, 18703, 18762, 
-    18821, 18880, 18939, 18998, 19057, 19116, 19175, 19234, 13275, 19293, 
-    13334, 19352, 19411, 19470, 19529, 19588, 19647, 19706, 19765, 19824, 
-    19883, 19942,  1121, 20001, 20060, 20119, 20178,  1121, 20237, 20296, 
-    20355,  1121, 20414, 20473, 20532, 20591, 20650, 20709, 20768, 20827, 
-    20886, 20945
-  };
-
-  /** 
-   * The packed transition table of the DFA
-   */
-  final private static String yy_packed = 
-    "\2\24\1\25\1\26\1\27\1\24\1\27\1\25\1\24"+
-    "\1\27\1\24\1\30\1\24\1\31\1\24\2\27\1\24"+
-    "\1\32\3\25\1\24\1\25\1\33\2\24\1\34\1\35"+
-    "\1\36\1\37\11\25\1\24\4\25\1\24\2\25\1\24"+
-    "\1\25\1\40\3\25\1\41\10\24\1\27\1\42\1\27"+
-    "\1\24\1\43\1\27\1\24\1\44\3\24\2\27\7\24"+
-    "\1\33\2\24\1\34\1\35\1\24\1\37\40\24\1\27"+
-    "\1\24\1\27\2\24\1\27\1\24\1\44\3\24\2\27"+
-    "\7\24\1\33\2\24\1\34\1\35\1\24\1\37\11\24"+
-    "\1\45\26\24\1\27\1\46\1\27\1\24\1\47\1\27"+
-    "\1\24\1\44\3\24\2\27\2\24\1\50\4\24\1\33"+
-    "\2\24\1\34\1\35\1\24\1\37\11\24\1\45\24\24"+
-    "\1\51\1\52\1\27\1\24\1\27\1\51\1\24\1\27"+
-    "\1\24\1\53\3\24\2\27\2\24\3\51\1\24\1\51"+
-    "\1\33\2\24\1\34\1\35\1\24\1\37\11\51\1\45"+
-    "\4\51\1\24\2\51\1\24\1\51\1\24\3\51\11\24"+
-    "\1\27\1\24\1\27\2\24\1\27\1\24\1\44\3\24"+
-    "\2\27\7\24\1\33\2\24\1\34\1\35\1\24\1\37"+
-    "\11\24\1\45\4\24\1\54\17\24\1\55\1\56\1\27"+
-    "\1\24\1\27\1\55\1\24\1\27\1\24\1\57\3\24"+
-    "\2\27\2\24\3\55\1\24\1\55\1\33\2\24\1\34"+
-    "\1\35\1\24\1\37\11\55\1\24\4\55\1\24\2\55"+
-    "\1\24\1\55\1\24\3\55\11\24\1\27\1\24\1\27"+
-    "\2\24\1\27\1\24\1\44\3\24\2\27\7\24\1\33"+
-    "\2\24\1\34\1\35\1\24\1\37\16\24\1\60\2\24"+
-    "\1\61\14\24\1\62\1\63\1\27\1\24\1\27\1\62"+
-    "\1\24\1\27\1\24\1\64\3\24\2\27\2\24\3\62"+
-    "\1\24\1\62\1\33\2\24\1\34\1\35\1\24\1\37"+
-    "\11\62\1\24\4\62\1\24\2\62\1\65\1\62\1\66"+
-    "\3\62\11\24\1\27\1\24\1\27\2\24\1\27\1\24"+
-    "\1\44\3\24\2\27\7\24\1\33\2\24\1\34\1\35"+
-    "\1\24\1\37\21\24\1\65\16\24\1\67\1\24\1\67"+
-    "\2\24\1\67\1\24\1\44\1\70\1\31\1\24\2\67"+
-    "\1\24\1\32\5\24\1\33\1\24\1\70\1\34\1\35"+
-    "\1\36\1\37\16\24\1\71\2\24\1\65\1\24\1\40"+
-    "\3\24\1\41\6\24\1\72\1\73\1\27\1\24\1\27"+
-    "\1\72\1\24\1\27\1\24\1\74\3\24\2\27\2\24"+
-    "\3\72\1\24\1\72\1\33\2\24\1\34\1\35\1\24"+
-    "\1\37\11\72\1\24\4\72\1\24\2\72\1\24\1\72"+
-    "\1\24\3\72\11\24\1\27\1\24\1\27\2\24\1\27"+
-    "\1\24\1\44\3\24\2\27\7\24\1\33\2\24\1\34"+
-    "\1\35\1\24\1\37\30\24\1\75\1\76\1\77\3\24"+
-    "\1\100\1\101\1\27\1\102\1\27\1\100\1\103\1\27"+
-    "\1\24\1\104\3\24\2\27\2\24\3\100\1\24\1\100"+
-    "\1\33\2\24\1\34\1\35\1\24\1\37\11\100\1\24"+
-    "\4\100\1\24\2\100\1\24\1\100\1\24\3\100\11\24"+
-    "\1\27\1\24\1\27\2\24\1\27\1\24\1\44\3\24"+
-    "\2\27\7\24\1\33\2\24\1\34\1\35\1\24\1\37"+
-    "\32\24\1\77\3\24\1\105\1\106\1\27\1\24\1\27"+
-    "\1\105\1\24\1\27\1\24\1\107\3\24\2\27\2\24"+
-    "\3\105\1\24\1\105\1\33\2\24\1\34\1\35\1\24"+
-    "\1\37\11\105\1\110\4\105\1\24\2\105\1\24\1\105"+
-    "\1\24\3\105\11\24\1\27\1\24\1\27\2\24\1\27"+
-    "\1\24\1\44\3\24\2\27\7\24\1\33\2\24\1\34"+
-    "\1\35\1\24\1\37\11\24\1\110\11\24\1\111\11\24"+
-    "\1\112\1\113\1\114\1\27\1\115\1\27\1\113\1\116"+
-    "\1\27\1\117\1\120\1\121\1\122\1\24\2\27\1\24"+
-    "\1\123\1\124\2\113\1\24\1\113\1\33\1\125\1\24"+
-    "\1\34\1\126\1\24\1\37\11\113\1\110\4\113\1\127"+
-    "\2\113\1\24\1\113\1\24\3\113\6\24\1\112\1\113"+
-    "\1\114\1\130\1\115\1\130\1\113\1\116\1\130\1\117"+
-    "\1\120\1\121\1\122\1\24\2\130\1\24\1\123\1\124"+
-    "\2\113\1\24\1\113\1\33\1\125\1\24\1\34\1\126"+
-    "\1\24\1\37\11\113\1\110\4\113\1\127\2\113\1\24"+
-    "\1\113\1\24\3\113\5\24\74\0\2\25\1\131\3\0"+
-    "\1\25\3\0\1\25\7\0\3\25\1\0\1\25\7\0"+
-    "\11\25\1\0\4\25\1\0\2\25\1\0\1\25\1\0"+
-    "\3\25\6\0\1\132\2\25\1\0\2\25\1\132\1\25"+
-    "\1\0\5\25\2\0\16\25\1\132\2\25\1\132\2\25"+
-    "\1\132\10\25\1\132\4\25\1\132\7\25\4\0\1\27"+
-    "\1\0\1\27\2\0\1\27\5\0\2\27\53\0\2\25"+
-    "\1\131\3\0\1\25\3\0\1\133\7\0\3\25\1\0"+
-    "\1\25\7\0\11\25\1\0\4\25\1\0\2\25\1\0"+
-    "\1\25\1\0\3\25\6\0\2\134\1\135\3\0\1\134"+
-    "\3\0\1\134\7\0\3\134\1\0\1\134\7\0\11\134"+
-    "\1\0\4\134\1\0\2\134\1\0\1\134\1\0\3\134"+
-    "\6\0\2\136\1\137\3\0\1\136\3\0\1\136\7\0"+
-    "\3\136\1\0\1\136\7\0\11\136\1\0\4\136\1\0"+
-    "\2\136\1\0\1\136\1\0\3\136\36\0\1\140\76\0"+
-    "\1\141\74\0\2\142\10\0\1\143\1\144\1\145\7\0"+
-    "\2\146\10\0\1\147\1\150\3\0\1\147\3\0\1\147"+
-    "\7\0\3\147\1\0\1\147\7\0\11\147\1\0\4\147"+
-    "\1\0\2\147\1\0\1\147\1\0\3\147\6\0\2\151"+
-    "\1\152\1\0\1\153\11\151\2\0\52\151\1\0\2\154"+
-    "\1\155\1\0\3\154\1\153\6\154\2\0\52\154\13\0"+
-    "\1\156\60\0\2\157\1\160\1\0\1\161\11\157\2\0"+
-    "\52\157\1\0\2\162\1\163\1\0\3\162\1\161\6\162"+
-    "\2\0\52\162\24\0\1\164\47\0\2\51\1\165\3\0"+
-    "\1\51\3\0\1\51\7\0\3\51\1\0\1\51\7\0"+
-    "\11\51\1\0\4\51\1\0\2\51\1\0\1\51\1\0"+
-    "\3\51\6\0\1\166\2\51\1\0\2\51\1\166\1\51"+
-    "\1\0\5\51\2\0\16\51\1\166\2\51\1\166\2\51"+
-    "\1\166\10\51\1\166\4\51\1\166\7\51\1\0\2\51"+
-    "\1\165\3\0\1\51\3\0\1\167\7\0\3\51\1\0"+
-    "\1\51\7\0\11\51\1\0\4\51\1\0\2\51\1\0"+
-    "\1\51\1\0\3\51\6\0\2\55\1\170\3\0\1\55"+
-    "\3\0\1\55\7\0\3\55\1\0\1\55\7\0\11\55"+
-    "\1\0\4\55\1\0\2\55\1\0\1\55\1\0\3\55"+
-    "\6\0\1\171\2\55\1\0\2\55\1\171\1\55\1\0"+
-    "\5\55\2\0\16\55\1\171\2\55\1\171\2\55\1\171"+
-    "\10\55\1\171\4\55\1\171\7\55\1\0\2\55\1\170"+
-    "\3\0\1\55\3\0\1\172\7\0\3\55\1\0\1\55"+
-    "\7\0\11\55\1\0\4\55\1\0\2\55\1\0\1\55"+
-    "\1\0\3\55\6\0\2\62\1\173\3\0\1\62\3\0"+
-    "\1\62\7\0\3\62\1\0\1\62\7\0\11\62\1\0"+
-    "\4\62\1\0\2\62\1\0\1\62\1\0\3\62\6\0"+
-    "\1\174\2\62\1\0\2\62\1\174\1\62\1\0\5\62"+
-    "\2\0\16\62\1\174\2\62\1\174\2\62\1\174\10\62"+
-    "\1\174\4\62\1\174\7\62\1\0\2\62\1\173\3\0"+
-    "\1\62\3\0\1\175\7\0\3\62\1\0\1\62\7\0"+
-    "\11\62\1\0\4\62\1\0\2\62\1\0\1\62\1\0"+
-    "\3\62\7\0\1\62\1\173\3\0\1\62\3\0\1\62"+
-    "\7\0\3\62\1\0\1\62\7\0\11\62\1\0\4\62"+
-    "\1\0\2\62\1\0\1\62\1\0\3\62\5\0\4\176"+
-    "\1\177\1\176\1\177\2\176\1\177\2\176\1\0\2\176"+
-    "\2\177\11\176\1\0\25\176\1\0\12\176\1\0\2\72"+
-    "\1\200\3\0\1\72\3\0\1\72\7\0\3\72\1\0"+
-    "\1\72\7\0\11\72\1\0\4\72\1\0\2\72\1\0"+
-    "\1\72\1\0\3\72\6\0\1\201\2\72\1\0\2\72"+
-    "\1\201\1\72\1\0\5\72\2\0\16\72\1\201\2\72"+
-    "\1\201\2\72\1\201\10\72\1\201\4\72\1\201\7\72"+
-    "\1\0\2\72\1\200\3\0\1\72\3\0\1\202\7\0"+
-    "\3\72\1\0\1\72\7\0\11\72\1\0\4\72\1\0"+
-    "\2\72\1\0\1\72\1\0\3\72\74\0\1\75\4\0"+
-    "\2\100\1\203\3\0\1\100\3\0\1\100\7\0\3\100"+
-    "\1\0\1\100\7\0\11\100\1\0\4\100\1\0\2\100"+
-    "\1\0\1\100\1\0\3\100\6\0\1\204\2\100\1\0"+
-    "\2\100\1\204\1\100\1\0\5\100\2\0\16\100\1\204"+
-    "\2\100\1\204\2\100\1\204\10\100\1\204\4\100\1\204"+
-    "\7\100\1\0\2\205\1\206\1\0\1\207\11\205\2\0"+
-    "\52\205\1\0\2\210\1\211\1\0\3\210\1\207\6\210"+
-    "\2\0\52\210\1\0\2\100\1\203\3\0\1\100\3\0"+
-    "\1\212\7\0\3\100\1\0\1\100\7\0\11\100\1\0"+
-    "\4\100\1\0\2\100\1\0\1\100\1\0\3\100\6\0"+
-    "\2\105\1\213\3\0\1\105\3\0\1\105\7\0\3\105"+
-    "\1\0\1\105\7\0\11\105\1\0\4\105\1\0\2\105"+
-    "\1\0\1\105\1\0\3\105\6\0\1\214\2\105\1\0"+
-    "\2\105\1\214\1\105\1\0\5\105\2\0\16\105\1\214"+
-    "\2\105\1\214\2\105\1\214\10\105\1\214\4\105\1\214"+
-    "\7\105\1\0\2\105\1\213\3\0\1\105\3\0\1\215"+
-    "\7\0\3\105\1\0\1\105\7\0\11\105\1\0\4\105"+
-    "\1\0\2\105\1\0\1\105\1\0\3\105\6\0\1\112"+
-    "\1\216\1\217\3\0\1\216\3\0\1\216\1\0\1\220"+
-    "\5\0\3\216\1\0\1\216\7\0\11\216\1\0\4\216"+
-    "\1\0\2\216\1\0\1\216\1\0\3\216\4\0\1\221"+
-    "\1\0\2\113\1\222\3\0\1\113\3\0\1\113\7\0"+
-    "\3\113\1\223\1\113\7\0\11\113\1\0\4\113\1\0"+
-    "\2\113\1\0\1\113\1\0\3\113\6\0\1\224\2\113"+
-    "\1\0\2\113\1\224\1\113\1\0\5\113\2\0\16\113"+
-    "\1\224\2\113\1\224\2\113\1\224\10\113\1\224\4\113"+
-    "\1\224\7\113\1\0\2\225\1\226\1\0\1\227\11\225"+
-    "\2\0\52\225\1\0\2\230\1\231\1\0\3\230\1\227"+
-    "\6\230\2\0\52\230\1\0\1\232\1\113\1\222\3\0"+
-    "\1\113\3\0\1\233\1\0\1\220\5\0\3\113\1\223"+
-    "\1\113\7\0\11\113\1\0\4\113\1\0\2\113\1\0"+
-    "\1\113\1\0\3\113\6\0\1\112\13\0\1\220\56\0"+
-    "\1\234\72\0\2\235\1\236\3\0\1\235\3\0\1\235"+
-    "\7\0\3\235\1\0\1\235\7\0\11\235\1\0\4\235"+
-    "\1\0\2\235\1\0\1\235\1\0\3\235\6\0\2\113"+
-    "\1\222\3\0\1\113\3\0\1\113\1\237\6\0\1\113"+
-    "\1\240\1\113\1\223\1\113\7\0\11\113\1\0\4\113"+
-    "\1\0\2\113\1\0\1\113\1\0\3\113\11\0\1\241"+
-    "\1\0\1\241\2\0\1\241\5\0\2\241\30\0\1\242"+
-    "\21\0\4\243\1\244\1\243\1\244\2\243\1\244\5\243"+
-    "\2\244\12\243\1\0\14\243\1\0\22\243\1\0\1\245"+
-    "\1\25\1\131\1\25\1\0\1\25\1\245\1\0\1\25"+
-    "\1\0\1\25\3\0\2\25\2\0\3\25\1\0\1\25"+
-    "\7\0\1\245\2\25\1\245\2\25\1\245\2\25\1\0"+
-    "\4\25\1\0\1\245\1\25\1\0\1\25\1\0\1\245"+
-    "\2\25\6\0\2\25\1\131\3\0\1\25\3\0\1\25"+
-    "\7\0\3\25\1\0\1\25\2\0\1\246\4\0\11\25"+
-    "\1\0\4\25\1\0\2\25\1\0\1\25\1\0\3\25"+
-    "\6\0\1\247\2\134\1\0\2\134\1\247\1\134\1\0"+
-    "\5\134\2\0\16\134\1\247\2\134\1\247\2\134\1\247"+
-    "\10\134\1\247\4\134\1\247\7\134\1\0\1\250\2\136"+
-    "\1\0\2\136\1\250\1\136\1\0\5\136\2\0\16\136"+
-    "\1\250\2\136\1\250\2\136\1\250\10\136\1\250\4\136"+
-    "\1\250\7\136\13\0\1\251\57\0\35\141\1\252\35\141"+
-    "\41\0\1\253\103\0\1\254\65\0\2\255\66\0\2\256"+
-    "\103\0\1\257\17\0\2\147\1\150\3\0\1\147\3\0"+
-    "\1\147\7\0\3\147\1\260\1\147\7\0\11\147\1\0"+
-    "\4\147\1\0\2\147\1\0\1\147\1\0\3\147\6\0"+
-    "\1\261\2\147\1\0\2\147\1\261\1\147\1\0\5\147"+
-    "\2\0\16\147\1\261\2\147\1\261\2\147\1\261\10\147"+
-    "\1\261\4\147\1\261\7\147\1\0\1\262\1\151\1\152"+
-    "\1\151\1\263\1\151\1\262\10\151\1\264\16\151\1\262"+
-    "\2\151\1\262\2\151\1\262\10\151\1\262\4\151\1\262"+
-    "\7\151\1\0\1\265\1\154\1\155\3\154\1\265\1\266"+
-    "\7\154\1\267\16\154\1\265\2\154\1\265\2\154\1\265"+
-    "\10\154\1\265\4\154\1\265\7\154\32\0\1\246\41\0"+
-    "\1\270\1\157\1\160\1\157\1\271\1\157\1\270\10\157"+
-    "\1\272\16\157\1\270\2\157\1\270\2\157\1\270\10\157"+
-    "\1\270\4\157\1\270\7\157\1\0\1\273\1\162\1\163"+
-    "\3\162\1\273\1\274\7\162\1\275\16\162\1\273\2\162"+
-    "\1\273\2\162\1\273\10\162\1\273\4\162\1\273\7\162"+
-    "\25\0\1\276\46\0\1\277\1\51\1\165\1\51\1\0"+
-    "\1\51\1\277\1\0\1\51\1\0\1\51\3\0\2\51"+
-    "\2\0\3\51\1\0\1\51\7\0\1\277\2\51\1\277"+
-    "\2\51\1\277\2\51\1\0\4\51\1\0\1\277\1\51"+
-    "\1\0\1\51\1\0\1\277\2\51\6\0\2\51\1\165"+
-    "\3\0\1\51\3\0\1\51\7\0\3\51\1\0\1\51"+
-    "\2\0\1\246\4\0\11\51\1\0\4\51\1\0\2\51"+
-    "\1\0\1\51\1\0\3\51\6\0\1\300\1\55\1\170"+
-    "\1\55\1\0\1\55\1\300\1\0\1\55\1\0\1\55"+
-    "\3\0\2\55\2\0\3\55\1\0\1\55\7\0\1\300"+
-    "\2\55\1\300\2\55\1\300\2\55\1\0\4\55\1\0"+
-    "\1\300\1\55\1\0\1\55\1\0\1\300\2\55\6\0"+
-    "\2\55\1\170\3\0\1\55\3\0\1\55\7\0\3\55"+
-    "\1\0\1\55\2\0\1\246\4\0\11\55\1\0\4\55"+
-    "\1\0\2\55\1\0\1\55\1\0\3\55\6\0\1\301"+
-    "\1\62\1\173\1\62\1\0\1\62\1\301\1\0\1\62"+
-    "\1\0\1\62\3\0\2\62\2\0\3\62\1\0\1\62"+
-    "\7\0\1\301\2\62\1\301\2\62\1\301\2\62\1\0"+
-    "\4\62\1\0\1\301\1\62\1\0\1\62\1\0\1\301"+
-    "\2\62\6\0\2\62\1\173\3\0\1\62\3\0\1\62"+
-    "\7\0\3\62\1\0\1\62\2\0\1\246\4\0\11\62"+
-    "\1\0\4\62\1\0\2\62\1\0\1\62\1\0\3\62"+
-    "\6\0\1\302\1\72\1\200\1\72\1\0\1\72\1\302"+
-    "\1\0\1\72\1\0\1\72\3\0\2\72\2\0\3\72"+
-    "\1\0\1\72\7\0\1\302\2\72\1\302\2\72\1\302"+
-    "\2\72\1\0\4\72\1\0\1\302\1\72\1\0\1\72"+
-    "\1\0\1\302\2\72\6\0\2\72\1\200\3\0\1\72"+
-    "\3\0\1\72\7\0\3\72\1\0\1\72\2\0\1\246"+
-    "\4\0\11\72\1\0\4\72\1\0\2\72\1\0\1\72"+
-    "\1\0\3\72\6\0\1\303\1\100\1\203\1\100\1\0"+
-    "\1\100\1\303\1\0\1\100\1\0\1\100\3\0\2\100"+
-    "\2\0\3\100\1\0\1\100\7\0\1\303\2\100\1\303"+
-    "\2\100\1\303\2\100\1\0\4\100\1\0\1\303\1\100"+
-    "\1\0\1\100\1\0\1\303\2\100\6\0\1\304\1\205"+
-    "\1\206\1\205\1\305\1\205\1\304\10\205\1\306\16\205"+
-    "\1\304\2\205\1\304\2\205\1\304\10\205\1\304\4\205"+
-    "\1\304\7\205\1\0\1\307\1\210\1\211\3\210\1\307"+
-    "\1\310\7\210\1\311\16\210\1\307\2\210\1\307\2\210"+
-    "\1\307\10\210\1\307\4\210\1\307\7\210\1\0\2\100"+
-    "\1\203\3\0\1\100\3\0\1\100\7\0\3\100\1\0"+
-    "\1\100\2\0\1\246\4\0\11\100\1\0\4\100\1\0"+
-    "\2\100\1\0\1\100\1\0\3\100\6\0\1\312\1\105"+
-    "\1\213\1\105\1\0\1\105\1\312\1\0\1\105\1\0"+
-    "\1\105\3\0\2\105\2\0\3\105\1\0\1\105\7\0"+
-    "\1\312\2\105\1\312\2\105\1\312\2\105\1\0\4\105"+
-    "\1\0\1\312\1\105\1\0\1\105\1\0\1\312\2\105"+
-    "\6\0\2\105\1\213\3\0\1\105\3\0\1\105\7\0"+
-    "\3\105\1\0\1\105\2\0\1\246\4\0\11\105\1\0"+
-    "\4\105\1\0\2\105\1\0\1\105\1\0\3\105\6\0"+
-    "\2\216\1\217\3\0\1\216\3\0\1\216\7\0\3\216"+
-    "\1\0\1\216\7\0\11\216\1\0\4\216\1\0\2\216"+
-    "\1\0\1\216\1\0\3\216\6\0\1\313\2\216\1\0"+
-    "\2\216\1\313\1\216\1\0\5\216\2\0\16\216\1\313"+
-    "\2\216\1\313\2\216\1\313\10\216\1\313\4\216\1\313"+
-    "\7\216\1\0\1\314\1\113\1\222\1\113\1\0\1\113"+
-    "\1\314\1\0\1\113\1\0\1\113\3\0\2\113\2\0"+
-    "\3\113\1\223\1\113\7\0\1\314\2\113\1\314\2\113"+
-    "\1\314\2\113\1\0\4\113\1\0\1\314\1\113\1\0"+
-    "\1\113\1\0\1\314\2\113\6\0\1\315\1\225\1\226"+
-    "\1\225\1\316\1\225\1\315\10\225\1\317\16\225\1\315"+
-    "\2\225\1\315\2\225\1\315\10\225\1\315\4\225\1\315"+
-    "\7\225\1\0\1\320\1\230\1\231\3\230\1\320\1\321"+
-    "\7\230\1\322\16\230\1\320\2\230\1\320\2\230\1\320"+
-    "\10\230\1\320\4\230\1\320\7\230\1\0\1\232\1\113"+
-    "\1\222\3\0\1\113\3\0\1\113\1\0\1\220\5\0"+
-    "\3\113\1\223\1\113\7\0\11\113\1\0\4\113\1\0"+
-    "\2\113\1\0\1\113\1\0\3\113\4\0\1\221\1\0"+
-    "\2\113\1\222\3\0\1\113\3\0\1\113\7\0\3\113"+
-    "\1\223\1\113\2\0\1\246\4\0\11\113\1\0\4\113"+
-    "\1\0\2\113\1\0\1\113\1\0\3\113\6\0\1\234"+
-    "\1\216\1\217\3\0\1\216\3\0\1\216\7\0\3\216"+
-    "\1\0\1\216\7\0\11\216\1\0\4\216\1\0\2\216"+
-    "\1\0\1\216\1\0\3\216\4\0\1\221\1\0\1\323"+
-    "\2\235\1\0\2\235\1\323\1\235\1\0\5\235\2\0"+
-    "\16\235\1\323\2\235\1\323\2\235\1\323\10\235\1\323"+
-    "\4\235\1\323\7\235\1\0\1\324\5\0\1\324\11\0"+
-    "\1\324\5\0\1\324\7\0\2\324\1\0\2\324\1\0"+
-    "\2\324\7\0\2\324\3\0\2\324\7\0\2\113\1\222"+
-    "\3\0\1\113\3\0\1\113\7\0\2\113\1\325\1\223"+
-    "\1\113\7\0\11\113\1\0\4\113\1\0\2\113\1\0"+
-    "\1\113\1\0\3\113\57\0\1\326\21\0\1\327\1\25"+
-    "\1\131\1\25\1\0\1\25\1\327\1\0\1\25\1\0"+
-    "\1\25\3\0\2\25\2\0\3\25\1\0\1\25\7\0"+
-    "\1\327\2\25\1\327\2\25\1\327\2\25\1\0\4\25"+
-    "\1\0\1\327\1\25\1\0\1\25\1\0\1\327\2\25"+
-    "\6\0\1\330\1\134\1\135\1\134\1\0\1\134\1\330"+
-    "\1\0\1\134\1\0\1\134\3\0\2\134\2\0\3\134"+
-    "\1\0\1\134\7\0\1\330\2\134\1\330\2\134\1\330"+
-    "\2\134\1\0\4\134\1\0\1\330\1\134\1\0\1\134"+
-    "\1\0\1\330\2\134\6\0\1\331\1\136\1\137\1\136"+
-    "\1\0\1\136\1\331\1\0\1\136\1\0\1\136\3\0"+
-    "\2\136\2\0\3\136\1\0\1\136\7\0\1\331\2\136"+
-    "\1\331\2\136\1\331\2\136\1\0\4\136\1\0\1\331"+
-    "\1\136\1\0\1\136\1\0\1\331\2\136\20\0\1\332"+
-    "\57\0\34\141\1\333\1\252\35\141\42\0\2\334\102\0"+
-    "\1\335\75\0\2\336\74\0\1\337\76\0\1\340\7\0"+
-    "\1\341\1\342\1\260\1\0\1\260\1\341\1\0\1\260"+
-    "\1\0\1\341\3\0\2\260\2\0\3\341\1\0\1\341"+
-    "\7\0\11\341\1\0\4\341\1\0\2\341\1\0\1\341"+
-    "\1\0\3\341\6\0\1\343\1\147\1\150\1\147\1\0"+
-    "\1\147\1\343\1\0\1\147\1\0\1\147\3\0\2\147"+
-    "\2\0\3\147\1\260\1\147\7\0\1\343\2\147\1\343"+
-    "\2\147\1\343\2\147\1\0\4\147\1\0\1\343\1\147"+
-    "\1\0\1\147\1\0\1\343\2\147\6\0\1\344\1\151"+
-    "\1\152\1\151\1\153\1\151\1\344\27\151\1\344\2\151"+
-    "\1\344\2\151\1\344\10\151\1\344\4\151\1\344\7\151"+
-    "\1\0\2\151\1\152\1\0\1\153\12\151\1\0\52\151"+
-    "\1\0\1\345\1\154\1\155\3\154\1\345\1\153\26\154"+
-    "\1\345\2\154\1\345\2\154\1\345\10\154\1\345\4\154"+
-    "\1\345\7\154\1\0\2\154\1\155\1\0\3\154\1\153"+
-    "\7\154\1\0\52\154\1\0\1\346\1\157\1\160\1\157"+
-    "\1\161\1\157\1\346\27\157\1\346\2\157\1\346\2\157"+
-    "\1\346\10\157\1\346\4\157\1\346\7\157\1\0\2\157"+
-    "\1\160\1\0\1\161\12\157\1\0\52\157\1\0\1\347"+
-    "\1\162\1\163\3\162\1\347\1\161\26\162\1\347\2\162"+
-    "\1\347\2\162\1\347\10\162\1\347\4\162\1\347\7\162"+
-    "\1\0\2\162\1\163\1\0\3\162\1\161\7\162\1\0"+
-    "\52\162\26\0\1\350\45\0\1\351\1\51\1\165\1\51"+
-    "\1\0\1\51\1\351\1\0\1\51\1\0\1\51\3\0"+
-    "\2\51\2\0\3\51\1\0\1\51\7\0\1\351\2\51"+
-    "\1\351\2\51\1\351\2\51\1\0\4\51\1\0\1\351"+
-    "\1\51\1\0\1\51\1\0\1\351\2\51\6\0\1\352"+
-    "\1\55\1\170\1\55\1\0\1\55\1\352\1\0\1\55"+
-    "\1\0\1\55\3\0\2\55\2\0\3\55\1\0\1\55"+
-    "\7\0\1\352\2\55\1\352\2\55\1\352\2\55\1\0"+
-    "\4\55\1\0\1\352\1\55\1\0\1\55\1\0\1\352"+
-    "\2\55\6\0\1\353\1\62\1\173\1\62\1\0\1\62"+
-    "\1\353\1\0\1\62\1\0\1\62\3\0\2\62\2\0"+
-    "\3\62\1\0\1\62\7\0\1\353\2\62\1\353\2\62"+
-    "\1\353\2\62\1\0\4\62\1\0\1\353\1\62\1\0"+
-    "\1\62\1\0\1\353\2\62\6\0\1\354\1\72\1\200"+
-    "\1\72\1\0\1\72\1\354\1\0\1\72\1\0\1\72"+
-    "\3\0\2\72\2\0\3\72\1\0\1\72\7\0\1\354"+
-    "\2\72\1\354\2\72\1\354\2\72\1\0\4\72\1\0"+
-    "\1\354\1\72\1\0\1\72\1\0\1\354\2\72\6\0"+
-    "\1\355\1\100\1\203\1\100\1\0\1\100\1\355\1\0"+
-    "\1\100\1\0\1\100\3\0\2\100\2\0\3\100\1\0"+
-    "\1\100\7\0\1\355\2\100\1\355\2\100\1\355\2\100"+
-    "\1\0\4\100\1\0\1\355\1\100\1\0\1\100\1\0"+
-    "\1\355\2\100\6\0\1\356\1\205\1\206\1\205\1\207"+
-    "\1\205\1\356\27\205\1\356\2\205\1\356\2\205\1\356"+
-    "\10\205\1\356\4\205\1\356\7\205\1\0\2\205\1\206"+
-    "\1\0\1\207\12\205\1\0\52\205\1\0\1\357\1\210"+
-    "\1\211\3\210\1\357\1\207\26\210\1\357\2\210\1\357"+
-    "\2\210\1\357\10\210\1\357\4\210\1\357\7\210\1\0"+
-    "\2\210\1\211\1\0\3\210\1\207\7\210\1\0\52\210"+
-    "\1\0\1\360\1\105\1\213\1\105\1\0\1\105\1\360"+
-    "\1\0\1\105\1\0\1\105\3\0\2\105\2\0\3\105"+
-    "\1\0\1\105\7\0\1\360\2\105\1\360\2\105\1\360"+
-    "\2\105\1\0\4\105\1\0\1\360\1\105\1\0\1\105"+
-    "\1\0\1\360\2\105\6\0\1\361\1\216\1\217\1\216"+
-    "\1\0\1\216\1\361\1\0\1\216\1\0\1\216\3\0"+
-    "\2\216\2\0\3\216\1\0\1\216\7\0\1\361\2\216"+
-    "\1\361\2\216\1\361\2\216\1\0\4\216\1\0\1\361"+
-    "\1\216\1\0\1\216\1\0\1\361\2\216\6\0\1\362"+
-    "\1\113\1\222\1\113\1\0\1\113\1\362\1\0\1\113"+
-    "\1\0\1\113\3\0\2\113\2\0\3\113\1\223\1\113"+
-    "\7\0\1\362\2\113\1\362\2\113\1\362\2\113\1\0"+
-    "\4\113\1\0\1\362\1\113\1\0\1\113\1\0\1\362"+
-    "\2\113\6\0\1\363\1\225\1\226\1\225\1\227\1\225"+
-    "\1\363\27\225\1\363\2\225\1\363\2\225\1\363\10\225"+
-    "\1\363\4\225\1\363\7\225\1\0\2\225\1\226\1\0"+
-    "\1\227\12\225\1\0\52\225\1\0\1\364\1\230\1\231"+
-    "\3\230\1\364\1\227\26\230\1\364\2\230\1\364\2\230"+
-    "\1\364\10\230\1\364\4\230\1\364\7\230\1\0\2\230"+
-    "\1\231\1\0\3\230\1\227\7\230\1\0\52\230\1\0"+
-    "\1\365\1\235\1\236\1\235\1\0\1\235\1\365\1\0"+
-    "\1\235\1\0\1\235\3\0\2\235\2\0\3\235\1\0"+
-    "\1\235\7\0\1\365\2\235\1\365\2\235\1\365\2\235"+
-    "\1\0\4\235\1\0\1\365\1\235\1\0\1\235\1\0"+
-    "\1\365\2\235\6\0\1\366\5\0\1\366\3\0\1\367"+
-    "\5\0\1\366\5\0\1\366\7\0\2\366\1\0\2\366"+
-    "\1\0\2\366\7\0\2\366\3\0\2\366\7\0\2\113"+
-    "\1\222\3\0\1\113\3\0\1\113\7\0\3\113\1\370"+
-    "\1\113\7\0\11\113\1\0\4\113\1\0\2\113\1\0"+
-    "\1\113\1\0\3\113\60\0\1\371\20\0\1\372\1\25"+
-    "\1\131\1\25\1\0\1\25\1\372\1\0\1\25\1\0"+
-    "\1\25\3\0\2\25\2\0\3\25\1\0\1\25\7\0"+
-    "\1\372\2\25\1\372\2\25\1\372\2\25\1\0\4\25"+
-    "\1\0\1\372\1\25\1\0\1\25\1\0\1\372\2\25"+
-    "\6\0\1\373\1\134\1\135\1\134\1\0\1\134\1\373"+
-    "\1\0\1\134\1\0\1\134\3\0\2\134\2\0\3\134"+
-    "\1\0\1\134\7\0\1\373\2\134\1\373\2\134\1\373"+
-    "\2\134\1\0\4\134\1\0\1\373\1\134\1\0\1\134"+
-    "\1\0\1\373\2\134\6\0\1\374\1\136\1\137\1\136"+
-    "\1\0\1\136\1\374\1\0\1\136\1\0\1\136\3\0"+
-    "\2\136\2\0\3\136\1\0\1\136\7\0\1\374\2\136"+
-    "\1\374\2\136\1\374\2\136\1\0\4\136\1\0\1\374"+
-    "\1\136\1\0\1\136\1\0\1\374\2\136\31\0\1\375"+
-    "\122\0\1\376\67\0\1\377\66\0\2\u0100\73\0\1\u0101"+
-    "\24\0\2\341\1\342\1\u0102\1\0\1\u0102\1\341\1\0"+
-    "\1\u0102\1\u0103\1\341\3\0\2\u0102\2\0\3\341\1\0"+
-    "\1\341\7\0\11\341\1\0\4\341\1\0\2\341\1\0"+
-    "\1\341\1\0\3\341\6\0\1\u0104\2\341\1\0\2\341"+
-    "\1\u0104\1\341\1\0\5\341\2\0\16\341\1\u0104\2\341"+
-    "\1\u0104\2\341\1\u0104\10\341\1\u0104\4\341\1\u0104\7\341"+
-    "\1\0\1\u0105\1\147\1\150\1\147\1\0\1\147\1\u0105"+
-    "\1\0\1\147\1\0\1\147\3\0\2\147\2\0\3\147"+
-    "\1\260\1\147\7\0\1\u0105\2\147\1\u0105\2\147\1\u0105"+
-    "\2\147\1\0\4\147\1\0\1\u0105\1\147\1\0\1\147"+
-    "\1\0\1\u0105\2\147\6\0\1\u0106\1\151\1\152\1\151"+
-    "\1\153\1\151\1\u0106\27\151\1\u0106\2\151\1\u0106\2\151"+
-    "\1\u0106\10\151\1\u0106\4\151\1\u0106\7\151\1\0\1\u0107"+
-    "\1\154\1\155\3\154\1\u0107\1\153\26\154\1\u0107\2\154"+
-    "\1\u0107\2\154\1\u0107\10\154\1\u0107\4\154\1\u0107\7\154"+
-    "\1\0\1\u0108\1\157\1\160\1\157\1\161\1\157\1\u0108"+
-    "\27\157\1\u0108\2\157\1\u0108\2\157\1\u0108\10\157\1\u0108"+
-    "\4\157\1\u0108\7\157\1\0\1\u0109\1\162\1\163\3\162"+
-    "\1\u0109\1\161\26\162\1\u0109\2\162\1\u0109\2\162\1\u0109"+
-    "\10\162\1\u0109\4\162\1\u0109\7\162\1\0\2\u010a\1\u010b"+
-    "\1\350\1\u010c\1\350\1\u010a\1\u010d\1\350\1\u010e\4\u010a"+
-    "\2\350\5\u010a\1\0\44\u010a\1\0\1\u010f\1\51\1\165"+
-    "\1\51\1\0\1\51\1\u010f\1\0\1\51\1\0\1\51"+
-    "\3\0\2\51\2\0\3\51\1\0\1\51\7\0\1\u010f"+
-    "\2\51\1\u010f\2\51\1\u010f\2\51\1\0\4\51\1\0"+
-    "\1\u010f\1\51\1\0\1\51\1\0\1\u010f\2\51\6\0"+
-    "\1\u0110\1\55\1\170\1\55\1\0\1\55\1\u0110\1\0"+
-    "\1\55\1\0\1\55\3\0\2\55\2\0\3\55\1\0"+
-    "\1\55\7\0\1\u0110\2\55\1\u0110\2\55\1\u0110\2\55"+
-    "\1\0\4\55\1\0\1\u0110\1\55\1\0\1\55\1\0"+
-    "\1\u0110\2\55\6\0\1\u0111\1\62\1\173\1\62\1\0"+
-    "\1\62\1\u0111\1\0\1\62\1\0\1\62\3\0\2\62"+
-    "\2\0\3\62\1\0\1\62\7\0\1\u0111\2\62\1\u0111"+
-    "\2\62\1\u0111\2\62\1\0\4\62\1\0\1\u0111\1\62"+
-    "\1\0\1\62\1\0\1\u0111\2\62\6\0\1\u0112\1\72"+
-    "\1\200\1\72\1\0\1\72\1\u0112\1\0\1\72\1\0"+
-    "\1\72\3\0\2\72\2\0\3\72\1\0\1\72\7\0"+
-    "\1\u0112\2\72\1\u0112\2\72\1\u0112\2\72\1\0\4\72"+
-    "\1\0\1\u0112\1\72\1\0\1\72\1\0\1\u0112\2\72"+
-    "\6\0\1\u0113\1\100\1\203\1\100\1\0\1\100\1\u0113"+
-    "\1\0\1\100\1\0\1\100\3\0\2\100\2\0\3\100"+
-    "\1\0\1\100\7\0\1\u0113\2\100\1\u0113\2\100\1\u0113"+
-    "\2\100\1\0\4\100\1\0\1\u0113\1\100\1\0\1\100"+
-    "\1\0\1\u0113\2\100\6\0\1\u0114\1\205\1\206\1\205"+
-    "\1\207\1\205\1\u0114\27\205\1\u0114\2\205\1\u0114\2\205"+
-    "\1\u0114\10\205\1\u0114\4\205\1\u0114\7\205\1\0\1\u0115"+
-    "\1\210\1\211\3\210\1\u0115\1\207\26\210\1\u0115\2\210"+
-    "\1\u0115\2\210\1\u0115\10\210\1\u0115\4\210\1\u0115\7\210"+
-    "\1\0\1\u0116\1\105\1\213\1\105\1\0\1\105\1\u0116"+
-    "\1\0\1\105\1\0\1\105\3\0\2\105\2\0\3\105"+
-    "\1\0\1\105\7\0\1\u0116\2\105\1\u0116\2\105\1\u0116"+
-    "\2\105\1\0\4\105\1\0\1\u0116\1\105\1\0\1\105"+
-    "\1\0\1\u0116\2\105\6\0\1\u0117\1\216\1\217\1\216"+
-    "\1\0\1\216\1\u0117\1\0\1\216\1\0\1\216\3\0"+
-    "\2\216\2\0\3\216\1\0\1\216\7\0\1\u0117\2\216"+
-    "\1\u0117\2\216\1\u0117\2\216\1\0\4\216\1\0\1\u0117"+
-    "\1\216\1\0\1\216\1\0\1\u0117\2\216\6\0\1\u0118"+
-    "\1\113\1\222\1\113\1\0\1\113\1\u0118\1\0\1\113"+
-    "\1\0\1\113\3\0\2\113\2\0\3\113\1\223\1\113"+
-    "\7\0\1\u0118\2\113\1\u0118\2\113\1\u0118\2\113\1\0"+
-    "\4\113\1\0\1\u0118\1\113\1\0\1\113\1\0\1\u0118"+
-    "\2\113\6\0\1\u0119\1\225\1\226\1\225\1\227\1\225"+
-    "\1\u0119\27\225\1\u0119\2\225\1\u0119\2\225\1\u0119\10\225"+
-    "\1\u0119\4\225\1\u0119\7\225\1\0\1\u011a\1\230\1\231"+
-    "\3\230\1\u011a\1\227\26\230\1\u011a\2\230\1\u011a\2\230"+
-    "\1\u011a\10\230\1\u011a\4\230\1\u011a\7\230\1\0\1\u011b"+
-    "\1\235\1\236\1\235\1\0\1\235\1\u011b\1\0\1\235"+
-    "\1\0\1\235\3\0\2\235\2\0\3\235\1\0\1\235"+
-    "\7\0\1\u011b\2\235\1\u011b\2\235\1\u011b\2\235\1\0"+
-    "\4\235\1\0\1\u011b\1\235\1\0\1\235\1\0\1\u011b"+
-    "\2\235\6\0\1\u011c\5\0\1\u011c\3\0\1\367\5\0"+
-    "\1\u011c\5\0\1\u011c\7\0\2\u011c\1\0\2\u011c\1\0"+
-    "\2\u011c\7\0\2\u011c\3\0\2\u011c\7\0\1\u011d\5\0"+
-    "\1\u011d\11\0\1\u011d\5\0\1\u011d\7\0\2\u011d\1\0"+
-    "\2\u011d\1\0\2\u011d\7\0\2\u011d\3\0\2\u011d\7\0"+
-    "\2\u011e\1\u011f\1\u0120\1\u0121\1\u0120\1\u011e\1\u0122\1\u0120"+
-    "\1\u0123\4\u011e\2\u0120\5\u011e\1\0\44\u011e\54\0\1\u0124"+
-    "\17\0\1\u0125\1\25\1\131\1\25\1\0\1\25\1\u0125"+
-    "\1\0\1\25\1\0\1\25\3\0\2\25\2\0\3\25"+
-    "\1\0\1\25\7\0\1\u0125\2\25\1\u0125\2\25\1\u0125"+
-    "\2\25\1\0\4\25\1\0\1\u0125\1\25\1\0\1\25"+
-    "\1\0\1\u0125\2\25\6\0\1\u0126\1\134\1\135\1\134"+
-    "\1\0\1\134\1\u0126\1\0\1\134\1\0\1\134\3\0"+
-    "\2\134\2\0\3\134\1\0\1\134\7\0\1\u0126\2\134"+
-    "\1\u0126\2\134\1\u0126\2\134\1\0\4\134\1\0\1\u0126"+
-    "\1\134\1\0\1\134\1\0\1\u0126\2\134\6\0\1\u0127"+
-    "\1\136\1\137\1\136\1\0\1\136\1\u0127\1\0\1\136"+
-    "\1\0\1\136\3\0\2\136\2\0\3\136\1\0\1\136"+
-    "\7\0\1\u0127\2\136\1\u0127\2\136\1\u0127\2\136\1\0"+
-    "\4\136\1\0\1\u0127\1\136\1\0\1\136\1\0\1\u0127"+
-    "\2\136\51\0\1\u0128\52\0\1\u0129\110\0\2\u012a\42\0"+
-    "\1\u012b\63\0\1\u0102\1\0\1\u0102\2\0\1\u0102\1\u0103"+
-    "\4\0\2\u0102\53\0\1\u012c\1\341\1\342\1\341\1\0"+
-    "\1\341\1\u012c\1\0\1\341\1\u0103\1\341\3\0\2\341"+
-    "\2\0\3\341\1\0\1\341\7\0\1\u012c\2\341\1\u012c"+
-    "\2\341\1\u012c\2\341\1\0\4\341\1\0\1\u012c\1\341"+
-    "\1\0\1\341\1\0\1\u012c\2\341\6\0\1\u012d\1\147"+
-    "\1\150\1\147\1\0\1\147\1\u012d\1\0\1\147\1\0"+
-    "\1\147\3\0\2\147\2\0\3\147\1\260\1\147\7\0"+
-    "\1\u012d\2\147\1\u012d\2\147\1\u012d\2\147\1\0\4\147"+
-    "\1\0\1\u012d\1\147\1\0\1\147\1\0\1\u012d\2\147"+
-    "\6\0\1\u012e\1\151\1\152\1\151\1\153\1\151\1\u012e"+
-    "\27\151\1\u012e\2\151\1\u012e\2\151\1\u012e\10\151\1\u012e"+
-    "\4\151\1\u012e\7\151\1\0\1\u012f\1\154\1\155\3\154"+
-    "\1\u012f\1\153\26\154\1\u012f\2\154\1\u012f\2\154\1\u012f"+
-    "\10\154\1\u012f\4\154\1\u012f\7\154\1\0\1\u0130\1\157"+
-    "\1\160\1\157\1\161\1\157\1\u0130\27\157\1\u0130\2\157"+
-    "\1\u0130\2\157\1\u0130\10\157\1\u0130\4\157\1\u0130\7\157"+
-    "\1\0\1\u0131\1\162\1\163\3\162\1\u0131\1\161\26\162"+
-    "\1\u0131\2\162\1\u0131\2\162\1\u0131\10\162\1\u0131\4\162"+
-    "\1\u0131\7\162\1\0\2\u010a\1\u010b\1\u0132\1\0\2\u010a"+
-    "\1\0\1\u0132\1\u010e\4\u010a\2\u0132\5\u010a\1\0\44\u010a"+
-    "\1\0\1\u0133\1\u010a\1\u010b\1\u0132\2\u010a\1\u0133\1\u010a"+
-    "\1\u0132\1\u0134\4\u010a\2\u0132\16\u010a\1\u0133\2\u010a\1\u0133"+
-    "\2\u010a\1\u0133\10\u010a\1\u0133\4\u010a\1\u0133\7\u010a\1\0"+
-    "\2\u010c\1\u0135\1\0\1\u0132\11\u010c\2\0\52\u010c\1\0"+
-    "\2\u010d\1\u0136\1\0\3\u010d\1\u0132\6\u010d\2\0\52\u010d"+
-    "\1\0\1\u0137\1\51\1\165\1\51\1\0\1\51\1\u0137"+
-    "\1\0\1\51\1\0\1\51\3\0\2\51\2\0\3\51"+
-    "\1\0\1\51\7\0\1\u0137\2\51\1\u0137\2\51\1\u0137"+
-    "\2\51\1\0\4\51\1\0\1\u0137\1\51\1\0\1\51"+
-    "\1\0\1\u0137\2\51\6\0\1\u0138\1\55\1\170\1\55"+
-    "\1\0\1\55\1\u0138\1\0\1\55\1\0\1\55\3\0"+
-    "\2\55\2\0\3\55\1\0\1\55\7\0\1\u0138\2\55"+
-    "\1\u0138\2\55\1\u0138\2\55\1\0\4\55\1\0\1\u0138"+
-    "\1\55\1\0\1\55\1\0\1\u0138\2\55\6\0\1\u0139"+
-    "\1\62\1\173\1\62\1\0\1\62\1\u0139\1\0\1\62"+
-    "\1\0\1\62\3\0\2\62\2\0\3\62\1\0\1\62"+
-    "\7\0\1\u0139\2\62\1\u0139\2\62\1\u0139\2\62\1\0"+
-    "\4\62\1\0\1\u0139\1\62\1\0\1\62\1\0\1\u0139"+
-    "\2\62\6\0\1\u013a\1\72\1\200\1\72\1\0\1\72"+
-    "\1\u013a\1\0\1\72\1\0\1\72\3\0\2\72\2\0"+
-    "\3\72\1\0\1\72\7\0\1\u013a\2\72\1\u013a\2\72"+
-    "\1\u013a\2\72\1\0\4\72\1\0\1\u013a\1\72\1\0"+
-    "\1\72\1\0\1\u013a\2\72\6\0\1\u013b\1\100\1\203"+
-    "\1\100\1\0\1\100\1\u013b\1\0\1\100\1\0\1\100"+
-    "\3\0\2\100\2\0\3\100\1\0\1\100\7\0\1\u013b"+
-    "\2\100\1\u013b\2\100\1\u013b\2\100\1\0\4\100\1\0"+
-    "\1\u013b\1\100\1\0\1\100\1\0\1\u013b\2\100\6\0"+
-    "\1\u013c\1\205\1\206\1\205\1\207\1\205\1\u013c\27\205"+
-    "\1\u013c\2\205\1\u013c\2\205\1\u013c\10\205\1\u013c\4\205"+
-    "\1\u013c\7\205\1\0\1\u013d\1\210\1\211\3\210\1\u013d"+
-    "\1\207\26\210\1\u013d\2\210\1\u013d\2\210\1\u013d\10\210"+
-    "\1\u013d\4\210\1\u013d\7\210\1\0\1\u013e\1\105\1\213"+
-    "\1\105\1\0\1\105\1\u013e\1\0\1\105\1\0\1\105"+
-    "\3\0\2\105\2\0\3\105\1\0\1\105\7\0\1\u013e"+
-    "\2\105\1\u013e\2\105\1\u013e\2\105\1\0\4\105\1\0"+
-    "\1\u013e\1\105\1\0\1\105\1\0\1\u013e\2\105\6\0"+
-    "\1\u013f\1\216\1\217\1\216\1\0\1\216\1\u013f\1\0"+
-    "\1\216\1\0\1\216\3\0\2\216\2\0\3\216\1\0"+
-    "\1\216\7\0\1\u013f\2\216\1\u013f\2\216\1\u013f\2\216"+
-    "\1\0\4\216\1\0\1\u013f\1\216\1\0\1\216\1\0"+
-    "\1\u013f\2\216\6\0\1\u0140\1\113\1\222\1\113\1\0"+
-    "\1\113\1\u0140\1\0\1\113\1\0\1\113\3\0\2\113"+
-    "\2\0\3\113\1\223\1\113\7\0\1\u0140\2\113\1\u0140"+
-    "\2\113\1\u0140\2\113\1\0\4\113\1\0\1\u0140\1\113"+
-    "\1\0\1\113\1\0\1\u0140\2\113\6\0\1\u0141\1\225"+
-    "\1\226\1\225\1\227\1\225\1\u0141\27\225\1\u0141\2\225"+
-    "\1\u0141\2\225\1\u0141\10\225\1\u0141\4\225\1\u0141\7\225"+
-    "\1\0\1\u0142\1\230\1\231\3\230\1\u0142\1\227\26\230"+
-    "\1\u0142\2\230\1\u0142\2\230\1\u0142\10\230\1\u0142\4\230"+
-    "\1\u0142\7\230\1\0\1\u0143\1\235\1\236\1\235\1\0"+
-    "\1\235\1\u0143\1\0\1\235\1\0\1\235\3\0\2\235"+
-    "\2\0\3\235\1\0\1\235\7\0\1\u0143\2\235\1\u0143"+
-    "\2\235\1\u0143\2\235\1\0\4\235\1\0\1\u0143\1\235"+
-    "\1\0\1\235\1\0\1\u0143\2\235\6\0\1\u0144\5\0"+
-    "\1\u0144\3\0\1\367\5\0\1\u0144\5\0\1\u0144\7\0"+
-    "\2\u0144\1\0\2\u0144\1\0\2\u0144\7\0\2\u0144\3\0"+
-    "\2\u0144\7\0\1\u0145\5\0\1\u0145\11\0\1\u0145\5\0"+
-    "\1\u0145\7\0\2\u0145\1\0\2\u0145\1\0\2\u0145\7\0"+
-    "\2\u0145\3\0\2\u0145\7\0\2\u011e\1\u011f\1\u0146\1\0"+
-    "\2\u011e\1\0\1\u0146\1\u0123\4\u011e\2\u0146\5\u011e\1\0"+
-    "\44\u011e\1\0\1\u0147\1\u011e\1\u011f\1\u0146\2\u011e\1\u0147"+
-    "\1\u011e\1\u0146\1\u0148\4\u011e\2\u0146\16\u011e\1\u0147\2\u011e"+
-    "\1\u0147\2\u011e\1\u0147\10\u011e\1\u0147\4\u011e\1\u0147\7\u011e"+
-    "\1\0\2\u0121\1\u0149\1\0\1\u0146\11\u0121\2\0\52\u0121"+
-    "\1\0\2\u0122\1\u014a\1\0\3\u0122\1\u0146\6\u0122\2\0"+
-    "\52\u0122\24\0\1\u014b\47\0\1\u014c\1\25\1\131\1\25"+
-    "\1\0\1\25\1\u014c\1\0\1\25\1\0\1\25\3\0"+
-    "\2\25\2\0\3\25\1\0\1\25\7\0\1\u014c\2\25"+
-    "\1\u014c\2\25\1\u014c\2\25\1\0\4\25\1\0\1\u014c"+
-    "\1\25\1\0\1\25\1\0\1\u014c\2\25\6\0\1\u014d"+
-    "\1\134\1\135\1\134\1\0\1\134\1\u014d\1\0\1\134"+
-    "\1\0\1\134\3\0\2\134\2\0\3\134\1\0\1\134"+
-    "\7\0\1\u014d\2\134\1\u014d\2\134\1\u014d\2\134\1\0"+
-    "\4\134\1\0\1\u014d\1\134\1\0\1\134\1\0\1\u014d"+
-    "\2\134\6\0\1\u014e\1\136\1\137\1\136\1\0\1\136"+
-    "\1\u014e\1\0\1\136\1\0\1\136\3\0\2\136\2\0"+
-    "\3\136\1\0\1\136\7\0\1\u014e\2\136\1\u014e\2\136"+
-    "\1\u014e\2\136\1\0\4\136\1\0\1\u014e\1\136\1\0"+
-    "\1\136\1\0\1\u014e\2\136\52\0\2\u014f\73\0\1\u0150"+
-    "\106\0\2\u0151\7\0\1\u0152\1\341\1\342\1\341\1\0"+
-    "\1\341\1\u0152\1\0\1\341\1\u0103\1\341\3\0\2\341"+
-    "\2\0\3\341\1\0\1\341\7\0\1\u0152\2\341\1\u0152"+
-    "\2\341\1\u0152\2\341\1\0\4\341\1\0\1\u0152\1\341"+
-    "\1\0\1\341\1\0\1\u0152\2\341\6\0\1\u0153\1\147"+
-    "\1\150\1\147\1\0\1\147\1\u0153\1\0\1\147\1\0"+
-    "\1\147\3\0\2\147\2\0\3\147\1\260\1\147\7\0"+
-    "\1\u0153\2\147\1\u0153\2\147\1\u0153\2\147\1\0\4\147"+
-    "\1\0\1\u0153\1\147\1\0\1\147\1\0\1\u0153\2\147"+
-    "\6\0\1\u0154\1\151\1\152\1\151\1\153\1\151\1\u0154"+
-    "\27\151\1\u0154\2\151\1\u0154\2\151\1\u0154\10\151\1\u0154"+
-    "\4\151\1\u0154\7\151\1\0\1\u0155\1\154\1\155\3\154"+
-    "\1\u0155\1\153\26\154\1\u0155\2\154\1\u0155\2\154\1\u0155"+
-    "\10\154\1\u0155\4\154\1\u0155\7\154\1\0\1\u0156\1\157"+
-    "\1\160\1\157\1\161\1\157\1\u0156\27\157\1\u0156\2\157"+
-    "\1\u0156\2\157\1\u0156\10\157\1\u0156\4\157\1\u0156\7\157"+
-    "\1\0\1\u0157\1\162\1\163\3\162\1\u0157\1\161\26\162"+
-    "\1\u0157\2\162\1\u0157\2\162\1\u0157\10\162\1\u0157\4\162"+
-    "\1\u0157\7\162\4\0\1\u0132\1\0\1\u0132\2\0\1\u0132"+
-    "\1\u010e\4\0\2\u0132\53\0\1\u0158\1\u010a\1\u010b\1\u010a"+
-    "\1\0\1\u010a\1\u0158\1\0\1\u010a\1\u010e\13\u010a\1\0"+
-    "\10\u010a\1\u0158\2\u010a\1\u0158\2\u010a\1\u0158\10\u010a\1\u0158"+
-    "\4\u010a\1\u0158\7\u010a\1\0\1\u0159\1\u010c\1\u0135\1\u010c"+
-    "\1\u015a\1\u010c\1\u0159\10\u010c\1\u015b\16\u010c\1\u0159\2\u010c"+
-    "\1\u0159\2\u010c\1\u0159\10\u010c\1\u0159\4\u010c\1\u0159\7\u010c"+
-    "\1\0\1\u015c\1\u010d\1\u0136\3\u010d\1\u015c\1\u015d\7\u010d"+
-    "\1\u015e\16\u010d\1\u015c\2\u010d\1\u015c\2\u010d\1\u015c\10\u010d"+
-    "\1\u015c\4\u010d\1\u015c\7\u010d\1\0\1\u015f\1\51\1\165"+
-    "\1\51\1\0\1\51\1\u015f\1\0\1\51\1\0\1\51"+
-    "\3\0\2\51\2\0\3\51\1\0\1\51\7\0\1\u015f"+
-    "\2\51\1\u015f\2\51\1\u015f\2\51\1\0\4\51\1\0"+
-    "\1\u015f\1\51\1\0\1\51\1\0\1\u015f\2\51\6\0"+
-    "\1\u0160\1\55\1\170\1\55\1\0\1\55\1\u0160\1\0"+
-    "\1\55\1\0\1\55\3\0\2\55\2\0\3\55\1\0"+
-    "\1\55\7\0\1\u0160\2\55\1\u0160\2\55\1\u0160\2\55"+
-    "\1\0\4\55\1\0\1\u0160\1\55\1\0\1\55\1\0"+
-    "\1\u0160\2\55\6\0\1\u0161\1\62\1\173\1\62\1\0"+
-    "\1\62\1\u0161\1\0\1\62\1\0\1\62\3\0\2\62"+
-    "\2\0\3\62\1\0\1\62\7\0\1\u0161\2\62\1\u0161"+
-    "\2\62\1\u0161\2\62\1\0\4\62\1\0\1\u0161\1\62"+
-    "\1\0\1\62\1\0\1\u0161\2\62\6\0\1\u0162\1\72"+
-    "\1\200\1\72\1\0\1\72\1\u0162\1\0\1\72\1\0"+
-    "\1\72\3\0\2\72\2\0\3\72\1\0\1\72\7\0"+
-    "\1\u0162\2\72\1\u0162\2\72\1\u0162\2\72\1\0\4\72"+
-    "\1\0\1\u0162\1\72\1\0\1\72\1\0\1\u0162\2\72"+
-    "\6\0\1\u0163\1\100\1\203\1\100\1\0\1\100\1\u0163"+
-    "\1\0\1\100\1\0\1\100\3\0\2\100\2\0\3\100"+
-    "\1\0\1\100\7\0\1\u0163\2\100\1\u0163\2\100\1\u0163"+
-    "\2\100\1\0\4\100\1\0\1\u0163\1\100\1\0\1\100"+
-    "\1\0\1\u0163\2\100\6\0\1\u0164\1\205\1\206\1\205"+
-    "\1\207\1\205\1\u0164\27\205\1\u0164\2\205\1\u0164\2\205"+
-    "\1\u0164\10\205\1\u0164\4\205\1\u0164\7\205\1\0\1\u0165"+
-    "\1\210\1\211\3\210\1\u0165\1\207\26\210\1\u0165\2\210"+
-    "\1\u0165\2\210\1\u0165\10\210\1\u0165\4\210\1\u0165\7\210"+
-    "\1\0\1\u0166\1\105\1\213\1\105\1\0\1\105\1\u0166"+
-    "\1\0\1\105\1\0\1\105\3\0\2\105\2\0\3\105"+
-    "\1\0\1\105\7\0\1\u0166\2\105\1\u0166\2\105\1\u0166"+
-    "\2\105\1\0\4\105\1\0\1\u0166\1\105\1\0\1\105"+
-    "\1\0\1\u0166\2\105\6\0\1\u0167\1\216\1\217\1\216"+
-    "\1\0\1\216\1\u0167\1\0\1\216\1\0\1\216\3\0"+
-    "\2\216\2\0\3\216\1\0\1\216\7\0\1\u0167\2\216"+
-    "\1\u0167\2\216\1\u0167\2\216\1\0\4\216\1\0\1\u0167"+
-    "\1\216\1\0\1\216\1\0\1\u0167\2\216\6\0\1\u0168"+
-    "\1\113\1\222\1\113\1\0\1\113\1\u0168\1\0\1\113"+
-    "\1\0\1\113\3\0\2\113\2\0\3\113\1\223\1\113"+
-    "\7\0\1\u0168\2\113\1\u0168\2\113\1\u0168\2\113\1\0"+
-    "\4\113\1\0\1\u0168\1\113\1\0\1\113\1\0\1\u0168"+
-    "\2\113\6\0\1\u0169\1\225\1\226\1\225\1\227\1\225"+
-    "\1\u0169\27\225\1\u0169\2\225\1\u0169\2\225\1\u0169\10\225"+
-    "\1\u0169\4\225\1\u0169\7\225\1\0\1\u016a\1\230\1\231"+
-    "\3\230\1\u016a\1\227\26\230\1\u016a\2\230\1\u016a\2\230"+
-    "\1\u016a\10\230\1\u016a\4\230\1\u016a\7\230\1\0\1\u016b"+
-    "\1\235\1\236\1\235\1\0\1\235\1\u016b\1\0\1\235"+
-    "\1\0\1\235\3\0\2\235\2\0\3\235\1\0\1\235"+
-    "\7\0\1\u016b\2\235\1\u016b\2\235\1\u016b\2\235\1\0"+
-    "\4\235\1\0\1\u016b\1\235\1\0\1\235\1\0\1\u016b"+
-    "\2\235\6\0\1\u016c\5\0\1\u016c\3\0\1\367\5\0"+
-    "\1\u016c\5\0\1\u016c\7\0\2\u016c\1\0\2\u016c\1\0"+
-    "\2\u016c\7\0\2\u016c\3\0\2\u016c\7\0\1\u016d\5\0"+
-    "\1\u016d\11\0\1\u016d\5\0\1\u016d\7\0\2\u016d\1\0"+
-    "\2\u016d\1\0\2\u016d\7\0\2\u016d\3\0\2\u016d\12\0"+
-    "\1\u0146\1\0\1\u0146\2\0\1\u0146\1\u0123\4\0\2\u0146"+
-    "\53\0\1\u016e\1\u011e\1\u011f\1\u011e\1\0\1\u011e\1\u016e"+
-    "\1\0\1\u011e\1\u0123\13\u011e\1\0\10\u011e\1\u016e\2\u011e"+
-    "\1\u016e\2\u011e\1\u016e\10\u011e\1\u016e\4\u011e\1\u016e\7\u011e"+
-    "\1\0\1\u016f\1\u0121\1\u0149\1\u0121\1\u0170\1\u0121\1\u016f"+
-    "\10\u0121\1\u0171\16\u0121\1\u016f\2\u0121\1\u016f\2\u0121\1\u016f"+
-    "\10\u0121\1\u016f\4\u0121\1\u016f\7\u0121\1\0\1\u0172\1\u0122"+
-    "\1\u014a\3\u0122\1\u0172\1\u0173\7\u0122\1\u0174\16\u0122\1\u0172"+
-    "\2\u0122\1\u0172\2\u0122\1\u0172\10\u0122\1\u0172\4\u0122\1\u0172"+
-    "\7\u0122\47\0\1\u0175\24\0\2\25\1\131\1\25\1\0"+
-    "\2\25\1\0\1\25\1\0\1\25\3\0\2\25\2\0"+
-    "\3\25\1\0\1\25\7\0\11\25\1\0\4\25\1\0"+
-    "\2\25\1\0\1\25\1\0\3\25\6\0\1\u0176\1\134"+
-    "\1\135\1\134\1\0\1\134\1\u0176\1\0\1\134\1\0"+
-    "\1\134\3\0\2\134\2\0\3\134\1\0\1\134\7\0"+
-    "\1\u0176\2\134\1\u0176\2\134\1\u0176\2\134\1\0\4\134"+
-    "\1\0\1\u0176\1\134\1\0\1\134\1\0\1\u0176\2\134"+
-    "\6\0\1\u0177\1\136\1\137\1\136\1\0\1\136\1\u0177"+
-    "\1\0\1\136\1\0\1\136\3\0\2\136\2\0\3\136"+
-    "\1\0\1\136\7\0\1\u0177\2\136\1\u0177\2\136\1\u0177"+
-    "\2\136\1\0\4\136\1\0\1\u0177\1\136\1\0\1\136"+
-    "\1\0\1\u0177\2\136\54\0\1\u0178\65\0\2\u0179\30\0"+
-    "\1\u017a\1\341\1\342\1\341\1\0\1\341\1\u017a\1\0"+
-    "\1\341\1\u0103\1\341\3\0\2\341\2\0\3\341\1\0"+
-    "\1\341\7\0\1\u017a\2\341\1\u017a\2\341\1\u017a\2\341"+
-    "\1\0\4\341\1\0\1\u017a\1\341\1\0\1\341\1\0"+
-    "\1\u017a\2\341\6\0\1\u017b\1\147\1\150\1\147\1\0"+
-    "\1\147\1\u017b\1\0\1\147\1\0\1\147\3\0\2\147"+
-    "\2\0\3\147\1\260\1\147\7\0\1\u017b\2\147\1\u017b"+
-    "\2\147\1\u017b\2\147\1\0\4\147\1\0\1\u017b\1\147"+
-    "\1\0\1\147\1\0\1\u017b\2\147\6\0\1\u017c\1\151"+
-    "\1\152\1\151\1\153\1\151\1\u017c\27\151\1\u017c\2\151"+
-    "\1\u017c\2\151\1\u017c\10\151\1\u017c\4\151\1\u017c\7\151"+
-    "\1\0\1\u017d\1\154\1\155\3\154\1\u017d\1\153\26\154"+
-    "\1\u017d\2\154\1\u017d\2\154\1\u017d\10\154\1\u017d\4\154"+
-    "\1\u017d\7\154\1\0\1\u017e\1\157\1\160\1\157\1\161"+
-    "\1\157\1\u017e\27\157\1\u017e\2\157\1\u017e\2\157\1\u017e"+
-    "\10\157\1\u017e\4\157\1\u017e\7\157\1\0\1\u017f\1\162"+
-    "\1\163\3\162\1\u017f\1\161\26\162\1\u017f\2\162\1\u017f"+
-    "\2\162\1\u017f\10\162\1\u017f\4\162\1\u017f\7\162\1\0"+
-    "\1\u0180\1\u010a\1\u010b\1\u010a\1\0\1\u010a\1\u0180\1\0"+
-    "\1\u010a\1\u010e\13\u010a\1\0\10\u010a\1\u0180\2\u010a\1\u0180"+
-    "\2\u010a\1\u0180\10\u010a\1\u0180\4\u010a\1\u0180\7\u010a\1\0"+
-    "\1\u0181\1\u010c\1\u0135\1\u010c\1\u0132\1\u010c\1\u0181\27\u010c"+
-    "\1\u0181\2\u010c\1\u0181\2\u010c\1\u0181\10\u010c\1\u0181\4\u010c"+
-    "\1\u0181\7\u010c\1\0\2\u010c\1\u0135\2\u0132\1\u015a\2\u010c"+
-    "\1\u015a\1\u0182\4\u010c\2\u0132\52\u010c\1\0\2\u010c\1\u0135"+
-    "\1\0\1\u0132\12\u010c\1\0\52\u010c\1\0\1\u0183\1\u010d"+
-    "\1\u0136\3\u010d\1\u0183\1\u0132\26\u010d\1\u0183\2\u010d\1\u0183"+
-    "\2\u010d\1\u0183\10\u010d\1\u0183\4\u010d\1\u0183\7\u010d\1\0"+
-    "\2\u010d\1\u0136\1\u0132\1\u010d\1\u015d\1\u010d\1\u0132\1\u015d"+
-    "\1\u0184\4\u010d\2\u0132\52\u010d\1\0\2\u010d\1\u0136\1\0"+
-    "\3\u010d\1\u0132\7\u010d\1\0\52\u010d\1\0\2\51\1\165"+
-    "\1\51\1\0\2\51\1\0\1\51\1\0\1\51\3\0"+
-    "\2\51\2\0\3\51\1\0\1\51\7\0\11\51\1\0"+
-    "\4\51\1\0\2\51\1\0\1\51\1\0\3\51\6\0"+
-    "\2\55\1\170\1\55\1\0\2\55\1\0\1\55\1\0"+
-    "\1\55\3\0\2\55\2\0\3\55\1\0\1\55\7\0"+
-    "\11\55\1\0\4\55\1\0\2\55\1\0\1\55\1\0"+
-    "\3\55\6\0\2\62\1\173\1\62\1\0\2\62\1\0"+
-    "\1\62\1\0\1\62\3\0\2\62\2\0\3\62\1\0"+
-    "\1\62\7\0\11\62\1\0\4\62\1\0\2\62\1\0"+
-    "\1\62\1\0\3\62\6\0\2\72\1\200\1\72\1\0"+
-    "\2\72\1\0\1\72\1\0\1\72\3\0\2\72\2\0"+
-    "\3\72\1\0\1\72\7\0\11\72\1\0\4\72\1\0"+
-    "\2\72\1\0\1\72\1\0\3\72\6\0\2\100\1\203"+
-    "\1\100\1\0\2\100\1\0\1\100\1\0\1\100\3\0"+
-    "\2\100\2\0\3\100\1\0\1\100\7\0\11\100\1\0"+
-    "\4\100\1\0\2\100\1\0\1\100\1\0\3\100\6\0"+
-    "\1\u0185\1\205\1\206\1\205\1\207\1\205\1\u0185\27\205"+
-    "\1\u0185\2\205\1\u0185\2\205\1\u0185\10\205\1\u0185\4\205"+
-    "\1\u0185\7\205\1\0\1\u0186\1\210\1\211\3\210\1\u0186"+
-    "\1\207\26\210\1\u0186\2\210\1\u0186\2\210\1\u0186\10\210"+
-    "\1\u0186\4\210\1\u0186\7\210\1\0\2\105\1\213\1\105"+
-    "\1\0\2\105\1\0\1\105\1\0\1\105\3\0\2\105"+
-    "\2\0\3\105\1\0\1\105\7\0\11\105\1\0\4\105"+
-    "\1\0\2\105\1\0\1\105\1\0\3\105\6\0\1\u0187"+
-    "\1\216\1\217\1\216\1\0\1\216\1\u0187\1\0\1\216"+
-    "\1\0\1\216\3\0\2\216\2\0\3\216\1\0\1\216"+
-    "\7\0\1\u0187\2\216\1\u0187\2\216\1\u0187\2\216\1\0"+
-    "\4\216\1\0\1\u0187\1\216\1\0\1\216\1\0\1\u0187"+
-    "\2\216\6\0\2\113\1\222\1\113\1\0\2\113\1\0"+
-    "\1\113\1\0\1\113\3\0\2\113\2\0\3\113\1\223"+
-    "\1\113\7\0\11\113\1\0\4\113\1\0\2\113\1\0"+
-    "\1\113\1\0\3\113\6\0\1\u0188\1\225\1\226\1\225"+
-    "\1\227\1\225\1\u0188\27\225\1\u0188\2\225\1\u0188\2\225"+
-    "\1\u0188\10\225\1\u0188\4\225\1\u0188\7\225\1\0\1\u0189"+
-    "\1\230\1\231\3\230\1\u0189\1\227\26\230\1\u0189\2\230"+
-    "\1\u0189\2\230\1\u0189\10\230\1\u0189\4\230\1\u0189\7\230"+
-    "\1\0\1\u018a\1\235\1\236\1\235\1\0\1\235\1\u018a"+
-    "\1\0\1\235\1\0\1\235\3\0\2\235\2\0\3\235"+
-    "\1\0\1\235\7\0\1\u018a\2\235\1\u018a\2\235\1\u018a"+
-    "\2\235\1\0\4\235\1\0\1\u018a\1\235\1\0\1\235"+
-    "\1\0\1\u018a\2\235\6\0\1\u018b\5\0\1\u018b\3\0"+
-    "\1\367\5\0\1\u018b\5\0\1\u018b\7\0\2\u018b\1\0"+
-    "\2\u018b\1\0\2\u018b\7\0\2\u018b\3\0\2\u018b\7\0"+
-    "\1\u018c\5\0\1\u018c\11\0\1\u018c\5\0\1\u018c\7\0"+
-    "\2\u018c\1\0\2\u018c\1\0\2\u018c\7\0\2\u018c\3\0"+
-    "\2\u018c\7\0\1\u018d\1\u011e\1\u011f\1\u011e\1\0\1\u011e"+
-    "\1\u018d\1\0\1\u011e\1\u0123\13\u011e\1\0\10\u011e\1\u018d"+
-    "\2\u011e\1\u018d\2\u011e\1\u018d\10\u011e\1\u018d\4\u011e\1\u018d"+
-    "\7\u011e\1\0\1\u018e\1\u0121\1\u0149\1\u0121\1\u0146\1\u0121"+
-    "\1\u018e\27\u0121\1\u018e\2\u0121\1\u018e\2\u0121\1\u018e\10\u0121"+
-    "\1\u018e\4\u0121\1\u018e\7\u0121\1\0\2\u0121\1\u0149\2\u0146"+
-    "\1\u0170\2\u0121\1\u0170\1\u018f\4\u0121\2\u0146\52\u0121\1\0"+
-    "\2\u0121\1\u0149\1\0\1\u0146\12\u0121\1\0\52\u0121\1\0"+
-    "\1\u0190\1\u0122\1\u014a\3\u0122\1\u0190\1\u0146\26\u0122\1\u0190"+
-    "\2\u0122\1\u0190\2\u0122\1\u0190\10\u0122\1\u0190\4\u0122\1\u0190"+
-    "\7\u0122\1\0\2\u0122\1\u014a\1\u0146\1\u0122\1\u0173\1\u0122"+
-    "\1\u0146\1\u0173\1\u0191\4\u0122\2\u0146\52\u0122\1\0\2\u0122"+
-    "\1\u014a\1\0\3\u0122\1\u0146\7\u0122\1\0\52\u0122\42\0"+
-    "\2\u0192\30\0\2\134\1\135\1\134\1\0\2\134\1\0"+
-    "\1\134\1\0\1\134\3\0\2\134\2\0\3\134\1\0"+
-    "\1\134\7\0\11\134\1\0\4\134\1\0\2\134\1\0"+
-    "\1\134\1\0\3\134\6\0\2\136\1\137\1\136\1\0"+
-    "\2\136\1\0\1\136\1\0\1\136\3\0\2\136\2\0"+
-    "\3\136\1\0\1\136\7\0\11\136\1\0\4\136\1\0"+
-    "\2\136\1\0\1\136\1\0\3\136\44\0\2\u0193\33\0"+
-    "\1\u0194\1\341\1\342\1\341\1\0\1\341\1\u0194\1\0"+
-    "\1\341\1\u0103\1\341\3\0\2\341\2\0\3\341\1\0"+
-    "\1\341\7\0\1\u0194\2\341\1\u0194\2\341\1\u0194\2\341"+
-    "\1\0\4\341\1\0\1\u0194\1\341\1\0\1\341\1\0"+
-    "\1\u0194\2\341\6\0\2\147\1\150\1\147\1\0\2\147"+
-    "\1\0\1\147\1\0\1\147\3\0\2\147\2\0\3\147"+
-    "\1\260\1\147\7\0\11\147\1\0\4\147\1\0\2\147"+
-    "\1\0\1\147\1\0\3\147\6\0\2\151\1\152\1\151"+
-    "\1\153\65\151\1\0\2\154\1\155\4\154\1\153\62\154"+
-    "\1\0\2\157\1\160\1\157\1\161\65\157\1\0\2\162"+
-    "\1\163\4\162\1\161\62\162\1\0\1\u0195\1\u010a\1\u010b"+
-    "\1\u010a\1\0\1\u010a\1\u0195\1\0\1\u010a\1\u010e\13\u010a"+
-    "\1\0\10\u010a\1\u0195\2\u010a\1\u0195\2\u010a\1\u0195\10\u010a"+
-    "\1\u0195\4\u010a\1\u0195\7\u010a\1\0\1\u0196\1\u010c\1\u0135"+
-    "\1\u010c\1\u0132\1\u010c\1\u0196\27\u010c\1\u0196\2\u010c\1\u0196"+
-    "\2\u010c\1\u0196\10\u010c\1\u0196\4\u010c\1\u0196\7\u010c\1\0"+
-    "\1\u0197\1\u010d\1\u0136\3\u010d\1\u0197\1\u0132\26\u010d\1\u0197"+
-    "\2\u010d\1\u0197\2\u010d\1\u0197\10\u010d\1\u0197\4\u010d\1\u0197"+
-    "\7\u010d\1\0\2\205\1\206\1\205\1\207\65\205\1\0"+
-    "\2\210\1\211\4\210\1\207\62\210\1\0\2\216\1\217"+
-    "\1\216\1\0\2\216\1\0\1\216\1\0\1\216\3\0"+
-    "\2\216\2\0\3\216\1\0\1\216\7\0\11\216\1\0"+
-    "\4\216\1\0\2\216\1\0\1\216\1\0\3\216\6\0"+
-    "\2\225\1\226\1\225\1\227\65\225\1\0\2\230\1\231"+
-    "\4\230\1\227\62\230\1\0\2\235\1\236\1\235\1\0"+
-    "\2\235\1\0\1\235\1\0\1\235\3\0\2\235\2\0"+
-    "\3\235\1\0\1\235\7\0\11\235\1\0\4\235\1\0"+
-    "\2\235\1\0\1\235\1\0\3\235\20\0\1\367\60\0"+
-    "\1\u0198\5\0\1\u0198\11\0\1\u0198\5\0\1\u0198\7\0"+
-    "\2\u0198\1\0\2\u0198\1\0\2\u0198\7\0\2\u0198\3\0"+
-    "\2\u0198\7\0\1\u0199\1\u011e\1\u011f\1\u011e\1\0\1\u011e"+
-    "\1\u0199\1\0\1\u011e\1\u0123\13\u011e\1\0\10\u011e\1\u0199"+
-    "\2\u011e\1\u0199\2\u011e\1\u0199\10\u011e\1\u0199\4\u011e\1\u0199"+
-    "\7\u011e\1\0\1\u019a\1\u0121\1\u0149\1\u0121\1\u0146\1\u0121"+
-    "\1\u019a\27\u0121\1\u019a\2\u0121\1\u019a\2\u0121\1\u019a\10\u0121"+
-    "\1\u019a\4\u0121\1\u019a\7\u0121\1\0\1\u019b\1\u0122\1\u014a"+
-    "\3\u0122\1\u019b\1\u0146\26\u0122\1\u019b\2\u0122\1\u019b\2\u0122"+
-    "\1\u019b\10\u0122\1\u019b\4\u0122\1\u019b\7\u0122\65\0\1\u019c"+
-    "\52\0\2\u019d\25\0\1\u019e\1\341\1\342\1\341\1\0"+
-    "\1\341\1\u019e\1\0\1\341\1\u0103\1\341\3\0\2\341"+
-    "\2\0\3\341\1\0\1\341\7\0\1\u019e\2\341\1\u019e"+
-    "\2\341\1\u019e\2\341\1\0\4\341\1\0\1\u019e\1\341"+
-    "\1\0\1\341\1\0\1\u019e\2\341\6\0\1\u019f\1\u010a"+
-    "\1\u010b\1\u010a\1\0\1\u010a\1\u019f\1\0\1\u010a\1\u010e"+
-    "\13\u010a\1\0\10\u010a\1\u019f\2\u010a\1\u019f\2\u010a\1\u019f"+
-    "\10\u010a\1\u019f\4\u010a\1\u019f\7\u010a\1\0\1\u01a0\1\u010c"+
-    "\1\u0135\1\u010c\1\u0132\1\u010c\1\u01a0\27\u010c\1\u01a0\2\u010c"+
-    "\1\u01a0\2\u010c\1\u01a0\10\u010c\1\u01a0\4\u010c\1\u01a0\7\u010c"+
-    "\1\0\1\u01a1\1\u010d\1\u0136\3\u010d\1\u01a1\1\u0132\26\u010d"+
-    "\1\u01a1\2\u010d\1\u01a1\2\u010d\1\u01a1\10\u010d\1\u01a1\4\u010d"+
-    "\1\u01a1\7\u010d\1\0\1\u01a2\5\0\1\u01a2\11\0\1\u01a2"+
-    "\5\0\1\u01a2\7\0\2\u01a2\1\0\2\u01a2\1\0\2\u01a2"+
-    "\7\0\2\u01a2\3\0\2\u01a2\7\0\1\u01a3\1\u011e\1\u011f"+
-    "\1\u011e\1\0\1\u011e\1\u01a3\1\0\1\u011e\1\u0123\13\u011e"+
-    "\1\0\10\u011e\1\u01a3\2\u011e\1\u01a3\2\u011e\1\u01a3\10\u011e"+
-    "\1\u01a3\4\u011e\1\u01a3\7\u011e\1\0\1\u01a4\1\u0121\1\u0149"+
-    "\1\u0121\1\u0146\1\u0121\1\u01a4\27\u0121\1\u01a4\2\u0121\1\u01a4"+
-    "\2\u0121\1\u01a4\10\u0121\1\u01a4\4\u0121\1\u01a4\7\u0121\1\0"+
-    "\1\u01a5\1\u0122\1\u014a\3\u0122\1\u01a5\1\u0146\26\u0122\1\u01a5"+
-    "\2\u0122\1\u01a5\2\u0122\1\u01a5\10\u0122\1\u01a5\4\u0122\1\u01a5"+
-    "\7\u0122\47\0\1\u01a6\24\0\2\341\1\342\1\341\1\0"+
-    "\2\341\1\0\1\341\1\u0103\1\341\3\0\2\341\2\0"+
-    "\3\341\1\0\1\341\7\0\11\341\1\0\4\341\1\0"+
-    "\2\341\1\0\1\341\1\0\3\341\6\0\1\u01a7\1\u010a"+
-    "\1\u010b\1\u010a\1\0\1\u010a\1\u01a7\1\0\1\u010a\1\u010e"+
-    "\13\u010a\1\0\10\u010a\1\u01a7\2\u010a\1\u01a7\2\u010a\1\u01a7"+
-    "\10\u010a\1\u01a7\4\u010a\1\u01a7\7\u010a\1\0\1\u01a8\1\u010c"+
-    "\1\u0135\1\u010c\1\u0132\1\u010c\1\u01a8\27\u010c\1\u01a8\2\u010c"+
-    "\1\u01a8\2\u010c\1\u01a8\10\u010c\1\u01a8\4\u010c\1\u01a8\7\u010c"+
-    "\1\0\1\u01a9\1\u010d\1\u0136\3\u010d\1\u01a9\1\u0132\26\u010d"+
-    "\1\u01a9\2\u010d\1\u01a9\2\u010d\1\u01a9\10\u010d\1\u01a9\4\u010d"+
-    "\1\u01a9\7\u010d\1\0\1\u01aa\1\u011e\1\u011f\1\u011e\1\0"+
-    "\1\u011e\1\u01aa\1\0\1\u011e\1\u0123\13\u011e\1\0\10\u011e"+
-    "\1\u01aa\2\u011e\1\u01aa\2\u011e\1\u01aa\10\u011e\1\u01aa\4\u011e"+
-    "\1\u01aa\7\u011e\1\0\1\u01ab\1\u0121\1\u0149\1\u0121\1\u0146"+
-    "\1\u0121\1\u01ab\27\u0121\1\u01ab\2\u0121\1\u01ab\2\u0121\1\u01ab"+
-    "\10\u0121\1\u01ab\4\u0121\1\u01ab\7\u0121\1\0\1\u01ac\1\u0122"+
-    "\1\u014a\3\u0122\1\u01ac\1\u0146\26\u0122\1\u01ac\2\u0122\1\u01ac"+
-    "\2\u0122\1\u01ac\10\u0122\1\u01ac\4\u0122\1\u01ac\7\u0122\1\0"+
-    "\2\u010a\1\u010b\1\u010a\1\0\2\u010a\1\0\1\u010a\1\u010e"+
-    "\13\u010a\1\0\44\u010a\1\0\1\u01ad\1\u010c\1\u0135\1\u010c"+
-    "\1\u0132\1\u010c\1\u01ad\27\u010c\1\u01ad\2\u010c\1\u01ad\2\u010c"+
-    "\1\u01ad\10\u010c\1\u01ad\4\u010c\1\u01ad\7\u010c\1\0\1\u01ae"+
-    "\1\u010d\1\u0136\3\u010d\1\u01ae\1\u0132\26\u010d\1\u01ae\2\u010d"+
-    "\1\u01ae\2\u010d\1\u01ae\10\u010d\1\u01ae\4\u010d\1\u01ae\7\u010d"+
-    "\1\0\2\u011e\1\u011f\1\u011e\1\0\2\u011e\1\0\1\u011e"+
-    "\1\u0123\13\u011e\1\0\44\u011e\1\0\1\u01af\1\u0121\1\u0149"+
-    "\1\u0121\1\u0146\1\u0121\1\u01af\27\u0121\1\u01af\2\u0121\1\u01af"+
-    "\2\u0121\1\u01af\10\u0121\1\u01af\4\u0121\1\u01af\7\u0121\1\0"+
-    "\1\u01b0\1\u0122\1\u014a\3\u0122\1\u01b0\1\u0146\26\u0122\1\u01b0"+
-    "\2\u0122\1\u01b0\2\u0122\1\u01b0\10\u0122\1\u01b0\4\u0122\1\u01b0"+
-    "\7\u0122\1\0\2\u010c\1\u0135\1\u010c\1\u0132\65\u010c\1\0"+
-    "\2\u010d\1\u0136\4\u010d\1\u0132\62\u010d\1\0\2\u0121\1\u0149"+
-    "\1\u0121\1\u0146\65\u0121\1\0\2\u0122\1\u014a\4\u0122\1\u0146"+
-    "\62\u0122";
-
-  /** 
-   * The transition table of the DFA
-   */
-  final private static int yytrans [] = yy_unpack(yy_packed);
-
-
-  /* error codes */
-  final private static int YY_UNKNOWN_ERROR = 0;
-  final private static int YY_ILLEGAL_STATE = 1;
-  final private static int YY_NO_MATCH = 2;
-  final private static int YY_PUSHBACK_2BIG = 3;
-
-  /* error messages for the codes above */
-  final private static String YY_ERROR_MSG[] = {
-    "Unkown internal scanner error",
-    "Internal error: unknown state",
-    "Error: could not match input",
-    "Error: pushback value was too large"
-  };
-
-  /**
-   * YY_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
-   */
-  private final static byte YY_ATTRIBUTE[] = {
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
-     0,  0,  0,  9,  1,  1,  1,  1,  1,  1,  1,  9,  1,  9,  1,  1, 
-     9,  1,  1,  1,  9,  1,  1,  1,  1,  1,  1,  9,  1,  1,  1,  9, 
-     9,  1,  1,  1,  9,  1,  3,  9,  9,  1,  1,  1,  9,  1,  9,  1, 
-     1,  1,  1,  1,  1,  1,  1,  9,  9,  1,  1,  1,  1,  1,  9,  1, 
-     1,  1,  1,  1,  1,  1,  9,  3,  0,  1,  1,  1,  0,  1,  0,  0, 
-     0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  9,  0,  0,  0,  0,  0, 
-     9,  0,  0,  0,  0,  1,  1,  0,  1,  1,  0,  1,  1, 13,  7,  0, 
-     1,  1,  0,  1,  0,  0,  9,  0,  0,  1,  0,  1,  1,  1,  0,  0, 
-     9,  0,  9,  1,  0,  0,  9,  0,  0,  1,  1,  1,  1,  0,  0,  1, 
-     0,  0, 13,  7,  1,  9,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0, 
-     1,  0,  1,  0,  0,  1,  0,  0,  1,  0,  0,  1,  0,  0,  1,  1, 
-     1,  1,  1,  0,  1,  0,  0,  1,  0,  1,  1,  1,  0,  1,  0,  0, 
-     1,  0,  1,  1,  1,  0,  1,  1,  1,  9,  9,  0,  0,  0,  0,  0, 
-     0,  0,  1,  0,  0,  0,  0,  0,  1,  1,  1,  1,  1,  0,  0,  1, 
-     1,  1,  0,  0,  1,  1,  0,  1,  0,  1,  1,  1,  0,  0,  0,  9, 
-     0,  0,  9,  0,  1,  0,  0,  0,  0,  0,  0,  0,  0,  9,  1,  1, 
-     1,  1,  1,  0,  0,  1,  1,  1,  0,  0,  1,  1,  1,  0,  0,  0, 
-     0,  0,  9,  0,  1,  1,  1,  0,  0,  9,  0,  0,  1,  0,  0,  0, 
-     0,  0,  0,  1,  0,  0,  1,  1,  1,  1,  1,  0,  0,  1,  1,  1, 
-     0,  0,  1,  1,  1,  0,  0,  1,  0,  0,  0,  1,  1,  1,  0,  9, 
-     0,  0,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1, 
-     1,  1,  1,  0,  0,  1,  1,  1,  0,  0,  1,  1,  1,  0,  0,  0, 
-     0,  0,  0,  0,  0,  1,  1,  9,  0,  0,  1,  0,  0,  0,  0,  0, 
-     0,  1,  0,  1,  0,  0,  1,  0,  0,  1,  1,  1,  0,  0,  1,  0, 
-     1,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  9,  0,  0,  0, 
-     0,  9,  0,  0,  0,  9,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
-  };
-
-  /** the input device */
-  private java.io.Reader yy_reader;
-
-  /** the current state of the DFA */
-  private int yy_state;
-
-  /** the current lexical state */
-  private int yy_lexical_state = YYINITIAL;
-
-  /** this buffer contains the current text to be matched and is
-      the source of the yytext() string */
-  private char yy_buffer[] = new char[16384];
-
-  /** the textposition at the last accepting state */
-  private int yy_markedPos;
-
-  /** the textposition at the last state to be included in yytext */
-  private int yy_pushbackPos;
-
-  /** the current text position in the buffer */
-  private int yy_currentPos;
-
-  /** startRead marks the beginning of the yytext() string in the buffer */
-  private int yy_startRead;
-
-  /** endRead marks the last character in the buffer, that has been read
-      from input */
-  private int yy_endRead;
-
-  /** number of newlines encountered up to the start of the matched text */
-  private int yyline;
-
-  /** the number of characters up to the start of the matched text */
-  private int yychar;
-
-  /**
-   * the number of characters from the last newline up to the start of the 
-   * matched text
-   */
-  private int yycolumn; 
-
-  /** 
-   * yy_atBOL == true <=> the scanner is currently at the beginning of a line
-   */
-  private boolean yy_atBOL;
-
-  /** yy_atEOF == true <=> the scanner has returned a value for EOF */
-  private boolean yy_atEOF;
-
-  /* user code: */
-	private final static String UNDEFINED = "undefined";
-	private String fBufferedContext = null;
-	private int fBufferedStart;
-//	private int fBufferedTextLength;
-	private int fBufferedLength;
-//	private StringBuffer fBufferedText = null;
-	private CSSTextRegionFactory fRegionFactory = CSSTextRegionFactory.getInstance();
-	private int fInitialState = YYINITIAL;
-	public final static int BUFFER_SIZE_NORMAL = 16384;
-	public final static int BUFFER_SIZE_SMALL = 256;
-	private int fInitialBufferSize = BUFFER_SIZE_NORMAL;
-
-	public void setInitialState(int state) {
-		fInitialState = state;
-	}
-	
-	public void setInitialBufferSize(int size) {
-		fInitialBufferSize = size;
-	}
-
-	/* user method */
-  	public final ITextRegion getNextToken() throws IOException {
-		String context;
-		String nextTokenType;
-		boolean spaceFollows;
-//		StringBuffer text;
-		int start;
-		int textLength;
-		int length;
-		if (fBufferedContext != null) {
-			context = fBufferedContext;
-//			text = fBufferedText;
-			start = fBufferedStart;
-			textLength = length = fBufferedLength;
-
-			fBufferedContext = null;
-		} else {
-			context = primGetNextToken();
-//			text = new StringBuffer(yytext());
-			start = yychar;
-			textLength = length = yylength();
-		}
-
-		if (context != null) {
-			if (context == UNDEFINED) {
-				// undef -> concatenate undef's
-				nextTokenType = primGetNextToken();
-				while (nextTokenType == UNDEFINED) {
-//					text.append(yytext());
-					textLength += yylength();
-					length = textLength;
-					nextTokenType = primGetNextToken();
-				}
-				fBufferedContext = nextTokenType;
-//				fBufferedText = new StringBuffer(yytext());
-				fBufferedStart = yychar;
-				fBufferedLength = yylength();
-			} else {
-				nextTokenType = null;
-				spaceFollows = false;
-				if (CSSRegionUtil.isDeclarationValueType(context)) { // declaration value can contain VALUE_S
-					nextTokenType = primGetNextToken();
-					spaceFollows = (nextTokenType == CSS_DECLARATION_VALUE_S);
-				} else if (canContainSpace(context)) {
-					nextTokenType = primGetNextToken();
-					spaceFollows = (nextTokenType == CSS_S);
-				}
-				if (nextTokenType != null) { // nextToken is retrieved
-					if (spaceFollows) {
-						// next is space -> append
-//						text.append(yytext());
-						length += yylength();
-					} else {
-						// next is NOT space -> push this for next time, return itself
-						fBufferedContext = nextTokenType;
-//						fBufferedText = new StringBuffer(yytext());
-						fBufferedStart = yychar;
-						fBufferedLength = yylength();
-					}
-				}
-			}
-		}
-
-		if (context != null) {
-			if (context == UNDEFINED) {
-				context = CSS_UNKNOWN;
-			}
-			return fRegionFactory.createRegion(context, start, textLength, length);
-		} else {
-			return null;
-		}
-  	}
-
-	/* user method */
-	/* for standalone use */
-  	public final List parseText() throws IOException {
-  		List tokens = new ArrayList();
-
-  		CSSTextToken token;
-		for (String kind = primGetNextToken(); kind != null; kind = primGetNextToken()) {
-			token = new CSSTextToken();
-			token.kind = kind;  				
-			token.start = yychar;
-			token.length = yylength();
-			token.image = yytext();
-			tokens.add(token);
-		}
-
-  		return tokens;
-  	}
-  	
-  	/* user method */
-  	private boolean canContainSpace(String type) {
-  		if (type == CSS_DELIMITER || type == CSS_RBRACE || type == CSS_DECLARATION_DELIMITER) {
-  			return false;
-  		} else {
-  			return true;
-  		}
-  	}
-
-	/* user method */
-	public final int getOffset() {
-		return yychar;
-	}
-	
-	/* user method */
-	public final boolean isEOF() {
-		return yy_atEOF;
-	}
-
-	/* user method */
-	public void reset(char[] charArray) {
-		reset(new CharArrayReader(charArray), 0);
-	}
-
-	/* user method */
-	public final void reset(java.io.Reader in, int newOffset) {
-		/** the input device */
-		yy_reader = in;
-
-		/** the current state of the DFA */
-		yy_state = 0;
-
-		/** the current lexical state */
-		yy_lexical_state = fInitialState; //YYINITIAL;
-
-		/** this buffer contains the current text to be matched and is
-			the source of the yytext() string */
-		if (yy_buffer.length != fInitialBufferSize) {
-			yy_buffer = new char[fInitialBufferSize];
-		}
-		java.util.Arrays.fill(yy_buffer, (char)0);
-
-		/** the textposition at the last accepting state */
-		yy_markedPos = 0;
-
-		/** the textposition at the last state to be included in yytext */
-		yy_pushbackPos = 0;
-
-		/** the current text position in the buffer */
-		yy_currentPos = 0;
-
-		/** startRead marks the beginning of the yytext() string in the buffer */
-		yy_startRead = 0;
-
-		/** endRead marks the last character in the buffer, that has been read
-			from input */
-		yy_endRead = 0;
-
-		/** number of newlines encountered up to the start of the matched text */
-		yyline = 0;
-
-		/** the number of characters up to the start of the matched text */
-		yychar = 0;
-
-		/**
-		 * the number of characters from the last newline up to the start of the 
-		 * matched text
-		 */
-		yycolumn = 0; 
-
-		/** 
-		 * yy_atBOL == true <=> the scanner is currently at the beginning of a line
-		 */
-		yy_atBOL = false;
-		
-		/** yy_atEOF == true <=> the scanner has returned a value for EOF */
-		yy_atEOF = false;
-
-		/* user variables */
-		//		fUndefined.delete(0, fUndefined.length());
-	}
-
-	/* user method */
-	public CSSTokenizer() {
-		super();
-	}
-
-
-
-  /**
-   * Creates a new scanner
-   * There is also a java.io.InputStream version of this constructor.
-   *
-   * @param   in  the java.io.Reader to read input from.
-   */
-  public CSSTokenizer(java.io.Reader in) {
-    this.yy_reader = in;
-  }
-
-  /**
-   * Creates a new scanner.
-   * There is also java.io.Reader version of this constructor.
-   *
-   * @param   in  the java.io.Inputstream to read input from.
-   */
-  public CSSTokenizer(java.io.InputStream in) {
-    this(new java.io.InputStreamReader(in));
-  }
-
-  /** 
-   * Unpacks the compressed DFA transition table.
-   *
-   * @param packed   the packed transition table
-   * @return         the unpacked transition table
-   */
-  private static int [] yy_unpack(String packed) {
-    int [] trans = new int[21004];
-    int i = 0;  /* index in packed string  */
-    int j = 0;  /* index in unpacked array */
-    while (i < 13906) {
-      int count = packed.charAt(i++);
-      int value = packed.charAt(i++);
-      value--;
-      do trans[j++] = value; while (--count > 0);
-    }
-    return trans;
-  }
-
-  /** 
-   * Unpacks the compressed character translation table.
-   *
-   * @param packed   the packed character translation table
-   * @return         the unpacked character translation table
-   */
-  private static char [] yy_unpack_cmap(String packed) {
-    char [] map = new char[0x10000];
-    int i = 0;  /* index in packed string  */
-    int j = 0;  /* index in unpacked array */
-    while (i < 170) {
-      int  count = packed.charAt(i++);
-      char value = packed.charAt(i++);
-      do map[j++] = value; while (--count > 0);
-    }
-    return map;
-  }
-
-
-  /**
-   * Gets the next input character.
-   *
-   * @return      the next character of the input stream, EOF if the
-   *              end of the stream is reached.
-   * @exception   IOException  if any I/O-Error occurs
-   */
-  private int yy_advance() throws java.io.IOException {
-
-    /* standard case */
-    if (yy_currentPos < yy_endRead) return yy_buffer[yy_currentPos++];
-
-    /* if the eof is reached, we don't need to work hard */ 
-    if (yy_atEOF) return YYEOF;
-
-    /* otherwise: need to refill the buffer */
-
-    /* first: make room (if you can) */
-    if (yy_startRead > 0) {
-      System.arraycopy(yy_buffer, yy_startRead, 
-                       yy_buffer, 0, 
-                       yy_endRead-yy_startRead);
-
-      /* translate stored positions */
-      yy_endRead-= yy_startRead;
-      yy_currentPos-= yy_startRead;
-      yy_markedPos-= yy_startRead;
-      yy_pushbackPos-= yy_startRead;
-      yy_startRead = 0;
-    }
-
-    /* is the buffer big enough? */
-    if (yy_currentPos >= yy_buffer.length) {
-      /* if not: blow it up */
-      char newBuffer[] = new char[yy_currentPos*2];
-      System.arraycopy(yy_buffer, 0, newBuffer, 0, yy_buffer.length);
-      yy_buffer = newBuffer;
-    }
-
-    /* finally: fill the buffer with new input */
-    int numRead = yy_reader.read(yy_buffer, yy_endRead, 
-                                            yy_buffer.length-yy_endRead);
-
-    if ( numRead == -1 ) return YYEOF;
-
-    yy_endRead+= numRead;
-
-    return yy_buffer[yy_currentPos++];
-  }
-
-
-  /**
-   * Closes the input stream.
-   */
-  final public void yyclose() throws java.io.IOException {
-    yy_atEOF = true;            /* indicate end of file */
-    yy_endRead = yy_startRead;  /* invalidate buffer    */
-    yy_reader.close();
-  }
-
-
-  /**
-   * Returns the current lexical state.
-   */
-  final public int yystate() {
-    return yy_lexical_state;
-  }
-
-  /**
-   * Enters a new lexical state
-   *
-   * @param newState the new lexical state
-   */
-  final public void yybegin(int newState) {
-    yy_lexical_state = newState;
-  }
-
-
-  /**
-   * Returns the text matched by the current regular expression.
-   */
-  final public String yytext() {
-    return new String( yy_buffer, yy_startRead, yy_markedPos-yy_startRead );
-  }
-
-  /**
-   * Returns the length of the matched text region.
-   */
-  final public int yylength() {
-    return yy_markedPos-yy_startRead;
-  }
-
-
-  /**
-   * Reports an error that occured while scanning.
-   *
-   * @param   errorCode  the code of the errormessage to display
-   */
-  private void yy_ScanError(int errorCode) {
-    try {
-      System.out.println(YY_ERROR_MSG[errorCode]);
-    }
-    catch (ArrayIndexOutOfBoundsException e) {
-      System.out.println(YY_ERROR_MSG[YY_UNKNOWN_ERROR]);
-    }
-
-    System.exit(1);
-  } 
-
-
-  /**
-   * Pushes the specified amount of characters back into the input stream.
-   *
-   * They will be read again by then next call of the scanning method
-   *
-   * @param number  the number of characters to be read again.
-   *                This number must not be greater than yylength()!
-   */
-  private void yypushback(int number) {
-    if ( number > yylength() )
-      yy_ScanError(YY_PUSHBACK_2BIG);
-
-    yy_markedPos -= number;
-  }
-
-
-  /**
-   * Resumes scanning until the next regular expression is matched,
-   * the end of input is encountered or an I/O-Error occurs.
-   *
-   * @return      the next token
-   * @exception   IOException  if any I/O-Error occurs
-   */
-  public String primGetNextToken() throws java.io.IOException {
-    int yy_input;
-    int yy_action;
-
-    yy_pushbackPos = -1;
-    boolean yy_was_pushback;
-
-    while (true) {
-
-      yychar+= yylength();
-
-      boolean yy_counted = false;
-      for (yy_currentPos = yy_startRead; yy_currentPos < yy_markedPos;
-                                                      yy_currentPos++) {
-        switch (yy_buffer[yy_currentPos]) {
-        case '\r':
-          yyline++;
-          yy_counted = true;
-          break;
-        case '\n':
-          if (yy_counted)
-            yy_counted = false;
-          else {
-            yyline++;
-          }
-          break;
-        default:
-          yy_counted = false;
-        }
-      }
-
-      if (yy_counted) {
-        if ( yy_advance() == '\n' ) yyline--;
-        if ( !yy_atEOF ) yy_currentPos--;
-      }
-
-      yy_action = -1;
-
-      yy_currentPos = yy_startRead = yy_markedPos;
-
-      yy_state = yy_lexical_state;
-
-      yy_was_pushback = false;
-
-      yy_forAction: {
-        while (true) {
-
-          yy_input = yy_advance();
-
-          if ( yy_input == YYEOF ) break yy_forAction;
-
-          int yy_next = yytrans[ yy_rowMap[yy_state] + yycmap[yy_input] ];
-          if (yy_next == -1) break yy_forAction;
-          yy_state = yy_next;
-
-          int yy_attributes = YY_ATTRIBUTE[yy_state];
-          if ( (yy_attributes & 2) > 0 )
-            yy_pushbackPos = yy_currentPos;
-
-          if ( (yy_attributes & 1) > 0 ) {
-            yy_was_pushback = (yy_attributes & 4) > 0;
-            yy_action = yy_state; 
-            yy_markedPos = yy_currentPos; 
-            if ( (yy_attributes & 8) > 0 ) break yy_forAction;
-          }
-
-        }
-      }
-
-      if (yy_was_pushback)
-        yy_markedPos = yy_pushbackPos;
-
-      switch (yy_action) {    
-
-        case 421: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_IMPORTANT;  }
-        case 433: break;
-        case 412: 
-          {  yybegin(ST_FONT_FACE_DELIMITER); return CSS_FONT_FACE;  }
-        case 434: break;
-        case 375: 
-          {  yybegin(ST_CHARSET_NAME); return CSS_CHARSET;  }
-        case 435: break;
-        case 335: 
-          {  yybegin(ST_IMPORT_URI); return CSS_IMPORT;  }
-        case 436: break;
-        case 297: 
-          {  yybegin(ST_MEDIA_MEDIUM); return CSS_MEDIA;  }
-        case 437: break;
-        case 290: 
-        case 327: 
-        case 398: 
-        case 400: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_URI;  }
-        case 438: break;
-        case 269: 
-        case 307: 
-        case 385: 
-        case 387: 
-          {  yybegin(ST_IMPORT_MEDIUM); return CSS_URI;  }
-        case 439: break;
-        case 255: 
-          {  yybegin(ST_PAGE_PSEUDO_PAGE); return CSS_PAGE;  }
-        case 440: break;
-        case 218: 
-          {  return CSS_COMMENT;  }
-        case 441: break;
-        case 217: 
-          {  return CSS_CDO;  }
-        case 442: break;
-        case 211: 
-        case 245: 
-        case 283: 
-        case 284: 
-        case 323: 
-        case 324: 
-        case 363: 
-        case 364: 
-        case 394: 
-        case 395: 
-        case 407: 
-        case 417: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_UNICODE_RANGE;  }
-        case 443: break;
-        case 165: 
-          {  return CSS_CDC;  }
-        case 444: break;
-        case 162: 
-          {  return CSS_DECLARATION_VALUE_S;  }
-        case 445: break;
-        case 156: 
-        case 210: 
-        case 244: 
-        case 282: 
-        case 322: 
-        case 362: 
-        case 393: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_HASH;  }
-        case 446: break;
-        case 150: 
-        case 205: 
-        case 208: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_STRING;  }
-        case 447: break;
-        case 57: 
-        case 59: 
-        case 128: 
-        case 129: 
-        case 193: 
-        case 235: 
-        case 273: 
-        case 313: 
-        case 353: 
-          {  yybegin(ST_SELECTOR_ATTRIBUTE_OPERATOR); return CSS_SELECTOR_ATTRIBUTE_NAME;  }
-        case 448: break;
-        case 56: 
-          {  yybegin(ST_SELECTOR); return CSS_SELECTOR_SEPARATOR;  }
-        case 449: break;
-        case 55: 
-        case 125: 
-          {  yybegin(ST_SELECTOR); return CSS_SELECTOR_COMBINATOR;  }
-        case 450: break;
-        case 52: 
-          {  yybegin(ST_DECLARATION); return CSS_LBRACE;  }
-        case 451: break;
-        case 49: 
-        case 51: 
-        case 123: 
-        case 124: 
-        case 192: 
-        case 234: 
-        case 272: 
-        case 312: 
-        case 352: 
-          {  yybegin(ST_PAGE_DELIMITER); return CSS_PAGE_SELECTOR;  }
-        case 452: break;
-        case 48: 
-          {  yybegin(YYINITIAL); return CSS_LBRACE;  }
-        case 453: break;
-        case 47: 
-          {  yybegin(ST_MEDIA_MEDIUM); return CSS_MEDIA_SEPARATOR;  }
-        case 454: break;
-        case 44: 
-        case 46: 
-        case 120: 
-        case 121: 
-        case 191: 
-        case 233: 
-        case 271: 
-        case 311: 
-        case 351: 
-          {  yybegin(ST_MEDIA_DELIMITER); return CSS_MEDIUM;  }
-        case 455: break;
-        case 43: 
-          {  yybegin(ST_IMPORT_MEDIUM); return CSS_MEDIA_SEPARATOR;  }
-        case 456: break;
-        case 20: 
-        case 23: 
-        case 89: 
-        case 90: 
-        case 164: 
-        case 214: 
-        case 249: 
-        case 292: 
-        case 331: 
-          {  yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ELEMENT_NAME;  }
-        case 457: break;
-        case 22: 
-        case 54: 
-        case 87: 
-        case 126: 
-        case 163: 
-          {  return CSS_S;  }
-        case 458: break;
-        case 27: 
-          {  yybegin(YYINITIAL); return CSS_RBRACE;  }
-        case 459: break;
-        case 29: 
-          {  yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_UNIVERSAL;  }
-        case 460: break;
-        case 32: 
-          {  yybegin(ST_SELECTOR_ATTRIBUTE_NAME); return CSS_SELECTOR_ATTRIBUTE_START;  }
-        case 461: break;
-        case 36: 
-          {  yybegin(YYINITIAL); return CSS_DELIMITER;  }
-        case 462: break;
-        case 40: 
-        case 42: 
-        case 117: 
-        case 118: 
-        case 190: 
-        case 232: 
-        case 270: 
-        case 310: 
-        case 350: 
-          {  yybegin(ST_IMPORT_DELIMITER); return CSS_MEDIUM;  }
-        case 463: break;
-        case 60: 
-          {  yybegin(ST_SELECTOR_ATTRIBUTE_VALUE); return CSS_SELECTOR_ATTRIBUTE_OPERATOR;  }
-        case 464: break;
-        case 62: 
-          {  yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ATTRIBUTE_END;  }
-        case 465: break;
-        case 63: 
-        case 67: 
-        case 131: 
-        case 134: 
-        case 137: 
-        case 194: 
-        case 196: 
-        case 199: 
-        case 236: 
-        case 274: 
-        case 314: 
-        case 354: 
-          {  yybegin(ST_SELECTOR_ATTRIBUTE_END); return CSS_SELECTOR_ATTRIBUTE_VALUE;  }
-        case 466: break;
-        case 68: 
-        case 70: 
-        case 139: 
-        case 140: 
-        case 201: 
-        case 239: 
-        case 277: 
-        case 317: 
-        case 357: 
-          {  yybegin(ST_DECLARATION_SEPARATOR); return CSS_DECLARATION_PROPERTY;  }
-        case 467: break;
-        case 71: 
-          {  yybegin(ST_DECLARATION); return CSS_DECLARATION_DELIMITER;  }
-        case 468: break;
-        case 72: 
-          {  yybegin(ST_DECLARATION_PRE_VALUE); return CSS_DECLARATION_SEPARATOR;  }
-        case 469: break;
-        case 73: 
-        case 155: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_NUMBER;  }
-        case 470: break;
-        case 74: 
-        case 79: 
-        case 83: 
-        case 147: 
-        case 153: 
-        case 154: 
-        case 159: 
-        case 203: 
-        case 212: 
-        case 241: 
-        case 279: 
-        case 319: 
-        case 359: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_IDENT;  }
-        case 471: break;
-        case 78: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE;  }
-        case 472: break;
-        case 85: 
-        case 86: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_OPERATOR;  }
-        case 473: break;
-        case 91: 
-        case 166: 
-        case 215: 
-        case 250: 
-        case 293: 
-        case 332: 
-        case 373: 
-          {  yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_CLASS;  }
-        case 474: break;
-        case 93: 
-        case 167: 
-        case 216: 
-        case 251: 
-        case 294: 
-        case 333: 
-        case 374: 
-          {  yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ID;  }
-        case 475: break;
-        case 102: 
-        case 176: 
-        case 226: 
-        case 258: 
-        case 260: 
-        case 300: 
-        case 338: 
-        case 378: 
-          {  yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_PSEUDO;  }
-        case 476: break;
-        case 106: 
-        case 178: 
-        case 181: 
-          {  yybegin(ST_CHARSET_DELIMITER); return CSS_STRING;  }
-        case 477: break;
-        case 112: 
-        case 184: 
-        case 187: 
-          {  yybegin(ST_IMPORT_MEDIUM); return CSS_STRING;  }
-        case 478: break;
-        case 141: 
-        case 202: 
-        case 240: 
-        case 278: 
-        case 318: 
-        case 358: 
-        case 390: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_DIMENSION;  }
-        case 479: break;
-        case 144: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_PERCENTAGE;  }
-        case 480: break;
-        case 146: 
-        case 247: 
-          {  yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_FUNCTION;  }
-        case 481: break;
-        case 19: 
-        case 21: 
-        case 24: 
-        case 25: 
-        case 26: 
-        case 28: 
-        case 30: 
-        case 31: 
-        case 33: 
-        case 34: 
-        case 35: 
-        case 37: 
-        case 38: 
-        case 39: 
-        case 41: 
-        case 45: 
-        case 50: 
-        case 53: 
-        case 58: 
-        case 61: 
-        case 64: 
-        case 65: 
-        case 66: 
-        case 69: 
-        case 75: 
-        case 76: 
-        case 77: 
-        case 80: 
-        case 81: 
-        case 82: 
-        case 84: 
-          { 
-	return UNDEFINED;
- }
-        case 482: break;
-        default: 
-          if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
-            yy_atEOF = true;
-              return null;
-          } 
-          else {
-            yy_ScanError(YY_NO_MATCH);
-          }
-      }
-    }
-  }    
-
-  /**
-   * Runs the scanner on input files.
-   *
-   * This main method is the debugging routine for the scanner.
-   * It prints each returned token to System.out until the end of
-   * file is reached, or an error occured.
-   *
-   * @param argv   the command line, contains the filenames to run
-   *               the scanner on.
-   */
-  public static void main(String argv[]) {
-    for (int i = 0; i < argv.length; i++) {
-      CSSTokenizer scanner = null;
-      try {
-        scanner = new CSSTokenizer( new java.io.FileReader(argv[i]) );
-      }
-      catch (java.io.FileNotFoundException e) {
-        System.out.println("File not found : \""+argv[i]+"\"");
-        System.exit(1);
-      }
-      catch (java.io.IOException e) {
-        System.out.println("Error opening file \""+argv[i]+"\"");
-        System.exit(1);
-      }
-      catch (ArrayIndexOutOfBoundsException e) {
-        System.out.println("Usage : java CSSTokenizer <inputfile>");
-        System.exit(1);
-      }
-
-      try {
-        do {
-          System.out.println(scanner.primGetNextToken());
-        } while (!scanner.yy_atEOF);
-
-      }
-      catch (java.io.IOException e) {
-        System.out.println("An I/O error occured while scanning :");
-        System.out.println(e);
-        System.exit(1);
-      }
-      catch (Exception e) {
-        e.printStackTrace();
-        System.exit(1);
-      }
-    }
-  }
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.jflex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.jflex
index 86481a4..ea7c6af2 100644
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.jflex
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.jflex
@@ -1,5 +1,5 @@
 /*******************************************************************************

- * Copyright (c) 2004 IBM Corporation and others.

+ * Copyright (c) 2004, 2009 IBM Corporation and others.

  * All rights reserved. This program and the accompanying materials

  * are made available under the terms of the Eclipse Public License v1.0

  * which accompanies this distribution, and is available at

@@ -29,10 +29,9 @@
 %function primGetNextToken

 %type String

 %char

-%line

 %unicode

 %caseless

-%debug

+//%debug

 %pack

 

 %{

@@ -104,7 +103,7 @@
 					spaceFollows = (nextTokenType == CSS_S);

 				}

 				if (nextTokenType != null) { // nextToken is retrieved

-					if (spaceFollows) {

+					if (spaceFollows && (context != CSS_COMMENT)) {

 						// next is space -> append

 //						text.append(yytext());

 						length += yylength();

@@ -163,7 +162,7 @@
 	

 	/* user method */

 	public final boolean isEOF() {

-		return yy_atEOF;

+		return zzAtEOF;

 	}

 

 	/* user method */

@@ -174,36 +173,36 @@
 	/* user method */

 	public final void reset(java.io.Reader in, int newOffset) {

 		/** the input device */

-		yy_reader = in;

+		zzReader = in;

 

 		/** the current state of the DFA */

-		yy_state = 0;

+		zzState = 0;

 

 		/** the current lexical state */

-		yy_lexical_state = fInitialState; //YYINITIAL;

+		zzLexicalState = fInitialState; //YYINITIAL;

 

 		/** this buffer contains the current text to be matched and is

 			the source of the yytext() string */

-		if (yy_buffer.length != fInitialBufferSize) {

-			yy_buffer = new char[fInitialBufferSize];

+		if (zzBuffer.length != fInitialBufferSize) {

+			zzBuffer = new char[fInitialBufferSize];

 		}

-		java.util.Arrays.fill(yy_buffer, (char)0);

+		java.util.Arrays.fill(zzBuffer, (char)0);

 

 		/** the textposition at the last accepting state */

-		yy_markedPos = 0;

+		zzMarkedPos = 0;

 

 		/** the textposition at the last state to be included in yytext */

-		yy_pushbackPos = 0;

+//		yy_pushbackPos = 0;

 

 		/** the current text position in the buffer */

-		yy_currentPos = 0;

+		zzCurrentPos = 0;

 

 		/** startRead marks the beginning of the yytext() string in the buffer */

-		yy_startRead = 0;

+		zzStartRead = 0;

 

 		/** endRead marks the last character in the buffer, that has been read

 			from input */

-		yy_endRead = 0;

+		zzEndRead = 0;

 

 		/** number of newlines encountered up to the start of the matched text */

 		yyline = 0;

@@ -220,10 +219,10 @@
 		/** 

 		 * yy_atBOL == true <=> the scanner is currently at the beginning of a line

 		 */

-		yy_atBOL = false;

+//		yy_atBOL = false;

 		

-		/** yy_atEOF == true <=> the scanner has returned a value for EOF */

-		yy_atEOF = false;

+		/** zzAtEOF == true <=> the scanner has returned a value for EOF */

+		zzAtEOF = false;

 

 		/* user variables */

 		//		fUndefined.delete(0, fUndefined.length());

@@ -234,6 +233,15 @@
 		super();

 	}

 

+	/**

+	 * Added to workaround stricter compilation options without creating

+	 * an alternate skeleton file

+	 */

+	void _usePrivates() {

+		System.out.print(yycolumn);

+		System.out.print(yyline);

+		System.out.print(Boolean.toString(zzAtBOL));

+	}

 %}

 

 %state ST_CHARSET_NAME

@@ -270,6 +278,7 @@
 string2 = \'([\t !#$%&(-~]|\\{nl}|\"|{nonascii}|{escape})*\'

 

 ident = -?{nmstart}{nmchar}*

+value_ident = -?{nmstart}"."?({nmchar}+"."?)*

 

 name = {nmchar}+

 num = [+-]?([0-9]+|[0-9]*"."[0-9]+)

@@ -355,6 +364,7 @@
  */

 <ST_MEDIA_MEDIUM> {

 	{ident} { yybegin(ST_MEDIA_DELIMITER); return CSS_MEDIUM; }

+	"{" { yybegin(YYINITIAL); return CSS_LBRACE; }

 }

 

 <ST_MEDIA_DELIMITER> {

@@ -407,8 +417,8 @@
 <YYINITIAL, ST_SELECTOR_MODIFIER, ST_SELECTOR> {

 	"*" { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_UNIVERSAL; }

 	{hash} { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ID; }

-//	":"{ident} { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_PSEUDO; }

-	":"{ident}("("{s}*{ident}{s}*")")? { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_PSEUDO; }

+//	":"{ident}("("{s}*{ident}{s}*")")? { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_PSEUDO; }

+	":"({ident}("("{s}*{ident}{s}*")")?)? { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_PSEUDO; }

 	"."{name} { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_CLASS; }

 	"[" { yybegin(ST_SELECTOR_ATTRIBUTE_NAME); return CSS_SELECTOR_ATTRIBUTE_START; }

 }

@@ -420,7 +430,7 @@
 <ST_SELECTOR_MODIFIER> {

 	"," { yybegin(ST_SELECTOR); return CSS_SELECTOR_SEPARATOR; }

 	// using LOOKAHEAD

-	{s}+/[^+>\{] { yybegin(ST_SELECTOR); return CSS_SELECTOR_COMBINATOR; }

+	{s}+/[^+>\{,/] { yybegin(ST_SELECTOR); return CSS_SELECTOR_COMBINATOR; }

 	"+"|">" { yybegin(ST_SELECTOR); return CSS_SELECTOR_COMBINATOR; }

 	"{" { yybegin(ST_DECLARATION); return CSS_LBRACE; }

 }

@@ -453,7 +463,7 @@
  */

 

 <ST_DECLARATION> {

-	{ident} { yybegin(ST_DECLARATION_SEPARATOR); return CSS_DECLARATION_PROPERTY; }

+	\x2A?{ident} { yybegin(ST_DECLARATION_SEPARATOR); return CSS_DECLARATION_PROPERTY; }

 }

 

 <ST_DECLARATION_SEPARATOR> {

@@ -469,7 +479,7 @@
 	// ordered following two rules deliberately, see 

 	//  https://bugs.eclipse.org/bugs/show_bug.cgi?id=129902

 	{num}{ident} { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_DIMENSION; }

-	{ident} { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_IDENT; }

+	{value_ident} { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_IDENT; }

 

 

 	{num}"%" { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_PERCENTAGE; }

diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/flex.cmd b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/flex.cmd
index 30fce78..d39ae78 100644
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/flex.cmd
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/flex.cmd
@@ -1,7 +1,6 @@
 @echo off

-set PATH=%PATH%;c:\jdk1.4\bin

-java -Xmx470000000 -cp JFlex\lib\sed-jflex.jar;. JFlex.Main JSPTokenizer -skel skeleton.sed

-java -Xmx470000000 -cp JFlex\lib\sed-jflex.jar;. JFlex.Main XMLTokenizer -skel skeleton.sed

-rm -f JSPTokenizer.java~ JSPTokenizer~ XMLTokenizer.java~ XMLTokenizer~

-copy XMLTokenizer.java ..\..\..\..\sedmodel\com\ibm\sed\parser\internal

-copy JSPTokenizer.java ..\..\..\..\sedmodel\com\ibm\sed\parser\internal

+set JAVA_HOME=d:\jdk6_03

+set JFLEX_HOME=D:\JFlex\jflex-1.4.2

+

+%JAVA_HOME%\bin\java -Xmx470M -jar %JFLEX_HOME%\lib\JFlex.jar CSSTokenizer.jflex

+move CSSTokenizer.java ..\..\..\..\..\org.eclipse.wst.css.core\src\org\eclipse\wst\css\core\internal\parser\ && del CSSTokenizer.java*

diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/flex.sh b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/flex.sh
deleted file mode 100644
index f7872f3..0000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/flex.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh

-

-JAVADIR=C:/App/IBM/Java141/bin

-JAVAOPT=-Xmx470000000

-CLASSPATH=../../HTMLTokenizer/devel/JFlex/lib/sed-jflex.jar\;.

-DESTDIR=../../../../../org.eclipse.wst.sse.core.css/src/com/ibm/sse/model/css/internal/parser

-

-#export PATH=$PATH:/opt/IBMJava2-131/bin/:/opt/IBMJava2-13/bin/:/opt/jdk1.4

-#java -Xmx470000000 -cp JFlex/lib/sed-jflex.jar;. JFlex.Main CSSTokenizer -skel skeleton.sse

-

-$JAVADIR/java $JAVAOPT -cp $CLASSPATH JFlex.Main CSSTokenizer.jflex

-

-rm -f CSSTokenizer.java~ CSSTokenizer.jflex~

-cp -v CSSTokenizer.java $DESTDIR

-#$JAVADIR/javac $DESTDIR/*.java

diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex
index 32fdb7b..dbae01f 100644
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex
@@ -1,5 +1,5 @@
 /*******************************************************************************

- * Copyright (c) 2004, 2007 IBM Corporation and others.

+ * Copyright (c) 2004, 2010 IBM Corporation and others.

  * All rights reserved. This program and the accompanying materials

  * are made available under the terms of the Eclipse Public License v1.0

  * which accompanies this distribution, and is available at

@@ -7,6 +7,7 @@
  * 

  * Contributors:

  *     IBM Corporation - initial API and implementation

+ *     Frits Jalvingh - contributions for bug 150794

  *******************************************************************************/

 

 package org.eclipse.jst.jsp.core.internal.parser.internal;

@@ -39,7 +40,8 @@
 	private String fBufferedContext = null;

 	private int fBufferedStart = 1;

 	private int fBufferedLength = 0;

-	private ContextRegionContainer fBufferedEmbeddedContainer = null;

+	private ITextRegion fBufferedEmbeddedContainer = null;

+	private ITextRegion fProxyUnknownRegion = null;

 	private String f_context = null;

 

 	// state stack for handling embedded regions

@@ -49,9 +51,11 @@
 	// a "hint" as to what state to enter once an embedded region has

 	//   been completed

 	private int fEmbeddedPostState = YYINITIAL;

+	

 	// the container used to create embedded regions

 	private ContextRegionContainer fEmbeddedContainer = null;

 	private static final String PROXY_CONTEXT = "PROXY_CONTEXT";

+	private static final String PROXY_UNKNOWN_CONTEXT = "PROXY_UNKNOWN_CONTEXT";

 

 	private String context = null;

 	private int start = 0;

@@ -85,6 +89,15 @@
 

 	private JSPParserRegionFactory fRegionFactory = new JSPParserRegionFactory();

 

+	// Is the embedded tag a JSP tag

+	private boolean fEmbeddedTag = false;

+	// Is the non-embedded tag a JSP tag

+	private boolean fContainerTag = false;

+	// Is the tokenizer in a non-embedded tag (between < and >)

+	private boolean fInTagContainer = false;

+	// Is the tokenizer in an embedded tag (between < and >)

+	private boolean fInTagEmbedded = false;

+

 	/**

 	 * user method 

 	 */

@@ -409,215 +422,221 @@
  */

 private final String doScan(String searchString, boolean requireTailSeparator, boolean allowJSP, boolean allowCDATA, String searchContext, int exitState, int immediateFallbackState) throws IOException {

 	boolean stillSearching = true;

-	// Disable further block (probably)

-	fIsBlockingEnabled = false;

-	int searchStringLength = searchString.length();

-	int n = 0;

-	char lastCheckChar;

-	int i;

-	boolean same = false;

-	// Check for JSP starts ("<%") if the tag is global like SCRIPT or STYLE

-	boolean checkJSPs = allowJSP && !fForbidJSP;

-	boolean checkedForJSPsOnce = !checkJSPs;

-	boolean checkedJSPsAtStartOnce = false;

-	

-	while (stillSearching) {

-		n = 0;

-		// Ensure that enough data from the input exists to compare against the search String.

-		n = yy_advance();

-		while(n != YYEOF && yy_currentPos < searchStringLength)

+	boolean wasBlockingEnabled = fIsBlockingEnabled;

+	try {

+		// Disable further block (probably)

+		fIsBlockingEnabled = false;

+		int searchStringLength = searchString.length();

+		int n = 0;

+		char lastCheckChar;

+		int i;

+		boolean same = false;

+		// Check for JSP starts ("<%") if the tag is global like SCRIPT or STYLE

+		boolean checkJSPs = allowJSP && !fForbidJSP;

+		boolean checkedForJSPsOnce = !checkJSPs;

+		boolean checkedJSPsAtStartOnce = false;

+		

+		while (stillSearching) {

+			n = 0;

+			// Ensure that enough data from the input exists to compare against the search String.

 			n = yy_advance();

-//		c = (char) n;

-		// If the input was too short or we've exhausted the input, stop immediately.

-		if (n == YYEOF && checkedForJSPsOnce) {

-			stillSearching = false;

-		}

-		else {

-			/**

-			 * Look for starting JSPs "<%"

-			 */

-			checkedForJSPsOnce = true;

-			// 1) yy_currentPos - searchStringLength : There's at least searchStringLength of input available; once that's read, check for JSPs

-			// ---

-			// Look for a JSP beginning at current-searchStringLength; if so, backup and switch scanner states to handle it.

-			// Ensure that we've not encountered a complete block (<%%>) that was *shorter* than the closeTagString and

-			// thus found twice at current-targetLength [since the first scan would have come out this far anyway].

-			if(checkJSPs && yy_currentPos > searchStringLength && yy_currentPos - searchStringLength != fLastInternalBlockStart && 

-				yy_buffer[yy_currentPos - searchStringLength] == '<' && yy_buffer[yy_currentPos - searchStringLength + 1] == '%') {

-				fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;

-				yy_currentPos = yy_markedPos + 1;

-				int resumeState = yystate();

-				yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

-				if(yy_markedPos == yy_startRead) {

-					String jspContext = primGetNextToken();

-					yybegin(resumeState);

-					return jspContext;

-				}

-				return searchContext;

-			}

-			// 2) yy_currentPos - jspstarter.length : There's not searchStringLength of input available; check for a JSP 2 spots back in what we could read

-			// ---

-			// Look for a JSP beginning at the current position; this case wouldn't be handled by the preceding section

-			// since it relies upon *having* closeTagStringLength amount of input to work as designed.  Must be sure we don't

-			// spill over the end of the buffer while checking.

-			else if(checkJSPs && yy_startRead != fLastInternalBlockStart && yy_currentPos > 0 && yy_currentPos < yy_buffer.length - 1 &&

-					yy_buffer[yy_currentPos - 1] == '<' && yy_buffer[yy_currentPos] == '%') {

-				fLastInternalBlockStart = yy_markedPos = yy_currentPos - 1;

-				yy_currentPos = yy_markedPos + 1;

-				int resumeState = yystate();

-				yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

-				if(yy_markedPos == yy_startRead) {

-					String jspContext = primGetNextToken();

-					yybegin(resumeState);

-					return jspContext;

-				}

-				return searchContext;

-			}

-			// 3) yy_currentPos..(yy_currentPos+jspStartlength-1) : Check at the start of the block one time

-			// ---

-			// Look for a JSP beginning immediately in the block area; this case wouldn't be handled by the preceding section

-			// since it relies upon yy_currentPos equaling exactly the previous end +1 to work as designed.

-			else if(checkJSPs && !checkedJSPsAtStartOnce && yy_startRead != fLastInternalBlockStart && yy_startRead > 0 &&

-					yy_startRead < yy_buffer.length - 1 && yy_buffer[yy_startRead] == '<' && yy_buffer[yy_startRead + 1] == '%') {

-				checkedJSPsAtStartOnce = true;

-				fLastInternalBlockStart = yy_markedPos = yy_startRead;

-				yy_currentPos = yy_markedPos + 1;

-				int resumeState = yystate();

-				yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

-				if(yy_markedPos == yy_startRead) {

-					String jspContext = primGetNextToken();

-					yybegin(resumeState);

-					return jspContext;

-				}

-				return searchContext;

-			}

-

-

-			/**

-			 * Look for starting CDATA "<![CDATA["

-			 */

-			// 1) yy_currentPos - searchStringLength: There's at least searchStringLength of input available; once that's read, check for CDATA

-			// ---

-			// Look for a CDATA beginning at current-searchStringLength; if so, backup and switch scanner states to handle it.

-			// Ensure that we've not encountered a complete block (<[!CDATA[]]>) that was *shorter* than the closeTagString and

-			// thus found twice at current-targetLength [since the first scan would have come out this far anyway].

-/*			if(checkCDATA && yy_currentPos > searchStringLength && yy_currentPos + searchStringLength < yy_buffer.length && yy_currentPos - searchStringLength != fLastInternalBlockStart && 

-				charsMatch(cdataStarter, yy_buffer, 0, yy_currentPos - searchStringLength)) {

-				fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;

-				yy_currentPos = yy_markedPos + 1;

-				int resumeState = yystate();

-				// go to a state where CDATA can be found

-				if (fEmbeddedContainer == null) {

-					fEmbeddedContainer = new ContextRegionContainer();

-					fEmbeddedContainer.setType(searchContext);

-					fEmbeddedContainer.setStart(yychar);

-				}

-				ITextRegion newToken = fRegionFactory.createToken(searchContext, yychar, yylength(), yylength());

-				fEmbeddedContainer.getRegions().add(newToken);

-				fEmbeddedContainer.setLength(fEmbeddedContainer.getLength() + yylength());

-				fEmbeddedContainer.setTextLength(fEmbeddedContainer.getTextLength() + yylength());

-				yybegin(YYINITIAL);

-				String context = primGetNextToken();

-				if(context.equals(XMLRegionContexts.XML_CDATA_OPEN)) {

-					assembleEmbeddedContainer(XMLRegionContexts.XML_CDATA_OPEN, XMLRegionContexts.XML_CDATA_CLOSE);

-				}

-				yybegin(resumeState);

-				return searchContext;

-			}

-*//*

-			// 2) yy_currentPos - cdataStarter.length: There's not searchStringLength of input available; check for a CDATA right here spots back in what we could read

-			// ---

-			// Look for a JSP beginning at the current position; this case wouldn't be handled by the preceding section

-			// since it relies upon *having* closeTagStringLength amount of input to work as designed.  Must be sure we don't

-			// spill over the end of the buffer while checking.

-			else if(checkCDATA && yy_startRead != fLastInternalBlockStart && yy_currentPos > 0 && yy_currentPos < yy_buffer.length - 1 &&

-					yy_buffer[yy_currentPos - 1] == '<' && yy_buffer[yy_currentPos] == '%') {

-				fLastInternalBlockStart = yy_markedPos = yy_currentPos - 1;

-				yy_currentPos = yy_markedPos + 1;

-				int resumeState = yystate();

-				yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

-				if(yy_markedPos == yy_startRead) {

-					String jspContext = primGetNextToken();

-					yybegin(resumeState);

-					return jspContext;

-				}

-				return searchContext;

-			}

-			// 3) yy_currentPos : Check at the start of the block one time

-			// ---

-			// Look for a JSP beginning immediately in the block area; this case wouldn't be handled by the preceding section

-			// since it relies upon yy_currentPos equaling exactly the previous end +1 to work as designed.

-			else if(checkCDATA && !checkedForCDATAOnce && yy_startRead != fLastInternalBlockStart && yy_startRead > 0 &&

-					yy_startRead < yy_buffer.length - 1 && yy_buffer[yy_startRead] == '<' && yy_buffer[yy_startRead + 1] == '%') {

-				checkedForCDATAOnce = true;

-				fLastInternalBlockStart = yy_markedPos = yy_startRead;

-				yy_currentPos = yy_markedPos + 1;

-				int resumeState = yystate();

-				yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

-				if(yy_markedPos == yy_startRead) {

-					String jspContext = primGetNextToken();

-					yybegin(resumeState);

-					return jspContext;

-				}

-				return searchContext;

-			}

-*/

-			// Check the characters in the target versus the last targetLength characters read from the buffer

-			// and see if it matches

-			if (n == YYEOF) {

+			while(n != YYEOF && yy_currentPos < searchStringLength)

+				n = yy_advance();

+	//		c = (char) n;

+			// If the input was too short or we've exhausted the input, stop immediately.

+			if (n == YYEOF && checkedForJSPsOnce) {

 				stillSearching = false;

 			}

 			else {

-				same = true;

-				// safety check for array accesses

-				if(yy_currentPos >= searchStringLength && yy_currentPos <= yy_buffer.length) {

-					for(i = 0; i < searchStringLength; i++) {

-						if(same && fIsCaseSensitiveBlocking)

-							same = yy_buffer[i + yy_currentPos - searchStringLength] == searchString.charAt(i);

-						else if(same && !fIsCaseSensitiveBlocking)

-							same = Character.toLowerCase(yy_buffer[i + yy_currentPos - searchStringLength]) == Character.toLowerCase(searchString.charAt(i));

+				/**

+				 * Look for starting JSPs "<%"

+				 */

+				checkedForJSPsOnce = true;

+				// 1) yy_currentPos - searchStringLength : There's at least searchStringLength of input available; once that's read, check for JSPs

+				// ---

+				// Look for a JSP beginning at current-searchStringLength; if so, backup and switch scanner states to handle it.

+				// Ensure that we've not encountered a complete block (<%%>) that was *shorter* than the closeTagString and

+				// thus found twice at current-targetLength [since the first scan would have come out this far anyway].

+				if(checkJSPs && yy_currentPos > searchStringLength && yy_currentPos - searchStringLength != fLastInternalBlockStart && 

+					yy_buffer[yy_currentPos - searchStringLength] == '<' && yy_buffer[yy_currentPos - searchStringLength + 1] == '%') {

+					fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;

+					yy_currentPos = yy_markedPos + 1;

+					int resumeState = yystate();

+					yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

+					if(yy_markedPos == yy_startRead) {

+						String jspContext = primGetNextToken();

+						yybegin(resumeState);

+						return jspContext;

+					}

+					return searchContext;

+				}

+				// 2) yy_currentPos - jspstarter.length : There's not searchStringLength of input available; check for a JSP 2 spots back in what we could read

+				// ---

+				// Look for a JSP beginning at the current position; this case wouldn't be handled by the preceding section

+				// since it relies upon *having* closeTagStringLength amount of input to work as designed.  Must be sure we don't

+				// spill over the end of the buffer while checking.

+				else if(checkJSPs && yy_startRead != fLastInternalBlockStart && yy_currentPos > 0 && yy_currentPos < yy_buffer.length - 1 &&

+						yy_buffer[yy_currentPos - 1] == '<' && yy_buffer[yy_currentPos] == '%') {

+					fLastInternalBlockStart = yy_markedPos = yy_currentPos - 1;

+					yy_currentPos = yy_markedPos + 1;

+					int resumeState = yystate();

+					yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

+					if(yy_markedPos == yy_startRead) {

+						String jspContext = primGetNextToken();

+						yybegin(resumeState);

+						return jspContext;

+					}

+					return searchContext;

+				}

+				// 3) yy_currentPos..(yy_currentPos+jspStartlength-1) : Check at the start of the block one time

+				// ---

+				// Look for a JSP beginning immediately in the block area; this case wouldn't be handled by the preceding section

+				// since it relies upon yy_currentPos equaling exactly the previous end +1 to work as designed.

+				else if(checkJSPs && !checkedJSPsAtStartOnce && yy_startRead != fLastInternalBlockStart && yy_startRead > 0 &&

+						yy_startRead < yy_buffer.length - 1 && yy_buffer[yy_startRead] == '<' && yy_buffer[yy_startRead + 1] == '%') {

+					checkedJSPsAtStartOnce = true;

+					fLastInternalBlockStart = yy_markedPos = yy_startRead;

+					yy_currentPos = yy_markedPos + 1;

+					int resumeState = yystate();

+					yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

+					if(yy_markedPos == yy_startRead) {

+						String jspContext = primGetNextToken();

+						yybegin(resumeState);

+						return jspContext;

+					}

+					return searchContext;

+				}

+	

+	

+				/**

+				 * Look for starting CDATA "<![CDATA["

+				 */

+				// 1) yy_currentPos - searchStringLength: There's at least searchStringLength of input available; once that's read, check for CDATA

+				// ---

+				// Look for a CDATA beginning at current-searchStringLength; if so, backup and switch scanner states to handle it.

+				// Ensure that we've not encountered a complete block (<[!CDATA[]]>) that was *shorter* than the closeTagString and

+				// thus found twice at current-targetLength [since the first scan would have come out this far anyway].

+	/*			if(checkCDATA && yy_currentPos > searchStringLength && yy_currentPos + searchStringLength < yy_buffer.length && yy_currentPos - searchStringLength != fLastInternalBlockStart && 

+					charsMatch(cdataStarter, yy_buffer, 0, yy_currentPos - searchStringLength)) {

+					fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;

+					yy_currentPos = yy_markedPos + 1;

+					int resumeState = yystate();

+					// go to a state where CDATA can be found

+					if (fEmbeddedContainer == null) {

+						fEmbeddedContainer = new ContextRegionContainer();

+						fEmbeddedContainer.setType(searchContext);

+						fEmbeddedContainer.setStart(yychar);

+					}

+					ITextRegion newToken = fRegionFactory.createToken(searchContext, yychar, yylength(), yylength());

+					fEmbeddedContainer.getRegions().add(newToken);

+					fEmbeddedContainer.setLength(fEmbeddedContainer.getLength() + yylength());

+					fEmbeddedContainer.setTextLength(fEmbeddedContainer.getTextLength() + yylength());

+					yybegin(YYINITIAL);

+					String context = primGetNextToken();

+					if(context.equals(XMLRegionContexts.XML_CDATA_OPEN)) {

+						assembleEmbeddedContainer(XMLRegionContexts.XML_CDATA_OPEN, XMLRegionContexts.XML_CDATA_CLOSE);

+					}

+					yybegin(resumeState);

+					return searchContext;

+				}

+	*//*

+				// 2) yy_currentPos - cdataStarter.length: There's not searchStringLength of input available; check for a CDATA right here spots back in what we could read

+				// ---

+				// Look for a JSP beginning at the current position; this case wouldn't be handled by the preceding section

+				// since it relies upon *having* closeTagStringLength amount of input to work as designed.  Must be sure we don't

+				// spill over the end of the buffer while checking.

+				else if(checkCDATA && yy_startRead != fLastInternalBlockStart && yy_currentPos > 0 && yy_currentPos < yy_buffer.length - 1 &&

+						yy_buffer[yy_currentPos - 1] == '<' && yy_buffer[yy_currentPos] == '%') {

+					fLastInternalBlockStart = yy_markedPos = yy_currentPos - 1;

+					yy_currentPos = yy_markedPos + 1;

+					int resumeState = yystate();

+					yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

+					if(yy_markedPos == yy_startRead) {

+						String jspContext = primGetNextToken();

+						yybegin(resumeState);

+						return jspContext;

+					}

+					return searchContext;

+				}

+				// 3) yy_currentPos : Check at the start of the block one time

+				// ---

+				// Look for a JSP beginning immediately in the block area; this case wouldn't be handled by the preceding section

+				// since it relies upon yy_currentPos equaling exactly the previous end +1 to work as designed.

+				else if(checkCDATA && !checkedForCDATAOnce && yy_startRead != fLastInternalBlockStart && yy_startRead > 0 &&

+						yy_startRead < yy_buffer.length - 1 && yy_buffer[yy_startRead] == '<' && yy_buffer[yy_startRead + 1] == '%') {

+					checkedForCDATAOnce = true;

+					fLastInternalBlockStart = yy_markedPos = yy_startRead;

+					yy_currentPos = yy_markedPos + 1;

+					int resumeState = yystate();

+					yybegin(ST_BLOCK_TAG_INTERNAL_SCAN);

+					if(yy_markedPos == yy_startRead) {

+						String jspContext = primGetNextToken();

+						yybegin(resumeState);

+						return jspContext;

+					}

+					return searchContext;

+				}

+	*/

+				// Check the characters in the target versus the last targetLength characters read from the buffer

+				// and see if it matches

+				if (n == YYEOF) {

+					stillSearching = false;

+				}

+				else {

+					same = true;

+					// safety check for array accesses

+					if(yy_currentPos >= searchStringLength && yy_currentPos <= yy_buffer.length) {

+						for(i = 0; i < searchStringLength && same; i++) {

+							if(fIsCaseSensitiveBlocking)

+								same = yy_buffer[i + yy_currentPos - searchStringLength] == searchString.charAt(i);

+							else

+								same = Character.toLowerCase(yy_buffer[i + yy_currentPos - searchStringLength]) == Character.toLowerCase(searchString.charAt(i));

+						}

+					}

+					// safety check failed; no match is possible right now

+					else {

+						same = false;

 					}

 				}

-				// safety check failed; no match is possible right now

+				if (same && requireTailSeparator && yy_currentPos < yy_buffer.length) {

+					// Additional check for close tags to ensure that targetString="</script" doesn't match

+					// "</scriptS"

+					lastCheckChar = yy_buffer[yy_currentPos];

+					// Succeed on "</script>" and "</script "

+					if(lastCheckChar == '>' || Character.isWhitespace(lastCheckChar))

+						stillSearching = false;

+				}

 				else {

-					same = false;

+					stillSearching = !same || (yy_currentPos < yy_startRead + searchStringLength);

 				}

 			}

-			if (same && requireTailSeparator && yy_currentPos < yy_buffer.length) {

-				// Additional check for close tags to ensure that targetString="</script" doesn't match

-				// "</scriptS"

-				lastCheckChar = yy_buffer[yy_currentPos];

-				// Succeed on "</script>" and "</script "

-				if(lastCheckChar == '>' || Character.isWhitespace(lastCheckChar))

-					stillSearching = false;

-			}

-			else {

-				stillSearching = !same || (yy_currentPos < yy_startRead + searchStringLength);

+		}

+		if (n != YYEOF || same) {

+			// We've stopped short of the end or definitely found a match

+			yy_markedPos = yy_currentPos - searchStringLength;

+			yy_currentPos = yy_markedPos + 1;

+			// If the searchString occurs at the very beginning of what would have

+			// been a Block, resume scanning normally immediately

+			if (yy_markedPos == yy_startRead) {

+				yybegin(immediateFallbackState);

+				return primGetNextToken();

 			}

 		}

-	}

-	if (n != YYEOF || same) {

-		// We've stopped short of the end or definitely found a match

-		yy_markedPos = yy_currentPos - searchStringLength;

-		yy_currentPos = yy_markedPos + 1;

-		// If the searchString occurs at the very beginning of what would have

+		else {

+			// We ran through the rest of the input

+			yy_markedPos = yy_currentPos;

+			yy_currentPos++;

+		}

+		yybegin(exitState);

+		// If the ending occurs at the very beginning of what would have

 		// been a Block, resume scanning normally immediately

-		if (yy_markedPos == yy_startRead) {

-			yybegin(immediateFallbackState);

+		if(yy_markedPos == yy_startRead)

 			return primGetNextToken();

-		}

+		return searchContext;

 	}

-	else {

-		// We ran through the rest of the input

-		yy_markedPos = yy_currentPos;

-		yy_currentPos++;

+	finally {

+		fIsBlockingEnabled = wasBlockingEnabled;

 	}

-	yybegin(exitState);

-	// If the ending occurs at the very beginning of what would have

-	// been a Block, resume scanning normally immediately

-	if(yy_markedPos == yy_startRead)

-		return primGetNextToken();

-	return searchContext;

 }

 /**

  * user method 

@@ -689,6 +708,8 @@
 			fIsBlockingEnabled = true;

 		} else if (f_context == XML_END_TAG_OPEN) {

 			fIsBlockingEnabled = false;

+		} else if (f_context == PROXY_UNKNOWN_CONTEXT) {

+			fBufferedEmbeddedContainer = fProxyUnknownRegion;

 		}

 		fBufferedContext = f_context;

 		fBufferedStart = yychar;

@@ -852,6 +873,11 @@
 		//  context as usual.

 		return doScan("--%>", false, false, true, JSP_COMMENT_TEXT, ST_JSP_COMMENT_END, ST_JSP_COMMENT_END);

 	}

+	

+	/* user method */

+	private boolean isJspTag() {

+		return (fContainerTag && fEmbeddedContainer != null) || (fContainerTag && fInTagContainer) || (fEmbeddedTag && fInTagEmbedded);

+	}

 %}

 

 %eof{

@@ -920,6 +946,7 @@
 %state ST_JSP_COMMENT

 %state ST_JSP_COMMENT_END

 

+%state ST_JSP_ATTRIBUTE_VALUE

 %state ST_XML_ATTRIBUTE_VALUE_SQUOTED

 %state ST_XML_ATTRIBUTE_VALUE_DQUOTED

 

@@ -989,7 +1016,10 @@
 

 // \x24 = '$', \x7b = '{', \x23 = '#'

 // [10] AttValue ::= '"' ([^<&"] | Reference)* '"' |  "'" ([^<&'] | Reference)* "'"

-AttValue = ( \"([^<"\x24\x23] | [\x24\x23][^\x7b"] | {Reference})*[\x24\x23]*\" | \'([^<'\x24\x23] | [\x24\x23][^\x7b'] | {Reference})*[\x24\x23]*\'  | ([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )*)

+AttValue = ( \"([^<"\x24\x23] | [\x24\x23][^\x7b"] | \\[\x24\x23][\x7b] | {Reference})* [\x24\x23]*\" | \'([^<'\x24\x23] | [\x24\x23][^\x7b'] | \\[\x24\x23][\x7b] | {Reference})*[\x24\x23]*\'  | ([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )*)

+

+// As Attvalue, but accepts escaped versions of the lead-in quote also

+QuotedAttValue = ( \"([^<"\x24\x23] | [\x24\x23][^\x7b"] | \\[\x24\x23][\x7b] | \\\" | {Reference})*[\x24\x23]*\" | \'([^<'\x24\x23] | [\x24\x23][^\x7b'] | \\[\x24\x23][\x7b] | \\\' | {Reference})*[\x24\x23]*\'  | ([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )*)

 

 // [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'") 

 SystemLiteral = ((\" [^\"]* \") | (\' [^\']* \')) 

@@ -1338,7 +1368,7 @@
 %%

 

 /* white space within a tag */

-<ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_PI, ST_XML_PI_EQUALS, ST_XML_PI_ATTRIBUTE_NAME, ST_XML_PI_ATTRIBUTE_VALUE, ST_XML_DECLARATION, ST_XML_DOCTYPE_DECLARATION, ST_XML_ELEMENT_DECLARATION, ST_XML_ATTLIST_DECLARATION, ST_XML_DECLARATION_CLOSE, ST_XML_DOCTYPE_ID_PUBLIC, ST_XML_DOCTYPE_ID_SYSTEM, ST_XML_DOCTYPE_EXTERNAL_ID, ST_JSP_DIRECTIVE_NAME, ST_JSP_DIRECTIVE_ATTRIBUTE_NAME, ST_JSP_DIRECTIVE_EQUALS, ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE,ST_XML_ATTRIBUTE_VALUE_DQUOTED,ST_XML_ATTRIBUTE_VALUE_SQUOTED,ST_DHTML_ATTRIBUTE_NAME,ST_DHTML_EQUALS,ST_DHTML_ATTRIBUTE_VALUE,ST_DHTML_TAG_CLOSE> {S}* {

+<ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE, ST_PI, ST_XML_PI_EQUALS, ST_XML_PI_ATTRIBUTE_NAME, ST_XML_PI_ATTRIBUTE_VALUE, ST_XML_DECLARATION, ST_XML_DOCTYPE_DECLARATION, ST_XML_ELEMENT_DECLARATION, ST_XML_ATTLIST_DECLARATION, ST_XML_DECLARATION_CLOSE, ST_XML_DOCTYPE_ID_PUBLIC, ST_XML_DOCTYPE_ID_SYSTEM, ST_XML_DOCTYPE_EXTERNAL_ID, ST_JSP_DIRECTIVE_NAME, ST_JSP_DIRECTIVE_ATTRIBUTE_NAME, ST_JSP_DIRECTIVE_EQUALS, ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE,ST_XML_ATTRIBUTE_VALUE_DQUOTED,ST_XML_ATTRIBUTE_VALUE_SQUOTED,ST_DHTML_ATTRIBUTE_NAME,ST_DHTML_EQUALS,ST_DHTML_ATTRIBUTE_VALUE,ST_DHTML_TAG_CLOSE> {S}* {

 	if(Debug.debugTokenizer)

 		dump("white space");//$NON-NLS-1$

         return WHITE_SPACE;

@@ -1359,14 +1389,16 @@
 /* VERY special cases for tags as values */

 /* quoted JSP */

 <ST_XML_ATTRIBUTE_VALUE_DQUOTED> ["] {

-	return XML_TAG_ATTRIBUTE_VALUE_DQUOTE;

+	return isJspTag()? JSP_TAG_ATTRIBUTE_VALUE_DQUOTE : XML_TAG_ATTRIBUTE_VALUE_DQUOTE;

 }

 <ST_XML_ATTRIBUTE_VALUE_SQUOTED> ['] {

-	return XML_TAG_ATTRIBUTE_VALUE_SQUOTE;

+	return isJspTag() ? JSP_TAG_ATTRIBUTE_VALUE_SQUOTE : XML_TAG_ATTRIBUTE_VALUE_SQUOTE;

 }

-<ST_XML_ATTRIBUTE_VALUE> ["] {

+<ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> ["] {

+	String type = yy_lexical_state == ST_XML_ATTRIBUTE_VALUE ? XML_TAG_ATTRIBUTE_VALUE_DQUOTE : JSP_TAG_ATTRIBUTE_VALUE_DQUOTE;

+

 	if (Debug.debugTokenizer) {

-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+		System.out.println("begin embedded region: " + fEmbeddedHint+", "+type);//$NON-NLS-1$

 	}

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 	fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_DQUOTED;

@@ -1374,16 +1406,21 @@
 	fStateStack.push(yystate());

 	if(Debug.debugTokenizer)

 		dump("JSP attribute value start - complex double quoted");//$NON-NLS-1$

-	assembleEmbeddedContainer(XML_TAG_ATTRIBUTE_VALUE_DQUOTE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE);

+	assembleEmbeddedContainer(type, type);

 	fStateStack.pop();

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;

 	fEmbeddedPostState = ST_XML_EQUALS;

 	yybegin(ST_XML_ATTRIBUTE_NAME);

+	if (fEmbeddedContainer.getLastRegion().getType() == UNDEFINED) {

+		fProxyUnknownRegion = fRegionFactory.createToken(XML_TAG_ATTRIBUTE_VALUE, fEmbeddedContainer.getStart(), fEmbeddedContainer.getTextLength(), fEmbeddedContainer.getLength());

+		return PROXY_UNKNOWN_CONTEXT;

+	}

 	return PROXY_CONTEXT;

 }

-<ST_XML_ATTRIBUTE_VALUE> ['] {

+<ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> ['] {

+	String type = yy_lexical_state == ST_XML_ATTRIBUTE_VALUE ? XML_TAG_ATTRIBUTE_VALUE_SQUOTE : JSP_TAG_ATTRIBUTE_VALUE_SQUOTE;

 	if (Debug.debugTokenizer) {

-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+		System.out.println("begin embedded region: " + fEmbeddedHint+", "+type);//$NON-NLS-1$

 	}

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 	fEmbeddedPostState = ST_XML_ATTRIBUTE_VALUE_SQUOTED;

@@ -1391,24 +1428,31 @@
 	fStateStack.push(yystate());

 	if(Debug.debugTokenizer)

 		dump("JSP attribute value start - complex single quoted");//$NON-NLS-1$

-	assembleEmbeddedContainer(XML_TAG_ATTRIBUTE_VALUE_SQUOTE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE);

+	assembleEmbeddedContainer(type, type);

 	fStateStack.pop();

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;

 	fEmbeddedPostState = ST_XML_EQUALS;

         yybegin(ST_XML_ATTRIBUTE_NAME);

+    if (fEmbeddedContainer.getLastRegion().getType() == UNDEFINED) {

+		fProxyUnknownRegion = fRegionFactory.createToken(XML_TAG_ATTRIBUTE_VALUE, fEmbeddedContainer.getStart(), fEmbeddedContainer.getTextLength(), fEmbeddedContainer.getLength());

+		return PROXY_UNKNOWN_CONTEXT;

+	}

 	return PROXY_CONTEXT;

 }

 

-<ST_XML_ATTRIBUTE_VALUE_DQUOTED> ([^<"\x24\x23]|[\x24\x23][^\x7b])+ {

+<ST_XML_ATTRIBUTE_VALUE_DQUOTED> ([^<"\x24\x23]+|[\x24\x23]{S}*)

+{

 	return XML_TAG_ATTRIBUTE_VALUE;

 }

-<ST_XML_ATTRIBUTE_VALUE_SQUOTED> ([^<'\x24\x23]|[\x24\x23][^\x7b])+ {

+<ST_XML_ATTRIBUTE_VALUE_SQUOTED> ([^<'\x24\x23]+|[\x24\x23]{S}*)

+{

 	return XML_TAG_ATTRIBUTE_VALUE;

 }

 

+

 <ST_XML_ATTRIBUTE_VALUE_DQUOTED,ST_XML_ATTRIBUTE_VALUE_SQUOTED> {genericTagOpen} {

 	if (Debug.debugTokenizer) {

-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+		System.out.println("begin embedded region: " + fEmbeddedHint+", genericTagOpen");//$NON-NLS-1$

 	}

 	int incomingState = yystate();

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

@@ -1423,7 +1467,7 @@
 }

 <ST_XML_ATTRIBUTE_VALUE_DQUOTED,ST_XML_ATTRIBUTE_VALUE_SQUOTED> {genericEndTagOpen} {

 	if (Debug.debugTokenizer) {

-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+		System.out.println("begin embedded region: " + fEmbeddedHint+", genericEndTagOpen");//$NON-NLS-1$

 	}

 	int incomingState = yystate();

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

@@ -1440,7 +1484,7 @@
 /* unquoted */

 <ST_XML_ATTRIBUTE_VALUE> {genericTagOpen} {

 	if (Debug.debugTokenizer) {

-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+		System.out.println("begin embedded region: " + fEmbeddedHint+", unquoted genericTagOpen");//$NON-NLS-1$

 	}

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

@@ -1456,7 +1500,7 @@
 	return PROXY_CONTEXT;

 }

 

-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_XML_DECLARATION> {genericEndTagOpen} {

+<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE, ST_XML_DECLARATION> {genericEndTagOpen} {

 	if(Debug.debugTokenizer)

 		dump("\nend tag open");//$NON-NLS-1$

 	fEmbeddedHint = XML_TAG_NAME;

@@ -1485,6 +1529,16 @@
 <ST_XML_TAG_NAME> {Name} {

 	if(Debug.debugTokenizer)

 		dump("tag name");//$NON-NLS-1$

+    String tagname = yytext();

+    boolean jspTag = tagname.indexOf(':') != -1;

+	if (fEmbeddedContainer != null) {

+    	fEmbeddedTag = jspTag;

+		fInTagEmbedded = true;

+    }

+	else {

+		fContainerTag = jspTag;

+		fInTagContainer = true;

+	}

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;

 	fEmbeddedPostState = ST_XML_EQUALS;

         yybegin(ST_XML_ATTRIBUTE_NAME);

@@ -1506,11 +1560,11 @@
 		dump("equals");//$NON-NLS-1$

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

-        yybegin(ST_XML_ATTRIBUTE_VALUE);

+        yybegin(isJspTag() ? ST_JSP_ATTRIBUTE_VALUE : ST_XML_ATTRIBUTE_VALUE);

         return XML_TAG_ATTRIBUTE_EQUALS;

 }

 /* the value was found, look for the next name */

-<ST_XML_ATTRIBUTE_VALUE> {AttValue} {

+<ST_XML_ATTRIBUTE_VALUE> {AttValue} { /* only allow for non-JSP tags for this does not obey JSP quoting rules */

 	if(Debug.debugTokenizer)

 		dump("attr value");//$NON-NLS-1$

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;

@@ -1518,8 +1572,17 @@
         yybegin(ST_XML_ATTRIBUTE_NAME);

         return XML_TAG_ATTRIBUTE_VALUE;

 }

+<ST_JSP_ATTRIBUTE_VALUE> {QuotedAttValue} { /* JSP attribute values have escape semantics */

+	if(Debug.debugTokenizer)

+		dump("jsp attr value");//$NON-NLS-1$

+	fEmbeddedHint = XML_TAG_ATTRIBUTE_NAME;

+	fEmbeddedPostState = ST_XML_EQUALS;

+	yybegin(ST_XML_ATTRIBUTE_NAME);

+	return XML_TAG_ATTRIBUTE_VALUE;

+}

+

 /* the tag's close was found */

-<ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE> {genericTagClose} {

+<ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> {genericTagClose} {

 	if(Debug.debugTokenizer)

 		dump("tag close");//$NON-NLS-1$

 	fEmbeddedHint = UNDEFINED;

@@ -1530,15 +1593,27 @@
 	}

 	else

         	yybegin(YYINITIAL);

-        return XML_TAG_CLOSE;

+

+	if (fEmbeddedContainer != null)

+		fInTagEmbedded = false;

+	else

+		fInTagContainer = false;

+

+	return XML_TAG_CLOSE;

 }

 /* the tag's close was found, but the tag doesn't need a matching end tag */

-<ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE> {genericEmptyTagClose} {

+<ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> {genericEmptyTagClose} {

         yybegin(YYINITIAL);

 	fEmbeddedHint = UNDEFINED;

 	if(Debug.debugTokenizer)

 		dump("empty tag close");//$NON-NLS-1$

-        return XML_EMPTY_TAG_CLOSE;

+

+	if (fEmbeddedContainer != null)

+		fInTagEmbedded = false;

+	else

+		fInTagContainer = false;

+

+	return XML_EMPTY_TAG_CLOSE;

 }

 

 <ST_XML_TAG_NAME> [^</>\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u0131\u0134-\u013E\u0141-\u0148\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0559\u0561-\u0586\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C\u110E-\u1112\u113C\u113E\u1140\u114C\u114E\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173\u1175\u119E\u11A8\u11AB\u11AE-\u11AF\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3\u4E00-\u9FA5\u3007\u3021-\u3029]* {

@@ -1546,8 +1621,8 @@
 		dump("inappropriate tag name");//$NON-NLS-1$

 	if(!fStateStack.empty() && (fStateStack.peek()==ST_XML_ATTRIBUTE_VALUE_SQUOTED||fStateStack.peek()==ST_XML_ATTRIBUTE_VALUE_DQUOTED)) {

 		yybegin(ST_ABORT_EMBEDDED);

-		yypushback(yylength()-1);

-		return XML_TAG_ATTRIBUTE_VALUE;

+		//yypushback(yylength()-1);

+		return UNDEFINED;

 	}

 	yybegin(YYINITIAL);

         return XML_CONTENT;

@@ -1564,7 +1639,7 @@
 	 * If this tag can not be nested or we're already searching for an

 	 * attribute name, equals, or value, return immediately.

 	 */

-	if (!isNestable(tagName) || (!fStateStack.empty() && (fStateStack.peek() == ST_XML_ATTRIBUTE_NAME || fStateStack.peek() == ST_XML_EQUALS || fStateStack.peek() == ST_XML_ATTRIBUTE_VALUE))) {

+	if (!isNestable(tagName) || (!fStateStack.empty() && (fStateStack.peek() == ST_XML_ATTRIBUTE_NAME || fStateStack.peek() == ST_XML_EQUALS || fStateStack.peek() == ST_XML_ATTRIBUTE_VALUE || fStateStack.peek() == ST_JSP_ATTRIBUTE_VALUE))) {

 		yybegin(ST_XML_TAG_NAME);

 		return XML_TAG_OPEN;

 	}

@@ -1580,7 +1655,7 @@
 	yybegin(ST_XML_EQUALS);

 	return PROXY_CONTEXT;

 }

-<ST_XML_ATTRIBUTE_VALUE> <{Name} {

+<ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> <{Name} {

 	String tagName = yytext().substring(1);

 	// pushback to just after the opening bracket

 	yypushback(yylength() - 1);

@@ -1588,7 +1663,7 @@
 	 * If this tag can not be nested or we're already searching for an

 	 * attribute name, equals, or value, return immediately.

 	 */

-	if (!isNestable(tagName) || (!fStateStack.empty() && (fStateStack.peek() == ST_XML_ATTRIBUTE_NAME || fStateStack.peek() == ST_XML_EQUALS || fStateStack.peek() == ST_XML_ATTRIBUTE_VALUE))) {

+	if (!isNestable(tagName) || (!fStateStack.empty() && (fStateStack.peek() == ST_XML_ATTRIBUTE_NAME || fStateStack.peek() == ST_XML_EQUALS || fStateStack.peek() == ST_XML_ATTRIBUTE_VALUE || fStateStack.peek() == ST_JSP_ATTRIBUTE_VALUE))) {

 		yybegin(ST_XML_TAG_NAME);

 		return XML_TAG_OPEN;

 	}

@@ -1608,7 +1683,7 @@
 

 // XML & JSP Comments

 

-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_XML_DECLARATION, ST_JSP_DIRECTIVE_NAME, ST_JSP_DIRECTIVE_NAME_WHITESPACE, ST_JSP_DIRECTIVE_ATTRIBUTE_NAME, ST_JSP_DIRECTIVE_EQUALS, ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE> {CommentStart} {

+<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE, ST_XML_DECLARATION, ST_JSP_DIRECTIVE_NAME, ST_JSP_DIRECTIVE_NAME_WHITESPACE, ST_JSP_DIRECTIVE_ATTRIBUTE_NAME, ST_JSP_DIRECTIVE_EQUALS, ST_JSP_DIRECTIVE_ATTRIBUTE_VALUE> {CommentStart} {

 	if(Debug.debugTokenizer)

 		dump("\ncomment start");//$NON-NLS-1$

 	fEmbeddedHint = XML_COMMENT_TEXT;

@@ -1680,7 +1755,7 @@
 	}

 	else {

 		if (Debug.debugTokenizer) {

-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+			System.out.println("begin embedded region: " + fEmbeddedHint+", jspScriptletStart");//$NON-NLS-1$

 		}

 		if(Debug.debugTokenizer)

 			dump("JSP scriptlet start");//$NON-NLS-1$

@@ -1711,6 +1786,11 @@
 			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

 		}

+        else if(yystate() == ST_JSP_ATTRIBUTE_VALUE) {

+            fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

+            fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

+        }

+		

 		return PROXY_CONTEXT;

 	}

 }

@@ -1749,7 +1829,7 @@
 	}

 	else {

 		if (Debug.debugTokenizer) {

-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+			System.out.println("begin embedded region: " + fEmbeddedHint+", jspExpressionStart");//$NON-NLS-1$

 		}

 		if(Debug.debugTokenizer)

 			dump("JSP expression start");//$NON-NLS-1$

@@ -1780,6 +1860,11 @@
 			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

 		}

+		else if(yystate() == ST_JSP_ATTRIBUTE_VALUE) {

+			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

+			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

+		}

+		

 		return PROXY_CONTEXT;

 	}

 }

@@ -1818,7 +1903,7 @@
 	}

 	else {

 		if (Debug.debugTokenizer) {

-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+			System.out.println("begin embedded region: " + fEmbeddedHint+", jspDeclarationStart");//$NON-NLS-1$

 		}

 		if(Debug.debugTokenizer)

 			dump("JSP declaration start");//$NON-NLS-1$

@@ -1849,6 +1934,10 @@
 			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

 		}

+		else if(yystate() == ST_JSP_ATTRIBUTE_VALUE) {

+			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

+			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

+		}

 		return PROXY_CONTEXT;

 	}

 }

@@ -1893,7 +1982,7 @@
 	}

 	else {

 		if (Debug.debugTokenizer) {

-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+			System.out.println("begin embedded region: " + fEmbeddedHint+", jspCommentStart");//$NON-NLS-1$

 		}

 		if(Debug.debugTokenizer)

 			dump("JSP comment start");//$NON-NLS-1$

@@ -1930,6 +2019,10 @@
 			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

 		}

+		else if(yystate() == ST_JSP_ATTRIBUTE_VALUE) {

+			fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

+			fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

+		}

 		return PROXY_CONTEXT;

 	}

 }

@@ -1977,7 +2070,7 @@
 	}

 	else {

 		if (Debug.debugTokenizer) {

-			System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+			System.out.println("begin embedded region: " + fEmbeddedHint+", jspDirectiveStart");//$NON-NLS-1$

 		}

 		if(Debug.debugTokenizer)

 			dump("JSP declaration start");//$NON-NLS-1$

@@ -2064,9 +2157,9 @@
 <ST_XML_ATTRIBUTE_VALUE_DQUOTED> \x24\x7b {

 	int enterState = yystate();

 	yybegin(ST_JSP_DQUOTED_EL);

-	assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE});

+	assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE, JSP_TAG_ATTRIBUTE_VALUE_DQUOTE});

 	// abort early when an unescaped double quote is found in the EL

-	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE)) {

+	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE) || fEmbeddedContainer.getLastRegion().getType().equals(JSP_TAG_ATTRIBUTE_VALUE_DQUOTE)) {

 		yybegin(ST_ABORT_EMBEDDED);

 		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

 	}

@@ -2078,9 +2171,9 @@
 <ST_XML_ATTRIBUTE_VALUE_DQUOTED> \x23\x7b {

 	int enterState = yystate();

 	yybegin(ST_JSP_DQUOTED_VBL);

-	assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE});

+	assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_DQUOTE, JSP_TAG_ATTRIBUTE_VALUE_DQUOTE});

 	// abort early when an unescaped double quote is found in the VBL

-	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE)) {

+	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_DQUOTE) || fEmbeddedContainer.getLastRegion().getType().equals(JSP_TAG_ATTRIBUTE_VALUE_DQUOTE)) {

 		yybegin(ST_ABORT_EMBEDDED);

 		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

 	}

@@ -2092,9 +2185,9 @@
 <ST_XML_ATTRIBUTE_VALUE_SQUOTED> \x24\x7b {

 	int enterState = yystate();

 	yybegin(ST_JSP_SQUOTED_EL);

-	assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE});

+	assembleEmbeddedContainer(JSP_EL_OPEN, new String[]{JSP_EL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE, JSP_TAG_ATTRIBUTE_VALUE_SQUOTE});

 	// abort early when an unescaped single quote is found in the EL

-	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE)) {

+	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE) || fEmbeddedContainer.getLastRegion().getType().equals(JSP_TAG_ATTRIBUTE_VALUE_SQUOTE)) {

 		yybegin(ST_ABORT_EMBEDDED);

 		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

 	}

@@ -2106,9 +2199,9 @@
 <ST_XML_ATTRIBUTE_VALUE_SQUOTED> \x23\x7b {

 	int enterState = yystate();

 	yybegin(ST_JSP_SQUOTED_VBL);

-	assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE});

+	assembleEmbeddedContainer(JSP_VBL_OPEN, new String[]{JSP_VBL_CLOSE, XML_TAG_ATTRIBUTE_VALUE_SQUOTE, JSP_TAG_ATTRIBUTE_VALUE_SQUOTE});

 	// abort early when an unescaped single quote is found in the VBL

-	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE)) {

+	if(fEmbeddedContainer.getLastRegion().getType().equals(XML_TAG_ATTRIBUTE_VALUE_SQUOTE) || fEmbeddedContainer.getLastRegion().getType().equals(JSP_TAG_ATTRIBUTE_VALUE_SQUOTE)) {

 		yybegin(ST_ABORT_EMBEDDED);

 		fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

 	}

@@ -2120,11 +2213,11 @@
 

 // unescaped double quote, return as ending region

 <ST_JSP_DQUOTED_EL,ST_JSP_DQUOTED_VBL> ["] {

-	return XML_TAG_ATTRIBUTE_VALUE_DQUOTE;

+	return isJspTag() ? JSP_TAG_ATTRIBUTE_VALUE_DQUOTE: XML_TAG_ATTRIBUTE_VALUE_DQUOTE;

 }

 // unescaped single quote, return as ending region

 <ST_JSP_SQUOTED_EL,ST_JSP_SQUOTED_VBL> ['] {

-	return XML_TAG_ATTRIBUTE_VALUE_SQUOTE;

+	return isJspTag() ? JSP_TAG_ATTRIBUTE_VALUE_SQUOTE : XML_TAG_ATTRIBUTE_VALUE_SQUOTE;

 }

 

 

@@ -2236,6 +2329,10 @@
 	yybegin(ST_JSP_EL_DQUOTES);

 	return JSP_EL_DQUOTE;

 }

+<ST_JSP_EL_DQUOTES> \x22 {

+	yybegin(ST_JSP_EL);

+	return JSP_EL_DQUOTE;

+}

 <ST_JSP_EL_DQUOTES> [^\x22]+/\x22 {

 	yybegin(ST_JSP_EL_DQUOTES_END);

 	return JSP_EL_QUOTED_CONTENT;

@@ -2248,6 +2345,10 @@
 	yybegin(ST_JSP_EL_SQUOTES);

 	return JSP_EL_SQUOTE;

 }

+<ST_JSP_EL_SQUOTES> \x27 {

+	yybegin(ST_JSP_EL);

+	return JSP_EL_SQUOTE;

+}

 <ST_JSP_EL_SQUOTES> [^\x27]+/\x27 {

 	yybegin(ST_JSP_EL_SQUOTES_END);

 	return JSP_EL_QUOTED_CONTENT;

@@ -2261,6 +2362,10 @@
 	yybegin(ST_JSP_VBL_DQUOTES);

 	return JSP_VBL_DQUOTE;

 }

+<ST_JSP_VBL_DQUOTES> \x22 {

+	yybegin(ST_JSP_VBL);

+	return JSP_VBL_DQUOTE;

+}

 <ST_JSP_VBL_DQUOTES> [^\x22]+/\x22 {

 	yybegin(ST_JSP_VBL_DQUOTES_END);

 	return JSP_VBL_QUOTED_CONTENT;

@@ -2273,6 +2378,10 @@
 	yybegin(ST_JSP_VBL_SQUOTES);

 	return JSP_VBL_SQUOTE;

 }

+<ST_JSP_VBL_SQUOTES> \x27 {

+	yybegin(ST_JSP_VBL);

+	return JSP_VBL_SQUOTE;

+}

 <ST_JSP_VBL_SQUOTES> [^\x27]+/\x27 {

 	yybegin(ST_JSP_VBL_SQUOTES_END);

 	return JSP_VBL_QUOTED_CONTENT;

@@ -2304,9 +2413,9 @@
 	return JSP_VBL_CONTENT;

 }

 // EL unquoted in tag (section 2.1 declares it as valid in template text (XML_CONTENT) or attribute values

-<ST_XML_ATTRIBUTE_VALUE> \x24\x7b[^\x7d]+/\x7d {

+<ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> \x24\x7b[^\x7d]+/\x7d {

 	if (Debug.debugTokenizer) {

-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+		System.out.println("begin embedded region: " + fEmbeddedHint+", el-unquoted");//$NON-NLS-1$

 	}

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

@@ -2325,9 +2434,9 @@
 	return PROXY_CONTEXT;

 }

 // VBL unquoted in tag or attribute values

-<ST_XML_ATTRIBUTE_VALUE> \x23\x7b[^\x7d]+/\x7d {

+<ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> \x23\x7b[^\x7d]+/\x7d {

 	if (Debug.debugTokenizer) {

-		System.out.println("begin embedded region: " + fEmbeddedHint);//$NON-NLS-1$

+		System.out.println("begin embedded region: " + fEmbeddedHint+", el-unquoted");//$NON-NLS-1$

 	}

 	fEmbeddedHint = XML_TAG_ATTRIBUTE_VALUE;

 	fEmbeddedPostState = ST_XML_ATTRIBUTE_NAME;

@@ -2525,7 +2634,7 @@
 

 // XML declarations

 

-<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE> {genericTagOpen}! {

+<YYINITIAL, ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBUTE_VALUE, ST_JSP_ATTRIBUTE_VALUE> {genericTagOpen}! {

 	fStateStack.push(yystate());

 	if(Debug.debugTokenizer)

 		dump("\ndeclaration start");//$NON-NLS-1$

@@ -2660,7 +2769,7 @@
 }

 // end DECLARATION handling

 

-<YYINITIAL> ([^<&%\x24\x23]*|\x23+|\x24+|[&%]{S}+{Name}[^&%<]*|[\x24\x23][^\x7b<&%]|[&%]{Name}([^;&%<]*|{S}+;*)) {

+<YYINITIAL> ([^<&%\x24\x23]*|\x23+|\x24+|[&%]{S}+{Name}[^&%<]*|[\x24\x23][^\x7b<&%][^<&%\x24\x23]*|\\[\x24\x23][\x7b]|[&%]{Name}([^;&%<]*|{S}+;*)) {

 	if(Debug.debugTokenizer)

 		dump("\nXML content");//$NON-NLS-1$

 	return XML_CONTENT;

diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex
index f4ef7b0..bf2a91e 100644
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex
@@ -1,5 +1,5 @@
 /*******************************************************************************

- * Copyright (c) 2004, 2007 IBM Corporation and others.

+ * Copyright (c) 2004, 2010 IBM Corporation and others.

  * All rights reserved. This program and the accompanying materials

  * are made available under the terms of the Eclipse Public License v1.0

  * which accompanies this distribution, and is available at

@@ -577,7 +577,7 @@
 EntityValue = (\" ([^%&\"] | {PEReference} | {Reference})* \" |  \' ([^%&\'] | {PEReference} | {Reference})* \')

 

 // [10] AttValue ::= '"' ([^<&"] | Reference)* '"' |  "'" ([^<&'] | Reference)* "'"

-AttValue = ( \" ([^<\"] | {Reference})* \" | \' ([^<\'] | {Reference})* \'  | ([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* )

+AttValue = ( \" ([^\"] | {Reference})* \" | \' ([^\'] | {Reference})* \'  | ([^\'\"\040\011\012\015<>/]|\/+[^\'\"\040\011\012\015<>/] )* )

 

 // [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'") 

 SystemLiteral = ((\" [^\"]* \") | (\' [^\']* \')) 

diff --git a/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
index 19cbfd1..8ef9c88 100644
--- a/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.sse.core; singleton:=true
-Bundle-Version: 1.1.300.qualifier
+Bundle-Version: 1.1.502.qualifier
 Bundle-Activator: org.eclipse.wst.sse.core.internal.SSECorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
@@ -37,12 +37,17 @@
  org.eclipse.wst.sse.core.text,
  org.eclipse.wst.sse.core.utils,
  org.eclipse.wst.sse.internal.contentproperties;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.sse.ui,org.eclipse.wst.xml.core,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui"
-Require-Bundle: org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.text;visibility:=reexport;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.filebuffers;bundle-version="[3.4.0,4.0.0)",
+Import-Package: com.ibm.icu.util; version="3.8",
+ com.ibm.icu.text; version="3.8"
+Require-Bundle: org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.text;bundle-version="[3.5.0,4.0.0)";visibility:=reexport,
+ org.eclipse.core.jobs;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.filebuffers;bundle-version="[3.5.0,4.0.0)",
  org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
  org.eclipse.emf.common;bundle-version="[2.4.0,3.0.0)",
- com.ibm.icu;bundle-version="[3.8.1,4.0.0)"
-Bundle-ActivationPolicy: lazy
+ org.eclipse.wst.validation;bundle-version="[1.2.100,2.0.0)";resolution:=optional,
+ org.eclipse.core.expressions;bundle-version="[3.4.100,4.0.0)",
+ org.eclipse.osgi.services;bundle-version="3.2.0"
+Bundle-ActivationPolicy: lazy;exclude:="org.eclipse.wst.sse.core.internal.propertytester"
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.sse.core/about.html b/bundles/org.eclipse.wst.sse.core/about.html
index 73db36e..2199df3 100644
--- a/bundles/org.eclipse.wst.sse.core/about.html
+++ b/bundles/org.eclipse.wst.sse.core/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/bundles/org.eclipse.wst.sse.core/config/charset.properties b/bundles/org.eclipse.wst.sse.core/config/charset.properties
index 004a070..8815e5a 100644
--- a/bundles/org.eclipse.wst.sse.core/config/charset.properties
+++ b/bundles/org.eclipse.wst.sse.core/config/charset.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2006 IBM Corporation and others.
+# Copyright (c) 2001, 2009 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -9,7 +9,7 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 ! the number of codeset names
-totalnumber=25
+totalnumber=26
 
 ! Only translate the xx.label strings.  Do not translate the xx.iana or xx.java strings.
 
@@ -31,66 +31,69 @@
 codeset.5.label=ISO Latin-1
 codeset.5.iana=ISO-8859-1
 
+codeset.6.label=ISO Latin-9
+codeset.6.iana=ISO-8859-15
+
 ! (Slavic: Czech, Croat, German, Hungarian, Polish, Romanian, Slovak, Slovenian)
-codeset.6.label=Central/East European (Slavic) 
-codeset.6.iana=ISO-8859-2
+codeset.7.label=Central/East European (Slavic) 
+codeset.7.iana=ISO-8859-2
 
 ! (Esperanto, Galician, Maltese, Turkish)
-codeset.7.label=Southern European
-codeset.7.iana=ISO-8859-3
+codeset.8.label=Southern European
+codeset.8.iana=ISO-8859-3
 
-codeset.8.label=Arabic, Logical
-codeset.8.iana=ISO-8859-6
+codeset.9.label=Arabic, Logical
+codeset.9.iana=ISO-8859-6
 
-codeset.9.label=Arabic
-codeset.9.iana=windows-1256
+codeset.10.label=Arabic
+codeset.10.iana=windows-1256
 
-codeset.10.label=Chinese, National Standard
-codeset.10.iana=GB18030
+codeset.11.label=Chinese, National Standard
+codeset.11.iana=GB18030
 
-codeset.11.label=Traditional Chinese, Big5
-codeset.11.iana=BIG5
+codeset.12.label=Traditional Chinese, Big5
+codeset.12.iana=BIG5
 
 ! (Estonian, Latvian, Lithuanian)
-codeset.12.label=Cyrillic, ISO-8859-4
-codeset.12.iana=ISO-8859-4
+codeset.13.label=Cyrillic, ISO-8859-4
+codeset.13.iana=ISO-8859-4
 
 ! (Bulgarian, Byelorussian, Macedonian, Serbian, Ukrainian)
-codeset.13.label=Cyrillic, ISO-8859-5
-codeset.13.iana=ISO-8859-5
+codeset.14.label=Cyrillic, ISO-8859-5
+codeset.14.iana=ISO-8859-5
 
-codeset.14.label=Greek
-codeset.14.iana=ISO-8859-7
+codeset.15.label=Greek
+codeset.15.iana=ISO-8859-7
 
-codeset.15.label=Hebrew, Visual
-codeset.15.iana=ISO-8859-8
+codeset.16.label=Hebrew, Visual
+codeset.16.iana=ISO-8859-8
 
 ! label=Hebrew, Logical
 ! iana=ISO-8859-8-I
 
-codeset.16.label=Hebrew
-codeset.16.iana=windows-1255
+codeset.17.label=Hebrew
+codeset.17.iana=windows-1255
 
-codeset.17.label=Japanese, EUC-JP
-codeset.17.iana=EUC-JP
+codeset.18.label=Japanese, EUC-JP
+codeset.18.iana=EUC-JP
 
-codeset.18.label=Japanese, ISO 2022
-codeset.18.iana=ISO-2022-JP
+codeset.19.label=Japanese, ISO 2022
+codeset.19.iana=ISO-2022-JP
 
-codeset.19.label=Japanese, Shift-JIS
-codeset.19.iana=Shift_JIS
+codeset.20.label=Japanese, Shift-JIS
+codeset.20.iana=Shift_JIS
 
-codeset.20.label=Japanese, Windows-31J
-codeset.20.iana=windows-31j
+codeset.21.label=Japanese, Windows-31J
+codeset.21.iana=windows-31j
 
-codeset.21.label=Korean, EUC-KR
-codeset.21.iana=EUC-KR
+codeset.22.label=Korean, EUC-KR
+codeset.22.iana=EUC-KR
 
-codeset.22.label=Korean, ISO 2022
-codeset.22.iana=ISO-2022-KR
+codeset.23.label=Korean, ISO 2022
+codeset.23.iana=ISO-2022-KR
 
-codeset.23.label=Thai, TISI
-codeset.23.iana=TIS-620
+codeset.24.label=Thai, TISI
+codeset.24.iana=TIS-620
 
-codeset.24.label=Turkish
-codeset.24.iana=ISO-8859-9
+codeset.25.label=Turkish
+codeset.25.iana=ISO-8859-9
diff --git a/bundles/org.eclipse.wst.sse.core/plugin.properties b/bundles/org.eclipse.wst.sse.core/plugin.properties
index 651ffcc..1e23274 100644
--- a/bundles/org.eclipse.wst.sse.core/plugin.properties
+++ b/bundles/org.eclipse.wst.sse.core/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2008 IBM Corporation and others.
+# Copyright (c) 2001, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -10,8 +10,8 @@
 #     Jens Lukowski/Innoopract - initial renaming/restructuring
 #     
 ###############################################################################
-providerName=Eclipse.org
-pluginName=Structured Text Model
+providerName=Eclipse Web Tools Platform
+pluginName=Structured Source Model
 # extension names
 Adapt_On_Create_Factory_Extension.name=Adapt On Create Factory Extension
 Document_Types_Extension.name=Document Types Extension
diff --git a/bundles/org.eclipse.wst.sse.core/plugin.xml b/bundles/org.eclipse.wst.sse.core/plugin.xml
index b5874b9..1b9d769 100644
--- a/bundles/org.eclipse.wst.sse.core/plugin.xml
+++ b/bundles/org.eclipse.wst.sse.core/plugin.xml
@@ -38,4 +38,22 @@
 			class="org.eclipse.wst.sse.core.internal.preferences.PreferenceInitializer" />
 	</extension>
 
+	<extension point="org.eclipse.wst.validation.validatorGroup">
+		<group id="structuredModelGroup">
+			<listener class="org.eclipse.wst.sse.core.internal.validate.ValidatorGroupListener"/>
+		</group>
+	</extension>
+	
+	<!-- Define the StructuredFilePropertyTester as it will handle tracing the entire -->
+	<!-- content type hierarchy for a file. Only operates on IFiles                   -->
+	<!-- Deprecated, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=288216         -->
+	<extension point="org.eclipse.core.expressions.propertyTesters">
+		<propertyTester
+			class="org.eclipse.wst.sse.core.internal.propertytester.StructuredFilePropertyTester"
+			id="org.eclipse.wst.sse.core.expressions.propertyTester.StructuredFilePropertyTester"
+			namespace="org.eclipse.wst.sse.core.resources"
+			properties="contentTypeId"
+			type="org.eclipse.core.resources.IFile">
+    </propertyTester>
+ </extension>
 </plugin>
diff --git a/bundles/org.eclipse.wst.sse.core/schema/commentElementHandler.exsd b/bundles/org.eclipse.wst.sse.core/schema/commentElementHandler.exsd
index 1441736..633c80c 100644
--- a/bundles/org.eclipse.wst.sse.core/schema/commentElementHandler.exsd
+++ b/bundles/org.eclipse.wst.sse.core/schema/commentElementHandler.exsd
@@ -1,16 +1,21 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
+<schema targetNamespace="org.eclipse.wst.sse.core" xmlns="http://www.w3.org/2001/XMLSchema">
 <annotation>
-      <appInfo>
+      <appinfo>
          <meta.schema plugin="org.eclipse.wst.sse.core" id="commentElementHandler" name="Comment Element Handler Extension Point"/>
-      </appInfo>
+      </appinfo>
       <documentation>
          &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
       </documentation>
    </annotation>
 
    <element name="extension">
+      <annotation>
+         <appinfo>
+            <meta.element />
+         </appinfo>
+      </annotation>
       <complexType>
          <sequence>
             <element ref="handler-custom"/>
@@ -34,9 +39,9 @@
                <documentation>
                   
                </documentation>
-               <appInfo>
+               <appinfo>
                   <meta.attribute translatable="true"/>
-               </appInfo>
+               </appinfo>
             </annotation>
          </attribute>
       </complexType>
@@ -59,9 +64,9 @@
                <documentation>
                   
                </documentation>
-               <appInfo>
-                  <meta.attribute kind="java"/>
-               </appInfo>
+               <appinfo>
+                  <meta.attribute kind="java" basedOn=":org.eclipse.wst.xml.core.internal.commentelement.CommentElementHandler"/>
+               </appinfo>
             </annotation>
          </attribute>
       </complexType>
@@ -80,47 +85,23 @@
    </element>
 
    <annotation>
-      <appInfo>
+      <appinfo>
          <meta.section type="since"/>
-      </appInfo>
+      </appinfo>
       <documentation>
          &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
       </documentation>
    </annotation>
 
-   <annotation>
-      <appInfo>
-         <meta.section type="examples"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
+
+
 
    <annotation>
-      <appInfo>
-         <meta.section type="apiInfo"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="implementation"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
+      <appinfo>
          <meta.section type="copyright"/>
-      </appInfo>
+      </appinfo>
       <documentation>
-         Copyright (c) 2005 IBM Corporation and others.&lt;br&gt;
+         Copyright (c) 2005, 2008 IBM Corporation and others.&lt;br&gt;
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 which accompanies 
 this distribution, and is available at &lt;a
diff --git a/bundles/org.eclipse.wst.sse.core/schema/modelHandler.exsd b/bundles/org.eclipse.wst.sse.core/schema/modelHandler.exsd
index 1c375bb..ea31dfa 100644
--- a/bundles/org.eclipse.wst.sse.core/schema/modelHandler.exsd
+++ b/bundles/org.eclipse.wst.sse.core/schema/modelHandler.exsd
@@ -1,6 +1,6 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
+<schema targetNamespace="org.eclipse.wst.sse.core" xmlns="http://www.w3.org/2001/XMLSchema">
 <annotation>
       <appInfo>
          <meta.schema plugin="org.eclipse.wst.sse.core" id="modelHandler" name="Model Handler Extension Point"/>
@@ -11,6 +11,11 @@
    </annotation>
 
    <element name="extension">
+      <annotation>
+         <appInfo>
+            <meta.element />
+         </appInfo>
+      </annotation>
       <complexType>
          <sequence minOccurs="0" maxOccurs="unbounded">
             <element ref="modelHandler"/>
@@ -49,6 +54,9 @@
                <documentation>
                   
                </documentation>
+               <appInfo>
+                  <meta.attribute kind="identifier"/>
+               </appInfo>
             </annotation>
          </attribute>
          <attribute name="class" type="string" use="required">
@@ -57,7 +65,7 @@
                   
                </documentation>
                <appInfo>
-                  <meta.attribute kind="java"/>
+                  <meta.attribute kind="java" basedOn="org.eclipse.wst.sse.core.internal.ltk.modelhandler.AbstractModelHandler:"/>
                </appInfo>
             </annotation>
          </attribute>
@@ -87,39 +95,15 @@
       </documentation>
    </annotation>
 
-   <annotation>
-      <appInfo>
-         <meta.section type="examples"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
 
-   <annotation>
-      <appInfo>
-         <meta.section type="apiInfo"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
 
-   <annotation>
-      <appInfo>
-         <meta.section type="implementation"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
 
    <annotation>
       <appInfo>
          <meta.section type="copyright"/>
       </appInfo>
       <documentation>
-         Copyright (c) 2005 IBM Corporation and others.&lt;br&gt;
+         Copyright (c) 2005, 2009 IBM Corporation and others.&lt;br&gt;
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 which accompanies 
 this distribution, and is available at &lt;a
diff --git a/bundles/org.eclipse.wst.sse.core/schema/taskscanner.exsd b/bundles/org.eclipse.wst.sse.core/schema/taskscanner.exsd
index 46c03fb..1f80a82 100644
--- a/bundles/org.eclipse.wst.sse.core/schema/taskscanner.exsd
+++ b/bundles/org.eclipse.wst.sse.core/schema/taskscanner.exsd
@@ -1,6 +1,6 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.core">
+<schema targetNamespace="org.eclipse.wst.sse.core" xmlns="http://www.w3.org/2001/XMLSchema">
 <annotation>
       <appInfo>
          <meta.schema plugin="org.eclipse.wst.sse.core" id="taskscanner" name="Task Scanner Extension Point"/>
@@ -11,6 +11,11 @@
    </annotation>
 
    <element name="extension">
+      <annotation>
+         <appInfo>
+            <meta.element internal="true" />
+         </appInfo>
+      </annotation>
       <complexType>
          <sequence>
             <element ref="scanner"/>
@@ -47,17 +52,17 @@
          <attribute name="contentTypeIds" type="string" use="required">
             <annotation>
                <documentation>
-                  
+                  Content type identifiers for which this scanner applies, separated by commas.
                </documentation>
             </annotation>
          </attribute>
          <attribute name="class" type="string" use="required">
             <annotation>
                <documentation>
-                  
+                  Scanner implementation.
                </documentation>
                <appInfo>
-                  <meta.attribute kind="java"/>
+                  <meta.attribute kind="java" basedOn=":org.eclipse.wst.sse.core.internal.provisional.tasks.IFileTaskScanner"/>
                </appInfo>
             </annotation>
          </attribute>
@@ -80,32 +85,8 @@
       </documentation>
    </annotation>
 
-   <annotation>
-      <appInfo>
-         <meta.section type="examples"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
 
-   <annotation>
-      <appInfo>
-         <meta.section type="apiInfo"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
 
-   <annotation>
-      <appInfo>
-         <meta.section type="implementation"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
 
    <annotation>
       <appInfo>
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettings.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettings.java
index 0c797e3..8dca387 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettings.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettings.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     David Carver (Intalio) - bug 300443 - some constants aren't static final
  *     
  *******************************************************************************/
 package org.eclipse.wst.sse.internal.contentproperties;
@@ -58,13 +59,13 @@
 
 	private String contentSettingsPath;
 	private IProject currProject;
-	private final String fileElementName = "file";//$NON-NLS-1$
-	private final String PATHATTR = "path"; //$NON-NLS-1$
-	private final String projectElementName = "project";//$NON-NLS-1$
+	private static final String fileElementName = "file";//$NON-NLS-1$
+	private static final String PATHATTR = "path"; //$NON-NLS-1$
+	private static final String projectElementName = "project";//$NON-NLS-1$
 
 
 
-	private final String rootElementName = "contentsettings";//$NON-NLS-1$
+	private static final String rootElementName = "contentsettings";//$NON-NLS-1$
 
 
 
@@ -122,10 +123,10 @@
 
 		Element e = null;
 		if (resource.getType() == IResource.PROJECT) {
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
+			e = (Element) domOperator.getElementWithNodeName(projectElementName);
 			if (e == null) {
 				// create project Element and add it into tree
-				e = (Element) domOperator.addElementUnderRoot(this.projectElementName);
+				e = (Element) domOperator.addElementUnderRoot(projectElementName);
 			}
 		}
 		else if (resource.getType() == IResource.FILE) {
@@ -133,7 +134,7 @@
 			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
 			if (e == null) {
 				// create file Element and add path into it.
-				e = (Element) domOperator.addElementUnderRoot(this.fileElementName);
+				e = (Element) domOperator.addElementUnderRoot(fileElementName);
 				domOperator.addAttributeAt(e, getPathAttr(), getRelativePathFromProject(resource));
 			}
 		}
@@ -222,10 +223,10 @@
 
 		Element e = null;
 		if (resource.getType() == IResource.PROJECT) {
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
+			e = (Element) domOperator.getElementWithNodeName(projectElementName);
 			if (e == null) {
 				// create project Element and add it into tree
-				e = (Element) domOperator.addElementUnderRoot(this.projectElementName);
+				e = (Element) domOperator.addElementUnderRoot(projectElementName);
 			}
 		}
 		else if (resource.getType() == IResource.FILE) {
@@ -233,7 +234,7 @@
 			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
 			if (e == null) {
 				// create file Element and add path into it.
-				e = (Element) domOperator.addElementUnderRoot(this.fileElementName);
+				e = (Element) domOperator.addElementUnderRoot(fileElementName);
 				domOperator.addAttributeAt(e, getPathAttr(), getRelativePathFromProject(resource));
 			}
 		}
@@ -330,7 +331,7 @@
 		Element e = null;
 		if (deletedFile.getType() == IResource.PROJECT)
 			// select project element and get attribute
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
+			e = (Element) domOperator.getElementWithNodeName(projectElementName);
 		else if (deletedFile.getType() == IResource.FILE)
 			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(deletedFile));
 		if (e == null) {
@@ -341,7 +342,7 @@
 
 		// when deletedFile entry exists.
 		if (deletedFile.getType() == IResource.PROJECT)
-			domOperator.removeElementWith(this.projectElementName);
+			domOperator.removeElementWith(projectElementName);
 		else if (deletedFile.getType() == IResource.FILE)
 			domOperator.removeElementWith(getPathAttr(), getRelativePathFromProject(deletedFile));
 
@@ -397,7 +398,7 @@
 		Element e = null;
 		if (resource.getType() == IResource.PROJECT)
 			// select project element and get attribute
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
+			e = (Element) domOperator.getElementWithNodeName(projectElementName);
 		else if (resource.getType() == IResource.FILE)
 			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
 
@@ -458,7 +459,7 @@
 		Element e = null;
 		if (resource.getType() == IResource.PROJECT)
 			// select project element and get attribute
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
+			e = (Element) domOperator.getElementWithNodeName(projectElementName);
 		else if (resource.getType() == IResource.FILE)
 			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
 
@@ -542,7 +543,7 @@
 		Element e = null;
 		if (resource.getType() == IResource.PROJECT)
 			// select project element and get attribute
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
+			e = (Element) domOperator.getElementWithNodeName(projectElementName);
 		else if (resource.getType() == IResource.FILE)
 			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
 
@@ -607,7 +608,7 @@
 		Element e = null;
 		if (resource.getType() == IResource.PROJECT)
 			// select project element and get attribute
-			e = (Element) domOperator.getElementWithNodeName(this.projectElementName);
+			e = (Element) domOperator.getElementWithNodeName(projectElementName);
 		else if (resource.getType() == IResource.FILE)
 			e = (Element) domOperator.getElementWithAttribute(getPathAttr(), getRelativePathFromProject(resource));
 
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSynchronizer.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSynchronizer.java
index 0dc38b1..e698b65 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSynchronizer.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSynchronizer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (Intalio) - bug 300434 - Make inner classes static where possible
  *******************************************************************************/
 package org.eclipse.wst.sse.internal.contentproperties;
 
@@ -28,7 +28,7 @@
  *             org.eclipse.html.core.internal.contentproperties.HTMLContentProperties
  */
 public class ContentSettingsSynchronizer implements IResourceChangeListener {
-	class ContentSettingsVisitor implements IResourceDeltaVisitor {
+	static class ContentSettingsVisitor implements IResourceDeltaVisitor {
 		// redefinition in ContentSettings.java
 		private String contentSettingsName = ContentSettings.getContentSettingsName(); //$NON-NLS-1$
 		private IResourceChangeEvent fEvent;
diff --git a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/SimpleNodeOperator.java b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/SimpleNodeOperator.java
index 16da926..ace7a38 100644
--- a/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/SimpleNodeOperator.java
+++ b/bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/SimpleNodeOperator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (Intalio) - bug 300434 - Make inner classes static where possible
  *******************************************************************************/
 package org.eclipse.wst.sse.internal.contentproperties;
 
@@ -51,7 +51,7 @@
 */
 class SimpleNodeOperator {
 
-	class CreateContentSettingsFailureException extends Exception {
+	static class CreateContentSettingsFailureException extends Exception {
 		/**
 		 * Comment for <code>serialVersionUID</code>
 		 */
@@ -63,7 +63,7 @@
 	}
 
 
-	class ReadContentSettingsFailureException extends Exception {
+	static class ReadContentSettingsFailureException extends Exception {
 		/**
 		 * Comment for <code>serialVersionUID</code>
 		 */
@@ -86,7 +86,7 @@
 	}
 
 	// writer class for .contentSettings.
-	class XMLDocumentWriter {
+	static class XMLDocumentWriter {
 		OutputStream fOut;
 
 		protected XMLDocumentWriter(OutputStream out) {
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedIO.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedIO.java
index ddc8d1d..1f31829 100644
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedIO.java
+++ b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedIO.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -116,6 +116,7 @@
 				result.setUnicodeStream(true);
 			else if (detectedBom.length == 3)
 				result.setUTF83ByteBOMUsed(true);
+			result.setUnicodeBOM(detectedBom);
 		}
 		return result;
 	}
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedReaderCreator.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedReaderCreator.java
index 53f2998..155ccdb 100644
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedReaderCreator.java
+++ b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedReaderCreator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -64,6 +64,10 @@
 
 
 	private InputStream fInputStream;
+	
+	private static final String CHARSET_UTF_16= "UTF-16"; //$NON-NLS-1$
+	
+	private static final String CHARSET_UTF_16LE= "UTF-16LE"; //$NON-NLS-1$
 
 	public CodedReaderCreator() {
 
@@ -292,6 +296,11 @@
 		if (fEncodingRule == EncodingRule.FORCE_DEFAULT) {
 			charsetName = encodingMemento.getAppropriateDefault();
 		}
+		
+		// [228366] For files that have a unicode BOM, and a charset name of UTF-16, the charset decoder needs "UTF-16LE"
+		if(CHARSET_UTF_16.equals(charsetName) && encodingMemento.getUnicodeBOM() == IContentDescription.BOM_UTF_16LE)
+			charsetName = CHARSET_UTF_16LE;
+		
 		Charset charset = Charset.forName(charsetName);
 		CharsetDecoder charsetDecoder = charset.newDecoder();
 		if (fEncodingRule == EncodingRule.IGNORE_CONVERSION_ERROR) {
diff --git a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/EncodingMemento.java b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/EncodingMemento.java
index 28857a3..c195a84 100644
--- a/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/EncodingMemento.java
+++ b/bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/EncodingMemento.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -73,6 +73,8 @@
 	private String fJavaCharsetName;
 	private boolean fUnicodeStream;
 	private boolean fUTF83ByteBOMUsed;
+	
+	private byte[] fBOM;
 
 	public EncodingMemento() {
 		super();
@@ -157,15 +159,8 @@
 		byte[] bom = null;
 		if (isUTF83ByteBOMUsed())
 			bom = IContentDescription.BOM_UTF_8;
-		else if (isUnicodeStream()) {
-			if (getJavaCharsetName().equals("UTF-16") || getJavaCharsetName().equals("UTF-16LE")) { //$NON-NLS-1$ //$NON-NLS-2$
-				bom = IContentDescription.BOM_UTF_16LE;
-			}
-			else if (getJavaCharsetName().equals("UTF-16BE")) { //$NON-NLS-1$
-				bom = IContentDescription.BOM_UTF_16BE;
-			}
-
-		}
+		else if (isUnicodeStream())
+			bom = fBOM;
 		return bom;
 	}
 
@@ -246,4 +241,7 @@
 		fUTF83ByteBOMUsed = uTF83ByteBOMUsed;
 	}
 
+	public void setUnicodeBOM(byte[] bom) {
+		fBOM = bom;
+	}
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/FileTaskScannerRegistryReader.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/FileTaskScannerRegistryReader.java
index d191e71..34b9c07 100644
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/FileTaskScannerRegistryReader.java
+++ b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/FileTaskScannerRegistryReader.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (Intalio) - bug 300434 - Make inner classes static where possibl *     
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.tasks;
 
@@ -29,7 +29,7 @@
 import org.eclipse.wst.sse.core.utils.StringUtils;
 
 public class FileTaskScannerRegistryReader {
-	private class ScannerInfo {
+	private static class ScannerInfo {
 		String fId;
 		IFileTaskScanner fScanner;
 
@@ -43,10 +43,6 @@
 			return obj instanceof ScannerInfo && fId.equals(((ScannerInfo) obj).fId);
 		}
 
-		public String getId() {
-			return fId;
-		}
-
 		public IFileTaskScanner getScanner() {
 			return fScanner;
 		}
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningJob.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningJob.java
index 1183beb..92fda63 100644
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningJob.java
+++ b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningJob.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     David Carver (Intalio) - bug 300443 - some constants aren't static final
  *     
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.tasks;
@@ -40,13 +41,13 @@
  * Queueing Job for processing deltas and projects.
  */
 class TaskScanningJob extends Job {
-	static final int JOB_DELAY_DELTA = 400;
-	private static final int JOB_DELAY_PROJECT = 2000;
+	static final int JOB_DELAY_DELTA = 1000;
+	private static final int JOB_DELAY_PROJECT = 5000;
 	static final String TASK_TAG_PROJECTS_ALREADY_SCANNED = "task-tag-projects-already-scanned"; //$NON-NLS-1$
 	private List fQueue = null;
 
 	/** symbolic name for OSGI framework */
-	private final String OSGI_FRAMEWORK_ID = "org.eclipse.osgi"; //$NON-NLS-1$
+	private static final String OSGI_FRAMEWORK_ID = "org.eclipse.osgi"; //$NON-NLS-1$
 
 	TaskScanningJob() {
 		super(SSECoreMessages.TaskScanner_0);
@@ -153,6 +154,14 @@
 
 		IStatus status = null;
 		List currentQueue = retrieveQueue();
+		
+		try {
+			Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
+		}
+		catch (SecurityException e) {
+			// not a critical problem
+		}
+		
 		List errors = null;
 		int ticks = currentQueue.size();
 		String taskName = null;
@@ -167,7 +176,7 @@
 		IProgressMonitor scanMonitor = null;
 		while (!currentQueue.isEmpty()) {
 			Object o = currentQueue.remove(0);
-			if (frameworkIsShuttingDown())
+			if (frameworkIsShuttingDown() || monitor.isCanceled())
 				return Status.CANCEL_STATUS;
 			try {
 				scanMonitor = new SubProgressMonitor(monitor, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningScheduler.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningScheduler.java
index 1ae5680..6095a6d 100644
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningScheduler.java
+++ b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningScheduler.java
@@ -28,7 +28,7 @@
 import org.eclipse.wst.sse.core.utils.StringUtils;
 
 public class TaskScanningScheduler {
-	private class ListenerVisitor implements IResourceChangeListener, IResourceDeltaVisitor {
+	class ListenerVisitor implements IResourceChangeListener, IResourceDeltaVisitor {
 		public void resourceChanged(IResourceChangeEvent event) {
 			IResourceDelta delta = event.getDelta();
 			if (delta.getResource() != null) {
@@ -89,13 +89,19 @@
 	 */
 	public static void shutdown() {
 		if (scheduler != null) {
-			scheduler.fJob.cancel();
 			ResourcesPlugin.getWorkspace().removeResourceChangeListener(scheduler.visitor);
+			scheduler.fJob.cancel();
+			try {
+				scheduler.fJob.join();
+			}
+			catch (InterruptedException e) {
+				Logger.logException(e);
+			}
 		}
 	}
 
 	/**
-	 * Only for use by SSECorePlugin class
+	 * Only for use by SSEUIPlugin class, UI by nature of its output being meant for the user
 	 */
 	public static void startup() {
 		scheduler = new TaskScanningScheduler();
diff --git a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/WorkspaceTaskScanner.java b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/WorkspaceTaskScanner.java
index ad34bad..a47d297 100644
--- a/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/WorkspaceTaskScanner.java
+++ b/bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/WorkspaceTaskScanner.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     David Carver (Intalio) - bug 300443 - some constants aren't static final
  *     
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.tasks;
@@ -52,6 +53,7 @@
 	private static WorkspaceTaskScanner _instance = null;
 	static final String SYNTHETIC_TASK = "org.eclipse.wst.sse.task-synthetic";
 	static final String MODIFICATION_STAMP = "org.eclipse.wst.sse.modification-stamp";
+	private boolean proceed = false;
 
 	static synchronized WorkspaceTaskScanner getInstance() {
 		if (_instance == null) {
@@ -60,7 +62,7 @@
 		return _instance;
 	}
 
-	final String DEFAULT_MARKER_TYPE = IFileTaskScanner.TASK_MARKER_ID;
+	static final String DEFAULT_MARKER_TYPE = IFileTaskScanner.TASK_MARKER_ID;
 	private List fActiveScanners = null;
 	private IContentType[] fCurrentIgnoreContentTypes = null;
 	private TaskTag[] fCurrentTaskTags = null;
@@ -282,7 +284,7 @@
 						finally {
 							progressMonitor.worked(1);
 						}
-						if (markerAttributeMaps != null && markerAttributeMaps.length > 0) {
+						if (proceed && markerAttributeMaps != null && markerAttributeMaps.length > 0) {
 							if (Logger.DEBUG_TASKS) {
 								System.out.println("" + markerAttributeMaps.length + " tasks for " + file.getFullPath()); //$NON-NLS-1$ //$NON-NLS-2$
 							}
@@ -331,10 +333,10 @@
 		if (Logger.DEBUG_TASKSOVERALLPERF) {
 			time0 = System.currentTimeMillis();
 		}
-		if (init(project)) {
-			internalScan(project, project, scanMonitor);
-			shutdownDelegates(project);
-		}
+		proceed = init(project);
+		internalScan(project, project, scanMonitor);
+		shutdownDelegates(project);
+		
 		if (Logger.DEBUG_TASKSOVERALLPERF) {
 			System.out.println("" + (System.currentTimeMillis() - time0) + "ms for " + project.getFullPath()); //$NON-NLS-1$ //$NON-NLS-2$
 		}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/StructuredModelManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/StructuredModelManager.java
index 346f987..76e8d31 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/StructuredModelManager.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/StructuredModelManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,7 +18,7 @@
 import org.osgi.framework.Bundle;
 
 /**
- * Class to allow access to ModelManager. Not intended to be subclassed.
+ * Class to allow access to properly configured implementors of IModelManager.
  * 
  * @since  1.5  org.eclipse.wst.sse.core
  */
@@ -36,7 +36,8 @@
 	 * shutting down).
 	 * 
 	 * @return IModelManager - returns the one model manager for structured
-	 *         model
+	 *         models or null if the owning bundle is neither active nor
+	 *         starting.
 	 */
 	public static IModelManager getModelManager() {
 		boolean isReady = false;
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/FileBufferModelManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/FileBufferModelManager.java
index 0de5ec0..734c86a 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/FileBufferModelManager.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/FileBufferModelManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (Intalio) - bug 300434 - Make inner classes static where possible
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal;
 
@@ -102,7 +102,7 @@
 	/**
 	 * A URIResolver instance of models built on java.io.Files
 	 */
-	class ExternalURIResolver implements URIResolver {
+	static class ExternalURIResolver implements URIResolver {
 		IPath fLocation;
 
 		ExternalURIResolver(IPath location) {
@@ -164,7 +164,7 @@
 	 * A URIResolver instance of models built on the extensible WST URI
 	 * resolver
 	 */
-	class CommonURIResolver implements URIResolver {
+	static class CommonURIResolver implements URIResolver {
 		String fLocation;
 		IPath fPath;
 		private IProject fProject;
@@ -243,7 +243,8 @@
 
 	/**
 	 * Maps interesting documents in file buffers to those file buffers.
-	 * Required to allows us to go from documents to complete models.
+	 * Required to allow us to go from the document instances to complete
+	 * models.
 	 */
 	class FileBufferMapper implements IFileBufferListener {
 		public void bufferContentAboutToBeReplaced(IFileBuffer buffer) {
@@ -257,6 +258,7 @@
 				ITextFileBuffer textBuffer = (ITextFileBuffer) buffer;
 				if (!(textBuffer.getDocument() instanceof IStructuredDocument))
 					return;
+
 				if (Logger.DEBUG_TEXTBUFFERLIFECYCLE) {
 					Logger.log(Logger.INFO, "Learned new buffer: " + buffer.getLocation().toString() + " " + buffer + " " + ((ITextFileBuffer) buffer).getDocument()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 				}
@@ -279,8 +281,7 @@
 				DocumentInfo info = (DocumentInfo) fDocumentMap.get(textBuffer.getDocument());
 				if (info != null) {
 					info.bufferReferenceCount--;
-					if (info.bufferReferenceCount == 0 && info.modelReferenceCount == 0)
-						fDocumentMap.remove(textBuffer.getDocument());
+					checkReferenceCounts(info, textBuffer.getDocument());
 				}
 			}
 		}
@@ -336,45 +337,39 @@
 		}
 	}
 
-	private static FileBufferModelManager instance;
+	private static FileBufferModelManager instance = new FileBufferModelManager();
 
 	public static FileBufferModelManager getInstance() {
-		if (instance == null) {
-			instance = new FileBufferModelManager();
-		}
 		return instance;
 	}
 
-	static final void shutdown() {
-		if (instance != null) {
-			if (Logger.DEBUG_FILEBUFFERMODELMANAGEMENT) {
-				IDocument[] danglingDocuments = (IDocument[]) instance.fDocumentMap.keySet().toArray(new IDocument[0]);
-				for (int i = 0; i < danglingDocuments.length; i++) {
-					DocumentInfo info = (DocumentInfo) instance.fDocumentMap.get(danglingDocuments[i]);
-					if (info.modelReferenceCount > 0)
-						System.err.println("LEAKED MODEL: " + info.buffer.getLocation() + " " + (info.model != null ? info.model.getId() : null)); //$NON-NLS-1$ //$NON-NLS-2$
-					if (info.bufferReferenceCount > 0)
-						System.err.println("LEAKED BUFFER: " + info.buffer.getLocation() + " " + info.buffer.getDocument()); //$NON-NLS-1$ //$NON-NLS-2$
-				}
+	static synchronized final void shutdown() {
+		FileBuffers.getTextFileBufferManager().removeFileBufferListener(instance.fFileBufferListener);
+
+		if (Logger.DEBUG_FILEBUFFERMODELMANAGEMENT || Logger.DEBUG_FILEBUFFERMODELLEAKS) {
+			IDocument[] danglingDocuments = (IDocument[]) instance.fDocumentMap.keySet().toArray(new IDocument[0]);
+			for (int i = 0; i < danglingDocuments.length; i++) {
+				DocumentInfo info = (DocumentInfo) instance.fDocumentMap.get(danglingDocuments[i]);
+				if (info.modelReferenceCount > 0)
+					System.err.println("LEAKED MODEL: " + info.buffer.getLocation() + " " + (info.model != null ? info.model.getId() : null)); //$NON-NLS-1$ //$NON-NLS-2$
+				if (info.bufferReferenceCount > 0)
+					System.err.println("LEAKED BUFFER: " + info.buffer.getLocation() + " " + info.buffer.getDocument()); //$NON-NLS-1$ //$NON-NLS-2$
 			}
-			FileBuffers.getTextFileBufferManager().removeFileBufferListener(instance.fFileBufferListener);
-			instance = null;
 		}
 	}
 
-	static final void startup() {
-		getInstance();
+	static synchronized final void startup() {
+		FileBuffers.getTextFileBufferManager().addFileBufferListener(getInstance().fFileBufferListener);
 	}
 
 	// a map of IStructuredDocuments to DocumentInfo objects
 	Map fDocumentMap = null;
 
-	IFileBufferListener fFileBufferListener = null;
+	FileBufferMapper fFileBufferListener = new FileBufferMapper();
 
 	FileBufferModelManager() {
 		super();
 		fDocumentMap = new Hashtable(4);
-		FileBuffers.getTextFileBufferManager().addFileBufferListener(fFileBufferListener = new FileBufferMapper());
 	}
 
 	public String calculateId(IFile file) {
@@ -420,11 +415,17 @@
 	/**
 	 * Registers "interest" in a document, or rather the file buffer that
 	 * backs it. Intentionally used to alter the reference count of the file
-	 * buffer so it is not accidentally disposed of.
+	 * buffer so it is not accidentally disposed of while we have a model open
+	 * on top of it.
 	 */
 	public boolean connect(IDocument document) {
+		if (document == null) {
+			Exception iae = new IllegalArgumentException("can not connect() without a document"); //$NON-NLS-1$ 
+			Logger.logException(iae);
+			return false;
+		}
 		DocumentInfo info = (DocumentInfo) fDocumentMap.get(document);
-		if( info == null)
+		if (info == null)
 			return false;
 		ITextFileBufferManager bufferManager = FileBuffers.getTextFileBufferManager();
 		IPath bufferLocation = info.buffer.getLocation();
@@ -530,6 +531,11 @@
 	 * buffer so that it knows it can safely be disposed of.
 	 */
 	public boolean disconnect(IDocument document) {
+		if (document == null) {
+			Exception iae = new IllegalArgumentException("can not disconnect() without a document"); //$NON-NLS-1$ 
+			Logger.logException(iae);
+			return false;
+		}
 		DocumentInfo info = (DocumentInfo) fDocumentMap.get(document);
 		if( info == null)
 			return false;
@@ -742,6 +748,19 @@
 		return new NullProgressMonitor();
 	}
 
+	/**
+	 * Will remove the entry corresponding to <code>document</code> if both
+	 * there are no more buffer or model reference counts for <code>info</code>
+	 * 
+	 * @param info the document info to check for reference counts
+	 * @param document the key to remove from the document map if there are no more
+	 * references
+	 */
+	private void checkReferenceCounts(DocumentInfo info, IDocument document) {
+		if (info.bufferReferenceCount == 0 && info.modelReferenceCount == 0)
+			fDocumentMap.remove(document);
+	}
+
 	public boolean isExistingBuffer(IDocument document) {
 		if (document == null) {
 			Exception iae = new IllegalArgumentException("can not check for an existing buffer without a document reference"); //$NON-NLS-1$ 
@@ -778,6 +797,11 @@
 					Logger.logException("Error releasing model for " + location, e); //$NON-NLS-1$
 				}
 			}
+			// [265899]
+			// In some scenarios, a model can be held onto after the editor has been disposed even if the lifecycle is
+			// maintained properly (e.g., an editor being closed before a DirtyRegionProcessor has a chance to complete). Because of this,
+			// the manager cannot be reliant upon the FileBufferMapper having the sole responsibility of the fDocumentMap cleanup
+			checkReferenceCounts(info, document);
 		}
 	}
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/IExecutionDelegate.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/IExecutionDelegate.java
index 097eb6d..63c5894 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/IExecutionDelegate.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/IExecutionDelegate.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,8 +13,15 @@
 
 package org.eclipse.wst.sse.core.internal;
 
+import org.eclipse.core.runtime.ISafeRunnable;
 
+/**
+ * An abstraction that allows even processing to be performed in a different
+ * context, e.g. a different Thread, if needed.
+ * 
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
 public interface IExecutionDelegate {
 
-	void execute(Runnable runnable);
+	void execute(ISafeRunnable runnable);
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/Logger.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/Logger.java
index 6219ddc..f826867 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/Logger.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/Logger.java
@@ -46,6 +46,11 @@
 	 */
 	public static final boolean DEBUG_FILEBUFFERMODELMANAGEMENT = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/filebuffers/modelmanagement")); //$NON-NLS-1$ //$NON-NLS-2$
 	/**
+	 * true if platform and plugin are in debug mode and debugging file buffer
+	 * models not being released on shutdown
+	 */
+	public static final boolean DEBUG_FILEBUFFERMODELLEAKS = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/filebuffers/leaks")); //$NON-NLS-1$ //$NON-NLS-2$
+	/**
 	 * true if platform and plugin are in debug mode and debugging formatting
 	 */
 	public static final boolean DEBUG_FORMAT = DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/format")); //$NON-NLS-1$ //$NON-NLS-2$
@@ -115,6 +120,17 @@
 	public static final int INFO = IStatus.INFO;
 	public static final int WARNING = IStatus.WARNING;
 	public static final int ERROR = IStatus.ERROR;
+	public static final int OK_DEBUG = 200 + OK;
+	public static final int INFO_DEBUG = 200 + INFO;
+	public static final int WARNING_DEBUG = 200 + WARNING;
+	public static final int ERROR_DEBUG = 200 + ERROR;
+
+	/**
+	 * @return true if the platform is debugging
+	 */
+	private static boolean isDebugging() {
+		return Platform.inDebugMode();
+	}
 
 	/**
 	 * Adds message to log.
@@ -127,8 +143,26 @@
 	 *            exception thrown
 	 */
 	private static void _log(int level, String message, Throwable exception) {
+		if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
+			if (!isDebugging())
+				return;
+		}
+		int severity = IStatus.OK;
+		switch (level) {
+			case INFO_DEBUG :
+			case INFO :
+				severity = IStatus.INFO;
+				break;
+			case WARNING_DEBUG :
+			case WARNING :
+				severity = IStatus.WARNING;
+				break;
+			case ERROR_DEBUG :
+			case ERROR :
+				severity = IStatus.ERROR;
+		}
 		message = (message != null) ? message : ""; //$NON-NLS-1$
-		Status statusObj = new Status(level, PLUGIN_ID, level, message, exception);
+		Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
 		Bundle bundle = Platform.getBundle(PLUGIN_ID);
 		if (bundle != null)
 			Platform.getLog(bundle).log(statusObj);
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePlugin.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePlugin.java
index bb4e8f3..15e32bb 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePlugin.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePlugin.java
@@ -19,6 +19,7 @@
 import org.eclipse.wst.sse.core.internal.modelhandler.ModelHandlerRegistry;
 import org.eclipse.wst.sse.core.internal.preferences.CommonModelPreferenceNames;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.tasks.TaskScanningScheduler;
 import org.osgi.framework.BundleContext;
 
 
@@ -60,6 +61,9 @@
 	 */
 	public void stop(BundleContext context) throws Exception {
 		savePluginPreferences();
+		
+		TaskScanningScheduler.shutdown();
+
 		FileBufferModelManager.shutdown();
 
 		super.stop(context);
@@ -75,6 +79,16 @@
 
 		// initialize FileBuffer handling
 		FileBufferModelManager.startup();
+
+		/**
+		 * If the user starts the workbench with
+		 * -Dorg.eclipse.wst.sse.core.taskscanner=off, the scanner should be
+		 * disabled
+		 */
+		String scan = System.getProperty("org.eclipse.wst.sse.core.taskscanner"); //$NON-NLS-1$
+		if (scan == null || !scan.equalsIgnoreCase("off")) { //$NON-NLS-1$
+			TaskScanningScheduler.startup();
+		}
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentLoader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentLoader.java
index 20a99d6..b7eff1e 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentLoader.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentLoader.java
@@ -23,8 +23,15 @@
 import org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument;
 
 
+/**
+ * Provides methods for the creation of an IStructuredDocument correctly
+ * prepared to work with a particular type of content.
+ */
 public interface IDocumentLoader {
 
+	/**
+	 * @return a new IStructuredDocument prepared by this loader
+	 */
 	IEncodedDocument createNewStructuredDocument();
 
 	/**
@@ -50,12 +57,15 @@
 
 	IEncodedDocument createNewStructuredDocument(String filename, InputStream istream, EncodingRule encodingRule) throws java.io.IOException;
 
+	/**
+	 * @return the document partitioner
+	 */
 	IDocumentPartitioner getDefaultDocumentPartitioner();
 
 	IDocumentCharsetDetector getDocumentEncodingDetector();
 
 	/**
-	 * A utility method, but depends on subclasses to impliment the preferred
+	 * A utility method, but depends on subclasses to implement the preferred
 	 * end of line for a particular content type. Note: subclasses should not
 	 * re-implement this method (there's no reason to, even though its part of
 	 * interface). This method not only converts end-of-line characters, if
@@ -63,6 +73,8 @@
 	 * structuredDocument. The returned value is either the original string,
 	 * if no conversion is needed, or a new string with end-of-lines
 	 * converted.
+	 * 
+	 * @deprecated - the content's line delimiters should be preserved
 	 */
 	StringBuffer handleLineDelimiter(StringBuffer originalString, IEncodedDocument theStructuredDocument);
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/AbstractStructuredFormatProcessor.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/AbstractStructuredFormatProcessor.java
index 4b554be..1e8d690 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/AbstractStructuredFormatProcessor.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/AbstractStructuredFormatProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,6 +9,7 @@
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
  *     Jesper Steen Møller - initial IDocumentExtension4 support - #102822
+ *     David Carver (Intalio) - bug 300443 - some constants aren't static final
  *     
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.format;
@@ -45,7 +46,7 @@
 	 * Max length of text to be formatted to be considered a "small change"
 	 * Used for document rewrite session type.
 	 */
-	private final int MAX_SMALL_FORMAT_SIZE = 1000;
+	private static final int MAX_SMALL_FORMAT_SIZE = 1000;
 
 	protected void ensureClosed(OutputStream outputStream, InputStream inputStream) {
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/EmbeddedTypeHandler.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/EmbeddedTypeHandler.java
index 2e4d314..b551190 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/EmbeddedTypeHandler.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/EmbeddedTypeHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,7 +14,7 @@
 
 import java.util.List;
 
-import org.eclipse.wst.sse.core.internal.ltk.parser.JSPCapableParser;
+import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
 import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
 
 
@@ -24,9 +24,10 @@
 
 	/**
 	 * These AdapterFactories are NOT added to IStructuredModel's
-	 * IAdapterFactory Registry ... they are for use by "JSP Aware
-	 * AdapterFactories" The are added to the "registry" in the
-	 * PageDirectiveAdapter.
+	 * IAdapterFactory Registry, but instead expected to be consulted as
+	 * needed by functionality aware of embedded content types.  Additions
+	 * to the model's own factory registry should be done in
+	 * {@link #initializeFactoryRegistry(FactoryRegistry)}
 	 */
 	List getAdapterFactories();
 
@@ -56,16 +57,18 @@
 	 * @return true if this handler thinks can handle the given mimeType
 	 */
 	boolean canHandleMimeType(String mimeType);
+
 	/**
 	 * This method is to give the EmbeddedContentType an opportunity to add
-	 * factories directly to the IStructuredModel's IAdapterFactory registry.
+	 * factories directly to the IStructuredModel's IAdapterFactory registry. 
 	 */
 	void initializeFactoryRegistry(FactoryRegistry registry);
 
 	/**
-	 * initializeParser Its purpose is to setBlockTags
+	 * initializeParser, for example, setting up a "block" tags list using an
+	 * extended interface
 	 */
-	void initializeParser(JSPCapableParser parser);
+	void initializeParser(RegionParser parser);
 
 	boolean isDefault();
 
@@ -73,5 +76,5 @@
 
 	void uninitializeFactoryRegistry(FactoryRegistry registry);
 
-	void uninitializeParser(JSPCapableParser parser);
+	void uninitializeParser(RegionParser parser);
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IDocumentTypeHandler.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IDocumentTypeHandler.java
index d4862a4..aa62963 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IDocumentTypeHandler.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IDocumentTypeHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,8 +16,8 @@
 import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
 
 /**
- * Interface to allow custom content types to be defined as extension points
- * in plugins.
+ * Responsible for providing the mechanisms used in the correct loading of an
+ * IStructuredDocument's contents and determine its self-described encoding.
  */
 public interface IDocumentTypeHandler {
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IModelHandler.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IModelHandler.java
index c2947d4..588f39e 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IModelHandler.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IModelHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,6 +17,10 @@
 import org.eclipse.wst.sse.core.internal.provisional.IModelLoader;
 
 
+/**
+ * Responsible for providing the mechanisms used in the correct loading of an
+ * IStructuredModel's contents and initialization of its adapter factories.
+ */
 public interface IModelHandler extends IDocumentTypeHandler {
 	/**
 	 * This method should return Factories which are added automatically by
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractModelLoader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractModelLoader.java
index 0ae7998..caafaaf 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractModelLoader.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractModelLoader.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -98,7 +98,7 @@
 			model.setStructuredDocument((IStructuredDocument) structuredDocument);
 			addFactories(model, getAdapterFactories());
 			//
-			initEmbeddedTypePre(model);
+			initEmbeddedTypePre(model, (IStructuredDocument) structuredDocument);
 			initEmbeddedTypePost(model);
 			// For types with propagating adapters, its important
 			// that the propagating adapter be in place before the contents
@@ -122,7 +122,7 @@
 		// that the propagating adapter be in place before the contents
 		// are set.
 		preLoadAdapt(model);
-		initEmbeddedTypePre(model);
+		initEmbeddedTypePre(model, structuredDocument);
 
 		model.setStructuredDocument(structuredDocument);
 		//
@@ -183,12 +183,28 @@
 	abstract public IDocumentLoader getDocumentLoader();
 
 	/**
-	 * Method initEmbeddedType. Nothing to do here in super class.
+	 * Method initEmbeddedType, "pre"-stage. Nothing to do here in super class.
 	 * 
 	 * @param model
 	 */
 	protected void initEmbeddedTypePre(IStructuredModel model) {
 	}
+
+	/**
+	 * Method initEmbeddedType, "pre"-stage. By default simply calls the
+	 * version of this method that uses only the structured model.
+	 * 
+	 * @param model
+	 *            the model for which to initialize
+	 * @param structuredDocument
+	 *            The structured document containing the text content for the
+	 *            model, which may be a different instance than what is in the
+	 *            model at this stage.
+	 */
+	protected void initEmbeddedTypePre(IStructuredModel model, IStructuredDocument structuredDocument) {
+		initEmbeddedTypePre(model);
+	}
+		
 	protected void initEmbeddedTypePost(IStructuredModel model) {
 	}
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelManagerImpl.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelManagerImpl.java
index de37b49..09a96e1 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelManagerImpl.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelManagerImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *  *     Frank Zigler/Web Performance, Inc. - 288196 - Deadlock in ModelManagerImpl after IOException
  *     
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.model;
@@ -40,9 +41,12 @@
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.QualifiedName;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.content.IContentDescription;
 import org.eclipse.core.runtime.jobs.ILock;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.text.BadLocationException;
@@ -81,65 +85,103 @@
 import org.eclipse.wst.sse.core.internal.util.Utilities;
 
 /**
- * Not intended to be subclassed, referenced or instantiated by clients.
+ * <p>Not intended to be subclassed, referenced or instantiated by clients.
+ * Clients should obtain an instance of the IModelManager interface through
+ * {@link StructuredModelManager#getModelManager()}.</p>
  * 
- * This class is responsible for creating, retrieving, and caching
+ * <p>This class is responsible for creating, retrieving, and caching
  * StructuredModels It retrieves the cached objects by an id which is
  * typically a String representing the resources URI. Note: Its important that
  * all clients that share a resource do so using <b>identical </b>
  * identifiers, or else different instances will be created and retrieved,
  * even if they all technically point to the same resource on the file system.
  * This class also provides a convenient place to register Model Loaders and
- * Dumpers based on 'type'.
+ * Dumpers based on 'type'.</p>
  */
 public class ModelManagerImpl implements IModelManager {
 
+	
+	
 	static class ReadEditType {
 		ReadEditType(String type) {
 		}
 	}
 
-	/**
-	 * A Data class to track our shared objects
-	 */
-	 static class SharedObject {
+	class SharedObject {
 		int referenceCountForEdit;
 		int referenceCountForRead;
-		IStructuredModel theSharedModel;
-		boolean initializing = true;
-		boolean doWait = true;
-		
-		SharedObject(IStructuredModel sharedModel) {
-			theSharedModel = sharedModel;
-			referenceCountForRead = 0;
-			referenceCountForEdit = 0;
+		volatile IStructuredModel theSharedModel;
+		final ILock LOAD_LOCK = Job.getJobManager().newLock();
+		volatile boolean initializing = true;
+		volatile boolean doWait = true;
+		// The field 'id' is only meant for debug
+		final String id;
+
+		SharedObject(String id) {
+			this.id=id;
+			// be aware, this lock will leak and cause the deadlock detector to be horrible if we never release it
+			LOAD_LOCK.acquire();
 		}
-		
+
 		/**
-		 * Waits until this shared object has been attempted to be loaded. 
-		 * The load is "attempted" because not all loads result in a model. 
-		 * However, upon leaving this method, theShareModel variable
-		 * is up-to-date.
+		 * Waits until this shared object has been attempted to be loaded. The
+		 * load is "attempted" because not all loads result in a model. However,
+		 * upon leaving this method, theShareModel variable is up-to-date.
 		 */
-		public synchronized void waitForLoadAttempt() {
-			while(initializing) {
-				try {
-					wait();
+		public void waitForLoadAttempt() {
+			final boolean allowInterrupt = PrefUtil.ALLOW_INTERRUPT_WAITING_THREAD;
+			final long timeLimit = (PrefUtil.WAIT_DELAY==0) ? Long.MAX_VALUE : PrefUtil.now() + PrefUtil.WAIT_DELAY;
+			final Job current = Job.getJobManager().currentJob();
+			boolean interrupted = false;
+			try {
+				while (initializing) {
+					if (current!=null) {
+						current.yieldRule(null);
+					}
+					try {
+						loop();
+					} catch (InterruptedException e) {
+						if (allowInterrupt) {
+							throw new OperationCanceledException("Waiting thread interrupted while waiting for model id: "+id + " to load");
+						} else {
+							interrupted=true;
+						}
+					}
+					if (PrefUtil.now() >= timeLimit	)
+						throw new OperationCanceledException("Waiting thread timeout exceeded while waiting for model id: "+id + " to load");
 				}
-				catch (InterruptedException e) {
-					// ignore interruption!
+			}
+			finally {
+				if (interrupted) {
+					Thread.currentThread().interrupt();
 				}
 			}
 		}
-		
+
+		private void loop() throws InterruptedException {	
+			if (initializing) {
+				if (LOAD_LOCK.acquire(PrefUtil.WAIT_INTERVAL_MS)) {
+					// if we got the lock, but initializing is still not true the deadlock detector gave us
+					// the lock and caused reentrancy into this critical section. This is invalid and the 
+					// sign of a cyclical load attempt. In this case, we through an 
+					// OperationCanceledException in lew of entering a spin-loop. 
+					if (initializing) {
+						LOAD_LOCK.release();
+						throw new OperationCanceledException("Aborted cyclic load attempt for model with id: "+ id );
+					} else {
+						LOAD_LOCK.release();
+					}
+				}
+			}
+		}
+
 		/**
-		 * Flags this model as loaded. All waiting methods on 
-		 * {@link #waitForLoadAttempt()} will proceed after this 
-		 * method returns. 
+		 * Flags this model as loaded. All waiting methods on
+		 * {@link #waitForLoadAttempt()} will proceed after this method returns.
 		 */
-		public synchronized void setLoaded() {
+		public void setLoaded() {
 			initializing = false;
-			notifyAll();
+			LOAD_LOCK.release();
 		}
 	}
 
@@ -207,7 +249,7 @@
 			SharedObject testObject = (SharedObject) fManagedObjects.get(id);
 			if (testObject==null) {
 				// null means it's been disposed, we need to do the work to reload it.
-				sharedObject = new SharedObject(null);
+				sharedObject = new SharedObject(id);
 				fManagedObjects.put(id, sharedObject);
 				SYNC.release();
 				_doCommonCreateModel(file, id, handler, resolver, rwType, encodingRule,
@@ -258,7 +300,9 @@
 	private void _doCommonCreateModel(IFile file, String id, IModelHandler handler,
 			URIResolver resolver, ReadEditType rwType, EncodingRule encodingRule,
 			SharedObject sharedObject) throws CoreException, IOException {
-		boolean doRemove = false;
+		// XXX: Does not integrate with FileBuffers
+		boolean doRemove = true;
+		try {
 		synchronized(sharedObject) {
 			InputStream inputStream = null;
 			IStructuredModel model = null;
@@ -283,16 +327,18 @@
 				// add to our cache
 				sharedObject.theSharedModel=model;
 				_initCount(sharedObject, rwType);
-			} else {
-				doRemove = true;
+				doRemove = false;
 			}
 		}
+		}
+		finally{
 		if (doRemove) {
 			SYNC.acquire();	
 			fManagedObjects.remove(id);	
 			SYNC.release();
 		}
 		sharedObject.setLoaded();
+		}
 	}
 
 	private IStructuredModel _commonCreateModel(InputStream inputStream, String id, IModelHandler handler, URIResolver resolver, ReadEditType rwType, String encoding, String lineDelimiter) throws IOException {
@@ -314,7 +360,7 @@
 			SharedObject testObject = (SharedObject) fManagedObjects.get(id);
 			if (testObject==null) {
 				// it was removed ,so lets create it
-				sharedObject = new SharedObject(null);
+				sharedObject = new SharedObject(id);
 				fManagedObjects.put(id, sharedObject);
 				SYNC.release();
 				_doCommonCreateModel(inputStream, id, handler, resolver, rwType,
@@ -344,7 +390,8 @@
 	private void _doCommonCreateModel(InputStream inputStream, String id, IModelHandler handler,
 			URIResolver resolver, ReadEditType rwType, String encoding, String lineDelimiter,
 			SharedObject sharedObject) throws IOException {
-		boolean doRemove = false;
+		boolean doRemove = true;
+		try {
 		synchronized(sharedObject) {
 			IStructuredModel model = null;
 			try {
@@ -360,12 +407,31 @@
 				handleProgramError(e);
 			}
 			if (model != null) {
+				/**
+				 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=264228
+				 * 
+				 * Ensure that the content type identifier field of the model
+				 * is properly set. This is normally handled by the
+				 * FileBufferModelManager when working with files as it knows
+				 * the content type in advance; here is where we handle it for
+				 * streams.
+				 */
+				if (model instanceof AbstractStructuredModel) {
+					DocumentReader reader = new DocumentReader(model.getStructuredDocument());
+					IContentDescription description = Platform.getContentTypeManager().getDescriptionFor(reader, id, new QualifiedName[0]);
+					reader.close();
+					if (description != null && description.getContentType() != null) {
+						((AbstractStructuredModel) model).setContentTypeIdentifier(description.getContentType().getId());
+					}
+				}
+
 				sharedObject.theSharedModel = model;
 				_initCount(sharedObject, rwType);
-			} else {
-				doRemove = true;
+				doRemove = false;
 			}
 		}
+		}
+		finally {
 		if (doRemove) {
 			SYNC.acquire();
 			// remove it if we didn't get one back
@@ -373,6 +439,7 @@
 			SYNC.release();
 		}
 		sharedObject.setLoaded();
+		}
 	}
 
 	private IStructuredModel _commonCreateModel(String id, IModelHandler handler, URIResolver resolver) throws ResourceInUse {
@@ -411,14 +478,12 @@
 
 	private IStructuredModel _commonGetModel(IFile iFile, ReadEditType rwType, String encoding, String lineDelimiter) throws UnsupportedEncodingException, IOException, CoreException {
 		String id = calculateId(iFile);
-		IModelHandler handler = calculateType(iFile);
-		URIResolver resolver = calculateURIResolver(iFile);
-		IStructuredModel model = _commonGetModel(iFile, id, handler, resolver, rwType, encoding, lineDelimiter);
+		IStructuredModel model = _commonGetModel(iFile, id, rwType, encoding, lineDelimiter);
 
 		return model;
 	}
 
-	private IStructuredModel _commonGetModel(IFile file, String id, IModelHandler handler, URIResolver resolver, ReadEditType rwType, String encoding, String lineDelimiter) throws IOException, CoreException {
+	private IStructuredModel _commonGetModel(IFile file, String id, ReadEditType rwType, String encoding, String lineDelimiter) throws IOException, CoreException {
 		if (id == null)
 			throw new IllegalArgumentException("Program Error: id may not be null"); //$NON-NLS-1$
 
@@ -436,7 +501,7 @@
 				SharedObject testObject = (SharedObject) fManagedObjects.get(id);
 				if (testObject==null) {
 					// it was removed ,so lets create it
-					sharedObject = new SharedObject(null);
+					sharedObject = new SharedObject(id);
 					fManagedObjects.put(id, sharedObject);
 					
 					SYNC.release();
@@ -470,24 +535,32 @@
 	}
 
 	private void _doCommonGetModel(IFile file, String id, SharedObject sharedObject,ReadEditType rwType) {
-		boolean doRemove = false;
-		synchronized(sharedObject) {
-			sharedObject.doWait=false;
-			IStructuredModel model = FileBufferModelManager.getInstance().getModel(file);
-			sharedObject.doWait=true;
-			if (model != null) {
-				sharedObject.theSharedModel=model;
-				_initCount(sharedObject, rwType);
-			} else {
-				doRemove = true;
+		boolean doRemove = true;
+		try {
+			synchronized(sharedObject) {
+				sharedObject.doWait=false;
+				IStructuredModel model = null;
+				try {
+					model = FileBufferModelManager.getInstance().getModel(file);
+				}
+				finally {
+					sharedObject.doWait=true;
+				}
+				if (model != null) {
+					sharedObject.theSharedModel=model;
+					_initCount(sharedObject, rwType);
+					doRemove = false;
+				}
 			}
 		}
-		if (doRemove) {
-			SYNC.acquire();
-			fManagedObjects.remove(id);
-			SYNC.release();
+		finally {
+			if (doRemove) {
+				SYNC.acquire();
+				fManagedObjects.remove(id);
+				SYNC.release();
+			}
+			sharedObject.setLoaded();
 		}
-		sharedObject.setLoaded();
 	}
 
 	private SharedObject _commonNewModel(IFile iFile, boolean force) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException {
@@ -513,7 +586,7 @@
 				throw new ResourceInUse();
 			}
 			
-			sharedObject = new SharedObject(null);
+			sharedObject = new SharedObject(id);
 			fManagedObjects.put(id, sharedObject);
 			
 		} finally {
@@ -538,7 +611,13 @@
 	public IStructuredModel _getModelFor(IStructuredDocument document, ReadEditType accessType) {
 
 		String id = FileBufferModelManager.getInstance().calculateId(document);
-		Assert.isNotNull(id, "unknown IStructuredDocument " + document); //$NON-NLS-1$
+		if (id == null) {
+			if (READ == accessType)
+				return getExistingModelForRead(document);
+			if (EDIT == accessType)
+				return getExistingModelForEdit(document);
+			Assert.isNotNull(id, "unknown IStructuredDocument " + document); //$NON-NLS-1$
+		}
 		
 		SharedObject sharedObject = null;
 		SYNC.acquire();
@@ -552,7 +631,7 @@
 			SYNC.acquire();
 			SharedObject testObject = (SharedObject) fManagedObjects.get(id);
 			if (testObject==null) {
-				sharedObject = new SharedObject(null);
+				sharedObject = new SharedObject(id);
 				fManagedObjects.put(id, sharedObject);
 				SYNC.release();
 				synchronized(sharedObject) {
@@ -563,7 +642,7 @@
 				break;
 			} else if (sharedObject == testObject) {
 				synchronized(sharedObject) {
-					Assert.isTrue(sharedObject.referenceCountForEdit + sharedObject.referenceCountForRead > 0);
+					Assert.isTrue(sharedObject.referenceCountForEdit + sharedObject.referenceCountForRead > 0, "reference count was less than zero");
 					if (sharedObject.theSharedModel!=null) {
 						_incrCount(sharedObject, accessType);
 					}
@@ -612,7 +691,7 @@
 	private void addFactories(IStructuredModel model, IModelHandler handler) {
 		Assert.isNotNull(model, "model can not be null"); //$NON-NLS-1$
 		FactoryRegistry registry = model.getFactoryRegistry();
-		Assert.isNotNull(registry, "Factory Registry can not be null"); //$NON-NLS-1$
+		Assert.isNotNull(registry, "model's Factory Registry can not be null"); //$NON-NLS-1$
 		List factoryList = handler.getAdapterFactories();
 		addFactories(model, factoryList);
 	}
@@ -620,7 +699,7 @@
 	private void addFactories(IStructuredModel model, List factoryList) {
 		Assert.isNotNull(model, "model can not be null"); //$NON-NLS-1$
 		FactoryRegistry registry = model.getFactoryRegistry();
-		Assert.isNotNull(registry, "Factory Registry can not be null"); //$NON-NLS-1$
+		Assert.isNotNull(registry, "model's Factory Registry can not be null"); //$NON-NLS-1$
 		// Note: we add all of them from handler, even if
 		// already exists. May need to reconsider this.
 		if (factoryList != null) {
@@ -667,7 +746,11 @@
 		URIResolver resolver = (URIResolver) project.getAdapter(URIResolver.class);
 		if (resolver == null)
 			resolver = new ProjectResolver(project);
-		resolver.setFileBaseLocation(file.getLocation().toString());
+		Object location = file.getLocation();
+		if (location == null)
+			location = file.getLocationURI();
+		if (location != null)
+			resolver.setFileBaseLocation(location.toString());
 		return resolver;
 	}
 
@@ -766,7 +849,7 @@
 			if (sharedObject != null) {
 				throw new ResourceInUse();
 			}
-			sharedObject = new SharedObject(null);
+			sharedObject = new SharedObject(newId);
 			fManagedObjects.put(newId,sharedObject);
 		} finally {
 			SYNC.release();
@@ -1294,7 +1377,7 @@
 	 */
 	public  IStructuredModel getModelForEdit(Object id, InputStream inputStream, URIResolver resolver) throws java.io.UnsupportedEncodingException, IOException {
 
-		Assert.isNotNull(id, "IFile parameter can not be null"); //$NON-NLS-1$
+		Assert.isNotNull(id, "requested model id can not be null"); //$NON-NLS-1$
 		String stringId = id.toString();
 		return getModelForEdit(stringId, Utilities.getMarkSupportedStream(inputStream), resolver);
 	}
@@ -1595,7 +1678,8 @@
 	 * not to use this function
 	 */
 	public void moveModel(Object oldId, Object newId) {
-		org.eclipse.wst.sse.core.internal.util.Assert.isNotNull(oldId, "id parameter can not be null"); //$NON-NLS-1$
+		Assert.isNotNull(oldId, "old id parameter can not be null"); //$NON-NLS-1$
+		Assert.isNotNull(newId, "new id parameter can not be null"); //$NON-NLS-1$
 		SYNC.acquire();
 		SharedObject sharedObject = (SharedObject) fManagedObjects.get(oldId);
 		// if not found in cache, ignore request.
@@ -1714,7 +1798,6 @@
 			
 			Assert.isNotNull(sharedObject, "release was requested on a model that was not being managed"); //$NON-NLS-1$
 			sharedObject.waitForLoadAttempt();
-			
 			SYNC.acquire();
 			synchronized(sharedObject) {
 				_decrCount(sharedObject, EDIT);
@@ -1735,7 +1818,17 @@
 				if ((sharedObject.referenceCountForRead > 0) && (sharedObject.referenceCountForEdit == 0) && sharedObject.theSharedModel.isDirty()) {
 					signalPreLifeCycleListenerRevert(sharedObject.theSharedModel);
 					revertModel(id, sharedObject);
-					sharedObject.theSharedModel.setDirtyState(false);
+					/*
+					 * Because model events are fired to notify about the
+					 * revert's changes, and listeners can still get/release
+					 * the model from this thread (locking prevents it being
+					 * done from other threads), the reference counts could
+					 * have changed since we entered this if block, and the
+					 * model could have been discarded.  Check the counts again.
+					 */
+					if (sharedObject.referenceCountForRead > 0 && sharedObject.referenceCountForEdit == 0) {
+						sharedObject.theSharedModel.setDirtyState(false);
+					}
 					signalPostLifeCycleListenerRevert(sharedObject.theSharedModel);
 				}
 			}
@@ -1842,6 +1935,7 @@
 	 * @deprecated - will become protected, use reload directly on model
 	 */
 	public  IStructuredModel reloadModel(Object id, java.io.InputStream inputStream) throws java.io.UnsupportedEncodingException {
+		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
 
 		// get the existing model associated with this id
 		IStructuredModel structuredModel = getExistingModel(id);
@@ -1863,6 +1957,8 @@
 	}
 
 	public void saveModel(IFile iFile, String id, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
+		Assert.isNotNull(iFile, "file parameter can not be null"); //$NON-NLS-1$
+		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
 
 		// let's see if we already have it in our cache
 	
@@ -1918,6 +2014,7 @@
 	 * @throws CoreException
 	 */
 	public void saveModel(String id, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException {
+		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
 
 		// let's see if we already have it in our cache
 
@@ -1965,6 +2062,8 @@
 	 *             in favor of the IFile form.
 	 */
 	public void saveModel(String id, OutputStream outputStream, EncodingRule encodingRule) throws UnsupportedEncodingException, CoreException, IOException {
+		Assert.isNotNull(id, "id parameter can not be null"); //$NON-NLS-1$
+
 		SYNC.acquire();
 		// let's see if we already have it in our cache
 		SharedObject sharedObject = (SharedObject) fManagedObjects.get(id);
@@ -1994,9 +2093,10 @@
 	}
 
 	public void saveStructuredDocument(IStructuredDocument structuredDocument, IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, CoreException, IOException {
+		Assert.isNotNull(iFile, "file parameter can not be null"); //$NON-NLS-1$
 		if (FileBufferModelManager.getInstance().isExistingBuffer(structuredDocument)) {
 			ITextFileBuffer buffer = FileBufferModelManager.getInstance().getBuffer(structuredDocument);
-			if (buffer.getLocation().equals(iFile.getLocation())) {
+			if (buffer.getLocation().equals(iFile.getFullPath()) || buffer.getLocation().equals(iFile.getLocation())) {
 				buffer.commit(new NullProgressMonitor(), true);
 			}
 		}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/PrefUtil.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/PrefUtil.java
new file mode 100644
index 0000000..ee29ad3
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/PrefUtil.java
@@ -0,0 +1,146 @@
+/*******************************************************************************

+ * Copyright (c) 2010 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ *

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *     

+ *******************************************************************************/

+package org.eclipse.wst.sse.core.internal.model;

+

+import org.eclipse.core.runtime.Platform;

+import org.eclipse.core.runtime.preferences.ConfigurationScope;

+import org.eclipse.core.runtime.preferences.IEclipsePreferences;

+import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;

+import org.eclipse.core.runtime.preferences.IPreferencesService;

+import org.eclipse.core.runtime.preferences.InstanceScope;

+import org.eclipse.osgi.util.NLS;

+import org.eclipse.wst.sse.core.internal.SSECorePlugin;

+import org.osgi.service.prefs.Preferences;

+

+class PrefUtil {

+

+	static long WAIT_INTERVAL_MS = 500;

+	static int WAIT_DELAY = getInt("org.eclipse.wst.sse.core.modelmanager.maxWaitDuringConcurrentLoad");

+	static boolean ALLOW_INTERRUPT_WAITING_THREAD = getBoolean("org.eclipse.wst.sse.core.modelmanager.allowInterruptsDuringConcurrentLoad");

+

+	/** Base of millisecond timings, to avoid wrapping */

+	private static final long MILLI_ORIGIN = System.currentTimeMillis();

+

+	/**

+	 * Returns millisecond time offset by origin

+	 */

+	static final long now() {

+		return System.currentTimeMillis() - MILLI_ORIGIN;

+	}

+	

+	private static IEclipsePreferences.IPreferenceChangeListener LISTENER;

+	static {

+		InstanceScope scope = new InstanceScope();

+		IEclipsePreferences instancePrefs = scope.getNode(SSECorePlugin.ID);

+		LISTENER = new IEclipsePreferences.IPreferenceChangeListener() {

+

+			public void preferenceChange(PreferenceChangeEvent event) {

+

+				if ("modelmanager.maxWaitDuringConcurrentLoad".equals(event.getKey())) {

+					WAIT_DELAY = getInt("org.eclipse.wst.sse.core.modelmanager.maxWaitDuringConcurrentLoad");

+				}

+				else if ("modelmanager.allowInterruptsDuringConcurrentLoad".equals(event.getKey())) {

+					ALLOW_INTERRUPT_WAITING_THREAD = getBoolean("org.eclipse.wst.sse.core.modelmanager.allowInterruptsDuringConcurrentLoad");

+				}

+			}

+		};

+		instancePrefs.addPreferenceChangeListener(LISTENER);

+	}

+

+	private static String getProperty(String property) {

+		// Importance order is:

+		// default-default < instanceScope < configurationScope < systemProperty

+		// < envVar

+		String value = null;

+

+		if (value == null) {

+			value = System.getenv(property);

+		}

+		if (value == null) {

+			value = System.getProperty(property);

+		}

+		if (value == null) {

+			IPreferencesService preferencesService = Platform.getPreferencesService();

+			

+			String key = property;

+			if (property != null && property.startsWith(SSECorePlugin.ID)) {

+				// +1, include the "."

+				key = property.substring(SSECorePlugin.ID.length() + 1, property.length());

+			}

+			InstanceScope instance = new InstanceScope();

+			ConfigurationScope config = new ConfigurationScope();

+			

+			Preferences instanceNode = instance.getNode(SSECorePlugin.ID);

+			Preferences configNode = config.getNode(SSECorePlugin.ID);

+			value = preferencesService.get(key, getDefault(property), new Preferences[]{configNode,instanceNode});

+		}

+

+		return value;

+	}

+

+	private static String getDefault(String property) {

+		// this is the "default-default"

+		if ("org.eclipse.wst.sse.core.modelmanager.maxWaitDuringConcurrentLoad".equals(property)) {

+			return "0";

+		}

+		else if ("org.eclipse.wst.sse.core.modelmanager.allowInterruptsDuringConcurrentLoad".equals(property)) {

+			return "false";

+		}

+		return null;

+	}

+

+	private static boolean getBoolean(String key) {

+		String property = getProperty(key);

+		// if (property != null) {

+		//			System.out.println("Tweak: " + key + "=" + Boolean.parseBoolean(property)); //$NON-NLS-1$ //$NON-NLS-2$

+		// }

+		return (property != null ? Boolean.valueOf(property) : Boolean.valueOf(getDefault(key)))

+				.booleanValue();

+	}

+

+	private static int getInt(String key) {

+		String property = getProperty(key);

+		int size = 0;

+		if (property != null) {

+			try {

+				size = Integer.parseInt(property);

+				//	System.out.println("Tweak: " + key + "=" + size); //$NON-NLS-1$ //$NON-NLS-2$

+			}

+			catch (NumberFormatException e) {

+				size = getDefaultInt(key, property, size);

+			}

+		}

+		else {

+			size = getDefaultInt(key, property, size);

+		}

+		return size;

+	}

+

+	private static int getDefaultInt(String key, String property, int size) {

+		// ignored

+		try {

+			size = Integer.parseInt(getDefault(key));

+		}

+		catch (NumberFormatException e1) {

+			handleIntParseException(key, property, e1);

+			size = 0;

+		}

+		return size;

+	}

+

+	private static void handleIntParseException(String key, String property, NumberFormatException e1) {

+		Exception n = new Exception(NLS.bind(

+				"Exception during parse of default value for key ''{0}'' value was ''{1}''. Using 0 instead", //$NON-NLS-1$

+				key, property), e1);

+		n.printStackTrace();

+	}

+}

diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistry.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistry.java
index af83ded..72bfa13 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistry.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistry.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -113,13 +113,14 @@
 	 * type.
 	 * 
 	 * @param file
+	 * @param provideDefault should the default extension be used in the absence of other methods
 	 * @return The IModelHandler registered for the content type of the given
 	 *         file. If an exact match is not found, the most-specific match
 	 *         according to IContentType.isKindOf() will be returned. If none
 	 *         are found, either a default or null will be returned.
 	 * @throws CoreException
 	 */
-	public IModelHandler getHandlerFor(IFile file) throws CoreException {
+	public IModelHandler getHandlerFor(IFile file, boolean provideDefault) throws CoreException {
 		IModelHandler modelHandler = null;
 		IContentDescription contentDescription = null;
 		IContentType contentType = null;
@@ -135,7 +136,7 @@
 				/* use the more thorough discovery method to get a description */
 				InputStream contents = null;
 				try {
-					contents = file.getContents(true);
+					contents = file.getContents(false);
 					contentDescription = Platform.getContentTypeManager().getDescriptionFor(contents, file.getName(), IContentDescription.ALL);
 					if (contentDescription != null) {
 						contentType = contentDescription.getContentType();
@@ -169,7 +170,7 @@
 		if (contentType != null) {
 			modelHandler = getHandlerForContentType(contentType);
 		}
-		else {
+		else if (contentType == null && provideDefault) {
 			// hard coding for null content type
 			modelHandler = getHandlerExtension(INTERNAL_DEFAULT_EXTENSION); //$NON-NLS-1$
 		}
@@ -177,6 +178,21 @@
 		return modelHandler;
 	}
 
+	/**
+	 * Finds the registered IModelHandler for a given named file's content
+	 * type. Will check for a default.
+	 * 
+	 * @param file
+	 * @return The IModelHandler registered for the content type of the given
+	 *         file. If an exact match is not found, the most-specific match
+	 *         according to IContentType.isKindOf() will be returned. If none
+	 *         are found, either a default or null will be returned.
+	 * @throws CoreException
+	 */
+	public IModelHandler getHandlerFor(IFile file) throws CoreException {
+		return getHandlerFor(file, true);
+	}
+
 
 	/**
 	 * Finds the registered IModelHandler for a given named InputStream.
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/propertytester/StructuredFilePropertyTester.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/propertytester/StructuredFilePropertyTester.java
new file mode 100644
index 0000000..184bc03
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/propertytester/StructuredFilePropertyTester.java
@@ -0,0 +1,85 @@
+/******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.wst.sse.core.internal.propertytester;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.wst.sse.core.internal.Logger;
+
+/**
+ * A Property Tester that operates on IFiles and validates
+ * that the expected content type id matches that of the content
+ * type of the file, or any of the base content types.
+ * 
+ * Based on org.eclipse.core.internal.propertytester.FilePropertyTester
+ * 
+ * @deprecated use org.eclipse.core.resources.contentTypeId instead
+ * 
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=288216 
+ */
+public class StructuredFilePropertyTester extends PropertyTester {
+
+	/**
+	 * A property indicating that we are looking to verify that the file matches
+	 * the content type matching the given identifier. The identifier is
+	 * provided as the expected value.
+	 */
+	private static final String PROPERTY_CONTENT_TYPE_ID = "contentTypeId"; //$NON-NLS-1$
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
+	 */
+	public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+		if(PROPERTY_CONTENT_TYPE_ID.equals(property) && (expectedValue != null) && (receiver instanceof IFile) && ((IFile) receiver).exists())
+			return testContentType((IFile) receiver, expectedValue.toString());
+		return false;
+	}
+	
+	/**
+	 * Tests whether the content type for <code>file</code> (or any base content types) 
+	 * matches the <code>contentTypeId</code>. It is possible that this method call could
+	 * cause the file to be read. It is also possible (through poor plug-in
+	 * design) for this method to load plug-ins.
+	 * 
+	 * @param file
+	 *            The file for which the content type should be determined; must
+	 *            not be <code>null</code>.
+	 * @param contentTypeId
+	 *            The expected content type; must not be <code>null</code>.
+	 * @return <code>true</code> if the file's content type (or base content types) 
+	 *         has an identifier that matches <code>contentTypeId</code>;
+	 *         <code>false</code> otherwise.
+	 */
+	private boolean testContentType(final IFile file, String contentTypeId) {
+		final String expectedValue = contentTypeId.trim();
+
+		try {
+			IContentDescription contentDescription = file.getContentDescription();
+			if (contentDescription != null) {
+				IContentType contentType = contentDescription.getContentType();
+				while (contentType != null) {
+					if (expectedValue.equals(contentType.getId()))
+						return true;
+					contentType = contentType.getBaseType();
+				}
+			}
+		}
+		catch (Exception e) {
+			// [232831] - Log messages only when debugging
+			if(Logger.DEBUG)
+				Logger.logException(e);
+		}
+		return false;
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractNotifier.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractNotifier.java
index 6217f99..6f18471 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractNotifier.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractNotifier.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -53,7 +53,7 @@
 		fAdapters[adapterCount++] = adapter;
 	}
 
-	private void ensureCapacity(int needed) {
+	private synchronized void ensureCapacity(int needed) {
 		if (fAdapters == null) {
 			// first time
 			fAdapters = new INodeAdapter[needed + growthConstant];
@@ -80,7 +80,7 @@
 	/**
 	 * Default behavior for getting an adapter.
 	 */
-	public INodeAdapter getAdapterFor(Object type) {
+	public synchronized INodeAdapter getAdapterFor(Object type) {
 		// first, we'll see if we already have one
 		INodeAdapter result = getExistingAdapter(type);
 		// if we didn't find one in our list already,
@@ -108,7 +108,7 @@
 	 * Returns a shallow clone of list, since clients should not manipulate
 	 * our list directly. Instead, they should use add/removeAdapter.
 	 */
-	public Collection getAdapters() {
+	public synchronized Collection getAdapters() {
 		if (fAdapters != null) {
 			if (adapterCount == 0) {
 				fAdapters = null;
@@ -153,7 +153,7 @@
 		return criteria;
 	}
 
-	public INodeAdapter getExistingAdapter(Object type) {
+	public synchronized INodeAdapter getExistingAdapter(Object type) {
 		INodeAdapter result = null;
 		for (int i = 0; i < adapterCount; i++) {
 			INodeAdapter a = fAdapters[i];
@@ -171,49 +171,49 @@
 
 	public void notify(int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
 
-		if (fAdapters != null) {
-			int localAdapterCount = 0;
-			INodeAdapter[] localAdapters = null;
+		int localAdapterCount = 0;
+		INodeAdapter[] localAdapters = null;
 
-			// lock object while making local assignments
-			synchronized (this) {
+		// lock object while making local assignments
+		synchronized (this) {
+			if (fAdapters != null) {
 				localAdapterCount = adapterCount;
 				localAdapters = new INodeAdapter[localAdapterCount];
 				System.arraycopy(fAdapters, 0, localAdapters, 0, localAdapterCount);
 			}
+		}
 
-			for (int i = 0; i < localAdapterCount; i++) {
-				INodeAdapter a = localAdapters[i];
+		for (int i = 0; i < localAdapterCount; i++) {
+			INodeAdapter a = localAdapters[i];
 
-				if (Logger.DEBUG_ADAPTERNOTIFICATIONTIME) {
-					long getAdapterTimeCriteria = getAdapterTimeCriteria();
-					long startTime = System.currentTimeMillis();
-					// ** keep this line identical with non-debug version!!
-					a.notifyChanged(this, eventType, changedFeature, oldValue, newValue, pos);
-					long notifyDuration = System.currentTimeMillis() - startTime;
-					if (getAdapterTimeCriteria >= 0 && notifyDuration > getAdapterTimeCriteria) {
-						System.out.println("adapter notifyDuration: " + notifyDuration + "  class: " + a.getClass()); //$NON-NLS-1$ //$NON-NLS-2$
-					}
+			if (Logger.DEBUG_ADAPTERNOTIFICATIONTIME) {
+				long getAdapterTimeCriteria = getAdapterTimeCriteria();
+				long startTime = System.currentTimeMillis();
+				// ** keep this line identical with non-debug version!!
+				a.notifyChanged(this, eventType, changedFeature, oldValue, newValue, pos);
+				long notifyDuration = System.currentTimeMillis() - startTime;
+				if (getAdapterTimeCriteria >= 0 && notifyDuration > getAdapterTimeCriteria) {
+					System.out.println("adapter notifyDuration: " + notifyDuration + "  class: " + a.getClass()); //$NON-NLS-1$ //$NON-NLS-2$
 				}
-				else {
-					try {
-						// ** keep this line identical with debug version!!
-						a.notifyChanged(this, eventType, changedFeature, oldValue, newValue, pos);
-					}
-					catch (Exception e) {
-						// Its important to "keep going", since notifications
-						// occur between an
-						// aboutToChange event and a changed event -- the
-						// changed event typically being require
-						// to restore state, etc. So, we just log message, do
-						// not re-throw it, but
-						// typically the exception does indicate a serious
-						// program error.
-						Logger.logException("A structured model client, " + a + " threw following exception during adapter notification (" + INodeNotifier.EVENT_TYPE_STRINGS[eventType] + " )", e); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					}
-				}
-
 			}
+			else {
+				try {
+					// ** keep this line identical with debug version!!
+					a.notifyChanged(this, eventType, changedFeature, oldValue, newValue, pos);
+				}
+				catch (Exception e) {
+					// Its important to "keep going", since notifications
+					// occur between an
+					// aboutToChange event and a changed event -- the
+					// changed event typically being require
+					// to restore state, etc. So, we just log message, do
+					// not re-throw it, but
+					// typically the exception does indicate a serious
+					// program error.
+					Logger.logException("A structured model client, " + a + " threw following exception during adapter notification (" + INodeNotifier.EVENT_TYPE_STRINGS[eventType] + " )", e); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+				}
+			}
+
 		}
 	}
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelManager.java
index d299322..b23d0fa 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelManager.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -20,25 +20,70 @@
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.jface.text.IDocument;
+import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
 import org.eclipse.wst.sse.core.internal.provisional.exceptions.ResourceAlreadyExists;
 import org.eclipse.wst.sse.core.internal.provisional.exceptions.ResourceInUse;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.util.URIResolver;
 
-
 /**
- * Responsible for providing a set of APIs for creating a new model manager,
- * for managing (add or remove) model loaders and model dumpers, and for
- * managing (get, release, save, and save as) models.
+ * <p>
+ * Provides APIs for managing (get, release, save, and save as) SSE Structured
+ * Models.
+ * </p>
+ * <p>
+ * Structured Models created from an implementor of this interface can be
+ * either managed or unmanaged. Managed models are shared using reference
+ * counts, so until that count has been decremented to zero, the model will
+ * continue to exist in memory. When managed, models can be looked up using
+ * their IDs or their IStructuredDocuments, which can be advantageous when
+ * building on APIs that aren't specifically designed for SSE (such as those
+ * revolving around IDocuments). Unmanaged models offer no such features, and
+ * are largely used for tasks where their contents are ephemeral, such as for
+ * populating a source viewer with syntax-colored content.
+ * </p>
+ * <p>
+ * There are two types of access used when retrieving a model from the model
+ * manager: READ and EDIT. The contents of a model can be modified regardless
+ * of which access type is used, but any client who gets a model for EDIT is
+ * explicitly declaring that they are interested in saving those changed
+ * contents. The EDIT and READ reference counts are visible to everyone, as
+ * are convenience methods for determining whether a managed model is shared
+ * among multiple clients accessing it for READ or EDIT.
+ * </p>
+ * <p>
+ * Managed models whose contents are "dirty" with READ and EDIT counts above
+ * zero will be reverted to the on-disk content if the EDIT count drops to
+ * zero while the READ count remains above zero.
+ * </p>
+ * <p>
+ * Shared models for which the read and edit counts have both dropped to zero
+ * are no longer valid for use, regardless of whether they have been garbage
+ * collected or not. It is possible, but not guaranteed, that the underlying
+ * structured document is still valid and may even be used in constructing a
+ * new shared model.
+ * </p>
+ * <p>
  * 
- * Clients can reference, but should not implement.
- * 
- * @see StructuredModelManger
+ * @noimplement This interface is not intended to be implemented by clients.
+ * Clients should obtain an instance of the IModelManager interface through
+ * {@link StructuredModelManager#getModelManager()}.</p>
+ *              </p>
+ *              <p>
+ * @see {@link StructuredModelManager}</p>
  */
 public interface IModelManager {
 
+	/**
+	 * A fixed ID used for models which were created as duplicates of existing
+	 * models
+	 */
 	public final static String DUPLICATED_MODEL = "org.eclipse.wst.sse.core.IModelManager.DUPLICATED_MODEL"; //$NON-NLS-1$
+
+	/**
+	 * A fixed ID used for unmanaged models
+	 */
 	public final static String UNMANAGED_MODEL = "org.eclipse.wst.sse.core.IModelManager.UNMANAGED_MODEL"; //$NON-NLS-1$
 
 	/**
@@ -48,22 +93,37 @@
 	 */
 	public String calculateId(IFile file);
 
+	/**
+	 * Copies a model with the old id 
+	 * @param oldId - the old model's ID
+	 * @param newId - the new model's ID
+	 * @return the new model
+	 * @throws ResourceInUse if the given new ID is already in use by a managed model
+	 */
 	IStructuredModel copyModelForEdit(String oldId, String newId) throws ResourceInUse;
 
 	/**
-	 * createNewInstance is similar to clone, except the new instance has no
-	 * content. Note: this produces an unmanaged model, for temporary use. If
-	 * a true shared model is desired, use "copy".
+	 * Creates a new, but empty, unmanaged model of the same kind as the one
+	 * given. For a managed model with the same contents, use "copy".
+	 * 
+	 * @param model
+	 * @return the model, or null of one could not be created
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
 	 */
 	public IStructuredModel createNewInstance(IStructuredModel model) throws IOException;
 
 	/**
 	 * Factory method, since a proper IStructuredDocument must have a proper
-	 * parser assigned. Note: its assume that IFile does not actually exist as
-	 * a resource yet. If it does, ResourceAlreadyExists exception is thrown.
-	 * If the resource does already exist, then createStructuredDocumentFor is
-	 * the right API to use.
+	 * parser assigned. If the resource does already exist, then
+	 * createStructuredDocumentFor is the right API to use.
 	 * 
+	 * @param iFile
+	 * @return the document, or null if one could not be created
+	 * @throws ResourceAlreadyExists
+	 *             if the IFile already exists
+	 * @throws CoreException if the file's contents or description can not be read
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
+	 * @throws ResourceAlreadyExists if the give file already exists
 	 */
 	IStructuredDocument createNewStructuredDocumentFor(IFile iFile) throws ResourceAlreadyExists, IOException, CoreException;
 
@@ -71,112 +131,277 @@
 	 * Factory method, since a proper IStructuredDocument must have a proper
 	 * parser assigned. Note: clients should verify IFile exists before using
 	 * this method. If this IFile does not exist, then
-	 * createNewStructuredDocument is the correct API to use.
+	 * {@link #createNewStructuredDocumentFor(IFile)} is the correct API to use.
+	 * 
+	 * @param iFile - the file
+	 * @return the document, or null if one could not be created
+	 * 
+	 * @throws CoreException if the file's contents or description can not be read
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
 	 */
 	IStructuredDocument createStructuredDocumentFor(IFile iFile) throws IOException, CoreException;
 
 	/**
-	 * Conveience method, since a proper IStructuredDocument must have a
+	 * Convenience method, since a proper IStructuredDocument must have a
 	 * proper parser assigned. It should only be used when an empty
 	 * structuredDocument is needed. Otherwise, use IFile form.
+	 * 
+	 * @param contentTypeId
+	 * @return a structured document with the correct parsing setup for the
+	 *         given content type ID, or null if one could not be created or
+	 *         the given content type ID is unknown or unsupported
 	 */
 	IStructuredDocument createStructuredDocumentFor(String contentTypeId);
 
 	/**
-	 * @deprecated -- I marked as deprecated to discouage use of this method.
-	 *             It does not really work for JSP fragments, since JSP
-	 *             Fragments need an IFile to correctly look up the content
-	 *             settings. Use IFile form instead. Note: some confustion
-	 *             with it and the form for HTPP encoding, so once a null arg
-	 *             is allowed in that API ... we can remove this one. (after
-	 *             verifying again with Tom/Linksbuild)
-	 */
-	IStructuredDocument createStructuredDocumentFor(String filename, InputStream inputStream, URIResolver resolver) throws IOException;
+	 * @deprecated - use IFile form instead as the correct encoding and content rules may not be applied otherwise
+	 * 
+	 * Creates and returns a properly configured structured document for the given contents with the given name
+	 * 
+	 * @param filename - the filename, which may be used to guess the content type
+	 * @param contents - the contents to load
+	 * @param resolver - the URIResolver to use for locating any needed resources
+	 * @return the IStructuredDocument or null of one could not be created
+	 * @throws IOException if the file's contents can not be read or its content type can not be determined
+	 */ 
+	IStructuredDocument createStructuredDocumentFor(String filename, InputStream contents, URIResolver resolver) throws IOException;
 
+	/**
+	 * Creates and returns a properly configured structured document for the given contents with the given name
+	 * 
+	 * @param filename - the filename, which may be used to guess the content type
+	 * @param inputStream - the contents to load
+	 * @param resolver - the URIResolver to use for locating any needed resources
+	 * @param ianaEncodingName - the IANA specified encoding to use when reading the contents
+	 * @return the IStructuredDocument or null if one could not be created
+	 * @throws IOException if the file's contents can not be read or its content type can not be determined
+	 * @deprecated - clients should convert the InputStream into text themselves
+	 *             and then use the version of this method taking a String for its
+	 *             content
+	 */
 	IStructuredDocument createStructuredDocumentFor(String filename, InputStream inputStream, URIResolver resolver, String ianaEncodingName) throws IOException;
 
+	/**
+	 * Creates and returns a properly configured structured document for the given contents with the given name
+	 * 
+	 * @param filename - the filename, which may be used to guess the content type
+	 * @param content - the contents to load
+	 * @param resolver - the URIResolver to use for locating any referenced resources
+	 * @return a structured document with the correct parsing setup for the
+	 *         given filename, or null if one could not be created
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
+	 */
 	IStructuredDocument createStructuredDocumentFor(String filename, String content, URIResolver resolver) throws IOException;
 
 	/**
-	 * Conveience method. It depends on the loaders newModel method to return
-	 * an appropriate StrucuturedModel appropriately initialized.
+	 * Creates and returns an unmanaged model populated with the given IFile's
+	 * contents
+	 * 
+	 * @param iFile
+	 * @return a structured model, or null if one could not be created
+	 * @throws CoreException if the file's contents or description can not be read
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
 	 */
 	IStructuredModel createUnManagedStructuredModelFor(IFile iFile) throws IOException, CoreException;
 
 	/**
-	 * Conveience method. It depends on the loaders newModel method to return
+	 * Convenience method. It depends on the loader's newModel method to return
 	 * an appropriate StrucuturedModel appropriately initialized.
+	 * 
+	 * @param contentTypeId
+	 * @return a structured model for the given content type, or null if one could not be created or the content type is unsupported
 	 */
 	IStructuredModel createUnManagedStructuredModelFor(String contentTypeId);
 
+	/**
+	 * @deprecated
+	 */
 	IStructuredModel createUnManagedStructuredModelFor(String contentTypeId, URIResolver resolver);
 
 	/**
-	 * Note: users of this 'model' must still release it when finished.
-	 * Returns null if there's not a model corresponding to document.
+	 * Note: callers of this method must still release the model when finished.
+	 * 
+	 * @param document
+	 * @return the structured model containing the give document, incrementing
+	 *         its edit count, or null if there is not a model corresponding
+	 *         to this document.
 	 */
 	IStructuredModel getExistingModelForEdit(IDocument document);
 
-	public IStructuredModel getExistingModelForEdit(IFile iFile);
+	/**
+	 * @param file
+	 * @return the structured model for the given file, incrementing its edit
+	 *         count, or null if one does not already exist for this file.
+	 */
+	IStructuredModel getExistingModelForEdit(IFile file);
 
 	/**
-	 * This is similar to the getModel method, except this method does not
-	 * create a model. This method does increment the reference count (if it
-	 * exists). If the model does not already exist in the cache of models,
-	 * null is returned.
+	 * @param id
+	 * @return the structured model with the given ID, incrementing its edit
+	 *         count, or null if one does not already exist for this ID
 	 */
 	public IStructuredModel getExistingModelForEdit(Object id);
 
 	/**
-	 * Note: users of this 'model' must still release it when finished.
-	 * Returns null if there's not a model corresponding to document.
+	 * Note: callers of this method must still release the model when finished.
+	 * 
+	 * @param document
+	 * @return the structured model containing the give document, incrementing
+	 *         its read count, or null if there is not a model corresponding
+	 *         to this document.
 	 */
 	IStructuredModel getExistingModelForRead(IDocument document);
 
+	/**
+	 * @param file
+	 * @return the structured model for the given file, incrementing its read
+	 *         count, or null if one does not already exist for this file.
+	 */
 	public IStructuredModel getExistingModelForRead(IFile iFile);
 
 	/**
-	 * This is similar to the getModel method, except this method does not
-	 * create a model. This method does increment the reference count (if it
-	 * exists). If the model does not already exist in the cache of models,
-	 * null is returned.
+	 * @param id
+	 * @return the structured model with the given ID, incrementing its edit
+	 *         count, or null if one does not already exist for this ID
 	 */
 	public IStructuredModel getExistingModelForRead(Object id);
 
+	/**
+	 * @deprecated - internal information
+	 */
 	public Enumeration getExistingModelIds();
 
+	/**
+	 * Returns a structured model for the given file. If one does not already
+	 * exists, one will be created with an edit count of 1. If one already
+	 * exists, its edit count will be incremented before it is returned.
+	 * 
+	 * @param iFile
+	 * @return a structured model for the given file, or null if one could not
+	 *         be found or created
+	 * @throws CoreException if the file's contents or description can not be read
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
+	 */
 	public IStructuredModel getModelForEdit(IFile iFile) throws IOException, CoreException;
 
-	/*
-	 * @deprecated - encoding is handled automatically
+	/**
+	 * Returns a structured model for the given file. If one does not already
+	 * exists, one will be created with an edit count of 1. If one already
+	 * exists, its edit count will be incremented before it is returned.
+	 * 
+	 * @param iFile
+	 * @param encodingRule the rule for handling encoding
+	 * @return a structured model for the given file, or null if one could not
+	 *         be found or created
+	 * @throws CoreException if the file's contents or description can not be read
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
+	 * @deprecated - encoding is handled automatically based on the file's
+	 *             contents or user preferences
 	 */
 	public IStructuredModel getModelForEdit(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException;
 
+	/**
+	 * @deprecated - Encoding and the line delimiter used are handled
+	 *             automatically based on the file's contents or user
+	 *             preferences.
+	 */
 	public IStructuredModel getModelForEdit(IFile iFile, String encoding, String lineDelimiter) throws UnsupportedEncodingException, IOException, CoreException;
 
+	/**
+	 * Returns a structured model for the given document. If one does not
+	 * already exists, one will be created with an edit count of 1. If one
+	 * already exists, its edit count will be incremented before it is
+	 * returned. This method is intended only to interact with documents
+	 * contained within File Buffers.
+	 * 
+	 * @param textFileBufferDocument
+	 * @return a structured model for the given document, or null if there is
+	 *         insufficient information known about the document instance to
+	 *         do so
+	 */
 	public IStructuredModel getModelForEdit(IStructuredDocument textFileBufferDocument);
 
-	/*
+	/**
+	 * Returns a structured model for the given contents using the given ID.
+	 * If one does not already exist, one will be created with an edit count
+	 * of 1. If one already exists, its edit count will be incremented before
+	 * it is returned.
+	 * 
+	 * @param id
+	 *            - the id for the model
+	 * @param inStream
+	 *            - the initial contents of the model
+	 * @param resolver
+	 *            - the URIResolver to use for locating any needed resources
+	 * @return a structured model for the given content, or null if one could
+	 *         not be found or created
+	 * @throws UnsupportedEncodingException
+	 * @throws IOException
+	 *             if the contents can not be read or its detected encoding
+	 *             does not support its contents
 	 * @deprecated - a URI resolver should be automatically created when
 	 *             needed
 	 */
 	public IStructuredModel getModelForEdit(String id, InputStream inStream, URIResolver resolver) throws UnsupportedEncodingException, IOException;
 
+	/**
+	 * Returns a structured model for the given file. If one does not already
+	 * exists, one will be created with a read count of 1. If one already
+	 * exists, its read count will be incremented before it is returned.
+	 * 
+	 * @param iFile
+	 * @return a structured model for the given file, or null if one could not
+	 *         be found or created
+	 * @throws CoreException if the file's contents or description can not be read
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
+	 */
 	public IStructuredModel getModelForRead(IFile iFile) throws IOException, CoreException;
 
-	/*
-	 * @deprecated - encoding is handled automatically
+	/**
+	 * @deprecated - encoding is handled automatically based on the file's
+	 *             contents or user preferences
 	 */
 	public IStructuredModel getModelForRead(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException;
 
-	/*
-	 * @deprecated - encoding and line delimiters are handled automatically
+	/**
+	 * @deprecated - Encoding and the line delimiter used are handled
+	 *             automatically based on the file's contents or user
+	 *             preferences.
 	 */
 	public IStructuredModel getModelForRead(IFile iFile, String encoding, String lineDelimiter) throws UnsupportedEncodingException, IOException, CoreException;
 
+	/**
+	 * Returns a structured model for the given document. If one does not
+	 * already exists, one will be created with a read count of 1. If one
+	 * already exists, its read count will be incremented before it is
+	 * returned. This method is intended only to interact with documents
+	 * contained within File Buffers.
+	 * 
+	 * @param textFileBufferDocument
+	 * @return a structured model for the given document, or null if there is
+	 *         insufficient information known about the document instance to
+	 *         do so
+	 */
 	public IStructuredModel getModelForRead(IStructuredDocument textFileBufferDocument);
 
-	/*
+	/**
+	 * Returns a structured model for the given contents using the given ID.
+	 * If one does not already exist, one will be created with an read count
+	 * of 1. If one already exists, its read count will be incremented before
+	 * it is returned.
+	 * 
+	 * @param id
+	 *            - the id for the model
+	 * @param inStream
+	 *            - the initial contents of the model
+	 * @param resolver
+	 *            - the URIResolver to use for locating any needed resources
+	 * @return a structured model for the given content, or null if one could
+	 *         not be found or created
+	 * @throws UnsupportedEncodingException
+	 * @throws IOException
+	 *             if the contents can not be read or its detected encoding
+	 *             does not support its contents
 	 * @deprecated - a URI resolver should be automatically created when
 	 *             needed
 	 */
@@ -187,6 +412,14 @@
 	 * force is false. The idea is that a client should call this method once
 	 * with force set to false. If the exception is thrown, then prompt client
 	 * if they want to overwrite.
+	 * 
+	 * @param iFile
+	 * @param force
+	 * @return the new structured model, or 
+	 * @throws ResourceInUse if the given new ID is already in use by a managed model
+	 * @throws CoreException if the file's contents or description can not be read
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
+	 * @throws ResourceAlreadyExists if the give file already exists
 	 */
 	IStructuredModel getNewModelForEdit(IFile iFile, boolean force) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException;
 
@@ -195,36 +428,44 @@
 	 * force is false. The idea is that a client should call this method once
 	 * with force set to false. If the exception is thrown, then prompt client
 	 * if they want to overwrite.
+	 * 
+	 * @param iFile
+	 * @param force
+	 * @return the new structured model, or 
+	 * @throws ResourceInUse if the given new ID is already in use by a managed model
+	 * @throws CoreException if the file's contents or description can not be read
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
+	 * @throws ResourceAlreadyExists if the give file already exists
 	 */
 	IStructuredModel getNewModelForRead(IFile iFile, boolean force) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException;
 
 	/**
-	 * This function returns the reference count of underlying model.
+	 * This function returns the combined "read" and "edit" reference counts
+	 * of underlying model.
 	 * 
 	 * @param id
-	 *            Object The id of the model TODO: try to refine the design
-	 *            not to use this function
-	 * @deprecated
+	 *            Object The id of the model
+	 * @deprecated - internal information that can be obtained from the model
+	 *             itself
 	 */
 	int getReferenceCount(Object id);
 
 	/**
-	 * This function returns the reference count of underlying model.
+	 * This function returns the "edit" reference count of underlying model.
 	 * 
 	 * @param id
-	 *            Object The id of the model TODO: try to refine the design
-	 *            not to use this function
-	 * @deprecated
+	 *            Object The id of the model
+	 * @deprecated - internal information that can be obtained from the model itself
 	 */
 	int getReferenceCountForEdit(Object id);
 
 	/**
-	 * This function returns the reference count of underlying model.
+	 * This function returns the "read" reference count of underlying model.
 	 * 
 	 * @param id
 	 *            Object The id of the model TODO: try to refine the design
 	 *            not to use this function
-	 * @deprecated
+	 * @deprecated - internal information that can be obtained from the model itself
 	 */
 	int getReferenceCountForRead(Object id);
 
@@ -238,7 +479,7 @@
 	boolean isShared(Object id);
 
 	/**
-	 * This function returns true if there are other references to the
+	 * This function returns true if there are other "edit" references to the
 	 * underlying model.
 	 * 
 	 * @param id
@@ -247,7 +488,7 @@
 	boolean isSharedForEdit(Object id);
 
 	/**
-	 * This function returns true if there are other references to the
+	 * This function returns true if there are other "read" references to the
 	 * underlying model.
 	 * 
 	 * @param id
@@ -256,13 +497,17 @@
 	boolean isSharedForRead(Object id);
 
 	/**
+	 * @deprecated - not granular enough
+	 * 
 	 * This method can be called to determine if the model manager is within a
 	 * "aboutToChange" and "changed" sequence.
 	 */
 	public boolean isStateChanging();
 
 	/**
-	 * This method changes the id of the model. TODO: try to refine the design
+	 * This method changes the id of the model. 
+	 * 
+	 * TODO: try to refine the design
 	 * not to use this function
 	 * 
 	 * @deprecated
@@ -270,7 +515,7 @@
 	void moveModel(Object oldId, Object newId);
 
 	/**
-	 * This method can be called when the content type of a model changes. Its
+	 * This method can be called when the content type of a model changes. It's
 	 * assumed the contentType has already been changed, and this method uses
 	 * the text of the old one, to repopulate the text of the new one. In
 	 * theory, the actual instance could change, (e.g. using 'saveAs' to go
@@ -292,6 +537,18 @@
 	 */
 	IStructuredModel reloadModel(Object id, InputStream inStream) throws UnsupportedEncodingException;
 
+	/**
+	 * Saves the contents of the given structured document to the given file. If
+	 * the document belongs to a managed model, that model will be saved and
+	 * marked as non-dirty.
+	 * 
+	 * @param structuredDocument
+	 *            - the structured document
+	 * @param iFile
+	 *            - the file to save to
+	 * @throws UnsupportedEncodingException
+	 * @throws CoreException if the file's contents or description can not be read
+	 * @throws IOException if the file's contents can not be read or its detected encoding does not support its contents
+	 */
 	void saveStructuredDocument(IStructuredDocument structuredDocument, IFile iFile) throws UnsupportedEncodingException, IOException, CoreException;
-
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeNotifier.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeNotifier.java
index 88d1888..a76fe75 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeNotifier.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeNotifier.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -55,9 +55,9 @@
 
 
 	/**
-	 * NOT API: these strings are for printing, such as during debuging
+	 * NOT API: these strings are for printing, such as during debugging
 	 */
-	static final String[] EVENT_TYPE_STRINGS = new String[]{"undefined", "CHANGE", "ADD", "REMOVE", "STRUCUTRED_CHANGED", "CONTENT_CHANGED"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+	static final String[] EVENT_TYPE_STRINGS = new String[]{"undefined", "CHANGE", "ADD", "REMOVE", "STRUCTURE_CHANGED", "CONTENT_CHANGED"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
 
 
 	/**
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IStructuredModel.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IStructuredModel.java
index 7370e92..5d67830 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IStructuredModel.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IStructuredModel.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -36,15 +36,11 @@
  * implementers. The main purposed of this abstraction is to provide a common
  * means to manage models that have an associated structured document.
  * 
- * @plannedfor 2.0
- * 
  * <p>
- * ISSUE: this interface needs ton of cleanup!
+ * TODO: this interface needs ton of cleanup!
  * </p>
  * 
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
+ * @noimplement This interface is not intended to be implemented by clients.
  */
 public interface IStructuredModel extends IAdaptable {
 
@@ -123,16 +119,25 @@
 
 	/**
 	 * @deprecated
+	 * @see IModelManager#copyModelForEdit(String, String)
 	 */
 	IStructuredModel copy(String id) throws ResourceInUse, ResourceAlreadyExists;
 
 	/**
 	 * Disable undo management.
+	 * 
+	 * @deprecated - the ability to enable and disable Undo management for the
+	 *             model cannot be guaranteed as it implicitly requires
+	 *             knowledge of the underlying undo/redo implementation
 	 */
 	void disableUndoManagement();
 
 	/**
 	 * Enable undo management.
+	 * 
+	 * @deprecated - the ability to enable and disable Undo management for the
+	 *             model cannot be guaranteed as it implicitly requires
+	 *             knowledge of the underlying undo/redo implementation
 	 */
 	void enableUndoManagement();
 
@@ -156,6 +161,10 @@
 
 	/**
 	 * @return The associated content type identifier (String) for this model.
+	 *         This value may be more accurate than the content type against
+	 *         which the model handler was registered.
+	 *         
+	 *         @see IModelHandler#getAssociatedContentTypeId()
 	 */
 	String getContentTypeIdentifier();
 
@@ -178,6 +187,9 @@
 	 */
 	IndexedRegion getIndexedRegion(int offset);
 
+	/**
+	 * @return the model's handler
+	 */
 	IModelHandler getModelHandler();
 
 	IModelManager getModelManager();
@@ -215,7 +227,7 @@
 	/**
 	 * Get URI resolution helper
 	 * 
-	 * @deprecated
+	 * @deprecated - use org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin.createResolver(*) instead
 	 */
 	URIResolver getResolver();
 
@@ -338,10 +350,16 @@
 
 	void save() throws UnsupportedEncodingException, IOException, CoreException;
 
+	/**
+	 * @deprecated - will save according to the encoding priorities specified for the IFile 
+	 */
 	void save(EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException;
 
 	void save(IFile iFile) throws UnsupportedEncodingException, IOException, CoreException;
 
+	/**
+	 * @deprecated - will save according to the encoding priorities specified for the IFile 
+	 */
 	void save(IFile iFile, EncodingRule encodingRule) throws UnsupportedEncodingException, IOException, CoreException;
 
 	void save(OutputStream outputStream) throws UnsupportedEncodingException, IOException, CoreException;
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IndexedRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IndexedRegion.java
index bf9b7bc..a9e9538 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IndexedRegion.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IndexedRegion.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -32,7 +32,7 @@
  * original source. They currently often do, so thought I'd mention explicitly
  * this may not always be true.
  * 
- * @plannedfor 1.0
+ * @noimplement This interface is not intended to be implemented by clients.
  */
 public interface IndexedRegion {
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/StructuredModelManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/StructuredModelManager.java
index a136922..baebc44 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/StructuredModelManager.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/StructuredModelManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -39,7 +39,7 @@
 	 * @return IModelManager - returns the one model manager for structured
 	 *         model
 	 * @deprecated - use the one that is in
-	 *             org.eclipse.wst.sse.core.SttructuredModelManager
+	 *             org.eclipse.wst.sse.core.StructuredModelManager
 	 */
 	public static IModelManager getModelManager() {
 		boolean isReady = false;
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IStructuredDocumentProposed.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IStructuredDocumentProposed.java
index 39832af..0c0f47d 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IStructuredDocumentProposed.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IStructuredDocumentProposed.java
@@ -32,7 +32,7 @@
  * 
  * Clients should not implement.
  * 
- * @plannedfor 1.0
+ * @deprecated - was never used
  */
 public interface IStructuredDocumentProposed extends IDocument, IDocumentExtension, IAdaptable {
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentRegionsReplacedEvent.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentRegionsReplacedEvent.java
index 6942bf7..8f08b88 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentRegionsReplacedEvent.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentRegionsReplacedEvent.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -29,6 +29,8 @@
 	private IStructuredDocumentRegionList fNewStructuredDocumentRegions;
 	private IStructuredDocumentRegionList fOldStructuredDocumentRegions;
 
+	private boolean fIsEntireDocumentReplaced;
+
 	/**
 	 * Creates an instance of StructuredDocumentRegionsReplacedEvent
 	 * 
@@ -53,6 +55,11 @@
 		fNewStructuredDocumentRegions = newStructuredDocumentRegions;
 	}
 
+	public StructuredDocumentRegionsReplacedEvent(IStructuredDocument document, Object originalRequester, IStructuredDocumentRegionList oldStructuredDocumentRegions, IStructuredDocumentRegionList newStructuredDocumentRegions, String changes, int offset, int lengthToReplace, boolean entireDocumentReplaced) {
+		this(document, originalRequester, oldStructuredDocumentRegions, newStructuredDocumentRegions, changes, offset, lengthToReplace);
+		fIsEntireDocumentReplaced = entireDocumentReplaced;
+	}
+
 	/**
 	 * Returns the new structured document regions.
 	 * 
@@ -70,4 +77,8 @@
 	public IStructuredDocumentRegionList getOldStructuredDocumentRegions() {
 		return fOldStructuredDocumentRegions;
 	}
+
+	public boolean isEntireDocumentReplaced() {
+		return fIsEntireDocumentReplaced;
+	}
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceAlreadyExists.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceAlreadyExists.java
index a796e90..79ff0e6 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceAlreadyExists.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceAlreadyExists.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,6 +14,10 @@
 
 
 
+/**
+ * Indicates that a Resource which a model or document was expected to create
+ * already exists.
+ */
 public class ResourceAlreadyExists extends Exception {
 
 	/**
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceInUse.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceInUse.java
index e4f1ac1..5ecbfad 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceInUse.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceInUse.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,6 +14,9 @@
 
 
 
+/**
+ * Indicates that a model with a particular ID already exists
+ */
 public class ResourceInUse extends Exception {
 
 	/**
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionList.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionList.java
index c0e46d6..594d3e8 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionList.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionList.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -37,7 +37,7 @@
 	 * 
 	 * @param insertPos
 	 * @param newRegions
-	 * @return
+	 * @return whether the contents of this list were modified
 	 */
 	public boolean addAll(int insertPos, ITextRegionList newRegions);
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java
index 3452d7a..6cafd4d 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,6 +9,9 @@
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
  *     Jesper Steen Møller - initial IDocumentExtension4 support - #102822
+ *                           (see also #239115)
+ *     David Carver (Intalio) - bug 300434 - Make inner classes static where possible
+ *     David Carver (Intalio) - bug 300443 - some constants aren't static final
  *     
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.text;
@@ -21,7 +24,9 @@
 import java.util.List;
 import java.util.Map;
 
+import org.eclipse.core.runtime.ISafeRunnable;
 import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.SafeRunner;
 import org.eclipse.core.runtime.preferences.IScopeContext;
 import org.eclipse.core.runtime.preferences.InstanceScope;
 import org.eclipse.jface.text.BadLocationException;
@@ -54,7 +59,6 @@
 import org.eclipse.jface.text.ITextStore;
 import org.eclipse.jface.text.ITypedRegion;
 import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.SequentialRewriteTextStore;
 import org.eclipse.jface.text.TypedRegion;
 import org.eclipse.wst.sse.core.internal.Logger;
 import org.eclipse.wst.sse.core.internal.document.StructuredDocumentFactory;
@@ -103,7 +107,7 @@
 		// jobs -- found not to be a good assumption. See below.
 		private List cachedRegionPositionArray = Collections.synchronizedList(new ArrayList());
 		private final boolean DEBUG = false;
-		private final int MAX_SIZE = 50;
+		private static final int MAX_SIZE = 50;
 
 
 		private ThreadLocal threadLocalCachePosition = new ThreadLocal();
@@ -184,11 +188,6 @@
 			return region;
 		}
 
-		// TODO: make privite if used, else delete
-		void set(int pos, IStructuredDocumentRegion region) {
-			cachedRegionPositionArray.set(pos, region);
-		}
-
 		void set(IStructuredDocumentRegion region) {
 			try {
 				int pos = getThreadLocalPosition();
@@ -226,7 +225,7 @@
 		}
 	}
 
-	class RegisteredReplace {
+	static class RegisteredReplace {
 		/** The owner of this replace operation. */
 		IDocumentListener fOwner;
 		/** The replace operation */
@@ -268,7 +267,7 @@
 	private IStructuredDocumentRegion cachedDocumentRegion;
 	private EncodingMemento encodingMemento;
 	private boolean fAcceptPostNotificationReplaces = true;
-	private CurrentDocumentRegionCache fCurrentDocumnetRegionCache;
+	private CurrentDocumentRegionCache fCurrentDocumentRegionCache;
 	private DocumentEvent fDocumentEvent;
 	private IDocumentListener[] fDocumentListeners;
 
@@ -306,7 +305,7 @@
 	 * user's preference is usually to be internally consistent.
 	 */
 	private String fInitialLineDelimiter;
-	private final String READ_ONLY_REGIONS_CATEGORY = "_READ_ONLY_REGIONS_CATEGORY_"; //$NON-NLS-1$
+	private static final String READ_ONLY_REGIONS_CATEGORY = "_READ_ONLY_REGIONS_CATEGORY_"; //$NON-NLS-1$
 	/**
 	 * Current rewrite session, or none if not presently rewriting.
 	 */
@@ -334,8 +333,8 @@
 
 	public BasicStructuredDocument() {
 		super();
-		fCurrentDocumnetRegionCache = new CurrentDocumentRegionCache();
-		fStore = new StructuredDocumentTextStore(50, 300);
+		fCurrentDocumentRegionCache = new CurrentDocumentRegionCache();
+		setTextStore(new StructuredDocumentTextStore(50, 300));
 		setLineTracker(new DefaultLineTracker());
 		NULL_DOCUMENT_EVENT = new NullDocumentEvent();
 
@@ -458,7 +457,6 @@
 						((IDocumentListener) holdListeners[i]).documentChanged(NULL_DOCUMENT_EVENT);
 					}
 					else {
-						fDocumentEvent.fModificationStamp = getModificationStamp();
 						((IDocumentListener) holdListeners[i]).documentChanged(fDocumentEvent);
 					}
 				}
@@ -1261,7 +1259,7 @@
 	IStructuredDocumentRegion getCachedDocumentRegion() {
 		IStructuredDocumentRegion result = null;
 		if (USE_LOCAL_THREAD) {
-			result = fCurrentDocumnetRegionCache.get();
+			result = fCurrentDocumentRegionCache.get();
 		}
 		else {
 			result = cachedDocumentRegion;
@@ -1807,7 +1805,6 @@
 	}
 
 	private ITextStore getStore() {
-		Assert.isNotNull(fStore);
 		return fStore;
 	}
 
@@ -1823,7 +1820,6 @@
 	 * @return the document's line tracker
 	 */
 	private ILineTracker getTracker() {
-		Assert.isNotNull(fTracker);
 		return fTracker;
 	}
 
@@ -1894,9 +1890,11 @@
 	 * @param start
 	 * @param replacementLength
 	 * @param changes
+	 * @param modificationStamp
+	 * @param ignoreReadOnlySettings
 	 * @return
 	 */
-	private StructuredDocumentEvent internalReplaceText(Object requester, int start, int replacementLength, String changes, boolean ignoreReadOnlySettings) {
+	private StructuredDocumentEvent internalReplaceText(Object requester, int start, int replacementLength, String changes, long modificationStamp, boolean ignoreReadOnlySettings) {
 		StructuredDocumentEvent result = null;
 
 		stopPostNotificationProcessing();
@@ -1944,12 +1942,14 @@
 			// fireStructuredDocumentEvent must be called in order to end
 			// documentAboutToBeChanged state
 
+
 			// increment modification stamp if modifications were made
 			if (result != null && !(result instanceof NoChangeEvent)) {
-				fModificationStamp++;
+				fModificationStamp= modificationStamp;
 				fNextModificationStamp= Math.max(fModificationStamp, fNextModificationStamp);
+				fDocumentEvent.fModificationStamp = fModificationStamp;
 			}
-
+				
 			if (result == null) {
 				// result should not be null, but if an exception was thrown,
 				// it will be
@@ -1996,6 +1996,7 @@
 					}
 				}
 			}
+
 			if (Debug.perfTest || Debug.perfTestStructuredDocumentOnly) {
 				long stopStreamTime = System.currentTimeMillis();
 				System.out.println("\n\t\t\t\t Total Time for IStructuredDocument event signaling/processing in replaceText: " + (stopStreamTime - startStreamTime)); //$NON-NLS-1$
@@ -2332,8 +2333,9 @@
 		stopPostNotificationProcessing();
 		clearReadOnly();
 
-		acquireLock();
 		try {
+			acquireLock();
+
 			CharSequenceReader subSetTextStoreReader = new CharSequenceReader((CharSequence) getStore(), 0, getStore().getLength());
 			resetParser(subSetTextStoreReader, 0);
 			//
@@ -2355,11 +2357,11 @@
 	 * @exception BadLocationException
 	 *                If position is not a valid range in the document
 	 */
-	public void replace(int pos, int length, String string) throws BadLocationException {
+	public void replace(int offset, int length, String text) throws BadLocationException {
 		if (Debug.displayWarnings) {
 			System.out.println("Note: IStructuredDocument::replace(int, int, String) .... its better to use replaceText(source, string, int, int) API for structuredDocument updates"); //$NON-NLS-1$
 		}
-		replaceText(this, pos, length, string);
+		replaceText(this, offset, length, text);
 	}
 
 	/**
@@ -2367,13 +2369,13 @@
 	 * length of "replaceLength".
 	 * <p>
 	 * 
-	 * @param start
+	 * @param pos
 	 *            start offset of text to replace None of the offsets include
 	 *            delimiters of preceeding lines. Offset 0 is the first
 	 *            character of the document.
-	 * @param replaceLength
+	 * @param length
 	 *            start offset of text to replace
-	 * @param newText
+	 * @param text
 	 *            start offset of text to replace
 	 *            <p>
 	 *            Implementors have to notify TextChanged listeners after the
@@ -2395,8 +2397,11 @@
 	/**
 	 * One of the APIs to manipulate the IStructuredDocument in terms of text.
 	 */
-	public StructuredDocumentEvent replaceText(Object requester, int start, int replacementLength, String changes) {
-		return replaceText(requester, start, replacementLength, changes, false);
+	public StructuredDocumentEvent replaceText(Object requester, int pos, int length, String text) {
+		if (length == 0 && (text == null || text.length() == 0))
+			return replaceText(requester, pos, length, text, getModificationStamp(), true);
+		else
+			return replaceText(requester, pos, length, text, getNextModificationStamp(), true);
 	}
 
 	public StructuredDocumentEvent replaceText(Object requester, int start, int replacementLength, String changes, boolean ignoreReadOnlySettings) {
@@ -2407,13 +2412,11 @@
 		else
 			modificationStamp = getNextModificationStamp();
 		
-		return replaceText(requester, start, replacementLength, changes, ignoreReadOnlySettings, modificationStamp);
+		return replaceText(requester, start, replacementLength, changes, modificationStamp, ignoreReadOnlySettings);
 	}
 	
-	private StructuredDocumentEvent replaceText(Object requester, int start, int replacementLength, String changes, boolean ignoreReadOnlySettings, long modificationStamp) {
-		StructuredDocumentEvent event = internalReplaceText(requester, start, replacementLength, changes, ignoreReadOnlySettings);
-		fModificationStamp = modificationStamp;
-		fNextModificationStamp= Math.max(fModificationStamp, fNextModificationStamp);
+	private StructuredDocumentEvent replaceText(Object requester, int start, int replacementLength, String changes, long modificationStamp, boolean ignoreReadOnlySettings) {
+		StructuredDocumentEvent event = internalReplaceText(requester, start, replacementLength, changes, modificationStamp, ignoreReadOnlySettings);
 		return event;
 	}
 
@@ -2484,7 +2487,7 @@
 	 */
 	public void setCachedDocumentRegion(IStructuredDocumentRegion structuredRegion) {
 		if (USE_LOCAL_THREAD) {
-			fCurrentDocumnetRegionCache.set(structuredRegion);
+			fCurrentDocumentRegionCache.set(structuredRegion);
 		}
 		else {
 			cachedDocumentRegion = structuredRegion;
@@ -2568,6 +2571,7 @@
 	 *            the document's line tracker
 	 */
 	private void setLineTracker(ILineTracker tracker) {
+		Assert.isNotNull(tracker);
 		fTracker = tracker;
 	}
 
@@ -2599,9 +2603,7 @@
 	 */
 	public StructuredDocumentEvent setText(Object requester, String theString) {
 		StructuredDocumentEvent result = null;
-
-		result = replaceText(requester, 0, getLength(), theString, true, getNextModificationStamp());
-
+		result = replaceText(requester, 0, getLength(), theString, getNextModificationStamp(), true);
 		return result;
 	}
 
@@ -2613,6 +2615,7 @@
 	 *            the document's text store
 	 */
 	private void setTextStore(ITextStore store) {
+		Assert.isNotNull(store);
 		fStore = store;
 	}
 
@@ -2630,9 +2633,10 @@
 	}
 
 
+	/*
+	 * {@inheritDoc}
+	 */
 	public void startSequentialRewrite(boolean normalized) {
-		ITextStore store = new SequentialRewriteTextStore(getStore());
-		setTextStore(store);
 	}
 
 	/*
@@ -2645,13 +2649,10 @@
 	}
 
 
+	/*
+	 * {@inheritDoc}
+	 */
 	public void stopSequentialRewrite() {
-		if (getStore() instanceof SequentialRewriteTextStore) {
-			SequentialRewriteTextStore srws = (SequentialRewriteTextStore) getStore();
-			ITextStore source = srws.getSourceStore();
-			setTextStore(source);
-			srws.dispose();
-		}
 	}
 
 	/*
@@ -2739,7 +2740,7 @@
 	 * Class which implements the rewritable session for the SSE.
 	 * 
 	 */
-	class StructuredDocumentRewriteSession extends DocumentRewriteSession {
+	static class StructuredDocumentRewriteSession extends DocumentRewriteSession {
 
 		/**
 		 * Creates a new session.
@@ -2840,9 +2841,9 @@
 				extension.stopRewriteSession(session, get());
 			}
 
+			fActiveRewriteSession = null;
 			DocumentRewriteSessionEvent event = new DocumentRewriteSessionEvent(this, session, DocumentRewriteSessionEvent.SESSION_STOP);
 			fireDocumentRewriteSessionEvent(event);
-			fActiveRewriteSession = null;
 		}
 	}
 
@@ -2916,7 +2917,7 @@
 	 *      java.lang.String, long)
 	 */
 	public void replace(int offset, int length, String text, long modificationStamp) throws BadLocationException {
-		replaceText(this, offset, length, text, false, modificationStamp);
+		replaceText(this, offset, length, text, modificationStamp, true);
 	}
 
 	/*
@@ -2927,7 +2928,7 @@
 	 */
 	public void set(String text, long modificationStamp) {
 		// bug 151069 - overwrite read only regions when setting entire document
-		 replaceText(null, 0, getLength(), text, true, modificationStamp);
+		 replaceText(null, 0, getLength(), text, modificationStamp, true);
 	}
 
 	/*
@@ -2954,15 +2955,21 @@
 	 * @param event
 	 *            The event to fire, either a start or stop event.
 	 */
-	private void fireDocumentRewriteSessionEvent(DocumentRewriteSessionEvent event) {
+	private void fireDocumentRewriteSessionEvent(final DocumentRewriteSessionEvent event) {
 		if (fDocumentRewriteSessionListeners == null || fDocumentRewriteSessionListeners.size() == 0)
 			return;
 
-		List list = new ArrayList(fDocumentRewriteSessionListeners);
-		Iterator e = list.iterator();
-		while (e.hasNext()) {
-			IDocumentRewriteSessionListener l = (IDocumentRewriteSessionListener) e.next();
-			l.documentRewriteSessionChanged(event);
+		Object[] listeners = fDocumentRewriteSessionListeners.toArray();
+		for (int i = 0; i < listeners.length; i++) {
+			final IDocumentRewriteSessionListener l = (IDocumentRewriteSessionListener) listeners[i];
+			SafeRunner.run(new ISafeRunnable() {
+				public void run() throws Exception {
+					l.documentRewriteSessionChanged(event);
+				}
+				public void handleException(Throwable exception) {
+					// logged for us
+				}
+			});
 		}
 	}
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocumentRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocumentRegion.java
index e93af09..7fba9b3 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocumentRegion.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocumentRegion.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,8 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (Intalio) - bug 300430 - String concatenation
+ *     David Carver (Intalio) - bug 300427 - Comparison of String Objects == or !=
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.text;
 
@@ -32,17 +33,22 @@
 	private static final String UNDEFINED = "org.eclipse.wst.sse.core.structuredDocument.UNDEFINED"; //$NON-NLS-1$
 
 	private ITextRegionList _regions;
-	private boolean fIsDeleted = false;
-	// private String fType;
+	/**
+	 * has this region been removed from its document
+	 */
+	private static final byte MASK_IS_DELETED = 1;
+	/**
+	 * was this region terminated normally
+	 */
+	private static final byte MASK_IS_ENDED = 1 << 1;
+
+	private byte fIsDeletedOrEnded = 0;
+
 	/**
 	 * allow a pointer back to this nodes model
 	 */
 	private IStructuredDocument fParentDocument;
-	/**
-	 * was this node terminated normally
-	 */
-	// 0 == false, 1 == true
-	private byte hasEnd = 0;
+	
 	protected int fLength;
 	private IStructuredDocumentRegion next = null;
 	private IStructuredDocumentRegion previous = null;
@@ -158,11 +164,13 @@
 		ITextRegion region = null;
 		String result = ""; //$NON-NLS-1$
 		int length = getRegions().size();
+		StringBuffer sb = new StringBuffer(result);
 		for (int i = 0; i < length; i++) {
 			region = getRegions().get(i);
-			if (region.getType() == context)
-				result += getFullText(region);
+			if (region.getType().equals(context))
+				sb.append(getFullText(region));
 		}
+		result = sb.toString();
 		return result;
 	}
 
@@ -197,16 +205,27 @@
 	 * The parameter offset refers to the overall offset in the document.
 	 */
 	public ITextRegion getRegionAtCharacterOffset(int offset) {
-		ITextRegion result = null;
 		if (_getRegions() != null) {
+			int thisStartOffset = getStartOffset();
+			if (offset < thisStartOffset)
+				return null;
+			int thisEndOffset = getStartOffset() + getLength();
+			if (offset > thisEndOffset)
+				return null;
 			// transform the requested offset to the "scale" that
 			// regions are stored in, which are all relative to the
 			// start point.
 			// int transformedOffset = offset - getStartOffset();
 			//
-			int length = getRegions().size();
-			for (int i = 0; i < length; i++) {
-				ITextRegion region = getRegions().get(i);
+			ITextRegionList regions = getRegions();
+			int length = regions.size();
+			int low = 0;
+			int high = length;
+			int mid = 0;
+			// Binary search for the region
+			while (low < high) {
+				mid = low + ((high - low) >> 1);
+				ITextRegion region = regions.get(mid);
 				if (Debug.debugStructuredDocument) {
 					System.out.println("region(s) in IStructuredDocumentRegion::getRegionAtCharacterOffset: " + region); //$NON-NLS-1$
 					System.out.println("       requested offset: " + offset); //$NON-NLS-1$
@@ -218,13 +237,16 @@
 					System.out.println("       region class: " + region.getClass()); //$NON-NLS-1$
 
 				}
-				if ((getStartOffset(region) <= offset) && (offset < getEndOffset(region))) {
-					result = region;
-					break;
-				}
+				// Region is before this one
+				if (offset < region.getStart() + thisStartOffset)
+					high = mid;
+				else if (offset > (region.getEnd() + thisStartOffset - 1))
+					low = mid + 1;
+				else
+					return region;
 			}
 		}
-		return result;
+		return null;
 	}
 
 	public ITextRegionList getRegions() {
@@ -299,7 +321,7 @@
 		int length = getRegions().size();
 		for (int i = 0; i < length; i++) {
 			region = getRegions().get(i);
-			if (region.getType() == context) {
+			if (region.getType().equals(context)) {
 				result = getText(region);
 				break;
 			}
@@ -351,7 +373,7 @@
 	 * @see org.eclipse.wst.sse.core.text.IStructuredDocumentRegion#isDeleted()
 	 */
 	public boolean isDeleted() {
-		return fIsDeleted || (fParentDocument == null);
+		return (fIsDeletedOrEnded & MASK_IS_DELETED) != 0 || (fParentDocument == null);
 	}
 
 	/**
@@ -359,7 +381,7 @@
 	 * @return boolean
 	 */
 	public boolean isEnded() {
-		return (hasEnd == 1);
+		return (fIsDeletedOrEnded & MASK_IS_ENDED) != 0;
 	}
 
 	public boolean sameAs(IStructuredDocumentRegion region, int shift) {
@@ -376,7 +398,7 @@
 				// offset,
 				// since that would decide many cases right away and avoid the
 				// text comparison
-				if (getType() == region.getType()) {
+				if (getType().equals(region.getType())) {
 					if (sameOffsetsAs(region, shift) && sameTextAs(region, shift)) {
 						result = true;
 					}
@@ -401,7 +423,7 @@
 				// offset,
 				// since that would decide many cases right away and avoid the
 				// text comparison
-				if (oldRegion.getType() == newRegion.getType()) {
+				if (oldRegion.getType().equals(newRegion.getType())) {
 					if (sameOffsetsAs(oldRegion, newDocumentRegion, newRegion, shift)) {
 						if (sameTextAs(oldRegion, newDocumentRegion, newRegion, shift)) {
 							result = true;
@@ -464,8 +486,10 @@
 	 * @see org.eclipse.wst.sse.core.text.IStructuredDocumentRegion#setDelete(boolean)
 	 */
 	public void setDeleted(boolean isDeleted) {
-		fIsDeleted = isDeleted;
-
+		if (isDeleted)
+			fIsDeletedOrEnded |= MASK_IS_DELETED;
+		else
+			fIsDeletedOrEnded &= ~MASK_IS_DELETED;
 	}
 
 	/**
@@ -474,12 +498,10 @@
 	 *            boolean
 	 */
 	public void setEnded(boolean newHasEnd) {
-		if (newHasEnd) {
-			hasEnd = 1;
-		}
-		else {
-			hasEnd = 0;
-		}
+		if (newHasEnd)
+			fIsDeletedOrEnded |= MASK_IS_ENDED;
+		else
+			fIsDeletedOrEnded &= ~MASK_IS_ENDED;
 	}
 
 	public void setLength(int newLength) {
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/JobSafeStructuredDocument.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/JobSafeStructuredDocument.java
index 5848016..502b508 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/JobSafeStructuredDocument.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/JobSafeStructuredDocument.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,21 +12,41 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.text;
 
-import org.eclipse.core.runtime.Platform;
+import java.util.Stack;
+
+import org.eclipse.core.runtime.ISafeRunnable;
 import org.eclipse.core.runtime.jobs.ILock;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.DocumentRewriteSession;
 import org.eclipse.jface.text.DocumentRewriteSessionType;
 import org.eclipse.wst.sse.core.internal.IExecutionDelegate;
 import org.eclipse.wst.sse.core.internal.ILockable;
 import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
+import org.eclipse.wst.sse.core.internal.provisional.events.NoChangeEvent;
 import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
 
-
-
+/**
+ * An IStructuredDocument that performs most of its computation and event
+ * notification through an IExecutionDelegate.
+ * 
+ * If the delegate has not been set, we execute on current thread, like
+ * "normal". This is the case for normal non-editor use (which should still,
+ * ultimately, be protected by a scheduling rule). For every operation, a
+ * runnable is created, even if later (in the execution delegate instance) it
+ * is decided nothing special is needed (that is, in fact being called from an
+ * editor's display thread, in which case its just executed) in the UI.
+ */
 public class JobSafeStructuredDocument extends BasicStructuredDocument implements IExecutionDelegatable, ILockable {
 
-	private IExecutionDelegate fExecutionDelegate;
-	private ILock fLockable = Platform.getJobManager().newLock();
+	private static abstract class JobSafeRunnable implements ISafeRunnable {
+		public void handleException(Throwable exception) {
+			// logged in SafeRunner
+		}
+	}
+	
+	private Stack fExecutionDelegates = new Stack();
+	private ILock fLockable = Job.getJobManager().newLock();
 
 	public JobSafeStructuredDocument() {
 		super();
@@ -46,9 +66,11 @@
 	}
 
 	private IExecutionDelegate getExecutionDelegate() {
-		return fExecutionDelegate;
+		if (!fExecutionDelegates.isEmpty())
+			return (IExecutionDelegate) fExecutionDelegates.peek();
+		return null;
 	}
-
+	
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -66,160 +88,137 @@
 	protected final void releaseLock() {
 		getLockObject().release();
 	}
-
+	
 	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.core.text.IStructuredDocument#replaceText(java.lang.Object,
-	 *      int, int, java.lang.String, boolean)
+	 * @see org.eclipse.jface.text.IDocument.replace(int, int, String)
+	 */
+	public void replace(final int offset, final int length, final String text) throws BadLocationException {
+		IExecutionDelegate delegate = getExecutionDelegate();
+		if (delegate == null) {
+			super.replace(offset, length, text);
+		}
+		else {
+			JobSafeRunnable runnable = new JobSafeRunnable() {
+				public void run() throws Exception {
+					JobSafeStructuredDocument.super.replace(offset, length, text);
+				}
+			};
+			delegate.execute(runnable);
+		}
+	}
+	
+	/*
+	 * @see org.eclipse.jface.text.IDocumentExtension4.replace(int, int, String, long)
+	 */
+	public void replace(final int offset, final int length, final String text, final long modificationStamp) throws BadLocationException {
+		IExecutionDelegate delegate = getExecutionDelegate();
+		if (delegate == null) {
+			super.replace(offset, length, text, modificationStamp);
+		}
+		else {
+			JobSafeRunnable runnable = new JobSafeRunnable() {
+				public void run() throws Exception {
+					JobSafeStructuredDocument.super.replace(offset, length, text, modificationStamp);
+				}
+			};
+			delegate.execute(runnable);
+		}
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument#replaceText(java.lang.Object, int, int, java.lang.String)
+	 */
+	public StructuredDocumentEvent replaceText(final Object requester, final int start, final int replacementLength, final String changes) {
+		StructuredDocumentEvent event = null;
+		IExecutionDelegate delegate = getExecutionDelegate();
+		if (delegate == null) {
+			event = super.replaceText(requester, start, replacementLength, changes);
+		}
+		else {
+			final Object[] resultSlot = new Object[1];
+			JobSafeRunnable runnable = new JobSafeRunnable() {
+				public void run() throws Exception {
+					resultSlot[0] = JobSafeStructuredDocument.super.replaceText(requester, start, replacementLength, changes);
+				}
+			};
+			delegate.execute(runnable);
+			event = (StructuredDocumentEvent) resultSlot[0];
+		}
+		return event;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument#replaceText(java.lang.Object, int, int, java.lang.String, boolean)
 	 */
 	public StructuredDocumentEvent replaceText(final Object requester, final int start, final int replacementLength, final String changes, final boolean ignoreReadOnlySettings) {
 		StructuredDocumentEvent event = null;
-		if (getExecutionDelegate() == null) {
-			// if the delegate has not been set, we execute on current
-			// thread, like "normal". This is the case for normal
-			// non-editor
-			// use (which should still, ultimately, be protected by
-			// a scheduling rule).
+		IExecutionDelegate delegate = getExecutionDelegate();
+		if (delegate == null) {
 			event = super.replaceText(requester, start, replacementLength, changes, ignoreReadOnlySettings);
 		}
 		else {
-			// If document is being used by an editor, a runnable is
-			// created,
-			// even if later (in the execution delegate instance) it is
-			// decided
-			// nothing special is needed (that is, in fact being called
-			// from
-			// editor's display thread, in which case its just executed)
 			final Object[] resultSlot = new Object[1];
-			Runnable runnable = new Runnable() {
-				public void run() {
-					try {
-						resultSlot[0] = JobSafeStructuredDocument.super.replaceText(requester, start, replacementLength, changes, ignoreReadOnlySettings);
-					}
-					catch (Throwable e) {
-						resultSlot[0] = e;
-					}
+			JobSafeRunnable runnable = new JobSafeRunnable() {
+				public void run() throws Exception {
+					resultSlot[0] = JobSafeStructuredDocument.super.replaceText(requester, start, replacementLength, changes, ignoreReadOnlySettings);
+				}
+
+				public void handleException(Throwable exception) {
+					resultSlot[0] = new NoChangeEvent(JobSafeStructuredDocument.this, requester, changes, start, replacementLength);
+					super.handleException(exception);
 				}
 			};
-			// strongly assumes synchronous call, to "wait" for
-			// results
-			// basically just routes to Display.synchExec(runnable),
-			// if not already running on display thread.
-			getExecutionDelegate().execute(runnable);
-
-			// this remembering and re-throwing of exception is just to
-			// get an
-			// exception that occurred on one thread, to be thrown on
-			// callers
-			// thread.
-			if (resultSlot[0] instanceof Throwable) {
-				throw new RuntimeException((Throwable) resultSlot[0]);
-			}
-			else {
-				event = (StructuredDocumentEvent) resultSlot[0];
-			}
+			delegate.execute(runnable);
+			event = (StructuredDocumentEvent) resultSlot[0];
 		}
 		return event;
 	}
 
 	public void setExecutionDelegate(IExecutionDelegate delegate) {
-		fExecutionDelegate = delegate;
+		if (delegate != null)
+			fExecutionDelegates.push(delegate);
+		else if (!fExecutionDelegates.isEmpty())
+			fExecutionDelegates.pop();
 	}
 
-
 	public StructuredDocumentEvent setText(final Object requester, final String theString) {
 		StructuredDocumentEvent event = null;
-		if (getExecutionDelegate() == null) {
-			// if the delegate has not been set, we execute on current
-			// thread, like "normal". This is the case for normal
-			// non-editor
-			// use (which should still, ultimately, be protected by
-			// a scheduling rule).
+		IExecutionDelegate executionDelegate = getExecutionDelegate();
+		if (executionDelegate == null) {
 			event = super.setText(requester, theString);
 		}
 		else {
-			// If document is being used by an editor, a runnable is
-			// created,
-			// even if later (in the execution delegate instance) it is
-			// decided
-			// nothing special is needed (that is, in fact being called
-			// from
-			// editor's display thread, in which case its just executed)
 			final Object[] resultSlot = new Object[1];
-			Runnable runnable = new Runnable() {
-				public void run() {
-					try {
-						resultSlot[0] = JobSafeStructuredDocument.super.setText(requester, theString);
-					}
-					catch (Throwable e) {
-						resultSlot[0] = e;
-					}
+			JobSafeRunnable runnable = new JobSafeRunnable() {
+				public void run() throws Exception {
+					resultSlot[0] = JobSafeStructuredDocument.super.setText(requester, theString);
+				}
+				public void handleException(Throwable exception) {
+					resultSlot[0] = new NoChangeEvent(JobSafeStructuredDocument.this, requester, theString, 0, 0);
+					super.handleException(exception);
 				}
 			};
-			// strongly assumes synchronous call, to "wait" for
-			// results
-			// basically just routes to Display.synchExec(runnable),
-			// if not already running on display thread.
-			getExecutionDelegate().execute(runnable);
-
-			// this remembering and re-throwing of exception is just to
-			// get an
-			// exception that occurred on one thread, to be thrown on
-			// callers
-			// thread.
-			if (resultSlot[0] instanceof Throwable) {
-				throw new RuntimeException((Throwable) resultSlot[0]);
-			}
-			else {
-				event = (StructuredDocumentEvent) resultSlot[0];
-			}
+			executionDelegate.execute(runnable);
+			event = (StructuredDocumentEvent) resultSlot[0];
 		}
 		return event;
 	}
 
 	public DocumentRewriteSession startRewriteSession(DocumentRewriteSessionType sessionType) throws IllegalStateException {
 		DocumentRewriteSession session = null;
-		if (getExecutionDelegate() == null) {
-			// if the delegate has not been set, we execute on current
-			// thread, like "normal". This is the case for normal
-			// non-editor
-			// use (which should still, ultimately, be protected by
-			// a scheduling rule).
+		IExecutionDelegate executionDelegate = getExecutionDelegate();
+		if (executionDelegate == null) {
 			session = internalStartRewriteSession(sessionType);
 		}
 		else {
-			// If document is being used by an editor, a runnable is
-			// created,
-			// even if later (in the execution delegate instance) it is
-			// decided
-			// nothing special is needed (that is, in fact being called
-			// from
-			// editor's display thread, in which case its just executed)
 			final Object[] resultSlot = new Object[1];
 			final DocumentRewriteSessionType finalSessionType = sessionType;
-			Runnable runnable = new Runnable() {
-				public void run() {
-					try {
-						resultSlot[0] = internalStartRewriteSession(finalSessionType);
-
-					}
-					catch (Throwable e) {
-						resultSlot[0] = e;
-					}
+			JobSafeRunnable runnable = new JobSafeRunnable() {
+				public void run() throws Exception {
+					resultSlot[0] = internalStartRewriteSession(finalSessionType);
 				}
 			};
-			// strongly assumes synchronous call, to "wait" for
-			// results
-			// basically just routes to Display.synchExec(runnable),
-			// if not already running on display thread.
-			getExecutionDelegate().execute(runnable);
-
-			// this remembering and re-throwing of exception is just to
-			// get an
-			// exception that occurred on one thread, to be thrown on
-			// callers
-			// thread.
+			executionDelegate.execute(runnable);
 			if (resultSlot[0] instanceof Throwable) {
 				throw new RuntimeException((Throwable) resultSlot[0]);
 			}
@@ -231,49 +230,18 @@
 	}
 
 	public void stopRewriteSession(DocumentRewriteSession session) {
-		if (getExecutionDelegate() == null) {
-			// if the delegate has not been set, we execute on current
-			// thread, like "normal". This is the case for normal
-			// non-editor
-			// use (which should still, ultimately, be protected by
-			// a scheduling rule).
+		IExecutionDelegate executionDelegate = getExecutionDelegate();
+		if (executionDelegate == null) {
 			internalStopRewriteSession(session);
 		}
 		else {
-			// If document is being used by an editor, a runnable is
-			// created,
-			// even if later (in the execution delegate instance) it is
-			// decided
-			// nothing special is needed (that is, in fact being called
-			// from
-			// editor's display thread, in which case its just executed)
-			final Object[] resultSlot = new Object[1];
 			final DocumentRewriteSession finalSession = session;
-			Runnable runnable = new Runnable() {
-				public void run() {
-					try {
-						internalStopRewriteSession(finalSession);
-
-					}
-					catch (Throwable e) {
-						resultSlot[0] = e;
-					}
+			JobSafeRunnable runnable = new JobSafeRunnable() {
+				public void run() throws Exception {
+					internalStopRewriteSession(finalSession);
 				}
 			};
-			// strongly assumes synchronous call, to "wait" for
-			// results
-			// basically just routes to Display.synchExec(runnable),
-			// if not already running on display thread.
-			getExecutionDelegate().execute(runnable);
-
-			// this remembering and re-throwing of exception is just to
-			// get an
-			// exception that occurred on one thread, to be thrown on
-			// callers
-			// thread.
-			if (resultSlot[0] instanceof Throwable) {
-				throw new RuntimeException((Throwable) resultSlot[0]);
-			}
+			executionDelegate.execute(runnable);
 		}
 	}
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/MinimalDocument.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/MinimalDocument.java
index 0d4675e..de3ff23 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/MinimalDocument.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/MinimalDocument.java
@@ -141,7 +141,7 @@
 		try {
 			result = data.get(offset, length);
 		} catch (StringIndexOutOfBoundsException e) {
-			throw new BadLocationException();
+			throw new BadLocationException("offset: " + offset + " length: " + length + "\ndocument length: " + data.getLength());
 		}
 		return result;
 	}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentReParser.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentReParser.java
index ead5dad..f846682 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentReParser.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentReParser.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (Intalio) - bug 300427 - Comparison of String Objects using == or !=
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.text;
 
@@ -50,6 +50,7 @@
 	protected final CoreNodeList EMPTY_LIST = new CoreNodeList();
 	protected String fChanges;
 	protected String fDeletedText;
+	protected boolean fIsEntireDocument;
 
 	private FindReplaceDocumentAdapter fFindReplaceDocumentAdapter = null;
 	protected int fLengthDifference;
@@ -339,7 +340,7 @@
 			// is
 			// no adjustments
 			// to downstream stuff necessary.
-			result = new StructuredDocumentRegionsReplacedEvent(fStructuredDocument, fRequester, oldNodes, newNodes, fChanges, fStart, fLengthToReplace);
+			result = new StructuredDocumentRegionsReplacedEvent(fStructuredDocument, fRequester, oldNodes, newNodes, fChanges, fStart, fLengthToReplace, fIsEntireDocument);
 		} else {
 			// note: integrates changes into model as a side effect
 			result = minimumEvent(oldNodes, newNodes);
@@ -424,7 +425,7 @@
 		//		if (isContainerRegion(oldRegion) != isContainerRegion(oldRegion))
 		if (isCollectionRegion(oldRegion) != isCollectionRegion(newRegion))
 			result = false;
-		else if (oldRegion.getType() == newRegion.getType())
+		else if (oldRegion.getType().equals(newRegion.getType()))
 			result = true;
 		return result;
 	}
@@ -582,6 +583,7 @@
 		// doesn't do this.)
 		if ((fChanges != null) && (fDeletedText != null) && (fChanges.length() == fDeletedText.length()) && (fChanges.equals(fDeletedText))) {
 			result = new NoChangeEvent(fStructuredDocument, fRequester, fChanges, fStart, fLengthToReplace);
+			((NoChangeEvent)result).reason = NoChangeEvent.NO_CONTENT_CHANGE;
 		}
 		return result;
 	}
@@ -717,6 +719,9 @@
 		isParsing = false;
 		dirtyStart = null;
 		dirtyEnd = null;
+		fChanges = null;
+		fDeletedText = null;
+		fIsEntireDocument = false;
 	}
 
 	protected IStructuredDocumentRegion findDirtyEnd(int end) {
@@ -835,6 +840,8 @@
 		// notice this one is derived
 		fLengthDifference = Utilities.calculateLengthDifference(fChanges, fLengthToReplace);
 		fDeletedText = fStructuredDocument.get(fStart, fLengthToReplace);
+		int docLength = fStructuredDocument.getLength();
+		fIsEntireDocument = lengthToReplace >= docLength && docLength > 0;
 	}
 
 	protected void insertNodes(IStructuredDocumentRegion previousOldNode, IStructuredDocumentRegion nextOldNode, CoreNodeList newNodes) {
@@ -1058,7 +1065,7 @@
 	protected StructuredDocumentEvent nodesReplacedCheck(CoreNodeList oldNodes, CoreNodeList newNodes) {
 		// actually, nothing to check here, since (and assuming) we've already
 		// minimized the number of nodes, and ruled out mere region changes
-		StructuredDocumentEvent result = new StructuredDocumentRegionsReplacedEvent(fStructuredDocument, fRequester, oldNodes, newNodes, fChanges, fStart, fLengthToReplace);
+		StructuredDocumentEvent result = new StructuredDocumentRegionsReplacedEvent(fStructuredDocument, fRequester, oldNodes, newNodes, fChanges, fStart, fLengthToReplace, fIsEntireDocument);
 		return result;
 	}
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/TextRegionListImpl.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/TextRegionListImpl.java
index ca92300..9f62b78 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/TextRegionListImpl.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/TextRegionListImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (Intalio) - bug 300434 - Make inner classes static where possible
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.text;
 
@@ -21,7 +21,7 @@
 
 public class TextRegionListImpl implements ITextRegionList {
 
-	private class NullIterator implements Iterator {
+	static private class NullIterator implements Iterator {
 		public NullIterator() {
 		}
 
@@ -40,13 +40,13 @@
 
 	}
 
-	private class RegionIterator implements Iterator {
+	private static class RegionIterator implements Iterator {
 		private ITextRegion[] fIteratorRegions;
 		private int index = -1;
 		private int maxindex = -1;
 
-		public RegionIterator() {
-			fIteratorRegions = toArray();
+		public RegionIterator(ITextRegion[] regions) {
+			fIteratorRegions = regions;
 			maxindex = fIteratorRegions.length - 1;
 		}
 
@@ -61,8 +61,11 @@
 		}
 
 		public void remove() {
+			if (index < 0) {
+				// next() has never been called
+				throw new IllegalStateException("can not remove regions without prior invocation of next()"); //$NON-NLS-1$
+			}
 			throw new UnsupportedOperationException("can not remove regions via iterator"); //$NON-NLS-1$
-
 		}
 
 	}
@@ -83,7 +86,6 @@
 	}
 
 	public boolean add(ITextRegion region) {
-
 		if (region == null)
 			return false;
 		ensureCapacity(fRegionsCount + 1);
@@ -91,7 +93,7 @@
 		return true;
 	}
 
-	public boolean addAll(int insertPos, ITextRegionList newRegions) {
+	public boolean addAll(int insertPos, ITextRegionList newRegionList) {
 		// beginning of list is 0 to insertPos-1
 		// remainder of list is insertPos to fRegionsCount
 		// resulting total will be be fRegionsCount + newRegions.size()
@@ -99,20 +101,24 @@
 			throw new ArrayIndexOutOfBoundsException(insertPos);
 		}
 
-		int newRegionsSize = newRegions.size();
+		int newRegionListSize = newRegionList.size();
 
-		ensureCapacity(fRegionsCount + newRegionsSize);
+		ensureCapacity(fRegionsCount + newRegionListSize);
 
 		int numMoved = fRegionsCount - insertPos;
 		if (numMoved > 0)
-			System.arraycopy(fRegions, insertPos, fRegions, insertPos + newRegionsSize, numMoved);
+			System.arraycopy(fRegions, insertPos, fRegions, insertPos + newRegionListSize, numMoved);
 
-		for (int i = 0; i < newRegionsSize; i++)
-			fRegions[insertPos++] = newRegions.get(i);
-
-		fRegionsCount += newRegionsSize;
-		return newRegionsSize != 0;
-
+		if (newRegionList instanceof TextRegionListImpl && ((TextRegionListImpl) newRegionList).fRegions != null) {
+			System.arraycopy(((TextRegionListImpl) newRegionList).fRegions, 0, fRegions, insertPos, newRegionListSize);
+		}
+		else {
+			for (int i = 0; i < newRegionListSize; i++) {
+				fRegions[insertPos++] = newRegionList.get(i);
+			}
+		}
+		fRegionsCount += newRegionListSize;
+		return newRegionListSize != 0;
 	}
 
 	public void clear() {
@@ -136,15 +142,14 @@
 	}
 
 	public ITextRegion get(int index) {
-		if (index < 0 || index > fRegionsCount) {
+		// fRegionCount may not equal fRegions.length
+		if (index < 0 || index >= fRegionsCount) {
 			throw new ArrayIndexOutOfBoundsException(index);
 		}
-		ITextRegion result = fRegions[index];
-		return result;
+		return fRegions[index];
 	}
 
 	public int indexOf(ITextRegion region) {
-
 		int result = -1;
 		if (region != null) {
 			if (fRegions != null) {
@@ -167,7 +172,7 @@
 		if (size() == 0) {
 			return new NullIterator();
 		} else {
-			return new RegionIterator();
+			return new RegionIterator(toArray());
 		}
 	}
 
@@ -219,5 +224,13 @@
 		System.arraycopy(fRegions, 0, newArray, 0, fRegionsCount);
 		return newArray;
 	}
+	
+	public void trimToSize() {
+		if (fRegions.length > fRegionsCount) {
+			ITextRegion[] newRegions = new ITextRegion[fRegionsCount];
+			System.arraycopy(fRegions, 0, newRegions, 0, fRegionsCount);
+			fRegions = newRegions;
+		}
+	}
 
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java
index 5f078c7..14e9b15 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -29,6 +29,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredTextPartitioner;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.sse.core.text.IStructuredPartitions;
@@ -38,6 +39,9 @@
  * Base Document partitioner for StructuredDocuments. BLOCK_TEXT ITextRegions
  * have a partition type of BLOCK or BLOCK:TAGNAME if a surrounding tagname
  * was recorded.
+ * 
+ * Subclasses should synchronize access to <code>internalReusedTempInstance</code> using the lock
+ * <code>PARTITION_LOCK</code>.
  */
 public class StructuredTextPartitioner implements IDocumentPartitioner, IStructuredTextPartitioner {
 
@@ -60,6 +64,8 @@
 	protected IStructuredTypedRegion internalReusedTempInstance = new SimpleStructuredTypedRegion(0, 0, IStructuredPartitions.DEFAULT_PARTITION);
 	protected IStructuredDocument fStructuredDocument;
 
+	protected final Object PARTITION_LOCK = new Object();
+
 	/**
 	 * StructuredTextPartitioner constructor comment.
 	 */
@@ -71,7 +77,7 @@
 	 * Returns the partitioning of the given range of the connected document.
 	 * There must be a document connected to this partitioner.
 	 * 
-	 * Note: this shouldn't be called dirctly by clients, unless they control
+	 * Note: this shouldn't be called directly by clients, unless they control
 	 * the threading that includes modifications to the document. Otherwise
 	 * the document could be modified while partitions are being computed. We
 	 * advise that clients use the computePartitions API directly from the
@@ -89,12 +95,12 @@
 		}
 		ITypedRegion[] results = null;
 
+		synchronized (cachedPartitions) {
+			if ((!cachedPartitions.isInValid) && (offset == cachedPartitions.fOffset) && (length == cachedPartitions.fLength))
+				results = cachedPartitions.fPartitions;
+		}
 
-
-		if ((!cachedPartitions.isInValid) && (offset == cachedPartitions.fOffset) && (length == cachedPartitions.fLength)) {
-			results = cachedPartitions.fPartitions;
-		} else {
-
+		if (results == null) {
 			if (length == 0) {
 				results = new ITypedRegion[]{getPartition(offset)};
 			} else {
@@ -109,19 +115,26 @@
 				int currentPos = offset;
 				IStructuredTypedRegion previousPartition = null;
 				while (currentPos < endPos) {
-					internalGetPartition(currentPos, false);
-					currentPos += internalReusedTempInstance.getLength();
-					// check if this partition just continues last one
-					// (type is the same),
-					// if so, just extend length of last one, not need to
-					// create new
-					// instance.
-					if (previousPartition != null && internalReusedTempInstance.getType().equals(previousPartition.getType())) {
-						// same partition type
-						previousPartition.setLength(previousPartition.getLength() + internalReusedTempInstance.getLength());
-					} else {
-						// not the same, so add to list
-						IStructuredTypedRegion partition = createNewPartitionInstance();
+					IStructuredTypedRegion partition = null;
+					synchronized (PARTITION_LOCK) {
+						internalGetPartition(currentPos, false);
+						currentPos += internalReusedTempInstance.getLength();
+						
+						// check if this partition just continues last one
+						// (type is the same),
+						// if so, just extend length of last one, not need to
+						// create new
+						// instance.
+						if (previousPartition != null && internalReusedTempInstance.getType().equals(previousPartition.getType())) {
+							// same partition type
+							previousPartition.setLength(previousPartition.getLength() + internalReusedTempInstance.getLength());
+						}
+						else {
+							// not the same, so add to list
+							partition = createNewPartitionInstance();
+						}
+					}
+					if (partition != null) {
 						list.add(partition);
 						// and make current, previous
 						previousPartition = partition;
@@ -140,15 +153,21 @@
 					((IStructuredRegion) results[results.length - 1]).setLength(offset + length - results[results.length - 1].getOffset());
 				}
 			}
-			cachedPartitions.fLength = length;
-			cachedPartitions.fOffset = offset;
-			cachedPartitions.fPartitions = results;
-			cachedPartitions.isInValid = false;
+			synchronized (cachedPartitions) {
+				cachedPartitions.fLength = length;
+				cachedPartitions.fOffset = offset;
+				cachedPartitions.fPartitions = results;
+				cachedPartitions.isInValid = false;
+			}
 		}
 		return results;
 	}
 
-
+	private void invalidatePartitionCache() {
+		synchronized (cachedPartitions) {
+			cachedPartitions.isInValid = true;
+		}
+	}
 
 	/**
 	 * Connects the document to the partitioner, i.e. indicates the begin of
@@ -156,7 +175,7 @@
 	 */
 	public synchronized void connect(IDocument document) {
 		if (document instanceof IStructuredDocument) {
-			cachedPartitions.isInValid = true;
+			invalidatePartitionCache();
 			this.fStructuredDocument = (IStructuredDocument) document;
 		} else {
 			throw new IllegalArgumentException("This class and API are for Structured Documents only"); //$NON-NLS-1$
@@ -185,7 +204,9 @@
 	}
 
 	private IStructuredTypedRegion createNewPartitionInstance() {
-		return new SimpleStructuredTypedRegion(internalReusedTempInstance.getOffset(), internalReusedTempInstance.getLength(), internalReusedTempInstance.getType());
+		synchronized (PARTITION_LOCK) {
+			return new SimpleStructuredTypedRegion(internalReusedTempInstance.getOffset(), internalReusedTempInstance.getLength(), internalReusedTempInstance.getType());
+		}
 	}
 
 	/**
@@ -212,7 +233,7 @@
 	 * @see org.eclipse.jface.text.IDocumentPartitioner#disconnect()
 	 */
 	public synchronized void disconnect() {
-		cachedPartitions.isInValid = true;
+		invalidatePartitionCache();
 		this.fStructuredDocument = null;
 	}
 
@@ -222,7 +243,7 @@
 	 * @see org.eclipse.jface.text.IDocumentPartitioner#documentAboutToBeChanged(DocumentEvent)
 	 */
 	public void documentAboutToBeChanged(DocumentEvent event) {
-		cachedPartitions.isInValid = true;
+		invalidatePartitionCache();
 	}
 
 	/**
@@ -270,7 +291,7 @@
 	}
 
 	/**
-	 * Returns the set of all possible content types the partitoner supports.
+	 * Returns the set of all possible content types the partitioner supports.
 	 * I.e. Any result delivered by this partitioner may not contain a content
 	 * type which would not be included in this method's result.
 	 * 
@@ -288,7 +309,7 @@
 	 * given document. The document has previously been connected to the
 	 * partitioner.
 	 * 
-	 * Note: this shouldn't be called dirctly by clients, unless they control
+	 * Note: this shouldn't be called directly by clients, unless they control
 	 * the threading that includes modifications to the document. Otherwise
 	 * the document could be modified while partitions are being computed. We
 	 * advise that clients use the getPartition API directly from the
@@ -545,34 +566,58 @@
 		}
 
 		if (!partitionFound && structuredDocumentRegion != null) {
-			ITextRegion resultRegion = structuredDocumentRegion.getRegionAtCharacterOffset(offset);
-			partitionFound = isDocumentRegionBasedPartition(structuredDocumentRegion, resultRegion, offset);
+			/* We want the actual ITextRegion and not a possible ITextRegionCollection that
+			 * could be returned by IStructuredDocumentRegion#getRegionAtCharacterOffset
+			 * This allows for correct syntax highlighting and content assist.
+			 */
+			DeepRegion resultRegion = getDeepRegionAtCharacterOffset(structuredDocumentRegion, offset);
+			partitionFound = isDocumentRegionBasedPartition(structuredDocumentRegion, resultRegion.region, offset);
 			if (!partitionFound) {
-				// Note: this new logic doesn't handle container regions
-				// inside of
-				// container regions ... may need to make this first clause
-				// a recursive method
-				if (resultRegion != null && resultRegion instanceof ITextRegionContainer) {
-					ITextRegionContainer containerRegion = (ITextRegionContainer) resultRegion;
-					// then need to "drill down" for relevent region and
-					// relevent offset
-					ITextRegion deepRegion = containerRegion.getRegionAtCharacterOffset(offset);
-					int endOffset = containerRegion.getEndOffset(deepRegion);
-					String type = getPartitionType(deepRegion, endOffset);
-					setInternalPartition(offset, endOffset - offset, type);
+				if (resultRegion.region != null) {
+					String type = getPartitionType(resultRegion.region, offset);
+					setInternalPartition(offset, resultRegion.end - offset, type);
 				} else {
-					if (resultRegion != null) {
-						String type = getPartitionType(resultRegion, offset);
-						setInternalPartition(offset, structuredDocumentRegion.getEndOffset(resultRegion) - offset, type);
-					} else {
-						// can happen at EOF
-						setInternalPartition(offset, 1, getUnknown());
-					}
+					// can happen at EOF
+					// https://bugs.eclipse.org/bugs/show_bug.cgi?id=224886
+					// The unknown type was causing problems with content assist in JSP documents
+					setInternalPartition(offset, 1, getDefaultPartitionType());
 				}
 			}
 		}
 	}
 
+	private static class DeepRegion {
+		int end;
+		ITextRegion region;
+		DeepRegion(ITextRegion r, int e) {
+			region = r;
+			end = e;
+		}
+	}
+
+	/**
+	 * <p>Unlike {@link IStructuredDocumentRegion#getRegionAtCharacterOffset(int)} this will dig
+	 * into <code>ITextRegionCollection</code> to find the region containing the given offset</p>
+	 * 
+	 * @param region the containing region of the given <code>offset</code>
+	 * @param offset to the overall offset in the document.
+	 * @return the <code>ITextRegion</code> containing the given <code>offset</code>, will never be
+	 * a <code>ITextRegionCollextion</code>
+	 */
+	private DeepRegion getDeepRegionAtCharacterOffset(IStructuredDocumentRegion region, int offset) {
+		ITextRegion text = region.getRegionAtCharacterOffset(offset);
+		int end = region.getStartOffset();
+		if (text != null)
+			end += text.getStart();
+		while (text instanceof ITextRegionCollection) {
+			text = ((ITextRegionCollection) text).getRegionAtCharacterOffset(offset);
+			end += text.getStart();
+		}
+		if (text != null)
+			end += text.getLength();
+		return new DeepRegion(text, end);
+	}
+
 	/**
 	 * Provides for a per-StructuredDocumentRegion override selecting the
 	 * partition type using more than just a single ITextRegion.
@@ -596,9 +641,11 @@
 	}
 
 	protected void setInternalPartition(int offset, int length, String type) {
-		internalReusedTempInstance.setOffset(offset);
-		internalReusedTempInstance.setLength(length);
-		internalReusedTempInstance.setType(type);
+		synchronized (PARTITION_LOCK) {
+			internalReusedTempInstance.setOffset(offset);
+			internalReusedTempInstance.setLength(length);
+			internalReusedTempInstance.setType(type);
+		}
 	}
 
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java
index 3a2ff35..93a9b91 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -72,19 +72,11 @@
 				fTextCommand.setTextInserted(fTextCommand.getTextInserted().concat(textInserted));
 				fTextCommand.setTextEnd(textEnd);
 			}
-			else if (fTextCommand != null && textStart == fTextCommand.getTextStart() - (textEnd - textStart + 1) && textEnd <= fTextCommand.getTextEnd() - (textEnd - textStart + 1) && textDeleted.length() == 1 && textInserted.length() == 0) {
+			else if (fTextCommand != null && textStart == fTextCommand.getTextStart() - 1 && textEnd <= fTextCommand.getTextEnd() - 1 && textDeleted.length() == 1 && textInserted.length() == 0 && fTextCommand.getTextDeleted().length() > 0) {
 				// backspace pressed
-
-				// erase a character just inserted
-				if (fTextCommand.getTextInserted().length() > 0) {
-					fTextCommand.setTextInserted(fTextCommand.getTextInserted().substring(0, fTextCommand.getTextEnd() - fTextCommand.getTextStart() - 1));
-					fTextCommand.setTextEnd(textEnd);
-				}
 				// erase a character in the file
-				else {
-					fTextCommand.setTextDeleted(textDeleted.concat(fTextCommand.getTextDeleted()));
-					fTextCommand.setTextStart(textStart);
-				}
+				fTextCommand.setTextDeleted(textDeleted.concat(fTextCommand.getTextDeleted()));
+				fTextCommand.setTextStart(textStart);
 			}
 			else {
 				createNewTextCommand(textDeleted, textInserted, textStart, textEnd);
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/AbstractMemoryListener.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/AbstractMemoryListener.java
new file mode 100644
index 0000000..46c60a8
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/AbstractMemoryListener.java
@@ -0,0 +1,205 @@
+/*******************************************************************************

+ * Copyright (c) 2009 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *     

+ *******************************************************************************/

+package org.eclipse.wst.sse.core.internal.util;

+

+import java.util.ArrayList;

+import java.util.Arrays;

+import java.util.Hashtable;

+import java.util.List;

+

+import org.eclipse.core.runtime.Assert;

+import org.eclipse.core.runtime.Platform;

+import org.eclipse.wst.sse.core.internal.Logger;

+import org.eclipse.wst.sse.core.internal.SSECorePlugin;

+import org.osgi.framework.Bundle;

+import org.osgi.framework.BundleContext;

+import org.osgi.framework.BundleException;

+import org.osgi.framework.ServiceRegistration;

+import org.osgi.service.event.Event;

+import org.osgi.service.event.EventAdmin;

+import org.osgi.service.event.EventConstants;

+import org.osgi.service.event.EventHandler;

+

+/**

+ * This responds to memory events.

+ * 

+ * Create an instance of a child of this class with the events you are interested in.

+ * Then call connect() to start listening. To stop listening call disconnect();

+ */

+public abstract class AbstractMemoryListener implements EventHandler {

+	/**

+	 * The event that indicates that memory is running low at the lowest severity.

+	 * Listeners are requested to release caches that can easily be recomputed.

+	 * The Java VM is not seriously in trouble, but process size is getting higher than 

+	 * is deemed acceptable.

+	 */

+	public static final String SEV_NORMAL = "org/eclipse/equinox/events/MemoryEvent/NORMAL"; //$NON-NLS-1$

+	

+	/**

+	 * The event that indicates that memory is running low at medium severity. 

+	 * Listeners are requested to release intermediate build results, complex models, etc.

+	 * Memory is getting low and may cause operating system level stress, such as swapping.

+	 */

+	public static final String SEV_SERIOUS = "org/eclipse/equinox/events/MemoryEvent/SERIOUS"; //$NON-NLS-1$

+	

+	/**

+	 * The event that indicates that memory is running low at highest severity.

+	 * Listeners are requested to do things like close editors and perspectives, close database connections, etc.

+	 * Restoring these resources and caches constitutes lots of work, but memory is so low that

+	 * drastic measures are required.

+	 */

+	public static final String SEV_CRITICAL = "org/eclipse/equinox/events/MemoryEvent/CRITICAL"; //$NON-NLS-1$

+	

+	/**

+	 * All of the valid memory severities

+	 */

+	public static final String[] SEV_ALL = { SEV_NORMAL, SEV_SERIOUS, SEV_CRITICAL };

+

+	/**

+	 * Used to register the {@link EventAdmin} listener

+	 */

+	private static BundleContext CONTEXT =

+		(SSECorePlugin.getDefault() != null) ?

+				SSECorePlugin.getDefault().getBundle().getBundleContext() : null;

+

+	/**

+	 * the severities that will be reacted to

+	 */

+	private final List fSeverities;

+	

+	/**

+	 * service used to register this listener

+	 */

+	private ServiceRegistration fRegisterService;

+

+	/**

+	 * Will listen to all memory events

+	 */

+	public AbstractMemoryListener() {

+		this(AbstractMemoryListener.SEV_ALL);

+	}

+

+	/**

+	 * Will listen to memory events of the given <code>severity</code>

+	 * 

+	 * @param severity listen for memory events of this severity

+	 */

+	public AbstractMemoryListener(String severity) {

+		Assert.isNotNull(severity, "Severity can not be null"); //$NON-NLS-1$

+		

+		List severities = new ArrayList(1);

+		severities.add(severity);

+		fSeverities = severities;

+	}

+	

+	/**

+	 * Will listen to memory events of the given <code>severities</code>

+	 * 

+	 * @param severities listen for memory events for any of these severities

+	 */

+	public AbstractMemoryListener(String[] severities) {

+		Assert.isNotNull(severities, "Severities can not be null"); //$NON-NLS-1$

+		Assert.isLegal(severities.length > 0, "Severities must specify at least one severity"); //$NON-NLS-1$

+		

+		fSeverities = Arrays.asList(severities);

+	}

+

+	/**

+	 * Will listen to memory events of the given <code>severities</code>

+	 * 

+	 * @param severities listen for memory events for any of these severities

+	 */

+	public AbstractMemoryListener(List severities) {

+		Assert.isNotNull(severities, "Severities can not be null"); //$NON-NLS-1$

+		Assert.isLegal(!severities.isEmpty(), "Severities must specify at least one severity"); //$NON-NLS-1$

+		fSeverities = severities;

+	}

+

+	/**

+	 * Connect this listener to the {@link EventAdmin}

+	 */

+	public final void connect() {

+		if (CONTEXT != null) {

+			// NOTE: This is TEMPORARY CODE needed to load the plugin

+			// until its done automatically by the product

+			// TODO: Remove me

+			Bundle b = Platform.getBundle("org.eclipse.equinox.event"); //$NON-NLS-1$

+			if (b != null && b.getState() == Bundle.RESOLVED) {

+				try {

+					b.start(Bundle.START_TRANSIENT);

+				}

+				catch (BundleException e) {

+					e.printStackTrace();

+				}

+			}

+			// end remove me

+			

+			//register this handler

+			String[] severities = (String[])fSeverities.toArray(new String[fSeverities.size()]);

+			Hashtable prop = new Hashtable(1);

+			prop.put(EventConstants.EVENT_TOPIC, severities);

+			fRegisterService = CONTEXT.registerService(EventHandler.class.getName(), this, prop);

+			

+			//call any implementer specific connect code

+			doConnect();

+		} else {

+			Logger.log(Logger.WARNING, "Error accessing bundle context. Is Platform running? Not tracking memory events. "); //$NON-NLS-1$

+		}

+	}

+

+	/**

+	 * Disconnect this listener to the {@link EventAdmin}

+	 */

+	public final void disconnect() {

+		if (fRegisterService != null) {

+			fRegisterService.unregister();

+			fRegisterService = null;

+		}

+		

+		//call any implementer specific disconnect code

+		doDisconnect();

+	}

+

+	/**

+	 * <p>Filter out any events that are not of the type that this listener handles</p>

+	 * 

+	 * @see org.osgi.service.event.EventHandler#handleEvent(org.osgi.service.event.Event)

+	 */

+	public final void handleEvent(Event event) {

+		if (fSeverities.contains(event.getTopic())) {

+			handleMemoryEvent(event);

+		}

+	}

+

+	/**

+	 * Implementing child classes may assume that only {@link Event}s of the types

+	 * given to the constructor will be given to this method.

+	 * 

+	 * @param event the {@link Event} with a topic equal to one of the memory

+	 * severities that this listener is listening for

+	 */

+	protected abstract void handleMemoryEvent(Event event);

+	

+	/**

+	 * Implementers may overrun this method to do setup after connection of this listener

+	 */

+	protected void doConnect() {

+		//do nothing by default

+	}

+	

+	/**

+	 * Implementers may overrun this method to do tear down after disconnection of this listener

+	 */

+	protected void doDisconnect() {

+		//do nothing by default

+	}

+}

diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Debug.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Debug.java
index d6126c3..3df8954 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Debug.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Debug.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (Intalio) - bug 300430 - String concatenation
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.util;
 
@@ -169,9 +169,11 @@
 	 */
 	private static String space(int depth) {
 		String result = "  "; //$NON-NLS-1$
+		StringBuffer sb = new StringBuffer(result);
 		for (int i = 0; i < depth; i++) {
-			result += "  "; //$NON-NLS-1$
+			sb.append("  "); //$NON-NLS-1$
 		}
+		result = sb.toString();
 		return result;
 	}
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/JarUtilities.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/JarUtilities.java
index 5582df1..bf621e0 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/JarUtilities.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/JarUtilities.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,9 +17,13 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.JarURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.List;
+import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipException;
 import java.util.zip.ZipFile;
@@ -27,8 +31,10 @@
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.wst.sse.core.internal.Logger;
 
 
@@ -38,11 +44,11 @@
 	 * @see http://java.sun.com/products/jsp/errata_1_1_a_042800.html, Issues
 	 *      8 & 9
 	 * 
-	 * "There are two cases. In both cases the TLD_URI is to be interpreted
-	 * relative to the root of the Web Application. In the first case the
-	 * TLD_URI refers to a TLD file directly. In the second case, the TLD_URI
-	 * refers to a JAR file. If so, that JAR file should have a TLD at
-	 * location META-INF/taglib.tld."
+	 *      "There are two cases. In both cases the TLD_URI is to be
+	 *      interpreted relative to the root of the Web Application. In the
+	 *      first case the TLD_URI refers to a TLD file directly. In the
+	 *      second case, the TLD_URI refers to a JAR file. If so, that JAR
+	 *      file should have a TLD at location META-INF/taglib.tld."
 	 */
 	public static final String JSP11_TAGLIB = "META-INF/taglib.tld"; //$NON-NLS-1$
 
@@ -54,7 +60,6 @@
 		}
 		catch (IOException ioe) {
 			// no cleanup can be done
-			Logger.logException("JarUtilities: Could not close file " + file.getName(), ioe); //$NON-NLS-1$
 		}
 	}
 
@@ -64,7 +69,7 @@
 	protected static InputStream getCachedInputStream(String jarFilename, String entryName) {
 		File testFile = new File(jarFilename);
 		if (!testFile.exists())
-			return null;
+			return getInputStream(ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(jarFilename)), entryName);
 
 		InputStream cache = null;
 		ZipFile jarfile = null;
@@ -72,7 +77,6 @@
 			jarfile = new ZipFile(jarFilename);
 		}
 		catch (IOException ioExc) {
-			Logger.logException("JarUtilities: " + jarFilename, ioExc); //$NON-NLS-1$
 			closeJarFile(jarfile);
 		}
 
@@ -85,7 +89,7 @@
 						entryInputStream = jarfile.getInputStream(zentry);
 					}
 					catch (IOException ioExc) {
-						Logger.logException("JarUtilities: " + jarFilename, ioExc); //$NON-NLS-1$
+						// no cleanup can be done
 					}
 
 					if (entryInputStream != null) {
@@ -114,6 +118,7 @@
 								entryInputStream.close();
 							}
 							catch (IOException e) {
+								// no cleanup can be done
 							}
 						}
 					}
@@ -125,11 +130,11 @@
 		}
 		return cache;
 	}
-	
+
 	private static InputStream copyAndCloseStream(InputStream original) {
 		ByteArrayOutputStream buffer = new ByteArrayOutputStream();
 		InputStream cachedCopy = null;
-		
+
 		if (original != null) {
 			int c;
 			// array dim restriction?
@@ -148,25 +153,40 @@
 		return cachedCopy;
 	}
 
+	/**
+	 * @param jarResource
+	 *            the zip file
+	 * @return a string array containing the entry paths to every file in this
+	 *         zip resource, excluding directories
+	 */
 	public static String[] getEntryNames(IResource jarResource) {
-		if (jarResource == null || jarResource.getType() != IResource.FILE)
+		if (jarResource == null || jarResource.getType() != IResource.FILE || !jarResource.isAccessible())
 			return new String[0];
-		if(jarResource.getLocation() == null) {
-			try {
-				return getEntryNames(new ZipInputStream(((IFile)jarResource).getContents()), true);
-			}
-			catch (CoreException e) {
-				Logger.logException("Problem reading contents of " + jarResource.getFullPath(), e);  //$NON-NLS-1$
-			}
+
+		try {
+			return getEntryNames(jarResource.getFullPath().toString(), new ZipInputStream(((IFile) jarResource).getContents()), true);
 		}
-		return getEntryNames(jarResource.getLocation().toString());
+		catch (CoreException e) {
+			// no cleanup can be done
+		}
+
+		IPath location = jarResource.getLocation();
+		if (location != null)
+			return getEntryNames(location.toString());
+		return new String[0];
 	}
 
+	/**
+	 * @param jarFilename
+	 *            the location of the zip file
+	 * @return a string array containing the entry paths to every file in the
+	 *         zip file at this location, excluding directories
+	 */
 	public static String[] getEntryNames(String jarFilename) {
 		return getEntryNames(jarFilename, true);
 	}
 
-	private static String[] getEntryNames(ZipInputStream jarInputStream, boolean excludeDirectories) {
+	private static String[] getEntryNames(String filename, ZipInputStream jarInputStream, boolean excludeDirectories) {
 		List entryNames = new ArrayList();
 		try {
 			ZipEntry z = jarInputStream.getNextEntry();
@@ -177,10 +197,10 @@
 			}
 		}
 		catch (ZipException zExc) {
-			Logger.log(Logger.WARNING, "JarUtilities ZipException: (stream) " + zExc.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
+			Logger.log(Logger.WARNING_DEBUG, "JarUtilities ZipException: (stream) " + filename, zExc); //$NON-NLS-1$ //$NON-NLS-2$
 		}
 		catch (IOException ioExc) {
-			Logger.log(Logger.WARNING, "JarUtilities IOException: (stream) " + ioExc.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
+			// no cleanup can be done
 		}
 		finally {
 			closeStream(jarInputStream);
@@ -194,68 +214,89 @@
 			inputStream.close();
 		}
 		catch (IOException e) {
-			// nothing to do
+			// no cleanup can be done
 		}
 	}
 
+	/**
+	 * @param jarFilename
+	 *            the location of the zip file
+	 * @param excludeDirectories
+	 *            whether to not include directories in the results
+	 * @return a string array containing the entry paths to every file in the
+	 *         zip file at this location, excluding directories if indicated
+	 */
 	public static String[] getEntryNames(String jarFilename, boolean excludeDirectories) {
 		ZipFile jarfile = null;
 		List entryNames = new ArrayList();
-		try {
-			jarfile = new ZipFile(jarFilename);
-			Enumeration entries = jarfile.entries();
-			while (entries.hasMoreElements()) {
-				ZipEntry z = (ZipEntry) entries.nextElement();
-				if (!(z.isDirectory() && excludeDirectories))
-					entryNames.add(z.getName());
+		File f = new File(jarFilename);
+		if (f.exists() && f.canRead()) {
+			try {
+				jarfile = new ZipFile(f);
+				Enumeration entries = jarfile.entries();
+				while (entries.hasMoreElements()) {
+					ZipEntry z = (ZipEntry) entries.nextElement();
+					if (!(z.isDirectory() && excludeDirectories))
+						entryNames.add(z.getName());
+				}
 			}
-		}
-		catch (ZipException zExc) {
-			Logger.log(Logger.WARNING, "JarUtilities ZipException: " + jarFilename + " " + zExc.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		catch (IOException ioExc) {
-			Logger.log(Logger.WARNING, "JarUtilities IOException: " + jarFilename + " " + ioExc.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-		finally {
-			closeJarFile(jarfile);
+			catch (ZipException zExc) {
+				Logger.log(Logger.WARNING_DEBUG, "JarUtilities ZipException: " + jarFilename + " " + zExc.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
+			}
+			catch (IOException ioExc) {
+				// no cleanup can be done
+			}
+			finally {
+				closeJarFile(jarfile);
+			}
 		}
 		String[] names = (String[]) entryNames.toArray(new String[0]);
 		return names;
 	}
 
+	/**
+	 * @param jarResource
+	 *            the zip file
+	 * @param entryName
+	 *            the entry's path in the zip file
+	 * @return an InputStream to the contents of the given entry or null if
+	 *         not possible
+	 */
 	public static InputStream getInputStream(IResource jarResource, String entryName) {
-		if (jarResource == null || jarResource.getType() != IResource.FILE)
+		if (jarResource == null || jarResource.getType() != IResource.FILE || !jarResource.isAccessible())
 			return null;
-		IPath location = jarResource.getLocation();
-		if(location == null) {
-			try {
-				InputStream zipStream = ((IFile)jarResource).getContents();
-				return getInputStream(new ZipInputStream(zipStream), entryName);
-			}
-			catch (CoreException e) {
-				Logger.logException("Problem reading contents of " + jarResource.getFullPath(), e);  //$NON-NLS-1$
-				return null;
-			}
+
+		try {
+			InputStream zipStream = ((IFile) jarResource).getContents();
+			return getInputStream(jarResource.getFullPath().toString(), new ZipInputStream(zipStream), entryName);
 		}
-		return getInputStream(location.toString(), entryName);
+		catch (CoreException e) {
+			// no cleanup can be done, probably out of sync
+		}
+
+		IPath location = jarResource.getLocation();
+		if (location != null) {
+			return getInputStream(location.toString(), entryName);
+		}
+		return null;
 	}
-	
-	private static InputStream getInputStream(ZipInputStream zip, String entryName) {
+
+	private static InputStream getInputStream(String filename, ZipInputStream zip, String entryName) {
 		InputStream result = null;
 		try {
 			ZipEntry z = zip.getNextEntry();
 			while (z != null && !z.getName().equals(entryName)) {
 				z = zip.getNextEntry();
 			}
-			if(z != null) {				
+			if (z != null) {
 				result = copyAndCloseStream(zip);
 			}
 		}
 		catch (ZipException zExc) {
-			Logger.log(Logger.WARNING, "JarUtilities ZipException: (stream) " + zExc.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
+			Logger.log(Logger.WARNING_DEBUG, "JarUtilities ZipException: (stream) " + filename, zExc); //$NON-NLS-1$ //$NON-NLS-2$
 		}
 		catch (IOException ioExc) {
-			Logger.log(Logger.WARNING, "JarUtilities IOException: (stream) " + ioExc.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
+			// no cleanup can be done
 		}
 		finally {
 			closeStream(zip);
@@ -263,6 +304,14 @@
 		return result;
 	}
 
+	/**
+	 * @param jarFilename
+	 *            the location of the zip file
+	 * @param entryName
+	 *            the entry's path in the zip file
+	 * @return an InputStream to the contents of the given entry or null if
+	 *         not possible
+	 */
 	public static InputStream getInputStream(String jarFilename, String entryName) {
 		// check sanity
 		if (jarFilename == null || jarFilename.length() < 1 || entryName == null || entryName.length() < 1)
@@ -277,4 +326,65 @@
 
 		return getCachedInputStream(jarFilename, internalName);
 	}
+
+	/**
+	 * @param url
+	 *            a URL pointint to a zip file
+	 * @return a cached copy of the contents at this URL, opening it as a file
+	 *         if it is a jar:file: URL, and using a URLConnection otherwise,
+	 *         or null if it could not be read. All sockets and file handles
+	 *         are closed as quickly as possible.
+	 */
+	public static InputStream getInputStream(URL url) {
+		String urlString = url.toString();
+		if (urlString.length() > 12 && urlString.startsWith("jar:file:") && urlString.indexOf("!/") > 9) { //$NON-NLS-1$ //$NON-NLS-2$
+			int fileIndex = urlString.indexOf("!/"); //$NON-NLS-1$ 
+			String jarFileName = urlString.substring(9, fileIndex);
+			if (fileIndex < urlString.length()) {
+				String jarPath = urlString.substring(fileIndex + 1);
+				return getInputStream(jarFileName, jarPath);
+			}
+		}
+
+		InputStream input = null;
+		JarURLConnection jarUrlConnection = null;
+		try {
+			URLConnection openConnection = url.openConnection();
+			openConnection.setDefaultUseCaches(false);
+			openConnection.setUseCaches(false);
+			if (openConnection instanceof JarURLConnection) {
+				jarUrlConnection = (JarURLConnection) openConnection;
+				JarFile jarFile = jarUrlConnection.getJarFile();
+				input = jarFile.getInputStream(jarUrlConnection.getJarEntry());
+			}
+			else {
+				input = openConnection.getInputStream();
+			}
+			if (input != null) {
+				return copyAndCloseStream(input);
+			}
+		}
+		catch (IOException e) {
+			Logger.logException(e);
+		}
+		finally {
+			if (jarUrlConnection != null) {
+				try {
+					jarUrlConnection.getJarFile().close();
+				}
+				catch (IOException e) {
+					// ignore
+				}
+				catch (IllegalStateException e) {
+					/*
+					 * ignore. Can happen in case the stream.close() did close
+					 * the jar file see
+					 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=140750
+					 */
+				}
+
+			}
+		}
+		return null;
+	}
 }
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/PathHelper.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/PathHelper.java
index 768f361..b835085 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/PathHelper.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/PathHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,8 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (Intalio) - bug 300430 - String concatenation
+ *          
  *******************************************************************************/
 package org.eclipse.wst.sse.core.internal.util;
 
@@ -80,15 +81,18 @@
 		}
 		// now generate the backs
 		String output = "";//$NON-NLS-1$
+		StringBuffer sb = new StringBuffer(output);
 		while (baseTokenizer.hasMoreTokens()) {
 			baseTokenizer.nextToken();
-			output += "../"; //$NON-NLS-1$
+			sb.append("../"); //$NON-NLS-1$
 		}
-		output += token2;
+		sb.append(token2);
 		// generate the rest
 		while (inputTokenizer.hasMoreTokens()) {
-			output = output + FORWARD_SLASH + inputTokenizer.nextToken();
+			sb.append(FORWARD_SLASH);
+			sb.append(inputTokenizer.nextToken());
 		}
+		output = sb.toString();
 		return output;
 	}
 
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Sorter.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Sorter.java
new file mode 100644
index 0000000..41cdf33
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Sorter.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.sse.core.internal.util;
+
+
+
+/**
+ * The SortOperation takes a collection of objects and returns a sorted
+ * collection of these objects. Concrete instances of this class provide the
+ * criteria for the sorting of the objects based on the type of the objects.
+ */
+public abstract class Sorter {
+
+	/**
+	 * Returns true iff elementTwo is 'greater than' elementOne. This is the
+	 * 'ordering' method of the sort operation. Each subclass overrides this
+	 * method with the particular implementation of the 'greater than' concept
+	 * for the objects being sorted. If elementOne and elementTwo are
+	 * equivalent in terms of their sorting order, this method must return
+	 * 'false'.
+	 */
+	public abstract boolean compare(Object elementOne, Object elementTwo);
+
+	/**
+	 * Sort the objects in the array and return the array.
+	 */
+	private Object[] quickSort(Object[] array, int left, int right) {
+		int originalLeft = left;
+		int originalRight = right;
+		Object mid = array[(left + right) / 2];
+
+		do {
+			while (compare(array[left], mid))
+				left++;
+			while (compare(mid, array[right]))
+				right--;
+			if (left <= right) {
+				Object tmp = array[left];
+				array[left] = array[right];
+				array[right] = tmp;
+				left++;
+				right--;
+			}
+		} while (left <= right);
+
+		if (originalLeft < right)
+			array = quickSort(array, originalLeft, right);
+		if (left < originalRight)
+			array = quickSort(array, left, originalRight);
+
+		return array;
+	}
+
+	/**
+	 * Return a new (quick)sorted array from this unsorted array. The original
+	 * array is not modified.
+	 */
+	public Object[] sort(Object[] unSortedCollection) {
+		int size = unSortedCollection.length;
+		Object[] sortedCollection = new Object[size];
+
+		//copy the array so can return a new sorted collection
+		System.arraycopy(unSortedCollection, 0, sortedCollection, 0, size);
+		if (size > 1)
+			quickSort(sortedCollection, 0, size - 1);
+
+		return sortedCollection;
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidatorGroupListener.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidatorGroupListener.java
new file mode 100644
index 0000000..c34c271
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidatorGroupListener.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.sse.core.internal.validate;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.Logger;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.validation.IValidatorGroupListener;
+import org.eclipse.wst.validation.ValidationState;
+
+public class ValidatorGroupListener implements IValidatorGroupListener {
+
+	Map fDiagnosticMap = new HashMap();
+	private static final boolean _debug = false;
+
+	public ValidatorGroupListener() {
+	}
+
+	protected void finalize() throws Throwable {
+		super.finalize();
+		if (fDiagnosticMap != null && !fDiagnosticMap.isEmpty()) {
+			Object[] paths = fDiagnosticMap.keySet().toArray();
+			for (int i = 0; i < paths.length; i++) {
+				Logger.log(Logger.ERROR, "Leaked model: " + paths[i]);
+				validationFinishing(ResourcesPlugin.getWorkspace().getRoot().getFile((IPath) paths[i]), new NullProgressMonitor(), null);
+			}
+		}
+	}
+
+	public void validationFinishing(IResource resource, IProgressMonitor monitor, ValidationState state) {
+		if (_debug)
+			System.out.println("Finishing:" + resource.getFullPath());
+		if (resource.getType() != IResource.FILE)
+			return;
+
+		IStructuredModel model = (IStructuredModel) fDiagnosticMap.remove(resource.getFullPath());
+		if (model != null) {
+			model.releaseFromRead();
+		}
+	}
+
+	public void validationStarting(IResource resource, IProgressMonitor monitor, ValidationState state) {
+		if (_debug)
+			System.out.println("Starting: " + resource.getFullPath());
+		try {
+			if (monitor != null && !monitor.isCanceled()) {
+				if (resource.getType() != IResource.FILE)
+					return;
+
+				IModelManager modelManager = StructuredModelManager.getModelManager();
+				// possible when shutting down
+				if (modelManager != null) {
+					IStructuredModel model = modelManager.getModelForRead((IFile) resource);
+					if (model != null) {
+						fDiagnosticMap.put(resource.getFullPath(), model);
+					}
+				}
+			}
+		}
+		catch (Exception e) {
+			Logger.logException(e);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/utils/StringUtils.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/utils/StringUtils.java
index 894fde2..72dca7d 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/utils/StringUtils.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/utils/StringUtils.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     David Carver (Intalio) - bug 300430 - String concatenation
  *     
  *******************************************************************************/
 package org.eclipse.wst.sse.core.utils;
@@ -221,22 +222,25 @@
 
 		String newText = ""; //$NON-NLS-1$
 		int lineCount = tempDoc.getNumberOfLines();
+		StringBuffer sb = new StringBuffer(newText);
 		for (int i = 0; i < lineCount; i++) {
 			try {
 				org.eclipse.jface.text.IRegion lineInfo = tempDoc.getLineInformation(i);
 				int lineStartOffset = lineInfo.getOffset();
 				int lineLength = lineInfo.getLength();
 				int lineEndOffset = lineStartOffset + lineLength;
-				newText += allText.substring(lineStartOffset, lineEndOffset);
+				sb.append(allText.substring(lineStartOffset, lineEndOffset));
 
-				if ((i < lineCount - 1) && (tempDoc.getLineDelimiter(i) != null))
-					newText += lineDelimiterToUse;
+				if ((i < lineCount - 1) && (tempDoc.getLineDelimiter(i) != null)) {
+					sb.append(lineDelimiterToUse);
+				}
 			}
 			catch (BadLocationException e) {
 				// log for now, unless we find reason not to
 				Logger.log(Logger.INFO, e.getMessage());
 			}
 		}
+		newText = sb.toString();
 
 		return newText;
 	}
@@ -546,13 +550,17 @@
 		int position = 0;
 		int previous = 0;
 		int spacer = source.length();
+		StringBuffer sb = new StringBuffer(normalString);
 		while (position + spacer - 1 < length && aString.indexOf(source, position) > -1) {
 			position = aString.indexOf(source, previous);
-			normalString = normalString + aString.substring(previous, position) + target;
+			sb.append(normalString);
+			sb.append(aString.substring(previous, position));
+			sb.append(target);
 			position += spacer;
 			previous = position;
 		}
-		normalString = normalString + aString.substring(position, aString.length());
+		sb.append(aString.substring(position, aString.length()));
+		normalString = sb.toString();
 
 		return normalString;
 	}
diff --git a/bundles/org.eclipse.wst.sse.ui/.options b/bundles/org.eclipse.wst.sse.ui/.options
index 70d30d1..cfbecf3 100644
--- a/bundles/org.eclipse.wst.sse.ui/.options
+++ b/bundles/org.eclipse.wst.sse.ui/.options
@@ -65,3 +65,9 @@
 org.eclipse.wst.sse.ui/debug/reconcilerSpelling/showProblems=false
 
 org.eclipse.wst.sse.ui/debug/reconcilerValidators=false
+#org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorStrategy
+org.eclipse.wst.sse.ui/debug/reconcilerValidatorSupported=false
+org.eclipse.wst.sse.ui/debug/reconcilerValidatorEnablement=false
+
+org.eclipse.wst.sse.ui/structuredPresentationReconciler=false
+org.eclipse.wst.sse.ui/structuredPresentationReconciler/time=false
diff --git a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.core.prefs
index b46c473..26b0cde 100644
--- a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Sat Mar 24 02:58:57 EDT 2007

+#Wed Apr 30 02:03:18 EDT 2008

 eclipse.preferences.version=1

 org.eclipse.jdt.core.builder.cleanOutputFolder=clean

 org.eclipse.jdt.core.builder.duplicateResourceTask=warning

@@ -25,6 +25,8 @@
 org.eclipse.jdt.core.compiler.problem.discouragedReference=warning

 org.eclipse.jdt.core.compiler.problem.emptyStatement=warning

 org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning

+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore

+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled

 org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore

 org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore

 org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error

@@ -51,8 +53,14 @@
 org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error

 org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning

 org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore

+org.eclipse.jdt.core.compiler.problem.nullReference=warning

 org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning

+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore

 org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error

+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning

+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning

+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore

+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning

 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled

 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error

 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled

@@ -65,14 +73,18 @@
 org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error

 org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore

 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore

+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled

+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled

 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled

 org.eclipse.jdt.core.compiler.problem.unusedImport=error

 org.eclipse.jdt.core.compiler.problem.unusedLabel=error

 org.eclipse.jdt.core.compiler.problem.unusedLocal=error

 org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore

+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled

 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled

 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled

 org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error

+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning

 org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning

 org.eclipse.jdt.core.compiler.source=1.3

 org.eclipse.jdt.core.incompatibleJDKLevel=ignore

diff --git a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.pde.prefs
index 061cd53..52ce9da 100644
--- a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.pde.prefs
@@ -1,16 +1,25 @@
-#Mon Apr 17 02:01:33 EDT 2006

+#Thu Aug 14 03:59:55 EDT 2008

+compilers.f.unresolved-features=1

+compilers.f.unresolved-plugins=1

 compilers.incompatible-environment=0

 compilers.p.build=0

 compilers.p.deprecated=1

+compilers.p.discouraged-class=1

 compilers.p.illegal-att-value=0

+compilers.p.internal=1

+compilers.p.missing-packages=2

 compilers.p.no-required-att=0

 compilers.p.not-externalized-att=0

 compilers.p.unknown-attribute=0

-compilers.p.unknown-class=0

+compilers.p.unknown-class=1

 compilers.p.unknown-element=0

+compilers.p.unknown-identifier=1

 compilers.p.unknown-resource=0

 compilers.p.unresolved-ex-points=0

 compilers.p.unresolved-import=0

 compilers.p.unused-element-or-attribute=0

+compilers.s.create-docs=false

+compilers.s.doc-folder=doc

+compilers.s.open-tags=1

 compilers.use-project=true

 eclipse.preferences.version=1

diff --git a/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF
index ea5fb6d..4b8c248 100644
--- a/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF
@@ -2,11 +2,12 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.sse.ui; singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.2.2.qualifier
 Bundle-Activator: org.eclipse.wst.sse.ui.internal.SSEUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Export-Package: org.eclipse.wst.sse.ui,
+ org.eclipse.wst.sse.ui.contentassist,
  org.eclipse.wst.sse.ui.internal;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
  org.eclipse.wst.sse.ui.internal.actions;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
  org.eclipse.wst.sse.ui.internal.contentassist;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
@@ -42,23 +43,28 @@
  org.eclipse.wst.sse.ui.internal.ui;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
  org.eclipse.wst.sse.ui.internal.util;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
  org.eclipse.wst.sse.ui.internal.view.events;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
+ org.eclipse.wst.sse.ui.preferences,
+ org.eclipse.wst.sse.ui.quickoutline,
+ org.eclipse.wst.sse.ui.reconcile,
+ org.eclipse.wst.sse.ui.typing,
  org.eclipse.wst.sse.ui.views.contentoutline,
  org.eclipse.wst.sse.ui.views.properties
-Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.debug.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.editors;bundle-version="[3.4.0,4.0.0)";visibility:=reexport,
- org.eclipse.search;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.forms;bundle-version="[3.3.100,3.4.0)",
- org.eclipse.ui.views;bundle-version="[3.3.0,4.0.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.0,1.3.0)",
+Import-Package: com.ibm.icu.util; version="3.8",
+ com.ibm.icu.text; version="3.8"
+Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.jface.text;bundle-version="[3.6.0,4.0.0)",
+ org.eclipse.debug.ui;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.editors;bundle-version="[3.5.0,4.0.0)";visibility:=reexport,
+ org.eclipse.search;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.forms;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.ui.views;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.validation;bundle-version="[1.2.100,1.3.0)",
  org.eclipse.emf.common;bundle-version="[2.4.0,3.0.0)",
- com.ibm.icu;bundle-version="[3.8.1,4.0.0)",
- org.eclipse.core.expressions;bundle-version="[3.3.0,4.0.0)"
+ org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)"
 Bundle-ActivationPolicy: lazy
 Eclipse-LazyStart: true
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.sse.ui/about.html b/bundles/org.eclipse.wst.sse.ui/about.html
index 73db36e..2199df3 100644
--- a/bundles/org.eclipse.wst.sse.ui/about.html
+++ b/bundles/org.eclipse.wst.sse.ui/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/bundles/org.eclipse.wst.sse.ui/build.properties b/bundles/org.eclipse.wst.sse.ui/build.properties
index 284e595..a080c98 100644
--- a/bundles/org.eclipse.wst.sse.ui/build.properties
+++ b/bundles/org.eclipse.wst.sse.ui/build.properties
@@ -26,5 +26,5 @@
                html/
 source.. = src/,\
            src-extensions/,\
-           src-encoding,\
+           src-encoding/,\
            src-tasktags/
diff --git a/bundles/org.eclipse.wst.sse.ui/plugin.properties b/bundles/org.eclipse.wst.sse.ui/plugin.properties
index 20dbc0d..7044196 100644
--- a/bundles/org.eclipse.wst.sse.ui/plugin.properties
+++ b/bundles/org.eclipse.wst.sse.ui/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2008 IBM Corporation and others.
+# Copyright (c) 2001, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
 #     Jens Lukowski/Innoopract - initial renaming/restructuring
 #     David Carver - bug 212330 - migrate to org.eclipse.ui.menus extension point     
 ###############################################################################
-providerName=Eclipse.org
+providerName=Eclipse Web Tools Platform
 pluginName=Structured Source Editor
 Standalone_Structured_Source_Editor.name=Standalone Structured Source Editor
 # Names on preferences pages
@@ -26,6 +26,10 @@
 Drop_Target_Transfers_Extension.name=Drop Target Transfers Extension
 Extended_Editor_Configuration_Extension.name=Extended Editor Configuration Extension
 quickFixProcessor=Quick Fix Processor Extension
+Semantic_Highlighting_Extension.name=Semantic Highlighting Extension
+Character_Pairing.name=Character Pairing Extension
+Completion_Proposal.name=Completion Proposal
+Completion_Proposal_Categories_Configuration.name=Completion Proposal Categories Configuration
 ##########################################################################
 # These strings are used in Workbench Keys Preferences
 ##########################################################################
@@ -33,13 +37,10 @@
 scope.structuredTextEditor.description=Editing in Structured Text Editors
 command.toggle.comment.name=Toggle Comment
 command.toggle.comment.description=Toggle Comment
-command.toggle.comment.mnemonic=T
 command.add.block.comment.name=Add Block Comment
 command.add.block.comment.description=Add Block Comment
-command.add.block.comment.mnemonic=A
 command.remove.block.comment.name=Remove Block Comment
 command.remove.block.comment.description=Remove Block Comment
-command.remove.block.comment.mnemonic=R
 command.cleanup.document.name=Cleanup Document...
 command.cleanup.document.description=Cleanup document
 command.cleanup.document.mnemonic=C
@@ -55,6 +56,8 @@
 command.search.find.occurrences.name=Occurrences in File
 command.search.find.occurrences.description=Find occurrences of the selection in the file
 command.search.find.occurrences.mnemonic=O
+command.information.quick_outline.name=Quick Outline
+command.information.quick_outline.description=Show the quick outline for the editor input
 ActionDefinition.selectEnclosing.name=Select Enclosing Element
 ActionDefinition.selectEnclosing.description=Expand selection to include enclosing element
 ActionDefinition.selectNext.name=Select Next Element
@@ -90,7 +93,7 @@
 #Spell_Check_label=Spell Check
 #Spell_Check_tooltip=Spell Check
 preferenceKeywords.todo=case sensitive task tag todo xxx fix fixme project specific projectspecific comments
-preferenceKeywords.sseeditor=structured text editor source xml html jsp appearance highlight matching brackets report problems type validation inform unsupported content folding color hovers modifier
+preferenceKeywords.sseeditor=structured text editor source xml html jsp appearance highlight matching brackets report problems type validation inform unsupported content folding color hovers modifier semantic
 ExpandSelectionTo=Expand Selection To
 SmartInsert_label=Sma&rt Insert Mode
 StructureSelectEnclosing_label=Enclosing Element
@@ -100,4 +103,9 @@
 StructureSelectPrevious_label=Previous Element
 StructureSelectPrevious_tooltip=Expand selection to include previous sibling
 StructureSelectHistory_label=Restore Last Selection
-StructureSelectHistory_tooltip=Restore last selection
\ No newline at end of file
+StructureSelectHistory_tooltip=Restore last selection
+
+Colors.content_assist_proposals_background=Content Assist Proposals Background
+Colors.content_assist_proposals_foreground=Content Assist Proposals Foreground
+Colors.content_assist_parameters_background=Content Assist Parameters Background
+Colors.content_assist_parameters_foreground=Content Assist Parameters Foreground
diff --git a/bundles/org.eclipse.wst.sse.ui/plugin.xml b/bundles/org.eclipse.wst.sse.ui/plugin.xml
index a98dccf..2bf3ff0 100644
--- a/bundles/org.eclipse.wst.sse.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.sse.ui/plugin.xml
@@ -4,17 +4,25 @@
 
 	<extension-point
 		id="adapterFactoryDescription"
-		name="%Adapter_Factory_Description_Extension.name" />
+		name="%Adapter_Factory_Description_Extension.name" ></extension-point>
 	<extension-point
 		id="extendedEditorActions"
-		name="%Extended_Editor_Actions_Extension.name" />
+		name="%Extended_Editor_Actions_Extension.name" ></extension-point>
 	<extension-point
 		id="dropTargetTransfers"
-		name="%Drop_Target_Transfers_Extension.name" />
+		name="%Drop_Target_Transfers_Extension.name" ></extension-point>
 	<extension-point
 		id="editorConfiguration"
 		name="%Extended_Editor_Configuration_Extension.name"
-		schema="schema/editorconfiguration.exsd" />
+		schema="schema/editorconfiguration.exsd" ></extension-point>
+	<extension-point
+		id="semanticHighlighting"
+		name="%Semantic_Highlighting_Extension.name"
+		schema="schema/semanticHighlighting.exsd" ></extension-point>
+	<extension-point
+		id="characterPairing"
+		name="%Character_Pairing.name"
+		schema="schema/characterPairing.exsd" ></extension-point>
 
 
 	<!-- Make sure default preference values are set at runtime -->
@@ -187,6 +195,12 @@
 			categoryId="org.eclipse.ui.category.edit"
 			id="org.eclipse.wst.sse.ui.search.find.occurrences">
 		</command>
+		<command
+			name="%command.information.quick_outline.name"
+			description="%command.information.quick_outline.description"
+			categoryId="org.eclipse.ui.category.navigate"
+			id="org.eclipse.wst.sse.ui.quick_outline">
+		</command>
 	</extension>
 	<!-- Keybinding scope for source editor -->
 	<extension point="org.eclipse.ui.contexts">
@@ -214,12 +228,40 @@
 			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
 		</key>
 		<key
+			sequence="M2+M3+ARROW_RIGHT"
+			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
+			commandId=""
+			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+			platform="carbon">
+		</key>
+		<key
+			sequence="M2+M4+ARROW_RIGHT"
+			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
+			commandId="org.eclipse.wst.sse.ui.structure.select.next"
+			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+			platform="carbon">
+		</key>
+		<key
 			sequence="M2+M3+ARROW_LEFT"
 			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
 			commandId="org.eclipse.wst.sse.ui.structure.select.previous"
 			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
 		</key>
 		<key
+			sequence="M2+M3+ARROW_LEFT"
+			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
+			commandId=""
+			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+			platform="carbon">
+		</key>
+		<key
+			sequence="M2+M4+ARROW_LEFT"
+			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
+			commandId="org.eclipse.wst.sse.ui.structure.select.previous"
+			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+			platform="carbon">
+		</key>
+		<key
 			sequence="M2+M3+ARROW_DOWN"
 			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
 			commandId="org.eclipse.wst.sse.ui.structure.select.last"
@@ -233,18 +275,38 @@
 			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
 		</key>
 		<key
+			sequence="M1+O"
+			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
+			commandId="org.eclipse.wst.sse.ui.quick_outline"
+			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
+		</key>
+		<key
 			sequence="M1+M2+/"
 			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
 			commandId="org.eclipse.wst.sse.ui.add.block.comment"
 			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
 		</key>
 		<key
+			sequence="M1+/"
+			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
+			commandId="org.eclipse.wst.sse.ui.add.block.comment"
+			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+			platform="carbon">
+		</key>
+		<key
 			sequence="M1+M2+\"
 			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
 			commandId="org.eclipse.wst.sse.ui.remove.block.comment"
 			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
 		</key>
 		<key
+			sequence="M1+\"
+			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
+			commandId="org.eclipse.wst.sse.ui.remove.block.comment"
+			schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+			platform="carbon">
+		</key>
+		<key
 			sequence="M1+M2+F"
 			contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
 			commandId="org.eclipse.wst.sse.ui.format.document"
@@ -454,10 +516,11 @@
 		</viewPage>
 	</extension>
 
-	<!-- extension point for breakpoint extension -->
+	<!-- extension point for toggling breakpoints -->
 	<extension-point
 		id="breakpoint"
-		name="%Breakpoint_Extension_Point.name" />
+		name="%Breakpoint_Extension_Point.name" 
+		schema="schema/org.eclipse.wst.sse.ui.breakpoint.exsd" />
 	<!-- extension point for source validation -->
 	<!-- interfaces for this extension point can be found in org.eclipse.wst.validation -->
 	<extension-point
@@ -468,6 +531,8 @@
 		id="quickFixProcessor" 
 		name="%quickFixProcessor" 
 		schema="schema/quickFixProcessor.exsd"/>
+ <extension-point id="completionProposal" name="%Completion_Proposal.name" schema="schema/completionProposal.exsd"/>
+ <extension-point id="completionProposalCategoriesConfiguration" name="%Completion_Proposal_Categories_Configuration.name" schema="schema/completionProposalCategoriesConfiguration.exsd"/>
  
 	<extension point="org.eclipse.ui.menus">
 		<menuContribution locationURI="menu:org.eclipse.ui.main.menu?after=edit">
@@ -486,15 +551,7 @@
 			<separator name="additions" visible="true"></separator>
 			<separator name="sourceEnd" visible="false"></separator>	
 		</menuContribution>
-		<menuContribution locationURI="popup:org.eclipse.wst.sse.ui.StructuredTextEditor.EditorContext?before=additions">
-		    <menu id="sourcePopupMenuId" label="%Source">
-				<separator name="sourceBegin" visible="false"></separator>
-				<separator name="additions" visible="true"></separator>
-				<separator name="sourceEnd" visible="false"></separator>	
-		    </menu>
-		    <menu id="refactorPopupMenuId" label="%Refactor">
-		    </menu>
-		</menuContribution>
+
 	    <menuContribution locationURI="menu:goTo?after=additions">
 		    <separator name="matchingBegin" visible="false"></separator>
 		    <command commandId="org.eclipse.wst.sse.ui.goto.matching.bracket" id="org.eclipse.wst.sse.ui.goto.matching.bracket" label="%ActionDefinition.gotoMatchingBracket.name" style="push">
@@ -504,6 +561,7 @@
 		    </command>
 			<separator name="matchingEnd" visible="false"></separator>
 		</menuContribution>
+		<!-- Contribute a Source menu for containers -->
      <menuContribution
            locationURI="popup:org.eclipse.ui.popup.any?after=additions">
         <menu
@@ -513,20 +571,8 @@
 	              commandId="org.eclipse.wst.sse.ui.format"
 	              id="sourceFormat"
 	              style="push">
-	           <visibleWhen checkEnabled="false">
-	              <or>
-					<iterate>
-						<adapt
-							type="org.eclipse.core.resources.IContainer">
-						</adapt>
-					</iterate>
-					<iterate>
-						<adapt
-							type="org.eclipse.core.resources.IFile">
-						</adapt>
-					</iterate>
-				 </or>	
-	           </visibleWhen>
+	           <!-- Check to make sure that the handler is enabled before making visible -->
+				<visibleWhen checkEnabled="true" />
 	        </command>
         </menu>
      </menuContribution>
@@ -537,13 +583,13 @@
 				</visibleWhen>
 			</command>
 		</menuContribution>
-	    <menuContribution locationURI="menu:edit?after=additions">
+	    <!--<menuContribution locationURI="menu:edit?after=additions">
 	       <command commandId="org.eclipse.ui.edit.text.toggleInsertMode" id="ToggleInsertMode" label="%SmartInsert_label" style="toggle">
 			   <visibleWhen checkEnabled="false">
 				   <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
 			   </visibleWhen>
 	       </command>	       
-		</menuContribution>
+		</menuContribution> -->
 	    <menuContribution locationURI="menu:expandSelectionToMenuId">
 	       <command commandId="org.eclipse.wst.sse.ui.structure.select.enclosing" id="org.eclipse.wst.sse.ui.structure.select.enclosing" label="%StructureSelectEnclosing_label" style="push">
 			   <visibleWhen checkEnabled="false">
@@ -566,32 +612,7 @@
 				</visibleWhen>
 	       </command>
 		</menuContribution>
-		<menuContribution locationURI="menu:sourceMenuId?after=sourceBegin">
-			<command commandId="org.eclipse.wst.sse.ui.toggle.comment"
-			         id="ToggleComment"
-			         mnemonic="%command.toggle.comment.mnemonic"
-			         style="push">
-				<visibleWhen checkEnabled="false">
-					<reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"/>
-				</visibleWhen>
-			</command>
-			<command commandId="org.eclipse.wst.sse.ui.add.block.comment"
-			         id="AddBlockComment"
-			         mnemonic="%command.add.block.comment.mnemonic"
-			         style="push">
-				<visibleWhen checkEnabled="false">
-					<reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"/>
-				</visibleWhen>
-			</command>
-			<command commandId="org.eclipse.wst.sse.ui.remove.block.comment"
-			         id="RemoveBlockComment"
-			         mnemonic="%command.remove.block.comment.mnemonic"
-			         style="push">
-				<visibleWhen checkEnabled="false">
-					<reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"/>
-				</visibleWhen>
-			</command>
-		</menuContribution>
+		
 
 		<menuContribution locationURI="menu:sourceMenuId?after=shiftBegin">
 			<command commandId="org.eclipse.ui.edit.text.shiftLeft"
@@ -642,22 +663,6 @@
 
 	     <menuContribution
 	           locationURI="popup:sourcePopupMenuId?after=sourceBegin">
-				<command commandId="org.eclipse.wst.sse.ui.toggle.comment" id="ToggleComment" style="push">
-					<visibleWhen checkEnabled="false">
-						<reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
-					</visibleWhen>
-				</command>
-				<command commandId="org.eclipse.wst.sse.ui.add.block.comment" id="AddBlockComment" style="push">
-					<visibleWhen checkEnabled="false">
-						<reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
-					</visibleWhen>
-				</command>
-				<command commandId="org.eclipse.wst.sse.ui.remove.block.comment" id="RemoveBlockComment" style="push">
-					<visibleWhen checkEnabled="false">
-						<reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
-					</visibleWhen>
-				</command>
-				<separator name="format" visible="true"></separator>
 				<command
 			           commandId="org.eclipse.wst.sse.ui.cleanup.document"
 			           id="CleanupDocument"
@@ -685,7 +690,7 @@
 						</visibleWhen>
 				</command>
 				
-	     </menuContribution>		
+	     </menuContribution>
 	</extension>
 	<extension
        point="org.eclipse.ui.commands">
@@ -694,13 +699,29 @@
 	          name="%command.format.document.name">
 	    </command>
 	</extension>
-	<extension
-       point="org.eclipse.ui.handlers">
-       <handler 
-             class="org.eclipse.wst.sse.ui.internal.handlers.FormatHandler"
-             commandId="org.eclipse.wst.sse.ui.format">
-       </handler>
+	
+	<!-- Enable the FormatHandler for Containers -->
+	<extension point="org.eclipse.ui.handlers">
+		<handler 
+			class="org.eclipse.wst.sse.ui.internal.handlers.FormatHandler"
+			commandId="org.eclipse.wst.sse.ui.format">
+			<activeWhen>
+				<iterate ifEmpty="false">
+					<adapt
+						type="org.eclipse.core.resources.IContainer">
+					</adapt>
+				</iterate>
+			</activeWhen>
+			<enabledWhen>
+				<iterate ifEmpty="false">
+					<adapt
+						type="org.eclipse.core.resources.IContainer">
+					</adapt>
+				</iterate>
+			</enabledWhen>
+		</handler>
 	</extension>
+	
 	<extension point="org.eclipse.core.expressions.definitions">
 		<definition id="org.eclipse.wst.sse.ui.sseActiveContext.definition">
             <with variable="activeContexts">
@@ -711,5 +732,53 @@
 		</definition>
 	</extension>
 	
+	<!-- Define theme -->
+	<extension
+		point="org.eclipse.ui.themes">
+		<theme
+			id="org.eclipse.ui.ide.systemDefault">
+			<colorOverride
+				id="content_assist_proposals_background"
+				value="COLOR_LIST_BACKGROUND">
+			</colorOverride>
+			<colorOverride
+				id="content_assist_proposals_foreground"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="content_assist_parameters_background"
+				value="COLOR_LIST_BACKGROUND">
+			</colorOverride>
+			<colorOverride
+				id="content_assist_parameters_foreground"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+		</theme>
+		<colorDefinition
+			id="content_assist_proposals_background"
+			isEditable="false"
+			label="%Colors.content_assist_proposals_background"
+			value="255,255,255">
+		</colorDefinition>
+		<colorDefinition
+			id="content_assist_proposals_foreground"
+			isEditable="false"
+			label="%Colors.content_assist_proposals_foreground"
+			value="0,0,0">
+		</colorDefinition>
+		<colorDefinition
+			id="content_assist_parameters_background"
+			isEditable="false"
+			label="%Colors.content_assist_parameters_background"
+			value="255,255,255">
+		</colorDefinition>
+		<colorDefinition
+			id="content_assist_parameters_foreground"
+			isEditable="false"
+			label="%Colors.content_assist_parameters_foreground"
+			value="0,0,0">
+		</colorDefinition>
+	</extension>
+	
 </plugin>
 
diff --git a/development/org.eclipse.wst.sse.unittests/schema/additionalTests.exsd b/bundles/org.eclipse.wst.sse.ui/schema/characterPairing.exsd
similarity index 63%
rename from development/org.eclipse.wst.sse.unittests/schema/additionalTests.exsd
rename to bundles/org.eclipse.wst.sse.ui/schema/characterPairing.exsd
index e0e5893..f6b731e 100644
--- a/development/org.eclipse.wst.sse.unittests/schema/additionalTests.exsd
+++ b/bundles/org.eclipse.wst.sse.ui/schema/characterPairing.exsd
@@ -1,123 +1,131 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.unittests">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.eclipse.wst.sse.unittests" id="additionalTests" name="%additionalTests"/>
-      </appInfo>
-      <documentation>
-         This extension point provides a way to add extra test cases and suites to the already running list without declaring a runtime dependency in this plug-in.
-      </documentation>
-   </annotation>
-
-   <element name="extension">
-      <complexType>
-         <choice minOccurs="0" maxOccurs="unbounded">
-            <element ref="test"/>
-            <element ref="suite"/>
-         </choice>
-         <attribute name="point" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="id" type="string">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="name" type="string">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-               <appInfo>
-                  <meta.attribute translatable="true"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="test">
-      <annotation>
-         <documentation>
-            Adds an individual Test case to run.
-         </documentation>
-      </annotation>
-      <complexType>
-         <attribute name="class" type="string" use="required">
-            <annotation>
-               <documentation>
-                  The Test class name.
-               </documentation>
-               <appInfo>
-                  <meta.attribute kind="java" basedOn="junit.framework.Test:"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="suite">
-      <annotation>
-         <documentation>
-            Adds a TestSuite to run.
-         </documentation>
-      </annotation>
-      <complexType>
-         <attribute name="class" type="string" use="required">
-            <annotation>
-               <documentation>
-                  The TestSuite class name.
-               </documentation>
-               <appInfo>
-                  <meta.attribute kind="java" basedOn="junit.framework.TestSuite:"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="since"/>
-      </appInfo>
-      <documentation>
-         [Enter the first release in which this extension point appears.]
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="examples"/>
-      </appInfo>
-      <documentation>
-         [Enter extension point usage example here.]
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="apiInfo"/>
-      </appInfo>
-      <documentation>
-         [Enter API information here.]
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="implementation"/>
-      </appInfo>
-      <documentation>
-         [Enter information about supplied implementation of this extension point.]
-      </documentation>
-   </annotation>
-
-
-</schema>
+<?xml version='1.0' encoding='UTF-8'?>

+<!-- Schema file written by PDE -->

+<schema targetNamespace="org.eclipse.wst.sse.ui" xmlns="http://www.w3.org/2001/XMLSchema">

+<annotation>

+      <appInfo>

+         <meta.schema plugin="org.eclipse.wst.sse.ui" id="characterPairing" name="Character Pairing"/>

+      </appInfo>

+      <documentation>

+         [Enter description of this extension point.]

+      </documentation>

+   </annotation>

+

+   <element name="extension">

+      <annotation>

+         <appInfo>

+            <meta.element />

+         </appInfo>

+      </annotation>

+      <complexType>

+         <sequence>

+            <element ref="inserter" minOccurs="0" maxOccurs="unbounded"/>

+         </sequence>

+         <attribute name="point" type="string" use="required">

+            <annotation>

+               <documentation>

+                  

+               </documentation>

+            </annotation>

+         </attribute>

+         <attribute name="id" type="string">

+            <annotation>

+               <documentation>

+                  

+               </documentation>

+            </annotation>

+         </attribute>

+         <attribute name="name" type="string">

+            <annotation>

+               <documentation>

+                  

+               </documentation>

+               <appInfo>

+                  <meta.attribute translatable="true"/>

+               </appInfo>

+            </annotation>

+         </attribute>

+      </complexType>

+   </element>

+

+   <element name="inserter">

+      <complexType>

+         <sequence>

+            <element ref="contentTypeIdentifier" minOccurs="1" maxOccurs="unbounded"/>

+         </sequence>

+         <attribute name="class" type="string" use="required">

+            <annotation>

+               <documentation>

+                  

+               </documentation>

+               <appInfo>

+                  <meta.attribute kind="java" basedOn="org.eclipse.wst.sse.ui.AbstractCharacterPairInserter:"/>

+               </appInfo>

+            </annotation>

+         </attribute>

+         <attribute name="id" type="string" use="required">

+            <annotation>

+               <documentation>

+                  

+               </documentation>

+            </annotation>

+         </attribute>

+      </complexType>

+   </element>

+

+   <element name="contentTypeIdentifier">

+      <complexType>

+         <attribute name="id" type="string" use="required">

+            <annotation>

+               <documentation>

+                  

+               </documentation>

+            </annotation>

+         </attribute>

+         <attribute name="partitions" type="string" use="required">

+            <annotation>

+               <documentation>

+                  

+               </documentation>

+            </annotation>

+         </attribute>

+      </complexType>

+   </element>

+

+   <annotation>

+      <appInfo>

+         <meta.section type="since"/>

+      </appInfo>

+      <documentation>

+         [Enter the first release in which this extension point appears.]

+      </documentation>

+   </annotation>

+

+   <annotation>

+      <appInfo>

+         <meta.section type="examples"/>

+      </appInfo>

+      <documentation>

+         [Enter extension point usage example here.]

+      </documentation>

+   </annotation>

+

+   <annotation>

+      <appInfo>

+         <meta.section type="apiinfo"/>

+      </appInfo>

+      <documentation>

+         [Enter API information here.]

+      </documentation>

+   </annotation>

+

+   <annotation>

+      <appInfo>

+         <meta.section type="implementation"/>

+      </appInfo>

+      <documentation>

+         [Enter information about supplied implementation of this extension point.]

+      </documentation>

+   </annotation>

+

+

+</schema>

diff --git a/bundles/org.eclipse.wst.sse.ui/schema/completionProposal.exsd b/bundles/org.eclipse.wst.sse.ui/schema/completionProposal.exsd
new file mode 100644
index 0000000..c0a8a1f
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/schema/completionProposal.exsd
@@ -0,0 +1,282 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.wst.sse.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appInfo>
+         <meta.schema plugin="org.eclipse.wst.sse.ui" id="completionProposal" name="SSE Completion Proposal"/>
+      </appInfo>
+      <documentation>
+         This extension point allows the contribution of SSE completion proposal computers and categories to participate in the content assist process of SSE editors.
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appInfo>
+            <meta.element labelAttribute="name" />
+         </appInfo>
+      </annotation>
+      <complexType>
+         <sequence>
+            <choice minOccurs="0" maxOccurs="unbounded">
+               <element ref="proposalCategory" minOccurs="0" maxOccurs="unbounded"/>
+               <element ref="proposalComputer" minOccurs="0" maxOccurs="unbounded"/>
+               <element ref="proposalComputerExtendedActivation" minOccurs="0" maxOccurs="unbounded"/>
+            </choice>
+         </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="proposalCategory">
+      <annotation>
+         <documentation>
+            A proposal category contribution defines categories of proposals used to group them in the UI.
+         </documentation>
+      </annotation>
+      <complexType>
+         <attribute name="id" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The unique ID of the proposal category
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  The name of the proposal category.  If a name is not provided the proposal category ID will be used as the name.
+               </documentation>
+               <appInfo>
+                  <meta.attribute translatable="true"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+         <attribute name="icon" type="string">
+            <annotation>
+               <documentation>
+                  An optional icon of the category, which can be displayed in the user preferences
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="resource"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="proposalComputer">
+      <annotation>
+         <documentation>
+            A proposal computer contribution which is associated with at least one content type.
+         </documentation>
+      </annotation>
+      <complexType>
+         <sequence>
+            <element ref="contentType" minOccurs="1" maxOccurs="unbounded"/>
+         </sequence>
+         <attribute name="id" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The unique ID of the proposal computer.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  The human readable name of the proposal computer.  If none is given the ID of the proposal computer will be used.
+               </documentation>
+               <appInfo>
+                  <meta.attribute translatable="true"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+         <attribute name="icon" type="string">
+            <annotation>
+               <documentation>
+                  An optional icon of the computer, which will be used when creating the proposals suggested by this computer.  This preference can be programicly overwriten by the implimentation of &lt;code&gt;org.eclipse.wst.sse.ui.internal.provisional.contentassist.ICompletionProposalComputer&lt;/code&gt; specified by the &lt;tt&gt;class&lt;/tt&gt; attribute.
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="resource"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+         <attribute name="class" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The class that implements the contributed computer. The
+class must be public and implement
+&lt;code&gt;org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer&lt;/code&gt;
+and must have a public 0-argument constructor.
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn=":org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+         <attribute name="activate" type="boolean" use="default" value="false">
+            <annotation>
+               <documentation>
+                  If the attribute is set to &lt;code&gt;true&lt;/code&gt; it will force this plug-in to be loaded on content assist invocation
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="categoryId" type="string" use="default" value="org.eclipse.wst.sse.ui.defaultProposalCategory">
+            <annotation>
+               <documentation>
+                  The id of a &lt;tt&gt;proposalCategory&lt;/tt&gt; that this proposal computer should be a part of
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="identifier" basedOn="org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="contentType">
+      <annotation>
+         <documentation>
+            A SSE content type. If no partition types are provided then computer will be associated with all partition types in the content type.
+         </documentation>
+      </annotation>
+      <complexType>
+         <sequence>
+            <element ref="partitionType" minOccurs="0" maxOccurs="unbounded"/>
+         </sequence>
+         <attribute name="id" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The ID of the content type
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="identifier" basedOn="org.eclipse.core.contenttype.contentTypes/content-type/@id"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="partitionType">
+      <annotation>
+         <documentation>
+            A SSE partition type.
+         </documentation>
+      </annotation>
+      <complexType>
+         <attribute name="id" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The ID of the partition type.
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="proposalComputerExtendedActivation">
+      <annotation>
+         <documentation>
+            Used to extended the activation context of an already existing proposal computer.  Use this if there is a plugin A that has defined a proposal comptuer that should be activated for a content type defined in plugin B.
+         </documentation>
+      </annotation>
+      <complexType>
+         <sequence>
+            <element ref="contentType" minOccurs="1" maxOccurs="unbounded"/>
+         </sequence>
+         <attribute name="id" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The ID of the &lt;tt&gt;proposalComputer&lt;/tt&gt; whos activation context should be extended.
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="identifier" basedOn="org.eclipse.wst.sse.ui.completionProposal/proposalComputer/@id"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+
+   <annotation>
+      <appInfo>
+         <meta.section type="examples"/>
+      </appInfo>
+      <documentation>
+         &lt;p&gt;The following are examples of SSE completion proposal contributions:&lt;/p&gt;
+
+&lt;b&gt;Plugin A:&lt;/b&gt;&lt;pre&gt;&lt;extension point=&quot;org.eclipse.wst.sse.ui.completionProposal&quot;&gt;
+  &lt;proposalCategory
+      icon=&quot;icons/full/obj16/tag-macro.gif&quot;
+      id=&quot;org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates&quot;
+      name=&quot;XML Templates&quot;&gt;
+  &lt;/proposalCategory&gt;
+  &lt;proposalComputer
+      activate=&quot;false&quot;
+      categoryId=&quot;org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates&quot;
+      class=&quot;org.eclipse.wst.xml.ui.internal.contentassist.XMLTemplatesCompletionProposalComputer&quot;
+      id=&quot;org.eclipse.wst.xml.ui.proposalComputer.xmlTemplates&quot;&gt;
+    &lt;contentType
+        id=&quot;org.eclipse.core.runtime.xml&quot;&gt;
+    &lt;/contentType&gt;
+  &lt;/proposalComputer&gt;
+&lt;/extension&gt;&lt;/pre&gt;
+&lt;b&gt;Plugin B:&lt;/b&gt; (extending the activation context of an existing computer)&lt;pre&gt;&lt;extension point=&quot;org.eclipse.wst.sse.ui.completionProposal&quot;&gt;
+  &lt;proposalComputerExtendedActivation
+      id=&quot;org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates&quot;&gt;
+    &lt;contentType
+        id=&quot;org.eclipse.jst.jsp.core.jspsource&quot;&gt;
+      &lt;partitionType
+          id=&quot;org.eclipse.wst.xml.XML_DEFAULT&quot;&gt;
+      &lt;/partitionType&gt;
+    &lt;/contentType&gt;
+  &lt;/proposalComputerExtendedActivation&gt;
+&lt;/extension&gt;&lt;/pre&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="apiinfo"/>
+      </appInfo>
+      <documentation>
+         The contributed class must impliment &lt;code&gt;org.eclipse.wst.sse.ui.internal.provisional.contentassist.ICompletionProposalComputer&lt;/code&gt;
+      </documentation>
+   </annotation>
+
+
+   <annotation>
+      <appInfo>
+         <meta.section type="copyright"/>
+      </appInfo>
+      <documentation>
+         Copyright (c) 2010 IBM Corporation and others.
+All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at &lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
+      </documentation>
+   </annotation>
+
+</schema>
diff --git a/bundles/org.eclipse.wst.sse.ui/schema/completionProposalCategoriesConfiguration.exsd b/bundles/org.eclipse.wst.sse.ui/schema/completionProposalCategoriesConfiguration.exsd
new file mode 100644
index 0000000..c8f40f4
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/schema/completionProposalCategoriesConfiguration.exsd
@@ -0,0 +1,126 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.wst.sse.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appInfo>
+         <meta.schema plugin="org.eclipse.wst.sse.ui" id="completionProposalCategoriesConfiguration" name="Completion Proposal Categories Configuration"/>
+      </appInfo>
+      <documentation>
+         This extension point allows the contribution of completion proposal category configuration readers.  These are used to determine which completion categories contributed by &lt;tt&gt;org.eclipse.wst.sse.ui.completionProposal&lt;/tt&gt; extensions are turned on by preference (either programatic or user).  If a completion proposal category configuration reader exists for a given content type the reader will be consulted to determine which completion categories to use when generating completion proposals.
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appInfo>
+            <meta.element labelAttribute="name" />
+         </appInfo>
+      </annotation>
+      <complexType>
+         <sequence>
+            <element ref="categoriesConfiguration" 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="categoriesConfiguration">
+      <complexType>
+         <attribute name="contentTypeID" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The ID of the content type
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="identifier" basedOn="org.eclipse.core.contenttype.contentTypes/content-type/@id"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+         <attribute name="class" type="string">
+            <annotation>
+               <documentation>
+                  The class that impliments the contributed completion proposal categories configuration.  The class must be public and impliment either &lt;code&gt;org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader&lt;/code&gt; or &lt;code&gt;org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter&lt;/code&gt;.
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn=":org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+
+   <annotation>
+      <appInfo>
+         <meta.section type="examples"/>
+      </appInfo>
+      <documentation>
+         &lt;p&gt;The following are examples of a SSE completion proposal computer contribution:&lt;/p&gt;
+&lt;pre&gt;&lt;extension
+    point=&quot;org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration&quot;&gt;
+  &lt;categoriesConfiguration
+    class=&quot;org.eclipse.wst.xml.ui.internal.preferences.XMLCompletionProposalCategoriesConfiguration&quot;
+    contentTypeID=&quot;org.eclipse.core.runtime.xml&quot;&gt;
+  &lt;/categoriesConfiguration&gt;
+&lt;/extension&gt;
+&lt;/pre&gt;
+&lt;/p&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="apiinfo"/>
+      </appInfo>
+      <documentation>
+         &lt;p&gt;The contributed class must impliment either &lt;code&gt;org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader&lt;/code&gt; or &lt;code&gt;org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter&lt;/code&gt;.&lt;/p&gt;
+
+&lt;p&gt;A reader implimentation should be used if the preferences can not be set by the user, if the preferences will be modified by the user then a writer implimentation should be used.&lt;/p&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="implementation"/>
+      </appInfo>
+      <documentation>
+         &lt;p&gt;See &lt;code&gt;org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration&lt;/code&gt; which if implimented by an adopter provides a usefull framework for reading and writing completion proposal categories configuration information to a preference store.&lt;/p&gt;
+
+&lt;p&gt;For a useful user interface for modifing completion proposal categories configurations see &lt;code&gt;org.eclipse.wst.sse.ui.preferences.CodeAssistCyclingConfigurationBlock&lt;/code&gt; which can easly be included on a preference page.&lt;/p&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="copyright"/>
+      </appInfo>
+      <documentation>
+         Copyright (c) 2010 IBM Corporation and others.
+All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at &lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
+      </documentation>
+   </annotation>
+
+</schema>
diff --git a/bundles/org.eclipse.wst.sse.ui/schema/editorconfiguration.exsd b/bundles/org.eclipse.wst.sse.ui/schema/editorconfiguration.exsd
index 250fec6..0f83484 100644
--- a/bundles/org.eclipse.wst.sse.ui/schema/editorconfiguration.exsd
+++ b/bundles/org.eclipse.wst.sse.ui/schema/editorconfiguration.exsd
@@ -1,6 +1,6 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.ui">
+<schema targetNamespace="org.eclipse.wst.sse.ui" xmlns="http://www.w3.org/2001/XMLSchema">
 <annotation>
       <appInfo>
          <meta.schema plugin="org.eclipse.wst.sse.ui" id="editorConfiguration" name="Editor Configuration"/>
@@ -11,6 +11,11 @@
    </annotation>
 
    <element name="extension">
+      <annotation>
+         <appInfo>
+            <meta.element />
+         </appInfo>
+      </annotation>
       <complexType>
          <sequence>
             <element ref="sourceViewerConfiguration" minOccurs="0" maxOccurs="unbounded"/>
@@ -20,6 +25,7 @@
             <element ref="doubleClickStrategy" minOccurs="0" maxOccurs="unbounded"/>
             <element ref="provisionalConfiguration" minOccurs="0" maxOccurs="unbounded"/>
             <element ref="provisionalDefinition" minOccurs="0" maxOccurs="unbounded"/>
+            <element ref="quickOutlineConfiguration" minOccurs="0" maxOccurs="unbounded"/>
          </sequence>
          <attribute name="point" type="string" use="required">
             <annotation>
@@ -234,7 +240,7 @@
                </documentation>
             </annotation>
          </attribute>
-         <attribute name="value" type="string">
+         <attribute name="value" type="string" use="required">
             <annotation>
                <documentation>
                   The value of this definition.
@@ -251,6 +257,33 @@
       </complexType>
    </element>
 
+   <element name="quickOutlineConfiguration">
+      <annotation>
+         <documentation>
+            Defines the configuration to be used when displaying editor input in the Tree layout for an editor&apos;s Quick Outline.
+         </documentation>
+      </annotation>
+      <complexType>
+         <attribute name="target" type="string" use="required">
+            <annotation>
+               <documentation>
+                  A string defining when to use this extension, either an editor or content type id.  Multiple targets may be given as a comma delimited value.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="class" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The class that provides implementation of the quick outline configuration.
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn="org.eclipse.wst.sse.ui.AbstractQuickOutlineConfiguration:"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
    <annotation>
       <appInfo>
          <meta.section type="since"/>
diff --git a/bundles/org.eclipse.wst.sse.ui/schema/org.eclipse.wst.sse.ui.breakpoint.exsd b/bundles/org.eclipse.wst.sse.ui/schema/org.eclipse.wst.sse.ui.breakpoint.exsd
new file mode 100644
index 0000000..0221b53
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/schema/org.eclipse.wst.sse.ui.breakpoint.exsd
@@ -0,0 +1,148 @@
+<?xml version='1.0' encoding='UTF-8'?>

+<!-- Schema file written by PDE -->

+<schema targetNamespace="org.eclipse.wst.sse.ui" xmlns="http://www.w3.org/2001/XMLSchema">

+<annotation>

+      <appInfo>

+         <meta.schema plugin="org.eclipse.wst.sse.ui" id="breakpoint" name="Breakpoint Providers"/>

+      </appInfo>

+      <documentation>

+         This extension point is provided to allow clients to provide support for adding their own breakpoint line markers with the StructuredTextEditor.

+      </documentation>

+   </annotation>

+

+   <element name="extension">

+      <annotation>

+         <appInfo>

+            <meta.element />

+         </appInfo>

+      </annotation>

+      <complexType>

+         <sequence>

+            <element ref="breakpointContribution" 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>

+            </annotation>

+         </attribute>

+      </complexType>

+   </element>

+

+   <element name="provider">

+      <complexType>

+         <attribute name="id" type="string">

+            <annotation>

+               <documentation>

+                  an optional identifier of the provider instance

+               </documentation>

+               <appInfo>

+                  <meta.attribute kind="identifier"/>

+               </appInfo>

+            </annotation>

+         </attribute>

+         <attribute name="class" type="string" use="required">

+            <annotation>

+               <documentation>

+                  An implementor of org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointProvider .

+               </documentation>

+               <appInfo>

+                  <meta.attribute kind="java" basedOn=":org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointProvider"/>

+               </appInfo>

+            </annotation>

+         </attribute>

+         <attribute name="contentTypes" type="string" use="required">

+            <annotation>

+               <documentation>

+                  A comma separated list of content type IDs for which this provider should be used.

+               </documentation>

+            </annotation>

+         </attribute>

+      </complexType>

+   </element>

+

+   <element name="breakpointContribution">

+      <complexType>

+         <choice>

+            <element ref="provider" minOccurs="1" maxOccurs="unbounded"/>

+         </choice>

+         <attribute name="id" type="string">

+            <annotation>

+               <documentation>

+                  an optional identifier of the contribution

+               </documentation>

+               <appInfo>

+                  <meta.attribute kind="identifier"/>

+               </appInfo>

+            </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 to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.&lt;/b&gt;

+      </documentation>

+   </annotation>

+

+   <annotation>

+      <appInfo>

+         <meta.section type="examples"/>

+      </appInfo>

+      <documentation>

+         Example demonstrating how Java stratum breakpoints are contributed when editing JSPs and tag files.

+&lt;pre&gt;

+ &lt;extension point=&quot;org.eclipse.wst.sse.ui.breakpoint&quot;&gt;

+  &lt;breakpointContribution id=&quot;org.eclipse.jst.jsp.ui.providers&quot;&gt;

+   &lt;provider

+    contentTypes=&quot;org.eclipse.jst.jsp.core.jspsource, org.eclipse.jst.jsp.core.tagsource&quot;

+    id=&quot;org.eclipse.jst.jsp.ui.internal.breakpointproviders.JavaStratumBreakpointProvider&quot;&gt;

+    class=&quot;org.eclipse.jst.jsp.ui.internal.breakpointproviders.JavaStratumBreakpointProvider&quot;/&gt;

+  &lt;/breakpointContribution&gt;

+ &lt;/extension&gt;

+&lt;/pre&gt;

+      </documentation>

+   </annotation>

+

+

+   <annotation>

+      <appInfo>

+         <meta.section type="implementation"/>

+      </appInfo>

+      <documentation>

+         A full implementation is available in org.eclipse.jst.jsp.ui.internal.breakpointproviders.JavaStratumBreakpointProvider

+      </documentation>

+   </annotation>

+

+   <annotation>

+      <appInfo>

+         <meta.section type="copyright"/>

+      </appInfo>

+      <documentation>

+         Copyright (c) 2009 IBM Corporation and others.&lt;br&gt;

+All rights reserved. This program and the accompanying materials are made 

+available under the terms of the Eclipse Public License v1.0 which accompanies 

+this distribution, and is available at &lt;a

+href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;

+      </documentation>

+   </annotation>

+

+</schema>

diff --git a/bundles/org.eclipse.wst.sse.ui/schema/org.eclipse.wst.sse.ui.sourcevalidation.exsd b/bundles/org.eclipse.wst.sse.ui/schema/org.eclipse.wst.sse.ui.sourcevalidation.exsd
index 5250d31..ee02eba 100644
--- a/bundles/org.eclipse.wst.sse.ui/schema/org.eclipse.wst.sse.ui.sourcevalidation.exsd
+++ b/bundles/org.eclipse.wst.sse.ui/schema/org.eclipse.wst.sse.ui.sourcevalidation.exsd
@@ -1,6 +1,6 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.ui">
+<schema targetNamespace="org.eclipse.wst.sse.ui" xmlns="http://www.w3.org/2001/XMLSchema">
 <annotation>
       <appInfo>
          <meta.schema plugin="org.eclipse.wst.sse.ui" id="sourcevalidation" name="Source Validation"/>
@@ -22,6 +22,11 @@
    </annotation>
 
    <element name="extension">
+      <annotation>
+         <appInfo>
+            <meta.element />
+         </appInfo>
+      </annotation>
       <complexType>
          <sequence>
             <element ref="validator"/>
@@ -62,17 +67,20 @@
                </documentation>
             </annotation>
          </attribute>
-         <attribute name="class" type="string">
+         <attribute name="class" type="string" use="required">
             <annotation>
                <documentation>
                   
                </documentation>
+               <appInfo>
+                  <meta.attribute kind="java"/>
+               </appInfo>
             </annotation>
          </attribute>
-         <attribute name="scope" type="string">
+         <attribute name="scope" type="string" use="required">
             <annotation>
                <documentation>
-                  
+                  Either &quot;total&quot; or &quot;partial&quot;, depending on whether all or just some of the document should be revalidated on changes.
                </documentation>
             </annotation>
          </attribute>
@@ -157,14 +165,6 @@
       </documentation>
    </annotation>
 
-   <annotation>
-      <appInfo>
-         <meta.section type="apiInfo"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
 
    <annotation>
       <appInfo>
diff --git a/bundles/org.eclipse.wst.sse.ui/schema/semanticHighlighting.exsd b/bundles/org.eclipse.wst.sse.ui/schema/semanticHighlighting.exsd
new file mode 100644
index 0000000..b14a843
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/schema/semanticHighlighting.exsd
@@ -0,0 +1,125 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.wst.sse.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appInfo>
+         <meta.schema plugin="org.eclipse.wst.sse.ui" id="semanticHighlighting" name="Semantic Highlighting"/>
+      </appInfo>
+      <documentation>
+         The Semantic Highlighting extension point allows plug-ins to contribute rules to the Structured Source Editor&apos;s semantic highlighting framework. Semantic highlighting is performed as a second pass after syntax highlighting.
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appInfo>
+            <meta.element />
+         </appInfo>
+      </annotation>
+      <complexType>
+         <sequence>
+            <element ref="highlighting" minOccurs="0" maxOccurs="unbounded"/>
+         </sequence>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appInfo>
+                  <meta.attribute translatable="true"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="highlighting">
+      <complexType>
+         <attribute name="target" type="string" use="required">
+            <annotation>
+               <documentation>
+                  A string defining when to use this extension.  It is the content type id.  Multiple targets may be given as a comma delimited value.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="class" type="string" use="required">
+            <annotation>
+               <documentation>
+                  Must implement org.eclipse.wst.sse.ui.ISemanticHighlighting to provide basic semantic highlighting information.
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn=":org.eclipse.wst.sse.ui.ISemanticHighlighting"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+         <attribute name="styleStringKey" type="string">
+            <annotation>
+               <documentation>
+                  The preference key that controls the style of the semantic highlighting. The style&apos;s value should be in the form: RGB foreground (#rrggbb) | RGB background (#rrggbb) | bold (true/false) | italic (true/false) | strikethrough (true/false) | underline (true/false)
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="since"/>
+      </appInfo>
+      <documentation>
+         3.1
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="examples"/>
+      </appInfo>
+      <documentation>
+         The following is the declaration of a semantic highlighting that is effective on org.eclipse.core.runtime.xml and org.eclipse.wst.xml.core.xmlsource content types. The &lt;code&gt;org.eclipse.wst.xml.ui.internal.style.NamespaceHighlighting&lt;/code&gt; determines the consumable regions of the document.
+&lt;pre&gt;
+ &lt;extension point=&quot;org.eclipse.wst.sse.ui.semanticHighlighting&quot;&gt;
+  &lt;highlighting
+        class=&quot;org.eclipse.wst.xml.ui.internal.style.NamespaceHighlighting&quot;
+        target=&quot;org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource&quot;&gt;
+  &lt;/highlighting&gt;
+ &lt;/extension&gt;
+&lt;/pre&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="apiinfo"/>
+      </appInfo>
+      <documentation>
+         See &lt;code&gt;org.eclipse.wst.sse.ui.ISemanticHighlighting&lt;/code&gt;
+      </documentation>
+   </annotation>
+
+
+   <annotation>
+      <appInfo>
+         <meta.section type="copyright"/>
+      </appInfo>
+      <documentation>
+         Copyright (c) 2009 IBM Corporation and others.
+All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at &lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
+      </documentation>
+   </annotation>
+
+</schema>
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ConfigurationPointCalculator.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ConfigurationPointCalculator.java
index 697420e..1aa8ae4 100644
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ConfigurationPointCalculator.java
+++ b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ConfigurationPointCalculator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -19,7 +19,8 @@
 import org.eclipse.core.runtime.content.IContentType;
 import org.eclipse.core.runtime.content.IContentTypeManager;
 import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPartSite;
 import org.eclipse.ui.part.MultiPageEditorSite;
 
 public class ConfigurationPointCalculator {
@@ -36,7 +37,7 @@
 	}
 
 	protected String fContentType = null;
-	protected IEditorPart fPart = null;
+	protected IWorkbenchPart fPart = null;
 
 	protected Class fRootClass = null;
 	protected String fSubContext = null;
@@ -51,39 +52,43 @@
 	public String[] getConfigurationPoints() {
 		List points = new ArrayList(2);
 
-		IEditorSite site = fPart.getEditorSite();
-		String id = site.getId();
-		if (id != null && id.length() > 0 && !id.equals(fRootClass.getName()))
-			points.add(id);
-
-		if (site instanceof MultiPageEditorSite) {
-			String multipageID = ((MultiPageEditorSite) site).getMultiPageEditor().getSite().getId();
-			if (!points.contains(multipageID))
-				points.add(multipageID);
-			String sourcePageID = ((MultiPageEditorSite) site).getMultiPageEditor().getSite().getId() + ".source"; //$NON-NLS-1$
-			if (!points.contains(sourcePageID))
-				points.add(sourcePageID);
-		}
-		if (site instanceof MultiPageEditorSite) {
-			String multipageClassName = ((MultiPageEditorSite) site).getMultiPageEditor().getClass().getName();
-			if (!points.contains(multipageClassName))
-				points.add(multipageClassName);
-		}
-		Class editorClass = fPart.getClass();
-		while (editorClass != null && fRootClass != null && !editorClass.equals(fRootClass)) {
-			if (!points.contains(editorClass.getName()))
-				points.add(editorClass.getName());
-			editorClass = editorClass.getSuperclass();
+		IWorkbenchPartSite site = null;
+		if (fPart != null) {
+			site = fPart.getSite();
+			String id = site.getId();
+			if (id != null && id.length() > 0 && !id.equals(fRootClass.getName()))
+				points.add(id);
+			if (site instanceof MultiPageEditorSite) {
+				String multipageID = ((MultiPageEditorSite) site).getMultiPageEditor().getSite().getId();
+				if (!points.contains(multipageID))
+					points.add(multipageID);
+				String sourcePageID = ((MultiPageEditorSite) site).getMultiPageEditor().getSite().getId() + ".source"; //$NON-NLS-1$
+				if (!points.contains(sourcePageID))
+					points.add(sourcePageID);
+			}
+			if (site instanceof MultiPageEditorSite) {
+				String multipageClassName = ((MultiPageEditorSite) site).getMultiPageEditor().getClass().getName();
+				if (!points.contains(multipageClassName))
+					points.add(multipageClassName);
+			}
+			Class editorClass = fPart.getClass();
+			while (editorClass != null && fRootClass != null && !editorClass.equals(fRootClass)) {
+				if (!points.contains(editorClass.getName()))
+					points.add(editorClass.getName());
+				editorClass = editorClass.getSuperclass();
+			}
 		}
 
-		IContentType contentType = Platform.getContentTypeManager().getContentType(fContentType);
-		while (contentType != null && !contentType.getId().equals(IContentTypeManager.CT_TEXT)) {
-			if (!points.contains(contentType.getId()))
-				points.add(contentType.getId());
-			contentType = contentType.getBaseType();
+		if (fContentType != null) {
+			IContentType contentType = Platform.getContentTypeManager().getContentType(fContentType);
+			while (contentType != null && !contentType.getId().equals(IContentTypeManager.CT_TEXT)) {
+				if (!points.contains(contentType.getId()))
+					points.add(contentType.getId());
+				contentType = contentType.getBaseType();
+			}
 		}
 
-		if (!points.contains(fRootClass.getName()))
+		if (fRootClass != null && !points.contains(fRootClass.getName()))
 			points.add(fRootClass.getName());
 		return (String[]) points.toArray(new String[0]);
 	}
@@ -98,7 +103,7 @@
 	/**
 	 * @return Returns the part.
 	 */
-	public IEditorPart getPart() {
+	public IWorkbenchPart getPart() {
 		return fPart;
 	}
 
@@ -128,7 +133,7 @@
 	 * @param part
 	 *            The part to set.
 	 */
-	public void setPart(IEditorPart part) {
+	public void setPart(IWorkbenchPart part) {
 		fPart = part;
 	}
 
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointProvider.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointProvider.java
index edfad13..b10cdf1 100644
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointProvider.java
+++ b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointProvider.java
@@ -40,7 +40,8 @@
 	 * @return IStatus the status after being asked to add a breakpoint. The
 	 *         Severity of ERROR should only be used if the location
 	 *         information is both valid for a breakpoint and one could not be
-	 *         added.
+	 *         added.  Any severity greater than INFO will be logged, and if
+	 *         no breakpoints were created, shown to the user.
 	 */
 	IStatus addBreakpoint(IDocument document, IEditorInput input, int lineNumber, int offset) throws CoreException;
 
diff --git a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/ExclusionsTab.java b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/ExclusionsTab.java
index 4bd4a5c..c6d9c5a 100644
--- a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/ExclusionsTab.java
+++ b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/ExclusionsTab.java
@@ -11,7 +11,6 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal.preferences.ui;
 
-import com.ibm.icu.text.Collator;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -48,6 +47,8 @@
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
 import org.eclipse.wst.sse.ui.internal.util.Sorter;
 
+import com.ibm.icu.text.Collator;
+
 class ExclusionsTab implements IPreferenceTab {
 	private class ArrayTreeContentProvider implements ITreeContentProvider {
 		public ArrayTreeContentProvider() {
@@ -233,11 +234,11 @@
 	public Control createContents(Composite tabFolder) {
 		Composite composite = new Composite(tabFolder, SWT.NONE);
 		composite.setLayout(new GridLayout(2, true));
-		Text description = new Text(composite, SWT.READ_ONLY);
+		Text description = new Text(composite, SWT.READ_ONLY | SWT.SINGLE);
 		description.setText(SSEUIMessages.TaskTagExclusionTab_02);
-		description.setBackground(composite.getBackground());
+//		description.setBackground(composite.getBackground());
 
-		fContentTypeList = new CheckboxTreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL);
+		fContentTypeList = new CheckboxTreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
 		fContentTypeList.setLabelProvider(new ContentTypeLabelProvider());
 		fContentTypeList.setContentProvider(new ArrayTreeContentProvider());
 
@@ -268,12 +269,12 @@
 
 		new Label(composite, SWT.NONE).setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
 
-		Text affectedTypesLabel = new Text(composite, SWT.READ_ONLY);
+		Text affectedTypesLabel = new Text(composite, SWT.READ_ONLY | SWT.SINGLE);
 		affectedTypesLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
-		affectedTypesLabel.setBackground(composite.getBackground());
+//		affectedTypesLabel.setBackground(composite.getBackground());
 		affectedTypesLabel.setText(SSEUIMessages.TaskTagExclusionTab_03);
 
-		final TreeViewer contentTypeTreeViewer = new TreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL);
+		final TreeViewer contentTypeTreeViewer = new TreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
 		contentTypeTreeViewer.setLabelProvider(new ContentTypeLabelProvider());
 		contentTypeTreeViewer.setContentProvider(new ContentTypeTreeProvider());
 		contentTypeTreeViewer.setInput(new Object[0]);
diff --git a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java
index 632eee6..6b633a0 100644
--- a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java
+++ b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java
@@ -209,7 +209,7 @@
 
 		Text description = new Text(composite, SWT.READ_ONLY | SWT.SINGLE);
 		description.setText(SSEUIMessages.TaskTagPreferenceTab_33); //$NON-NLS-1$
-		description.setBackground(composite.getBackground());
+//		description.setBackground(composite.getBackground());
 		GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
 		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=104403
 		Point sizeHint = description.computeSize(SWT.DEFAULT, SWT.DEFAULT);
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EditorExecutionContext.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EditorExecutionContext.java
index d9f69b3..b40d9a5 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EditorExecutionContext.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EditorExecutionContext.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,74 +12,146 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.ui;
 
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.IWorkbenchPartSite;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
 import org.eclipse.wst.sse.core.internal.IExecutionDelegate;
-
-
+import org.eclipse.wst.sse.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
 
 class EditorExecutionContext implements IExecutionDelegate {
 
+	/**
+	 * Reusable runnable for the Display execution queue to cut down on
+	 * garbage creation. Will make use of the progress service if possible.
+	 */
+	private static class ReusableUIRunner implements Runnable, IRunnableWithProgress {
+		private StructuredTextEditor editor;
+		private ISafeRunnable fRunnable = null;
+
+		ReusableUIRunner(StructuredTextEditor part) {
+			super();
+			editor = part;
+		}
+
+		/*
+		 * Expected to only be run by Display queue in the UI Thread
+		 * 
+		 * @see java.lang.Runnable#run()
+		 */
+		public void run() {
+			IWorkbenchPartSite site = editor.getEditorPart().getSite();
+			final IWorkbenchWindow workbenchWindow = (site == null) ? null : site.getWorkbenchWindow();
+			final IWorkbenchSiteProgressService jobService = (IWorkbenchSiteProgressService) ((site == null) ? null : site.getAdapter(IWorkbenchSiteProgressService.class));
+			/*
+			 * Try to use the progress service so the workbench can give more
+			 * feedback to the user (although editors seem to make less use of
+			 * the service than views -
+			 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=86221 .
+			 */
+			if (workbenchWindow != null && jobService != null) {
+				/*
+				 * Doc is ambiguous, but it must be run from the UI thread -
+				 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=165180
+				 */
+				try {
+					jobService.runInUI(workbenchWindow, this, (ISchedulingRule) editor.getEditorPart().getEditorInput().getAdapter(IResource.class));
+				}
+				catch (InvocationTargetException e) {
+					Logger.logException(e);
+				}
+				catch (InterruptedException e) {
+					Logger.logException(e);
+				}
+			}
+			else {
+				/*
+				 * Run it directly and direct the UI of the editor. See
+				 * StructuredTextEditor's begin/end background job for other
+				 * activities to best accommodate (for example, there is a
+				 * "timed delay" before the editor itself leaves
+				 * background-update mode). NOTE: this execute method itself
+				 * is always called from inside of an ILock block, so another
+				 * block is not not needed here for all these sycnExec's.
+				 */
+				IWorkbench workbench = SSEUIPlugin.getInstance().getWorkbench();
+				final Display display = workbench.getDisplay();
+				if (display != null && !display.isDisposed()) {
+					editor.beginBackgroundOperation();
+					try {
+						/*
+						 * Here's where the document update/modification
+						 * occurs
+						 */
+						SafeRunner.run(fRunnable);
+					}
+					finally {
+						/*
+						 * This 'end' is just a signal to editor that this
+						 * particular update is done. Its up to the editor to
+						 * decide exactly when to leave its "background mode"
+						 */
+						editor.endBackgroundOperation();
+					}
+				}
+				fRunnable = null;
+			}
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see
+		 * org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse
+		 * .core.runtime.IProgressMonitor)
+		 */
+		public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+			if (fRunnable != null)
+				SafeRunner.run(fRunnable);
+		}
+
+		void setRunnable(ISafeRunnable r) {
+			fRunnable = r;
+		}
+	}
 
 	StructuredTextEditor fEditor;
+	private ReusableUIRunner fReusableRunner;
 
 	public EditorExecutionContext(StructuredTextEditor editor) {
 		super();
 		fEditor = editor;
+		fReusableRunner = new ReusableUIRunner(fEditor);
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @see org.eclipse.wst.sse.core.internal.document.IExecutionDelegate#execute(java.lang.Runnable)
+	 * @see
+	 * org.eclipse.wst.sse.core.internal.IExecutionDelegate#execute(java.lang
+	 * .Runnable)
 	 */
-	public void execute(final Runnable runnable) {
-		IWorkbench workbench = PlatformUI.getWorkbench();
+	public void execute(final ISafeRunnable runnable) {
+		IWorkbench workbench = SSEUIPlugin.getInstance().getWorkbench();
 		final Display display = workbench.getDisplay();
 		if (display.getThread() == Thread.currentThread()) {
-			// if already in display thread, we can simply run, "as usual"
-			runnable.run();
-		} else {
-			// this is the part that's really new, that
-			// accomidate's a change in a document
-			// from background thread, by forcing it on
-			// the display thread.
-			final StructuredTextEditor editor = fEditor;
-			// if not in display thread, we "force" to run on display thread.
-			// see editors begin/end background job for other
-			// activities to best accomidate (for example, there
-			// is a "timed delay" before the editor itself leaves
-			// background-update mode).
-			// NOTE: this execute method itself is always called from
-			// inside of an ILock block, so another
-			// block is not not needed here for all these sycnExec's
-			display.syncExec(new Runnable() {
-				public void run() {
-					if (display != null && !display.isDisposed()) {
-						editor.beginBackgroundOperation();
-						try {
-							// here's where the document update/modification
-							// occurs
-							runnable.run();
-
-							// for future, possibly explore solutions such as
-							// this
-							//							IWorkbenchSiteProgressService jobService =
-							// (IWorkbenchSiteProgressService)
-							// editor.getEditorPart().getSite().getAdapter(IWorkbenchSiteProgressService.class);
-							//							jobService.runInUI(xxxxx)
-						} finally {
-							// this 'end' is just a signal to editor that this
-							// particular update is done. Its up to the editor
-							// to decide exactly when to leave its "background
-							// mode"
-							editor.endBackgroundOperation();
-						}
-					}
-				}
-			});
+			// *If already in display thread, we can simply run, "as usual"*/
+			SafeRunner.run(runnable);
+		}
+		else {
+			// *otherwise run through the reusable runner */
+			fReusableRunner.setRunnable(runnable);
+			display.syncExec(fReusableRunner);
 		}
 	}
 }
-
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EncodingSupport.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EncodingSupport.java
new file mode 100644
index 0000000..fd054ef
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EncodingSupport.java
@@ -0,0 +1,139 @@
+/*******************************************************************************

+ * Copyright (c) 2008 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+

+package org.eclipse.wst.sse.ui;

+

+import org.eclipse.ui.editors.text.DefaultEncodingSupport;

+import org.eclipse.ui.editors.text.IEncodingSupport;

+import org.eclipse.ui.texteditor.StatusTextEditor;

+import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;

+

+/**

+ * An implementation that will try to use a <b>provisional</b> configuration

+ * if IEncodingSupport.class as a delegate. A delegate, if found, will be

+ * asked for encoding information before defaulting to the superclass

+ * implementation, but will be told to set the encoding after the superclass

+ * has. Delegates should not duplicate any functionality in the

+ * DefaultEncodingSupport implementation as they may be executed in addition

+ * to the default behavior.

+ */

+class EncodingSupport extends DefaultEncodingSupport {

+	private String[] fConfigurationPoints = null;

+	/** The editor this support is associated with. */

+	private StatusTextEditor fStatusTextEditor;

+

+	IEncodingSupport fSupportDelegate = null;

+

+	EncodingSupport(String[] configurationPoints) {

+		super();

+		fConfigurationPoints = configurationPoints;

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see org.eclipse.ui.editors.text.DefaultEncodingSupport#dispose()

+	 */

+	public void dispose() {

+		super.dispose();

+

+		if (fSupportDelegate instanceof DefaultEncodingSupport) {

+			((DefaultEncodingSupport) fSupportDelegate).dispose();

+		}

+		fSupportDelegate = null;

+		fStatusTextEditor = null;

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @seeorg.eclipse.ui.editors.text.DefaultEncodingSupport#

+	 * getDefaultEncoding()

+	 */

+	public String getDefaultEncoding() {

+		IEncodingSupport delegate = getEncodingSupportDelegate();

+		if (delegate != null) {

+			return delegate.getDefaultEncoding();

+		}

+

+		return super.getDefaultEncoding();

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see org.eclipse.ui.editors.text.DefaultEncodingSupport#getEncoding ()

+	 */

+	public String getEncoding() {

+		IEncodingSupport delegate = getEncodingSupportDelegate();

+		if (delegate != null) {

+			return delegate.getEncoding();

+		}

+

+		return super.getEncoding();

+	}

+

+	IEncodingSupport getEncodingSupportDelegate() {

+		if (fSupportDelegate == null) {

+			ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();

+			for (int i = 0; fSupportDelegate == null && i < fConfigurationPoints.length; i++) {

+				fSupportDelegate = (IEncodingSupport) builder.getConfiguration(IEncodingSupport.class.getName(), fConfigurationPoints[i]);

+			}

+		}

+		return fSupportDelegate;

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see

+	 * org.eclipse.ui.editors.text.DefaultEncodingSupport#initialize(org.eclipse

+	 * .ui.texteditor.StatusTextEditor)

+	 */

+	public void initialize(StatusTextEditor textEditor) {

+		super.initialize(textEditor);

+		fStatusTextEditor = textEditor;

+

+		IEncodingSupport encodingSupportDelegate = getEncodingSupportDelegate();

+		if (encodingSupportDelegate instanceof DefaultEncodingSupport) {

+			((DefaultEncodingSupport) encodingSupportDelegate).initialize(textEditor);

+		}

+	}

+

+	void reinitialize(String[] configurationPoints) {

+		if (fSupportDelegate instanceof DefaultEncodingSupport) {

+			((DefaultEncodingSupport) fSupportDelegate).dispose();

+		}

+		fSupportDelegate = null;

+

+		fConfigurationPoints = configurationPoints;

+

+		IEncodingSupport encodingSupportDelegate = getEncodingSupportDelegate();

+		if (encodingSupportDelegate instanceof DefaultEncodingSupport) {

+			((DefaultEncodingSupport) encodingSupportDelegate).initialize(fStatusTextEditor);

+		}

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see org.eclipse.ui.editors.text.DefaultEncodingSupport#setEncoding

+	 * (java.lang.String, boolean)

+	 */

+	protected void setEncoding(String encoding, boolean overwrite) {

+		super.setEncoding(encoding, overwrite);

+

+		IEncodingSupport delegate = getEncodingSupportDelegate();

+		if (delegate != null && overwrite) {

+			delegate.setEncoding(encoding);

+		}

+	}

+}

diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/FoldingActionGroup.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/FoldingActionGroup.java
index 2121d02..7291cef 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/FoldingActionGroup.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/FoldingActionGroup.java
@@ -27,7 +27,7 @@
 import org.eclipse.ui.texteditor.TextOperationAction;
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
 import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
+import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy;
 
 class FoldingActionGroup extends ActionGroup {
 	private static abstract class PreferenceAction extends ResourceAction implements IUpdate {
@@ -81,8 +81,8 @@
 		fToggle = new PreferenceAction(SSEUIMessages.getResourceBundle(), "Projection_Toggle_", IAction.AS_CHECK_BOX) { //$NON-NLS-1$
 			public void run() {
 				IPreferenceStore store = SSEUIPlugin.getDefault().getPreferenceStore();
-				boolean current = store.getBoolean(IStructuredTextFoldingProvider.FOLDING_ENABLED);
-				store.setValue(IStructuredTextFoldingProvider.FOLDING_ENABLED, !current);
+				boolean current = store.getBoolean(AbstractStructuredFoldingStrategy.FOLDING_ENABLED);
+				store.setValue(AbstractStructuredFoldingStrategy.FOLDING_ENABLED, !current);
 			}
 
 			public void update() {
@@ -94,7 +94,7 @@
 		};
 		
 		IPreferenceStore store = SSEUIPlugin.getDefault().getPreferenceStore();
-		boolean checked = store.getBoolean(IStructuredTextFoldingProvider.FOLDING_ENABLED);
+		boolean checked = store.getBoolean(AbstractStructuredFoldingStrategy.FOLDING_ENABLED);
 		fToggle.setChecked(checked);
 		fToggle.setActionDefinitionId(IFoldingCommandIds.FOLDING_TOGGLE);
 		editor.setAction("FoldingToggle", fToggle); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/IContentSelectionProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/IContentSelectionProvider.java
new file mode 100644
index 0000000..84ab191
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/IContentSelectionProvider.java
@@ -0,0 +1,13 @@
+package org.eclipse.wst.sse.ui;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.TreeViewer;
+
+/**
+ * Allows contributors to redefine a selection when provided with the current
+ * selection.
+ * 
+ */
+public interface IContentSelectionProvider {
+	ISelection getSelection(TreeViewer viewer, ISelection selection);
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ISemanticHighlighting.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ISemanticHighlighting.java
new file mode 100644
index 0000000..f8193de
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ISemanticHighlighting.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.Position;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+
+/**
+ * This interface defines preferences and consumability for semantic highlighting.
+ * The preference keys provided by the implementation are stored within the preference store
+ * provided by the implementation. When a region is consumable by the semantic highlighting,
+ * the implementation provides an array of positions to style.
+ * 
+ * @since 3.1
+ *
+ */
+public interface ISemanticHighlighting {
+	
+	/**
+	 * The preference key that controls the text's bold attribute for the semantic highlighting
+	 * @return the bold preference key
+	 */
+	public String getBoldPreferenceKey();
+	
+	/**
+	 * The preference key that controls the text's underline attribute for the semantic highlighting
+	 * @return the bold preference key
+	 */
+	public String getUnderlinePreferenceKey();
+	
+	/**
+	 * The preference key that controls the text's strikethrough attribute for the semantic highlighting
+	 * @return the bold preference key
+	 */
+	public String getStrikethroughPreferenceKey();
+	
+	/**
+	 * The preference key that controls the text's italic attribute for the semantic highlighting
+	 * @return the bold preference key
+	 */
+	public String getItalicPreferenceKey();
+	
+	/**
+	 * The preference key that controls the text's color attribute for the semantic highlighting
+	 * @return the bold preference key
+	 */
+	public String getColorPreferenceKey();
+	
+	/**
+	 * The preference store that maintains the preferences for the semantic highlighting
+	 * @return the bold preference key
+	 */
+	public IPreferenceStore getPreferenceStore();
+	
+	/**
+	 * The preference key that controls if the semantic highlighting is enabled
+	 * @return the bold preference key
+	 */
+	public String getEnabledPreferenceKey();
+
+	/**
+	 * @return the display name
+	 */
+	public String getDisplayName();
+
+	/**
+	 * Returns an array of positions iff the semantic highlighting consumes any part of the structured document region.
+	 * <p>
+	 * NOTE: Implementors are not allowed to keep a reference on the region or on any object
+	 * retrieved from the region.
+	 * </p>
+	 *
+	 * @param region the structured document region
+	 * @return an array of positions to consume iff the semantic highlighting consumes any part of the structured document region, otherwise null
+	 */
+	public Position[] consumes(IStructuredDocumentRegion region);
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ISemanticHighlightingExtension.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ISemanticHighlightingExtension.java
new file mode 100644
index 0000000..b73398e
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ISemanticHighlightingExtension.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui;
+
+import org.eclipse.jface.text.Position;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+
+/**
+ * Extends {@link org.eclipse.wst.sse.ui.ISemanticHighlighting} allowing clients to
+ * define consumability with respect to indexed regions containing the structured
+ * document region.
+ * 
+ */
+public interface ISemanticHighlightingExtension {
+
+	/**
+	 * Returns an array of positions iff the semantic highlighting consumes any part of the structured document region
+	 *
+	 * <p>
+	 * NOTE: Implementors are not allowed to keep a reference on the either regions or on any object
+	 * retrieved from the regions.
+	 * </p>
+	 *
+	 * @param documentRegion the structured document region
+	 * @param indexedRegion the indexed region that contains the <code>documentRegion</code>
+	 * @return an array of positions to consume iff the semantic highlighting consumes any part of the structured document region, otherwise null
+	 */
+	public Position[] consumes(IStructuredDocumentRegion documentRegion, IndexedRegion indexedRegion);
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java
index ca6fc96..659e4da 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,15 +13,16 @@
 package org.eclipse.wst.sse.ui;
 
 import java.io.IOException;
-import java.lang.ref.Reference;
-import java.lang.ref.SoftReference;
 import java.lang.reflect.Method;
 import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashSet;
 import java.util.Iterator;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.ResourceBundle;
+import java.util.Set;
 import java.util.Timer;
 import java.util.TimerTask;
 
@@ -29,17 +30,19 @@
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
 import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ISafeRunnable;
 import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.core.runtime.content.IContentTypeManager;
 import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
 import org.eclipse.emf.common.command.Command;
 import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.GroupMarker;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.action.IStatusLineManager;
@@ -47,8 +50,10 @@
 import org.eclipse.jface.action.Separator;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.text.AbstractInformationControlManager;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.DefaultInformationControl;
+import org.eclipse.jface.text.IBlockTextSelection;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IInformationControl;
 import org.eclipse.jface.text.IInformationControlCreator;
@@ -61,11 +66,16 @@
 import org.eclipse.jface.text.ITextViewerExtension;
 import org.eclipse.jface.text.ITextViewerExtension2;
 import org.eclipse.jface.text.ITextViewerExtension5;
+import org.eclipse.jface.text.ITypedRegion;
 import org.eclipse.jface.text.Region;
 import org.eclipse.jface.text.TextSelection;
 import org.eclipse.jface.text.contentassist.ContentAssistant;
 import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.information.IInformationPresenter;
+import org.eclipse.jface.text.information.IInformationProvider;
 import org.eclipse.jface.text.information.InformationPresenter;
+import org.eclipse.jface.text.reconciler.IReconciler;
+import org.eclipse.jface.text.source.Annotation;
 import org.eclipse.jface.text.source.DefaultCharacterPairMatcher;
 import org.eclipse.jface.text.source.ICharacterPairMatcher;
 import org.eclipse.jface.text.source.ISourceViewer;
@@ -87,8 +97,10 @@
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.custom.VerifyKeyListener;
 import org.eclipse.swt.dnd.DND;
 import org.eclipse.swt.dnd.DropTarget;
+import org.eclipse.swt.events.VerifyEvent;
 import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.Point;
@@ -104,9 +116,11 @@
 import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.IFileEditorInput;
 import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPartListener;
 import org.eclipse.ui.ISharedImages;
 import org.eclipse.ui.IStorageEditorInput;
 import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.contexts.IContextService;
@@ -117,7 +131,6 @@
 import org.eclipse.ui.help.IWorkbenchHelpSystem;
 import org.eclipse.ui.part.IShowInTargetList;
 import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
-import org.eclipse.ui.progress.UIJob;
 import org.eclipse.ui.texteditor.ChainedPreferenceStore;
 import org.eclipse.ui.texteditor.DefaultRangeIndicator;
 import org.eclipse.ui.texteditor.IAbstractTextEditorHelpContextIds;
@@ -126,6 +139,11 @@
 import org.eclipse.ui.texteditor.ITextEditor;
 import org.eclipse.ui.texteditor.ITextEditorActionConstants;
 import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
+import org.eclipse.ui.texteditor.ITextEditorExtension;
+import org.eclipse.ui.texteditor.ITextEditorExtension2;
+import org.eclipse.ui.texteditor.ITextEditorExtension3;
+import org.eclipse.ui.texteditor.ITextEditorExtension4;
+import org.eclipse.ui.texteditor.ITextEditorExtension5;
 import org.eclipse.ui.texteditor.IUpdate;
 import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
 import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;
@@ -149,12 +167,12 @@
 import org.eclipse.wst.sse.ui.internal.IExtendedContributor;
 import org.eclipse.wst.sse.ui.internal.IModelProvider;
 import org.eclipse.wst.sse.ui.internal.IPopupMenuContributor;
+import org.eclipse.wst.sse.ui.internal.IStructuredTextEditorActionConstants;
 import org.eclipse.wst.sse.ui.internal.Logger;
 import org.eclipse.wst.sse.ui.internal.ReadOnlyAwareDropTargetAdapter;
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
 import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
 import org.eclipse.wst.sse.ui.internal.StorageModelProvider;
-import org.eclipse.wst.sse.ui.internal.StructuredLineChangeHover;
 import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
 import org.eclipse.wst.sse.ui.internal.UnknownContentTypeDialog;
 import org.eclipse.wst.sse.ui.internal.actions.ActionDefinitionIds;
@@ -168,20 +186,30 @@
 import org.eclipse.wst.sse.ui.internal.derived.HTMLTextPresenter;
 import org.eclipse.wst.sse.ui.internal.editor.EditorModelUtil;
 import org.eclipse.wst.sse.ui.internal.editor.IHelpContextIds;
+import org.eclipse.wst.sse.ui.internal.editor.SelectionConvertor;
 import org.eclipse.wst.sse.ui.internal.editor.StructuredModelDocumentProvider;
 import org.eclipse.wst.sse.ui.internal.extension.BreakpointProviderBuilder;
 import org.eclipse.wst.sse.ui.internal.hyperlink.OpenHyperlinkAction;
 import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
+import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy;
 import org.eclipse.wst.sse.ui.internal.properties.ConfigurablePropertySheetPage;
 import org.eclipse.wst.sse.ui.internal.properties.ShowPropertiesAction;
 import org.eclipse.wst.sse.ui.internal.provisional.extensions.ConfigurationPointCalculator;
 import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
 import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.NullSourceEditingTextTools;
+import org.eclipse.wst.sse.ui.internal.provisional.preferences.CommonEditorPreferenceNames;
+import org.eclipse.wst.sse.ui.internal.quickoutline.QuickOutlineHandler;
+import org.eclipse.wst.sse.ui.internal.quickoutline.QuickOutlinePopupDialog;
+import org.eclipse.wst.sse.ui.internal.reconcile.DocumentRegionProcessor;
 import org.eclipse.wst.sse.ui.internal.selection.SelectionHistory;
+import org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingManager;
 import org.eclipse.wst.sse.ui.internal.text.DocumentRegionEdgeMatcher;
+import org.eclipse.wst.sse.ui.internal.text.SourceInfoProvider;
 import org.eclipse.wst.sse.ui.internal.util.Assert;
 import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
+import org.eclipse.wst.sse.ui.quickoutline.AbstractQuickOutlineConfiguration;
+import org.eclipse.wst.sse.ui.reconcile.ISourceReconcilingListener;
+import org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter;
 import org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration;
 import org.eclipse.wst.sse.ui.views.properties.PropertySheetConfiguration;
 
@@ -219,11 +247,12 @@
 			if (getTextViewer() != null) {
 				// getTextViewer().setRedraw(false);
 				getTextViewer().unconfigure();
+				setStatusLineMessage(null);
 			}
 		}
 
 		public void modelChanged(IStructuredModel model) {
-			if (getTextViewer() != null) {
+			if (getSourceViewer() != null) {
 				// getTextViewer().setRedraw(true);
 				// Since the model can be changed on a background
 				// thread, we will update menus on display thread,
@@ -263,6 +292,11 @@
 				// so we don't freeze workbench (eg. during page language or
 				// content type change)
 				((ITextViewerExtension) getSourceViewer()).setRedraw(true);
+				
+				IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService) getSite().getService(IWorkbenchSiteProgressService.class);
+				if (service != null) {
+					service.warnOfContentChange();
+				}
 			}
 		}
 
@@ -296,7 +330,7 @@
 			}
 		}
 	}
-
+	
 	/**
 	 * Listens to double-click and selection from the outline page
 	 */
@@ -439,35 +473,22 @@
 	 */
 	private static class StructuredSelectionProvider implements IPostSelectionProvider, ISelectionValidator {
 		/**
-		 * A "hybrid" text and structured selection class. Converts the source
-		 * viewer text selection to a generic "getIndexedRegion"-derived
-		 * structured selection, allowing selection changed listeners to
-		 * possibly not need to reference the model directly.
+		 * A "hybrid" text and structured selection class containing the text
+		 * selection and a list of selected model objects. The determination
+		 * of which model objects matches the text selection is responsibility
+		 * of the StructuredSelectionProvider which created this selection
+		 * object.
 		 */
-		private static class StructuredTextSelection extends TextSelection implements IStructuredSelection, ITextSelection {
-			private Reference selectedStructured;
-			private InternalTextSelection fInternalTextSelection;
-
-			StructuredTextSelection(ITextSelection selection, IDocument document, IStructuredModel model) {
-				// note: we do not currently use super class at all, but, only
-				// subclass TextSelection,
-				// because some infrastructure code uses "instanceof
-				// TextSelection" instead of ITextSelection.
-				super(selection.getOffset(), selection.getLength());
-				fInternalTextSelection = new InternalTextSelection(document, selection.getOffset(), selection.getLength());
-				selectedStructured = new SoftReference(initializeInferredSelectedObjects(selection, model));
-			}
-
-			StructuredTextSelection(ITextSelection selection, Object[] selectedObjects, IDocument document) {
-				super(selection.getOffset(), selection.getLength());
-				fInternalTextSelection = new InternalTextSelection(document, selection.getOffset(), selection.getLength());
-				selectedStructured = new SoftReference(selectedObjects);
-			}
+		private static class StructuredTextSelection extends TextSelection implements IStructuredSelection {
+			private Object[] selectedStructured;
 
 			StructuredTextSelection(IDocument document, int offset, int length, Object[] selectedObjects) {
-				super(offset, length);
-				fInternalTextSelection = new InternalTextSelection(document, offset, length);
-				selectedStructured = new SoftReference(selectedObjects);
+				super(document, offset, length);
+				selectedStructured = selectedObjects;
+			}
+
+			StructuredTextSelection(IDocument document, ITextSelection selection, Object[] selectedObjects) {
+				this(document, selection.getOffset(), selection.getLength(), selectedObjects);
 			}
 
 			public Object getFirstElement() {
@@ -476,45 +497,12 @@
 			}
 
 			private Object[] getSelectedStructures() {
-				Object[] selectedStructures = (Object[]) selectedStructured.get();
-				if (selectedStructures == null) {
-					selectedStructures = new Object[0];
-				}
-				return selectedStructures;
-			}
-
-			private Object[] initializeInferredSelectedObjects(ITextSelection selection, IStructuredModel model) {
-				Object[] localSelectedStructures = null;
-				if (model != null) {
-					IndexedRegion region = model.getIndexedRegion(selection.getOffset());
-					int end = selection.getOffset() + selection.getLength();
-					if (region != null) {
-						if (end <= region.getEndOffset()) {
-							// single selection
-							localSelectedStructures = new Object[1];
-							localSelectedStructures[0] = region;
-						}
-						else {
-							// multiple selection
-							int maxLength = model.getStructuredDocument().getLength();
-							List structures = new ArrayList(2);
-							while (region != null && region.getEndOffset() <= end && region.getEndOffset() < maxLength) {
-								structures.add(region);
-								region = model.getIndexedRegion(region.getEndOffset() + 1);
-							}
-							localSelectedStructures = structures.toArray();
-						}
-					}
-				}
-				if (localSelectedStructures == null) {
-					localSelectedStructures = new Object[0];
-				}
-				return localSelectedStructures;
+				return (selectedStructured != null) ? selectedStructured : new Object[0];
 			}
 
 			public boolean isEmpty() {
 				// https://bugs.eclipse.org/bugs/show_bug.cgi?id=191327
-				return fInternalTextSelection.isEmpty() || getSelectedStructures().length == 0;
+				return super.isEmpty() || getSelectedStructures().length == 0;
 			}
 
 			public Iterator iterator() {
@@ -522,7 +510,7 @@
 			}
 
 			public int size() {
-				return getSelectedStructures().length;
+				return (selectedStructured != null) ? selectedStructured.length : 0;
 			}
 
 			public Object[] toArray() {
@@ -534,209 +522,10 @@
 			}
 
 			public String toString() {
-				return fInternalTextSelection.getOffset() + ":" + fInternalTextSelection.getLength() + "@" + getSelectedStructures(); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-
-
-			private static class InternalTextSelection implements ITextSelection {
-
-
-				private SoftReference weakDocument;
-
-				/** Offset of the selection */
-				private int fOffset;
-				/** Length of the selection */
-				private int fLength;
-
-				/**
-				 * Creates a text selection for the given range. This
-				 * selection object describes generically a text range and is
-				 * intended to be an argument for the
-				 * <code>setSelection</code> method of selection providers.
-				 * 
-				 * @param offset
-				 *            the offset of the range
-				 * @param length
-				 *            the length of the range
-				 */
-				InternalTextSelection(int offset, int length) {
-					this(null, offset, length);
-				}
-
-				/**
-				 * Creates a text selection for the given range of the given
-				 * document. This selection object is created by selection
-				 * providers in responds <code>getSelection</code>.
-				 * 
-				 * @param document
-				 *            the document whose text range is selected in a
-				 *            viewer
-				 * @param offset
-				 *            the offset of the selected range
-				 * @param length
-				 *            the length of the selected range
-				 */
-				InternalTextSelection(IDocument document, int offset, int length) {
-					weakDocument = new SoftReference(document);
-					fOffset = offset;
-					fLength = length;
-				}
-
-				/**
-				 * 
-				 * Returns true if the offset and length are smaller than 0. A
-				 * selection of length 0, is a valid text selection as it
-				 * describes, e.g., the cursor position in a viewer.
-				 * 
-				 * @return <code>true</code> if this selection is empty
-				 * @see org.eclipse.jface.viewers.ISelection#isEmpty()
-				 */
-				public boolean isEmpty() {
-					return fOffset < 0 || fLength < 0;
-				}
-
-				/*
-				 * @see org.eclipse.jface.text.ITextSelection#getOffset()
-				 */
-				public int getOffset() {
-					return fOffset;
-				}
-
-				/*
-				 * @see org.eclipse.jface.text.ITextSelection#getLength()
-				 */
-				public int getLength() {
-					return fLength;
-				}
-
-				/*
-				 * @see org.eclipse.jface.text.ITextSelection#getStartLine()
-				 */
-				public int getStartLine() {
-
-					IDocument document = (IDocument) weakDocument.get();
-					try {
-						if (document != null)
-							return document.getLineOfOffset(fOffset);
-					}
-					catch (BadLocationException x) {
-					}
-
-					return -1;
-				}
-
-				/*
-				 * @see org.eclipse.jface.text.ITextSelection#getEndLine()
-				 */
-				public int getEndLine() {
-					IDocument document = (IDocument) weakDocument.get();
-					try {
-						if (document != null) {
-							int endOffset = fOffset + fLength;
-							if (fLength != 0)
-								endOffset--;
-							return document.getLineOfOffset(endOffset);
-						}
-					}
-					catch (BadLocationException x) {
-					}
-
-					return -1;
-				}
-
-				/*
-				 * @see org.eclipse.jface.text.ITextSelection#getText()
-				 */
-				public String getText() {
-					IDocument document = (IDocument) weakDocument.get();
-					try {
-						if (document != null)
-							return document.get(fOffset, fLength);
-					}
-					catch (BadLocationException x) {
-					}
-
-					return null;
-				}
-
-				/*
-				 * @see java.lang.Object#equals(Object)
-				 */
-				public boolean equals(Object obj) {
-					if (obj == this)
-						return true;
-
-					if (obj == null || getClass() != obj.getClass())
-						return false;
-
-					InternalTextSelection s = (InternalTextSelection) obj;
-					boolean sameRange = (s.fOffset == fOffset && s.fLength == fLength);
-					if (sameRange) {
-
-						IDocument document = (IDocument) weakDocument.get();
-						IDocument sDocument = s.getDocument();
-
-						// ISSUE: why does not IDocument .equals suffice?
-						if (sDocument == null && document == null)
-							return true;
-						if (sDocument == null || document == null)
-							return false;
-
-						try {
-							// ISSUE: pricey! (a cached hash might be in
-							// order, if this
-							// was ever really ever used very often.
-							String sContent = sDocument.get(fOffset, fLength);
-							String content = document.get(fOffset, fLength);
-							return sContent.equals(content);
-						}
-						catch (BadLocationException x) {
-							// return false, can not be equal
-						}
-					}
-
-					return false;
-				}
-
-				/*
-				 * @see java.lang.Object#hashCode()
-				 */
-				public int hashCode() {
-					IDocument document = (IDocument) weakDocument.get();
-					int low = document != null ? document.hashCode() : 0;
-					return (fOffset << 24) | (fLength << 16) | low;
-				}
-
-				private IDocument getDocument() {
-					if (weakDocument == null)
-						return null;
-					return (IDocument) weakDocument.get();
-				}
-			}
-
-			public int getOffset() {
-				return fInternalTextSelection.getOffset();
-			}
-
-
-			public int getLength() {
-				return fInternalTextSelection.getLength();
-			}
-
-			public int getStartLine() {
-				return fInternalTextSelection.getStartLine();
-			}
-
-			public int getEndLine() {
-				return fInternalTextSelection.getEndLine();
-			}
-
-			public String getText() {
-				return fInternalTextSelection.getText();
+				return getOffset() + ":" + getLength() + "@" + getSelectedStructures(); //$NON-NLS-1$ //$NON-NLS-2$
 			}
 		}
-
-		private SoftReference weakDocument;
+		
 		private ISelectionProvider fParentProvider = null;
 		private boolean isFiringSelection = false;
 		private ListenerList listeners = new ListenerList();
@@ -744,16 +533,17 @@
 		private ISelection fLastSelection = null;
 		private ISelectionProvider fLastSelectionProvider = null;
 		private SelectionChangedEvent fLastUpdatedSelectionChangedEvent = null;
-		private SoftReference weakEditor;
-
-
+		private StructuredTextEditor fEditor;
+		/*
+		 * Responsible for finding the selected objects within a text
+		 * selection. Set/reset by the StructuredTextEditor based on a
+		 * per-model adapter on input.
+		 */
+		SelectionConvertor selectionConvertor = new SelectionConvertor();
+		
 		StructuredSelectionProvider(ISelectionProvider parentProvider, StructuredTextEditor structuredTextEditor) {
 			fParentProvider = parentProvider;
-			weakEditor = new SoftReference(structuredTextEditor);
-			IDocument document = structuredTextEditor.getDocumentProvider().getDocument(structuredTextEditor.getEditorInput());
-			if (document != null) {
-				setDocument(document);
-			}
+			fEditor = structuredTextEditor;
 			fParentProvider.addSelectionChangedListener(new ISelectionChangedListener() {
 				public void selectionChanged(SelectionChangedEvent event) {
 					handleSelectionChanged(event);
@@ -776,6 +566,13 @@
 			listeners.add(listener);
 		}
 
+		public void dispose() {
+			fEditor = null;
+			listeners.clear();
+			postListeners.clear();
+			selectionConvertor = null;
+		}
+
 		private void fireSelectionChanged(final SelectionChangedEvent event, ListenerList listenerList) {
 			Object[] listeners = listenerList.getListeners();
 			isFiringSelection = true;
@@ -805,25 +602,48 @@
 			 */
 			ISelection selection = getParentProvider().getSelection();
 			if (!(selection instanceof IStructuredSelection) && selection instanceof ITextSelection) {
-				IStructuredModel model = null;
+				IStructuredModel structuredModel = null;
 				StructuredTextEditor localEditor = getStructuredTextEditor();
 				if (localEditor != null) {
-					model = localEditor.getModel();
-					selection = new StructuredTextSelection((ITextSelection) selection, getDocument(), model);
+					structuredModel = localEditor.getInternalModel();
+					if (structuredModel != null) {
+						if (localEditor.isBlockSelectionModeEnabled()) {
+							/*
+							 * Block selection handling - find the overlapping
+							 * objects on each line, keeping in mind that the
+							 * selected block may not overlap actual lines or
+							 * columns of the document.
+							 * IBlockTextSelection.getRegions() should handle
+							 * that for us...
+							 */
+							IBlockTextSelection blockSelection = (IBlockTextSelection) selection;
+							IRegion[] regions = blockSelection.getRegions();
+							Set blockObjects = new LinkedHashSet();
+							for (int i = 0; i < regions.length; i++) {
+								Object[] objects = selectionConvertor.getElements(structuredModel, regions[i].getOffset(), regions[i].getLength());
+								for (int j = 0; j < objects.length; j++) {
+									blockObjects.add(objects[j]);
+								}
+							}
+							selection = new StructuredTextSelection(getDocument(), (ITextSelection) selection, blockObjects.toArray());
+						}
+						else {
+							int start = ((ITextSelection) selection).getOffset();
+							int end = start + ((ITextSelection) selection).getLength();
+							selection = new StructuredTextSelection(getDocument(), (ITextSelection) selection, selectionConvertor.getElements(structuredModel, start, end));
+						}
+					}
 				}
-				else {
-					selection = new StructuredTextSelection((ITextSelection) selection, getDocument(), null);
+				if (selection == null) {
+					selection = new StructuredTextSelection(getDocument(), (ITextSelection) selection, new Object[0]);
 				}
 			}
+			
 			return selection;
 		}
 
 		private StructuredTextEditor getStructuredTextEditor() {
-			StructuredTextEditor editor = null;
-			if (weakEditor != null) {
-				editor = (StructuredTextEditor) weakEditor.get();
-			}
-			return editor;
+			return fEditor;
 		}
 
 		void handlePostSelectionChanged(SelectionChangedEvent event) {
@@ -835,7 +655,7 @@
 				updatedEvent = updateEvent(event);
 			}
 			// only update the range indicator on post selection
-			StructuredTextEditor localEditor = (StructuredTextEditor) weakEditor.get();
+			StructuredTextEditor localEditor = fEditor;
 
 			if (localEditor != null) {
 				localEditor.updateRangeIndication(updatedEvent.getSelection());
@@ -854,11 +674,7 @@
 		}
 
 		IDocument getDocument() {
-			IDocument document = null;
-			if (weakDocument != null) {
-				document = (IDocument) weakDocument.get();
-			}
-			return document;
+			return fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput());
 		}
 
 
@@ -921,8 +737,14 @@
 				StructuredTextEditor localEditor = getStructuredTextEditor();
 				if (localEditor != null) {
 					structuredModel = localEditor.getInternalModel();
+					if (structuredModel != null) {
+						int start = ((ITextSelection) selection).getOffset();
+						int end = start + ((ITextSelection) selection).getLength();
+						selection = new StructuredTextSelection(getDocument(), (ITextSelection) event.getSelection(), selectionConvertor.getElements(structuredModel, start, end));
+					}
 				}
-				selection = new StructuredTextSelection((ITextSelection) event.getSelection(), getDocument(), structuredModel);
+				if (selection == null)
+					selection = new StructuredTextSelection(getDocument(), (ITextSelection) event.getSelection(), new Object[0]);
 			}
 			SelectionChangedEvent newEvent = new SelectionChangedEvent(event.getSelectionProvider(), selection);
 			return newEvent;
@@ -974,10 +796,6 @@
 			}
 			return updated;
 		}
-
-		public void setDocument(IDocument document) {
-			weakDocument = new SoftReference(document);
-		}
 	}
 
 	class TimeOutExpired extends TimerTask {
@@ -1010,6 +828,144 @@
 		}
 	}
 
+	private class CharacterPairListener implements VerifyKeyListener {
+		private CharacterPairing[] fInserters = new CharacterPairing[0];
+
+		/**
+		 * Add the pairing to the list of inserters
+		 * @param pairing
+		 */
+		void addInserter(CharacterPairing pairing) {
+			List pairings = new ArrayList(Arrays.asList(fInserters));
+			pairings.add(pairing);
+			fInserters = (CharacterPairing[]) pairings.toArray(new CharacterPairing[pairings.size()]);
+		}
+
+		void prioritize() {
+			Arrays.sort(fInserters);
+		}
+
+		/**
+		 * Perform cleanup on the character pair inserters
+		 */
+		void dispose() {
+			for (int i = 0; i < fInserters.length; i++) {
+				final AbstractCharacterPairInserter inserter = fInserters[i].inserter;
+				SafeRunner.run(new ISafeRunnable() {
+					public void handleException(Throwable exception) {
+						// rely on default logging
+					}
+
+					public void run() throws Exception {
+						inserter.dispose();
+					}
+				});
+			}
+		}
+
+		public void verifyKey(final VerifyEvent event) {
+			if (!event.doit || getInsertMode() != SMART_INSERT || isBlockSelectionModeEnabled() && isMultilineSelection())
+				return;
+			final boolean[] paired = { false };
+			for (int i = 0; i < fInserters.length; i++) {
+				final CharacterPairing pairing = fInserters[i];
+				// use a SafeRunner -- this is a critical function (typing)
+				SafeRunner.run(new ISafeRunnable() {
+					public void run() throws Exception {
+						final AbstractCharacterPairInserter inserter = pairing.inserter;
+						if (inserter.hasPair(event.character)) {
+							if (pair(event, inserter, pairing.partitions))
+								paired[0] = true;
+						}
+					}
+
+					public void handleException(Throwable exception) {
+						// rely on default logging
+					}
+				});
+				if (paired[0])
+					return;
+			}
+		}
+
+		private boolean pair(VerifyEvent event, AbstractCharacterPairInserter inserter, Set partitions) {
+			final ISourceViewer viewer = getSourceViewer();
+			final IDocument document = getSourceViewer().getDocument();
+			if (document != null) {
+				try {
+					final Point selection = viewer.getSelectedRange();
+					final int offset = selection.x;
+					final ITypedRegion partition = document.getPartition(offset);
+					if (partitions.contains(partition.getType())) {
+						// Don't modify if the editor input cannot be changed
+						if (!validateEditorInputState())
+							return false;
+						event.doit = !inserter.pair(viewer, event.character);
+						return true;
+					}
+				} catch (BadLocationException e) {
+				}
+			}
+			return false;
+		}
+
+		private boolean isMultilineSelection() {
+			ISelection selection = getSelectionProvider().getSelection();
+			if (selection instanceof ITextSelection) {
+				ITextSelection ts = (ITextSelection) selection;
+				return ts.getStartLine() != ts.getEndLine();
+			}
+			return false;
+		}
+	}
+
+	/**
+	 * Representation of a character pairing that includes its priority based on
+	 * its content type and how close it is to the content type of the file
+	 * in the editor.
+	 */
+	private class CharacterPairing implements Comparable {
+		int priority;
+		AbstractCharacterPairInserter inserter;
+		Set partitions;
+		public int compareTo(Object o) {
+			if (o == this)
+				return 0;
+			return this.priority - ((CharacterPairing) o).priority;
+		}
+	}
+	
+	private class PartListener implements IPartListener {
+
+		private ITextEditor fEditor;
+
+		public PartListener(ITextEditor editor) {
+			fEditor = editor;
+		}
+
+		public void partActivated(IWorkbenchPart part) {
+			if (part.getAdapter(ITextEditor.class) == fEditor) {
+				IReconciler reconciler = getSourceViewerConfiguration().getReconciler(getSourceViewer());
+				if (reconciler instanceof DocumentRegionProcessor) {
+					((DocumentRegionProcessor) reconciler).forceReconciling();
+				}
+			}
+		}
+
+		public void partBroughtToTop(IWorkbenchPart part) {
+		}
+
+		public void partClosed(IWorkbenchPart part) {
+		}
+
+		public void partDeactivated(IWorkbenchPart part) {
+		}
+
+		public void partOpened(IWorkbenchPart part) {
+		}
+		
+	}
+
 	/**
 	 * Not API. May be removed in the future.
 	 */
@@ -1022,12 +978,13 @@
 	protected static final String DOT = "."; //$NON-NLS-1$
 	private static final String EDITOR_CONTEXT_MENU_ID = "org.eclipse.wst.sse.ui.StructuredTextEditor.EditorContext"; //$NON-NLS-1$
 	private static final String EDITOR_CONTEXT_MENU_SUFFIX = ".source.EditorContext"; //$NON-NLS-1$
+
 	/** Non-NLS strings */
 	private static final String EDITOR_KEYBINDING_SCOPE_ID = "org.eclipse.wst.sse.ui.structuredTextEditorScope"; //$NON-NLS-1$
 	/**
 	 * Not API. May be removed in the future.
 	 */
-	public static final String GROUP_NAME_ADDITIONS = "additions"; //$NON-NLS-1$
+	public static final String GROUP_NAME_ADDITIONS = IWorkbenchActionConstants.MB_ADDITIONS; //$NON-NLS-1$
 
 	private static final String REDO_ACTION_DESC = SSEUIMessages.Redo___0___UI_; //$NON-NLS-1$ = "Redo: {0}."
 	private static final String REDO_ACTION_DESC_DEFAULT = SSEUIMessages.Redo_Text_Change__UI_; //$NON-NLS-1$ = "Redo Text Change."
@@ -1050,8 +1007,8 @@
 	private boolean fBackgroundJobEnded;
 	private boolean fBusyState;
 	private Timer fBusyTimer;
-	Runnable fCurrentRunnable = null;
 	boolean fDirtyBeforeDocumentEvent = false;
+	int validateEditCount = 0;
 	private ExtendedEditorDropTargetAdapter fDropAdapter;
 	private DropTarget fDropTarget;
 	boolean fEditorDisposed = false;
@@ -1060,18 +1017,20 @@
 	private IContentOutlinePage fOutlinePage;
 
 	private OutlinePageListener fOutlinePageListener = null;
-	/** This editor's projection model updater */
-	private IStructuredTextFoldingProvider fProjectionModelUpdater;
 	/** This editor's projection support */
 	private ProjectionSupport fProjectionSupport;
 	private IPropertySheetPage fPropertySheetPage;
+
+	private ISourceReconcilingListener[] fReconcilingListeners = new ISourceReconcilingListener[0]; 
+	private IPartListener fPartListener;
+
 	private String fRememberTitle;
 	/** The ruler context menu to be disposed. */
 	private Menu fRulerContextMenu;
 	/** The ruler context menu manager to be disposed. */
 	private MenuManager fRulerContextMenuManager;
 
-	String[] fShowInTargetIds = new String[]{IPageLayout.ID_RES_NAV};
+	String[] fShowInTargetIds = new String[]{IPageLayout.ID_RES_NAV, IPageLayout.ID_PROJECT_EXPLORER, IPageLayout.ID_OUTLINE};
 
 	private IAction fShowPropertiesAction = null;
 	private IStructuredModel fStructuredModel;
@@ -1086,6 +1045,8 @@
 	/** The information presenter. */
 	private InformationPresenter fInformationPresenter;
 	private boolean fUpdateMenuTextPending;
+	/** The quick outline handler */
+	private QuickOutlineHandler fOutlineHandler;
 
 	private boolean shouldClose = false;
 	private long startPerfTime;
@@ -1097,6 +1058,12 @@
 
 	private ILabelProvider fStatusLineLabelProvider;
 
+	private SemanticHighlightingManager fSemanticManager;
+	
+	private boolean fSelectionChangedFromGoto = false;
+
+	private final CharacterPairListener fPairInserter = new CharacterPairListener();
+
 	/**
 	 * Creates a new Structured Text Editor.
 	 */
@@ -1105,54 +1072,30 @@
 		initializeDocumentProvider(null);
 	}
 
-	private void aboutToSaveModel() {
-		if (getInternalModel() != null) {
-			getInternalModel().aboutToChangeModel();
+	private IStructuredModel aboutToSaveModel() {
+		IStructuredModel model = getInternalModel();
+		if (model != null) {
+			model.aboutToChangeModel();
 		}
+		return model;
 	}
 
-	private void abstractTextEditorContextMenuAboutToShow(IMenuManager menu) {
-		menu.add(new Separator(ITextEditorActionConstants.GROUP_UNDO));
-		menu.add(new GroupMarker(ITextEditorActionConstants.GROUP_SAVE));
-		menu.add(new Separator(ITextEditorActionConstants.GROUP_COPY));
-		menu.add(new Separator(ITextEditorActionConstants.GROUP_PRINT));
-		menu.add(new Separator(ITextEditorActionConstants.GROUP_EDIT));
-		menu.add(new Separator(ITextEditorActionConstants.GROUP_FIND));
-		menu.add(new Separator(IWorkbenchActionConstants.GROUP_ADD));
-		menu.add(new Separator(ITextEditorActionConstants.GROUP_REST));
-		menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+	protected void addSourceMenuActions(IMenuManager menu) {
+		IMenuManager subMenu= new MenuManager(SSEUIMessages.SourceMenu_label, IStructuredTextEditorActionConstants.SOURCE_CONTEXT_MENU_ID);
+		subMenu.add(new Separator(IStructuredTextEditorActionConstants.SOURCE_BEGIN));
+		subMenu.add(new Separator(IStructuredTextEditorActionConstants.SOURCE_ADDITIONS));
+		subMenu.add(new Separator(IStructuredTextEditorActionConstants.SOURCE_END));
+		menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, subMenu);
+	}
 
-		if (isEditable()) {
-			addAction(menu, ITextEditorActionConstants.GROUP_UNDO, ITextEditorActionConstants.UNDO);
-			addAction(menu, ITextEditorActionConstants.GROUP_UNDO, ITextEditorActionConstants.REVERT_TO_SAVED);
-			addAction(menu, ITextEditorActionConstants.GROUP_SAVE, ITextEditorActionConstants.SAVE);
-			addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.CUT);
-			addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.COPY);
-			addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.PASTE);
-		}
-		else {
-			addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.COPY);
-		}
-
-		// from AbstractDecoratedTextEditor
-		IAction preferencesAction = getAction(ITextEditorActionConstants.CONTEXT_PREFERENCES);
-		menu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator(ITextEditorActionConstants.GROUP_SETTINGS));
-		menu.appendToGroup(ITextEditorActionConstants.GROUP_SETTINGS, preferencesAction);
+	protected void addRefactorMenuActions(IMenuManager menu) {
+		IMenuManager subMenu = new MenuManager(SSEUIMessages.RefactorMenu_label, IStructuredTextEditorActionConstants.REFACTOR_CONTEXT_MENU_ID);
+		menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, subMenu);
 	}
 
 	protected void addContextMenuActions(IMenuManager menu) {
 		// Only offer actions that affect the text if the viewer allows
 		// modification and supports any of these operations
-//		IAction formatAll = getAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT);
-//		IAction formatSelection = getAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS);
-//		IAction cleanupAll = getAction(StructuredTextEditorActionConstants.ACTION_NAME_CLEANUP_DOCUMENT);
-//		boolean enableFormatMenu = (formatAll != null && formatAll.isEnabled()) || (formatSelection != null && formatSelection.isEnabled()) || (cleanupAll != null && cleanupAll.isEnabled());
-//
-//		if (getSourceViewer().isEditable() && enableFormatMenu) {
-//			addAction(menu, ITextEditorActionConstants.GROUP_EDIT, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT);
-//			addAction(menu, ITextEditorActionConstants.GROUP_EDIT, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS);
-//			addAction(menu, ITextEditorActionConstants.GROUP_EDIT, StructuredTextEditorActionConstants.ACTION_NAME_CLEANUP_DOCUMENT);
-//		}
 
 		// Some Design editors (DTD) rely on this view for their own uses
 		menu.appendToGroup(IWorkbenchActionConstants.GROUP_ADD, fShowPropertiesAction);
@@ -1208,17 +1151,6 @@
 		showBusy(true);
 	}
 
-	// private void addFindOccurrencesAction(String matchType, String
-	// matchText, IMenuManager menu) {
-	//
-	// AbstractFindOccurrencesAction action = new
-	// AbstractFindOccurrencesAction(getFileInEditor(), new
-	// SearchUIConfiguration(), (IStructuredDocument) getDocument(),
-	// matchType, matchText, getProgressMonitor());
-	// action.setText("Occurrences of \"" + matchText + "\" in File");
-	// menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, action);
-	// }
-
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -1359,7 +1291,7 @@
 		// override the cut/paste/delete action to make
 		// them run on read-only
 		// files
-		Action action = new TextOperationAction(resourceBundle, "Editor_Cut_", this, ITextOperationTarget.CUT, true); //$NON-NLS-1$
+		Action action = new TextOperationAction(resourceBundle, "Editor_Cut_", this, ITextOperationTarget.CUT); //$NON-NLS-1$
 		action.setActionDefinitionId(IWorkbenchActionDefinitionIds.CUT);
 		setAction(ITextEditorActionConstants.CUT, action);
 		helpSystem.setHelp(action, IAbstractTextEditorHelpContextIds.CUT_ACTION);
@@ -1369,7 +1301,7 @@
 		// override the cut/paste/delete action to make
 		// them run on read-only
 		// files
-		action = new TextOperationAction(resourceBundle, "Editor_Paste_", this, ITextOperationTarget.PASTE, true); //$NON-NLS-1$
+		action = new TextOperationAction(resourceBundle, "Editor_Paste_", this, ITextOperationTarget.PASTE); //$NON-NLS-1$
 		action.setActionDefinitionId(IWorkbenchActionDefinitionIds.PASTE);
 		setAction(ITextEditorActionConstants.PASTE, action);
 		helpSystem.setHelp(action, IAbstractTextEditorHelpContextIds.PASTE_ACTION);
@@ -1380,14 +1312,14 @@
 		// override the cut/paste/delete action to make
 		// them run on read-only
 		// files
-		action = new TextOperationAction(resourceBundle, "Editor_Delete_", this, ITextOperationTarget.DELETE, true); //$NON-NLS-1$
+		action = new TextOperationAction(resourceBundle, "Editor_Delete_", this, ITextOperationTarget.DELETE); //$NON-NLS-1$
 		action.setActionDefinitionId(IWorkbenchActionDefinitionIds.DELETE);
 		setAction(ITextEditorActionConstants.DELETE, action);
 		helpSystem.setHelp(action, IAbstractTextEditorHelpContextIds.DELETE_ACTION);
 		// SourceView Action - requesting content assist to
 		// show completetion
 		// proposals for the current insert position
-		action = new TextOperationAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS + UNDERSCORE, this, ISourceViewer.CONTENTASSIST_PROPOSALS, true);
+		action = new TextOperationAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS + UNDERSCORE, this, ISourceViewer.CONTENTASSIST_PROPOSALS);
 		helpSystem.setHelp(action, IHelpContextIds.CONTMNU_CONTENTASSIST_HELPID);
 		action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
 		setAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS, action);
@@ -1436,16 +1368,20 @@
 		computeAndSetDoubleClickAction();
 		
 		IHandler handler = new GotoMatchingBracketHandler();
-    IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
-    if (handlerService != null)
-      handlerService.activateHandler(ActionDefinitionIds.GOTO_MATCHING_BRACKET, handler);
+	    IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
+	    if (handlerService != null)
+	      handlerService.activateHandler(ActionDefinitionIds.GOTO_MATCHING_BRACKET, handler);
+	    if (handlerService != null) {
+	    	fOutlineHandler = new QuickOutlineHandler();
+	    	handlerService.activateHandler(ActionDefinitionIds.SHOW_OUTLINE, fOutlineHandler);
+	    }
 
-		fShowPropertiesAction = new ShowPropertiesAction();
+		fShowPropertiesAction = new ShowPropertiesAction(getEditorPart(), getSelectionProvider());
 		fFoldingGroup = new FoldingActionGroup(this, getSourceViewer());
 	}
 
 	protected LineChangeHover createChangeHover() {
-		return new StructuredLineChangeHover();
+		return super.createChangeHover(); //new StructuredLineChangeHover();
 	}
 
 	protected ICharacterPairMatcher createCharacterPairMatcher() {
@@ -1456,7 +1392,7 @@
 			matcher = (ICharacterPairMatcher) builder.getConfiguration(DocumentRegionEdgeMatcher.ID, ids[i]);
 		}
 		if (matcher == null) {
-			matcher = new DefaultCharacterPairMatcher(new char[]{'(', ')', '{', '}', '[', ']', '<', '>'});
+			matcher = new DefaultCharacterPairMatcher(new char[]{'(', ')', '{', '}', '[', ']', '<', '>', '"', '"', '\'', '\''});
 		}
 		return matcher;
 	}
@@ -1484,7 +1420,13 @@
 	}
 
 	protected void createModelDependentFields() {
-		// none at this level
+		if (fStructuredSelectionProvider != null) {
+			SelectionConvertor convertor = (SelectionConvertor) fStructuredModel.getAdapter(SelectionConvertor.class);
+			if (convertor != null)
+				fStructuredSelectionProvider.selectionConvertor = convertor;
+			else
+				fStructuredSelectionProvider.selectionConvertor = new SelectionConvertor();
+		}
 	}
 
 	/**
@@ -1499,8 +1441,8 @@
 	public void createPartControl(Composite parent) {
 		IContextService contextService = (IContextService) getSite().getService(IContextService.class);
 		if (contextService != null)
-		  contextService.activateContext(EDITOR_KEYBINDING_SCOPE_ID);
-		
+			contextService.activateContext(EDITOR_KEYBINDING_SCOPE_ID);
+
 		if (getSourceViewerConfiguration() == null) {
 			ConfigurationAndTarget cat = createSourceViewerConfiguration();
 			fViewerConfigurationTargetId = cat.getTargetId();
@@ -1534,6 +1476,22 @@
 		fInformationPresenter = new InformationPresenter(informationControlCreator);
 		fInformationPresenter.setSizeConstraints(60, 10, true, true);
 		fInformationPresenter.install(getSourceViewer());
+		addReconcilingListeners(getSourceViewerConfiguration(), getTextViewer());
+		fPartListener = new PartListener(this);
+		getSite().getWorkbenchWindow().getPartService().addPartListener(fPartListener);
+		installSemanticHighlighting();
+		if (fOutlineHandler != null) {
+			IInformationPresenter presenter = configureOutlinePresenter(getSourceViewer(), getSourceViewerConfiguration());
+			if (presenter != null) {
+				presenter.install(getSourceViewer());
+				fOutlineHandler.configure(presenter);
+			}
+		}
+		installCharacterPairing();
+		ISourceViewer viewer = getSourceViewer();
+		if (viewer instanceof ITextViewerExtension)
+			((ITextViewerExtension) viewer).appendVerifyKeyListener(fPairInserter);
+		
 	}
 
 	protected PropertySheetConfiguration createPropertySheetConfiguration() {
@@ -1576,14 +1534,12 @@
 		if (!allIds.contains(IPageLayout.ID_RES_NAV)) {
 			allIds.add(IPageLayout.ID_RES_NAV);
 		}
+		if (!allIds.contains(IPageLayout.ID_PROJECT_EXPLORER)) {
+			allIds.add(IPageLayout.ID_PROJECT_EXPLORER);
+		}
 		if (!allIds.contains(IPageLayout.ID_OUTLINE)) {
 			allIds.add(IPageLayout.ID_OUTLINE);
 		}
-		// Copied from org.eclipse.ui.navigator.resources.ProjectExplorer.VIEW_ID
-		String PE_VIEW_ID = "org.eclipse.ui.navigator.ProjectExplorer"; //$NON-NLS-1$
-		if (!allIds.contains(PE_VIEW_ID)) {
-			allIds.add(PE_VIEW_ID);
-		}
 		return (String[]) allIds.toArray(new String[0]);
 	}
 
@@ -1696,24 +1652,25 @@
 			System.out.println("Average time per call: " + (adapterTime / adapterRequests)); //$NON-NLS-1$
 		}
 
+		ISourceViewer viewer = getSourceViewer();
+		if (viewer instanceof ITextViewerExtension)
+			((ITextViewerExtension) viewer).removeVerifyKeyListener(fPairInserter);
+
 		// dispose of information presenter
 		if (fInformationPresenter != null) {
 			fInformationPresenter.dispose();
 			fInformationPresenter = null;
 		}
 
+		if (fOutlineHandler != null) {
+			fOutlineHandler.dispose();
+		}
 		// dispose of selection history
 		if (fSelectionHistory != null) {
 			fSelectionHistory.dispose();
 			fSelectionHistory = null;
 		}
 
-		// dispose of document folding support
-		if (fProjectionModelUpdater != null) {
-			fProjectionModelUpdater.uninstall();
-			fProjectionModelUpdater = null;
-		}
-
 		if (fProjectionSupport != null) {
 			fProjectionSupport.dispose();
 			fProjectionSupport = null;
@@ -1781,16 +1738,33 @@
 		if (fDropTarget != null)
 			fDropTarget.dispose();
 
+		if (fPartListener != null) {
+			getSite().getWorkbenchWindow().getPartService().removePartListener(fPartListener);
+			fPartListener = null;
+		}
+
+		uninstallSemanticHighlighting();
+
+		if (fPairInserter != null)
+			fPairInserter.dispose();
+
+
 		setPreferenceStore(null);
 
-		// strictly speaking, but following null outs
-		// should not be needed,
-		// but in the event of a memory leak, they make the
-		// memory leak less
-		// severe
+		/*
+		 * Strictly speaking, but following null outs should not be needed,
+		 * but in the event of a memory leak, they make the memory leak less
+		 * severe
+		 */
 		fDropAdapter = null;
 		fDropTarget = null;
 
+		if (fStructuredSelectionProvider != null) {
+			fStructuredSelectionProvider.dispose();
+		}
+
+		setStatusLineMessage(null);
+
 		super.dispose();
 
 		Logger.trace("Source Editor", "StructuredTextEditor::dispose exit"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -1815,7 +1789,8 @@
 	 * here.
 	 */
 	private void disposeModelDependentFields() {
-		// none at this level
+		if(fStructuredSelectionProvider != null)
+			fStructuredSelectionProvider.selectionConvertor = new SelectionConvertor();
 	}
 
 	/*
@@ -1844,13 +1819,14 @@
 	 * @see org.eclipse.ui.ISaveablePart#doSave(org.eclipse.core.runtime.IProgressMonitor)
 	 */
 	public void doSave(IProgressMonitor progressMonitor) {
+		IStructuredModel model = null;
 		try {
-			aboutToSaveModel();
+			model = aboutToSaveModel();
 			updateEncodingMemento();
 			super.doSave(progressMonitor);
 		}
 		finally {
-			savedModel();
+			savedModel(model);
 		}
 	}
 
@@ -1860,8 +1836,6 @@
 	 * @see org.eclipse.ui.texteditor.AbstractTextEditor#doSetInput(org.eclipse.ui.IEditorInput)
 	 */
 	protected void doSetInput(IEditorInput input) throws CoreException {
-		// TODO: if opened in more than one editor, this will cause
-		// problems.
 		IEditorInput oldInput = getEditorInput();
 		if (oldInput != null) {
 			IDocument olddoc = getDocumentProvider().getDocument(oldInput);
@@ -1874,30 +1848,24 @@
 			fStructuredModel.releaseFromEdit();
 		}
 
+		//attempt to get the model for the given input
 		super.doSetInput(input);
+		IStructuredModel model = tryToGetModel(input);
+		
+		/* if could not get the model prompt user to update content type
+		 * if preferences allow, then try to get model again
+		 */
+		if(model == null &&	SSEUIPlugin.getDefault().getPreferenceStore().getBoolean(EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG)) {
+			// display a dialog informing user of unknown content type giving them chance to update preferences
+			UnknownContentTypeDialog dialog = new UnknownContentTypeDialog(getSite().getShell(), SSEUIPlugin.getDefault().getPreferenceStore(), EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG);
+			dialog.open();
 
-		IDocument newDocument = getDocumentProvider().getDocument(input);
-		if (newDocument instanceof IExecutionDelegatable) {
-			((IExecutionDelegatable) newDocument).setExecutionDelegate(new EditorExecutionContext(this));
-		}
-
-		IStructuredModel model = null;
-		// if we have a Model provider, get the model from it
-		if (getDocumentProvider() instanceof IModelProvider) {
-			model = ((IModelProvider) getDocumentProvider()).getModel(getEditorInput());
-			if (!model.isShared()) {
-				EditorModelUtil.addFactoriesTo(model);
-			}
-		}
-		else {
-			if (newDocument instanceof IStructuredDocument) {
-				// corresponding releaseFromEdit occurs in
-				// dispose()
-				model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) newDocument);
-				EditorModelUtil.addFactoriesTo(model);
-			}
-
-			else {
+			//try to get model again in hopes user updated preferences
+			super.doSetInput(input);
+			model = tryToGetModel(input);
+			
+			//still could not get the model to open this editor so log
+			if(model == null) {
 				logUnexpectedDocumentKind(input);
 			}
 		}
@@ -1913,12 +1881,41 @@
 			updateEditorControlsForContentType(null);
 		}
 
-		if (fProjectionModelUpdater != null)
-			updateProjectionSupport();
-
 		// start editor with smart insert mode
 		setInsertMode(SMART_INSERT);
 	}
+	
+	/**
+	 * <p>Attempts to get the {@link IStructuredModel} for the given {@link IEditorInput}</p>
+	 * 
+	 * @param input the {@link IEditorInput} to try and get the {@link IStructuredModel} for
+	 * 
+	 * @return The {@link IStructuredModel} associated with the given {@link IEditorInput} or
+	 * <code>null</code> if no associated {@link IStructuredModel} could be found.
+	 */
+	private IStructuredModel tryToGetModel(IEditorInput input) {
+		IStructuredModel model = null;
+		
+		IDocument newDocument = getDocumentProvider().getDocument(input);
+		if (newDocument instanceof IExecutionDelegatable) {
+			((IExecutionDelegatable) newDocument).setExecutionDelegate(new EditorExecutionContext(this));
+		}
+
+		// if we have a Model provider, get the model from it
+		if (getDocumentProvider() instanceof IModelProvider) {
+			model = ((IModelProvider) getDocumentProvider()).getModel(getEditorInput());
+			if (!model.isShared()) {
+				EditorModelUtil.addFactoriesTo(model);
+			}
+		}
+		else if (newDocument instanceof IStructuredDocument) {
+			// corresponding releaseFromEdit occurs in dispose()
+			model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) newDocument);
+			EditorModelUtil.addFactoriesTo(model);
+		} 
+		
+		return model;
+	}
 
 	/**
 	 * Sets up this editor's context menu before it is made visible.
@@ -1930,21 +1927,17 @@
 	 *            the menu
 	 */
 	public void editorContextMenuAboutToShow(IMenuManager menu) {
-		// To be consistant with the Java Editor, we want
-		// to remove
-		// ShiftRight and ShiftLeft from the context menu.
-		//
-		// ShiftRight and ShiftLeft were added in the super
-		// implemenation of
-		// this method. We want to skip it and call
-		// AbstractTextEditor's
-		// implementation directly. The easiest way is to
-		// copy the method here.
-
-		// super.editorContextMenuAboutToShow(menu);
-		abstractTextEditorContextMenuAboutToShow(menu);
+		/*
+		 * To be consistent with the Java Editor, we want to remove ShiftRight
+		 * and ShiftLeft from the context menu.
+		 */
+		super.editorContextMenuAboutToShow(menu);
+		menu.remove(ITextEditorActionConstants.SHIFT_LEFT);
+		menu.remove(ITextEditorActionConstants.SHIFT_RIGHT);
 
 		addContextMenuActions(menu);
+		addSourceMenuActions(menu);
+		addRefactorMenuActions(menu);
 		addExtendedContextMenuActions(menu);
 	}
 
@@ -2008,7 +2001,7 @@
 		Object result = null;
 		// text editor
 		IStructuredModel internalModel = getInternalModel();
-		if (ITextEditor.class.equals(required)) {
+		if (ITextEditor.class.equals(required) || ITextEditorExtension5.class.equals(required) || ITextEditorExtension4.class.equals(required) || ITextEditorExtension3.class.equals(required) || ITextEditorExtension2.class.equals(required) || ITextEditorExtension.class.equals(required)) {
 			result = this;
 		}
 		else if (IWorkbenchSiteProgressService.class.equals(required)) {
@@ -2059,13 +2052,25 @@
 		else if (IToggleBreakpointsTarget.class.equals(required)) {
 			result = ToggleBreakpointsTarget.getInstance();
 		}
+		else if (ITextEditorExtension4.class.equals(required)) {
+			result = this;
+		}
 		else if (IShowInTargetList.class.equals(required)) {
-			return new ShowInTargetListAdapter();
+			result = new ShowInTargetListAdapter();
+		}
+		else if (IVerticalRuler.class.equals(required)) {
+			return getVerticalRuler();
 		}
 		else if (SelectionHistory.class.equals(required)) {
 			if (fSelectionHistory == null)
 				fSelectionHistory = new SelectionHistory(this);
-			return fSelectionHistory;
+			result = fSelectionHistory;
+		}
+		else if (IResource.class.equals(required)) {
+			IEditorInput input = getEditorInput();
+			if (input != null) {
+				result = input.getAdapter(required);
+			}
 		}
 		else {
 			if (result == null && internalModel != null) {
@@ -2075,6 +2080,9 @@
 			if (result == null)
 				result = super.getAdapter(required);
 		}
+		if (result == null) {
+//			Logger.log(Logger.INFO_DEBUG, "StructuredTextEditor.getAdapter returning null for " + required); //$NON-NLS-1$
+		}
 		if (org.eclipse.wst.sse.core.internal.util.Debug.perfTestAdapterClassLoading) {
 			long stop = System.currentTimeMillis();
 			adapterRequests++;
@@ -2228,7 +2236,7 @@
 		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88714
 		return SWT.LEFT_TO_RIGHT;
 	}
-
+	
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -2244,6 +2252,12 @@
 						updateStatusLine(event.getSelection());
 					}
 				});
+				if (fStructuredModel != null) {
+					SelectionConvertor convertor = (SelectionConvertor) fStructuredModel.getAdapter(SelectionConvertor.class);
+					if (convertor != null) {
+						fStructuredSelectionProvider.selectionConvertor = convertor;
+					}
+				}
 			}
 		}
 		if (fStructuredSelectionProvider == null) {
@@ -2252,6 +2266,15 @@
 		return fStructuredSelectionProvider;
 	}
 
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.texteditor.AbstractTextEditor#getStatusLineManager()
+	 * 
+	 * Overridden to use the top-level editor part's status line
+	 */
+	protected IStatusLineManager getStatusLineManager() {
+		return getEditorPart().getEditorSite().getActionBars().getStatusLineManager();
+	}
+
 	/**
 	 * Returns the editor's source viewer. This method was created to expose
 	 * the protected final getSourceViewer() method.
@@ -2326,8 +2349,10 @@
 		if (selection.getLength() < 0)
 			targetOffset -= selection.getLength();
 
-		sourceViewer.setSelectedRange(targetOffset, selection.getLength());
-		sourceViewer.revealRange(targetOffset, selection.getLength());
+		if (sourceViewer != null) {
+			sourceViewer.setSelectedRange(targetOffset, selection.getLength());
+			sourceViewer.revealRange(targetOffset, selection.getLength());
+		}
 	}
 	
 	/*
@@ -2339,7 +2364,7 @@
 		super.handleCursorPositionChanged();
 		updateStatusField(StructuredTextEditorActionConstants.STATUS_CATEGORY_OFFSET);
 	}
-
+	
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -2351,25 +2376,33 @@
 		if (EditorPreferenceNames.EDITOR_TEXT_HOVER_MODIFIERS.equals(property)) {
 			updateHoverBehavior();
 		}
+		
+		//enable or disable as you type validation
+		else if(CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS.equals(property)) {
+			IReconciler reconciler = this.getSourceViewerConfiguration().getReconciler(this.getSourceViewer());
+			if (reconciler instanceof DocumentRegionProcessor) {
+				((DocumentRegionProcessor) reconciler).setValidatorStrategyEnabled(isValidationEnabled());
+			}
+		}
 
-		if (IStructuredTextFoldingProvider.FOLDING_ENABLED.equals(property)) {
+		else if (AbstractStructuredFoldingStrategy.FOLDING_ENABLED.equals(property)) {
 			if (getSourceViewer() instanceof ProjectionViewer) {
 				// install projection support if it has not even been
 				// installed yet
-				if (isFoldingEnabled() && (fProjectionSupport == null) && (fProjectionModelUpdater == null)) {
+				if (isFoldingEnabled() && (fProjectionSupport == null)) {
 					installProjectionSupport();
 				}
 				ProjectionViewer pv = (ProjectionViewer) getSourceViewer();
 				if (pv.isProjectionMode() != isFoldingEnabled()) {
-					if (pv.canDoOperation(ProjectionViewer.TOGGLE))
+					if (pv.canDoOperation(ProjectionViewer.TOGGLE)) {
 						pv.doOperation(ProjectionViewer.TOGGLE);
+					}
 				}
 			}
-			return;
 		}
 
 		// update content assist preferences
-		if (EditorPreferenceNames.CODEASSIST_PROPOSALS_BACKGROUND.equals(property)) {
+		else if (EditorPreferenceNames.CODEASSIST_PROPOSALS_BACKGROUND.equals(property)) {
 			ISourceViewer sourceViewer = getSourceViewer();
 			if (sourceViewer != null) {
 				SourceViewerConfiguration configuration = getSourceViewerConfiguration();
@@ -2386,7 +2419,7 @@
 		}
 
 		// update content assist preferences
-		if (EditorPreferenceNames.CODEASSIST_PROPOSALS_FOREGROUND.equals(property)) {
+		else if (EditorPreferenceNames.CODEASSIST_PROPOSALS_FOREGROUND.equals(property)) {
 			ISourceViewer sourceViewer = getSourceViewer();
 			if (sourceViewer != null) {
 				SourceViewerConfiguration configuration = getSourceViewerConfiguration();
@@ -2403,7 +2436,7 @@
 		}
 
 		// update content assist preferences
-		if (EditorPreferenceNames.CODEASSIST_PARAMETERS_BACKGROUND.equals(property)) {
+		else if (EditorPreferenceNames.CODEASSIST_PARAMETERS_BACKGROUND.equals(property)) {
 			ISourceViewer sourceViewer = getSourceViewer();
 			if (sourceViewer != null) {
 				SourceViewerConfiguration configuration = getSourceViewerConfiguration();
@@ -2421,7 +2454,7 @@
 		}
 
 		// update content assist preferences
-		if (EditorPreferenceNames.CODEASSIST_PARAMETERS_FOREGROUND.equals(property)) {
+		else if (EditorPreferenceNames.CODEASSIST_PARAMETERS_FOREGROUND.equals(property)) {
 			ISourceViewer sourceViewer = getSourceViewer();
 			if (sourceViewer != null) {
 				SourceViewerConfiguration configuration = getSourceViewerConfiguration();
@@ -2507,8 +2540,7 @@
 	 */
 	protected void initializeEditor() {
 		super.initializeEditor();
-		// FIXME: here's where to add back in our custom encoding support
-		fEncodingSupport = null;
+
 		setPreferenceStore(createCombinedPreferenceStore());
 
 		setRangeIndicator(new DefaultRangeIndicator());
@@ -2554,10 +2586,6 @@
 	 * viewer-dependent.
 	 */
 	private void initializeSourceViewer() {
-		IAction contentAssistAction = getAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS);
-		if (contentAssistAction instanceof IUpdate) {
-			((IUpdate) contentAssistAction).update();
-		}
 		IAction openHyperlinkAction = getAction(StructuredTextEditorActionConstants.ACTION_NAME_OPEN_FILE);
 		if (openHyperlinkAction instanceof OpenHyperlinkAction) {
 			((OpenHyperlinkAction) openHyperlinkAction).setHyperlinkDetectors(getSourceViewerConfiguration().getHyperlinkDetectors(getSourceViewer()));
@@ -2585,9 +2613,8 @@
 	 * @see org.eclipse.ui.editors.text.TextEditor#installEncodingSupport()
 	 */
 	protected void installEncodingSupport() {
-		// TODO: install our custom support that can
-		// update document appropriately
-		// super.installEncodingSupport();
+		fEncodingSupport = new EncodingSupport(getConfigurationPoints());
+		fEncodingSupport.initialize(this);
 	}
 
 	/**
@@ -2607,49 +2634,11 @@
 		});
 		fProjectionSupport.install();
 
-		IStructuredTextFoldingProvider updater = null;
-		ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
-		String[] ids = getConfigurationPoints();
-		for (int i = 0; updater == null && i < ids.length; i++) {
-			updater = (IStructuredTextFoldingProvider) builder.getConfiguration(IStructuredTextFoldingProvider.ID, ids[i]);
-		}
-
-		fProjectionModelUpdater = updater;
-		if (fProjectionModelUpdater != null)
-			fProjectionModelUpdater.install(projectionViewer);
-
 		if (isFoldingEnabled())
 			projectionViewer.doOperation(ProjectionViewer.TOGGLE);
 	}
 
 	/**
-	 * Install everything necessary to get document folding working and enable
-	 * document folding
-	 */
-	private void updateProjectionSupport() {
-		// dispose of previous document folding support
-		if (fProjectionModelUpdater != null) {
-			fProjectionModelUpdater.uninstall();
-			fProjectionModelUpdater = null;
-		}
-
-		ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer();
-		IStructuredTextFoldingProvider updater = null;
-		ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
-		String[] ids = getConfigurationPoints();
-		for (int i = 0; updater == null && i < ids.length; i++) {
-			updater = (IStructuredTextFoldingProvider) builder.getConfiguration(IStructuredTextFoldingProvider.ID, ids[i]);
-		}
-
-		fProjectionModelUpdater = updater;
-		if (fProjectionModelUpdater != null)
-			fProjectionModelUpdater.install(projectionViewer);
-
-		if (fProjectionModelUpdater != null)
-			fProjectionModelUpdater.initialize();
-	}
-
-	/**
 	 * Return whether document folding should be enabled according to the
 	 * preference store settings.
 	 * 
@@ -2658,22 +2647,24 @@
 	private boolean isFoldingEnabled() {
 		IPreferenceStore store = getPreferenceStore();
 		// check both preference store and vm argument
-		return (store.getBoolean(IStructuredTextFoldingProvider.FOLDING_ENABLED));
+		return (store.getBoolean(AbstractStructuredFoldingStrategy.FOLDING_ENABLED));
+	}
+	
+	/**
+	 * Determine if the user preference for as you type validation is enabled or not
+	 */
+	private boolean isValidationEnabled() {
+		return getPreferenceStore().getBoolean(CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS);
 	}
 
+	/**
+	 * <p>Logs a warning about how this {@link StructuredTextEditor} just opened an {@link IEditorInput}
+	 * it was not designed to open.</p>
+	 * 
+	 * @param input the {@link IEditorInput} this {@link StructuredTextEditor} was not designed to open
+	 * to log the message about.
+	 */
 	private void logUnexpectedDocumentKind(IEditorInput input) {
-		// display a dialog informing user of uknown content type
-		if (SSEUIPlugin.getDefault().getPreferenceStore().getBoolean(EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG)) {
-			Job job = new UIJob(SSEUIMessages.StructuredTextEditor_0) {
-				public IStatus runInUIThread(IProgressMonitor monitor) {
-					UnknownContentTypeDialog dialog = new UnknownContentTypeDialog(getSite().getShell(), SSEUIPlugin.getDefault().getPreferenceStore(), EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG);
-					dialog.open();
-					return Status.OK_STATUS;
-				}
-			};
-			job.schedule();
-		}
-
 		Logger.log(Logger.WARNING, "StructuredTextEditor being used without StructuredDocument"); //$NON-NLS-1$
 		String name = null;
 		if (input != null) {
@@ -2706,15 +2697,11 @@
 			boolean projectionMode = projectionViewer.isProjectionMode();
 			if (projectionMode) {
 				projectionViewer.disableProjection();
-				if (fProjectionModelUpdater != null)
-					fProjectionModelUpdater.uninstall();
 			}
 
 			super.performRevert();
 
 			if (projectionMode) {
-				if (fProjectionModelUpdater != null)
-					fProjectionModelUpdater.install(projectionViewer);
 				projectionViewer.enableProjection();
 			}
 
@@ -2814,10 +2801,20 @@
 	public void safelySanityCheckState(IEditorInput input) {
 		super.safelySanityCheckState(input);
 	}
+	
+	protected void sanityCheckState(IEditorInput input) {
+		try {
+			++validateEditCount;
+			super.sanityCheckState(input);
+		}
+		finally {
+			--validateEditCount;
+		}
+	}
 
-	private void savedModel() {
-		if (getInternalModel() != null) {
-			getInternalModel().changedModel();
+	private void savedModel(IStructuredModel model) {
+		if (model != null) {
+			model.changedModel();
 		}
 	}
 
@@ -2880,15 +2877,48 @@
 	 * that viewer configuration could be set after editor part was created.
 	 */
 	protected void setSourceViewerConfiguration(SourceViewerConfiguration config) {
+		SourceViewerConfiguration oldSourceViewerConfiguration = getSourceViewerConfiguration();
 		super.setSourceViewerConfiguration(config);
 		StructuredTextViewer stv = getTextViewer();
 		if (stv != null) {
-			// there should be no need to unconfigure
-			// before configure because
-			// configure will
-			// also unconfigure before configuring
+			/*
+			 * There should be no need to unconfigure before configure because
+			 * configure will also unconfigure before configuring
+			 */
+			removeReconcilingListeners(oldSourceViewerConfiguration, stv);
 			stv.unconfigure();
+			setStatusLineMessage(null);
 			stv.configure(config);
+			addReconcilingListeners(config, stv);
+		}
+	}
+	
+	private void removeReconcilingListeners(SourceViewerConfiguration config, StructuredTextViewer stv) {
+		IReconciler reconciler = config.getReconciler(stv);
+		if (reconciler instanceof DocumentRegionProcessor) {
+			for (int i = 0; i < fReconcilingListeners.length; i++) {
+				((DocumentRegionProcessor) reconciler).removeReconcilingListener(fReconcilingListeners[i]);
+			}
+		}
+	}
+
+	private void addReconcilingListeners(SourceViewerConfiguration config, StructuredTextViewer stv) {
+		try {
+			List reconcilingListeners = new ArrayList(fReconcilingListeners.length);
+			String[] ids = getConfigurationPoints();
+			for (int i = 0; i < ids.length; i++) {
+				reconcilingListeners.addAll(ExtendedConfigurationBuilder.getInstance().getConfigurations("sourceReconcilingListener", ids[i])); //$NON-NLS-1$
+			}
+			fReconcilingListeners = (ISourceReconcilingListener[]) reconcilingListeners.toArray(new ISourceReconcilingListener[reconcilingListeners.size()]);
+		}
+		catch (ClassCastException e) {
+			Logger.log(Logger.ERROR, "Configuration has a reconciling listener that does not implement ISourceReconcilingListener."); //$NON-NLS-1$
+		}
+
+		IReconciler reconciler = config.getReconciler(stv);
+		if (reconciler instanceof DocumentRegionProcessor) {
+			for (int i = 0; i < fReconcilingListeners.length; i++)
+				((DocumentRegionProcessor) reconciler).addReconcilingListener(fReconcilingListeners[i]);
 		}
 	}
 
@@ -2949,15 +2979,22 @@
 			fStatusLineLabelProvider.dispose();
 		}
 
+		String configurationId = fViewerConfigurationTargetId;
 		updateSourceViewerConfiguration();
 
+		/* Only reinstall if the configuration id has changed */
+		if (configurationId != null && !configurationId.equals(fViewerConfigurationTargetId)) {
+			uninstallSemanticHighlighting();
+			installSemanticHighlighting();
+		}
+
 		if (getSourceViewerConfiguration() instanceof StructuredTextViewerConfiguration) {
 			fStatusLineLabelProvider = ((StructuredTextViewerConfiguration) getSourceViewerConfiguration()).getStatusLineLabelProvider(getSourceViewer());
 			updateStatusLine(null);
 		}
 
-		if (fStructuredSelectionProvider != null) {
-			fStructuredSelectionProvider.setDocument(getInternalModel().getStructuredDocument());
+		if (fEncodingSupport != null && fEncodingSupport instanceof EncodingSupport) {
+			((EncodingSupport) fEncodingSupport).reinitialize(getConfigurationPoints());
 		}
 
 		createModelDependentFields();
@@ -3057,20 +3094,24 @@
 			IStructuredDocument doc = internalModel.getStructuredDocument();
 			EncodingMemento memento = doc.getEncodingMemento();
 			IDocumentCharsetDetector detector = internalModel.getModelHandler().getEncodingDetector();
-			if (memento != null && detector != null)
+			if (memento != null && detector != null) {
 				detector.set(doc);
-			try {
-				detector.getEncoding();
+				try {
+					String newEncoding = detector.getEncoding();
+					if (newEncoding != null) {
+						memento.setDetectedCharsetName(newEncoding);
+					}
+				}
+				catch (IOException e) {
+					failed = true;
+				}
 			}
-			catch (IOException e) {
-				failed = true;
-			}
-			// be sure to use the new instance
-			// but only if no exception occurred.
-			// (we may find cases we need to do more error recover there)
-			// should be near impossible to get IOException from processing
-			// the
-			// *document*
+			/**
+			 * Be sure to use the new value but only if no exception
+			 * occurred. (we may find cases we need to do more error recovery
+			 * there) should be near impossible to get IOException from
+			 * processing the _document_
+			 */
 			if (!failed) {
 				doc.setEncodingMemento(memento);
 			}
@@ -3133,7 +3174,12 @@
 	}
 
 	private void updateMenuText() {
-		if (fStructuredModel != null && !fStructuredModel.isModelStateChanging() && getTextViewer().getTextWidget() != null) {
+		ITextViewer viewer = getTextViewer();
+		StyledText widget = null;
+		if (viewer != null)
+			widget = viewer.getTextWidget();
+
+		if (fStructuredModel != null && !fStructuredModel.isModelStateChanging() && viewer != null && widget != null && !widget.isDisposed()) {
 			// performance: don't force an update of the action bars unless
 			// required as it is expensive
 			String previousUndoText = null;
@@ -3162,37 +3208,41 @@
 				// get undo command
 				Command undoCommand = undoManager.getUndoCommand();
 				// set undo label and description
-				undoAction.setEnabled(undoManager.undoable());
-				if (undoCommand != null) {
-					String label = undoCommand.getLabel();
-					if (label != null) {
-						String customText = MessageFormat.format(UNDO_ACTION_TEXT, new String[]{label});
-						updateActions = updateActions || customText == null || previousUndoText == null || !customText.equals(previousUndoText);
-						undoAction.setText(customText);
-					}
-					String desc = undoCommand.getDescription();
-					if (desc != null) {
-						String customDesc = MessageFormat.format(UNDO_ACTION_DESC, new String[]{desc});
-						updateActions = updateActions || customDesc == null || previousRedoDesc == null || !customDesc.equals(previousUndoDesc);
-						undoAction.setDescription(customDesc);
+				if (undoAction != null) {
+					undoAction.setEnabled(undoManager.undoable());
+					if (undoCommand != null) {
+						String label = undoCommand.getLabel();
+						if (label != null) {
+							String customText = MessageFormat.format(UNDO_ACTION_TEXT, new String[]{label});
+							updateActions = updateActions || customText == null || previousUndoText == null || !customText.equals(previousUndoText);
+							undoAction.setText(customText);
+						}
+						String desc = undoCommand.getDescription();
+						if (desc != null) {
+							String customDesc = MessageFormat.format(UNDO_ACTION_DESC, new String[]{desc});
+							updateActions = updateActions || customDesc == null || previousRedoDesc == null || !customDesc.equals(previousUndoDesc);
+							undoAction.setDescription(customDesc);
+						}
 					}
 				}
 				// get redo command
 				Command redoCommand = undoManager.getRedoCommand();
 				// set redo label and description
-				redoAction.setEnabled(undoManager.redoable());
-				if (redoCommand != null) {
-					String label = redoCommand.getLabel();
-					if (label != null) {
-						String customText = MessageFormat.format(REDO_ACTION_TEXT, new String[]{label});
-						updateActions = updateActions || customText == null || previousRedoText == null || !customText.equals(previousRedoText);
-						redoAction.setText(customText);
-					}
-					String desc = redoCommand.getDescription();
-					if (desc != null) {
-						String customDesc = MessageFormat.format(REDO_ACTION_DESC, new String[]{desc});
-						updateActions = updateActions || customDesc == null || previousRedoDesc == null || !customDesc.equals(previousRedoDesc);
-						redoAction.setDescription(customDesc);
+				if (redoAction != null) {
+					redoAction.setEnabled(undoManager.redoable());
+					if (redoCommand != null) {
+						String label = redoCommand.getLabel();
+						if (label != null) {
+							String customText = MessageFormat.format(REDO_ACTION_TEXT, new String[]{label});
+							updateActions = updateActions || customText == null || previousRedoText == null || !customText.equals(previousRedoText);
+							redoAction.setText(customText);
+						}
+						String desc = redoCommand.getDescription();
+						if (desc != null) {
+							String customDesc = MessageFormat.format(REDO_ACTION_DESC, new String[]{desc});
+							updateActions = updateActions || customDesc == null || previousRedoDesc == null || !customDesc.equals(previousRedoDesc);
+							redoAction.setDescription(customDesc);
+						}
 					}
 				}
 			}
@@ -3225,7 +3275,7 @@
 				rangeUpdated = true;
 			}
 		}
-		if (!rangeUpdated) {
+		if (!rangeUpdated && getSourceViewer() != null) {
 			if (selection instanceof ITextSelection) {
 				getSourceViewer().setRangeIndication(((ITextSelection) selection).getOffset(), ((ITextSelection) selection).getLength(), false);
 			}
@@ -3317,10 +3367,6 @@
 			// (maybe only need to reset viewerconfig's document)
 			if (!configured)
 				getSourceViewer().configure(configuration);
-			IAction contentAssistAction = getAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS);
-			if (contentAssistAction instanceof IUpdate) {
-				((IUpdate) contentAssistAction).update();
-			}
 			IAction openHyperlinkAction = getAction(StructuredTextEditorActionConstants.ACTION_NAME_OPEN_FILE);
 			if (openHyperlinkAction instanceof OpenHyperlinkAction) {
 				((OpenHyperlinkAction) openHyperlinkAction).setHyperlinkDetectors(getSourceViewerConfiguration().getHyperlinkDetectors(getSourceViewer()));
@@ -3336,10 +3382,11 @@
 
 		if (StructuredTextEditorActionConstants.STATUS_CATEGORY_OFFSET.equals(category)) {
 			IStatusField field = getStatusField(category);
-			if (field != null) {
-				Point selection = getTextViewer().getTextWidget().getSelection();
-				int offset1 = widgetOffset2ModelOffset(getSourceViewer(), selection.x);
-				int offset2 = widgetOffset2ModelOffset(getSourceViewer(), selection.y);
+			ISourceViewer sourceViewer = getSourceViewer();
+			if (field != null && sourceViewer != null) {
+				Point selection = sourceViewer.getTextWidget().getSelection();
+				int offset1 = widgetOffset2ModelOffset(sourceViewer, selection.x);
+				int offset2 = widgetOffset2ModelOffset(sourceViewer, selection.y);
 				String text = null;
 				if (offset1 != offset2)
 					text = "[" + offset1 + "-" + offset2 + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -3349,8 +3396,21 @@
 			}
 		}
 	}
+	
+	public Annotation gotoAnnotation(boolean forward) {
+		Annotation result = super.gotoAnnotation(forward);
+		if(result != null)
+			fSelectionChangedFromGoto = true;
+		return result;
+	}
 
 	void updateStatusLine(ISelection selection) {
+		// Bug 210481 - Don't update the status line if the selection
+		// was caused by go to navigation
+		if(fSelectionChangedFromGoto) {
+			fSelectionChangedFromGoto = false;
+			return;
+		}
 		IStatusLineManager statusLineManager = getEditorSite().getActionBars().getStatusLineManager();
 		if (fStatusLineLabelProvider != null && statusLineManager != null) {
 			String text = null;
@@ -3397,15 +3457,142 @@
 	}
 
 	protected SourceViewerDecorationSupport getSourceViewerDecorationSupport(ISourceViewer viewer) {
-		/*
-		 * Need to override this method to use special
-		 * StructuredSourceViewerDecorationSupport. See
-		 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=201928
-		 */
-		if (fSourceViewerDecorationSupport == null) {
-			fSourceViewerDecorationSupport = new StructuredSourceViewerDecorationSupport(viewer, getOverviewRuler(), getAnnotationAccess(), getSharedColors());
-			configureSourceViewerDecorationSupport(fSourceViewerDecorationSupport);
+		/* Removed workaround for Bug [206913] source annotations are not painting in source editors.
+		 * With the new presentation reconciler, we no longer need to force the painting. This
+		 * actually caused Bug [219776] Wrong annotation display on macs. We forced the
+		 * Squiggles strategy, even when the native problem underline was specified for annotations */
+		return super.getSourceViewerDecorationSupport(viewer);
+	}
+
+	private void installCharacterPairing() {
+		IStructuredModel model = getInternalModel();
+		if (model != null) {
+			IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(SSEUIPlugin.ID, "characterPairing"); //$NON-NLS-1$
+			IContentTypeManager mgr = Platform.getContentTypeManager();
+			IContentType type = mgr.getContentType(model.getContentTypeIdentifier());
+			if (type != null) {
+				for (int i = 0; i < elements.length; i++) {
+					// Create the inserter
+					IConfigurationElement element = elements[i];
+					try {
+						IConfigurationElement[] contentTypes = element.getChildren("contentTypeIdentifier");
+						for (int j = 0; j < contentTypes.length; j++) {
+							String id = contentTypes[j].getAttribute("id");
+							if (id != null) {
+								IContentType targetType = mgr.getContentType(id);
+								int priority = calculatePriority(type, targetType, 0);
+								if (priority >= 0) {
+									final CharacterPairing pairing = new CharacterPairing();
+									pairing.priority = priority;
+									String[] partitions = StringUtils.unpack(contentTypes[j].getAttribute("partitions"));
+									pairing.partitions = new HashSet(partitions.length);
+									// Only add the inserter if there is at least one partition for the content type
+									for (int k = 0; k < partitions.length; k++) {
+										pairing.partitions.add(partitions[k]);
+									}
+
+									pairing.inserter = (AbstractCharacterPairInserter) element.createExecutableExtension("class");
+									if (pairing.inserter != null && partitions.length > 0) {
+										fPairInserter.addInserter(pairing);
+										/* use a SafeRunner since this method is also invoked during Part creation */
+										SafeRunner.run(new ISafeRunnable() {
+											public void run() throws Exception {
+												pairing.inserter.initialize();
+											}
+
+											public void handleException(Throwable exception) {
+												// rely on default logging
+											}
+										});
+									}
+								}
+							}
+						}
+					} catch (CoreException e) {
+						Logger.logException(e);
+					}
+				}
+				fPairInserter.prioritize();
+			}
 		}
-		return fSourceViewerDecorationSupport;
+	}
+
+	/**
+	 * Calculates the priority of the target content type. The closer <code>targetType</code>
+	 * is to <code>type</code> the higher its priority.
+	 * 
+	 * @param type
+	 * @param targetType
+	 * @param priority
+	 * @return
+	 */
+	private int calculatePriority(IContentType type, IContentType targetType, int priority) {
+		if (type == null || targetType == null)
+			return -1;
+		if (type.getId().equals(targetType.getId()))
+			return priority;
+		return calculatePriority(type.getBaseType(), targetType, ++priority);
+	}
+
+	/**
+	 * Installs semantic highlighting on the editor
+	 */
+	private void installSemanticHighlighting() {
+		IStructuredModel model = getInternalModel();
+		if (fSemanticManager == null && model != null) {
+			fSemanticManager = new SemanticHighlightingManager();
+			fSemanticManager.install(getSourceViewer(), getPreferenceStore(), getSourceViewerConfiguration(), model.getContentTypeIdentifier());
+		}
+	}
+	
+	/**
+	 * Uninstalls semantic highlighting on the editor and performs cleanup
+	 */
+	private void uninstallSemanticHighlighting() {
+		if (fSemanticManager != null) {
+			fSemanticManager.uninstall();
+			fSemanticManager = null;
+		}
+	}
+
+	private IInformationPresenter configureOutlinePresenter(ISourceViewer sourceViewer, SourceViewerConfiguration config) {
+		InformationPresenter presenter = null;
+
+		// Get the quick outline configuration
+		AbstractQuickOutlineConfiguration cfg = null;
+		ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
+		String[] ids = getConfigurationPoints();
+		for (int i = 0; cfg == null && i < ids.length; i++) {
+			cfg = (AbstractQuickOutlineConfiguration) builder.getConfiguration(ExtendedConfigurationBuilder.QUICKOUTLINECONFIGURATION, ids[i]);
+		}
+
+		if (cfg != null) {
+			presenter = new InformationPresenter(getOutlinePresenterControlCreator(cfg));
+			presenter.setDocumentPartitioning(config.getConfiguredDocumentPartitioning(sourceViewer));
+			presenter.setAnchor(AbstractInformationControlManager.ANCHOR_GLOBAL);
+			IInformationProvider provider = new SourceInfoProvider(this);
+			String[] contentTypes = config.getConfiguredContentTypes(sourceViewer);
+			for (int i = 0; i < contentTypes.length; i++) {
+				presenter.setInformationProvider(provider, contentTypes[i]);
+			}
+			presenter.setSizeConstraints(50, 20, true, false);
+		}
+		return presenter;
+	}
+
+	/**
+	 * Returns the outline presenter control creator. The creator is a 
+	 * factory creating outline presenter controls for the given source viewer. 
+	 *
+	 * @param sourceViewer the source viewer to be configured by this configuration
+	 * @return an information control creator
+	 */
+	private IInformationControlCreator getOutlinePresenterControlCreator(final AbstractQuickOutlineConfiguration config) {
+		return new IInformationControlCreator() {
+			public IInformationControl createInformationControl(Shell parent) {
+				int shellStyle = SWT.RESIZE;
+				return new QuickOutlinePopupDialog(parent, shellStyle, getInternalModel(), config);
+			}
+		};
 	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java
index 0e3b9e0..5008211 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import org.eclipse.jface.dialogs.IDialogSettings;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.PreferenceConverter;
 import org.eclipse.jface.text.DefaultInformationControl;
@@ -31,6 +32,7 @@
 import org.eclipse.jface.text.contentassist.IContentAssistant;
 import org.eclipse.jface.text.formatter.IContentFormatter;
 import org.eclipse.jface.text.hyperlink.IHyperlinkPresenter;
+import org.eclipse.jface.text.hyperlink.MultipleHyperlinkPresenter;
 import org.eclipse.jface.text.information.IInformationPresenter;
 import org.eclipse.jface.text.information.IInformationProvider;
 import org.eclipse.jface.text.information.InformationPresenter;
@@ -38,6 +40,7 @@
 import org.eclipse.jface.text.quickassist.IQuickAssistAssistant;
 import org.eclipse.jface.text.quickassist.QuickAssistAssistant;
 import org.eclipse.jface.text.reconciler.IReconciler;
+import org.eclipse.jface.text.source.Annotation;
 import org.eclipse.jface.text.source.IAnnotationHover;
 import org.eclipse.jface.text.source.ISourceViewer;
 import org.eclipse.jface.viewers.ILabelProvider;
@@ -45,22 +48,26 @@
 import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.RGB;
 import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchPreferenceConstants;
+import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.editors.text.EditorsUI;
 import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
 import org.eclipse.ui.texteditor.ChainedPreferenceStore;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
 import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
+import org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor;
 import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
 import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
 import org.eclipse.wst.sse.ui.internal.StructuredTextAnnotationHover;
 import org.eclipse.wst.sse.ui.internal.contentassist.StructuredContentAssistant;
 import org.eclipse.wst.sse.ui.internal.correction.CompoundQuickAssistProcessor;
 import org.eclipse.wst.sse.ui.internal.derived.HTMLTextPresenter;
-import org.eclipse.wst.sse.ui.internal.hyperlink.HighlighterHyperlinkPresenter;
 import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.provisional.preferences.CommonEditorPreferenceNames;
 import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+import org.eclipse.wst.sse.ui.internal.provisional.style.ReconcilerHighlighter;
+import org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler;
 import org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor;
+import org.eclipse.wst.sse.ui.internal.rules.StructuredDocumentDamagerRepairer;
 import org.eclipse.wst.sse.ui.internal.taginfo.AnnotationHoverProcessor;
 import org.eclipse.wst.sse.ui.internal.taginfo.BestMatchHover;
 import org.eclipse.wst.sse.ui.internal.taginfo.ProblemAnnotationHoverProcessor;
@@ -84,11 +91,12 @@
  * @since 1.0
  */
 public class StructuredTextViewerConfiguration extends TextSourceViewerConfiguration {
-	/*
+	/**
 	 * One instance per configuration because creating a second assistant that
 	 * is added to a viewer can cause odd key-eating by the wrong one.
 	 */
 	private StructuredContentAssistant fContentAssistant = null;
+	
 	/*
 	 * One instance per configuration because it's just like content assistant
 	 */
@@ -101,9 +109,12 @@
 	 * Extended configuration provisionalConfiguration type to contribute
 	 * additional auto edit strategies
 	 */
-	private final String AUTOEDITSTRATEGY = "autoeditstrategy";
-
-
+	private final String AUTOEDITSTRATEGY = "autoeditstrategy"; //$NON-NLS-1$
+	
+	private final String CONTENT_ASSIST_SIZE = "contentassistsize";
+	
+	private ReconcilerHighlighter fHighlighter = null;
+	
 	/**
 	 * Creates a structured text viewer configuration.
 	 */
@@ -127,24 +138,18 @@
 	}
 
 	/**
-	 * Returns the annotation hover which will provide the information to be
-	 * shown in a hover popup window when requested for the given source
-	 * viewer.<br />
 	 * Note: Clients cannot override this method because this method returns a
-	 * specially configured Annotation Hover for the StructuredTextViewer.
+	 * specially configured Annotation Hover for the StructuredTextViewer
 	 * 
-	 * @param sourceViewer
-	 *            the source viewer to be configured by this configuration
-	 * @return an annotation hover specially configured for
-	 *         StructuredTextViewer
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.editors.text.TextSourceViewerConfiguration#getAnnotationHover(org.eclipse.jface.text.source.ISourceViewer)
 	 */
 	final public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
-		/*
-		 * This implmentation returns an annotation hover that works with
-		 * StructuredTextViewer and breakpoints. Important! must remember to
-		 * release it when done with it (during viewer.unconfigure)
-		 */
-		return new StructuredTextAnnotationHover();
+		return new StructuredTextAnnotationHover() {
+			protected boolean isIncluded(Annotation annotation) {
+				return isShowInVerticalRuler(annotation);
+			}
+		};
 	}
 
 	/**
@@ -158,6 +163,9 @@
 		return EditorUtility.getColor(rgb);
 	}
 
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
+	 */
 	public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
 		List allStrategies = new ArrayList(0);
 
@@ -252,6 +260,7 @@
 			fContentAssistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
 			fContentAssistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
 			fContentAssistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
+			fContentAssistant.enableColoredLabels(PlatformUI.getPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.USE_COLORED_LABELS));
 
 			// set content assist preferences
 			if (fPreferenceStore != null) {
@@ -272,9 +281,7 @@
 				fContentAssistant.setContextInformationPopupForeground(color);
 				fContentAssistant.setContextSelectorForeground(color);
 			}
-		}
-
-		if (!fContentAssistant.isInitialized()) {
+			
 			// add content assist processors for each partition type
 			String[] types = getConfiguredContentTypes(sourceViewer);
 			for (int i = 0; i < types.length; i++) {
@@ -288,13 +295,26 @@
 					}
 				}
 			}
+			IDialogSettings dialogSettings = SSEUIPlugin.getInstance().getDialogSettings();
+			if(dialogSettings != null) {
+				IDialogSettings section = dialogSettings.getSection(CONTENT_ASSIST_SIZE);
+				if(section == null) {
+					section = dialogSettings.addNewSection(CONTENT_ASSIST_SIZE);
+				}
+				fContentAssistant.setRestoreCompletionProposalSize(section);
+			}
 		}
 		return fContentAssistant;
 	}
 
 	/**
-	 * Returns the content assist processors that will be used for content
-	 * assist in the given source viewer and for the given partition type.
+	 * <p>Returns a {@link StructuredContentAssistProcessor} which can be contributed to through
+	 * the <tt>org.eclipse.wst.sse.ui.completionProposal</tt> extension point.</p>
+	 * 
+	 * <p>If an extender of this class overrides this method and does not include an
+	 * implementation of a {@link StructuredContentAssistProcessor} in their returned
+	 * processors then all of the contributions by the aforementioned extension point
+	 * will be left out.</p>
 	 * 
 	 * @param sourceViewer
 	 *            the source viewer to be configured by this configuration
@@ -304,7 +324,9 @@
 	 * @return IContentAssistProcessors or null if should not be supported
 	 */
 	protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
-		return null;
+		IContentAssistProcessor processor = new StructuredContentAssistProcessor(
+				fContentAssistant, partitionType, sourceViewer, null);
+		return new IContentAssistProcessor[]{processor};
 	}
 
 	/**
@@ -371,8 +393,8 @@
 
 	/**
 	 * Returns the hyperlink presenter for the given source viewer.<br />
-	 * Note: Clients cannot override this method because this method returns a
-	 * specially configured hyperlink presenter for the StructuredTextViewer.
+	 * Note: Clients cannot override this method, and although it's no longer
+	 * necessary, it must remain for binary compatibility.
 	 * 
 	 * @param sourceViewer
 	 *            the source viewer to be configured by this configuration
@@ -380,16 +402,12 @@
 	 *         StructuredTextViewer
 	 */
 	final public IHyperlinkPresenter getHyperlinkPresenter(ISourceViewer sourceViewer) {
-		/*
-		 * This implementation returns a hyperlink presenter that uses
-		 * Highlither instead of PresentationReconciler
-		 */
 		if (fPreferenceStore == null) {
 			return super.getHyperlinkPresenter(sourceViewer);
 		}
-		return new HighlighterHyperlinkPresenter(fPreferenceStore);
+		return new MultipleHyperlinkPresenter(fPreferenceStore);
 	}
-
+	
 	/**
 	 * Returns the information control creator. The creator is a factory
 	 * creating information controls for the given source viewer.<br />
@@ -403,7 +421,7 @@
 		// used by hover help
 		return new IInformationControlCreator() {
 			public IInformationControl createInformationControl(Shell parent) {
-				return new DefaultInformationControl(parent, SWT.NONE, new HTMLTextPresenter(true));
+				return new DefaultInformationControl(parent, new HTMLTextPresenter(true));
 			}
 		};
 	}
@@ -461,7 +479,7 @@
 	 *             extension point
 	 */
 	protected IInformationProvider getInformationProvider(ISourceViewer sourceViewer, String partitionType) {
-		ITextHover bestMatchHover = new BestMatchHover(createDocumentationHover(partitionType));
+		ITextHover bestMatchHover = new BestMatchHover(createDocumentationHovers(partitionType));
 		return new TextHoverInformationProvider(bestMatchHover);
 	}
 
@@ -502,9 +520,6 @@
 	}
 
 	/**
-	 * StructuredTextViewer currently does not support presentation
-	 * reconciler, so clients cannot override this method to provide their own
-	 * presentation reconciler. <br />
 	 * See <code>getLineStyleProviders(ISourceViewer, String)</code> for
 	 * alternative way to provide highlighting information.
 	 * 
@@ -513,12 +528,41 @@
 	 * @return always returns null
 	 * @see #getLineStyleProviders(ISourceViewer, String)
 	 */
-	final public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
-		/*
-		 * This implementation returns null because StructuredTextViewer does
-		 * not use presentation reconciler
-		 */
-		return null;
+	public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
+		StructuredPresentationReconciler reconciler = new StructuredPresentationReconciler();
+		reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
+		
+		String[] contentTypes = getConfiguredContentTypes(sourceViewer);
+		
+		if(contentTypes != null) {
+			StructuredDocumentDamagerRepairer dr = null;
+			
+			for (int i = 0; i < contentTypes.length; i++) {
+				if (fHighlighter != null) {
+					LineStyleProvider provider = fHighlighter.getProvider(contentTypes[i]);
+					if (provider == null)
+						continue;
+					
+					dr = new StructuredDocumentDamagerRepairer(provider);
+					dr.setDocument(sourceViewer.getDocument());
+					reconciler.setDamager(dr, contentTypes[i]);
+					reconciler.setRepairer(dr, contentTypes[i]);
+				}
+			}
+		}
+		
+		return reconciler;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.editors.text.TextSourceViewerConfiguration#getOverviewRulerAnnotationHover(org.eclipse.jface.text.source.ISourceViewer)
+	 */
+	public IAnnotationHover getOverviewRulerAnnotationHover(ISourceViewer sourceViewer) {
+		return new StructuredTextAnnotationHover(true) {
+			protected boolean isIncluded(Annotation annotation) {
+				return isShowInOverviewRuler(annotation);
+			}
+		};
 	}
 
 	/*
@@ -553,7 +597,7 @@
 	private IInformationControlCreator getQuickAssistAssistantInformationControlCreator() {
 		return new IInformationControlCreator() {
 			public IInformationControl createInformationControl(Shell parent) {
-				return new DefaultInformationControl(parent, SWT.NONE, new HTMLTextPresenter(true));
+				return new DefaultInformationControl(parent, new HTMLTextPresenter(true));
 			}
 		};
 	}
@@ -574,22 +618,22 @@
 	 * @return a reconciler
 	 */
 	final public IReconciler getReconciler(ISourceViewer sourceViewer) {
-		boolean reconcilingEnabled = fPreferenceStore.getBoolean(CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS);
-		if (sourceViewer == null || !reconcilingEnabled)
-			return null;
-
-		/*
-		 * Only create reconciler if sourceviewer is present
-		 */
-		if (fReconciler == null && sourceViewer != null) {
-			StructuredRegionProcessor reconciler = new StructuredRegionProcessor();
-
-			// reconciler configurations
-			reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
-
-			fReconciler = reconciler;
+		IReconciler reconciler = null;
+		
+		if (sourceViewer != null) {
+			//Only create reconciler if sourceViewer is present
+			if (fReconciler == null && sourceViewer != null) {
+				StructuredRegionProcessor newReconciler = new StructuredRegionProcessor();
+	
+				// reconciler configurations
+				newReconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
+	
+				fReconciler = newReconciler;
+			}
+			reconciler = fReconciler;
 		}
-		return fReconciler;
+		
+		return reconciler;
 	}
 
 	/**
@@ -602,20 +646,17 @@
 	}
 
 	/**
-	 * Create a documentation hover based on hovers contributed via
+	 * Create documentation hovers based on hovers contributed via
 	 * <code>org.eclipse.wst.sse.ui.editorConfiguration</code> extension
 	 * point
 	 * 
 	 * @param partitionType
 	 * @return
 	 */
-	private ITextHover createDocumentationHover(String partitionType) {
-		ITextHover textHover = null;
-		Object extendedTextHover = ExtendedConfigurationBuilder.getInstance().getConfiguration(ExtendedConfigurationBuilder.DOCUMENTATIONTEXTHOVER, partitionType);
-		if (extendedTextHover instanceof ITextHover) {
-			textHover = (ITextHover) extendedTextHover;
-		}
-		return textHover;
+	private ITextHover[] createDocumentationHovers(String partitionType) {
+		List extendedTextHover = ExtendedConfigurationBuilder.getInstance().getConfigurations(ExtendedConfigurationBuilder.DOCUMENTATIONTEXTHOVER, partitionType);
+		ITextHover[] hovers = (ITextHover[]) extendedTextHover.toArray(new ITextHover[extendedTextHover.size()]);
+		return hovers;
 	}
 
 	public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
@@ -635,9 +676,12 @@
 				else if (TextHoverManager.ANNOTATION_HOVER.equalsIgnoreCase(hoverType))
 					textHover = new AnnotationHoverProcessor();
 				else if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType))
-					textHover = new BestMatchHover(createDocumentationHover(contentType));
+					textHover = new BestMatchHover(createDocumentationHovers(contentType));
 				else if (TextHoverManager.DOCUMENTATION_HOVER.equalsIgnoreCase(hoverType)) {
-					textHover = createDocumentationHover(contentType);
+					ITextHover[] hovers = createDocumentationHovers(contentType);
+					if (hovers.length > 0) {
+						textHover = hovers[0];
+					}
 				}
 			}
 			i++;
@@ -661,4 +705,15 @@
 		 */
 		return new StructuredTextViewerUndoManager();
 	}
+	
+	public void setHighlighter(ReconcilerHighlighter highlighter) {
+		fHighlighter = highlighter;
+	}
+	
+	/**
+	 * @return the associated content assistnat
+	 */
+	protected StructuredContentAssistant getContentAssistant() {
+		return this.fContentAssistant;
+	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/CompletionProposalInvocationContext.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/CompletionProposalInvocationContext.java
new file mode 100644
index 0000000..9ac2f0c
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/CompletionProposalInvocationContext.java
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.contentassist;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.wst.sse.ui.internal.Logger;
+
+/**
+ * <p>Helpful class for passing around information about the invocation context
+ * of a content assist request</p>
+ * 
+ * @base org.eclipse.jdt.ui.text.java.ContentAssistInvocationContext
+ */
+public class CompletionProposalInvocationContext {
+	/** the viewer that was used to invoke content assist */
+	private final ITextViewer fViewer;
+	
+	/** the character offset where content assist was invoked in the viewer */
+	private final int fInvocationOffset;
+	
+	/** the partition type where content assist was invoked */
+	private String fPartitionType;
+	
+	/**
+	 * <p>Create a new context</p>
+	 * 
+	 * @param viewer {@link ITextViewer} that was used to invoke content assist
+	 * @param invocationOffset character offset where content assist was invoked in the viewer
+	 */
+	public CompletionProposalInvocationContext(ITextViewer viewer, int invocationOffset) {
+		fViewer = viewer;
+		fInvocationOffset = invocationOffset;
+		fPartitionType = null;
+	}
+	
+	/**
+	 * @return {@link IDocument} that content assist was invoked on
+	 */
+	public IDocument getDocument() {
+		return fViewer.getDocument();
+	}
+	
+	/**
+	 * @return {@link ITextViewer} that was used to invoke content assist
+	 */
+	public ITextViewer getViewer() {
+		return fViewer;
+	}
+	
+	/**
+	 * @return character offset where content assist was invoked in the viewer
+	 */
+	public int getInvocationOffset() {
+		return fInvocationOffset;
+	}
+	
+	/**
+	 * @return the partition type where content assist was invoked
+	 */
+	public String getInvocationPartitionType() {
+		if(fPartitionType == null) {
+			fPartitionType = ""; //$NON-NLS-1$
+			try {
+				fPartitionType = this.getDocument().getPartition(this.fInvocationOffset).getType();
+			} catch (BadLocationException e) {
+				// should never happen, nothing we can do about it if it does
+				Logger.logException("Could not get the partition type at content assist invocation offset", e); //$NON-NLS-1$
+			}
+		}
+		return fPartitionType;
+	}
+	
+	/**
+	 * <p>Invocation contexts are equal if they describe the same context and are of the same type.
+	 * This implementation checks for <code>null</code> values and class equality. Subclasses
+	 * should extend this method by adding checks for their context relevant fields (but not
+	 * necessarily cached values).</p>
+	 * <p>
+	 * Example:
+	 *
+	 * <pre>
+	 * class MyContext extends ContentAssistInvocationContext {
+	 * 	private final Object fState;
+	 * 	private Object fCachedInfo;
+	 *
+	 * 	...
+	 *
+	 * 	public boolean equals(Object obj) {
+	 * 		if (!super.equals(obj))
+	 * 			return false;
+	 * 		MyContext other= (MyContext) obj;
+	 * 		return fState.equals(other.fState);
+	 * 	}
+	 * }
+	 * </pre>
+	 *
+	 * </p>
+	 * <p>
+	 * Subclasses should also extend {@link Object#hashCode()}.
+	 * </p>
+	 *
+	 * @param obj {@inheritDoc}
+	 * @return {@inheritDoc}
+	 */
+	public boolean equals(Object obj) {
+		boolean equal = false;
+		if(obj instanceof CompletionProposalInvocationContext) {
+			CompletionProposalInvocationContext other = (CompletionProposalInvocationContext) obj;
+			equal = (fViewer == null && other.fViewer == null || fViewer != null && fViewer.equals(other.fViewer)) &&
+					fInvocationOffset == other.fInvocationOffset;
+		}
+		return equal;
+	}
+
+	/**
+	 * @see java.lang.Object#hashCode()
+	 */
+	public int hashCode() {
+		return 23459213 << 5 | (fViewer == null ? 0 : fViewer.hashCode() << 3) | fInvocationOffset;
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/ICompletionProposalComputer.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/ICompletionProposalComputer.java
new file mode 100644
index 0000000..b4f608a
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/ICompletionProposalComputer.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.contentassist;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+
+/**
+ * <p>Computes completions and context information displayed by the SSE editor content assistant.
+ * Contributions to the <tt>org.eclipse.wst.sse.ui.completionProposal</tt> extension point
+ * must implement this interface.</p>
+ * 
+ * @base org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer
+ */
+public interface ICompletionProposalComputer {
+	/**
+	 * Informs the computer that a content assist session has started. This call will always be
+	 * followed by a {@link #sessionEnded()} call, but not necessarily by calls to
+	 * {@link #computeCompletionProposals(CompletionProposalInvocationContext, IProgressMonitor) computeCompletionProposals}
+	 * or
+	 * {@link #computeContextInformation(CompletionProposalInvocationContext, IProgressMonitor) computeContextInformation}.
+	 */
+	void sessionStarted();
+
+	/**
+	 * Returns a list of completion proposals valid at the given invocation context.
+	 *
+	 * @param context the context of the content assist invocation
+	 * @param monitor a progress monitor to report progress. The monitor is private to this
+	 *        invocation, i.e. there is no need for the receiver to spawn a sub monitor.
+	 * @return a list of completion proposals (element type: {@link ICompletionProposal})
+	 */
+	List computeCompletionProposals(CompletionProposalInvocationContext context, IProgressMonitor monitor);
+
+	/**
+	 * Returns context information objects valid at the given invocation context.
+	 *
+	 * @param context the context of the content assist invocation
+	 * @param monitor a progress monitor to report progress. The monitor is private to this
+	 *        invocation, i.e. there is no need for the receiver to spawn a sub monitor.
+	 * @return a list of context information objects (element type: {@link IContextInformation})
+	 */
+	List computeContextInformation(CompletionProposalInvocationContext context, IProgressMonitor monitor);
+
+	/**
+	 * Returns the reason why this computer was unable to produce any completion proposals or
+	 * context information.
+	 *
+	 * @return an error message or <code>null</code> if no error occurred
+	 */
+	String getErrorMessage();
+
+	/**
+	 * Informs the computer that a content assist session has ended. This call will always be after
+	 * any calls to
+	 * {@linkplain #computeCompletionProposals(CompletionProposalInvocationContext, IProgressMonitor) computeCompletionProposals}
+	 * and
+	 * {@linkplain #computeContextInformation(CompletionProposalInvocationContext, IProgressMonitor) computeContextInformation}.
+	 */
+	void sessionEnded();
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/StructuredContentAssistProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/StructuredContentAssistProcessor.java
new file mode 100644
index 0000000..6104e06
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/StructuredContentAssistProcessor.java
@@ -0,0 +1,914 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.contentassist;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.action.LegacyActionTools;
+import org.eclipse.jface.bindings.TriggerSequence;
+import org.eclipse.jface.bindings.keys.KeySequence;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextInputListener;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ContentAssistEvent;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.ICompletionListener;
+import org.eclipse.jface.text.contentassist.ICompletionListenerExtension;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContentAssistantExtension2;
+import org.eclipse.jface.text.contentassist.IContentAssistantExtension3;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.ui.keys.IBindingService;
+import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
+import org.eclipse.wst.sse.ui.internal.IReleasable;
+import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposalCategory;
+import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposalComputerRegistry;
+import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposoalCatigoriesConfigurationRegistry;
+import org.eclipse.wst.sse.ui.internal.contentassist.CompoundContentAssistProcessor;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContextInformationValidator;
+import org.eclipse.wst.sse.ui.internal.contentassist.OptionalMessageDialog;
+import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader;
+import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter;
+
+
+/**
+ * <p>A content assist processor that aggregates the proposals of the
+ * {@link org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer}s contributed via the
+ * <code>org.eclipse.wst.sse.ui.completionProposal</code> extension point.</p>
+ * <p>
+ * Extenders may extend:
+ * <ul>
+ * <li>{@link #propertyChange(PropertyChangeEvent)}to react to property change events
+ * that occur in the {@link IPreferenceStore} given to the constructor in case the behavior
+ * of the processor needs to change according to user preferences</li>
+ * <li>{@link #getCompletionProposalAutoActivationCharacters()}</li>
+ * <li>{@link #getContextInformationAutoActivationCharacters()}</li>
+ * <li>{@link #filterAndSortProposals(List, IProgressMonitor, CompletionProposalInvocationContext)}
+ * to add sorting and filtering</li>
+ * <li>{@link #filterAndSortContextInformation(List, IProgressMonitor)} to add sorting and filtering</li>
+ * <li>{@link #createProgressMonitor()} to change the way progress is reported</li>
+ * <li>{@link #createContext(ITextViewer, int)} to provide the context object
+ * passed to the computers</li>
+ * <li>{@link #getContextInformationValidator()} to add context validation (needed if any
+ * contexts are provided)</li>
+ * <li>{@link #getErrorMessage()} to change error reporting</li>
+ * </ul>
+ * </p>
+ * 
+ * @base org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor
+ */
+public class StructuredContentAssistProcessor implements IContentAssistProcessor, IPropertyChangeListener, IReleasable {
+
+	/** Legacy editor configuration extension point. */
+	private static final String CONTENT_ASSIST_PROCESSOR_EXTENDED_ID = "contentassistprocessor"; //$NON-NLS-1$
+
+	/** Content assist processors added through the now legacy editor configuration extension point */
+	private List fLegacyExtendedContentAssistProcessors;
+	
+	/**
+	 * Dialog settings key for the "all categories are disabled" warning dialog. See
+	 * {@link OptionalMessageDialog}.
+	 */
+	private static final String PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY= "EmptyDefaultAssistCategory"; //$NON-NLS-1$
+
+	/**
+	 * Used to sort categories by their page order so they are cycled in the correct order
+	 */
+	private final Comparator PAGE_ORDER_COMPARATOR = new Comparator() {
+		public int compare(Object o1, Object o2) {
+			CompletionProposalCategory d1= (CompletionProposalCategory) o1;
+			CompletionProposalCategory d2= (CompletionProposalCategory) o2;
+
+			return d1.getPageSortRank(fContentTypeID) - d2.getPageSortRank(fContentTypeID);
+		}
+	};
+	
+	/**
+	 * Used to sort categories by their default page order so they are
+	 * ordered correctly on the default page
+	 */
+	private final Comparator DEFAULT_PAGE_ORDER_COMPARATOR = new Comparator() {
+		public int compare(Object o1, Object o2) {
+			CompletionProposalCategory d1= (CompletionProposalCategory) o1;
+			CompletionProposalCategory d2= (CompletionProposalCategory) o2;
+
+			return d1.getDefaultPageSortRank(fContentTypeID) - d2.getDefaultPageSortRank(fContentTypeID);
+		}
+	};
+
+	/** List of {@link CompletionProposalCategory}s supported by this processor */
+	private List fCategories;
+	
+	/** content type ID this processor is associated with */
+	String fContentTypeID;
+	
+	/** partition type ID this processor is associated with */
+	private final String fPartitionTypeID;
+	
+	/** Content assistant used for giving the user status messages and listening to completion results*/
+	private ContentAssistant fAssistant;
+
+	/* cycling stuff */
+	private int fRepetition= -1;
+	private List fCategoryIteration = null;
+	private String fIterationGesture = null;
+	private int fNumberOfComputedResults = 0;
+	private String fErrorMessage;
+	
+	/** Optionally specified preference store for listening to property change events */
+	private IPreferenceStore fPreferenceStore;
+	
+	/** The viewer this processor is associated with */
+	private ITextViewer fViewer;
+
+	/**
+	 * the {@link ITextInputListener} used to set the content type when
+	 * a document is set for this processors associated viewer.
+	 */
+	private ITextInputListener fTextInputListener;
+
+	private CompletionListener fCompletionListener;
+	
+	/** the context information validator for this processor */
+	private IContextInformationValidator fContextInformationValidator;
+	
+	/**
+	 * <p>Create a new content assist processor for a specific partition type. 
+	 * The content type will be determined when a document is set on the viewer</p>
+	 * 
+	 * <p>If the given {@link IPreferenceStore} is not <code>null</code> then this
+	 * processor will be registered as a {@link IPropertyChangeListener} on the given store
+	 * so that implementers of this class can change the way the processor acts based on
+	 * user preferences</p>
+	 * 
+	 * @param assistant {@link ContentAssistant} to use
+	 * @param partitionTypeID the partition type this processor is for
+	 * @param viewer {@link ITextViewer} this processor is acting in
+	 * @param preferenceStore This processor will be registered as a {@link IPropertyChangeListener}
+	 * on this store and the processor itself will take care of removing itself as a listener, if
+	 * <code>null</code> then will not be registered as a {@link IPropertyChangeListener}
+	 */
+	public StructuredContentAssistProcessor(ContentAssistant assistant, String partitionTypeID,
+			ITextViewer viewer, IPreferenceStore preferenceStore) {
+		
+		Assert.isNotNull(partitionTypeID);
+		Assert.isNotNull(assistant);
+		
+		//be sure the registry has been loaded, none blocking
+		CompletionProposalComputerRegistry.getDefault().initialize();
+		
+		//register on the preference store
+		this.fPreferenceStore = preferenceStore;
+		if(this.fPreferenceStore != null) {
+			this.fPreferenceStore.addPropertyChangeListener(this);
+		}
+		
+		//The content type can not be determined until a document has been set
+		this.fContentTypeID = null;
+		this.fViewer = viewer;
+		if(viewer != null) {
+			this.fTextInputListener = new TextInputListener();
+			viewer.addTextInputListener(this.fTextInputListener);
+		
+			if(viewer.getDocument() != null) {
+				/* it is highly unlike the document has already been set, but check
+				 * just for sanity
+				 */
+				this.fTextInputListener.inputDocumentChanged(null, viewer.getDocument());
+			}
+		}
+		
+		//set the associated partition type
+		this.fPartitionTypeID = partitionTypeID;
+		
+		//add completion listener
+		fAssistant = assistant;
+		fCompletionListener = new CompletionListener();
+		fAssistant.addCompletionListener(fCompletionListener);
+		
+		//lazy load these to speed up initial editor opening
+		fLegacyExtendedContentAssistProcessors = null;
+		fCategories = null;
+	}
+
+	/**
+	 * <p>Collect the proposals using the extension points</p>
+	 * 
+	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer, int)
+	 */
+	public final ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
+		clearState();
+
+		IProgressMonitor monitor= createProgressMonitor();
+		monitor.beginTask(SSEUIMessages.ContentAssist_computing_proposals, getProposalCategories().size() + 1);
+
+		CompletionProposalInvocationContext context = createContext(viewer, offset);
+
+		monitor.subTask(SSEUIMessages.ContentAssist_collecting_proposals);
+		List proposals = collectProposals(viewer, offset, monitor, context);
+
+		monitor.subTask(SSEUIMessages.ContentAssist_sorting_proposals);
+		List filtered = filterAndSortProposals(proposals, monitor, context);
+		fNumberOfComputedResults= filtered.size();
+
+		ICompletionProposal[] result= (ICompletionProposal[]) filtered.toArray(new ICompletionProposal[filtered.size()]);
+		monitor.done();
+
+		return result;
+	}
+
+	/**
+	 * <p>Collect the context information using the extension points</p>
+	 * 
+	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer, int)
+	 */
+	public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
+		clearState();
+
+		IProgressMonitor monitor= createProgressMonitor();
+		monitor.beginTask(SSEUIMessages.ContentAssist_computing_contexts, getProposalCategories().size() + 1);
+
+		monitor.subTask(SSEUIMessages.ContentAssist_collecting_contexts);
+		List proposals= collectContextInformation(viewer, offset, monitor);
+
+		monitor.subTask(SSEUIMessages.ContentAssist_sorting_contexts);
+		List filtered= filterAndSortContextInformation(proposals, monitor);
+		fNumberOfComputedResults= filtered.size();
+
+		IContextInformation[] result= (IContextInformation[]) filtered.toArray(new IContextInformation[filtered.size()]);
+		monitor.done();
+		return result;
+	}
+
+	/**
+	 * <p>Default implementation is to return <code>null</code></p>
+	 * <p>Extenders may override</p>
+	 * 
+	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
+	 */
+	public char[] getCompletionProposalAutoActivationCharacters() {
+		return null;
+	}
+
+	/**
+	 * <p>Default implementation is to return <code>null</code></p>
+	 * <p>Extenders may override</p>
+	 * 
+	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters()
+	 */
+	public char[] getContextInformationAutoActivationCharacters() {
+		return null;
+	}
+
+	/**
+	 * <p>Extenders may override this function to change error reporting</p>
+	 * 
+	 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage()
+	 */
+	public String getErrorMessage() {
+		if (fErrorMessage != null)
+			return fErrorMessage;
+		if (fNumberOfComputedResults > 0)
+			return null;
+		return SSEUIMessages.ContentAssist_no_completions;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#getContextInformationValidator()
+	 */
+	public IContextInformationValidator getContextInformationValidator() {
+		if (this.fContextInformationValidator == null) {
+			this.fContextInformationValidator = new ContextInformationValidator();
+		}
+		return this.fContextInformationValidator;
+	}
+	
+	/**
+	 * <p>Extenders may override, but should always be sure to call the super implementation</p>
+	 * 
+	 * @see org.eclipse.wst.sse.ui.internal.IReleasable#release()
+	 */
+	public void release() {
+		if(this.fPreferenceStore != null) {
+			this.fPreferenceStore.removePropertyChangeListener(this);
+			this.fPreferenceStore = null;
+		}
+		
+		if(this.fViewer != null) {
+			this.fViewer.removeTextInputListener(this.fTextInputListener);
+			this.fViewer = null;
+		}
+		if (this.fAssistant != null) {
+			this.fAssistant.removeCompletionListener(fCompletionListener);
+			this.fAssistant = null;
+		}
+	}
+	
+	/**
+	 * <p>Intended to be overridden by extenders wishing to change the behavior
+	 * of the processor based on user preferences from the store optionally 
+	 * associated with this processor.  If no store was given to the constructor
+	 * when creating this assistant then this method will never be invoked.</p>
+	 * 
+	 * <p>The default implementation does not react to the events in any way</p>
+	 * 
+	 * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+	 */
+	public void propertyChange(PropertyChangeEvent event) {
+	}
+	
+	/**
+	 * <p>Filters and sorts the proposals. The passed list may be modified
+	 * and returned, or a new list may be created and returned.</p>
+	 * 
+	 * <p>The default implementation does not do any sorting or filtering.</p>
+	 * <p>Extenders may override this function.</p>
+	 *
+	 * @param proposals the list of collected proposals (element type:
+	 *        {@link ICompletionProposal})
+	 * @param monitor a progress monitor
+	 * @param context TODO
+	 * @return the list of filtered and sorted proposals, ready for
+	 *         display (element type: {@link ICompletionProposal})
+	 */
+	protected List filterAndSortProposals(List proposals, IProgressMonitor monitor, CompletionProposalInvocationContext context) {
+		return proposals;
+	}
+	
+	/**
+	 * <p>Filters and sorts the context information objects. The passed
+	 * list may be modified and returned, or a new list may be created
+	 * and returned.</p>
+	 * 
+	 * <p>The default implementation does not do any sorting or filtering</p>
+	 * <p>Extenders may override this method</p>
+	 *
+	 * @param contexts the list of collected proposals (element type:
+	 *        {@link IContextInformation})
+	 * @param monitor a progress monitor
+	 * @return the list of filtered and sorted proposals, ready for
+	 *         display (element type: {@link IContextInformation})
+	 */
+	protected List filterAndSortContextInformation(List contexts, IProgressMonitor monitor) {
+		return contexts;
+	}
+
+	/**
+	 * <p>Creates a progress monitor.</p>
+	 * <p>The default implementation creates a {@link NullProgressMonitor}.</p>
+	 *
+	 * <p>Extenders may override this method</p>
+	 *
+	 * @return a progress monitor
+	 */
+	protected IProgressMonitor createProgressMonitor() {
+		return new NullProgressMonitor();
+	}
+
+	/**
+	 * <p>Creates the context that is passed to the completion proposal
+	 * computers.</p>
+	 * 
+	 * <p>Extenders may override this method</p>
+	 *
+	 * @param viewer the viewer that content assist is invoked on
+	 * @param offset the content assist offset
+	 * @return the context to be passed to the computers
+	 */
+	protected CompletionProposalInvocationContext createContext(ITextViewer viewer, int offset) {
+		return new CompletionProposalInvocationContext(viewer, offset);
+	}
+	
+	/**
+	 * @return the associated preference store
+	 */
+	protected IPreferenceStore getPreferenceStore() {
+		return this.fPreferenceStore;
+	}
+	
+	/**
+	 * Clears the state
+	 */
+	private void clearState() {
+		fErrorMessage=null;
+		fNumberOfComputedResults= 0;
+	}
+
+	/**
+	 * <p>Collects the proposals from the extensions.</p>
+	 *
+	 * @param viewer the text viewer
+	 * @param offset the offset
+	 * @param monitor the progress monitor
+	 * @param context the code assist invocation context
+	 * @return the list of proposals
+	 */
+	private List collectProposals(ITextViewer viewer, int offset, IProgressMonitor monitor, CompletionProposalInvocationContext context) {
+		List proposals = new ArrayList();
+		List categories = getCategories();
+		for (Iterator it = categories.iterator(); it.hasNext();) {
+			CompletionProposalCategory cat = (CompletionProposalCategory) it.next();
+			List computed = cat.computeCompletionProposals(context, this.fContentTypeID, this.fPartitionTypeID, new SubProgressMonitor(monitor, 1));
+			proposals.addAll(computed);
+			if (fErrorMessage == null) {
+				fErrorMessage= cat.getErrorMessage();
+			}
+		}
+		
+		// if default page
+		// Deal with adding in proposals from processors added through the legacy extension
+		if (isFirstPage() && getLegacyExtendedContentAssistProcessors() != null &&
+				!getLegacyExtendedContentAssistProcessors().isEmpty()) {
+			
+			Iterator iter = getLegacyExtendedContentAssistProcessors().iterator();
+			while (iter.hasNext()) {
+				IContentAssistProcessor legacyProcessor = (IContentAssistProcessor) iter.next();
+				ICompletionProposal[] legacyComputed = legacyProcessor.computeCompletionProposals(viewer, offset);
+				if (legacyComputed != null) {
+					proposals.addAll(Arrays.asList(legacyComputed));
+				}
+			}
+		}
+		
+		return proposals;
+	}
+	
+	/**
+	 * <p>Collects the context information from the extensions.</p>
+	 * 
+	 * @param viewer
+	 * @param offset
+	 * @param monitor
+	 * @return
+	 */
+	private List collectContextInformation(ITextViewer viewer, int offset, IProgressMonitor monitor) {
+		List proposals = new ArrayList();
+		CompletionProposalInvocationContext context= createContext(viewer, offset);
+
+		List providers= getCategories();
+		for (Iterator it= providers.iterator(); it.hasNext();) {
+			CompletionProposalCategory cat= (CompletionProposalCategory) it.next();
+			List computed= cat.computeContextInformation(context, this.fContentTypeID, this.fPartitionTypeID, new SubProgressMonitor(monitor, 1));
+			proposals.addAll(computed);
+			if (fErrorMessage == null) {
+				fErrorMessage= cat.getErrorMessage();
+			}
+		}
+		
+		// Deal with adding in contexts from processors added through the legacy extension
+		if (getLegacyExtendedContentAssistProcessors() != null &&
+				!getLegacyExtendedContentAssistProcessors().isEmpty()) {
+			
+			Iterator iter = getLegacyExtendedContentAssistProcessors().iterator();
+			while (iter.hasNext()) {
+				IContentAssistProcessor legacyProcessor = (IContentAssistProcessor) iter.next();
+				IContextInformation[] legacyComputed = legacyProcessor.computeContextInformation(viewer, offset);
+				if(legacyComputed != null) {
+					proposals.addAll(Arrays.asList(legacyComputed));
+				}
+			}
+		}
+
+		return proposals;
+	}
+
+	/**
+	 * @return the next set of categories
+	 */
+	private List getCategories() {
+		List categories;
+		if (fCategoryIteration == null) {
+			categories =  getProposalCategories();
+		} else {
+			int iteration= fRepetition % fCategoryIteration.size();
+			fAssistant.setStatusMessage(createIterationMessage());
+			fAssistant.setEmptyMessage(createEmptyMessage());
+			fRepetition++;
+	
+			categories = (List) fCategoryIteration.get(iteration);
+		}
+		
+		return categories;
+	}
+
+	/**
+	 *  This may show the warning dialog if all categories are disabled
+	 */
+	private void resetCategoryIteration() {
+		fCategoryIteration = getCategoryIteration();
+	}
+
+	/**
+	 * @return {@link List} of {@link List}s of {@link CompletionProposalCategory}s, this is
+	 * the ordered list of the completion categories to cycle through
+	 */
+	private List getCategoryIteration() {
+		List sequence= new ArrayList();
+		sequence.add(getDefaultCategories());
+		for (Iterator it= getSortedOwnPageCategories().iterator(); it.hasNext();) {
+			CompletionProposalCategory cat= (CompletionProposalCategory) it.next();
+			sequence.add(Collections.singletonList(cat));
+		}
+		return sequence;
+	}
+
+	/**
+	 * @return the sorted categories for the default page
+	 */
+	private List getDefaultCategories() {
+		// default mix - enable all included computers
+		List included= getDefaultCategoriesUnchecked();
+
+		if (included.size() == 0 && CompletionProposalComputerRegistry.getDefault().hasUninstalledComputers()) {
+			if (informUserAboutEmptyDefaultCategory()) {
+				// preferences were restored - recompute the default categories
+				included= getDefaultCategoriesUnchecked();
+			}
+			CompletionProposalComputerRegistry.getDefault().resetUnistalledComputers();
+		}
+		
+		Collections.sort(included, DEFAULT_PAGE_ORDER_COMPARATOR);
+
+		return included;
+	}
+
+	/**
+	 * <p>Gets the default categories with no error checking.</p>
+	 * 
+	 * @return the default {@link CompletionProposalCategory}s
+	 */
+	private List getDefaultCategoriesUnchecked() {
+		List included = new ArrayList();
+		for (Iterator it = getProposalCategories().iterator(); it.hasNext();) {
+			CompletionProposalCategory category = (CompletionProposalCategory) it.next();
+			if (category.isIncludedOnDefaultPage(this.fContentTypeID) && category.hasComputers(fContentTypeID, fPartitionTypeID))
+				included.add(category);
+		}
+		return included;
+	}
+
+	/**
+	 * <p>Informs the user about the fact that there are no enabled categories in the default content
+	 * assist set and shows a link to the preferences.</p>
+	 *
+	 * @return  <code>true</code> if the default should be restored
+	 */
+	private boolean informUserAboutEmptyDefaultCategory() {
+		/*If warn about empty default category and there are associated properties for this
+		 * processors content type and those properties have an associated properties page then
+		 * display warning message to user.
+		 */
+		ICompletionProposalCategoriesConfigurationReader properties = CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getReadableConfiguration(this.fContentTypeID);
+		if (OptionalMessageDialog.isDialogEnabled(PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY) &&
+				properties instanceof ICompletionProposalCategoriesConfigurationWriter  &&
+				((ICompletionProposalCategoriesConfigurationWriter)properties).hasAssociatedPropertiesPage()) {
+			
+			ICompletionProposalCategoriesConfigurationWriter propertiesExtension = (ICompletionProposalCategoriesConfigurationWriter)properties;
+			
+			final Shell shell= SSEUIPlugin.getActiveWorkbenchShell();
+			String title= SSEUIMessages.ContentAssist_all_disabled_title;
+			String message= SSEUIMessages.ContentAssist_all_disabled_message;
+			// see PreferencePage#createControl for the 'defaults' label
+			final String restoreButtonLabel= JFaceResources.getString("defaults"); //$NON-NLS-1$
+			final String linkMessage= NLS.bind(SSEUIMessages.ContentAssist_all_disabled_preference_link, LegacyActionTools.removeMnemonics(restoreButtonLabel));
+			final int restoreId= IDialogConstants.CLIENT_ID + 10;
+			final int settingsId= IDialogConstants.CLIENT_ID + 11;
+			final OptionalMessageDialog dialog= new OptionalMessageDialog(PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY, shell, title, null /* default image */, message, MessageDialog.WARNING, new String[] { restoreButtonLabel, IDialogConstants.CLOSE_LABEL }, 1) {
+				/*
+				 * @see org.eclipse.jdt.internal.ui.dialogs.OptionalMessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite)
+				 */
+				protected Control createCustomArea(Composite composite) {
+					// wrap link and checkbox in one composite without space
+					Composite parent= new Composite(composite, SWT.NONE);
+					GridLayout layout= new GridLayout();
+					layout.marginHeight= 0;
+					layout.marginWidth= 0;
+					layout.verticalSpacing= 0;
+					parent.setLayout(layout);
+
+					Composite linkComposite= new Composite(parent, SWT.NONE);
+					layout= new GridLayout();
+					layout.marginHeight= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
+					layout.marginWidth= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
+					layout.horizontalSpacing= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
+					linkComposite.setLayout(layout);
+
+	        		Link link= new Link(linkComposite, SWT.NONE);
+	        		link.setText(linkMessage);
+	        		link.addSelectionListener(new SelectionAdapter() {
+	        			public void widgetSelected(SelectionEvent e) {
+	        				setReturnCode(settingsId);
+	        				close();
+	        			}
+	        		});
+	        		GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
+	        		gridData.widthHint= this.getMinimumMessageWidth();
+					link.setLayoutData(gridData);
+
+					// create checkbox and "don't show this message" prompt
+					super.createCustomArea(parent);
+
+					return parent;
+	        	}
+
+				/*
+				 * @see org.eclipse.jface.dialogs.MessageDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
+				 */
+				protected void createButtonsForButtonBar(Composite parent) {
+			        Button[] buttons= new Button[2];
+					buttons[0]= createButton(parent, restoreId, restoreButtonLabel, false);
+			        buttons[1]= createButton(parent, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL, true);
+			        setButtons(buttons);
+				}
+	        };
+	        int returnValue = dialog.open();
+	        
+	        //based on user actions either reset defaults or open preference dialog
+	        if (restoreId == returnValue || settingsId == returnValue) {
+	        	if (restoreId == returnValue) {
+	        		propertiesExtension.loadDefaults();
+	        		propertiesExtension.saveConfiguration();
+	        	}
+	        	if (settingsId == returnValue) {
+					PreferencesUtil.createPreferenceDialogOn(shell,
+							propertiesExtension.getPropertiesPageID(), null, null).open();
+	        	}
+	        	
+	        	return true;
+	        }
+		}
+		return false;
+	}
+
+	/**
+	 * @return a sorted {@link List} of {@link CompletionProposalCategory}s that
+	 * should be displayed on their own content assist page
+	 */
+	private List getSortedOwnPageCategories() {
+		ArrayList sorted= new ArrayList();
+		for (Iterator it= getProposalCategories().iterator(); it.hasNext();) {
+			CompletionProposalCategory category= (CompletionProposalCategory) it.next();
+			if (category.isDisplayedOnOwnPage(this.fContentTypeID) && 
+					category.hasComputers(fContentTypeID, fPartitionTypeID)) {
+				
+				sorted.add(category);
+			}
+		}
+		Collections.sort(sorted, PAGE_ORDER_COMPARATOR);
+		return sorted;
+	}
+
+	/**
+	 * @return a user message describing that there are no content assist suggestions for the current page
+	 */
+	private String createEmptyMessage() {
+		return NLS.bind(SSEUIMessages.ContentAssist_no_message, new String[]{getCategoryLabel(fRepetition)});
+	}
+
+	/**
+	 * @return user message describing what the next page of content assist holds
+	 */
+	private String createIterationMessage() {
+		return NLS.bind(SSEUIMessages.ContentAssist_toggle_affordance_update_message,
+				new String[]{ getCategoryLabel(fRepetition), fIterationGesture, getCategoryLabel(fRepetition + 1) });
+	}
+
+	/**
+	 * @param repetition which category to get the label for
+	 * @return the label of the category
+	 */
+	private String getCategoryLabel(int repetition) {
+		int iteration= repetition % fCategoryIteration.size();
+		if (iteration == 0)
+			return SSEUIMessages.ContentAssist_defaultProposalCategory_title;
+		return ((CompletionProposalCategory) ((List) fCategoryIteration.get(iteration)).get(0)).getDisplayName();
+	}
+
+	/**
+	 * @return {@link String} representing the user command to iterate to the next page
+	 */
+	private String getIterationGesture() {
+		TriggerSequence binding= getIterationBinding();
+		return binding != null ?
+				NLS.bind(SSEUIMessages.ContentAssist_press, new Object[] { binding.format() })
+				: SSEUIMessages.ContentAssist_click;
+	}
+
+	/**
+	 * @return {@link KeySequence} used by user to iterate to the next page
+	 */
+	private KeySequence getIterationBinding() {
+	    final IBindingService bindingSvc= (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class);
+		TriggerSequence binding= bindingSvc.getBestActiveBindingFor(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
+		if (binding instanceof KeySequence)
+			return (KeySequence) binding;
+		return null;
+    }
+	
+	/**
+	 * @return <code>true</code> if displaying first page, <code>false</code> otherwise
+	 */
+	private boolean isFirstPage() {
+		return fCategoryIteration.size() == 1 || fRepetition % fCategoryIteration.size() == 1;
+	}
+	
+	/**
+	 * <p><b>NOTE: </b>This method should be used over accessing the
+	 * {@link #fLegacyExtendedContentAssistProcessors} field directly so as to
+	 * facilitate the lazy initialization of the field.</p>
+	 * 
+	 * @return the legacy extended content assist processors
+	 */
+	private List getLegacyExtendedContentAssistProcessors() {
+		if(fLegacyExtendedContentAssistProcessors == null) {
+			fLegacyExtendedContentAssistProcessors =
+				ExtendedConfigurationBuilder.getInstance().getConfigurations(
+						CONTENT_ASSIST_PROCESSOR_EXTENDED_ID, fPartitionTypeID);
+		}
+		
+		return fLegacyExtendedContentAssistProcessors;
+	}
+	
+	/**
+	 * <p><b>NOTE: </b>This method should be used over accessing the {@link #fCategories}
+	 * field directly so as to facilitate the lazy initialization of the field.</p>
+	 * 
+	 * @return the categories associated with the content type this processor is associated with
+	 */
+	private List getProposalCategories() {
+		if(fCategories == null) {
+			fCategories =
+				CompletionProposalComputerRegistry.getDefault().getProposalCategories(fContentTypeID);
+		}
+		
+		return fCategories;
+	}
+	
+	/**
+	 * The completion listener class for this processor.
+	 */
+	private final class CompletionListener implements ICompletionListener, ICompletionListenerExtension {
+		/**
+		 * @see org.eclipse.jface.text.contentassist.ICompletionListener#assistSessionStarted(org.eclipse.jface.text.contentassist.ContentAssistEvent)
+		 */
+		public void assistSessionStarted(ContentAssistEvent event) {
+			if (event.processor == StructuredContentAssistProcessor.this ||
+					(event.processor instanceof CompoundContentAssistProcessor &&
+							((CompoundContentAssistProcessor)event.processor).containsProcessor(StructuredContentAssistProcessor.this))) {
+				
+				fIterationGesture= getIterationGesture();
+				KeySequence binding= getIterationBinding();
+	
+				// This may show the warning dialog if all categories are disabled
+				resetCategoryIteration();
+				for (Iterator it= StructuredContentAssistProcessor.this.getProposalCategories().iterator(); it.hasNext();) {
+					CompletionProposalCategory cat= (CompletionProposalCategory) it.next();
+					cat.sessionStarted();
+				}
+	
+				fRepetition= 0;
+				if (event.assistant instanceof IContentAssistantExtension2) {
+					IContentAssistantExtension2 extension= (IContentAssistantExtension2) event.assistant;
+	
+					if (fCategoryIteration.size() == 1) {
+						extension.setRepeatedInvocationMode(false);
+						extension.setShowEmptyList(false);
+					} else {
+						extension.setRepeatedInvocationMode(true);
+						extension.setStatusLineVisible(true);
+						extension.setStatusMessage(createIterationMessage());
+						extension.setShowEmptyList(true);
+						if (extension instanceof IContentAssistantExtension3) {
+							IContentAssistantExtension3 ext3= (IContentAssistantExtension3) extension;
+							((ContentAssistant) ext3).setRepeatedInvocationTrigger(binding);
+						}
+					}
+				}
+			}
+		}
+
+		/**
+		 * @see org.eclipse.jface.text.contentassist.ICompletionListener#assistSessionEnded(org.eclipse.jface.text.contentassist.ContentAssistEvent)
+		 */
+		public void assistSessionEnded(ContentAssistEvent event) {
+			if (event.processor == StructuredContentAssistProcessor.this ||	(event.processor instanceof CompoundContentAssistProcessor && ((CompoundContentAssistProcessor)event.processor).containsProcessor(StructuredContentAssistProcessor.this))) {
+				for (Iterator it= StructuredContentAssistProcessor.this.getProposalCategories().iterator(); it.hasNext();) {
+					CompletionProposalCategory cat= (CompletionProposalCategory) it.next();
+					cat.sessionEnded();
+				}
+	
+				fCategoryIteration= null;
+				fRepetition= -1;
+				fIterationGesture= null;
+				if (event.assistant instanceof IContentAssistantExtension2) {
+					IContentAssistantExtension2 extension= (IContentAssistantExtension2) event.assistant;
+					extension.setShowEmptyList(false);
+					extension.setRepeatedInvocationMode(false);
+					extension.setStatusLineVisible(false);
+					if (extension instanceof IContentAssistantExtension3) {
+						IContentAssistantExtension3 ext3= (IContentAssistantExtension3) extension;
+						((ContentAssistant) ext3).setRepeatedInvocationTrigger(null);
+					}
+				}
+			}
+		}
+
+		/**
+		 * @see org.eclipse.jface.text.contentassist.ICompletionListener#selectionChanged(org.eclipse.jface.text.contentassist.ICompletionProposal, boolean)
+		 */
+		public void selectionChanged(ICompletionProposal proposal, boolean smartToggle) {
+			//ignore
+		}
+
+		/**
+		 * @see org.eclipse.jface.text.contentassist.ICompletionListenerExtension#assistSessionRestarted(org.eclipse.jface.text.contentassist.ContentAssistEvent)
+		 */
+		public void assistSessionRestarted(ContentAssistEvent event) {
+			fRepetition= 0;
+		}
+	}
+	
+	/**
+	 * 
+	 */
+	private class TextInputListener implements ITextInputListener {
+
+		/**
+		 * <p>Set the content type based on the new document if it has not already been
+		 * set yet.</p>
+		 * 
+		 * @see org.eclipse.jface.text.ITextInputListener#inputDocumentChanged(org.eclipse.jface.text.IDocument, org.eclipse.jface.text.IDocument)
+		 */
+		public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
+			if(fContentTypeID == null) {
+				if(newInput instanceof IStructuredDocument) {
+					IStructuredModel model = null;
+					try {
+						model = StructuredModelManager.getModelManager().getModelForRead((IStructuredDocument)newInput);
+						if(model != null) {
+							fContentTypeID = model.getContentTypeIdentifier();
+						}
+					} finally {
+						if(model != null) {
+							model.releaseFromRead();
+						}
+					}
+				}
+			}
+		}
+		
+		/**
+		 * <p>Ignored</p>
+		 * 
+		 * @see org.eclipse.jface.text.ITextInputListener#inputDocumentAboutToBeChanged(org.eclipse.jface.text.IDocument, org.eclipse.jface.text.IDocument)
+		 */
+		public void inputDocumentAboutToBeChanged(IDocument oldInput,
+				IDocument newInput) {
+			//ignore
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedConfigurationBuilder.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedConfigurationBuilder.java
index 7aaa739..8ec6fa8 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedConfigurationBuilder.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedConfigurationBuilder.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -66,6 +66,11 @@
 	 * strategy
 	 */
 	public static final String DOUBLECLICKSTRATEGY = "doubleClickStrategy"; //$NON-NLS-1$
+	/**
+	 * Extension type to pass into getConfigurations to get quick outline
+	 * configuration
+	 */
+	public static final String QUICKOUTLINECONFIGURATION = "quickOutlineConfiguration"; //$NON-NLS-1$
 
 	private static final String ATT_CLASS = "class"; //$NON-NLS-1$
 	private static final String ATT_TARGET = "target"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorDropTargetAdapter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorDropTargetAdapter.java
index 662746d..bf0b04e 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorDropTargetAdapter.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorDropTargetAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -21,6 +21,7 @@
 import org.eclipse.swt.dnd.TransferData;
 import org.eclipse.swt.graphics.Point;
 import org.eclipse.ui.IEditorPart;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
 import org.eclipse.wst.sse.ui.internal.TransferBuilder.TransferProxyForDelayLoading;
 
 /**
@@ -162,6 +163,11 @@
 		for (int i = 0; i < ts.length; i++) {
 			if (ts[i].isSupportedType(event.currentDataType)) {
 				if (doDrop(ts[i], event)) {
+					IEditorPart part = targetEditor;
+					if (targetEditor instanceof StructuredTextEditor){
+						part = ((StructuredTextEditor) targetEditor).getEditorPart();
+					}
+					targetEditor.getSite().getPage().activate(part);
 					break;
 				}
 			}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/GotoAnnotationAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/GotoAnnotationAction.java
index 8be1b93..67de28a 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/GotoAnnotationAction.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/GotoAnnotationAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -42,7 +42,7 @@
 import org.eclipse.ui.texteditor.AnnotationPreference;
 import org.eclipse.ui.texteditor.IEditorStatusLine;
 import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.MarkerAnnotation;
+import org.eclipse.ui.texteditor.SimpleMarkerAnnotation;
 import org.eclipse.ui.texteditor.TextEditorAction;
 
 /**
@@ -204,6 +204,7 @@
 		// The original JavaEditor M7 implementation made use of an adapter,
 		// but that approach
 		// fails with a MultiPageEditorSite
+		
 		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
 		if (window == null)
 			return null;
@@ -320,8 +321,8 @@
 	 */
 	protected void updateAnnotationViews(Annotation annotation) {
 		IMarker marker = null;
-		if (annotation instanceof MarkerAnnotation)
-			marker = ((MarkerAnnotation) annotation).getMarker();
+		if (annotation instanceof SimpleMarkerAnnotation)
+			marker = ((SimpleMarkerAnnotation) annotation).getMarker();
 
 		if (marker != null) {
 			try {
@@ -339,6 +340,13 @@
 						else if (marker.isSubtypeOf(IMarker.BOOKMARK)) {
 							view = page.findView(IPageLayout.ID_BOOKMARKS);
 						}
+//						else if (marker.isSubtypeOf(IBreakpoint.BREAKPOINT_MARKER)) {
+//							view = page.findView(IDebugUIConstants.ID_BREAKPOINT_VIEW);
+//						}
+						
+						if (view == null) {
+							view = page.findView("org.eclipse.ui.views.AllMarkersView");
+						}
 						// If the view isn't open on this perspective, don't
 						// interact with it
 						if (view != null) {
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IStructuredTextEditorActionConstants.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IStructuredTextEditorActionConstants.java
new file mode 100644
index 0000000..d4b131c
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IStructuredTextEditorActionConstants.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal;
+
+public interface IStructuredTextEditorActionConstants {
+	String SOURCE_CONTEXT_MENU_ID = "sourcePopupMenuId"; //$NON-NLS-1$
+	String SOURCE_BEGIN = "sourceBegin"; //$NON-NLS-1$
+	String SOURCE_ADDITIONS = "additions"; //$NON-NLS-1$
+	String SOURCE_END = "sourceEnd"; //$NON-NLS-1$
+
+	String REFACTOR_CONTEXT_MENU_ID = "refactorPopupMenuId"; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/Logger.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/Logger.java
index 4f3f82d..906e3f2 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/Logger.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/Logger.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,13 +14,13 @@
 
 
 
-import com.ibm.icu.util.StringTokenizer;
-
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Status;
 import org.osgi.framework.Bundle;
 
+import com.ibm.icu.util.StringTokenizer;
+
 /**
  * Small convenience class to log messages to plugin's log file and also, if
  * desired, the console. This class should only be used by classes in this
@@ -75,11 +75,21 @@
 		}
 		message = (message != null) ? message : "null"; //$NON-NLS-1$
 		Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
-		Bundle bundle = Platform.getBundle(PLUGIN_ID);
-		if (bundle != null) 
-			Platform.getLog(bundle).log(statusObj);
+		_log(statusObj);
 
 	}
+	
+	/**
+	 * Adds {@link IStatus} to the log.
+	 * 
+	 * @param statusObj {@link IStatus} to add to the log
+	 */
+	protected static void _log(IStatus statusObj) {
+		Bundle bundle = Platform.getBundle(PLUGIN_ID);
+		if (bundle != null) {
+			Platform.getLog(bundle).log(statusObj);
+		}
+	}
 
 	/**
 	 * Prints message to log if category matches /debug/tracefilter option.
@@ -138,6 +148,15 @@
 	public static void log(int level, String message, Throwable exception) {
 		_log(level, message, exception);
 	}
+	
+	/**
+	 * <p>Allows an already constructed status to be logged</p>
+	 * 
+	 * @param status {@link IStatus} to log.
+	 */
+	public static void log(IStatus status) {
+		_log(status);
+	}
 
 	public static void logException(String message, Throwable exception) {
 		_log(ERROR, message, exception);
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/PreferenceInitializer.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/PreferenceInitializer.java
index 372c808..20c8cca 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/PreferenceInitializer.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/PreferenceInitializer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,11 +15,14 @@
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.resource.ColorRegistry;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.RGB;
+import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.editors.text.EditorsUI;
 import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
+import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy;
 import org.eclipse.wst.sse.ui.internal.provisional.preferences.CommonEditorPreferenceNames;
 
 
@@ -29,7 +32,8 @@
 	 */
 	public void initializeDefaultPreferences() {
 		IPreferenceStore store = SSEUIPlugin.getDefault().getPreferenceStore();
-
+		ColorRegistry registry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
+		
 		// use the base annotation & quick diff preference page
 		EditorsUI.useAnnotationsPreferencePage(store);
 		EditorsUI.useQuickDiffPreferencePage(store);
@@ -47,7 +51,7 @@
 		// preference
 		store.setDefault(CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS, true);
 
-		setMatchingBracketsPreferences(store);
+		setMatchingBracketsPreferences(store, registry);
 
 		// hover help preferences are not part of base text editor preference
 		String mod2Name = Action.findModifierString(SWT.MOD2); // SWT.COMMAND
@@ -60,22 +64,24 @@
 		store.setDefault(EditorPreferenceNames.READ_ONLY_FOREGROUND_SCALE, 30);
 		
 		// set default enable folding value
-		store.setDefault(IStructuredTextFoldingProvider.FOLDING_ENABLED, false);
+		store.setDefault(AbstractStructuredFoldingStrategy.FOLDING_ENABLED, true);
 		
 		// set default for show message dialog when unknown content type in editor
 		store.setDefault(EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG, true);
 		
 		// set content assist defaults
 		store.setDefault(EditorPreferenceNames.CODEASSIST_AUTOACTIVATION_DELAY, 500);
-		PreferenceConverter.setDefault(store, EditorPreferenceNames.CODEASSIST_PROPOSALS_BACKGROUND, new RGB(255, 255, 255));
-		PreferenceConverter.setDefault(store, EditorPreferenceNames.CODEASSIST_PROPOSALS_FOREGROUND, new RGB(0, 0, 0));
-		PreferenceConverter.setDefault(store, EditorPreferenceNames.CODEASSIST_PARAMETERS_BACKGROUND, new RGB(255, 255, 255));
-		PreferenceConverter.setDefault(store, EditorPreferenceNames.CODEASSIST_PARAMETERS_FOREGROUND, new RGB(0, 0, 0));
+		PreferenceConverter.setDefault(store, EditorPreferenceNames.CODEASSIST_PROPOSALS_BACKGROUND, ColorHelper.findRGB(registry, EditorPreferenceNames.CODEASSIST_PROPOSALS_BACKGROUND, new RGB(255, 255, 255)));
+		PreferenceConverter.setDefault(store, EditorPreferenceNames.CODEASSIST_PROPOSALS_FOREGROUND, ColorHelper.findRGB(registry, EditorPreferenceNames.CODEASSIST_PROPOSALS_FOREGROUND, new RGB(0, 0, 0)));
+		PreferenceConverter.setDefault(store, EditorPreferenceNames.CODEASSIST_PARAMETERS_BACKGROUND, ColorHelper.findRGB(registry, EditorPreferenceNames.CODEASSIST_PARAMETERS_BACKGROUND, new RGB(255, 255, 255)));
+		PreferenceConverter.setDefault(store, EditorPreferenceNames.CODEASSIST_PARAMETERS_FOREGROUND, ColorHelper.findRGB(registry, EditorPreferenceNames.CODEASSIST_PARAMETERS_FOREGROUND, new RGB(0, 0, 0)));
+
+		store.setDefault(EditorPreferenceNames.SEMANTIC_HIGHLIGHTING, true);
 	}
 
-	private void setMatchingBracketsPreferences(IPreferenceStore store) {
+	private void setMatchingBracketsPreferences(IPreferenceStore store, ColorRegistry registry) {
 		// matching brackets is not part of base text editor preference
 		store.setDefault(EditorPreferenceNames.MATCHING_BRACKETS, true);
-		PreferenceConverter.setDefault(store, EditorPreferenceNames.MATCHING_BRACKETS_COLOR, new RGB(192, 192, 192));
+		PreferenceConverter.setDefault(store, EditorPreferenceNames.MATCHING_BRACKETS_COLOR, ColorHelper.findRGB(registry, EditorPreferenceNames.MATCHING_BRACKETS_COLOR, new RGB(192, 192, 192)));
 	}
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java
index 1d1ddfe..7450860 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java
@@ -1,5 +1,5 @@
 /**********************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others. All rights reserved.   This
+ * Copyright (c) 2005, 2010 IBM Corporation and others. All rights reserved.   This
  * program and the accompanying materials are made available under the terms of
  * the Eclipse Public License v1.0 which accompanies this distribution, and is
  * available at http://www.eclipse.org/legal/epl-v10.html
@@ -178,6 +178,7 @@
 	//
 	public static String ExpandSelectionToMenu_label;
 	public static String SourceMenu_label;
+	public static String RefactorMenu_label;
 
 	public static String FindOccurrencesActionProvider_0;
 	public static String RemoveAction_0;
@@ -274,6 +275,7 @@
 
 	public static String EditStructuredTextEditorPreferencesAction_0;
 	public static String StructuredTextEditorPreferencePage_0;
+	public static String StructuredTextEditorPreferencePage_1;
 	public static String PreferenceManager_0;
 
 	public static String OccurrencesSearchQuery_0;
@@ -319,6 +321,7 @@
 	public static String An_error_has_occurred_when_ERROR_;
 	public static String Problems_During_Save_As_UI_;
 	public static String Save_could_not_be_complete_UI_;
+	public static String SemanticHighlightingReconciler_0;
 	public static String ManageBreakpoints_error_removing_title1;
 	public static String ManageBreakpoints_error_removing_message1;
 	public static String ManageBreakpoints_error_retrieving_message;
@@ -428,4 +431,36 @@
 	public static String UnknownContentTypeDialog_1;
 	public static String UnknownContentTypeDialog_2;
 	public static String StyledTextColorPicker_0;
+	
+	public static String TextSearchLabelProvider_matchCountFormat;
+	
+	//content assist messages
+	public static String ContentAssist_computing_proposals;
+	public static String ContentAssist_collecting_proposals;
+	public static String ContentAssist_sorting_proposals;
+	public static String ContentAssist_collecting_contexts;
+	public static String ContentAssist_computing_contexts;
+	public static String ContentAssist_sorting_contexts;
+	public static String ContentAssist_no_completions;
+	public static String ContentAssist_all_disabled_title;
+	public static String ContentAssist_all_disabled_message;
+	public static String ContentAssist_all_disabled_preference_link;
+	public static String ContentAssist_no_message;
+	public static String ContentAssist_toggle_affordance_update_message;
+	public static String ContentAssist_defaultProposalCategory_title;
+	public static String ContentAssist_press;
+	public static String ContentAssist_click;
+	public static String OptionalMessageDialog_dontShowAgain;
+	
+	//content assist preference messages
+	public static String CodeAssistAdvancedConfigurationBlock_page_description;
+	public static String CodeAssistAdvancedConfigurationBlock_no_shortcut;
+	public static String CodeAssistAdvancedConfigurationBlock_Up;
+	public static String CodeAssistAdvancedConfigurationBlock_Down;
+	public static String CodeAssistAdvancedConfigurationBlock_separate_table_description;
+	public static String CodeAssistAdvancedConfigurationBlock_default_table_description;
+	public static String CodeAssistAdvancedConfigurationBlock_default_table_category_column_title;
+	public static String CodeAssistAdvancedConfigurationBlock_PagesDown;
+	public static String CodeAssistAdvancedConfigurationBlock_PagesUp;
+	public static String CodeAssistAdvancedConfigurationBlock_separate_table_category_column_title;
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPlugin.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPlugin.java
index ebc192c..d46cf03 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPlugin.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPlugin.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,10 +15,11 @@
 
 
 import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.forms.FormColors;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.sse.core.internal.tasks.TaskScanningScheduler;
 import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistry;
 import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistryImpl;
 import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
@@ -67,15 +68,6 @@
 
 	public void start(BundleContext context) throws Exception {
 		super.start(context);
-		/**
-		 * If the user starts the workbench with
-		 * -Dorg.eclipse.wst.sse.core.taskscanner=off, the scanner should be
-		 * disabled
-		 */
-		String scan = System.getProperty("org.eclipse.wst.sse.core.taskscanner"); //$NON-NLS-1$
-		if (scan == null || !scan.equalsIgnoreCase("off")) { //$NON-NLS-1$
-			TaskScanningScheduler.startup();
-		}
 	}
 	
 	public FormToolkit getDialogsFormToolkit() {
@@ -90,6 +82,18 @@
 
 	public void stop(BundleContext context) throws Exception {
 		super.stop(context);
-		TaskScanningScheduler.shutdown();
+	}
+
+	/**
+	 * <p>A utility function for getting the active workbench shell.</p>
+	 * 
+	 * @return the active workbench {@link Shell}
+	 */
+	public static Shell getActiveWorkbenchShell() {
+		 IWorkbenchWindow window = getDefault().getWorkbench().getActiveWorkbenchWindow();
+		 if (window != null) {
+		 	return window.getShell();
+		 }
+		 return null;
 	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties
index 107193e..aa04685 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2008 IBM Corporation and others.
+# Copyright (c) 2001, 2009 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -105,7 +105,7 @@
 ## The following strings are for "XML->XML Source->XML Style" Preferences, "Web Tools->Source->HTML Style" Preferences, and "Web Tools->Source->JavaScript Style" Preferences
 Content_type__UI_=Co&ntent type:
 Foreground_UI_=&Foreground:
-Background_UI_=&Background:
+Background_UI_=Backgr&ound:
 Bold_UI_=B&old
 Italics_UI=Italics
 Restore_Default_UI_=&Restore Default
@@ -152,6 +152,7 @@
 ##########################################################################
 ExpandSelectionToMenu_label=E&xpand Selection To
 SourceMenu_label=&Source
+RefactorMenu_label=Refac&tor
 #
 FindOccurrencesActionProvider_0=Current selection does not resolve to a searchable element
 RemoveAction_0=Remove Property
@@ -174,7 +175,7 @@
 StructuredTextEditorPreferencePage_30=&Report problems as you type
 StructuredTextEditorPreferencePage_37=Empty input
 StructuredTextEditorPreferencePage_38=is not a valid input.
-StructuredTextEditorPreferencePage_39=Inform when unsupported content type is in editor
+StructuredTextEditorPreferencePage_39=Inform when &unsupported content type is in editor
 StructuredTextEditorPreferencePage_40=Also see the <a>''{0}''</a> preferences.
 StructuredTextEditorPreferencePage_41=Completion proposal background
 StructuredTextEditorPreferencePage_42=Completion proposal foreground
@@ -245,9 +246,10 @@
 annotationHover_desc=Shows the description of the selected annotation.
 EditStructuredTextEditorPreferencesAction_0=Editor Preferences
 StructuredTextEditorPreferencePage_0=Appearance
+StructuredTextEditorPreferencePage_1=Enable &semantic highlighting
 PreferenceManager_0=Original Error:
 
-OccurrencesSearchQuery_0={0} - {1} Occurrences in {2}
+OccurrencesSearchQuery_0={0} - {1} occurrences in {2}
 OccurrencesSearchQuery_2=file
 ShowView_errorTitle=Problems Showing View
 proc_dirty_regions_0 = Processing Dirty Regions
@@ -294,6 +296,7 @@
 ## save as problems (next two) should match what is in workbench
 Problems_During_Save_As_UI_=Problems During Save As...
 Save_could_not_be_complete_UI_=Save could not be completed.
+SemanticHighlightingReconciler_0=Semantic Highlighting Job
 ManageBreakpoints_error_removing_title1=Remove Breakpoint
 ManageBreakpoints_error_removing_message1=Cannot remove breakpoint
 ManageBreakpoints_error_retrieving_message=Retrieving markers failed:
@@ -393,7 +396,7 @@
 ## Above are possibly unused strings that may be removed
 ###############################################################################
 StyledTextColorPicker_0=Pick a color
-SyntaxColoring_Link=Default colors and font can be configured on the <a href=\"org.eclipse.ui.preferencePages.GeneralTextEditor\">Text Editors</a> and on the <a href=\"org.eclipse.ui.preferencePages.ColorsAndFonts\">Colors and Fonts</a> preference page.
+SyntaxColoring_Link=Default colors and font can be configured on the <a href=\"org.eclipse.ui.preferencePages.GeneralTextEditor\">Text Editors</a> and on the <a href=\"org.eclipse.ui.preferencePages.ColorsAndFonts\">Colors and Fonts</a> preference pages.  Decorations for annotations can be configured on the <a href=\"org.eclipse.ui.editors.preferencePages.Annotations\">Annotations</a> preference page.
 SyntaxColoring_Description=Customize the syntax highlighting by selecting the type of text whose style you want to customize from either the list or the example text area.
 
 GotoMatchingBracket_label= Matching &Bracket
@@ -402,3 +405,40 @@
 GotoMatchingBracket_error_invalidSelection=No bracket selected
 GotoMatchingBracket_error_noMatchingBracket=No matching bracket found
 GotoMatchingBracket_error_bracketOutsideSelectedElement=Matching bracket is outside the selected element
+
+TextSearchLabelProvider_matchCountFormat=({0} matches)
+
+
+##################################################
+## Content Assist Strings
+##################################################
+ContentAssist_computing_proposals=Computing completion proposals
+ContentAssist_collecting_proposals=Collecting completion proposals
+ContentAssist_sorting_proposals=Sorting completion proposals
+ContentAssist_collecting_contexts=Collecting context information
+ContentAssist_computing_contexts=Computing context information
+ContentAssist_sorting_contexts=Sorting context information
+ContentAssist_no_completions=No completions available.
+ContentAssist_all_disabled_title=Content Assist Problem
+ContentAssist_all_disabled_message=Some content proposal kinds have been uninstalled. It is recommended to review the content assist settings.
+ContentAssist_all_disabled_preference_link=Change the settings on the <a>Content Assist preference page</a> or click ''{0}'' to restore the default behavior.
+ContentAssist_no_message= No {0}
+ContentAssist_toggle_affordance_update_message={1} to show {2}
+ContentAssist_defaultProposalCategory_title=Default Proposals
+ContentAssist_press=Press ''{0}''
+ContentAssist_click=Click
+OptionalMessageDialog_dontShowAgain= Do not show this &message again
+
+##################################################
+## Content Assist Properties page Strings
+##################################################
+CodeAssistAdvancedConfigurationBlock_page_description=Configure the behavior of the content assist ({0}) command.
+CodeAssistAdvancedConfigurationBlock_no_shortcut=no shortcut
+CodeAssistAdvancedConfigurationBlock_Up=&Up
+CodeAssistAdvancedConfigurationBlock_Down=D&own
+CodeAssistAdvancedConfigurationBlock_default_table_description=Select the proposal &categories contained in the 'default' content assist list:
+CodeAssistAdvancedConfigurationBlock_default_table_category_column_title=Default Proposal Categories
+CodeAssistAdvancedConfigurationBlock_PagesDown=Do&wn
+CodeAssistAdvancedConfigurationBlock_PagesUp=U&p
+CodeAssistAdvancedConfigurationBlock_separate_table_description=Select the &enablement and order of proposal categories that are cycled through when repeatedly invoking content assist:
+CodeAssistAdvancedConfigurationBlock_separate_table_category_column_title=Content Assist Pages
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StorageModelProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StorageModelProvider.java
index a0fc0c6..5082372 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StorageModelProvider.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StorageModelProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,19 +18,24 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import org.eclipse.core.resources.IEncodedStorage;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.IStorage;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.content.IContentDescription;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.source.AnnotationModel;
 import org.eclipse.jface.text.source.IAnnotationModel;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPathEditorInput;
 import org.eclipse.ui.IStorageEditorInput;
 import org.eclipse.ui.editors.text.FileDocumentProvider;
+import org.eclipse.ui.editors.text.ILocationProvider;
 import org.eclipse.ui.editors.text.StorageDocumentProvider;
 import org.eclipse.ui.texteditor.DocumentProviderRegistry;
 import org.eclipse.ui.texteditor.IDocumentProvider;
@@ -65,6 +70,9 @@
 			}
 
 			StorageInfo info = (StorageInfo) getElementInfo(element);
+			
+			if (info == null)
+				return;
 
 			/**
 			 * Force a reload of the markers into annotations since their
@@ -72,7 +80,7 @@
 			 * reconnecting forces a call to the private catchupWithMarkers
 			 * method.
 			 */
-			if (info != null && info.fModel != null) {
+			if (info.fModel != null) {
 				info.fModel.disconnect(info.fDocument);
 			}
 
@@ -197,34 +205,48 @@
 
 	String calculateBaseLocation(IStorageEditorInput input) {
 		String location = null;
-		try {
-			IStorage storage = input.getStorage();
-			if (storage != null) {
-				IPath storagePath = storage.getFullPath();
-				String name = storage.getName();
-				if (storagePath != null) {
-					// If they are different, the IStorage contract is not
-					// being honored
-					// (https://bugs.eclipse.org/bugs/show_bug.cgi?id=73098).
-					// Favor the name.
-					if (!storagePath.lastSegment().equals(name)) {
-						IPath workingPath = storagePath.addTrailingSeparator();
-						location = workingPath.append(name).toString();
-					}
-					else {
-						location = storagePath.makeAbsolute().toString();
-					}
-				}
-				if (location == null)
-					location = name;
+		if (input instanceof IPathEditorInput) {
+			IPath path = ((IPathEditorInput) input).getPath();
+			if (path != null) {
+				location = path.toString();
 			}
 		}
-		catch (CoreException e) {
-			Logger.logException(e);
+		if (location == null && input instanceof ILocationProvider) {
+			IPath path = ((ILocationProvider) input).getPath(input);
+			if (path != null) {
+				location = path.toString();
+			}
 		}
-		finally {
-			if (location == null)
-				location = input.getName();
+		if (location == null) {
+			try {
+				IStorage storage = input.getStorage();
+				if (storage != null) {
+					IPath storagePath = storage.getFullPath();
+					String name = storage.getName();
+					if (storagePath != null) {
+						// If they are different, the IStorage contract is not
+						// being honored
+						// (https://bugs.eclipse.org/bugs/show_bug.cgi?id=73098).
+						// Favor the name.
+						if (!storagePath.lastSegment().equals(name)) {
+							IPath workingPath = storagePath.addTrailingSeparator();
+							location = workingPath.append(name).toString();
+						}
+						else {
+							location = storagePath.makeAbsolute().toString();
+						}
+					}
+					if (location == null)
+						location = name;
+				}
+			}
+			catch (CoreException e) {
+				Logger.logException(e);
+			}
+			finally {
+				if (location == null)
+					location = input.getName();
+			}
 		}
 		return location;
 	}
@@ -239,34 +261,42 @@
 		 * 
 		 */
 		String path = null;
-		try {
-			IStorage storage = input.getStorage();
-			if (storage != null) {
-				IPath storagePath = storage.getFullPath();
-				String name = storage.getName();
-				if (storagePath != null) {
-					// If they are different, the IStorage contract is not
-					// being honored
-					// (https://bugs.eclipse.org/bugs/show_bug.cgi?id=73098).
-					// Favor the name.
-					if (!storagePath.lastSegment().equals(name)) {
-						IPath workingPath = storagePath.addTrailingSeparator();
-						path = workingPath.append(name).toString();
-					}
-					else {
-						path = storagePath.makeAbsolute().toString();
-					}
-				}
-				if (path == null)
-					path = name;
+		if (input instanceof ILocationProvider) {
+			IPath ipath = ((ILocationProvider) input).getPath(input);
+			if (ipath != null) {
+				path = ipath.toString();
 			}
 		}
-		catch (CoreException e) {
-			Logger.logException(e);
-		}
-		finally {
-			if (path == null)
-				path = ""; //$NON-NLS-1$
+		if (path == null) {
+			try {
+				IStorage storage = input.getStorage();
+				if (storage != null) {
+					IPath storagePath = storage.getFullPath();
+					String name = storage.getName();
+					if (storagePath != null) {
+						// If they are different, the IStorage contract is not
+						// being honored
+						// (https://bugs.eclipse.org/bugs/show_bug.cgi?id=73098).
+						// Favor the name.
+						if (!storagePath.lastSegment().equals(name)) {
+							IPath workingPath = storagePath.addTrailingSeparator();
+							path = workingPath.append(name).toString();
+						}
+						else {
+							path = storagePath.makeAbsolute().toString();
+						}
+					}
+					if (path == null)
+						path = name;
+				}
+			}
+			catch (CoreException e) {
+				Logger.logException(e);
+			}
+			finally {
+				if (path == null)
+					path = input.getName(); //$NON-NLS-1$
+			}
 		}
 		/*
 		 * Prepend the hash to the path value so that we have a 1:1:1 match
@@ -581,6 +611,48 @@
 			provider = new FileDocumentProvider();
 		provider.saveDocument(monitor, element, document, overwrite);
 	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.editors.text.StorageDocumentProvider#getPersistedEncoding(java.lang.Object)
+	 */
+	protected String getPersistedEncoding(Object element) {
+		String charset = super.getPersistedEncoding(element);
+		if (charset == null && element instanceof IStorageEditorInput) {
+			IStorage storage;
+			try {
+				storage = ((IStorageEditorInput) element).getStorage();
+				if (storage != null && !(storage instanceof IEncodedStorage)) {
+					InputStream contents = null;
+					try {
+						contents = storage.getContents();
+						if (contents != null) {
+							QualifiedName[] detectionOptions = new QualifiedName[]{IContentDescription.BYTE_ORDER_MARK, IContentDescription.CHARSET};
+							IContentDescription description = Platform.getContentTypeManager().getDescriptionFor(contents, storage.getName(), detectionOptions);
+							if (description != null) {
+								charset = description.getCharset();
+							}
+						}
+
+					}
+					catch (IOException e) {
+					}
+					finally {
+						if (contents != null)
+							try {
+								contents.close();
+							}
+							catch (IOException e) {
+								// do nothing
+							}
+					}
+				}
+			}
+			catch (CoreException e) {
+				Logger.logException(e);
+			}
+		}
+		return charset;
+	}
 
 	public IStructuredModel getModel(IEditorInput element) {
 		IStructuredModel result = null;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredLineChangeHover.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredLineChangeHover.java
index 469aadc..69d5d28 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredLineChangeHover.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredLineChangeHover.java
@@ -23,7 +23,7 @@
  * so that html in the diff file (displayed in hover) isn't presented as style
  * (bold, italic, colors, etc...)
  * 
- * @author pavery
+ * @deprecated
  */
 public class StructuredLineChangeHover extends LineChangeHover {
 	/*
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredMarkerAnnotation.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredMarkerAnnotation.java
index c7b196e..ed26973 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredMarkerAnnotation.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredMarkerAnnotation.java
@@ -42,6 +42,9 @@
 	}
 
 	public final String getAnnotationType() {
+		if (fAnnotationType==null){
+			initAnnotationType();
+		}
 		return fAnnotationType;
 	}
 
@@ -53,13 +56,14 @@
 	 */
 	protected Image getImage(Display display) {
 		Image image = null;
-		if (fAnnotationType == TemporaryAnnotation.ANNOT_ERROR) {
+		String annotationType = getAnnotationType();
+		if (annotationType == TemporaryAnnotation.ANNOT_ERROR) {
 			image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
 		}
-		else if (fAnnotationType == TemporaryAnnotation.ANNOT_WARNING) {
+		else if (annotationType == TemporaryAnnotation.ANNOT_WARNING) {
 			image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK);
 		}
-		else if (fAnnotationType == TemporaryAnnotation.ANNOT_INFO) {
+		else if (annotationType == TemporaryAnnotation.ANNOT_INFO) {
 			image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK);
 		}
 
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextAnnotationHover.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextAnnotationHover.java
index a76dda4..624a3f7 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextAnnotationHover.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextAnnotationHover.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,380 +12,70 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal;
 
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Set;
 
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationHover;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.texteditor.MarkerAnnotation;
-import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.jface.internal.text.html.HTMLPrinter;
+import org.eclipse.jface.text.source.DefaultAnnotationHover;
 
-public class StructuredTextAnnotationHover implements IAnnotationHover {
+/**
+ * Determines all messages for the given line and collects, concatenates, and
+ * formats them in HTML. Use of the internal HTMLPrinter was observed in
+ * org.eclipse.jdt.internal.ui.text.HTMLAnnotationHover .
+ */
+public class StructuredTextAnnotationHover extends DefaultAnnotationHover {
 
-	/**
-	 * Provides a set of convenience methods for creating HTML pages. Taken
-	 * from org.eclipse.jdt.internal.ui.text.HTMLPrinter
-	 */
-	class HTMLPrinter {
-
-		HTMLPrinter() {
-		}
-
-		void addBullet(StringBuffer buffer, String bullet) {
-			if (bullet != null) {
-				buffer.append("<li>"); //$NON-NLS-1$
-				buffer.append(bullet);
-				buffer.append("</li>"); //$NON-NLS-1$
-			}
-		}
-
-		void addPageEpilog(StringBuffer buffer) {
-			buffer.append("</font></body></html>"); //$NON-NLS-1$
-		}
-
-		void addPageProlog(StringBuffer buffer) {
-			insertPageProlog(buffer, buffer.length());
-		}
-
-		void addParagraph(StringBuffer buffer, Reader paragraphReader) {
-			if (paragraphReader != null)
-				addParagraph(buffer, read(paragraphReader));
-		}
-
-		void addParagraph(StringBuffer buffer, String paragraph) {
-			if (paragraph != null) {
-				buffer.append("<p>"); //$NON-NLS-1$
-				buffer.append(paragraph);
-			}
-		}
-
-		void addSmallHeader(StringBuffer buffer, String header) {
-			if (header != null) {
-				buffer.append("<h5>"); //$NON-NLS-1$
-				buffer.append(header);
-				buffer.append("</h5>"); //$NON-NLS-1$
-			}
-		}
-
-		String convertToHTMLContent(String content) {
-			content = replace(content, '<', "&lt;"); //$NON-NLS-1$
-			return replace(content, '>', "&gt;"); //$NON-NLS-1$
-		}
-
-		void endBulletList(StringBuffer buffer) {
-			buffer.append("</ul>"); //$NON-NLS-1$
-		}
-
-		void insertPageProlog(StringBuffer buffer, int position) {
-			buffer.insert(position, "<html><body text=\"#000000\" bgcolor=\"#FFFF88\"><font size=-1>"); //$NON-NLS-1$
-		}
-
-		String read(Reader rd) {
-
-			StringBuffer buffer = new StringBuffer();
-			char[] readBuffer = new char[2048];
-
-			try {
-				int n = rd.read(readBuffer);
-				while (n > 0) {
-					buffer.append(readBuffer, 0, n);
-					n = rd.read(readBuffer);
-				}
-				return buffer.toString();
-			}
-			catch (IOException x) {
-			}
-
-			return null;
-		}
-
-		private String replace(String text, char c, String s) {
-
-			int previous = 0;
-			int current = text.indexOf(c, previous);
-
-			if (current == -1)
-				return text;
-
-			StringBuffer buffer = new StringBuffer();
-			while (current > -1) {
-				buffer.append(text.substring(previous, current));
-				buffer.append(s);
-				previous = current + 1;
-				current = text.indexOf(c, previous);
-			}
-			buffer.append(text.substring(previous));
-
-			return buffer.toString();
-		}
-
-		void startBulletList(StringBuffer buffer) {
-			buffer.append("<ul>"); //$NON-NLS-1$
-		}
+	public StructuredTextAnnotationHover() {
+		super();
 	}
 
-	private IDebugModelPresentation fDebugModelPresentation;
-
-	private HTMLPrinter printer = new HTMLPrinter();
-
-	/**
-	 * Returns the distance to the ruler line.
-	 */
-	private int compareRulerLine(Position position, IDocument document, int line) {
-
-		if (position.getOffset() > -1 && position.getLength() > -1) {
-			try {
-				int markerLine = document.getLineOfOffset(position.getOffset());
-				if (line == markerLine)
-					return 1;
-				if (markerLine <= line && line <= document.getLineOfOffset(position.getOffset() + position.getLength()))
-					return 2;
-			}
-			catch (BadLocationException x) {
-			}
-		}
-
-		return 0;
+	public StructuredTextAnnotationHover(boolean showLineNumber) {
+		super(showLineNumber);
 	}
 
 	/*
-	 * Formats the message of this hover to fit onto the screen.
+	 * Formats a message as HTML text.
 	 */
-	private String formatHoverText(String text, ISourceViewer sourceViewer) {
-		String result = null;
-		String lineDelim = new String();
-		try {
-			lineDelim = sourceViewer.getDocument().getLineDelimiter(0);
-		}
-		catch (org.eclipse.jface.text.BadLocationException exception) {
-			// skip, just use default
-		}
-		Display display = sourceViewer.getTextWidget().getDisplay();
-
-		// replace special characters in text with html entity (like <, >, &
-		// to &lt;, &gt;, &&;)
-		text = StringUtils.convertToHTMLContent(text);
-
-		Reader textReader = new StringReader(text);
-		GC gc = new GC(display);
-		try {
-			StringBuffer buf = new StringBuffer();
-
-			StructuredTextLineBreakingReader reader = new StructuredTextLineBreakingReader(textReader, gc, getHoverWidth(display));
-			String line = reader.readLine();
-			while (line != null) {
-				if (buf.length() != 0) {
-					buf.append(lineDelim);
-				}
-				buf.append(line);
-				line = reader.readLine();
-			}
-			result = buf.toString();
-		}
-		catch (IOException exception) {
-			Logger.logException(exception);
-		}
-		finally {
-			gc.dispose();
-		}
-		return result;
+	protected String formatSingleMessage(String message) {
+		StringBuffer buffer = new StringBuffer();
+		HTMLPrinter.addPageProlog(buffer);
+		HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(message));
+		HTMLPrinter.addPageEpilog(buffer);
+		return buffer.toString();
 	}
 
 	/*
 	 * Formats several message as HTML text.
 	 */
-	private String formatMultipleHoverText(List messages) {
-
+	protected String formatMultipleMessages(List messages) {
 		StringBuffer buffer = new StringBuffer();
-		printer.addPageProlog(buffer);
-		printer.addParagraph(buffer, SSEUIMessages.Multiple_errors); //$NON-NLS-1$
+		HTMLPrinter.addPageProlog(buffer);
+		HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(SSEUIMessages.Multiple_errors));
 
-		printer.startBulletList(buffer);
+		HTMLPrinter.startBulletList(buffer);
+		Set collectedMessages = new HashSet();
 		Iterator e = messages.iterator();
-		while (e.hasNext())
-			printer.addBullet(buffer, printer.convertToHTMLContent((String) e.next()));
-		printer.endBulletList(buffer);
+		while (e.hasNext()) {
+			String converted = HTMLPrinter.convertToHTMLContent((String) e.next());
+			collectedMessages.add(converted);
+		}
+		e = collectedMessages.iterator();
+		while (e.hasNext()) {
+			HTMLPrinter.addBullet(buffer, e.next().toString());
+		}
+		HTMLPrinter.endBulletList(buffer);
 
-		printer.addPageEpilog(buffer);
+		HTMLPrinter.addPageEpilog(buffer);
 		return buffer.toString();
 	}
 
-	/**
-	 * @see IVerticalRulerHover#getHoverInfo(ISourceViewer, int)
-	 */
-	public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) {
-		IMarker marker = getMarker(sourceViewer, lineNumber);
-		List messages = new ArrayList(marker == null ? 0 : 1);
-		if (marker != null) {
-			String text = marker.getAttribute(IMarker.MESSAGE, (String) null);
-			if (text != null) {
-				messages.add(text);
-			}
-			else {
-				try {
-					if (marker.isSubtypeOf(IBreakpoint.BREAKPOINT_MARKER)) {
-						IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
-						IBreakpoint[] breakpoints = manager.getBreakpoints();
-						for (int i = 0; i < breakpoints.length; i++) {
-							IBreakpoint breakpoint = breakpoints[i];
-							if (breakpoint.getMarker().equals(marker)) {
-								if (fDebugModelPresentation == null) {
-									fDebugModelPresentation = DebugUITools.newDebugModelPresentation();
-								}
-								text = fDebugModelPresentation.getText(breakpoint);
-								if (text != null) {
-									messages.add(text);
-								}
-							}
-						}
-					}
-				}
-				catch (CoreException e) {
-					Logger.logException(e);
-				}
-			}
-		}
-		List temporaryAnnotations = getTemporaryAnnotationsForLine(sourceViewer, lineNumber);
-		for (int i = 0; i < temporaryAnnotations.size(); i++) {
-			String message = ((Annotation) temporaryAnnotations.get(i)).getText();
-			if (message != null) {
-				boolean duplicated = false;
-				for (int j = 0; j < messages.size(); j++)
-					duplicated = duplicated || messages.get(j).equals(message);
-				if (!duplicated) {
-					messages.add(message);
-				}
-
-			}
-			else
-				messages.add(((ITemporaryAnnotation) temporaryAnnotations.get(i)).toString());
-		}
-		if (messages.size() > 1)
-			return formatMultipleHoverText(messages);
-		else if (messages.size() > 0)
-			return formatHoverText(messages.get(0).toString(), sourceViewer);
-		else
-			return null;
-	}
-
-	private int getHoverWidth(Display display) {
-		Rectangle displayBounds = display.getBounds();
-		int hoverWidth = displayBounds.width - (display.getCursorLocation().x - displayBounds.x);
-		hoverWidth -= 12; // XXX: Add some space to the border, Revisit
-		if (hoverWidth < 200) {
-			hoverWidth = 200;
-		}
-		return hoverWidth;
-	}
-
-	/**
-	 * Returns one marker which includes the ruler's line of activity.
-	 */
-	private IMarker getMarker(ISourceViewer viewer, int line) {
-
-		IDocument document = viewer.getDocument();
-		IAnnotationModel model = viewer.getAnnotationModel();
-
-		if (model == null)
-			return null;
-
-		List exact = new ArrayList();
-		List including = new ArrayList();
-
-		Iterator e = model.getAnnotationIterator();
-		while (e.hasNext()) {
-			Object o = e.next();
-			if (o instanceof MarkerAnnotation) {
-				MarkerAnnotation a = (MarkerAnnotation) o;
-				switch (compareRulerLine(model.getPosition(a), document, line)) {
-					case 1 :
-						exact.add(a.getMarker());
-						break;
-					case 2 :
-						including.add(a.getMarker());
-						break;
-				}
-			}
-		}
-
-		return select(exact, including);
-	}
-
-	/**
-	 * Returns one marker which includes the ruler's line of activity.
-	 */
-	private List getTemporaryAnnotationsForLine(ISourceViewer viewer, int line) {
-
-		IDocument document = viewer.getDocument();
-		IAnnotationModel model = viewer.getAnnotationModel();
-
-		if (model == null)
-			return null;
-
-		List exact = new ArrayList();
-		List including = new ArrayList();
-
-		Iterator e = model.getAnnotationIterator();
-		while (e.hasNext()) {
-			Object o = e.next();
-			if (o instanceof ITemporaryAnnotation) {
-				ITemporaryAnnotation a = (ITemporaryAnnotation) o;
-				Position position = model.getPosition((Annotation) a);
-				if (position == null)
-					continue;
-
-				switch (compareRulerLine(position, document, line)) {
-					case 1 :
-						exact.add(a);
-						break;
-					case 2 :
-						including.add(a);
-						break;
-				}
-			}
-		}
-
-		return exact;
-	}
-
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see org.eclipse.wst.sse.ui.IReleasable#release()
 	 */
 	public void release() {
-		if (fDebugModelPresentation != null) {
-			fDebugModelPresentation.dispose();
-		}
-	}
-
-	/**
-	 * Selects one marker from the two lists.
-	 */
-	private IMarker select(List firstChoice, List secondChoice) {
-		if (!firstChoice.isEmpty())
-			return (IMarker) firstChoice.get(0);
-		if (!secondChoice.isEmpty())
-			return (IMarker) secondChoice.get(0);
-		return null;
 	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextViewer.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextViewer.java
index f737962..987b1c0 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextViewer.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextViewer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,6 +12,9 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal;
 
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.Assert;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.DocumentRewriteSession;
 import org.eclipse.jface.text.DocumentRewriteSessionType;
@@ -19,6 +22,7 @@
 import org.eclipse.jface.text.IDocumentAdapter;
 import org.eclipse.jface.text.IDocumentExtension4;
 import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextPresentationListener;
 import org.eclipse.jface.text.ITextSelection;
 import org.eclipse.jface.text.ITextViewerExtension2;
 import org.eclipse.jface.text.Region;
@@ -42,22 +46,25 @@
 import org.eclipse.swt.events.VerifyEvent;
 import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.IEditorStatusLine;
 import org.eclipse.wst.sse.core.internal.cleanup.StructuredContentCleanupHandler;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.undo.IDocumentSelectionMediator;
 import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
 import org.eclipse.wst.sse.core.internal.undo.UndoDocumentEvent;
 import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
+import org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider;
+import org.eclipse.wst.sse.ui.internal.provisional.style.CompatibleHighlighter;
 import org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter;
 import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+import org.eclipse.wst.sse.ui.internal.provisional.style.ReconcilerHighlighter;
 import org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor;
 import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
 
+/**
+ * <p>
+ * Like {@link org.eclipse.wst.sse.ui.StructuredTextEditor}, this class is not
+ * meant to be subclassed.<br />
+ */
 public class StructuredTextViewer extends ProjectionViewer implements IDocumentSelectionMediator {
 	/** Text operation codes */
 	private static final int BASE = ProjectionViewer.COLLAPSE_ALL; // see
@@ -81,9 +88,11 @@
 	private final int MAX_SMALL_FORMAT_LENGTH = 1000;
 	private boolean fBackgroundupdateInProgress;
 	private StructuredContentCleanupHandler fContentCleanupHandler = null;
-	private IDocumentAdapter fDocAdapter;
+	//private IDocumentAdapter fDocAdapter;
 
 	private Highlighter fHighlighter;
+	
+	private ReconcilerHighlighter fRecHighlighter = null;
 
 	// private ViewerSelectionManager fViewerSelectionManager;
 	private SourceViewerConfiguration fConfiguration;
@@ -112,6 +121,13 @@
 		setRedraw(false);
 	}
 
+	protected void createControl(Composite parent, int styles) {
+		// Forces LEFT_TO_RIGHT orientation unless otherwise suggested
+		if ((styles & SWT.LEFT_TO_RIGHT) == 0 && (styles & SWT.RIGHT_TO_LEFT) == 0)
+			styles |= SWT.LEFT_TO_RIGHT;
+		super.createControl(parent, styles);
+	}
+
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -161,12 +177,16 @@
 			fHighlighter = null;
 		}
 
-		// install content type independent plugins
-		if (fPresentationReconciler != null)
+		if(fRecHighlighter != null) {
+			fRecHighlighter.uninstall();
+			fRecHighlighter = null;
+		}
+		
+		// Bug 230297 - Uninstall presentation reconciler in preparation of a new one
+		if(fPresentationReconciler != null) {
 			fPresentationReconciler.uninstall();
-		fPresentationReconciler = configuration.getPresentationReconciler(this);
-		if (fPresentationReconciler != null)
-			fPresentationReconciler.install(this);
+			fPresentationReconciler = null;
+		}
 
 		IReconciler newReconciler = configuration.getReconciler(this);
 
@@ -253,7 +273,7 @@
 		if (fOverviewRulerAnnotationHover instanceof StructuredTextAnnotationHover) {
 			((StructuredTextAnnotationHover) fOverviewRulerAnnotationHover).release();
 		}
-		setOverviewRulerAnnotationHover(configuration.getAnnotationHover(this));
+		setOverviewRulerAnnotationHover(configuration.getOverviewRulerAnnotationHover(this));
 
 		getTextWidget().setTabs(configuration.getTabWidth(this));
 		setHoverControlCreator(configuration.getInformationControlCreator(this));
@@ -267,11 +287,11 @@
 		int eventStateMask = configuration.getHyperlinkStateMask(this);
 		setHyperlinkDetectors(hyperlinkDetectors, eventStateMask);
 
-		// install content type specific plugins
 		String[] types = configuration.getConfiguredContentTypes(this);
 
 		// clear autoindent/autoedit strategies
 		fAutoIndentStrategies = null;
+		
 		for (int i = 0; i < types.length; i++) {
 			String t = types[i];
 			setAutoEditStrategies(configuration.getAutoEditStrategies(this, t), t);
@@ -296,17 +316,31 @@
 			if (prefixes != null && prefixes.length > 0)
 				setDefaultPrefixes(prefixes, t);
 
-			// add highlighter/linestyleprovider
-			// BUG139753 - only create Highlighter if we have a valid document
-			if (configuration instanceof StructuredTextViewerConfiguration && getDocument() instanceof IStructuredDocument) {
+			// Bug 230297 - Add LineStyleProviders from the new configuration if
+			// the document is set
+			if(getDocument() != null) {
+				// add highlighter/linestyleprovider
 				LineStyleProvider[] providers = ((StructuredTextViewerConfiguration) configuration).getLineStyleProviders(this, t);
 				if (providers != null) {
 					for (int j = 0; j < providers.length; ++j) {
-						// delay creation of highlighter till
-						// linestyleprovider needs to be added
-						if (fHighlighter == null)
-							fHighlighter = new Highlighter();
-						fHighlighter.addProvider(t, providers[j]);
+						
+						if(fRecHighlighter == null) {
+							fRecHighlighter = new ReconcilerHighlighter();
+							((StructuredTextViewerConfiguration) configuration).setHighlighter(fRecHighlighter);
+						}
+						if (providers[j] instanceof AbstractLineStyleProvider) {
+							((AbstractLineStyleProvider) providers[j]).init((IStructuredDocument) getDocument(), fRecHighlighter);
+							fRecHighlighter.addProvider(t, providers[j]);
+						}
+						else {
+							// init with compatibility instance
+							if (fHighlighter == null) {
+								fHighlighter = new CompatibleHighlighter();
+							}
+							Logger.log(Logger.INFO_DEBUG, "CompatibleHighlighter installing compatibility for " + providers[j].getClass()); //$NON-NLS-1$
+							providers[j].init((IStructuredDocument) getDocument(), fHighlighter);
+							fHighlighter.addProvider(t, providers[j]);
+						}
 					}
 				}
 			}
@@ -318,10 +352,19 @@
 			fHighlighter.setDocument((IStructuredDocument) getDocument());
 			fHighlighter.install(this);
 		}
+		
+		if (fRecHighlighter != null)
+			fRecHighlighter.install(this);
 
 		activatePlugins();
 
 		fConfiguration = configuration;
+		
+		// Update the viewer's presentation reconciler
+		fPresentationReconciler = configuration.getPresentationReconciler(this);
+		
+		if(fPresentationReconciler != null)
+			fPresentationReconciler.install(this);
 	}
 
 	/**
@@ -358,12 +401,14 @@
 		}
 	}
 
+	/**
+	 * @deprecated - present for compatibility only
+	 */
 	protected IDocumentAdapter createDocumentAdapter() {
-
-		fDocAdapter = new StructuredDocumentToTextAdapter(getTextWidget());
-		return fDocAdapter;
+		return super.createDocumentAdapter();
 	}
 
+
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -403,9 +448,8 @@
 						String err = fContentAssistant.showPossibleCompletions();
 						if (err != null) {
 							// don't wanna beep if there is no error
-							PlatformStatusLineUtil.displayErrorMessage(err);
+							PlatformStatusLineUtil.displayTemporaryErrorMessage(this, err);
 						}
-						PlatformStatusLineUtil.addOneTimeClearListener();
 					}
 					else
 						beep();
@@ -416,9 +460,8 @@
 					String err = fContentAssistant.showContextInformation();
 					if (err != null) {
 						// don't wanna beep if there is no error
-						PlatformStatusLineUtil.displayErrorMessage(err);
+						PlatformStatusLineUtil.displayTemporaryErrorMessage(this, err);
 					}
-					PlatformStatusLineUtil.addOneTimeClearListener();
 				}
 				break;
 			case SHIFT_RIGHT :
@@ -620,6 +663,11 @@
 			fHighlighter.uninstall();
 			fHighlighter = null;
 		}
+		
+		if (fRecHighlighter != null) {
+			fRecHighlighter.uninstall();
+			fRecHighlighter = null;
+		}
 		super.handleDispose();
 
 		Logger.trace("Source Editor", "StructuredTextViewer::handleDispose exit"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -646,6 +694,7 @@
 			beep();
 			return;
 		}
+		
 		// for read-only support
 		if (containsReadOnly(getVisibleDocument(), e.start, e.end)) {
 			e.doit = false;
@@ -657,13 +706,14 @@
 			super.handleVerifyEvent(e);
 		}
 		catch (Exception x) {
-			// note, we catch and log any exception,
-			// since an otherwise can actually prevent typing!
-			// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=111318
+			/*
+			 * Note, we catch and log any exception, since an otherwise can
+			 * actually prevent typing! see
+			 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=111318
+			 */
 
 			if (TRACE_EXCEPTIONS)
 				Logger.logException("StructuredTextViewer.exception.verifyText", x); //$NON-NLS-1$
-
 		}
 	}
 
@@ -770,26 +820,6 @@
 	}
 
 	/**
-	 * Use the active editor to set a status line message
-	 * 
-	 * @param msg
-	 */
-	private void setErrorMessage(String msg) {
-		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-		if (window != null) {
-			IWorkbenchPage page = window.getActivePage();
-			if (page != null) {
-				IEditorPart editor = page.getActiveEditor();
-				if (editor != null) {
-					IEditorStatusLine statusLine = (IEditorStatusLine) editor.getAdapter(IEditorStatusLine.class);
-					if (statusLine != null)
-						statusLine.setMessage(true, msg, null);
-				}
-			}
-		}
-	}
-
-	/**
 	 * Uninstalls anything that was installed by configure
 	 */
 	public void unconfigure() {
@@ -798,6 +828,11 @@
 			fHighlighter.uninstall();
 			fHighlighter = null;
 		}
+		
+		if (fRecHighlighter != null) {
+			fRecHighlighter.uninstall();
+			fRecHighlighter = null;
+		}
 
 		if (fAnnotationHover instanceof StructuredTextAnnotationHover) {
 			((StructuredTextAnnotationHover) fAnnotationHover).release();
@@ -807,10 +842,6 @@
 			((StructuredTextAnnotationHover) fOverviewRulerAnnotationHover).release();
 		}
 
-		// doesn't seem to be handled elsewhere, so we'll be sure error
-		// messages's are cleared.
-		setErrorMessage(null);
-
 		super.unconfigure();
 		fConfiguration = null;
 		Logger.trace("Source Editor", "StructuredTextViewer::unconfigure exit"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -831,9 +862,9 @@
 
 	private void updateHighlighter(IStructuredDocument document) {
 		boolean documentSet = false;
-
+		
 		// if highlighter has not been created yet, initialize and install it
-		if (fHighlighter == null && fConfiguration instanceof StructuredTextViewerConfiguration) {
+		if (fRecHighlighter == null && fConfiguration instanceof StructuredTextViewerConfiguration) {
 			String[] types = fConfiguration.getConfiguredContentTypes(this);
 			for (int i = 0; i < types.length; i++) {
 				String t = types[i];
@@ -842,18 +873,31 @@
 				LineStyleProvider[] providers = ((StructuredTextViewerConfiguration) fConfiguration).getLineStyleProviders(this, t);
 				if (providers != null) {
 					for (int j = 0; j < providers.length; ++j) {
-						// delay creation of highlighter till
-						// linestyleprovider needs to be added
-						// do not create highlighter if no valid document
-						if (fHighlighter == null)
-							fHighlighter = new Highlighter();
-						fHighlighter.addProvider(t, providers[j]);
+						
+						if(fRecHighlighter == null) {
+							fRecHighlighter = new ReconcilerHighlighter();
+							((StructuredTextViewerConfiguration) fConfiguration).setHighlighter(fRecHighlighter);
+						}
+						if (providers[j] instanceof AbstractLineStyleProvider) {
+							((AbstractLineStyleProvider) providers[j]).init(document, fRecHighlighter);
+							fRecHighlighter.addProvider(t, providers[j]);
+						}
+						else {
+							// init with compatibility instance
+							if (fHighlighter == null) {
+								fHighlighter = new CompatibleHighlighter();
+							}
+							Logger.log(Logger.INFO_DEBUG, "CompatibleHighlighter installing compatibility for " + providers[j].getClass()); //$NON-NLS-1$
+							providers[j].init(document, fHighlighter);
+							fHighlighter.addProvider(t, providers[j]);
+						}
 					}
 				}
 			}
-
-			// initialize highlighter after linestyleproviders were added
-			if (fHighlighter != null) {
+			
+			if(fRecHighlighter != null)
+				fRecHighlighter.install(this);
+			if(fHighlighter != null) {
 				fHighlighter.setDocumentPartitioning(fConfiguration.getConfiguredDocumentPartitioning(this));
 				// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203347
 				// make sure to set document before install
@@ -864,6 +908,17 @@
 		}
 		if (fHighlighter != null && !documentSet)
 			fHighlighter.setDocument(document);
+		
+		// install content type independent plugins
+		if (fPresentationReconciler != null)
+			fPresentationReconciler.uninstall();
+		// 228847 - XSL Content Assist tests fail with Null Pointer on Highlighter
+		if(fConfiguration != null)
+			fPresentationReconciler = fConfiguration.getPresentationReconciler(this);
+		
+		if (fPresentationReconciler != null)
+			fPresentationReconciler.install(this);
+
 	}
 
 	/**
@@ -880,4 +935,24 @@
 			}
 		}
 	}
+	
+	/**
+	 * Prepends the text presentation listener at the beginning of the viewer's
+	 * list of text presentation listeners.  If the listener is already registered
+	 * with the viewer this call moves the listener to the beginning of
+	 * the list.
+	 *
+	 * @param listener the text presentation listener
+	 * @since 3.1
+	 */
+	public void prependTextPresentationListener(ITextPresentationListener listener) {
+
+		Assert.isNotNull(listener);
+
+		if (fTextPresentationListeners == null)
+			fTextPresentationListeners= new ArrayList();
+
+		fTextPresentationListeners.remove(listener);
+		fTextPresentationListeners.add(0, listener);
+	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionContributor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionContributor.java
index 6c34979..5002931 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionContributor.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionContributor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -25,8 +25,10 @@
 import org.eclipse.jface.action.IToolBarManager;
 import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.action.Separator;
+import org.eclipse.search.ui.IContextMenuConstants;
 import org.eclipse.ui.IActionBars;
 import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchActionConstants;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.editors.text.TextEditorActionContributor;
 import org.eclipse.ui.texteditor.ITextEditor;
@@ -54,7 +56,7 @@
  */
 public class ActionContributor extends TextEditorActionContributor implements ISourceViewerActionBarContributor, IExtendedContributor {
 
-	public static final boolean _showDebugStatus = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/actioncontributor/debugstatusfields")); //$NON-NLS-1$ //$NON-NLS-2$
+	public static final boolean _showDebugStatus = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/actioncontributor/debugstatusfields")) || Platform.inDebugMode() || Platform.inDevelopmentMode(); //$NON-NLS-1$ //$NON-NLS-2$
 
 	private static final String[] EDITOR_IDS = {"org.eclipse.wst.sse.ui.StructuredTextEditor"}; //$NON-NLS-1$
 
@@ -208,6 +210,11 @@
 	 */
 	public void contributeToMenu(IMenuManager menu) {
 		super.contributeToMenu(menu);
+
+		IMenuManager editMenu= menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
+		if (editMenu != null) {
+			editMenu.appendToGroup(IContextMenuConstants.GROUP_ADDITIONS, fToggleInsertModeAction);
+		}
 /*
 		addToMenu(menu);
 */
@@ -343,9 +350,9 @@
 		fPreviousAnnotation.setEditor(textEditor);
 		fNextAnnotation.setEditor(textEditor);
 		fGotoMatchingBracketAction.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_GOTO_MATCHING_BRACKET));
-
-		fToggleInsertModeAction.setAction(getAction(textEditor, ITextEditorActionConstants.TOGGLE_INSERT_MODE));
 */
+		fToggleInsertModeAction.setAction(getAction(textEditor, ITextEditorActionConstants.TOGGLE_INSERT_MODE));
+
 		if (extendedContributor != null) {
 			extendedContributor.setActiveEditor(activeEditor);
 		}
@@ -362,6 +369,7 @@
 	 * @see org.eclipse.wst.sse.ui.ISourceViewerActionBarContributor#setViewerSpecificContributionsEnabled(boolean)
 	 */
 	public void setViewerSpecificContributionsEnabled(boolean enabled) {
+		fToggleInsertModeAction.setEnabled(enabled);
 /*		fShiftRight.setEnabled(enabled);
 		fShiftLeft.setEnabled(enabled);
 		fNextAnnotation.setEnabled(enabled);
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionDefinitionIds.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionDefinitionIds.java
index a745d5c..ae26969 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionDefinitionIds.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionDefinitionIds.java
@@ -51,6 +51,7 @@
 	public final static String TOGGLE_COMMENT = "org.eclipse.wst.sse.ui.toggle.comment";//$NON-NLS-1$
 	public final static String TOGGLE_BREAKPOINTS = "org.eclipse.wst.sse.ui.breakpoints.toggle";//$NON-NLS-1$
 	public final static String UNCOMMENT = "org.eclipse.wst.sse.ui.uncomment";//$NON-NLS-1$
+	public final static String SHOW_OUTLINE = "org.eclipse.wst.sse.ui.quick_outline";//$NON-NLS-1$
 
 	// registered command IDs, so we pick up the declared key bindings
 	public static final String GOTO_MATCHING_BRACKET= "org.eclipse.wst.sse.ui.goto.matching.bracket"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/StructuredTextEditorActionConstants.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/StructuredTextEditorActionConstants.java
index c943cc1..286d8cc 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/StructuredTextEditorActionConstants.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/StructuredTextEditorActionConstants.java
@@ -33,6 +33,7 @@
 	public final static String ACTION_NAME_TOGGLE_COMMENT = "ToggleComment";//$NON-NLS-1$
 	public final static String ACTION_NAME_UNCOMMENT = "Uncomment";//$NON-NLS-1$
 	public final static String ACTION_NAME_GOTO_MATCHING_BRACKET = "GotoMatchingBracket";//$NON-NLS-1$
+	public final static String ACTION_NAME_SHOW_OUTLINE = "ShowQuickOutline"; //$NON-NLS-1$
 
 	/**
 	 * @deprecated use UNDERSCORE instead
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalCategory.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalCategory.java
new file mode 100644
index 0000000..83abfa3
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalCategory.java
@@ -0,0 +1,374 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.contentassist;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.action.LegacyActionTools;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.wst.sse.core.internal.util.Assert;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader;
+import org.osgi.framework.Bundle;
+
+/**
+ * Describes a category extension to the
+ * <code>org.eclipse.wst.sse.ui.completionProposal</code> extension point.
+ */
+public final class CompletionProposalCategory {
+	/** The extension schema name of the icon attribute. */
+	private static final String ICON= "icon"; //$NON-NLS-1$
+	
+	/** The extension schema name of the ID attribute. */
+	private static final String ID= "id"; //$NON-NLS-1$
+	
+	/** The extension schema name of the name attribute. */
+	private static final String NAME= "name"; //$NON-NLS-1$
+
+	/** ID of this completion category */
+	private final String fId;
+	
+	/** Name of this completion category */
+	private final String fName;
+	
+	/** The image descriptor for this category, or <code>null</code> if none specified. */
+	private final ImageDescriptor fImage;
+	
+	/** The last error reported by this category */
+	private String fLastError = null;
+
+	/**
+	 * <p>Construct the category by parsing the given element.</p>
+	 * 
+	 * @param element {@link IConfigurationElement} containing the configuration of this category
+	 * @throws CoreException if the given {@link IConfigurationElement} does not contain the correct
+	 * elements and attributes.
+	 */
+	CompletionProposalCategory(IConfigurationElement element) throws CoreException {
+		Assert.isLegal(element != null);
+		
+		//get & verify ID
+		fId = element.getAttribute(ID);
+		ContentAssistUtils.checkExtensionAttributeNotNull(fId, ID, element);
+		
+		//get & verify optional name
+		String name= element.getAttribute(NAME);
+		if (name == null) {
+			fName = fId;
+		} else {
+			fName= name;
+		}
+
+		//get & verify optional icon
+		String icon= element.getAttribute(ICON);
+		ImageDescriptor img= null;
+		if (icon != null) {
+			Bundle bundle= ContentAssistUtils.getBundle(element);
+			if (bundle != null) {
+				Path path= new Path(icon);
+				URL url= FileLocator.find(bundle, path, null);
+				img= ImageDescriptor.createFromURL(url);
+			}
+		}
+		fImage= img;
+	}
+
+	/**
+	 * <p>Creates a category with the given name and ID</p>
+	 * 
+	 * @param id the unique ID of the new category
+	 * @param name the name of the new category
+	 */
+	CompletionProposalCategory(String id, String name) {
+		fId= id;
+		fName= name;
+		fImage= null;
+	}
+
+	/**
+	 * <p>Returns the unique identifier of the category</p>
+	 *
+	 * @return Returns the id
+	 */
+	public String getId() {
+		return fId;
+	}
+
+	/**
+	 * <p>Returns the human readable name of the category.
+	 * It may contain mnemonics.</p>
+	 *
+	 * @return Returns the name
+	 */
+	public String getName() {
+		return fName;
+	}
+
+	/**
+	 * <p>Returns the human readable name of the category
+	 * without mnemonic hint in order to be displayed
+	 * in a message.</p>
+	 *
+	 * @return Returns the name
+	 */
+	public String getDisplayName() {
+		return LegacyActionTools.removeMnemonics(fName);
+	}
+
+	/**
+	 * <p>Returns the image descriptor of the category.</p>
+	 *
+	 * @return the image descriptor of the category
+	 */
+	public ImageDescriptor getImageDescriptor() {
+		return fImage;
+	}
+
+	/**
+	 * @return <code>true</code> if this category should be displayed on
+	 * its own content assist page, <code>false</code> otherwise
+	 */
+	public boolean isDisplayedOnOwnPage(String contentTypeID) {
+		boolean displayOnOwnPage = ICompletionProposalCategoriesConfigurationReader.DEFAULT_DISPLAY_ON_OWN_PAGE;
+		
+		ICompletionProposalCategoriesConfigurationReader properties =
+			CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getReadableConfiguration(contentTypeID);
+		if(properties != null) {
+			displayOnOwnPage = properties.shouldDisplayOnOwnPage(this.fId);
+		}
+		
+		return displayOnOwnPage;
+	}
+
+	/**
+	 * @return <code>true</code> if this category should be displayed in
+	 * the default content assist page, <code>false</code> otherwise
+	 */
+	public boolean isIncludedOnDefaultPage(String contentTypeID) {
+		boolean includeOnDefaultPage = ICompletionProposalCategoriesConfigurationReader.DEFAULT_INCLUDE_ON_DEFAULTS_PAGE;
+		
+		ICompletionProposalCategoriesConfigurationReader properties =
+			CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getReadableConfiguration(contentTypeID);
+		if(properties != null) {
+			includeOnDefaultPage = properties.shouldDisplayOnDefaultPage(this.fId);
+		}
+		
+		return includeOnDefaultPage;
+	}
+	
+	/**
+	 * <p>Given a content type ID determines the rank of this
+	 * category for sorting the content assist pages</p>
+	 * 
+	 * @return the sort rank of this category
+	 */
+	public int getPageSortRank(String contentTypeID) {
+		int sortOrder = ICompletionProposalCategoriesConfigurationReader.DEFAULT_SORT_ORDER;
+		
+		ICompletionProposalCategoriesConfigurationReader properties =
+			CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getReadableConfiguration(contentTypeID);
+		if(properties != null) {
+			sortOrder = properties.getPageSortOrder(this.fId);
+		}
+		
+		return sortOrder;
+	}
+	
+	/**
+	 * <p>Given a content type ID determines the rank of this
+	 * category for sorting on the default content assist page
+	 * with other categories</p>
+	 * 
+	 * @return the sort rank of this category
+	 */
+	public int getDefaultPageSortRank(String contentTypeID) {
+		int sortOrder = ICompletionProposalCategoriesConfigurationReader.DEFAULT_SORT_ORDER;
+		
+		ICompletionProposalCategoriesConfigurationReader properties =
+			CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getReadableConfiguration(contentTypeID);
+		if(properties != null) {
+			sortOrder = properties.getDefaultPageSortOrder(this.fId);
+		}
+		
+		return sortOrder;
+	}
+	
+	/**
+	 * <p><b>NOTE: </b> enablement is not the same as weather a category
+	 * should be displayed on its own page or the default page, it describes
+	 * if the category should be used at all.  Currently categories are always
+	 * enabled.  There maybe cases in the future where a category should be
+	 * disabled entirely though.</p>
+	 * 
+	 * @return <code>true</code> if this category is enabled,
+	 * <code>false</code> otherwise
+	 */
+	public boolean isEnabled() {
+		return true;
+	}
+
+	/**
+	 * @return <code>true</code> if the category contains any computers, <code>false</code>
+	 *         otherwise
+	 */
+	public boolean hasComputers() {
+		List descriptors=  CompletionProposalComputerRegistry.getDefault().getProposalComputerDescriptors();
+		for (Iterator it= descriptors.iterator(); it.hasNext();) {
+			CompletionProposalComputerDescriptor desc= (CompletionProposalComputerDescriptor) it.next();
+			if (desc.getCategory() == this) {
+				return true;
+			}
+		}
+		return false;
+	}
+	
+	/**
+	 * @param contentTypeID the content type ID
+	 * @param partitionTypeID the partition
+	 * @return <code>true</code> if the category contains any computers, in the given partition type
+	 * in the given content type, <code>false</code> otherwise
+	 */
+	public boolean hasComputers(String contentTypeID, String partitionTypeID) {
+		List descriptors = CompletionProposalComputerRegistry.getDefault().getProposalComputerDescriptors(contentTypeID, partitionTypeID);
+		for (Iterator it = descriptors.iterator(); it.hasNext();) {
+			CompletionProposalComputerDescriptor desc= (CompletionProposalComputerDescriptor) it.next();
+			if (desc.getCategory() == this) {
+				return true;
+			}
+		}
+		return false;
+	}
+	
+	/**
+	 * @param contentTypeID the content type ID
+	 * @return <code>true</code> if the category contains any computers, in the given partition type
+	 * in the given content type, <code>false</code> otherwise
+	 */
+	public boolean hasComputers(String contentTypeID) {
+		List descriptors = CompletionProposalComputerRegistry.getDefault().getProposalComputerDescriptors(contentTypeID);
+		for (Iterator it = descriptors.iterator(); it.hasNext();) {
+			CompletionProposalComputerDescriptor desc= (CompletionProposalComputerDescriptor) it.next();
+			if (desc.getCategory() == this) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	/**
+	 * <p>Safely computes completion proposals of all computers of this category through their
+	 * extension.</p>
+	 *
+	 * @param context the invocation context passed on to the extension
+	 * @param contentTypeID the content type ID where the invocation occurred
+	 * @param partitionTypeID the partition type where the invocation occurred
+	 * @param monitor the progress monitor passed on to the extension
+	 * @return the list of computed completion proposals (element type:
+	 *         {@link org.eclipse.jface.text.contentassist.ICompletionProposal})
+	 */
+	public List computeCompletionProposals(CompletionProposalInvocationContext context,
+			String contentTypeID, String partitionTypeID, SubProgressMonitor monitor) {
+		
+		fLastError = null;
+		List result = new ArrayList();
+		List descriptors = new ArrayList(CompletionProposalComputerRegistry.getDefault().getProposalComputerDescriptors(contentTypeID, partitionTypeID));
+		for (Iterator it = descriptors.iterator(); it.hasNext();) {
+			CompletionProposalComputerDescriptor desc = (CompletionProposalComputerDescriptor) it.next();
+			if (desc.getCategory() == this) {
+				result.addAll(desc.computeCompletionProposals(context, monitor));
+			}
+			
+			if (fLastError == null && desc.getErrorMessage() != null) {
+				fLastError = desc.getErrorMessage();
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * <p>Safely computes context information objects of all computers of this category through their
+	 * extension.</p>
+	 *
+	 * @param context the invocation context passed on to the extension
+	 * @param contentTypeID the content type ID where the invocation occurred
+	 * @param partitionTypeID the partition type where the invocation occurred
+	 * @param monitor the progress monitor passed on to the extension
+	 * @return the list of computed context information objects (element type:
+	 *         {@link org.eclipse.jface.text.contentassist.IContextInformation})
+	 */
+	public List computeContextInformation(CompletionProposalInvocationContext context,
+			String contentTypeID, String partitionTypeID, SubProgressMonitor monitor) {
+		
+		fLastError= null;
+		List result= new ArrayList();
+		List descriptors= new ArrayList(CompletionProposalComputerRegistry.getDefault().getProposalComputerDescriptors(contentTypeID, partitionTypeID));
+		for (Iterator it= descriptors.iterator(); it.hasNext();) {
+			CompletionProposalComputerDescriptor desc= (CompletionProposalComputerDescriptor) it.next();
+			if (desc.getCategory() == this && (isIncludedOnDefaultPage(contentTypeID) || isDisplayedOnOwnPage(contentTypeID))) {
+				result.addAll(desc.computeContextInformation(context, monitor));
+			}
+			if (fLastError == null) {
+				fLastError= desc.getErrorMessage();
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * @return the last error message reported by a computer in this category
+	 */
+	public String getErrorMessage() {
+		return fLastError;
+	}
+
+	/**
+	 * <p>Notifies the computers in this category of a proposal computation session start.</p>
+	 */
+	public void sessionStarted() {
+		List descriptors= new ArrayList(CompletionProposalComputerRegistry.getDefault().getProposalComputerDescriptors());
+		for (Iterator it= descriptors.iterator(); it.hasNext();) {
+			CompletionProposalComputerDescriptor desc= (CompletionProposalComputerDescriptor) it.next();
+			if (desc.getCategory() == this)
+				desc.sessionStarted();
+			if (fLastError == null)
+				fLastError= desc.getErrorMessage();
+		}
+	}
+
+	/**
+	 * <p>Notifies the computers in this category of a proposal computation session end.</p>
+	 */
+	public void sessionEnded() {
+		List descriptors= new ArrayList(CompletionProposalComputerRegistry.getDefault().getProposalComputerDescriptors());
+		for (Iterator it= descriptors.iterator(); it.hasNext();) {
+			CompletionProposalComputerDescriptor desc= (CompletionProposalComputerDescriptor) it.next();
+			if (desc.getCategory() == this)
+				desc.sessionEnded();
+			if (fLastError == null)
+				fLastError= desc.getErrorMessage();
+		}
+	}
+	
+	/**
+	 * @see java.lang.Object#toString()
+	 */
+	public String toString() {
+		return fId + ": " + fName; //$NON-NLS-1$
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerDescriptor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerDescriptor.java
new file mode 100644
index 0000000..3825dc5
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerDescriptor.java
@@ -0,0 +1,647 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.contentassist;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IContributor;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.InvalidRegistryObjectException;
+import org.eclipse.core.runtime.PerformanceStats;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer;
+import org.eclipse.wst.sse.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+import org.osgi.framework.Bundle;
+
+/**
+ * Wraps an {@link ICompletionProposalComputer} provided by an extension to the
+ * <code>org.eclipse.wst.sse.ui.completionProposal</code> extension point.
+ * Instances are immutable. Instances can be obtained from a
+ * {@link CompletionProposalComputerRegistry}.
+ *
+ * @see CompletionProposalComputerRegistry
+ */
+final class CompletionProposalComputerDescriptor {
+	/** The default category id. */
+	private static final String DEFAULT_CATEGORY_ID= "org.eclipse.wst.sse.ui.defaultProposalCategory"; //$NON-NLS-1$
+	
+	/** The extension schema name of the category id attribute. */
+	private static final String ATTR_CATEGORY_ID= "categoryId"; //$NON-NLS-1$
+	
+	/** The extension schema name for element ID attributes */
+	private static final String ATTR_ID= "id"; //$NON-NLS-1$
+	
+	/** The extension schema name for element name attributes */
+	private static final String ATTR_NAME= "name"; //$NON-NLS-1$
+	
+	/** The extension schema name of the class attribute. */
+	private static final String ATTR_CLASS= "class"; //$NON-NLS-1$
+	
+	/** The extension schema name of the activate attribute. */
+	private static final String ATTRACTIVATE= "activate"; //$NON-NLS-1$
+	
+	/** The extension schema name of the content type child elements. */
+	private static final String ELEM_CONTENT_TYPE = "contentType"; //$NON-NLS-1$
+	
+	/** The extension schema name of the partition type child elements. */
+	private static final String ELEM_PARTITION_TYPE= "partitionType"; //$NON-NLS-1$
+	
+	/** The name of the performance event used to trace extensions. */
+	private static final String PERFORMANCE_EVENT= SSEUIPlugin.ID + "/perf/content_assist/extensions"; //$NON-NLS-1$
+	
+	/**
+	 * If <code>true</code>, execution time of extensions is measured and the data forwarded to
+	 * core's {@link PerformanceStats} service.
+	 */
+	private static final boolean MEASURE_PERFORMANCE= PerformanceStats.isEnabled(PERFORMANCE_EVENT);
+	
+	/**
+	 * Independently of the {@link PerformanceStats} service, any operation that takes longer than
+	 * {@value} milliseconds will be flagged as an violation. This timeout does not apply to the
+	 * first invocation, as it may take longer due to plug-in initialization etc. See also
+	 * {@link #fIsReportingDelay}.
+	 */
+	private static final long MAX_DELAY= 500000;
+
+	/* log constants */
+	private static final String COMPUTE_COMPLETION_PROPOSALS= "computeCompletionProposals()"; //$NON-NLS-1$
+	private static final String COMPUTE_CONTEXT_INFORMATION= "computeContextInformation()"; //$NON-NLS-1$
+	private static final String SESSION_STARTED= "sessionStarted()"; //$NON-NLS-1$
+	private static final String SESSION_ENDED= "sessionEnded()"; //$NON-NLS-1$
+
+	/** The identifier of the extension. */
+	private final String fId;
+	
+	/** The name of the extension. */
+	private final String fName;
+	
+	/** The class name of the provided <code>ISSECompletionProposalComputer</code>. */
+	private final String fClass;
+	
+	/** The activate attribute value. */
+	private final boolean fActivate;
+	
+	/** The configuration element of this extension. */
+	private final IConfigurationElement fElement;
+	
+	/** The computer, if instantiated, <code>null</code> otherwise. */
+	private ICompletionProposalComputer fComputer;
+	
+	/** The UI category. */
+	private final CompletionProposalCategory fCategory;
+	
+	/** The first error message in the most recent operation, or <code>null</code>. */
+	private String fLastError;
+	
+	/**
+	 * Tells whether to inform the user when <code>MAX_DELAY</code> has been exceeded.
+	 * We start timing execution after the first session because the first may take
+	 * longer due to plug-in activation and initialization.
+	 */
+	private boolean fIsReportingDelay = false;
+	
+	/** The start of the last operation. */
+	private long fStart;
+	
+	/**
+	 * Tells whether we tried to load the computer.
+	 * @since 3.4
+	 */
+	boolean fTriedLoadingComputer = false;
+
+	/**
+	 * <p>Creates a new descriptor.</p>
+	 * <p><b>NOTE: </b> This will not add this new descriptor to the given
+	 * {@link CompletionProposalComputerRegistry}. That can not be done
+	 * until this descriptor is done being constructed.  Therefore be sure
+	 * to call {@link #addToRegistry()} after creating a new descriptor.</p>
+	 *
+	 * @param element the configuration element to read
+	 * @param categories the categories
+	 * 
+	 * @throws InvalidRegistryObjectException if this extension is no longer valid
+	 * @throws CoreException if the extension contains invalid values
+	 */
+	CompletionProposalComputerDescriptor(IConfigurationElement element, List categories) throws InvalidRegistryObjectException, CoreException {
+		Assert.isLegal(element != null);
+		fElement = element;
+		
+		//get & verify ID
+		fId = fElement.getAttribute(ATTR_ID);
+		ContentAssistUtils.checkExtensionAttributeNotNull(fId, ATTR_ID, fElement);
+
+		//get & verify optional name
+		String name= fElement.getAttribute(ATTR_NAME);
+		if (name == null) {
+			fName= fId;
+		} else {
+			fName= name;
+		}
+
+		//get & verify activate plugin attribute
+		String activateAttribute= fElement.getAttribute(ATTRACTIVATE);
+		fActivate = Boolean.valueOf(activateAttribute).booleanValue();
+
+		//get & verify class
+		fClass= fElement.getAttribute(ATTR_CLASS);
+		ContentAssistUtils.checkExtensionAttributeNotNull(fClass, ATTR_CLASS, fElement);
+
+		//get & verify optional category id
+		String categoryId= fElement.getAttribute(ATTR_CATEGORY_ID);
+		if (categoryId == null) {
+			categoryId= DEFAULT_CATEGORY_ID;
+		}
+		
+		//find the category with the determined category id
+		CompletionProposalCategory category= null;
+		for (Iterator it= categories.iterator(); it.hasNext();) {
+			CompletionProposalCategory cat= (CompletionProposalCategory) it.next();
+			if (cat.getId().equals(categoryId)) {
+				category= cat;
+				break;
+			}
+		}
+		
+		/* create a category if it does not exist
+		 * else just set the category
+		 */
+		if (category == null) {
+			fCategory = new CompletionProposalCategory(categoryId, fName);
+			
+			/* will add the new category to the registers list of categories,
+			 *  by the magic of object references
+			 */
+			categories.add(fCategory);
+		} else {
+			fCategory = category;
+		}
+	}
+	
+	/**
+	 * <p>Adds this descriptor to the {@link CompletionProposalComputerRegistry}.</p>
+	 * <p><b>NOTE: </b>Must be done after descriptor creation or the descriptor will
+	 * not be added to the registry. Can not be done in constructor because
+	 * descriptor must be constructed before it can be added to the registry</p>
+	 * 
+	 * 
+	 * @throws InvalidRegistryObjectException
+	 * @throws CoreException
+	 */
+	void addToRegistry() throws InvalidRegistryObjectException, CoreException {
+		parseActivationAndAddToRegistry(this.fElement, this);
+	}
+	
+	/**
+	 * @return the category that the wrapped {@link ICompletionProposalComputer} is
+	 * associated with.
+	 */
+	CompletionProposalCategory getCategory() {
+		return fCategory;
+	}
+	
+	/**
+	 * @return the contributor of the described {@link ICompletionProposalComputer}
+	 */
+    IContributor getContributor()  {
+        try {
+	        return fElement.getContributor();
+        } catch (InvalidRegistryObjectException e) {
+        	return null;
+        }
+    }
+
+	/**
+	 * @return Returns the id of the described {@link ICompletionProposalComputer}
+	 */
+	public String getId() {
+		return fId;
+	}
+
+	/**
+	 * @return the name of the described {@link ICompletionProposalComputer}
+	 */
+	public String getName() {
+		return fName;
+	}
+
+	/**
+	 * Returns a new instance of the computer as described in the
+	 * extension's xml. Note that the safest way to access the computer
+	 * is by using the
+	 * {@linkplain #computeCompletionProposals(ContentAssistInvocationContext, IProgressMonitor) computeCompletionProposals}
+	 * and
+	 * {@linkplain #computeContextInformation(ContentAssistInvocationContext, IProgressMonitor) computeContextInformation}
+	 * methods. These delegate the functionality to the contributed
+	 * computer, but handle instance creation and any exceptions thrown.
+	 *
+	 * @return a new instance of the completion proposal computer as
+	 *         described by this descriptor
+	 *         
+	 * @throws CoreException if the creation fails
+	 * @throws InvalidRegistryObjectException if the extension is not
+	 *         valid any longer (e.g. due to plug-in unloading)
+	 */
+	public ICompletionProposalComputer createComputer() throws CoreException, InvalidRegistryObjectException {
+		return (ICompletionProposalComputer) fElement.createExecutableExtension(ATTR_CLASS);
+	}
+
+	/**
+	 * <p>Safely computes completion proposals through the described extension.</p>
+	 *
+	 * @param context the invocation context passed on to the extension
+	 * @param monitor the progress monitor passed on to the extension
+	 * @return the list of computed completion proposals (element type:
+	 *         {@link org.eclipse.jface.text.contentassist.ICompletionProposal})
+	 */
+	public List computeCompletionProposals(CompletionProposalInvocationContext context, IProgressMonitor monitor) {
+		List completionProposals = Collections.EMPTY_LIST;
+		if (isEnabled()) {
+			IStatus status = null;
+			try {
+				// plugin must be active to get computer
+				ICompletionProposalComputer computer = getComputer(true);
+				if (computer != null) {
+					try {
+						PerformanceStats stats= startMeter(context, computer);
+						//ask the computer for the proposals
+						List proposals = computer.computeCompletionProposals(context, monitor);
+						stopMeter(stats, COMPUTE_COMPLETION_PROPOSALS);
+		
+						if (proposals != null) {
+							fLastError = computer.getErrorMessage();
+							completionProposals = proposals;
+						} else {
+							status = createAPIViolationStatus(COMPUTE_COMPLETION_PROPOSALS);
+						}
+					} finally {
+						fIsReportingDelay = true;
+					}
+				}
+			} catch (InvalidRegistryObjectException x) {
+				status= createExceptionStatus(x);
+			} catch (CoreException x) {
+				status= createExceptionStatus(x);
+			} catch (RuntimeException x) {
+				status= createExceptionStatus(x);
+			} finally {
+				monitor.done();
+			}
+	
+			if(status != null) {
+				Logger.log(status);
+			}
+		}
+
+		return completionProposals;
+	}
+
+	/**
+	 * <p>Safely computes context information objects through the described extension.</p>
+	 *
+	 * @param context the invocation context passed on to the extension
+	 * @param monitor the progress monitor passed on to the extension
+	 * @return the list of computed context information objects (element type:
+	 *         {@link org.eclipse.jface.text.contentassist.IContextInformation})
+	 */
+	public List computeContextInformation(CompletionProposalInvocationContext context, IProgressMonitor monitor) {
+		List contextInformation = Collections.EMPTY_LIST;
+		if (isEnabled()) {
+			IStatus status = null;
+			try {
+				// plugin must be active to get computer
+				ICompletionProposalComputer computer = getComputer(true);
+				if (computer != null) {
+					PerformanceStats stats= startMeter(context, computer);
+					List proposals= computer.computeContextInformation(context, monitor);
+					stopMeter(stats, COMPUTE_CONTEXT_INFORMATION);
+		
+					if (proposals != null) {
+						fLastError= computer.getErrorMessage();
+						contextInformation = proposals;
+					} else {
+						status = createAPIViolationStatus(COMPUTE_CONTEXT_INFORMATION);
+					}
+				}
+			} catch (InvalidRegistryObjectException x) {
+				status= createExceptionStatus(x);
+			} catch (CoreException x) {
+				status= createExceptionStatus(x);
+			} catch (RuntimeException x) {
+				status= createExceptionStatus(x);
+			} finally {
+				monitor.done();
+			}
+	
+			if(status != null) {
+				Logger.log(status);
+			}
+		}
+		
+		return contextInformation;
+	}
+
+	/**
+	 * <p>Notifies the described extension of a proposal computation session start.</p>
+	 * 
+	 * <p><b>Note: </b>This method is called every time code assist is invoked and
+	 * is <strong>not</strong> filtered by content type or partition type.</p>
+	 */
+	public void sessionStarted() {
+		if (isEnabled()) {
+			IStatus status = null;
+			try {
+				// plugin must be active to get computer
+				ICompletionProposalComputer computer = getComputer(true);
+				if (computer != null) {
+					PerformanceStats stats = startMeter(SESSION_STARTED, computer);
+					computer.sessionStarted();
+					stopMeter(stats, SESSION_ENDED);
+				}
+			} catch (InvalidRegistryObjectException x) {
+				status= createExceptionStatus(x);
+			} catch (CoreException x) {
+				status= createExceptionStatus(x);
+			} catch (RuntimeException x) {
+				status= createExceptionStatus(x);
+			}
+	
+			if(status != null) {
+				Logger.log(status);
+			}
+		}
+	}
+
+	/**
+	 * <p>Notifies the described extension of a proposal computation session end.</p>
+	 * 
+	 * <p><b>Note: </b>This method is called every time code assist is invoked and
+	 * is <strong>not</strong> filtered by content type or partition type.</p>
+	 */
+	public void sessionEnded() {
+		if (isEnabled()) {
+			IStatus status = null;
+			try {
+				// plugin must be active to get computer
+				ICompletionProposalComputer computer = getComputer(true);
+				if (computer != null) {
+					PerformanceStats stats= startMeter(SESSION_ENDED, computer);
+					computer.sessionEnded();
+					stopMeter(stats, SESSION_ENDED);
+				}
+			} catch (InvalidRegistryObjectException x) {
+				status= createExceptionStatus(x);
+			} catch (CoreException x) {
+				status= createExceptionStatus(x);
+			} catch (RuntimeException x) {
+				status= createExceptionStatus(x);
+			}
+	
+			if(status != null) {
+				Logger.log(status);
+			}
+		}
+	}
+	
+	/**
+	 * @return the error message from the described {@link ICompletionProposalComputer}
+	 */
+	public String getErrorMessage() {
+		return fLastError;
+	}
+	
+	/**
+	 * @see java.lang.Object#toString()
+	 */
+	public String toString() {
+		return fId + ": " + fName; //$NON-NLS-1$
+	}
+	
+	/**
+	 * <p>Parses the given configuration element for its activation context,
+	 * that is to say the content types and partiton types and updates the registry
+	 * to associated the given computer descriptor with the parsed activation contexts.</P>
+	 * 
+	 * <p>This is useful for parsing both <tt>proposalComputer</tt> elements and
+	 * <tt>proposalComputerExtendedActivation</tt> elements.</p>
+	 * 
+	 * @param element {@link IConfigurationElement} containing the activation context
+	 * @param desc {@link CompletionProposalComputerDescriptor} to associate with the parsed activation context
+	 * 
+	 * @throws InvalidRegistryObjectException
+	 * @throws CoreException
+	 */
+	protected static void parseActivationAndAddToRegistry(IConfigurationElement element,
+			CompletionProposalComputerDescriptor desc) throws InvalidRegistryObjectException, CoreException {
+		
+		/* if this descriptor is specific to a content type/s add it to the registry as such
+		 * else add to registry for all content types
+		 */
+		IConfigurationElement[] contentTypes = element.getChildren(ELEM_CONTENT_TYPE);
+		if(contentTypes.length > 0) {
+			for(int contentTypeIndex = 0; contentTypeIndex < contentTypes.length; ++contentTypeIndex) {
+				String contentTypeID = contentTypes[contentTypeIndex].getAttribute(ATTR_ID);
+				ContentAssistUtils.checkExtensionAttributeNotNull(contentTypeID, ATTR_ID, contentTypes[contentTypeIndex]);
+				
+				/* if this descriptor is for specific partition types in the content type
+				 * add it to the registry as such
+				 * else add to the registry for all partition types in the content type
+				 */
+				IConfigurationElement[] partitionTypes = contentTypes[contentTypeIndex].getChildren(ELEM_PARTITION_TYPE);
+				if(partitionTypes.length > 0) {
+					for (int partitionTypeIndex = 0; partitionTypeIndex < partitionTypes.length; ++partitionTypeIndex) {
+						String partitionTypeID = partitionTypes[partitionTypeIndex].getAttribute(ATTR_ID);
+						ContentAssistUtils.checkExtensionAttributeNotNull(partitionTypeID, ATTR_ID, partitionTypes[partitionTypeIndex]);
+						
+						CompletionProposalComputerRegistry.getDefault().putDescription(contentTypeID, partitionTypeID, desc);
+					}
+				} else {
+					CompletionProposalComputerRegistry.getDefault().putDescription(contentTypeID, null, desc);
+				}
+			}
+		} else {
+			Logger.log(Logger.WARNING, "The configuration element: " + element + " does not contain any content types."); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+	}
+
+	/**
+	 * @return <code>true</code> if the plugin that contains the {@link IConfigurationElement}
+	 * associated with this descriptor is loaded, <code>false</code> otherwise.
+	 */
+	private boolean isPluginLoaded() {
+		Bundle bundle= getBundle();
+		return bundle != null && bundle.getState() == Bundle.ACTIVE;
+	}
+
+	/**
+	 * @return the {@link Bundle} that contains the {@link IConfigurationElement} associated
+	 * with this descriptor
+	 */
+	private Bundle getBundle() {
+		String namespace= fElement.getDeclaringExtension().getContributor().getName();
+		Bundle bundle= Platform.getBundle(namespace);
+		return bundle;
+	}
+	
+	/**
+	 * <p>Returns a cached instance of the computer as described in the
+	 * extension's xml. If the computer is not yet created and
+	 * <code>canCreate</code> is <code>true</code> then {@link #createComputer()}
+	 * is called and the result cached.</p>
+	 *
+	 * @param canCreate <code>true</code> if the proposal computer can be created
+	 * @return a new instance of the completion proposal computer as
+	 *         described by this descriptor
+	 *         
+	 * @throws CoreException if the creation fails
+	 * @throws InvalidRegistryObjectException if the extension is not
+	 *         valid any longer (e.g. due to plug-in unloading)
+	 */
+	private synchronized ICompletionProposalComputer getComputer(boolean canCreate) throws CoreException, InvalidRegistryObjectException {
+		if (fComputer == null && canCreate && !fTriedLoadingComputer && (fActivate || isPluginLoaded())) {
+			fTriedLoadingComputer= true;
+			fComputer= createComputer();
+		}
+		return fComputer;
+	}
+	
+	/**
+	 * @return the enablement state of the category this describer is associated with
+	 */
+	private boolean isEnabled() {
+		return fCategory.isEnabled();
+	}
+	
+	/**
+	 * <p>Starts the meter for measuring the computers performance</p>
+	 * 
+	 * @param context
+	 * @param computer
+	 * @return
+	 */
+	private PerformanceStats startMeter(Object context, ICompletionProposalComputer computer) {
+		final PerformanceStats stats;
+		if (MEASURE_PERFORMANCE) {
+			stats= PerformanceStats.getStats(PERFORMANCE_EVENT, computer);
+			stats.startRun(context.toString());
+		} else {
+			stats= null;
+		}
+
+		if (fIsReportingDelay) {
+			fStart= System.currentTimeMillis();
+		}
+
+		return stats;
+	}
+
+	/**
+	 * <p>Stops the meter for measuring the computers performance</p>
+	 * 
+	 * @param context
+	 * @param computer
+	 * @return
+	 */
+	private void stopMeter(final PerformanceStats stats, String operation) {
+		if (MEASURE_PERFORMANCE) {
+			stats.endRun();
+			if (stats.isFailure()) {
+				IStatus status= createPerformanceStatus(operation);
+				Logger.log(status);
+				return;
+			}
+		}
+
+		if (fIsReportingDelay) {
+			long current= System.currentTimeMillis();
+			if (current - fStart > MAX_DELAY) {
+				IStatus status= createPerformanceStatus(operation);
+				Logger.log(status);
+			}
+		}
+	}
+	
+	/**
+	 * @return A message explaining that the described {@link ICompletionProposalComputer} failed in some way
+	 */
+	private String createBlameMessage() {
+		return "The ''" + getName() + "'' proposal computer from the ''" + //$NON-NLS-1$ //$NON-NLS-2$
+			fElement.getDeclaringExtension().getContributor().getName() + "'' plug-in did not complete normally."; //$NON-NLS-1$
+	}
+	
+	/**
+	 * <p>Create a status message describing that the extension has become invalid</p>
+	 * 
+	 * @param x the associated {@link InvalidRegistryObjectException}
+	 * @return the created {@link IStatus}
+	 */
+	private IStatus createExceptionStatus(InvalidRegistryObjectException x) {
+		String blame= createBlameMessage();
+		String reason= "The extension has become invalid."; //$NON-NLS-1$
+		return new Status(IStatus.INFO, SSEUIPlugin.ID, IStatus.OK, blame + " " + reason, x); //$NON-NLS-1$
+	}
+
+	/**
+	 * <p>create a status message explaining that the extension could not be instantiated</p>
+	 * 
+	 * @param x the associated {@link CoreException}
+	 * @return the created {@link IStatus}
+	 */
+	private IStatus createExceptionStatus(CoreException x) {
+		String blame = createBlameMessage();
+		String reason = "Unable to instantiate the extension."; //$NON-NLS-1$
+		return new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.OK, blame + " " + reason, x); //$NON-NLS-1$
+	}
+
+	/**
+	 * <p>Create a status message explaining the extension has thrown a runtime exception</p>
+	 * 
+	 * @param x the associated {@link RuntimeException}
+	 * @return the created {@link IStatus}
+	 */
+	private IStatus createExceptionStatus(RuntimeException x) {
+		String blame= createBlameMessage();
+		String reason= "The extension has thrown a runtime exception."; //$NON-NLS-1$
+		return new Status(IStatus.WARNING, SSEUIPlugin.ID, IStatus.OK, blame + " " + reason, x); //$NON-NLS-1$
+	}
+
+	/**
+	 * <p>Create a status message explaining the extension has violated the API of the extension point</p>
+	 * 
+	 * @param operation the operation that created the API violation
+	 * @return the created {@link IStatus}
+	 */
+	private IStatus createAPIViolationStatus(String operation) {
+		String blame = createBlameMessage();
+		String reason = "The extension violated the API contract of the ''" + operation + "'' operation."; //$NON-NLS-1$ //$NON-NLS-2$
+		return new Status(IStatus.WARNING, SSEUIPlugin.ID, IStatus.OK, blame + " " + reason, null); //$NON-NLS-1$
+	}
+
+	/**
+	 * <p>Create a status message explaining that the extension took to long during an operation</p>
+	 * 
+	 * @param operation the operation that took to long
+	 * @return the created {@link IStatus}
+	 */
+	private IStatus createPerformanceStatus(String operation) {
+		String blame= createBlameMessage();
+		String reason = "The extension took too long to return from the ''" + operation + "'' operation."; //$NON-NLS-1$ //$NON-NLS-2$
+		return new Status(IStatus.WARNING, SSEUIPlugin.ID, IStatus.OK, blame + " " + reason, null); //$NON-NLS-1$
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerRegistry.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerRegistry.java
new file mode 100644
index 0000000..21b5b83
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerRegistry.java
@@ -0,0 +1,508 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.InvalidRegistryObjectException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.wst.sse.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+
+
+/**
+ * <p>A registry for all extensions to the
+ * <code>org.eclipse.wst.sse.ui.completionProposal</code>
+ * extension point.</p>
+ */
+public final class CompletionProposalComputerRegistry {
+
+	/** The extension schema name of the extension point */
+	private static final String EXTENSION_POINT = "completionProposal"; //$NON-NLS-1$
+	
+	/** The extension schema name of proposal category child elements. */
+	private static final String ELEM_PROPOSAL_CATEGORY = "proposalCategory"; //$NON-NLS-1$
+	
+	/** The extension schema name of proposal computer child elements. */
+	private static final String ELEM_PROPOSAL_COMPUTER = "proposalComputer"; //$NON-NLS-1$
+	
+	/** The extension schema name of proposal computer activation child elements. */
+	private static final String ELEM_PROPOSAL_COMPUTER_EXTENDED_ACTIVATION = "proposalComputerExtendedActivation"; //$NON-NLS-1$
+	
+	/** The extension schema name for element ID attributes */
+	private static final String ATTR_ID= "id"; //$NON-NLS-1$
+	
+	/** preference key to keep track of the last known number of content assist computers */
+	private static final String NUM_COMPUTERS_PREF_KEY = "content_assist_number_of_computers"; //$NON-NLS-1$
+	
+	/**
+	 * A fake partition type ID stating used to say a {@link CompletionProposalComputerDescriptor} should
+	 * be associated with all partition types in a given content type.
+	 */
+	private static final String ALL_PARTITION_TYPES_ID = "all_partition_types_fake_ID"; //$NON-NLS-1$
+	
+	/** State where in the registry has not yet been loaded */
+	private static final byte NONE = 0;
+
+	/** State where the registry is being initialized */
+	private static final byte INITIALIZING = 1;
+	
+	/** State where in the registry is currently being loaded */
+	private static final byte LOADING = 2;
+	
+	/** State where in the registry has been loaded */
+	private static final byte LOADED = 3;
+
+	/** The singleton instance. */
+	private static CompletionProposalComputerRegistry fgSingleton= null;
+
+	/**
+	 * @return the singleton instance of the registry
+	 */
+	public static synchronized CompletionProposalComputerRegistry getDefault() {
+		if (fgSingleton == null) {
+			fgSingleton= new CompletionProposalComputerRegistry();
+		}
+
+		return fgSingleton;
+	}
+
+	/**
+	 * <code>{@link Map}&lt{@link String}, {@link CompletionProposalContentTypeContext}&gt</code>
+	 * <ul>
+	 * <li><b>key:</b> content type ID</li>
+	 * <li><b>value:</b> the context for the associated content type ID</li>
+	 * <ul>
+	 */
+	private final Map fActivationContexts;
+	
+	/**
+	 * <code>{@link Map}&lt{@link String}, {@link CompletionProposalComputerDescriptor}&gt</code>
+	 * <ul>
+	 * <li><b>key:</b> descriptor ID</li>
+	 * <li><b>value:</b> descriptor</li>
+	 * <ul>
+	 */
+	private final Map fDescriptors = new HashMap();
+
+	/** The {@link CompletionProposalCategory}s tracked by this registry */
+	private final List fCategories = new ArrayList();
+	
+	/** Unmodifiable public list of the {@link CompletionProposalCategory}s tracked by this registry */
+	private final List fPublicCategories = Collections.unmodifiableList(fCategories);
+	
+	/**
+	 * <p>The current state of the registry</p>
+	 * 
+	 * @see #NONE
+	 * @see #LOADING
+	 * @see #LOADED
+	 */
+	private byte fState;
+	
+	/**
+	 * Lock that is held while loading, operations waiting for
+	 * load to finish can lock on this as well
+	 */
+	private final Object fLoadingLock;
+
+	/** <code>true</code> if computers have been uninstalled since last load */
+	private boolean fHasUninstalledComputers= false;
+
+	/**
+	 * Creates a new instance.
+	 */
+	private CompletionProposalComputerRegistry() {
+		this.fActivationContexts = new HashMap();
+		this.fState = CompletionProposalComputerRegistry.NONE;
+		this.fLoadingLock = new Object();
+	}
+	
+	/**
+	 * <p>Calling this when the registry has not yet been loaded will start a
+	 * {@link Thread} to start loading the registry.  All other operations on
+	 * the registry will be blocked until the loading has completed.  If
+	 * the registry has already been loaded or is loading then this
+	 * method does nothing.</p>
+	 */
+	public synchronized void initialize() {
+		if(fState == CompletionProposalComputerRegistry.NONE) {
+			fState = CompletionProposalComputerRegistry.INITIALIZING;
+			new Thread() {
+				public void run() {
+					CompletionProposalComputerRegistry.this.load();
+				}
+			}.start();
+		}
+	}
+	
+	/**
+	 * <p><b>NOTE: </b>The returned list is read-only and is sorted in the order that the
+	 * extensions were read in. There are no duplicate elements in the returned list.
+	 * The returned list may change if plug-ins are loaded or unloaded while the
+	 * application is running.</p>
+	 *
+	 * @return the list of proposal categories contributed to the
+	 * <code>org.eclipse.wst.sse.ui.completionProposal</code> extension point (element type:
+	 *         {@link CompletionProposalCategory})
+	 */
+	public List getProposalCategories() {
+		internalEnsureLoaded();
+		return fPublicCategories;
+	}
+	
+	/**
+	 * <p><b>NOTE: </b>The returned list is read-only and is sorted in the order that the
+	 * extensions were read in. There are no duplicate elements in the returned list.
+	 * The returned list may change if plug-ins are loaded or unloaded while the
+	 * application is running.</p>
+	 * 
+	 * @param contentTypeID get the {@link CompletionProposalCategory}s associated with this ID
+	 * @return the {@link CompletionProposalCategory}s associated with the given content type ID
+	 */
+	public List getProposalCategories(String contentTypeID) {
+		internalEnsureLoaded();
+		List result = new ArrayList();
+		for(int i = 0; i < fCategories.size(); ++i) {
+			CompletionProposalCategory category = ((CompletionProposalCategory)fCategories.get(i));
+			if(category.hasComputers(contentTypeID)) {
+				result.add(category);
+			}
+		}
+		
+		return Collections.unmodifiableList(result);
+	}
+	
+	/**
+	 * @return <code>true</code> if the registry detected that computers got uninstalled since the last run
+	 * 			<code>false</code> otherwise or if {@link #resetUnistalledComputers()} has been called
+	 */
+	public boolean hasUninstalledComputers() {
+		return fHasUninstalledComputers;
+	}
+	
+	/**
+	 * <p>Clears the setting that uninstalled computers have been detected.
+	 * This setting is used to decide weather a helpful message should be
+	 * displayed to the user</p>
+	 */
+	public void resetUnistalledComputers() {
+		fHasUninstalledComputers = false;
+	}
+	
+	/**
+	 * <p>Adds the given {@link CompletionProposalComputerDescriptor} to the registry.</p>
+	 * 
+	 * @param contentTypeID the ID of the content type to associated the descriptor with
+	 * @param partitionTypeID the ID of the partition type in the content type to associate
+	 * the descriptor with, or <code>null</code> to associate with all partition types in
+	 * the content type.
+	 * @param descriptor the {@link CompletionProposalComputerDescriptor} to associate with
+	 * the given content type and partition type
+	 */
+	void putDescription(String contentTypeID, String partitionTypeID,
+			CompletionProposalComputerDescriptor descriptor) {
+		
+		if(partitionTypeID == null) {
+			partitionTypeID = ALL_PARTITION_TYPES_ID;
+		}
+		
+		CompletionProposalContentTypeContext context = getContext(contentTypeID);
+		context.putDescriptor(partitionTypeID, descriptor);
+	}
+
+	/**
+	 * @param contentTypeID get only descriptors associated with this content type
+	 * @param partitionTypeID get only descriptors associated with this partition type as well
+	 * as describers associated with any partition type in the given content type
+	 * @return all of the {@link CompletionProposalComputerDescriptor}s associated with the
+	 * given content type and partition type (including any describers associated with all
+	 * partition types in the given content type)
+	 */
+	List getProposalComputerDescriptors(String contentTypeID, String partitionTypeID) {
+		internalEnsureLoaded();
+		
+		Set descriptorsSet = new HashSet();
+		List contexts = this.getContexts(contentTypeID);
+		for(int i = 0; i < contexts.size(); ++i) {
+			CompletionProposalContentTypeContext contentSpecificContext =
+				(CompletionProposalContentTypeContext)contexts.get(i);
+			
+			//add all descriptors specific to the given content type and the given partition type
+			descriptorsSet.addAll(contentSpecificContext.getDescriptors(partitionTypeID));
+			
+			//add all descriptors specific to the given content type but not specific to a partition type
+			descriptorsSet.addAll(contentSpecificContext.getDescriptors(ALL_PARTITION_TYPES_ID));
+		}
+		
+		List descriptors = new ArrayList(descriptorsSet);
+		return descriptors != null ? Collections.unmodifiableList(descriptors) : Collections.EMPTY_LIST;
+	}
+	
+	/**
+	 * @param contentTypeID get only descriptors associated with this content type
+	 * @return all of the {@link CompletionProposalComputerDescriptor}s associated with the
+	 * given content type
+	 */
+	List getProposalComputerDescriptors(String contentTypeID) {
+		internalEnsureLoaded();
+		
+		Set descriptorsSet = new HashSet();
+		
+		List contexts = this.getContexts(contentTypeID);
+		for(int i = 0; i < contexts.size(); ++i) {
+			CompletionProposalContentTypeContext contentSpecificContext =
+				(CompletionProposalContentTypeContext)contexts.get(i);
+			
+			//add all descriptors specific to the given content type
+			descriptorsSet.addAll(contentSpecificContext.getDescriptors());
+		}
+		
+		List descriptors = new ArrayList(descriptorsSet);
+		return descriptors != null ? Collections.unmodifiableList(descriptors) : Collections.EMPTY_LIST;
+	}
+
+	/**
+	 * @return Unmodifiable list of all of the {@link CompletionProposalComputerDescriptor}s associated with
+	 * this registry
+	 */
+	List getProposalComputerDescriptors() {
+		internalEnsureLoaded();
+		return Collections.unmodifiableList( new ArrayList(fDescriptors.values()));
+	}
+
+	/**
+	 * <p>This method performs differently depending on the state of the registry</p>
+	 * <ul>
+	 * <li>{@link #NONE} - forces the registry to load now on the current thread</li>
+	 * <li>{@link #LOADING} - blocks until the registry has finished loading on
+	 * whichever thread it is being loaded on</li>
+	 * <li>{@link #LOADED} - immediately returns</li>
+	 * </ul>
+	 */
+	private void internalEnsureLoaded() {
+		switch (fState) {
+			case CompletionProposalComputerRegistry.NONE:
+			case CompletionProposalComputerRegistry.INITIALIZING: {
+				load();
+				break;
+			}
+			case CompletionProposalComputerRegistry.LOADING: {
+				//as soon as this lock is released the loading process is done
+				synchronized (fLoadingLock) {
+					//sanity check
+					Assert.isTrue(fState == CompletionProposalComputerRegistry.LOADED,
+							"The state of the registry should be guaranteed to be LOADED " + //$NON-NLS-1$
+							" once the loading lock has been released."); //$NON-NLS-1$
+				}
+				break;
+			}
+		}
+	}
+	
+	/**
+	 * <p>Loads the completion proposal extension points if they
+	 * have not been loaded already</p>
+	 */
+	private void load() {
+		/* hold this lock while loading, others waiting for load to
+		 * finish can synchronize on this lock to be guaranteed the load
+		 * will be done when the lock is released
+		 */
+		synchronized (fLoadingLock) {
+			if(fState == CompletionProposalComputerRegistry.NONE || fState == CompletionProposalComputerRegistry.INITIALIZING) {
+				//update the state
+				fState = CompletionProposalComputerRegistry.LOADING;
+				
+				IExtensionRegistry registry= Platform.getExtensionRegistry();
+				List extensionElements= new ArrayList(Arrays.asList(registry.getConfigurationElementsFor(SSEUIPlugin.ID, EXTENSION_POINT)));
+		
+				Map loadedDescriptors = new HashMap();
+				List extendedComputerActivations = new ArrayList();
+		
+				//get the categories and remove them from the extension elements
+				List categories= getCategories(extensionElements);
+				
+				//deal with the proposal computers and set aside the proposal computer activation extensions
+				for (Iterator iter= extensionElements.iterator(); iter.hasNext();) {
+					IConfigurationElement element= (IConfigurationElement) iter.next();
+					try {
+						if (element.getName().equals(ELEM_PROPOSAL_COMPUTER)) {
+							//create the descriptor and add it to the registry
+							CompletionProposalComputerDescriptor desc = new CompletionProposalComputerDescriptor(element, categories);
+							desc.addToRegistry();
+							loadedDescriptors.put(desc.getId(), desc);
+						} else if(element.getName().equals(ELEM_PROPOSAL_COMPUTER_EXTENDED_ACTIVATION)) {
+							extendedComputerActivations.add(element);
+						}
+		
+					} catch (InvalidRegistryObjectException x) {
+						/*
+						 * Element is not valid any longer as the contributing plug-in was unloaded or for
+						 * some other reason. Do not include the extension in the list and log it
+						 */
+						String message = "The extension ''" + element.toString() + "'' is invalid."; //$NON-NLS-1$ //$NON-NLS-2$
+						IStatus status= new Status(IStatus.WARNING, SSEUIPlugin.ID, IStatus.OK, message, x);
+						Logger.log(status);
+					} catch (CoreException x) {
+						Logger.log(x.getStatus());
+					}
+				}
+				
+				//deal with extended computer activations
+				for(int i = 0; i < extendedComputerActivations.size(); ++i) {
+					IConfigurationElement element = (IConfigurationElement)extendedComputerActivations.get(i);
+					String proposalComputerID = element.getAttribute(ATTR_ID);
+					CompletionProposalComputerDescriptor descriptor =
+						(CompletionProposalComputerDescriptor)loadedDescriptors.get(proposalComputerID);
+					if(descriptor != null) {
+						try {
+							//add the extra activation contexts to the registry
+							CompletionProposalComputerDescriptor.parseActivationAndAddToRegistry(element, descriptor);
+						} catch (InvalidRegistryObjectException x) {
+							/*
+							 * Element is not valid any longer as the contributing plug-in was unloaded or for
+							 * some other reason. Do not include the extension in the list and log it
+							 */
+							String message = "The extension ''" + element.toString() + "'' is invalid."; //$NON-NLS-1$ //$NON-NLS-2$
+							IStatus status= new Status(IStatus.WARNING, SSEUIPlugin.ID, IStatus.OK, message, x);
+							Logger.log(status);
+						} catch (CoreException x) {
+							Logger.log(x.getStatus());
+						}
+						
+					} else {
+						//activation extension has invalid computer ID
+						Logger.log(Logger.WARNING, "Configuration element " + element + //$NON-NLS-1$
+								" intented to extend an existing completion proposal computer" + //$NON-NLS-1$
+								" specified an invalid completion proposal computer ID " + //$NON-NLS-1$
+								proposalComputerID);
+					}
+				}
+		
+				fCategories.clear();
+				fCategories.addAll(categories);
+		
+				fDescriptors.clear();
+				fDescriptors.putAll(loadedDescriptors);
+				
+				updateUninstalledComputerCount();
+				
+				//update the state
+				fState = CompletionProposalComputerRegistry.LOADED;
+			}
+		}
+	}
+
+	/**
+	 * <p>Updates the uninstalled computer count</p>
+	 */
+	private void updateUninstalledComputerCount() {
+		IPreferenceStore preferenceStore = SSEUIPlugin.getDefault().getPreferenceStore();
+		int lastNumberOfComputers= preferenceStore.getInt(NUM_COMPUTERS_PREF_KEY);
+		int currNumber= fDescriptors.size();
+		fHasUninstalledComputers= lastNumberOfComputers > currNumber;
+		preferenceStore.putValue(NUM_COMPUTERS_PREF_KEY, Integer.toString(currNumber));
+	}
+
+	/**
+	 * <p>Configures the categories found in the given {@link IConfigurationElement}s
+	 * and removes them from the given list.</p>
+	 * 
+	 * @param extensionElements {@link IConfigurationElement}s that include proposal
+	 * category extensions
+	 * @return {@link CompletionProposalCategory}s created from the given
+	 * {@link IConfigurationElement}s that defined new proposal categories.
+	 */
+	private List getCategories(List extensionElements) {
+		List categories= new ArrayList();
+		for (Iterator iter= extensionElements.iterator(); iter.hasNext();) {
+			IConfigurationElement element= (IConfigurationElement) iter.next();
+			try {
+				if (element.getName().equals(ELEM_PROPOSAL_CATEGORY)) {
+					iter.remove(); // remove from list to leave only computers
+
+					CompletionProposalCategory category= new CompletionProposalCategory(element);
+					categories.add(category);
+				}
+			} catch (InvalidRegistryObjectException x) {
+				/* Element is not valid any longer as the contributing plug-in was unloaded or for
+				 * some other reason. Do not include the extension in the list and log it
+				 */
+				String message = "The extension ''" + element.toString() + "'' has become invalid."; //$NON-NLS-1$ //$NON-NLS-2$
+				IStatus status= new Status(IStatus.WARNING, SSEUIPlugin.ID, IStatus.OK, message, x);
+				Logger.log(status);
+			} catch (CoreException x) {
+				Logger.log(x.getStatus());
+			}
+		}
+		
+		return categories;
+	}
+	
+	/**
+	 * <p>Gets the {@link CompletionProposalContentTypeContext} associated with the given content type,
+	 * if one does not already exist then one is created</p>
+	 * 
+	 * @param contentTypeID get the {@link CompletionProposalContentTypeContext} associated with this content type
+	 * @return the existing or new {@link CompletionProposalContentTypeContext} associated with the given content type
+	 */
+	private CompletionProposalContentTypeContext getContext(String contentTypeID) {
+		CompletionProposalContentTypeContext context = (CompletionProposalContentTypeContext)this.fActivationContexts.get(contentTypeID);
+		if(context == null) {
+			context = new CompletionProposalContentTypeContext(contentTypeID);
+			this.fActivationContexts.put(contentTypeID, context);
+		}
+		
+		return context;
+	}
+	
+	/**
+	 * <p>Gets all of the {@link CompletionProposalContentTypeContext}s associated with
+	 * the given content type ID.  A context is considered associated if its associated content type ID
+	 * is either the given content type ID or is a base content type ID of the given content type ID.</p>
+	 * 
+	 * @param contentTypeID get the contexts for this content type ID
+	 * @return {@link List} of {@link CompletionProposalContentTypeContext}s associated with the given
+	 * content type ID
+	 */
+	private List getContexts(String contentTypeID) {
+		List contexts = new ArrayList();
+		IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeID);
+		
+		while(contentType != null) {
+			Object context = this.fActivationContexts.get(contentType.getId());
+			if(context != null) {
+				contexts.add(context);
+			}
+			
+			contentType = contentType.getBaseType();
+		}
+		
+		return contexts;
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalContentTypeContext.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalContentTypeContext.java
new file mode 100644
index 0000000..75ffdf0
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalContentTypeContext.java
@@ -0,0 +1,147 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.contentassist;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * <p>There should be one context for each content type. It keeps track
+ * of the describers associated with different partition types for its unique
+ * content type.</p>
+ */
+public class CompletionProposalContentTypeContext {
+
+	/** the content type this context is associated with */
+	private final String fContentTypeID;
+	
+	/**
+	 * 
+	 * <code>{@link Map}&lt{@link String}, {@link Set}&lt{@link CompletionProposalComputerDescriptor}&gt&gt</code>
+	 * <ul>
+	 * <li><b>key:</b> partition type ID</li>
+	 * <li><b>value:</b> {@link Set} of associated computer descriptors</li>
+	 * </ul>
+	 */
+	private Map fPartitionTypesToDescriptors;
+	
+	/**
+	 * <p>Create a new context for the given content type ID.</p>
+	 * <p>There should only ever be one context for any unique content type</p>
+	 * @param contentTypeID the content type this context is for
+	 */
+	public CompletionProposalContentTypeContext(String contentTypeID) {
+		this.fContentTypeID = contentTypeID;
+		this.fPartitionTypesToDescriptors = new HashMap();
+	}
+	
+	/**
+	 * <p>Adds a describer to this context for a given partition type.  There
+	 * can be more then one describer for one partition type.</p>
+	 * 
+	 * @param partitionTypeID the partition type to associate the given descriptor with
+	 * @param descriptor {@link CompletionProposalComputerDescriptor} to associate with the given
+	 * partition type in this context
+	 */
+	public void putDescriptor(String partitionTypeID, CompletionProposalComputerDescriptor descriptor) {
+		Set descriptors = (Set)this.fPartitionTypesToDescriptors.get(partitionTypeID);
+		if(descriptors != null) {
+			descriptors.add(descriptor);
+		} else {
+			descriptors = new HashSet();
+			descriptors.add(descriptor);
+			this.fPartitionTypesToDescriptors.put(partitionTypeID, descriptors);
+		}
+	}
+	
+	/**
+	 * @return All of the {@link CompletionProposalComputerDescriptor}s associated with
+	 * any partition type in this context
+	 */
+	public Set getDescriptors() {
+		Set allDescriptors = new HashSet();
+		Collection descriptorSets = this.fPartitionTypesToDescriptors.values();
+		Iterator iter = descriptorSets.iterator();
+		while(iter.hasNext()) {
+			Set descriptorSet = (Set)iter.next();
+			allDescriptors.addAll(descriptorSet);
+		}
+		
+		return Collections.unmodifiableSet(allDescriptors);
+	}
+	
+	/**
+	 * @param partitionTypeID get {@link CompletionProposalComputerDescriptor}s for only this partition type
+	 * for this context
+	 * @return {@link CompletionProposalComputerDescriptor}s assoicated with the given partition type
+	 * in this context
+	 */
+	public Set getDescriptors(String partitionTypeID) {
+		Set descriptors = (Set)this.fPartitionTypesToDescriptors.get(partitionTypeID);
+		return descriptors != null ? Collections.unmodifiableSet(descriptors) : Collections.EMPTY_SET;
+	}
+	
+	/**
+	 * @return the content type this context is for
+	 */
+	public String getContentTypeID() {
+		return fContentTypeID;
+	}
+	
+	/**
+	 * @return the hash code of the content type ID
+	 * 
+	 * @see java.lang.Object#hashCode()
+	 */
+	public int hashCode() {
+		return fContentTypeID.hashCode();
+	}
+	
+	/**
+	 * <p>Two {@link CompletionProposalContentTypeContext} are equal if they have the
+	 * same content type ID.</p>
+	 * 
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	public boolean equals(Object obj) {
+		boolean equal = false;
+		if(obj instanceof CompletionProposalContentTypeContext) {
+			equal = this.fContentTypeID.equals(((CompletionProposalContentTypeContext)obj).fContentTypeID);
+		}
+		
+		return equal;
+	}
+	
+	/**
+	 * @see java.lang.Object#toString()
+	 */
+	public String toString() {
+		StringBuffer buff = new StringBuffer(this.fContentTypeID);
+		Set partitions = this.fPartitionTypesToDescriptors.keySet();
+		Iterator partitionsIter = partitions.iterator();
+		while(partitionsIter.hasNext()) {
+			String partitionType = (String)partitionsIter.next();
+			buff.append("\n\t" + partitionType); //$NON-NLS-1$
+			List descriptors = (List)this.fPartitionTypesToDescriptors.get(partitionType);
+			for(int i = 0; i < descriptors.size(); ++i) {
+				buff.append("\n\t\t" + descriptors.get(i).toString()); //$NON-NLS-1$
+			}
+		}
+		
+		return buff.toString();
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposoalCatigoriesConfigurationRegistry.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposoalCatigoriesConfigurationRegistry.java
new file mode 100644
index 0000000..a84944a
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposoalCatigoriesConfigurationRegistry.java
@@ -0,0 +1,175 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.InvalidRegistryObjectException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.sse.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader;
+import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter;
+
+/**
+ * <p>A registry for all extensions to the
+ * <code>org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration</code>
+ * extension point.</p>
+ */
+public final class CompletionProposoalCatigoriesConfigurationRegistry {
+	/** The extension schema name of the extension point */
+	private static final String EXTENSION_POINT = "completionProposalCategoriesConfiguration"; //$NON-NLS-1$
+
+	/** The extension schema name of categories properties child elements */
+	private static final String ELEM_CATEGORIES_PROPERTIES = "categoriesConfiguration"; //$NON-NLS-1$
+	
+	/** The extension schema name of the content type id attribute */
+	private static final String ATTR_CONTENT_TYPE_ID = "contentTypeID"; //$NON-NLS-1$
+	
+	/** The extension schema name of the class attribute */
+	private static final String ATTR_CLASS = "class"; //$NON-NLS-1$
+	
+	/** The singleton instance. */
+	private static CompletionProposoalCatigoriesConfigurationRegistry fgSingleton = null;
+	
+	/** <code>true</code> if this registry has been loaded. */
+	private boolean fLoaded;
+	
+	/**
+	 * <code>{@link Map}<{@link String}, {@link ICompletionProposalCategoriesConfigurationReader}></code>
+	 * <ul>
+	 * <li><b>key:</b> Content Type ID</li>
+	 * <li><b>value:</b> Categories Properties</li>
+	 */
+	private Map fPropertiesByContentTypeID;
+	
+	/**
+	 * @return the singleton instance of this registry
+	 */
+	public static synchronized CompletionProposoalCatigoriesConfigurationRegistry getDefault() {
+		if (fgSingleton == null) {
+			fgSingleton = new CompletionProposoalCatigoriesConfigurationRegistry();
+		}
+
+		return fgSingleton;
+	}
+	
+	/**
+	 * Private constructor to create singleton instance
+	 */
+	private CompletionProposoalCatigoriesConfigurationRegistry() {
+		this.fLoaded = false;
+		this.fPropertiesByContentTypeID = new HashMap();
+	}
+	
+	/**
+	 * @param contentTypeID get the {@link ICompletionProposalCategoriesConfigurationReader} associated
+	 * with the given content type
+	 * @return the {@link ICompletionProposalCategoriesConfigurationReader} associated
+	 * with the given content type, or <code>null</code> if one does not exist.
+	 */
+	public ICompletionProposalCategoriesConfigurationReader getReadableConfiguration(String contentTypeID) {
+		this.ensureLoaded();
+		return (ICompletionProposalCategoriesConfigurationReader)this.fPropertiesByContentTypeID.get(contentTypeID);
+	}
+	
+	/**
+	 * @param contentTypeID get the {@link ICompletionProposalCategoriesConfigurationWriter} associated
+	 * with the given content type
+	 * @return the {@link ICompletionProposalCategoriesConfigurationWriter} associated
+	 * with the given content type, or <code>null</code> if one does not exist.
+	 */
+	public ICompletionProposalCategoriesConfigurationWriter getWritableConfiguration(String contentTypeID) {
+		this.ensureLoaded();
+		
+		ICompletionProposalCategoriesConfigurationReader reader = getReadableConfiguration(contentTypeID);
+		ICompletionProposalCategoriesConfigurationWriter writer = null;
+		if(reader instanceof ICompletionProposalCategoriesConfigurationWriter) {
+			writer = (ICompletionProposalCategoriesConfigurationWriter)reader;
+		}
+		
+		return writer;
+	}
+	
+	/**
+	 * Ensures the <code>org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration</code>
+	 * extensions have been loaded
+	 */
+	private void ensureLoaded() {
+		if(!this.fLoaded) {
+			this.load();
+			this.fLoaded = true;
+		}
+	}
+	
+	/**
+	 * Loads the <code>org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration</code> extensions
+	 */
+	private void load() {
+		//get the extensions
+		IExtensionRegistry registry= Platform.getExtensionRegistry();
+		List extensionElements= new ArrayList(Arrays.asList(registry.getConfigurationElementsFor(SSEUIPlugin.ID, EXTENSION_POINT)));
+		
+		//for each element get its attributes and add it to the map of properties
+		Iterator elementsIter = extensionElements.iterator();
+		while(elementsIter.hasNext()) {
+			IConfigurationElement element = (IConfigurationElement)elementsIter.next();
+			
+			try {
+				if(element.getName().equals(ELEM_CATEGORIES_PROPERTIES)) {				
+					String contentTypeID = element.getAttribute(ATTR_CONTENT_TYPE_ID);
+					ContentAssistUtils.checkExtensionAttributeNotNull(contentTypeID, ATTR_CONTENT_TYPE_ID, element);
+					
+					String pageClass = element.getAttribute(ATTR_CLASS);
+					ContentAssistUtils.checkExtensionAttributeNotNull(pageClass, ATTR_CLASS, element);
+					
+					ICompletionProposalCategoriesConfigurationReader props =
+						(ICompletionProposalCategoriesConfigurationReader)element.createExecutableExtension(ATTR_CLASS);
+				
+					if(!this.fPropertiesByContentTypeID.containsKey(contentTypeID)){
+						this.fPropertiesByContentTypeID.put(contentTypeID, props);
+					} else {
+						Logger.log(Logger.ERROR, "Extension " + element.getDeclaringExtension() + //$NON-NLS-1$
+								" is attempting to to define itself as the proposal cateigories" + //$NON-NLS-1$
+								" configuration for content type " + contentTypeID + " when another" + //$NON-NLS-1$ //$NON-NLS-2$
+								" extensions has already done so."); //$NON-NLS-1$
+					}
+				} else {
+					//extension specified element that is not valid for this extension
+					Logger.log(Logger.WARNING, "The element " + element + " is not valid for the" + //$NON-NLS-1$ //$NON-NLS-2$
+							"org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration" + //$NON-NLS-1$
+							" extension point.  Only " + ELEM_CATEGORIES_PROPERTIES + //$NON-NLS-1$
+							" elements are valid."); //$NON-NLS-1$
+				}
+			} catch (InvalidRegistryObjectException x) {
+				/*
+				 * Element is not valid any longer as the contributing plug-in was unloaded
+				 * or for some other reason. 
+				 */
+				String message = "The extension ''" + element.toString() + "'' has become invalid."; //$NON-NLS-1$ //$NON-NLS-2$
+				IStatus status= new Status(IStatus.WARNING, SSEUIPlugin.ID, IStatus.OK, message, x);
+				Logger.log(status);
+			} catch (CoreException x) {
+				Logger.log(x.getStatus());
+			}
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompoundContentAssistProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompoundContentAssistProcessor.java
index 1382a52..49c0ae7 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompoundContentAssistProcessor.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompoundContentAssistProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -21,11 +21,11 @@
 import java.util.List;
 import java.util.Set;
 
+import org.eclipse.core.runtime.Assert;
 import org.eclipse.jface.contentassist.IContentAssistSubjectControl;
 import org.eclipse.jface.contentassist.ISubjectControlContentAssistProcessor;
 import org.eclipse.jface.contentassist.ISubjectControlContextInformationPresenter;
 import org.eclipse.jface.contentassist.ISubjectControlContextInformationValidator;
-import org.eclipse.jface.text.Assert;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.TextPresentation;
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
@@ -36,208 +36,21 @@
 import org.eclipse.jface.text.contentassist.IContextInformationValidator;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.wst.sse.ui.internal.IReleasable;
+import org.eclipse.wst.sse.ui.internal.Logger;
 
 /**
- * A processor that aggregates the proposals of multiple other processors.
+ * <p>A processor that aggregates the proposals of multiple other processors.
  * When proposals are requested, the contained processors are queried in the
  * order they were added to the compound object. Copied from
  * org.eclipse.jdt.internal.ui.text.CompoundContentAssistProcessor.
- * Modification was made to add a dispose() method.
+ * Modification was made to add a dispose() method.</p>
  */
-class CompoundContentAssistProcessor implements IContentAssistProcessor, ISubjectControlContentAssistProcessor {
+public class CompoundContentAssistProcessor implements IContentAssistProcessor, ISubjectControlContentAssistProcessor, IReleasable {
 
-	private static class WrappedContextInformation implements IContextInformation, IContextInformationExtension {
-		private IContextInformation fInfo;
-		private IContentAssistProcessor fProcessor;
-
-		WrappedContextInformation(IContextInformation info, IContentAssistProcessor processor) {
-			fInfo = info;
-			fProcessor = processor;
-		}
-
-		/*
-		 * @see java.lang.Object#equals(java.lang.Object)
-		 */
-		public boolean equals(Object obj) {
-			return fInfo.equals(obj);
-		}
-
-		/*
-		 * @see org.eclipse.jface.text.contentassist.IContextInformation#getContextDisplayString()
-		 */
-		public String getContextDisplayString() {
-			return fInfo.getContextDisplayString();
-		}
-
-		/*
-		 * @see org.eclipse.jface.text.contentassist.IContextInformation#getImage()
-		 */
-		public Image getImage() {
-			return fInfo.getImage();
-		}
-
-		/*
-		 * @see org.eclipse.jface.text.contentassist.IContextInformation#getInformationDisplayString()
-		 */
-		public String getInformationDisplayString() {
-			return fInfo.getInformationDisplayString();
-		}
-
-		/*
-		 * @see java.lang.Object#hashCode()
-		 */
-		public int hashCode() {
-			return fInfo.hashCode();
-		}
-
-		/*
-		 * @see java.lang.Object#toString()
-		 */
-		public String toString() {
-			return fInfo.toString();
-		}
-
-		IContentAssistProcessor getProcessor() {
-			return fProcessor;
-		}
-
-		IContextInformation getContextInformation() {
-			return fInfo;
-		}
-
-		public int getContextInformationPosition() {
-			int position = -1;
-			if (fInfo instanceof IContextInformationExtension)
-				position = ((IContextInformationExtension)fInfo).getContextInformationPosition();
-			return position;
-		}
-	}
-
-	private static class CompoundContentAssistValidator implements IContextInformationValidator {
-		List fValidators = new ArrayList();
-		IContextInformationValidator fValidator;
-
-		void add(IContextInformationValidator validator) {
-			fValidators.add(validator);
-		}
-
-		/*
-		 * @see org.eclipse.jface.text.contentassist.IContextInformationValidator#install(org.eclipse.jface.text.contentassist.IContextInformation,
-		 *      org.eclipse.jface.text.ITextViewer, int)
-		 */
-		public void install(IContextInformation info, ITextViewer viewer, int documentPosition) {
-			// install either the validator in the info, or all validators
-			fValidator = getValidator(info);
-			IContextInformation realInfo = getContextInformation(info);
-			if (fValidator != null)
-				fValidator.install(realInfo, viewer, documentPosition);
-			else {
-				for (Iterator it = fValidators.iterator(); it.hasNext();) {
-					IContextInformationValidator v = (IContextInformationValidator) it.next();
-					v.install(realInfo, viewer, documentPosition);
-				}
-			}
-		}
-
-		IContextInformationValidator getValidator(IContextInformation info) {
-			if (info instanceof WrappedContextInformation) {
-				WrappedContextInformation wrap = (WrappedContextInformation) info;
-				return wrap.getProcessor().getContextInformationValidator();
-			}
-
-			return null;
-		}
-
-		IContextInformation getContextInformation(IContextInformation info) {
-			IContextInformation realInfo = info;
-			if (info instanceof WrappedContextInformation) {
-				WrappedContextInformation wrap = (WrappedContextInformation) info;
-				realInfo = wrap.getContextInformation();
-			}
-
-			return realInfo;
-		}
-
-		/*
-		 * @see org.eclipse.jface.text.contentassist.IContextInformationValidator#isContextInformationValid(int)
-		 */
-		public boolean isContextInformationValid(int documentPosition) {
-			// use either the validator in the info, or all validators
-			boolean isValid = false;
-			if (fValidator != null)
-				isValid = fValidator.isContextInformationValid(documentPosition);
-			else {
-				for (Iterator it = fValidators.iterator(); it.hasNext();) {
-					IContextInformationValidator v = (IContextInformationValidator) it.next();
-					isValid |= v.isContextInformationValid(documentPosition);
-				}
-			}
-			return isValid;
-		}
-
-	}
-
-	private static class CompoundContentAssistValidatorPresenter extends CompoundContentAssistValidator implements IContextInformationPresenter {
-		public boolean updatePresentation(int offset, TextPresentation presentation) {
-			// use either the validator in the info, or all validators
-			boolean presentationUpdated = false;
-			if (fValidator instanceof IContextInformationPresenter)
-				presentationUpdated = ((IContextInformationPresenter) fValidator).updatePresentation(offset, presentation);
-			else {
-				for (Iterator it = fValidators.iterator(); it.hasNext();) {
-					IContextInformationValidator v = (IContextInformationValidator) it.next();
-					if (v instanceof IContextInformationPresenter)
-						presentationUpdated |= ((IContextInformationPresenter) v).updatePresentation(offset, presentation);
-				}
-			}
-			return presentationUpdated;
-		}
-	}
-
-	private static class CompoundContentAssistValidatorEx extends CompoundContentAssistValidator implements ISubjectControlContextInformationValidator {
-		/*
-		 * @see ISubjectControlContextInformationValidator#install(IContextInformation,
-		 *      IContentAssistSubjectControl, int)
-		 */
-		public void install(IContextInformation info, IContentAssistSubjectControl contentAssistSubjectControl, int documentPosition) {
-			// install either the validator in the info, or all validators
-			fValidator = getValidator(info);
-			IContextInformation realInfo = getContextInformation(info);
-			if (fValidator instanceof ISubjectControlContextInformationValidator)
-				((ISubjectControlContextInformationValidator) fValidator).install(realInfo, contentAssistSubjectControl, documentPosition);
-			else {
-				for (Iterator it = fValidators.iterator(); it.hasNext();) {
-					if (it.next() instanceof ISubjectControlContextInformationValidator)
-						((ISubjectControlContextInformationValidator) it.next()).install(realInfo, contentAssistSubjectControl, documentPosition);
-				}
-			}
-		}
-
-	}
-
-	private static class CompoundContentAssistValidatorPresenterEx extends CompoundContentAssistValidatorPresenter implements ISubjectControlContextInformationPresenter, ISubjectControlContextInformationValidator {
-		/*
-		 * @see ISubjectControlContextInformationPresenter#install(IContextInformation,
-		 *      IContentAssistSubjectControl, int)
-		 */
-		public void install(IContextInformation info, IContentAssistSubjectControl contentAssistSubjectControl, int documentPosition) {
-			// install either the validator in the info, or all validators
-			fValidator = getValidator(info);
-			IContextInformation realInfo = getContextInformation(info);
-
-			if (fValidator instanceof ISubjectControlContextInformationValidator)
-				((ISubjectControlContextInformationValidator) fValidator).install(realInfo, contentAssistSubjectControl, documentPosition);
-			else {
-				for (Iterator it = fValidators.iterator(); it.hasNext();) {
-					if (it.next() instanceof ISubjectControlContextInformationValidator)
-						((ISubjectControlContextInformationValidator) it.next()).install(realInfo, contentAssistSubjectControl, documentPosition);
-				}
-			}
-		}
-
-	}
-
+	/** the compound processors */
 	private final Set fProcessors = new LinkedHashSet();
+	
+	/** Aggregated error message from the compound processors */
 	private String fErrorMessage;
 
 	/**
@@ -266,6 +79,17 @@
 		Assert.isNotNull(processor);
 		fProcessors.add(processor);
 	}
+	
+	/**
+	 * @param processor check to see if this {@link IContentAssistProcessor} is one
+	 * in this compound processor.
+	 * 
+	 * @return <code>true</code> if this compound processor contains the given processor,
+	 * <code>false</code> otherwise
+	 */
+	public boolean containsProcessor(IContentAssistProcessor processor) {
+		return fProcessors.contains(processor);
+	}
 
 	/**
 	 * Removes a processor from this compound processor.
@@ -297,18 +121,25 @@
 		List ret = new LinkedList();
 		for (Iterator it = fProcessors.iterator(); it.hasNext();) {
 			IContentAssistProcessor p = (IContentAssistProcessor) it.next();
-			ICompletionProposal[] proposals = p.computeCompletionProposals(viewer, documentOffset);
-			if (proposals != null && proposals.length > 0) {
-				ret.addAll(Arrays.asList(proposals));
-				fErrorMessage = null; // Hide previous errors
-			} else {
-				if (fErrorMessage == null && ret.isEmpty()) {
-					String errorMessage = p.getErrorMessage();
-					if (errorMessage != null) {
-						fErrorMessage = errorMessage;
+			try {
+				// isolate calls to each processor
+				ICompletionProposal[] proposals = p.computeCompletionProposals(viewer, documentOffset);
+				if (proposals != null && proposals.length > 0) {
+					ret.addAll(Arrays.asList(proposals));
+					fErrorMessage = null; // Hide previous errors
+				}
+				else {
+					if (fErrorMessage == null && ret.isEmpty()) {
+						String errorMessage = p.getErrorMessage();
+						if (errorMessage != null) {
+							fErrorMessage = errorMessage;
+						}
 					}
 				}
 			}
+			catch (Exception e) {
+				Logger.logException(e);
+			}
 		}
 		return (ICompletionProposal[]) ret.toArray(new ICompletionProposal[ret.size()]);
 	}
@@ -517,8 +348,16 @@
 
 	/**
 	 * Dispose of any content assist processors that need disposing
+	 * @deprecated use {@link #release()}
 	 */
 	public void dispose() {
+		this.release();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.IReleasable#release()
+	 */
+	public void release() {
 		// go through list of content assist processors and dispose
 		for (Iterator it = fProcessors.iterator(); it.hasNext();) {
 			IContentAssistProcessor p = (IContentAssistProcessor) it.next();
@@ -528,4 +367,195 @@
 		}
 		fProcessors.clear();
 	}
+	
+	private static class WrappedContextInformation implements IContextInformation, IContextInformationExtension {
+		private IContextInformation fInfo;
+		private IContentAssistProcessor fProcessor;
+
+		WrappedContextInformation(IContextInformation info, IContentAssistProcessor processor) {
+			fInfo = info;
+			fProcessor = processor;
+		}
+
+		/*
+		 * @see java.lang.Object#equals(java.lang.Object)
+		 */
+		public boolean equals(Object obj) {
+			return fInfo.equals(obj);
+		}
+
+		/*
+		 * @see org.eclipse.jface.text.contentassist.IContextInformation#getContextDisplayString()
+		 */
+		public String getContextDisplayString() {
+			return fInfo.getContextDisplayString();
+		}
+
+		/*
+		 * @see org.eclipse.jface.text.contentassist.IContextInformation#getImage()
+		 */
+		public Image getImage() {
+			return fInfo.getImage();
+		}
+
+		/*
+		 * @see org.eclipse.jface.text.contentassist.IContextInformation#getInformationDisplayString()
+		 */
+		public String getInformationDisplayString() {
+			return fInfo.getInformationDisplayString();
+		}
+
+		/*
+		 * @see java.lang.Object#hashCode()
+		 */
+		public int hashCode() {
+			return fInfo.hashCode();
+		}
+
+		/*
+		 * @see java.lang.Object#toString()
+		 */
+		public String toString() {
+			return fInfo.toString();
+		}
+
+		IContentAssistProcessor getProcessor() {
+			return fProcessor;
+		}
+
+		IContextInformation getContextInformation() {
+			return fInfo;
+		}
+
+		public int getContextInformationPosition() {
+			int position = -1;
+			if (fInfo instanceof IContextInformationExtension)
+				position = ((IContextInformationExtension)fInfo).getContextInformationPosition();
+			return position;
+		}
+	}
+	
+	private static class CompoundContentAssistValidator implements IContextInformationValidator {
+		List fValidators = new ArrayList();
+		IContextInformationValidator fValidator;
+
+		void add(IContextInformationValidator validator) {
+			fValidators.add(validator);
+		}
+
+		/*
+		 * @see org.eclipse.jface.text.contentassist.IContextInformationValidator#install(org.eclipse.jface.text.contentassist.IContextInformation,
+		 *      org.eclipse.jface.text.ITextViewer, int)
+		 */
+		public void install(IContextInformation info, ITextViewer viewer, int documentPosition) {
+			// install either the validator in the info, or all validators
+			fValidator = getValidator(info);
+			IContextInformation realInfo = getContextInformation(info);
+			if (fValidator != null)
+				fValidator.install(realInfo, viewer, documentPosition);
+			else {
+				for (Iterator it = fValidators.iterator(); it.hasNext();) {
+					IContextInformationValidator v = (IContextInformationValidator) it.next();
+					v.install(realInfo, viewer, documentPosition);
+				}
+			}
+		}
+
+		IContextInformationValidator getValidator(IContextInformation info) {
+			if (info instanceof WrappedContextInformation) {
+				WrappedContextInformation wrap = (WrappedContextInformation) info;
+				return wrap.getProcessor().getContextInformationValidator();
+			}
+
+			return null;
+		}
+
+		IContextInformation getContextInformation(IContextInformation info) {
+			IContextInformation realInfo = info;
+			if (info instanceof WrappedContextInformation) {
+				WrappedContextInformation wrap = (WrappedContextInformation) info;
+				realInfo = wrap.getContextInformation();
+			}
+
+			return realInfo;
+		}
+
+		/*
+		 * @see org.eclipse.jface.text.contentassist.IContextInformationValidator#isContextInformationValid(int)
+		 */
+		public boolean isContextInformationValid(int documentPosition) {
+			// use either the validator in the info, or all validators
+			boolean isValid = false;
+			if (fValidator != null)
+				isValid = fValidator.isContextInformationValid(documentPosition);
+			else {
+				for (Iterator it = fValidators.iterator(); it.hasNext();) {
+					IContextInformationValidator v = (IContextInformationValidator) it.next();
+					isValid |= v.isContextInformationValid(documentPosition);
+				}
+			}
+			return isValid;
+		}
+
+	}
+
+	private static class CompoundContentAssistValidatorPresenter extends CompoundContentAssistValidator implements IContextInformationPresenter {
+		public boolean updatePresentation(int offset, TextPresentation presentation) {
+			// use either the validator in the info, or all validators
+			boolean presentationUpdated = false;
+			if (fValidator instanceof IContextInformationPresenter)
+				presentationUpdated = ((IContextInformationPresenter) fValidator).updatePresentation(offset, presentation);
+			else {
+				for (Iterator it = fValidators.iterator(); it.hasNext();) {
+					IContextInformationValidator v = (IContextInformationValidator) it.next();
+					if (v instanceof IContextInformationPresenter)
+						presentationUpdated |= ((IContextInformationPresenter) v).updatePresentation(offset, presentation);
+				}
+			}
+			return presentationUpdated;
+		}
+	}
+
+	private static class CompoundContentAssistValidatorEx extends CompoundContentAssistValidator implements ISubjectControlContextInformationValidator {
+		/*
+		 * @see ISubjectControlContextInformationValidator#install(IContextInformation,
+		 *      IContentAssistSubjectControl, int)
+		 */
+		public void install(IContextInformation info, IContentAssistSubjectControl contentAssistSubjectControl, int documentPosition) {
+			// install either the validator in the info, or all validators
+			fValidator = getValidator(info);
+			IContextInformation realInfo = getContextInformation(info);
+			if (fValidator instanceof ISubjectControlContextInformationValidator)
+				((ISubjectControlContextInformationValidator) fValidator).install(realInfo, contentAssistSubjectControl, documentPosition);
+			else {
+				for (Iterator it = fValidators.iterator(); it.hasNext();) {
+					if (it.next() instanceof ISubjectControlContextInformationValidator)
+						((ISubjectControlContextInformationValidator) it.next()).install(realInfo, contentAssistSubjectControl, documentPosition);
+				}
+			}
+		}
+
+	}
+
+	private static class CompoundContentAssistValidatorPresenterEx extends CompoundContentAssistValidatorPresenter implements ISubjectControlContextInformationPresenter, ISubjectControlContextInformationValidator {
+		/*
+		 * @see ISubjectControlContextInformationPresenter#install(IContextInformation,
+		 *      IContentAssistSubjectControl, int)
+		 */
+		public void install(IContextInformation info, IContentAssistSubjectControl contentAssistSubjectControl, int documentPosition) {
+			// install either the validator in the info, or all validators
+			fValidator = getValidator(info);
+			IContextInformation realInfo = getContextInformation(info);
+
+			if (fValidator instanceof ISubjectControlContextInformationValidator)
+				((ISubjectControlContextInformationValidator) fValidator).install(realInfo, contentAssistSubjectControl, documentPosition);
+			else {
+				for (Iterator it = fValidators.iterator(); it.hasNext();) {
+					if (it.next() instanceof ISubjectControlContextInformationValidator)
+						((ISubjectControlContextInformationValidator) it.next()).install(realInfo, contentAssistSubjectControl, documentPosition);
+				}
+			}
+		}
+
+	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java
index 275f554..9b1fa92 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,6 +12,12 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal.contentassist;
 
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.InvalidRegistryObjectException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
@@ -19,6 +25,8 @@
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+import org.osgi.framework.Bundle;
 
 
 /**
@@ -88,5 +96,51 @@
 		}
 		return sdRegion;
 	}
+	
+	/**
+	 * @return the bundle that defined the {@link IConfigurationElement} that defines
+	 * this category.
+	 */
+	public static Bundle getBundle(IConfigurationElement element) {
+		String namespace= element.getDeclaringExtension().getContributor().getName();
+		Bundle bundle= Platform.getBundle(namespace);
+		return bundle;
+	}
+	
+	/**
+	 * <p>Checks that the given attribute value is not <code>null</code>.</p>
+	 *
+	 * @param value the object to check if not null
+	 * @param attribute the attribute
+	 * 
+	 * @throws InvalidRegistryObjectException if the registry element is no longer valid
+	 * @throws CoreException if <code>value</code> is <code>null</code>
+	 */
+	public static void checkExtensionAttributeNotNull(Object value, String attribute,
+			IConfigurationElement element) throws InvalidRegistryObjectException, CoreException {
+		
+		if (value == null) {
+			String message = "The extension \"" + element.getDeclaringExtension().getUniqueIdentifier() + //$NON-NLS-1$
+				"\" from plug-in \"" + element.getContributor().getName() + //$NON-NLS-1$
+				"\" did not specify a value for the required \"" + attribute + //$NON-NLS-1$
+				"\" attribute for the element \"" + element.getName() + "\". Disabling the extension."; //$NON-NLS-1$ //$NON-NLS-2$
+			IStatus status= new Status(IStatus.WARNING, SSEUIPlugin.ID, IStatus.OK, message, null);
+			throw new CoreException(status);
+		}
+	}
+	
+	/**
+	 * @param textViewer check to see if this viewer is empty
+	 * @return <code>true</code> if there is no text or it's all white space,
+	 * <code>false</code> otherwise
+	 */
+	public static boolean isViewerEmpty(ITextViewer textViewer) {
+		boolean isEmpty = false;
+		String text = textViewer.getTextWidget().getText();
+		if ((text == null) || ((text != null) && text.trim().equals(""))) { //$NON-NLS-1$
+			isEmpty = true;
+		}
+		return isEmpty;
+	}
 
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContextInformationValidator.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContextInformationValidator.java
new file mode 100644
index 0000000..cbaf65f
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContextInformationValidator.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.contentassist;
+
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+
+/**
+ * <p>A {@link IContextInformationValidator} for structured documents</p>
+ */
+public class ContextInformationValidator implements IContextInformationValidator {
+
+	/** the installed document position */
+	private int fDocumentPosition;
+
+	/** the installed document */
+	private IStructuredDocument fDocument;
+	
+	/** the installed region start*/
+	private IndexedRegion fRegion;
+	
+	/**
+	 * <p>Default constructor</p>
+	 */
+	public ContextInformationValidator() {
+		fDocumentPosition = -1;
+		fDocument = null;
+	}
+	
+	/**
+	 * @see org.eclipse.jface.text.contentassist.IContextInformationValidator#install(org.eclipse.jface.text.contentassist.IContextInformation,
+	 *      org.eclipse.jface.text.ITextViewer, int)
+	 */
+	public void install(IContextInformation info, ITextViewer viewer, int documentPosition) {
+		fDocumentPosition = documentPosition;
+		fDocument = (IStructuredDocument)viewer.getDocument();
+	}
+	
+	/**
+	 * @see org.eclipse.jface.text.contentassist.IContextInformationValidator#isContextInformationValid(int)
+	 */
+	public boolean isContextInformationValid(int documentPosition) {
+		/*
+		 * determine whether or not this context info should still be
+		 * showing... if cursor still within the same region then it's valid
+		 */
+		boolean result = false;
+
+		calculateInstalledIndexedRegion();
+		
+		if (fRegion != null) {
+			int start = fRegion.getStartOffset();
+			int end = fRegion.getEndOffset();
+			result = (documentPosition < end) && (documentPosition > start + 1);
+		}
+		return result;
+	}
+	
+	/**
+	 * @return {@link IndexedRegion} that this validator was installed on
+	 */
+	private void calculateInstalledIndexedRegion() {
+		if (fRegion == null) {
+			IStructuredModel model = null;
+			try {
+				model = StructuredModelManager.getModelManager().getModelForRead(fDocument);
+				if (model != null) {
+					fRegion = model.getIndexedRegion(fDocumentPosition);
+				}
+			}
+			finally {
+				if (model != null)
+					model.releaseFromRead();
+			}
+		}
+	}
+}
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 67c2f9b..61d9b5f 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -281,7 +281,9 @@
 			int length = offset - fReplacementOffset;
 			String start = document.get(fReplacementOffset, length);
 
-			return word.substring(0, length).equalsIgnoreCase(start);
+			if(word != null) {
+				return word.substring(0, length).equalsIgnoreCase(start);
+			}
 		}
 		catch (BadLocationException x) {
 		}
@@ -307,18 +309,11 @@
 		boolean validated = startsWith(document, offset, fDisplayString);
 
 		if (fUpdateLengthOnValidate) {
-
 			// it would be better to use "originalCursorPosition" instead of
 			// getReplacementOffset(), but we don't have that info.
 			int newLength = offset - getReplacementOffset();
 			int delta = newLength - fOriginalReplacementLength;
 			fReplacementLength = delta + fOriginalReplacementLength;
-
-			// if it's an attribute value, replacement offset is
-			// going to be one off from the actual cursor offset...
-			char firstChar = document.get().charAt(getReplacementOffset());
-			if (firstChar == '"' || firstChar == '\'')
-				fReplacementLength++;
 		}
 		return validated;
 	}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/OptionalMessageDialog.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/OptionalMessageDialog.java
new file mode 100644
index 0000000..04cde16
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/OptionalMessageDialog.java
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.contentassist;
+
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+
+/**
+ * <p>This is a <code>MessageDialog</code> which allows the user
+ * to choose that the dialog isn't shown again the next time.</p>
+ * 
+ * @base org.eclipse.jdt.internal.ui.dialogs.OptionalMessageDialog
+ */
+public class OptionalMessageDialog extends MessageDialog {
+
+	// String constants for widgets
+	private static final String CHECKBOX_TEXT = SSEUIMessages.OptionalMessageDialog_dontShowAgain;
+
+	// Dialog store id constants
+	private static final String STORE_ID = "ContentAssist_OptionalMessageDialog.hide."; //$NON-NLS-1$
+
+	public static final int NOT_SHOWN = IDialogConstants.CLIENT_ID + 1;
+
+	private final String fId;
+	private final String fCheckBoxText;
+
+	private Button fHideDialogCheckBox;
+
+
+	/**
+	 * Opens the dialog but only if the user hasn't chosen to hide it.
+	 *
+	 * @return the index of the pressed button or {@link SWT#DEFAULT} if the dialog got dismissed
+	 *         without pressing a button (e.g. via Esc) or {{@link #NOT_SHOWN} if the dialog was not
+	 *         shown
+	 */
+	public static int open(String id, Shell parent, String title, Image titleImage, String message, int dialogType, String[] buttonLabels, int defaultButtonIndex) {
+		return open(id, parent, title, titleImage, message, dialogType, buttonLabels, defaultButtonIndex, CHECKBOX_TEXT);
+	}
+
+	/**
+	 * Opens the dialog but only if the user hasn't chosen to hide it.
+	 *
+	 * @return the index of the pressed button or {@link SWT#DEFAULT} if the dialog got dismissed
+	 *         without pressing a button (e.g. via Esc) or {{@link #NOT_SHOWN} if the dialog was not
+	 *         shown
+	 */
+	public static int open(String id, Shell parent, String title, Image titleImage, String message, int dialogType, String[] buttonLabels, int defaultButtonIndex, String checkboxText) {
+		if (!isDialogEnabled(id))
+			return OptionalMessageDialog.NOT_SHOWN;
+
+		MessageDialog dialog= new OptionalMessageDialog(id, parent, title, titleImage, message, dialogType, buttonLabels, defaultButtonIndex, checkboxText);
+		return dialog.open();
+	}
+
+	protected OptionalMessageDialog(String id, Shell parent, String title, Image titleImage, String message, int dialogType, String[] buttonLabels, int defaultButtonIndex) {
+		this(id, parent, title, titleImage, message, dialogType, buttonLabels, defaultButtonIndex, CHECKBOX_TEXT);
+	}
+
+	protected OptionalMessageDialog(String id, Shell parent, String title, Image titleImage, String message, int dialogType, String[] buttonLabels, int defaultButtonIndex, String checkBoxText) {
+		super(parent, title, titleImage, message, dialogType, buttonLabels, defaultButtonIndex);
+		fId= id;
+		fCheckBoxText= checkBoxText;
+	}
+
+	protected Control createCustomArea(Composite parent) {
+		Composite composite= new Composite(parent, SWT.NONE);
+		GridLayout layout= new GridLayout();
+		layout.marginHeight= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
+		layout.marginWidth= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
+		layout.horizontalSpacing= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
+		composite.setLayout(layout);
+		composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+		fHideDialogCheckBox= new Button(composite, SWT.CHECK | SWT.LEFT);
+		fHideDialogCheckBox.setText(fCheckBoxText);
+		fHideDialogCheckBox.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				setDialogEnabled(fId, !((Button)e.widget).getSelection());
+			}
+		});
+		applyDialogFont(fHideDialogCheckBox);
+		return fHideDialogCheckBox;
+	}
+
+	//--------------- Configuration handling --------------
+
+	/**
+	 * Returns this dialog
+	 *
+	 * @return the settings to be used
+	 */
+	private static IDialogSettings getDialogSettings() {
+		IDialogSettings settings= SSEUIPlugin.getDefault().getDialogSettings();
+		settings= settings.getSection(STORE_ID);
+		if (settings == null)
+			settings= SSEUIPlugin.getDefault().getDialogSettings().addNewSection(STORE_ID);
+		return settings;
+	}
+
+	/**
+	 * Answers whether the optional dialog is enabled and should be shown.
+	 */
+	public static boolean isDialogEnabled(String key) {
+		IDialogSettings settings= getDialogSettings();
+		return !settings.getBoolean(key);
+	}
+
+	/**
+	 * Sets whether the optional dialog is enabled and should be shown.
+	 */
+	public static void setDialogEnabled(String key, boolean isEnabled) {
+		IDialogSettings settings= getDialogSettings();
+		settings.put(key, !isEnabled);
+	}
+
+	/**
+	 * Clears all remembered information about hidden dialogs
+	 */
+	public static void clearAllRememberedStates() {
+		IDialogSettings settings= SSEUIPlugin.getDefault().getDialogSettings();
+		settings.addNewSection(STORE_ID);
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/StructuredContentAssistant.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/StructuredContentAssistant.java
index 5f35cae..b10942c 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/StructuredContentAssistant.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/StructuredContentAssistant.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,136 +13,60 @@
 package org.eclipse.wst.sse.ui.internal.contentassist;
 
 import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 
 import org.eclipse.jface.text.contentassist.ContentAssistant;
 import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
+import org.eclipse.wst.sse.ui.internal.IReleasable;
 
+/**
+ * <p>Content assistant that uses {@link CompoundContentAssistProcessor}s so that multiple
+ * processors can be registered for each partition type</p>
+ */
 public class StructuredContentAssistant extends ContentAssistant {
-	private static final String CONTENT_ASSIST_PROCESSOR_EXTENDED_ID = "contentassistprocessor"; //$NON-NLS-1$
-
-	/**
-	 * personal list of content assist processors
+	/** need to retain copy of all releasable processors so they can be released on uninstall */
+	private List fReleasableProcessors;
+	
+	/** 
+	 * <code>true</code> if a content assist processor has been added to this assistant,
+	 * <code>false</code> otherwise
 	 */
-	private Map fProcessors;
+	private boolean fIsInitalized;
+	
 	/**
-	 * list of partition types where extended processors have been installed
+	 * <p>Construct the assistant</p>
 	 */
-	private List fInstalledExtendedContentTypes;
-
+	public StructuredContentAssistant() {
+		this.fIsInitalized = false;
+		this.fReleasableProcessors = new ArrayList();
+	}
+	
 	/**
-	 * Each set content assist processor is placed inside a
+	 * <p>Each set content assist processor is placed inside a
 	 * CompoundContentAssistProcessor which allows multiple processors per
-	 * partition type
+	 * partition type</p>
 	 * 
 	 * @param processor
 	 *            the content assist processor to register, or
 	 *            <code>null</code> to remove an existing one
 	 * @param contentType
 	 *            the content type under which to register
+	 *            
+	 * @see org.eclipse.jface.text.contentassist.ContentAssistant#setContentAssistProcessor(org.eclipse.jface.text.contentassist.IContentAssistProcessor, java.lang.String)
 	 */
 	public void setContentAssistProcessor(IContentAssistProcessor processor, String partitionType) {
-		if (fProcessors == null)
-			fProcessors = new HashMap();
-
+		this.fIsInitalized = true;
+		
 		CompoundContentAssistProcessor compoundProcessor = getExistingContentAssistProcessor(partitionType);
-
-		// if processor is null, you want to remove all processors of
-		// contentType
-		if (processor == null && compoundProcessor != null) {
-			compoundProcessor.dispose();
-			fProcessors.remove(partitionType);
-			compoundProcessor = null;
+		if(compoundProcessor == null) {
+			compoundProcessor = new CompoundContentAssistProcessor();
+			this.fReleasableProcessors.add(compoundProcessor);
 		}
-		if (processor != null) {
-			// create a new compoundprocess if there already isnt one
-			if (compoundProcessor == null) {
-				compoundProcessor = new CompoundContentAssistProcessor();
-			}
-			// add processor to compound processor
-			compoundProcessor.add(processor);
-			// add compound procesor to processors list (will replace old one,
-			// even if same instance)
-			fProcessors.put(partitionType, compoundProcessor);
-		}
+		
+		compoundProcessor.add(processor);
 		super.setContentAssistProcessor(compoundProcessor, partitionType);
 	}
-
-	private CompoundContentAssistProcessor getExistingContentAssistProcessor(String partitionType) {
-		CompoundContentAssistProcessor compoundContentAssistProcessor = null;
-		IContentAssistProcessor processor = super.getContentAssistProcessor(partitionType);
-		if (processor != null) {
-			if (processor instanceof CompoundContentAssistProcessor) {
-				compoundContentAssistProcessor = (CompoundContentAssistProcessor) processor;
-			}
-			else {
-				throw new IllegalStateException("StructuredContentAssistant use CompoundContentAssistProcessor"); //$NON-NLS-1$
-			}
-		}
-		return compoundContentAssistProcessor;
-
-	}
-
-	/**
-	 * Returns the content assist processor to be used for the given content
-	 * type. Also installs any content assist processors that were added by
-	 * extension point.
-	 * 
-	 * @param contentType
-	 *            the type of the content for which this content assistant is
-	 *            to be requested
-	 * @return an instance content assist processor or <code>null</code> if
-	 *         none exists for the specified content type
-	 */
-	public IContentAssistProcessor getContentAssistProcessor(String partitionType) {
-		if (fInstalledExtendedContentTypes == null || !fInstalledExtendedContentTypes.contains(partitionType)) {
-			// get extended content assist processors that have not already
-			// been set
-			List processors = ExtendedConfigurationBuilder.getInstance().getConfigurations(CONTENT_ASSIST_PROCESSOR_EXTENDED_ID, partitionType);
-			if (processors != null && !processors.isEmpty()) {
-				Iterator iter = processors.iterator();
-				while (iter.hasNext()) {
-					IContentAssistProcessor processor = (IContentAssistProcessor) iter.next();
-					setContentAssistProcessor(processor, partitionType);
-				}
-			}
-			// add partition type to list of extended partition types
-			// installed (regardless of whether or not any extended content
-			// assist processors were installed because dont want to look it
-			// up every time)
-			if (fInstalledExtendedContentTypes == null)
-				fInstalledExtendedContentTypes = new ArrayList();
-			fInstalledExtendedContentTypes.add(partitionType);
-		}
-
-		IContentAssistProcessor processor = super.getContentAssistProcessor(partitionType);
-		return processor;
-	}
-
-	public void uninstall() {
-		// dispose of all content assist processors
-		if (fProcessors != null && !fProcessors.isEmpty()) {
-			Collection collection = fProcessors.values();
-			Iterator iter = collection.iterator();
-			while (iter.hasNext()) {
-				((CompoundContentAssistProcessor) iter.next()).dispose();
-			}
-			fProcessors.clear();
-		}
-		fProcessors = null;
-
-		// clear out list of installed content types
-		if (fInstalledExtendedContentTypes != null) {
-			fInstalledExtendedContentTypes.clear();
-		}
-		super.uninstall();
-	}
-
+	
 	/**
 	 * Returns true if content assist has been initialized with some content
 	 * assist processors. False otherwise.
@@ -150,6 +74,39 @@
 	 * @return true if content assistant has been initialized
 	 */
 	public boolean isInitialized() {
-		return (fProcessors != null);
+		return this.fIsInitalized;
 	}
-}
+	
+	/**
+	 * 
+	 * @param partitionType
+	 * @return
+	 */
+	private CompoundContentAssistProcessor getExistingContentAssistProcessor(String partitionType) {
+		CompoundContentAssistProcessor compoundContentAssistProcessor = null;
+		IContentAssistProcessor processor = super.getContentAssistProcessor(partitionType);
+		if (processor != null) {
+			if (processor instanceof CompoundContentAssistProcessor) {
+				compoundContentAssistProcessor = (CompoundContentAssistProcessor) processor;
+			}
+		}
+		return compoundContentAssistProcessor;
+	}
+	
+	/**
+	 * @see org.eclipse.jface.text.contentassist.ContentAssistant#uninstall()
+	 */
+	public void uninstall() {
+		// dispose of all content assist processors
+		if (this.fReleasableProcessors != null && !this.fReleasableProcessors.isEmpty()) {
+			for(int i = 0; i < this.fReleasableProcessors.size(); ++i) {
+				((IReleasable)this.fReleasableProcessors.get(i)).release();
+			}
+			
+			this.fReleasableProcessors.clear();
+		}
+		this.fReleasableProcessors = null;
+		
+		super.uninstall();
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/ConfigurableContentOutlinePage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/ConfigurableContentOutlinePage.java
index 8fe00e9..ca87d75 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/ConfigurableContentOutlinePage.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/ConfigurableContentOutlinePage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -32,6 +32,7 @@
 import org.eclipse.jface.util.SafeRunnable;
 import org.eclipse.jface.util.TransferDragSourceListener;
 import org.eclipse.jface.util.TransferDropTargetListener;
+import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
 import org.eclipse.jface.viewers.DoubleClickEvent;
 import org.eclipse.jface.viewers.IContentProvider;
 import org.eclipse.jface.viewers.IDoubleClickListener;
@@ -151,15 +152,23 @@
 			if (_DEBUG) {
 				_DEBUG_TIME = System.currentTimeMillis();
 			} /*
-				 * Bug 136310, unless this page is that part's
-				 * IContentOutlinePage, ignore the selection change
-				 */
+			 * Bug 136310, unless this page is that part's
+			 * IContentOutlinePage, ignore the selection change
+			 */
 			if (part == null || part.getAdapter(IContentOutlinePage.class) == ConfigurableContentOutlinePage.this) {
 				ISelection validContentSelection = getConfiguration().getSelection(getTreeViewer(), selection);
 
 				boolean isLinked = getConfiguration().isLinkedWithEditor(getTreeViewer());
 				if (isLinked) {
-					getTreeViewer().setSelection(validContentSelection, true);
+					if (!getTreeViewer().getSelection().equals(validContentSelection)) {
+						try {
+							fIsReceivingSelection = true;
+							getTreeViewer().setSelection(validContentSelection, true);
+						}
+						finally {
+							fIsReceivingSelection = false;
+						}
+					}
 				}
 			}
 			if (_DEBUG) {
@@ -175,7 +184,7 @@
 	private class SelectionProvider implements IPostSelectionProvider {
 		private class PostSelectionChangedListener implements ISelectionChangedListener {
 			public void selectionChanged(SelectionChangedEvent event) {
-				if (!isFiringSelection()) {
+				if (!isFiringSelection() && !fIsReceivingSelection) {
 					fireSelectionChanged(event, postListeners);
 					updateStatusLine(getSite().getActionBars().getStatusLineManager(), event.getSelection());
 				}
@@ -184,7 +193,7 @@
 
 		private class SelectionChangedListener implements ISelectionChangedListener {
 			public void selectionChanged(SelectionChangedEvent event) {
-				if (!isFiringSelection()) {
+				if (!isFiringSelection() && !fIsReceivingSelection) {
 					fireSelectionChanged(event, listeners);
 				}
 			}
@@ -320,6 +329,8 @@
 
 	SelectionProvider fSelectionProvider = null;
 
+	boolean fIsReceivingSelection;
+
 	/**
 	 * A ContentOutlinePage that abstract as much behavior as possible away
 	 * from the Controls and varies it by content type.
@@ -334,8 +345,7 @@
 	 * Adds a listener to a list of those notified when someone double-clicks
 	 * in the page.
 	 * 
-	 * @param newListener -
-	 *            the listener to add
+	 * @param newListener - the listener to add
 	 */
 	public void addDoubleClickListener(IDoubleClickListener newListener) {
 		if (fDoubleClickProvider == null) {
@@ -357,6 +367,7 @@
 	 */
 	public void createControl(Composite parent) {
 		super.createControl(parent);
+		ColumnViewerToolTipSupport.enableFor(getTreeViewer());
 
 		IWorkbenchPage page = getSite().getWorkbenchWindow().getActivePage();
 		if (page != null) {
@@ -468,7 +479,9 @@
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @see org.eclipse.ui.part.IPageBookViewPage#init(org.eclipse.ui.part.IPageSite)
+	 * @see
+	 * org.eclipse.ui.part.IPageBookViewPage#init(org.eclipse.ui.part.IPageSite
+	 * )
 	 */
 	public void init(IPageSite pageSite) {
 		super.init(pageSite);
@@ -479,8 +492,7 @@
 	 * Removes a listener to a list of those notified when someone
 	 * double-clicks in the page.
 	 * 
-	 * @param oldListener -
-	 *            the listener to remove
+	 * @param oldListener - the listener to remove
 	 */
 	public void removeDoubleClickListener(IDoubleClickListener oldListener) {
 		if (fDoubleClickProvider != null) {
@@ -488,6 +500,16 @@
 		}
 	}
 
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.views.contentoutline.ContentOutlinePage#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+	 */
+	public void selectionChanged(SelectionChangedEvent event) {
+		if (!fIsReceivingSelection)
+			super.selectionChanged(event);
+	}
+
 	/**
 	 * Configures (or reconfigures) the page according to the given
 	 * configuration.
@@ -647,8 +669,7 @@
 	}
 
 	/**
-	 * @param id -
-	 *            the content type identifier to use for further extension
+	 * @param id - the content type identifier to use for further extension
 	 */
 	public void setInputContentTypeIdentifier(String id) {
 		fInputContentTypeIdentifier = id;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapter.java
index 5473cd5..4789341 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapter.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,8 +18,21 @@
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
 
 
+/**
+ * Adapter interface to provide JFace-style children and property information.
+ * The factory returning this adapter is expected to implement
+ * IJFaceNodeAdapterFactory
+ * 
+ */
 public interface IJFaceNodeAdapter extends INodeAdapter {
 
+    /**
+     * Returns the child elements of the given parent element.
+     * The result is not modified by the viewer.
+     *
+     * @param node the parent object
+     * @return an array of child elements
+     */
 	public Object[] getChildren(Object node);
 
 	/**
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/AnnotationQuery.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/AnnotationQuery.java
index 37f377c..b8d1936 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/AnnotationQuery.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/AnnotationQuery.java
@@ -43,9 +43,9 @@
 	 * </p>
 	 * 
 	 * @param problemType
-	 *            the targetted annotation type
+	 *            the targeted annotation type
 	 * @param markerAttributes
-	 *            the targetted annotation attributes
+	 *            the targeted annotation attributes
 	 */
 	public AnnotationQuery(String annotationType, String[] annotationAttributes) {
 		if (annotationAttributes == null) {
@@ -73,9 +73,20 @@
 			return null;
 
 		Map annoAttributes = ((TemporaryAnnotation) anno).getAttributes();
+		/*
+		 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=243660
+		 * 
+		 * May be null if the original validation IMessage contained no
+		 * attributes or this annotation was not based on a validation
+		 * IMessage
+		 */
+		if (annoAttributes == null) {
+			return null;
+		}
+		
 		// Check type
 		if (type != null) {
-			String problemType = (String) annoAttributes.get("problemType");
+			String problemType = (String) annoAttributes.get("problemType"); //$NON-NLS-1$;
 			if (!type.equals(problemType))
 				return null;
 		}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/QuickFixRegistry.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/QuickFixRegistry.java
index 120cbd9..2be196f 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/QuickFixRegistry.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/QuickFixRegistry.java
@@ -15,12 +15,14 @@
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IConfigurationElement;
 import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
 import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.wst.sse.core.internal.Logger;
 
 public class QuickFixRegistry {
 	private static QuickFixRegistry instance;
@@ -53,7 +55,6 @@
 	 *            the configuration element defining the result
 	 */
 	void addResolutionQuery(AnnotationQuery query, AnnotationQueryResult result, IConfigurationElement element) {
-
 		addQuery(resolutionQueries, query, result, element);
 	}
 
@@ -96,10 +97,17 @@
 
 	public IQuickAssistProcessor[] getQuickFixProcessors(Annotation anno) {
 		// Collect all matches
-		ArrayList processors = new ArrayList();
+		List processors = new ArrayList();
 		for (Iterator iter = resolutionQueries.keySet().iterator(); iter.hasNext();) {
 			AnnotationQuery query = (AnnotationQuery) iter.next();
-			AnnotationQueryResult result = query.performQuery(anno);
+			AnnotationQueryResult result = null;
+			try {
+				/* AnnotationQuery objects are contributed by extension point */
+				result = query.performQuery(anno);
+			}
+			catch (Exception e) {
+				Logger.logException(e);
+			}
 			if (result != null) {
 				// See if a matching result is registered
 				Map resultsTable = (Map) resolutionQueries.get(query);
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/SourceValidationQuickAssistProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/SourceValidationQuickAssistProcessor.java
index 613cd0c..9033fd5 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/SourceValidationQuickAssistProcessor.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/SourceValidationQuickAssistProcessor.java
@@ -16,6 +16,7 @@
 import java.util.List;
 import java.util.Map;
 
+import org.eclipse.jface.text.Position;
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
 import org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext;
 import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
@@ -79,7 +80,8 @@
 					if (anno instanceof TemporaryAnnotation) {
 						attributes = ((TemporaryAnnotation) anno).getAttributes();
 					}
-					StructuredTextInvocationContext sseContext = new StructuredTextInvocationContext(viewer, documentOffset, length, attributes);
+					Position pos = model.getPosition(anno);
+					StructuredTextInvocationContext sseContext = new StructuredTextInvocationContext(viewer, pos.getOffset(), pos.getLength(), attributes);
 
 					// call each processor
 					for (int i = 0; i < processors.size(); ++i) {
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java
index 6f5198f..dc8646e 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     Pete Carapetyan/Genuitec - 244835 - Enable/Disable breakpoint action does not refresh its label
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal.debug;
 
@@ -24,6 +24,8 @@
 import org.eclipse.debug.core.IBreakpointManager;
 import org.eclipse.debug.core.model.IBreakpoint;
 import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.Position;
@@ -41,6 +43,7 @@
 import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel;
 import org.eclipse.ui.texteditor.IDocumentProvider;
 import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorExtension;
 import org.eclipse.ui.texteditor.IUpdate;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
@@ -154,14 +157,25 @@
 	protected IVerticalRulerInfo fRulerInfo = null;
 	protected ITextEditor fTextEditor = null;
 
+	private IMenuListener menuListener;
+
 	public BreakpointRulerAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
 		super();
 		fTextEditor = editor;
-		if(rulerInfo != null) {
+		if (rulerInfo != null) {
 			fRulerInfo = rulerInfo;
 			fMouseListener = new MouseUpdater();
 			rulerInfo.getControl().addMouseListener(fMouseListener);
 		}
+		if (editor instanceof ITextEditorExtension) {
+			ITextEditorExtension extension = (ITextEditorExtension) editor;
+			menuListener = new IMenuListener() {
+				public void menuAboutToShow(IMenuManager manager) {
+					update();
+				}
+			};
+			extension.addRulerContextMenuListener(menuListener);
+		}
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java
index 15d10de..e211930 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,8 +23,11 @@
 import org.eclipse.debug.core.DebugPlugin;
 import org.eclipse.debug.core.IBreakpointManager;
 import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.IDebugUIConstants;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.source.IVerticalRulerInfo;
 import org.eclipse.swt.widgets.Shell;
@@ -122,7 +125,7 @@
 			 * Show for conditions more severe than INFO or when no
 			 * breakpoints were created
 			 */
-			if (status.getSeverity() > IStatus.INFO || getBreakpoints(getMarkers()).length < 1) {
+			if (status.getSeverity() > IStatus.INFO && getBreakpoints(getMarkers()).length < 1) {
 				ErrorDialog.openError(shell, SSEUIMessages.ManageBreakpoints_error_adding_title1, status.getMessage(), status); //$NON-NLS-1$ //$NON-NLS-2$
 				return false;
 			}
@@ -207,4 +210,19 @@
 	 */
 	public void update() {
 	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.jface.action.Action#getImageDescriptor()
+	 * overriding for lazy loading
+	 */
+	public ImageDescriptor getImageDescriptor() {
+		
+		ImageDescriptor image = super.getImageDescriptor();
+		if (image == null){
+			image = DebugUITools.getImageDescriptor(IDebugUIConstants.IMG_OBJS_BREAKPOINT);
+			setImageDescriptor(image);
+		}
+		return image;
+	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/SelectionConvertor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/SelectionConvertor.java
new file mode 100644
index 0000000..b6f5601
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/SelectionConvertor.java
@@ -0,0 +1,62 @@
+/*******************************************************************************

+ * Copyright (c) 2008 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+

+package org.eclipse.wst.sse.ui.internal.editor;

+

+import java.util.ArrayList;

+import java.util.List;

+

+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;

+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;

+

+/**

+ * This class/interface is part of an experimental API that is still under

+ * development and expected to change significantly before reaching stability.

+ * It is being made available at this early stage to solicit feedback from

+ * pioneering adopters on the understanding that any code that uses this API

+ * will almost certainly be broken (repeatedly) as the API evolves.

+ */

+public class SelectionConvertor {

+	/**

+	 * @param model

+	 * @param start

+	 * @param end

+	 * @return the most specific mapping of this text selection to

+	 *         implementors of IndexedRegion

+	 */

+	public Object[] getElements(IStructuredModel model, int start, int end) {

+		Object[] localSelectedStructures = null;

+		if (model != null) {

+			IndexedRegion region = model.getIndexedRegion(start);

+			if (region != null) {

+				if (end <= region.getEndOffset()) {

+					// single selection

+					localSelectedStructures = new Object[1];

+					localSelectedStructures[0] = region;

+				}

+				else {

+					// multiple selection

+					int maxLength = model.getStructuredDocument().getLength();

+					List structures = new ArrayList(2);

+					while (region != null && region.getEndOffset() <= end && region.getEndOffset() < maxLength) {

+						structures.add(region);

+						region = model.getIndexedRegion(region.getEndOffset() + 1);

+					}

+					localSelectedStructures = structures.toArray();

+				}

+			}

+		}

+		if (localSelectedStructures == null) {

+			localSelectedStructures = new Object[0];

+		}

+		return localSelectedStructures;

+	}

+}

diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java
index d58ab8f..104f49a 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -22,6 +22,8 @@
 
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.text.IDocument;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorExtension2;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
@@ -122,17 +124,8 @@
 					editor = (IExtendedSimpleEditor) args[1];
 				}
 				beginRecording();
-				if ((editor != null) && !(obj instanceof ISelfValidateEditAction)) {
-					
-					// TODO: cleanup validateEdit
-					// just leaving this check and following code here for transition. 
-					// I assume we'll remove all need for 'validateEdit'
-					// or move to platform editor's validateState 
-					
-//					IStatus status = editor.validateEdit(getDisplay().getActiveShell());
-//					if (!status.isOK()) {
-//						return null;
-//					}
+				if ((args[1] instanceof ITextEditor) && !(obj instanceof ISelfValidateEditAction) && !isEditable((ITextEditor) args[1])) {
+					return Boolean.FALSE;
 				}
 			}
 			result = m.invoke(obj, args);
@@ -147,4 +140,10 @@
 		}
 		return result;
 	}
+
+	private boolean isEditable(ITextEditor editor) {
+		if (editor instanceof ITextEditorExtension2)
+			return ((ITextEditorExtension2) editor).validateEditorInputState();
+		return editor.isEditable();
+	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/FindOccurrencesHandler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/FindOccurrencesHandler.java
index 1d09715..e8a5add 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/FindOccurrencesHandler.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/FindOccurrencesHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -26,6 +26,8 @@
 import org.eclipse.ui.IFileEditorInput;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
 import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
 import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
@@ -62,8 +64,14 @@
 		}
 		else {
 			String errorMessage = SSEUIMessages.FindOccurrencesActionProvider_0; //$NON-NLS-1$
-			PlatformStatusLineUtil.displayErrorMessage(errorMessage);
-			PlatformStatusLineUtil.addOneTimeClearListener();
+			if (textEditor instanceof StructuredTextEditor) {
+				PlatformStatusLineUtil.displayTemporaryErrorMessage(((StructuredTextEditor) textEditor).getTextViewer(), errorMessage);
+
+			}
+			else {
+				PlatformStatusLineUtil.displayErrorMessage(errorMessage);
+				PlatformStatusLineUtil.addOneTimeClearListener();
+			}
 		}
 		return null;
 	}
@@ -82,12 +90,26 @@
 		String partition = tr != null ? tr.getType() : ""; //$NON-NLS-1$
 
 		Iterator it = getProcessors().iterator();
-		FindOccurrencesProcessor action = null;
+		FindOccurrencesProcessor processor = null;
 		while (it.hasNext()) {
-			action = (FindOccurrencesProcessor) it.next();
+			processor = (FindOccurrencesProcessor) it.next();
 			// we just choose the first action that can handle the partition
-			if (action.enabledForParitition(partition))
-				return action;
+			if (processor.enabledForParitition(partition))
+				return processor;
+		}
+
+		List extendedFindOccurrencesProcessors = ExtendedConfigurationBuilder.getInstance().getConfigurations(FindOccurrencesProcessor.class.getName(), partition);
+		for (int i = 0; i < extendedFindOccurrencesProcessors.size(); i++) {
+			Object o = extendedFindOccurrencesProcessors.get(i);
+			if (o instanceof FindOccurrencesProcessor) {
+				/*
+				 * We just choose the first registered processor that
+				 * explicitly says it can handle the partition
+				 */
+				processor = (FindOccurrencesProcessor) o;
+				if (processor.enabledForParitition(partition))
+					return processor;
+			}
 		}
 		return null;
 	}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/FormatHandler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/FormatHandler.java
index 633c875..6b1b815 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/FormatHandler.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/handlers/FormatHandler.java
@@ -161,11 +161,10 @@
 				IStructuredFormatProcessor formatProcessor = getFormatProcessor(contentType.getId());
 				if (formatProcessor != null && (monitor == null || !monitor.isCanceled())) {
 					String message = NLS.bind(SSEUIMessages.FormatActionDelegate_3, new String[]{file.getFullPath().toString().substring(1)});					monitor.subTask(message);
-					formatProcessor.setProgressMonitor(monitor);
+					formatProcessor.setProgressMonitor(new SubProgressMonitor(monitor, 95));
 					formatProcessor.formatFile(file);
 				}
 			}
-			monitor.worked(95);
 			monitor.done();
 		} catch (MalformedInputExceptionWithDetail e) {
 			String message = NLS.bind(SSEUIMessages.FormatActionDelegate_5, new String[]{file.getFullPath().toString()});
@@ -186,13 +185,14 @@
 			// BUG 178598 - If the resource is shared, and it's possible to
 			// get the workbench Display, the UI thread is asked to execute the
 			// format of the file when it can
+			monitor.beginTask("", 20); //$NON-NLS-1$
 			try {
 				ITextFileBufferManager manager= FileBuffers.getTextFileBufferManager();
 				ITextFileBuffer buffer = null;
 				
 				try {
 					if(manager != null) {
-						manager.connect(file.getFullPath(), LocationKind.IFILE, monitor);
+						manager.connect(file.getFullPath(), LocationKind.IFILE, new SubProgressMonitor(monitor, 1));
 						buffer = manager.getTextFileBuffer(resource.getFullPath(), LocationKind.IFILE);
 					}
 					
@@ -201,18 +201,19 @@
 						if (display != null) {
 							display.syncExec(new Runnable() {
 								public void run() {
-									format(monitor, file);
+									format(new SubProgressMonitor(monitor, 18), file);
 								}
 							});
 						}
 					}
 					else
-						format(monitor, file);
+						format(new SubProgressMonitor(monitor, 18), file);
 				}
 				finally {
 					if(manager != null)
 						manager.disconnect(file.getFullPath(), LocationKind.IFILE, new SubProgressMonitor(monitor, 1));
 				}
+				monitor.done();
 			}
 			catch(CoreException e) {
 				String message = NLS.bind(SSEUIMessages.FormatActionDelegate_4, new String[]{file.getFullPath().toString()});
@@ -229,7 +230,7 @@
 
 			try {
 				IResource[] members = container.members();
-				monitor.beginTask("", members.length);
+				monitor.beginTask("", members.length); //$NON-NLS-1$
 				for (int i = 0; i < members.length; i++) {
 					if (monitor != null && !monitor.isCanceled())
 						format(new SubProgressMonitor(monitor, 1), members[i]);
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/OpenHyperlinkAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/OpenHyperlinkAction.java
index 9994523..35a6e55 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/OpenHyperlinkAction.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/OpenHyperlinkAction.java
@@ -2,12 +2,14 @@
 
 import java.util.ResourceBundle;
 
+import org.eclipse.core.runtime.SafeRunner;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.ITextSelection;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.Region;
 import org.eclipse.jface.text.hyperlink.IHyperlink;
 import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
+import org.eclipse.jface.util.SafeRunnable;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.ui.texteditor.ITextEditor;
 import org.eclipse.ui.texteditor.TextEditorAction;
@@ -37,21 +39,34 @@
 		}
 
 		ITextSelection textSelection = (ITextSelection) selection;
-		IRegion region = new Region(textSelection.getOffset(), textSelection.getLength());
+		final IRegion region = new Region(textSelection.getOffset(), textSelection.getLength());
 		IHyperlink hyperlink = null;
 
 		synchronized (fHyperlinkDetectors) {
 			for (int i = 0, length = fHyperlinkDetectors.length; i < length && hyperlink == null; i++) {
-				IHyperlinkDetector detector = fHyperlinkDetectors[i];
+				final IHyperlinkDetector detector = fHyperlinkDetectors[i];
 				if (detector == null)
 					continue;
 
-				IHyperlink[] hyperlinks = detector.detectHyperlinks(fTextViewer, region, false);
-				if (hyperlinks == null)
+				/* The array is final, but its contents aren't */
+				final IHyperlink[][] hyperlinks = new IHyperlink[1][];
+
+				/*
+				 * Detect from within a SafeRunnable since the list of
+				 * detectors is extensible
+				 */
+				SafeRunnable detectorRunnable = new SafeRunnable() {
+					public void run() throws Exception {
+						hyperlinks[0] = detector.detectHyperlinks(fTextViewer, region, false);
+					}
+				};
+				SafeRunner.run(detectorRunnable);
+
+				if (hyperlinks[0] == null)
 					continue;
 
 				if (hyperlinks.length > 0)
-					hyperlink = hyperlinks[0];
+					hyperlink = hyperlinks[0][0];
 			}
 		}
 		if (hyperlink != null) {
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/EditorPreferenceNames.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/EditorPreferenceNames.java
index 76cccac..5ce3447 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/EditorPreferenceNames.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/EditorPreferenceNames.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -145,4 +145,12 @@
 	 * @see org.eclipse.jface.preference.PreferenceConverter
 	 */
 	public final static String CODEASSIST_PARAMETERS_FOREGROUND = "content_assist_parameters_foreground"; //$NON-NLS-1$
+	
+	/**
+	 * A named preference that controls whether semantic highlighting is turned on or off
+	 * <p>
+	 * Value is of type <code>Boolean</code>.
+	 * </p>
+	 */
+	public final static String SEMANTIC_HIGHLIGHTING = "semanticHighlighting"; //$NON-NLS-1$
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferencePage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferencePage.java
index bc0b6a6..0e69c18 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferencePage.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferencePage.java
@@ -58,6 +58,18 @@
 
 		return button;
 	}
+	
+	protected void initCheckbox(Button box, String key) {
+		if(box != null && key != null) {
+			box.setSelection(getPreferenceStore().getBoolean(key));
+		}
+	}
+
+	protected void defaultCheckbox(Button box, String key) {
+		if(box != null && key != null) {
+			box.setSelection(getPreferenceStore().getDefaultBoolean(key));
+		}
+	}
 
 	protected Composite createComposite(Composite parent, int numColumns) {
 		Composite composite = new Composite(parent, SWT.NULL);
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorHelper.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorHelper.java
index d39424d..684da7b 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorHelper.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,6 +14,7 @@
 
 
 
+import org.eclipse.jface.resource.ColorRegistry;
 import org.eclipse.swt.graphics.RGB;
 import org.eclipse.wst.sse.ui.internal.Logger;
 
@@ -188,4 +189,42 @@
 
 		return stylePrefs;
 	}
+	
+	/**
+	 * Attempts to lookup the RGB value for <code>key</code> from the color
+	 * registry. If one is not found, the <code>defaultRGB</code> is used.
+	 * @param registry The ColorRegistry to search for the RGB value
+	 * @param key The key that the RGB value is stored under in the registry
+	 * @param defaultRGB The default RGB value to return in the absence of one
+	 * from the color registry
+	 * 
+	 * @return The RGB value from the color registry for a given key, if it exists.
+	 * Otherwise, return the default RGB value.
+	 */
+	public static RGB findRGB(ColorRegistry registry, String key, RGB defaultRGB) {
+		if(registry.hasValueFor(key))
+			return registry.getRGB(key);
+		return defaultRGB;
+	}
+	
+	/**
+	 * Attempts to find the RGB string for <code>key</code> from the color registry.
+	 * If one is not found, an RGB string is generated from the parameters <code>r,g,b</code>.
+	 * 
+	 * @param registry The ColorRegistry to search for the RGB value
+	 * @param key The key that the RGB value is stored under in the registry
+	 * @param r The default red value
+	 * @param g The default green value
+	 * @param b The default blue value
+	 * 
+	 * @return The String RGB value from the color registry for a given key, if it exists.
+	 * Otherwise, return the string RGB value created from the default r,g,b parameters.
+	 * 
+	 */
+	public static String findRGBString(ColorRegistry registry, String key, int r, int g, int b) {
+		if(registry.hasValueFor(key))
+			return toRGBString(registry.getRGB(key));
+		return getColorString(r, g, b);
+	}
+	
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StructuredTextEditorPreferencePage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StructuredTextEditorPreferencePage.java
index 560ee09..dd9ee29 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StructuredTextEditorPreferencePage.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StructuredTextEditorPreferencePage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -51,7 +51,7 @@
 import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
 import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
 import org.eclipse.wst.sse.ui.internal.preferences.TabFolderLayout;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
+import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy;
 import org.eclipse.wst.sse.ui.internal.provisional.preferences.CommonEditorPreferenceNames;
 
 /**
@@ -157,7 +157,10 @@
 		addCheckBox(appearanceComposite, label, EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG, 0);
 
 		label = SSEUIMessages.StructuredTextEditorPreferencePage_3;
-		addCheckBox(appearanceComposite, label, IStructuredTextFoldingProvider.FOLDING_ENABLED, 0);
+		addCheckBox(appearanceComposite, label, AbstractStructuredFoldingStrategy.FOLDING_ENABLED, 0);
+		
+		label = SSEUIMessages.StructuredTextEditorPreferencePage_1;
+		addCheckBox(appearanceComposite, label, EditorPreferenceNames.SEMANTIC_HIGHLIGHTING, 0);
 
 		Label l = new Label(appearanceComposite, SWT.LEFT);
 		GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
@@ -292,8 +295,10 @@
 		overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS));
 		overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG));
 
-		overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IStructuredTextFoldingProvider.FOLDING_ENABLED));
+		overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractStructuredFoldingStrategy.FOLDING_ENABLED));
 		
+		overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, EditorPreferenceNames.SEMANTIC_HIGHLIGHTING));
+
 		overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, EditorPreferenceNames.CODEASSIST_PROPOSALS_BACKGROUND));
 		overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, EditorPreferenceNames.CODEASSIST_PROPOSALS_FOREGROUND));
 		overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, EditorPreferenceNames.CODEASSIST_PARAMETERS_BACKGROUND));
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredCommentFoldingPosition.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredCommentFoldingPosition.java
new file mode 100644
index 0000000..f346653
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredCommentFoldingPosition.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.projection;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.source.projection.IProjectionPosition;
+
+/**
+ * Represents a folding position for an XML comment
+ */
+public abstract class AbstractStructuredCommentFoldingPosition extends Position implements IProjectionPosition {
+
+	/**
+	 * Default constructor
+	 * 
+	 * @param offset the offset of the folding position
+	 * @param length the length of the folidng position
+	 */
+	public AbstractStructuredCommentFoldingPosition(int offset, int length) {
+		super(offset, length);
+	}
+	
+	/**
+	 * @see org.eclipse.jface.text.source.projection.IProjectionPosition#computeCaptionOffset(org.eclipse.jface.text.IDocument)
+	 */
+	public int computeCaptionOffset(IDocument document) throws BadLocationException {
+		return findFirstContent(document.get(offset, length));
+	}
+
+	/**
+	 * @see org.eclipse.jface.text.source.projection.IProjectionPosition#computeProjectionRegions(org.eclipse.jface.text.IDocument)
+	 */
+	public IRegion[] computeProjectionRegions(IDocument document) throws BadLocationException {
+		//get the content of the comment
+		String content = document.get(offset, length);
+		int contentStart = findFirstContent(content);
+		
+		//find the start line of the comment
+		//find the end line of the comment
+		//find the first line of text in the comment
+		int startLineNum = document.getLineOfOffset(getStartOffset());
+		IRegion startLine = document.getLineInformation(startLineNum);
+		int endLineNum = document.getLineOfOffset(getEndOffset()) +1;
+		IRegion endLine = document.getLineInformation(endLineNum);
+		int captionLineNum = document.getLineOfOffset(getStartOffset() + contentStart);
+		
+		int foldOffset;			
+		int foldEndOffset;
+		
+		synchronized (this) {
+			foldOffset = startLine.getOffset();
+			if(foldOffset < offset) {
+				offset = foldOffset;
+			}
+		
+			foldEndOffset = endLine.getOffset();
+		
+			if((foldEndOffset-offset) > length) {
+				length = foldEndOffset-offset;
+			}
+		}
+		
+		//fold before the first line of text in the comment
+		IRegion preRegion = null;
+		IRegion postRegion = null;
+		if(startLineNum < captionLineNum) {
+			IRegion captionLine = document.getLineInformation(captionLineNum);
+			preRegion = new Region(foldOffset, captionLine.getOffset()-foldOffset);
+		}
+		
+		//fold after the first line of text in the comment
+		if(captionLineNum < endLineNum) {
+			int postRegionOffset = document.getLineOffset(captionLineNum+1);
+			postRegion = new Region(postRegionOffset, foldEndOffset-postRegionOffset);
+		}
+		
+		IRegion[] regions = null;
+		if(preRegion != null && postRegion != null) {
+			regions = new IRegion[] {preRegion, postRegion};
+		} else if(preRegion != null) {
+			regions = new IRegion[] {preRegion};
+		} else if(postRegion != null) {
+			regions = new IRegion[] {postRegion};
+		}
+		
+		return regions;
+	}
+	
+	/**
+	 * Finds the offset of the first identifier part within <code>content</code>.
+	 * Returns 0 if none is found.
+	 *
+	 * @param content the content to search
+	 * @param prefixEnd the end of the prefix
+	 * @return the first index of a unicode identifier part, or zero if none can
+	 *         be found
+	 */
+	private int findFirstContent(final CharSequence content) {
+		int lenght= content.length();
+		for (int i= 0; i < lenght; i++) {
+			if (Character.isUnicodeIdentifierPart(content.charAt(i)))
+				return i;
+		}
+		return 0;
+	}
+	
+	/**
+	 * @return the start offset of the folding position
+	 */
+	protected abstract int getStartOffset();
+	
+	/**
+	 * @return the end offset of the folding position
+	 */
+	protected abstract int getEndOffset();
+
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredFoldingPosition.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredFoldingPosition.java
new file mode 100644
index 0000000..3ddb47a
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredFoldingPosition.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.projection;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.source.projection.IProjectionPosition;
+
+/**
+ * Represents a single folding position in an <code>IStructuredDocument</code>
+ */
+public abstract class AbstractStructuredFoldingPosition extends Position implements IProjectionPosition {
+	
+	/**
+	 * Default constructor
+	 * 
+	 * @param offset the offset of the folding position
+	 * @param length the length of the folidng position
+	 */
+	public AbstractStructuredFoldingPosition(int offset, int length) {
+		super(offset, length);
+	}
+	
+	/**
+	 * @see org.eclipse.jface.text.source.projection.IProjectionPosition#computeCaptionOffset(org.eclipse.jface.text.IDocument)
+	 */
+	public int computeCaptionOffset(IDocument document) throws BadLocationException {
+		
+		return 0;
+	}
+	
+	/**
+	 * @see org.eclipse.jface.text.source.projection.IProjectionPosition#computeProjectionRegions(org.eclipse.jface.text.IDocument)
+	 */
+	public IRegion[] computeProjectionRegions(IDocument document) throws BadLocationException {
+		
+		int startLineNum = document.getLineOfOffset(getStartOffset()) + 1;
+		IRegion startLine = document.getLineInformation(startLineNum);
+		int endLineNum = document.getLineOfOffset(getEndOffset()) + 1;
+		IRegion endLine = document.getLineInformation(endLineNum);
+		
+		int foldOffset;			
+		int foldEndOffset;
+		
+		synchronized (this) {
+			foldOffset = startLine.getOffset();
+			if(foldOffset < offset) {
+				offset = foldOffset;
+			}
+		
+			foldEndOffset = endLine.getOffset();
+		
+			if((foldEndOffset-offset) > length) {
+				length = foldEndOffset-offset;
+			}
+		}
+		
+		return new IRegion[] {new Region(foldOffset, foldEndOffset-foldOffset)};
+	}
+	
+	/**
+	 * @return the start offset of the folding position
+	 */
+	protected abstract int getStartOffset();
+	
+	/**
+	 * @return the end offset of the folding position
+	 */
+	protected abstract int getEndOffset();
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredFoldingStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredFoldingStrategy.java
new file mode 100644
index 0000000..c686845
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/AbstractStructuredFoldingStrategy.java
@@ -0,0 +1,510 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.projection;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.reconciler.DirtyRegion;
+import org.eclipse.jface.text.reconciler.IReconcileStep;
+import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.jface.text.source.projection.IProjectionListener;
+import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
+import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
+import org.eclipse.jface.text.source.projection.ProjectionViewer;
+import org.eclipse.swt.graphics.FontMetrics;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.ui.internal.reconcile.AbstractStructuredTextReconcilingStrategy;
+import org.eclipse.wst.sse.ui.internal.reconcile.StructuredReconcileStep;
+
+/**
+ * <p>This class has the default implementation for a structured editor folding strategy.
+ * Each content type that the structured editor supports should create an extension point
+ * specifying a child class of this class as its folding strategy, if that content type
+ * should have folding.</p>
+ * 
+ * <p>EX:<br />
+ * <code>&lt;extension point="org.eclipse.wst.sse.ui.editorConfiguration"&gt;<br />
+ *  &lt;provisionalConfiguration<br />
+ *			type="foldingstrategy"<br />
+ *			class="org.eclipse.wst.xml.ui.internal.projection.XMLFoldingStrategy"<br />
+ *			target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" /&gt;<br />
+ *	&lt;/extension&gt;</code></p>
+ * 
+ * <p>Different content types can use the same folding strategy if it makes sense to do so,
+ * such as with HTML/XML/JSP.</p>
+ * 
+ * <p>This strategy is based on the Reconciler paradigm and thus runs in the background,
+ * this means that even for very large documents requiring the calculation of 1000s of
+ * folding annotations the user will not be effected except for the annotations may take
+ * some time to first appear.</p>
+ */
+public abstract class AbstractStructuredFoldingStrategy
+	extends AbstractStructuredTextReconcilingStrategy implements IProjectionListener {
+	
+	/**
+	 * The org.eclipse.wst.sse.ui.editorConfiguration provisionalConfiguration type
+	 */
+	public static final String ID = "foldingstrategy"; //$NON-NLS-1$ 
+	
+	/**
+	 * A named preference that controls whether folding is enabled in the
+	 * Structured Text editor.
+	 */
+	public final static String FOLDING_ENABLED = "foldingEnabled"; //$NON-NLS-1$ 
+	
+	/**
+	 * The annotation model associated with this folding strategy
+	 */
+	protected ProjectionAnnotationModel fProjectionAnnotationModel;
+	
+	/**
+	 * The structured text viewer this folding strategy is associated with
+	 */
+	private ProjectionViewer fViewer;
+	
+	/**
+	 * these are not used but needed to implement abstract methods
+	 */
+	private IReconcileStep fFoldingStep;
+	
+	/**
+	 * Default constructor for the folding strategy, can not take any parameters
+	 * because subclasses instances of this class are created using reflection
+	 * based on plugin settings
+	 */
+	public AbstractStructuredFoldingStrategy() {
+		super();
+	}
+	
+	/**
+	 * The folding strategy must be associated with a viewer for it to function
+	 * 
+	 * @param viewer the viewer to associate this folding strategy with
+	 */
+	public void setViewer(ProjectionViewer viewer) {
+		super.setViewer(viewer);
+		
+		if(fViewer != null) {
+			fViewer.removeProjectionListener(this);
+		}
+		fViewer = viewer;
+		fViewer.addProjectionListener(this);
+		fProjectionAnnotationModel = fViewer.getProjectionAnnotationModel();
+	}
+	
+	public void uninstall() {
+		setDocument(null);
+		
+		if(fViewer != null) {
+			fViewer.removeProjectionListener(this);
+			fViewer = null;
+		}
+		
+		fFoldingStep = null;
+		
+		projectionDisabled();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.wst.sse.ui.internal.reconcile.AbstractStructuredTextReconcilingStrategy#setDocument(org.eclipse.jface.text.IDocument)
+	 */
+	public void setDocument(IDocument document) {
+		super.setDocument(document);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.jface.text.source.projection.IProjectionListener#projectionDisabled()
+	 */
+	public void projectionDisabled() {
+		fProjectionAnnotationModel = null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.jface.text.source.projection.IProjectionListener#projectionEnabled()
+	 */
+	public void projectionEnabled() {
+		if(fViewer != null) {
+			fProjectionAnnotationModel = fViewer.getProjectionAnnotationModel();
+		}
+	}
+	
+	/**
+	 * <p><b>NOTE 1:</b> This implementation of reconcile ignores the given {@link IRegion} and instead gets all of the
+	 * structured document regions effected by the range of the given {@link DirtyRegion}.</p>
+	 * 
+	 * <p><b>NOTE 2:</b> In cases where multiple {@link IRegion} maybe dirty it is more efficient to pass one
+	 * {@link DirtyRegion} contain all of the {@link IRegion}s then one {@link DirtyRegion} for each IRegion.
+	 * Case in point, when processing the entire document it is <b>recommended</b> that this function be
+	 * called only <b>once</b> with one {@link DirtyRegion} that spans the entire document.</p>
+	 * 
+	 * @param dirtyRegion the region that needs its folding annotations processed
+	 * @param subRegion ignored
+	 * 
+	 * @see org.eclipse.wst.sse.ui.internal.reconcile.AbstractStructuredTextReconcilingStrategy#reconcile(org.eclipse.jface.text.reconciler.DirtyRegion, org.eclipse.jface.text.IRegion)
+	 */
+	public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) {
+		IStructuredModel model = null;
+		if(fProjectionAnnotationModel != null) {
+			try {
+				model = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
+				if(model != null) {
+					//use the structured doc to get all of the regions effected by the given dirty region
+					IStructuredDocument structDoc = model.getStructuredDocument();
+					IStructuredDocumentRegion[] structRegions = structDoc.getStructuredDocumentRegions(dirtyRegion.getOffset(), dirtyRegion.getLength());
+					Set indexedRegions = getIndexedRegions(model, structRegions);
+
+					//these are what are passed off to the annotation model to
+					//actually create and maintain the annotations
+					List modifications = new ArrayList();
+					List deletions = new ArrayList();
+					Map additions = new HashMap();
+					boolean isInsert = dirtyRegion.getType().equals(DirtyRegion.INSERT);
+					boolean isRemove = dirtyRegion.getType().equals(DirtyRegion.REMOVE);
+
+					//find and mark all folding annotations with length 0 for deletion 
+					markInvalidAnnotationsForDeletion(dirtyRegion, deletions);
+					
+					//reconcile each effected indexed region
+					Iterator indexedRegionsIter = indexedRegions.iterator();
+					while(indexedRegionsIter.hasNext() && fProjectionAnnotationModel != null) {
+						IndexedRegion indexedRegion = (IndexedRegion)indexedRegionsIter.next();
+					
+						//only try to create an annotation if the index region is a valid type
+						if(indexedRegionValidType(indexedRegion)) {
+							FoldingAnnotation annotation = new FoldingAnnotation(indexedRegion, false);
+							
+							// if INSERT calculate new addition position or modification
+							// else if REMOVE add annotation to the deletion list
+							if(isInsert) {
+								Annotation existingAnno = getExistingAnnotation(indexedRegion);
+								//if projection has been disabled the iter could be null
+								//if annotation does not already exist for this region create a new one
+								//else modify an old one, which could include deletion
+								if(existingAnno == null) {
+									Position newPos = calcNewFoldPosition(indexedRegion);
+
+									if(newPos != null && newPos.length > 0) {
+										additions.put(annotation, newPos);
+									}
+								} else {
+									updateAnnotations(existingAnno, indexedRegion, additions, modifications, deletions);
+								}
+							} else if (isRemove) {
+								deletions.add(annotation);
+							}
+						}
+					}
+					
+					//be sure projection has not been disabled
+					if(fProjectionAnnotationModel != null) {
+						//send the calculated updates to the annotations to the annotation model
+						fProjectionAnnotationModel.modifyAnnotations((Annotation[])deletions.toArray(new Annotation[1]), additions, (Annotation[])modifications.toArray(new Annotation[0]));
+					}
+				}
+			} finally {
+				if(model != null) {
+					model.releaseFromRead();
+				}
+			}
+		}
+	}
+	
+	/**
+	 * <p>Every implementation of the folding strategy calculates the position for a given
+	 * IndexedRegion differently.  Also this calculation often relies on casting to internal classes
+	 * only available in the implementing classes plugin</p>
+	 * 
+	 * @param indexedRegion the IndexedRegion to calculate a new annotation position for
+	 * @return the calculated annotation position or NULL if none can be calculated based on the given region
+	 */
+	abstract protected Position calcNewFoldPosition(IndexedRegion indexedRegion);
+	
+	/**
+	 * This is the default behavior for updating a dirtied IndexedRegion.  This function
+	 * can be overridden if slightly different functionality is required in a specific instance
+	 * of this class.
+	 * 
+	 * @param existingAnnotationsIter the existing annotations that need to be updated
+	 * based on the given dirtied IndexRegion
+	 * @param dirtyRegion the IndexedRegion that caused the annotations need for updating
+	 * @param modifications the list of annotations to be modified
+	 * @param deletions the list of annotations to be deleted
+	 */
+	protected void updateAnnotations(Annotation existingAnnotation, IndexedRegion dirtyRegion, Map additions, List modifications, List deletions) {
+		if(existingAnnotation instanceof FoldingAnnotation) {
+			FoldingAnnotation foldingAnnotation = (FoldingAnnotation)existingAnnotation;
+			Position newPos = calcNewFoldPosition(foldingAnnotation.getRegion());
+
+			//if a new position can be calculated then update the position of the annotation,
+			//else the annotation needs to be deleted
+			if(newPos != null && newPos.length > 0 && fProjectionAnnotationModel != null) {
+				Position oldPos = fProjectionAnnotationModel.getPosition(foldingAnnotation);
+				//only update the position if we have to
+				if(!newPos.equals(oldPos)) {
+					oldPos.setOffset(newPos.offset);
+					oldPos.setLength(newPos.length);
+					modifications.add(foldingAnnotation);
+				}
+			} else {
+				deletions.add(foldingAnnotation);
+			}
+		}
+	}
+
+	/**
+	 * <p>Searches the given {@link DirtyRegion} for annotations that now have a length of 0.
+	 * This is caused when something that was being folded has been deleted.  These {@link FoldingAnnotation}s
+	 * are then added to the {@link List} of {@link FoldingAnnotation}s to be deleted</p>
+	 * 
+	 * @param dirtyRegion find the now invalid {@link FoldingAnnotation}s in this {@link DirtyRegion}
+	 * @param deletions the current list of {@link FoldingAnnotation}s marked for deletion that the
+	 * newly found invalid {@link FoldingAnnotation}s will be added to
+	 */
+	protected void markInvalidAnnotationsForDeletion(DirtyRegion dirtyRegion, List deletions) {
+		Iterator iter = getAnnotationIterator(dirtyRegion);
+		while(iter.hasNext()) {
+			Annotation anno = (Annotation)iter.next();
+			if(anno instanceof FoldingAnnotation) {
+				Position pos = fProjectionAnnotationModel.getPosition(anno);
+				if(pos.length == 0) {
+					deletions.add(anno);
+	 			}
+	 		}
+	 	}
+	}
+
+	/**
+	 * Should return true if the given IndexedRegion is one that this strategy pays attention to
+	 * when calculating new and updated annotations
+	 * 
+	 * @param indexedRegion the IndexedRegion to check the type of
+	 * @return true if the IndexedRegion is of a valid type, false otherwise
+	 */
+	abstract protected boolean indexedRegionValidType(IndexedRegion indexedRegion);
+	
+	/**
+	 *  Steps are not used in this strategy
+	 * 
+	 * @see org.eclipse.wst.sse.ui.internal.reconcile.AbstractStructuredTextReconcilingStrategy#containsStep(org.eclipse.jface.text.reconciler.IReconcileStep)
+	 */
+	protected boolean containsStep(IReconcileStep step) {
+		return fFoldingStep.equals(step);
+	}
+
+	/** 
+	 * Steps are not used in this strategy
+	 * 
+	 * @see org.eclipse.wst.sse.ui.internal.reconcile.AbstractStructuredTextReconcilingStrategy#createReconcileSteps()
+	 */
+	public void createReconcileSteps() {
+		fFoldingStep = new StructuredReconcileStep() { };
+	}
+	
+	/**
+	 * A FoldingAnnotation is a ProjectionAnnotation in a structured document.
+	 * Its extended functionality include storing the <code>IndexedRegion</code> it is folding
+	 * and overriding the paint method (in a hacky type way) to prevent one line folding
+	 * annotations to be drawn.
+	 */
+	protected class FoldingAnnotation extends ProjectionAnnotation {
+		private boolean fIsVisible; /* workaround for BUG85874 */
+		
+		/**
+		 * The IndexedRegion this annotation is folding
+		 */
+		private IndexedRegion fRegion;
+		
+		/**
+		 * Creates a new FoldingAnnotation that is associated with the given IndexedRegion
+		 * 
+		 * @param region the IndexedRegion this annotation is associated with 
+		 * @param isCollapsed true if this annotation should be collapsed, false otherwise
+		 */
+		public FoldingAnnotation(IndexedRegion region, boolean isCollapsed) {
+			super(isCollapsed);
+			
+			fIsVisible = false;
+			fRegion = region;
+		}
+		
+		/**
+		 * Returns the IndexedRegion this annotation is associated with
+		 * 
+		 * @return the IndexedRegion this annotation is associated with
+		 */
+		public IndexedRegion getRegion() {
+			return fRegion;
+		}
+
+		public void setRegion(IndexedRegion region) {
+			fRegion = region;
+		}
+
+		/**
+		 * Does not paint hidden annotations. Annotations are hidden when they
+		 * only span one line.
+		 * 
+		 * @see ProjectionAnnotation#paint(org.eclipse.swt.graphics.GC,
+		 *      org.eclipse.swt.widgets.Canvas,
+		 *      org.eclipse.swt.graphics.Rectangle)
+		 */
+		public void paint(GC gc, Canvas canvas, Rectangle rectangle) {
+			/* workaround for BUG85874 */
+			/*
+			 * only need to check annotations that are expanded because hidden
+			 * annotations should never have been given the chance to
+			 * collapse.
+			 */
+			if (!isCollapsed()) {
+				// working with rectangle, so line height
+				FontMetrics metrics = gc.getFontMetrics();
+				if (metrics != null) {
+					// do not draw annotations that only span one line and
+					// mark them as not visible
+					if ((rectangle.height / metrics.getHeight()) <= 1) {
+						fIsVisible = false;
+						return;
+					}
+				}
+			}
+			fIsVisible = true;
+			super.paint(gc, canvas, rectangle);
+		}
+
+		/**
+		 * @see org.eclipse.jface.text.source.projection.ProjectionAnnotation#markCollapsed()
+		 */
+		public void markCollapsed() {
+			/* workaround for BUG85874 */
+			// do not mark collapsed if annotation is not visible
+			if (fIsVisible)
+				super.markCollapsed();
+		}
+		
+		/**
+		 * Two FoldingAnnotations are equal if their IndexedRegions are equal
+		 * 
+		 * @see java.lang.Object#equals(java.lang.Object)
+		 */
+		public boolean equals(Object obj) {
+			boolean equal = false;
+			
+			if(obj instanceof FoldingAnnotation) {
+				equal = fRegion.equals(((FoldingAnnotation)obj).fRegion);
+			}
+			
+			return equal;
+		}
+		
+		/**
+		 * Returns the hash code of the IndexedRegion this annotation is associated with
+		 * 
+		 * @see java.lang.Object#hashCode()
+		 */
+		public int hashCode() {
+			return fRegion.hashCode();
+		}
+		
+		/**
+		 * Returns the toString of the aIndexedRegion this annotation is associated with
+		 * 
+		 * @see java.lang.Object#toString()
+		 */
+		public String toString() {
+			return fRegion.toString();
+		}
+	}
+	
+	/**
+	 * Given a {@link DirtyRegion} returns an {@link Iterator} of the already existing
+	 * annotations in that region.
+	 * 
+	 * @param dirtyRegion the {@link DirtyRegion} to check for existing annotations in
+	 * 
+	 * @return an {@link Iterator} over the annotations in the given {@link DirtyRegion}.
+	 * The iterator could have no annotations in it. Or <code>null</code> if projection has
+	 * been disabled.
+	 */
+	private Iterator getAnnotationIterator(DirtyRegion dirtyRegion) {
+		Iterator annoIter = null; 
+		//be sure project has not been disabled
+		if(fProjectionAnnotationModel != null) {
+			//workaround for Platform Bug 299416
+			int offset = dirtyRegion.getOffset();
+			if(offset > 0) {
+				offset--;
+			}
+			annoIter = fProjectionAnnotationModel.getAnnotationIterator(offset, dirtyRegion.getLength(), false, false);
+		}
+		return annoIter;
+	}
+
+	/**
+	 * <p>Gets the first {@link Annotation} at the start offset of the given {@link IndexedRegion}.</p>
+	 * 
+	 * @param indexedRegion get the first {@link Annotation} at this {@link IndexedRegion}
+	 * @return the first {@link Annotation} at the start offset of the given {@link IndexedRegion}
+	 */
+	private Annotation getExistingAnnotation(IndexedRegion indexedRegion) {
+		Iterator iter = fProjectionAnnotationModel.getAnnotationIterator(indexedRegion.getStartOffset(), 1, false, true);
+		Annotation anno = null;
+		if(iter.hasNext()) {
+			anno = (Annotation)iter.next();
+		}
+
+		return anno;
+	}
+
+	/**
+	 * <p>Gets all of the {@link IndexedRegion}s from the given {@link IStructuredModel} spand by the given
+	 * {@link IStructuredDocumentRegion}s.</p>
+	 * 
+	 * @param model the {@link IStructuredModel} used to get the {@link IndexedRegion}s
+	 * @param structRegions get the {@link IndexedRegion}s spanned by these {@link IStructuredDocumentRegion}s
+	 * @return the {@link Set} of {@link IndexedRegion}s from the given {@link IStructuredModel} spaned by the
+	 * given {@link IStructuredDocumentRegion}s.
+	 */
+	private Set getIndexedRegions(IStructuredModel model, IStructuredDocumentRegion[] structRegions) {
+		Set indexedRegions = new HashSet();
+
+		//for each text region in each struct doc region find the indexed region it spans/is in
+		for(int structRegionIndex = 0; structRegionIndex < structRegions.length && fProjectionAnnotationModel != null; ++structRegionIndex) {
+			ITextRegionList textRegions = structRegions[structRegionIndex].getRegions();
+			for(int textRegionIndex = 0; textRegionIndex < textRegions.size() && fProjectionAnnotationModel != null; ++textRegionIndex) {
+				int offset = structRegions[structRegionIndex].getStartOffset(textRegions.get(textRegionIndex));
+				indexedRegions.add(model.getIndexedRegion(offset));
+			}
+		}
+
+		return indexedRegions;
+	 }
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/IStructuredTextFoldingProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/IStructuredTextFoldingProvider.java
deleted file mode 100644
index 76d9af2..0000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/IStructuredTextFoldingProvider.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.eclipse.wst.sse.ui.internal.projection;
-
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-
-/**
- * Implementors of this interface which will create and maintain
- * {@link org.eclipse.jface.text.source.projection.ProjectionAnnotation}
- * objects that define folded regions in the the
- * {@link org.eclipse.jface.text.source.projection.ProjectionViewer}for a
- * structured model.
- */
-public interface IStructuredTextFoldingProvider {
-	public static final String ID = "structuredtextfoldingprovider"; //$NON-NLS-1$
-
-	/**
-	 * A named preference that controls whether folding is enabled in the
-	 * Structured Text editor.
-	 */
-	public final static String FOLDING_ENABLED = "foldingEnabled"; //$NON-NLS-1$ 
-
-	// copied interface from
-	// org.eclipse.jdt.ui.text.folding.IJavaFoldingStructureProvider
-	/**
-	 * Installs this structure provider on the given viewer. Implementations
-	 * should listen to the projection events generated by <code>viewer</code>
-	 * and enable / disable generation of projection structure accordingly.
-	 * 
-	 * @param viewer
-	 *            the projection viewer that displays the annotations created
-	 *            by this structure provider
-	 */
-	public void install(ProjectionViewer viewer);
-
-	/**
-	 * Uninstalls this structure provider. Any references to viewers should be
-	 * cleared.
-	 */
-	public void uninstall();
-
-	/**
-	 * Initialize this provider with the correct document. Assumes projection
-	 * is enabled. (otherwise, only install would have been called)
-	 */
-	public void initialize();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ConfigurablePropertySheetPage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ConfigurablePropertySheetPage.java
index c1d8429..881cb2f 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ConfigurablePropertySheetPage.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ConfigurablePropertySheetPage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,15 +17,11 @@
 import org.eclipse.jface.action.IStatusLineManager;
 import org.eclipse.jface.action.IToolBarManager;
 import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.part.IPageSite;
+import org.eclipse.ui.part.PageBookView;
 import org.eclipse.ui.views.properties.IPropertySheetEntry;
 import org.eclipse.ui.views.properties.IPropertySheetPage;
 import org.eclipse.ui.views.properties.IPropertySource;
@@ -76,6 +72,8 @@
 	public void dispose() {
 		setConfiguration(null);
 		getSite().getWorkbenchWindow().getSelectionService().removePostSelectionListener(this);
+		fSelectedEntries = null;
+		fInput = null;
 		super.dispose();
 	}
 
@@ -121,17 +119,22 @@
 		if (fSelectedEntries != null) {
 			Object[] entries = fSelectedEntries;
 			ISelection selection = fInput;
+			boolean needsRefresh = false;
 			if (selection != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
 				IPropertySource source = getConfiguration().getPropertySourceProvider(this).getPropertySource(((IStructuredSelection) selection).getFirstElement());
 				if (source != null && source instanceof IPropertySourceExtension) {
 					for (int i = 0; i < entries.length; i++) {
 						if (entries[i] instanceof IPropertySheetEntry) {
 							IPropertySheetEntry entry = (IPropertySheetEntry) entries[i];
+							needsRefresh = true;
 							((IPropertySourceExtension) source).removeProperty(entry.getDisplayName());
 						}
 					}
 				}
 			}
+			if (needsRefresh) {
+				refresh();
+			}
 		}
 	}
 
@@ -147,7 +150,12 @@
 		if (_DEBUG) {
 			_DEBUG_TIME = System.currentTimeMillis();
 		}
-		if (getControl() != null && getControl().isVisible() && !getControl().isFocusControl()) {
+		// skip if we're the source of this selection
+		if (part != null && part instanceof PageBookView) {
+			if (((PageBookView) part).getCurrentPage() == this)
+				return;
+		}
+		if (getControl() != null && getControl().isVisible()) {
 			ISelection preferredSelection = getConfiguration().getInputSelection(part, selection);
 			/*
 			 * Do some minor caching of the selection.
@@ -195,20 +203,5 @@
 
 	public void setFocus() {
 		super.setFocus();
-
-		IWorkbenchWindow workbenchWindow = getSite().getWorkbenchWindow();
-		IWorkbenchPage activePage = workbenchWindow.getActivePage();
-		if (activePage != null) {
-			IEditorPart activeEditor = activePage.getActiveEditor();
-			if (activeEditor != null) {
-				IEditorSite editorSite = activeEditor.getEditorSite();
-				if (editorSite != null) {
-					ISelectionProvider selectionProvider = editorSite.getSelectionProvider();
-					if (selectionProvider != null) {
-						selectionChanged(activeEditor, selectionProvider.getSelection());
-					}
-				}
-			}
-		}
 	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ShowPropertiesAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ShowPropertiesAction.java
index 1b87e0b..38b0551 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ShowPropertiesAction.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ShowPropertiesAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,8 +12,15 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal.properties;
 
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
 import org.eclipse.wst.sse.ui.internal.ShowViewAction;
 import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImageHelper;
 import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImages;
@@ -21,18 +28,42 @@
 
 /**
  * Surfaces the Properties view
- * 
- * @author Nitin Dahyabhai
  */
 public class ShowPropertiesAction extends ShowViewAction {
 	private final static String VIEW_ID = "org.eclipse.ui.views.PropertySheet"; //$NON-NLS-1$
+	private ISelectionProvider fSelectionProvider;
+	private IWorkbenchPart fPart;
 
 	public ShowPropertiesAction() {
 		super(SSEUIMessages.ShowPropertiesAction_0, EditorPluginImageHelper.getInstance().getImageDescriptor(EditorPluginImages.IMG_OBJ_PROP_PS)); //$NON-NLS-1$
 		PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IHelpContextIds.CONTMNU_PROPERTIES_HELPID);
 	}
 
+	public ShowPropertiesAction(IWorkbenchPart part, ISelectionProvider provider) {
+		this();
+		fSelectionProvider = provider;
+		fPart = part;
+	}
+
 	protected String getViewID() {
 		return VIEW_ID;
 	}
+
+	public void run() {
+		super.run();
+
+		if (fSelectionProvider != null) {
+			IWorkbenchWindow window = SSEUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
+			IWorkbenchPage page = window.getActivePage();
+			if (page != null) {
+				IViewPart findView = page.findView(getViewID());
+				if (findView instanceof ISelectionListener && fPart != null) {
+					((ISelectionListener) findView).selectionChanged(fPart, fSelectionProvider.getSelection());
+				}
+				else {
+					findView.getViewSite().getSelectionProvider().setSelection(fSelectionProvider.getSelection());
+				}
+			}
+		}
+	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/AbstractLineStyleProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/AbstractLineStyleProvider.java
index 9f835f1..2b80125 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/AbstractLineStyleProvider.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/AbstractLineStyleProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.text.ITypedRegion;
 import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.source.ISourceViewer;
 import org.eclipse.jface.util.IPropertyChangeListener;
 import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.swt.SWT;
@@ -46,12 +47,15 @@
 		}
 	}
 
-	private IStructuredDocument fDocument;
-	private Highlighter fHighlighter;
+	protected IStructuredDocument fDocument;
+	protected Highlighter fHighlighter;
 	private boolean fInitialized;
-	private PropertyChangeListener fPreferenceListener = new PropertyChangeListener();
+	protected PropertyChangeListener fPreferenceListener = new PropertyChangeListener();
 
-	/** Contains all text attributes pretaining to this line style provider */
+	//private ISourceViewer fSourceViewer = null;
+	protected ReconcilerHighlighter fRecHighlighter = null;
+	
+	/** Contains all text attributes pertaining to this line style provider */
 	private HashMap fTextAttributes = null;
 
 	// we keep track of LogMessage to avoid writing hundreds of messages,
@@ -116,8 +120,15 @@
 		int start = flatNode.getStartOffset(region);
 		if (start < startOffset)
 			start = startOffset;
+		
+		// Base the text end offset off of the, possibly adjusted, start
+		int textEnd = start + region.getTextLength();
 		int maxOffset = startOffset + length;
-		int end = flatNode.getEndOffset(region); // use get length directly
+		
+		int end = flatNode.getEndOffset(region);
+		// Use the end of the text in the region to avoid applying background color to trailing whitespace
+		if(textEnd < end)
+			end = textEnd;
 		// instead of end-start?
 		if (end > maxOffset)
 			end = maxOffset;
@@ -151,6 +162,10 @@
 	protected IStructuredDocument getDocument() {
 		return fDocument;
 	}
+	
+	public void setDocument(IStructuredDocument document) {
+		fDocument = document;
+	}
 
 	/**
 	 */
@@ -175,7 +190,8 @@
 
 	protected void handlePropertyChange(PropertyChangeEvent event) {
 		// force a full update of the text viewer
-		fHighlighter.refreshDisplay();
+		if(fRecHighlighter != null)
+			fRecHighlighter.refreshDisplay();
 	}
 
 	public void init(IStructuredDocument structuredDocument, Highlighter highlighter) {
@@ -189,6 +205,22 @@
 
 		setInitialized(true);
 	}
+	
+	public void init(IStructuredDocument structuredDocument, ISourceViewer sourceViewer) {
+		init(structuredDocument, (Highlighter) null);
+	}
+	
+	public void init(IStructuredDocument structuredDocument, ReconcilerHighlighter highlighter)	{
+		fDocument = structuredDocument;
+		fRecHighlighter = highlighter;
+		
+		if(isInitialized())
+			return;
+		
+		registerPreferenceManager();
+		
+		setInitialized(true);
+	}
 
 	/**
 	 * @deprecated - left because it's public, but we aren't adapters any more
@@ -296,7 +328,8 @@
 					continue;
 
 				if (region instanceof ITextRegionCollection) {
-					handled = prepareTextRegion((ITextRegionCollection) region, partitionStartOffset, partitionLength, holdResults);
+					boolean handledCollection = (prepareTextRegion((ITextRegionCollection) region, partitionStartOffset, partitionLength, holdResults));
+					handled = (!handled) ? handledCollection : handled;
 				} else {
 
 					attr = getAttributeFor(structuredDocumentRegion, region);
@@ -337,7 +370,7 @@
 		return handled;
 	}
 
-	private void registerPreferenceManager() {
+	protected void registerPreferenceManager() {
 		IPreferenceStore pref = getColorPreferences();
 		if (pref != null) {
 			pref.addPropertyChangeListener(fPreferenceListener);
@@ -363,7 +396,7 @@
 		this.fInitialized = initialized;
 	}
 
-	private void unRegisterPreferenceManager() {
+	protected void unRegisterPreferenceManager() {
 		IPreferenceStore pref = getColorPreferences();
 		if (pref != null) {
 			pref.removePropertyChangeListener(fPreferenceListener);
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/CompatibleHighlighter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/CompatibleHighlighter.java
new file mode 100644
index 0000000..a54398b
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/CompatibleHighlighter.java
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.provisional.style;
+
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.swt.custom.LineStyleEvent;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+
+/**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=224209
+ * 
+ * Created to provide compatibility with refreshDisplay() and getTextViewer()
+ * methods on the superclass that might be called by LineStyleProviders.
+ */
+public final class CompatibleHighlighter extends Highlighter {
+
+	private ITextViewer textViewer;
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#addProvider(java.lang.String,
+	 *      org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider)
+	 */
+	public void addProvider(String partitionType, LineStyleProvider provider) {
+		super.addProvider(partitionType, provider);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#getTextViewer()
+	 */
+	public ITextViewer getTextViewer() {
+		return super.getTextViewer();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#install(org.eclipse.jface.text.ITextViewer)
+	 */
+	public void install(ITextViewer newTextViewer) {
+		textViewer = newTextViewer;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#lineGetStyle(int,
+	 *      int)
+	 */
+	public StyleRange[] lineGetStyle(int eventLineOffset, int eventLineLength) {
+		return new StyleRange[0];
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#lineGetStyle(org.eclipse.swt.custom.LineStyleEvent)
+	 */
+	public void lineGetStyle(LineStyleEvent event) {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#refreshDisplay()
+	 */
+	public void refreshDisplay() {
+		if (textViewer != null)
+			textViewer.invalidateTextPresentation();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#refreshDisplay(int,
+	 *      int)
+	 */
+	public void refreshDisplay(int start, int length) {
+		refreshDisplay();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#removeProvider(java.lang.String)
+	 */
+	public void removeProvider(String partitionType) {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#setDocument(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument)
+	 */
+	public void setDocument(IStructuredDocument structuredDocument) {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#setDocumentPartitioning(java.lang.String)
+	 */
+	public void setDocumentPartitioning(String partitioning) {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter#uninstall()
+	 */
+	public void uninstall() {
+		super.uninstall();
+		textViewer = null;
+	}
+}
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 161c21b..b47107d 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
@@ -83,7 +83,6 @@
 
 			private NormalizedRGB normalizedRGB;
 
-			RGB originalRGB;
 			private double u = -1;
 			private double v = -1;
 			private double y = -1;
@@ -101,7 +100,6 @@
 
 			public YUV(RGB rgb) {
 				this();
-				originalRGB = rgb;
 				normalizedRGB = new NormalizedRGB(rgb);
 				// force calculations
 				getY();
@@ -245,7 +243,7 @@
 
 	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$
+	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;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProvider.java
index c395324..ff81827 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProvider.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,6 +17,11 @@
 import org.eclipse.jface.text.ITypedRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 
+/**
+ * This interface is not intended to be implemented by clients. Clients
+ * should instead subclass AbstractLineStyleProvider
+ *
+ */
 public interface LineStyleProvider {
 
 	/**
@@ -30,7 +35,9 @@
 
 	/**
 	 * Optionally appends StyleRanges to the styleRanges Collection, in order,
-	 * and only covering the given range within the document.
+	 * and only covering the given range within the document. StyleRanges added
+	 * to the collection should not expand outside of the range of the currentRegion
+	 * ITypedRegion.
 	 * 
 	 * @param currentRegion -
 	 *            the current document partition
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/ReconcilerHighlighter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/ReconcilerHighlighter.java
new file mode 100644
index 0000000..1a39d4b
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/ReconcilerHighlighter.java
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.provisional.style;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
+import org.eclipse.wst.sse.ui.internal.Logger;
+
+public class ReconcilerHighlighter {
+
+	private static final String LINE_STYLE_PROVIDER_EXTENDED_ID = Highlighter.LINE_STYLE_PROVIDER_EXTENDED_ID;
+
+	private Map fTableOfProviders = null;
+
+	private Map fExtendedProviders = null;
+
+	private ITextViewer fTextViewer = null;
+
+	private final static boolean _trace = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.sse.ui/structuredPresentationReconciler")).booleanValue(); //$NON-NLS-1$
+	private final static String TRACE_PREFIX = "StructuredPresentationReconciler: "; //$NON-NLS-1$
+	private long time0;
+
+	/**
+	 * instance for older LineStyleProviders loaded by extension point,
+	 * created if needed
+	 */
+	private CompatibleHighlighter fCompatibleHighlighter = null;
+
+	public void refreshDisplay() {
+		if (_trace) {
+			time0 = System.currentTimeMillis();
+		}
+		if (fTextViewer != null)
+			fTextViewer.invalidateTextPresentation();
+		if (_trace) {
+			System.out.println(TRACE_PREFIX + "ReconcilerHighlighter refreshDisplay took " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
+			System.out.flush();
+		}
+	}
+
+	/**
+	 * Registers a given line style provider for a particular partition type.
+	 * If there is already a line style provider registered for this type, the
+	 * new line style provider is registered instead of the old one.
+	 * 
+	 * @param partitionType
+	 *            the partition type under which to register
+	 * @param the
+	 *            line style provider to register, or <code>null</code> to
+	 *            remove an existing one
+	 */
+	public void addProvider(String partitionType, LineStyleProvider provider) {
+		getTableOfProviders().put(partitionType, provider);
+	}
+
+	public void removeProvider(String partitionType) {
+		getTableOfProviders().remove(partitionType);
+	}
+
+	public LineStyleProvider getProvider(String partitionType) {
+		LineStyleProvider result = (LineStyleProvider) getTableOfProviders().get(partitionType);
+
+		// The provider was not within the default set of providers. Use the
+		// extended configuration
+		// to look up additional providers
+		if (result == null) {
+			// NOT YET FINALIZED - DO NOT CONSIDER AS API
+			synchronized (getExtendedProviders()) {
+				if (!getExtendedProviders().containsKey(partitionType)) {
+					result = (LineStyleProvider) ExtendedConfigurationBuilder.getInstance().getConfiguration(LINE_STYLE_PROVIDER_EXTENDED_ID, partitionType);
+					getExtendedProviders().put(partitionType, result);
+
+					if (result != null && fTextViewer != null && fTextViewer.getDocument() instanceof IStructuredDocument) {
+						if (result instanceof AbstractLineStyleProvider) {
+							((AbstractLineStyleProvider) result).init((IStructuredDocument) fTextViewer.getDocument(), this);
+						}
+						else {
+							Logger.log(Logger.INFO_DEBUG, "CompatibleHighlighter installing compatibility for " + result.getClass()); //$NON-NLS-1$
+							if (fCompatibleHighlighter == null) {
+								fCompatibleHighlighter = new CompatibleHighlighter();
+								fCompatibleHighlighter.install(fTextViewer);
+							}
+							result.init((IStructuredDocument) fTextViewer.getDocument(), fCompatibleHighlighter);
+						}
+					}
+				}
+				else {
+					result = (LineStyleProvider) getExtendedProviders().get(partitionType);
+				}
+			}
+		}
+		return result;
+	}
+
+	private Map getTableOfProviders() {
+		if (fTableOfProviders == null) {
+			fTableOfProviders = new HashMap();
+		}
+		return fTableOfProviders;
+	}
+
+	private Map getExtendedProviders() {
+		if (fExtendedProviders == null) {
+			fExtendedProviders = new HashMap(3);
+		}
+		return fExtendedProviders;
+	}
+
+	public void install(ITextViewer textViewer) {
+		fTextViewer = textViewer;
+		if (fCompatibleHighlighter != null) {
+			fCompatibleHighlighter.uninstall();
+			fCompatibleHighlighter.install(fTextViewer);
+		}
+		refreshDisplay();
+	}
+
+	public void uninstall() {
+		Iterator it = getTableOfProviders().values().iterator();
+
+		while (it.hasNext()) {
+			LineStyleProvider provider = (LineStyleProvider) it.next();
+			if (provider != null)
+				provider.release();
+		}
+
+		it = getExtendedProviders().values().iterator();
+		while (it.hasNext()) {
+			LineStyleProvider provider = (LineStyleProvider) it.next();
+			if (provider != null)
+				provider.release();
+		}
+
+		getTableOfProviders().clear();
+		getExtendedProviders().clear();
+		fTableOfProviders = null;
+		if (fCompatibleHighlighter != null) {
+			fCompatibleHighlighter.uninstall();
+		}
+		fTextViewer = null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/StructuredPresentationReconciler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/StructuredPresentationReconciler.java
new file mode 100644
index 0000000..1001ad5
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/StructuredPresentationReconciler.java
@@ -0,0 +1,934 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.sse.ui.internal.provisional.style;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.BadPositionCategoryException;
+import org.eclipse.jface.text.DefaultPositionUpdater;
+import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.DocumentPartitioningChangedEvent;
+import org.eclipse.jface.text.DocumentRewriteSessionEvent;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentExtension3;
+import org.eclipse.jface.text.IDocumentExtension4;
+import org.eclipse.jface.text.IDocumentListener;
+import org.eclipse.jface.text.IDocumentPartitioningListener;
+import org.eclipse.jface.text.IDocumentPartitioningListenerExtension;
+import org.eclipse.jface.text.IDocumentPartitioningListenerExtension2;
+import org.eclipse.jface.text.IDocumentRewriteSessionListener;
+import org.eclipse.jface.text.IPositionUpdater;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextInputListener;
+import org.eclipse.jface.text.ITextListener;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.ITextViewerExtension5;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.TextEvent;
+import org.eclipse.jface.text.TextPresentation;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.jface.text.TypedPosition;
+import org.eclipse.jface.text.presentation.IPresentationDamager;
+import org.eclipse.jface.text.presentation.IPresentationReconciler;
+import org.eclipse.jface.text.presentation.IPresentationReconcilerExtension;
+import org.eclipse.jface.text.presentation.IPresentationRepairer;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.wst.sse.core.internal.provisional.events.IStructuredDocumentListener;
+import org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent;
+import org.eclipse.wst.sse.core.internal.provisional.events.NoChangeEvent;
+import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
+import org.eclipse.wst.sse.core.internal.provisional.events.RegionsReplacedEvent;
+import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentRegionsReplacedEvent;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+
+public class StructuredPresentationReconciler implements IPresentationReconciler, IPresentationReconcilerExtension {
+
+	/** Prefix of the name of the position category for tracking damage regions. */
+	final static String TRACKED_PARTITION= "__reconciler_tracked_partition"; //$NON-NLS-1$
+	
+	private final static boolean _trace = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.sse.ui/structuredPresentationReconciler")).booleanValue(); //$NON-NLS-1$
+	private final static boolean _traceTime = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.sse.ui/structuredPresentationReconciler/time")).booleanValue(); //$NON-NLS-1$
+	private static final String TRACE_PREFIX = "StructuredPresentationReconciler: ";
+	private long time0;
+	private long time1;
+
+	/**
+	 * Internal listener class.
+	 */
+	class InternalListener implements
+			ITextInputListener, IDocumentListener, ITextListener, IStructuredDocumentListener,
+			IDocumentPartitioningListener, IDocumentPartitioningListenerExtension, IDocumentPartitioningListenerExtension2, IDocumentRewriteSessionListener {
+
+		/** Set to <code>true</code> if between a document about to be changed and a changed event. */
+		private boolean fDocumentChanging= false;
+		
+		/** Flag for the document being in a rewrite session */
+		private boolean fInRewriteSession = false;
+		
+		/** Flag for some kind of changes being applied during a document rewrite session */
+		private boolean fHasIncomingChanges = false;
+		
+		/**
+		 * The cached redraw state of the text viewer.
+		 * @since 3.0
+		 */
+		private boolean fCachedRedrawState= true;
+
+		public void newModel(NewDocumentEvent structuredDocumentEvent) {
+			if(fInRewriteSession) {
+				fHasIncomingChanges = true;
+				return;
+			}
+			if (_trace) {
+				time1 = System.currentTimeMillis();
+			}
+			int length = structuredDocumentEvent.getLength();
+			recordDamage(new Region(0, length), structuredDocumentEvent.getDocument());
+			if (_trace) {
+				System.out.println("\n" + TRACE_PREFIX + "calculated damage for NewDocumentEvent: (length=" + length + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+				System.out.flush();
+			}
+			if (_trace && _traceTime) {
+				System.out.println(TRACE_PREFIX + "calculated damage for NewDocumentEvent in " + (System.currentTimeMillis()-time1) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
+				System.out.flush();
+			}
+		}
+
+		public void noChange(NoChangeEvent structuredDocumentEvent) {
+			if(fInRewriteSession) {
+				fHasIncomingChanges = true;
+				return;
+			}
+			if (_trace) {
+				time1 = System.currentTimeMillis();
+			}
+			if (structuredDocumentEvent.reason == NoChangeEvent.NO_CONTENT_CHANGE ) {
+				IRegion damage = new Region(structuredDocumentEvent.fOffset, structuredDocumentEvent.fLength);
+				recordDamage(damage, structuredDocumentEvent.fDocument);
+			}
+			if (_trace && _traceTime) {
+				System.out.println("\n" + TRACE_PREFIX + "calculated damage for NoChangeEvent in " + (System.currentTimeMillis()-time1) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
+				System.out.flush();
+			}
+		}
+
+		public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent) {
+			if(fInRewriteSession) {
+				fHasIncomingChanges = true;
+				return;
+			}
+			if (_trace) {
+				time1 = System.currentTimeMillis();
+			}
+			IRegion damage;
+			IStructuredDocumentRegionList newDocumentRegions = structuredDocumentEvent.getNewStructuredDocumentRegions();
+			if (newDocumentRegions.getLength() > 0) {
+				int startOffset = newDocumentRegions.item(0).getStartOffset();
+				int length = newDocumentRegions.item(newDocumentRegions.getLength() - 1).getEndOffset() - startOffset;
+				damage = new Region(startOffset, length);
+
+			}
+			else {
+				damage = new Region(structuredDocumentEvent.fOffset, structuredDocumentEvent.getLength());
+			}
+			recordDamage(damage, structuredDocumentEvent.fDocument);
+			if (_trace) {
+				System.out.println("\n" + TRACE_PREFIX + "calculated damage for StructuredDocumentRegionsReplacedEvent: [" + damage.getOffset() + ":" + damage.getLength() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
+				System.out.flush();
+			}
+			if (_trace && _traceTime) {
+				System.out.println(TRACE_PREFIX + "calculated damage for StructuredDocumentRegionsReplacedEvent in " + (System.currentTimeMillis()-time1) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
+				System.out.flush();
+			}
+		}
+
+		public void regionChanged(RegionChangedEvent structuredDocumentEvent) {
+			if(fInRewriteSession) {
+				fHasIncomingChanges = true;
+				return;
+			}
+			if (_trace) {
+				time1 = System.currentTimeMillis();
+			}
+			IStructuredDocumentRegion documentRegion = structuredDocumentEvent.getStructuredDocumentRegion();
+			ITextRegion changedRegion = structuredDocumentEvent.getRegion();
+			int startOffset = documentRegion.getStartOffset(changedRegion);
+			int length = changedRegion.getLength();
+			IRegion damage = new Region(startOffset, length);
+
+			recordDamage(damage, structuredDocumentEvent.fDocument);
+			if (_trace) {
+				System.out.println("\n" + TRACE_PREFIX + "calculated damage for RegionChangedEvent: [" + damage.getOffset() + ":" + damage.getLength() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
+				System.out.flush();
+			}
+			if (_trace && _traceTime) {
+				System.out.println(TRACE_PREFIX + "calculated damage for RegionChangedEvent in " + (System.currentTimeMillis()-time1) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
+				System.out.flush();
+			}
+		}
+
+		public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent) {
+			if(fInRewriteSession) {
+				fHasIncomingChanges = true;
+				return;
+			}
+			if (_trace) {
+				time1 = System.currentTimeMillis();
+			}
+			IRegion damage;
+			IStructuredDocumentRegion documentRegion = structuredDocumentEvent.getStructuredDocumentRegion();
+			ITextRegionList newRegions = structuredDocumentEvent.getNewRegions();
+			if (newRegions.size() > 0) {
+				ITextRegion firstChangedRegion = newRegions.get(0);
+				ITextRegion lastChangedRegion = newRegions.get(newRegions.size() - 1);
+				int startOffset = documentRegion.getStartOffset(firstChangedRegion);
+				int length = documentRegion.getEndOffset(lastChangedRegion) - startOffset;
+				damage = new Region(startOffset, length);
+			}
+			else {
+				damage = new Region(documentRegion.getStartOffset(), documentRegion.getLength());
+			}
+			recordDamage(damage, structuredDocumentEvent.fDocument);
+			if (_trace) {
+				System.out.println("\n" + TRACE_PREFIX + "calculated damage for RegionsReplacedEvent: [" + damage.getOffset() + ":" + damage.getLength() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
+				System.out.flush();
+			}
+			if (_trace && _traceTime) {
+				System.out.println(TRACE_PREFIX + "calculated damage for RegionsReplacedEvent in " + (System.currentTimeMillis()-time1) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
+				System.out.flush();
+			}
+		}
+		
+		/*
+		 * @see ITextInputListener#inputDocumentAboutToBeChanged(IDocument, IDocument)
+		 */
+		public void inputDocumentAboutToBeChanged(IDocument oldDocument, IDocument newDocument) {
+			if (oldDocument != null) {
+				try {
+
+					fViewer.removeTextListener(this);
+					oldDocument.removeDocumentListener(this);
+					oldDocument.removeDocumentPartitioningListener(this);
+					if (oldDocument instanceof IStructuredDocument) {
+						((IStructuredDocument) oldDocument).removeDocumentChangedListener(this);
+					}
+
+					oldDocument.removePositionUpdater(fPositionUpdater);
+					oldDocument.removePositionCategory(fPositionCategory);
+
+				} catch (BadPositionCategoryException x) {
+					// should not happened for former input documents;
+				}
+			}
+		}
+
+		/*
+		 * @see ITextInputListener#inputDocumenChanged(IDocument, IDocument)
+		 */
+		public void inputDocumentChanged(IDocument oldDocument, IDocument newDocument) {
+			if (_trace || _traceTime) {
+				time1 = System.currentTimeMillis();
+			}
+
+			fDocumentChanging= false;
+			fCachedRedrawState= true;
+
+			if (newDocument != null) {
+				newDocument.addPositionCategory(fPositionCategory);
+				newDocument.addPositionUpdater(fPositionUpdater);
+
+				if (newDocument instanceof IStructuredDocument) {
+					newDocument.addDocumentPartitioningListener(this);
+					newDocument.addDocumentListener(this);
+					((IStructuredDocument)newDocument).addDocumentChangedListener(this);
+				}
+				fViewer.addTextListener(this);
+
+				if (newDocument instanceof IStructuredDocument) {
+					setDocumentToDamagers(newDocument);
+					setDocumentToRepairers(newDocument);
+					processDamage(new Region(0, newDocument.getLength()), newDocument);
+				}
+			}
+			if (_trace) {
+				System.out.println(TRACE_PREFIX + "processed damage for inputDocumentChanged in " + (System.currentTimeMillis() - time1) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
+			}
+		}
+
+		/*
+		 * @see IDocumentPartitioningListener#documentPartitioningChanged(IDocument)
+		 */
+		public void documentPartitioningChanged(IDocument document) {
+			if (_traceTime) {
+				time0 = System.currentTimeMillis();
+			}
+			if (!fDocumentChanging && fCachedRedrawState)
+				processDamage(new Region(0, document.getLength()), document);
+			else
+				fDocumentPartitioningChanged= true;
+			if (_trace) {
+				System.out.println(TRACE_PREFIX + "processed damage for documentPartitioningChanged [full document]"); //$NON-NLS-1$
+			}
+			if (_trace && _traceTime) {
+				System.out.println(TRACE_PREFIX + "processed damage for documentPartitioningChanged in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
+			}
+		}
+
+		/*
+		 * @see IDocumentPartitioningListenerExtension#documentPartitioningChanged(IDocument, IRegion)
+		 * @since 2.0
+		 */
+		public void documentPartitioningChanged(IDocument document, IRegion changedRegion) {
+			if (_traceTime) {
+				time0 = System.currentTimeMillis();
+			}
+			if (!fDocumentChanging && fCachedRedrawState) {
+				processDamage(new Region(changedRegion.getOffset(), changedRegion.getLength()), document);
+			} else {
+				fDocumentPartitioningChanged= true;
+				fChangedDocumentPartitions= changedRegion;
+			}
+			if (_trace) {
+				System.out.println(TRACE_PREFIX + "processed damage for documentPartitioningChanged [" + changedRegion.getOffset() + ":" + changedRegion.getLength() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			}
+			if (_trace && _traceTime) {
+				System.out.println(TRACE_PREFIX + "processed damage for documentPartitioningChanged in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
+			}
+		}
+
+		/*
+		 * @see org.eclipse.jface.text.IDocumentPartitioningListenerExtension2#documentPartitioningChanged(org.eclipse.jface.text.DocumentPartitioningChangedEvent)
+		 * @since 3.0
+		 */
+		public void documentPartitioningChanged(DocumentPartitioningChangedEvent event) {
+			IRegion changedRegion= event.getChangedRegion(getDocumentPartitioning());
+			if (changedRegion != null)
+				documentPartitioningChanged(event.getDocument(), changedRegion);
+		}
+
+		/*
+		 * @see IDocumentListener#documentAboutToBeChanged(DocumentEvent)
+		 */
+		public void documentAboutToBeChanged(DocumentEvent e) {
+
+			fDocumentChanging= true;
+			if (fCachedRedrawState) {
+				try {
+					int offset= e.getOffset() + e.getLength();
+					ITypedRegion region= getPartition(e.getDocument(), offset);
+					fRememberedPosition= new TypedPosition(region);
+					e.getDocument().addPosition(fPositionCategory, fRememberedPosition);
+				} catch (BadLocationException x) {
+					// can not happen
+				} catch (BadPositionCategoryException x) {
+					// should not happen on input elements
+				}
+			}
+		}
+
+		/*
+		 * @see IDocumentListener#documentChanged(DocumentEvent)
+		 */
+		public void documentChanged(DocumentEvent e) {
+			if (fCachedRedrawState) {
+				try {
+					e.getDocument().removePosition(fPositionCategory, fRememberedPosition);
+				} catch (BadPositionCategoryException x) {
+					// can not happen on input documents
+				}
+			}
+			fDocumentChanging= false;
+		}
+
+		/*
+		 * @see ITextListener#textChanged(TextEvent)
+		 */
+		public void textChanged(TextEvent e) {
+			if(fInRewriteSession) {
+				fHasIncomingChanges = true;
+				return;
+			}
+			fCachedRedrawState= e.getViewerRedrawState();
+	 		if (!fCachedRedrawState) {
+				if (_trace) {
+					System.out.println("\n" + TRACE_PREFIX + "returned early from textChanged(TextEvent)"); //$NON-NLS-1$	 //$NON-NLS-2$	
+				}
+				return;
+			}
+			if (_trace) {
+				System.out.println("\n" + TRACE_PREFIX + "entering textChanged(TextEvent)"); //$NON-NLS-1$ //$NON-NLS-2$
+				time0 = System.currentTimeMillis();
+			}
+
+	 		IRegion damage= null;
+	 		IDocument document= null;
+
+		 	if (e.getDocumentEvent() == null) {
+		 		document= fViewer.getDocument();
+		 		if (document != null)  {
+			 		if (e.getOffset() == 0 && e.getLength() == 0 && e.getText() == null) {
+						// redraw state change, damage the whole document
+						damage= new Region(0, document.getLength());
+			 		} else {
+						IRegion region= widgetRegion2ModelRegion(e);
+						try {
+							String text= document.get(region.getOffset(), region.getLength());
+							DocumentEvent de= new DocumentEvent(document, region.getOffset(), region.getLength(), text);
+							damage= getDamage(de, false);
+						} catch (BadLocationException x) {
+							/* ignored in platform PresentationReconciler, too */
+						}
+			 		}
+		 		}
+		 	} else  {
+		 		DocumentEvent de= e.getDocumentEvent();
+		 		document= de.getDocument();
+		 		damage= getDamage(de, true);
+		 	}
+			if(_trace && _traceTime) {
+				System.out.println(TRACE_PREFIX + "calculated simple text damage at " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
+				System.out.flush();
+			}
+			
+			boolean damageOverlaps = processRecordedDamages(damage, document);
+			if(_trace && _traceTime) {
+				System.out.println(TRACE_PREFIX + "processed recorded structured text damage at " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
+			}
+
+			if (damage != null && document != null && !damageOverlaps) {
+				processDamage(damage, document);
+				if(_trace && _traceTime) {
+					System.out.println(TRACE_PREFIX + "processed simple text damage at " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
+					System.out.flush();
+				}
+			}
+
+			fDocumentPartitioningChanged= false;
+			fChangedDocumentPartitions= null;
+			if(_trace) {
+				System.out.println(TRACE_PREFIX + "finished textChanged(TextEvent) in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
+			}
+		}
+
+		/**
+		 * Translates the given text event into the corresponding range of the viewer's document.
+		 *
+		 * @param e the text event
+		 * @return the widget region corresponding the region of the given event
+		 * @since 2.1
+		 */
+		protected IRegion widgetRegion2ModelRegion(TextEvent e) {
+
+			String text= e.getText();
+			int length= text == null ? 0 : text.length();
+
+			if (fViewer instanceof ITextViewerExtension5) {
+				ITextViewerExtension5 extension= (ITextViewerExtension5) fViewer;
+				return extension.widgetRange2ModelRange(new Region(e.getOffset(), length));
+			}
+
+			IRegion visible= fViewer.getVisibleRegion();
+			IRegion region= new Region(e.getOffset() + visible.getOffset(), length);
+			return region;
+		}
+
+		public void documentRewriteSessionChanged(DocumentRewriteSessionEvent event) {
+			fInRewriteSession = (event != null && event.fChangeType == DocumentRewriteSessionEvent.SESSION_START);
+			if(!fInRewriteSession && fHasIncomingChanges && event != null) {
+				if (_trace)
+					time0 = System.currentTimeMillis();
+				processDamage(new Region(0, event.fDocument.getLength()), event.fDocument);
+				if(_trace && _traceTime)
+					System.out.println(TRACE_PREFIX + " processed damaged after ending document rewrite session at " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
+				fHasIncomingChanges = false;
+			}
+		}
+
+	}
+	
+	private static class RecordedDamage {
+		IRegion damage; 
+		IDocument document;
+		RecordedDamage(IRegion damage, IDocument document) {
+			this.damage = damage;
+			this.document = document;
+		}
+	}
+
+	/** The map of presentation damagers. */
+	private Map fDamagers;
+	/** The map of presentation repairers. */
+	private Map fRepairers;
+	/** The target viewer. */
+	private ITextViewer fViewer;
+	/** The internal listener. */
+	private InternalListener fInternalListener= new InternalListener();
+	/** The name of the position category to track damage regions. */
+	private String fPositionCategory;
+	/** The position updated for the damage regions' position category. */
+	private IPositionUpdater fPositionUpdater;
+	/** The positions representing the damage regions. */
+	private TypedPosition fRememberedPosition;
+	/** Flag indicating the receipt of a partitioning changed notification. */
+	private boolean fDocumentPartitioningChanged= false;
+	/** The range covering the changed partitioning. */
+	private IRegion fChangedDocumentPartitions= null;
+	
+	/**
+	 * Because structured document events fire before textChanged(), it's
+	 * possible the widget isn't fully aware of the changes to its contents.
+	 * "Record" the damage to process after textChanged() has been fired.
+	 */
+	private List fRecordedDamages = new ArrayList(2);
+	
+	/**
+	 * The partitioning used by this presentation reconciler.
+	 * @since 3.0
+	 */
+	private String fPartitioning;
+
+	private IDocument fLastDocument;
+	
+	/**
+	 * Creates a new presentation reconciler. There are no damagers or repairers
+	 * registered with this reconciler by default. The default partitioning
+	 * <code>IDocumentExtension3.DEFAULT_PARTITIONING</code> is used.
+	 */
+	public StructuredPresentationReconciler() {
+		super();
+		fPartitioning= IDocumentExtension3.DEFAULT_PARTITIONING;
+		fPositionCategory= TRACKED_PARTITION + hashCode();
+		fPositionUpdater= new DefaultPositionUpdater(fPositionCategory);
+	}
+
+	/**
+	 * Sets the document partitioning for this presentation reconciler.
+	 *
+	 * @param partitioning the document partitioning for this presentation reconciler.
+	 * @since 3.0
+	 */
+	public void setDocumentPartitioning(String partitioning) {
+		Assert.isNotNull(partitioning);
+		fPartitioning= partitioning;
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.presentation.IPresentationReconcilerExtension#geDocumenttPartitioning()
+	 * @since 3.0
+	 */
+	public String getDocumentPartitioning() {
+		return fPartitioning;
+	}
+
+	/**
+	 * Registers the given presentation damager for a particular content type.
+	 * If there is already a damager registered for this type, the old damager
+	 * is removed first.
+	 *
+	 * @param damager the presentation damager to register, or <code>null</code> to remove an existing one
+	 * @param contentType the content type under which to register
+	 */
+	public void setDamager(IPresentationDamager damager, String contentType) {
+
+		Assert.isNotNull(contentType);
+
+		if (fDamagers == null)
+			fDamagers= new HashMap();
+
+		if (damager == null)
+			fDamagers.remove(contentType);
+		else
+			fDamagers.put(contentType, damager);
+	}
+
+	/**
+	 * Registers the given presentation repairer for a particular content type.
+	 * If there is already a repairer registered for this type, the old repairer
+	 * is removed first.
+	 *
+	 * @param repairer the presentation repairer to register, or <code>null</code> to remove an existing one
+	 * @param contentType the content type under which to register
+	 */
+	public void setRepairer(IPresentationRepairer repairer, String contentType) {
+
+		Assert.isNotNull(contentType);
+
+		if (fRepairers == null)
+			fRepairers= new HashMap();
+
+		if (repairer == null)
+			fRepairers.remove(contentType);
+		else
+			fRepairers.put(contentType, repairer);
+	}
+
+	/*
+	 * @see IPresentationReconciler#install(ITextViewer)
+	 */
+	public void install(ITextViewer viewer) {
+		if(_trace) {
+			time0 = System.currentTimeMillis();
+		}
+		Assert.isNotNull(viewer);
+
+		fViewer= viewer;
+		fViewer.addTextInputListener(fInternalListener);
+		
+		IDocument document= viewer.getDocument();
+		if (document != null) {
+			fInternalListener.inputDocumentChanged(null, document);
+			if(document instanceof IStructuredDocument) {
+				((IStructuredDocument) document).addDocumentChangedListener(fInternalListener);
+			}
+			if(document instanceof IDocumentExtension4) {
+				((IDocumentExtension4) document).addDocumentRewriteSessionListener(fInternalListener);
+			}
+		}
+		if(_trace) {
+			System.out.println(TRACE_PREFIX + "installed to text viewer in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+	}
+
+	/*
+	 * @see IPresentationReconciler#uninstall()
+	 */
+	public void uninstall() {
+		if(_trace) {
+			time0 = System.currentTimeMillis();
+		}
+		fViewer.removeTextInputListener(fInternalListener);
+
+		IDocument document = null;
+		if(( document = fViewer.getDocument()) instanceof IStructuredDocument) {
+			((IStructuredDocument) document).removeDocumentChangedListener(fInternalListener);
+		}
+		if(document instanceof IDocumentExtension4) {
+			((IDocumentExtension4) document).removeDocumentRewriteSessionListener(fInternalListener);
+		}
+		// Ensure we uninstall all listeners
+		fInternalListener.inputDocumentAboutToBeChanged(fViewer.getDocument(), null);
+		if(_trace) {
+			System.out.println(TRACE_PREFIX + "uninstalled from text viewer in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+	}
+
+	/*
+	 * @see IPresentationReconciler#getDamager(String)
+	 */
+	public IPresentationDamager getDamager(String contentType) {
+
+		if (fDamagers == null)
+			return null;
+
+		return (IPresentationDamager) fDamagers.get(contentType);
+	}
+
+	/*
+	 * @see IPresentationReconciler#getRepairer(String)
+	 */
+	public IPresentationRepairer getRepairer(String contentType) {
+
+		if (fRepairers == null)
+			return null;
+
+		return (IPresentationRepairer) fRepairers.get(contentType);
+	}
+
+	/**
+	 * Informs all registered damagers about the document on which they will work.
+	 *
+	 * @param document the document on which to work
+	 */
+	protected void setDocumentToDamagers(IDocument document) {
+		if (fDamagers != null) {
+			Iterator e= fDamagers.values().iterator();
+			while (e.hasNext()) {
+				IPresentationDamager damager= (IPresentationDamager) e.next();
+				damager.setDocument(document);
+			}
+		}
+	}
+
+	/**
+	 * Informs all registered repairers about the document on which they will work.
+	 *
+	 * @param document the document on which to work
+	 */
+	protected void setDocumentToRepairers(IDocument document) {
+		if (fRepairers != null) {
+			Iterator e= fRepairers.values().iterator();
+			while (e.hasNext()) {
+				IPresentationRepairer repairer= (IPresentationRepairer) e.next();
+				repairer.setDocument(document);
+			}
+		}
+	}
+
+	/**
+	 * Constructs a "repair description" for the given damage and returns this
+	 * description as a text presentation. For this, it queries the partitioning
+	 * of the damage region and asks the appropriate presentation repairer for
+	 * each partition to construct the "repair description" for this partition.
+	 *
+	 * @param damage the damage to be repaired
+	 * @param document the document whose presentation must be repaired
+	 * @return the presentation repair description as text presentation or
+	 *         <code>null</code> if the partitioning could not be computed
+	 */
+	protected TextPresentation createPresentation(IRegion damage, IDocument document) {
+		try {
+			int validLength = Math.min(damage.getLength(), document.getLength() - damage.getOffset());
+			
+			if (fRepairers == null || fRepairers.isEmpty()) {
+				TextPresentation presentation= new TextPresentation(damage, 1);
+				presentation.setDefaultStyleRange(new StyleRange(damage.getOffset(), validLength, null, null));
+				return presentation;
+			}
+
+			TextPresentation presentation= new TextPresentation(damage, 1000);
+
+			ITypedRegion[] partitions= TextUtilities.computePartitioning(document, getDocumentPartitioning(), damage.getOffset(), validLength, false);
+			for (int i= 0; i < partitions.length; i++) {
+				ITypedRegion r= partitions[i];
+				IPresentationRepairer repairer= getRepairer(r.getType());
+				if (repairer != null)
+					repairer.createPresentation(presentation, r);
+			}
+
+			return presentation;
+
+		} catch (BadLocationException x) {
+			/* ignored in platform PresentationReconciler, too */
+		}
+
+		return null;
+	}
+
+
+	/**
+	 * Checks for the first and the last affected partition affected by a
+	 * document event and calls their damagers. Invalidates everything from the
+	 * start of the damage for the first partition until the end of the damage
+	 * for the last partition.
+	 *
+	 * @param e the event describing the document change
+	 * @param optimize <code>true</code> if partition changes should be
+	 *        considered for optimization
+	 * @return the damaged caused by the change or <code>null</code> if
+	 *         computing the partitioning failed
+	 * @since 3.0
+	 */
+	IRegion getDamage(DocumentEvent e, boolean optimize) {
+		int length= e.getText() == null ? 0 : e.getText().length();
+		
+		if (fDamagers == null || fDamagers.isEmpty()) {
+			length= Math.max(e.getLength(), length);
+			length= Math.min(e.getDocument().getLength() - e.getOffset(), length);
+			return new Region(e.getOffset(), length);
+		}
+
+		boolean isDeletion= length == 0;
+		IRegion damage= null;
+		try {
+			int offset= e.getOffset();
+			if (isDeletion)
+				offset= Math.max(0, offset - 1);
+			ITypedRegion partition= getPartition(e.getDocument(), offset);
+			IPresentationDamager damager= getDamager(partition.getType());
+			if (damager == null)
+				return null;
+
+			IRegion r= damager.getDamageRegion(partition, e, fDocumentPartitioningChanged);
+
+			if (!fDocumentPartitioningChanged && optimize && !isDeletion) {
+				damage= r;
+			} else {
+
+				int damageEnd= getDamageEndOffset(e);
+
+				int parititionDamageEnd= -1;
+				if (fChangedDocumentPartitions != null)
+					parititionDamageEnd= fChangedDocumentPartitions.getOffset() + fChangedDocumentPartitions.getLength();
+
+				int end= Math.max(damageEnd, parititionDamageEnd);
+
+				damage= end == -1 ? r : new Region(r.getOffset(), end - r.getOffset());
+			}
+
+		} catch (BadLocationException x) {
+			/* ignored in platform PresentationReconciler, too */
+		}
+
+		return damage;
+	}
+
+	/**
+	 * Returns the end offset of the damage. If a partition has been split by
+	 * the given document event also the second half of the original
+	 * partition must be considered. This is achieved by using the remembered
+	 * partition range.
+	 *
+	 * @param e the event describing the change
+	 * @return the damage end offset (excluding)
+	 * @exception BadLocationException if method accesses invalid offset
+	 */
+	int getDamageEndOffset(DocumentEvent e) throws BadLocationException {
+
+		IDocument d= e.getDocument();
+
+		int length= 0;
+		if (e.getText() != null) {
+			length= e.getText().length();
+			if (length > 0)
+				-- length;
+		}
+
+		ITypedRegion partition= getPartition(d, e.getOffset() + length);
+		int endOffset= partition.getOffset() + partition.getLength();
+		if (endOffset == e.getOffset())
+			return -1;
+
+		int end= fRememberedPosition == null ? -1 : fRememberedPosition.getOffset() + fRememberedPosition.getLength();
+		if (endOffset < end && end < d.getLength())
+			partition= getPartition(d, end);
+
+		//if there is not damager for the partition then use the endOffset of the partition
+		IPresentationDamager damager= getDamager(partition.getType());
+		if (damager != null) {
+			IRegion r= damager.getDamageRegion(partition, e, fDocumentPartitioningChanged);
+			endOffset = r.getOffset() + r.getLength();
+		}
+
+		return endOffset;
+	}
+	
+	void processRecordedDamages() {
+		processRecordedDamages(null, null);
+	}
+	
+	boolean processRecordedDamages(IRegion damage, IDocument document) {
+		RecordedDamage[] recordings = null;
+		boolean recordingOverlaps = false;
+		synchronized (fRecordedDamages) {
+			recordings = (RecordedDamage[]) fRecordedDamages.toArray(new RecordedDamage[fRecordedDamages.size()]);
+			fRecordedDamages.clear();
+		}
+		for (int i = 0; i < recordings.length; i++) {
+			if (isOverlappingRegion(damage, recordings[i].damage) && document == recordings[i].document)
+				recordingOverlaps = true;
+			processDamage(recordings[i].damage, recordings[i].document);
+		}
+		return recordingOverlaps;
+	}
+	
+	private boolean isOverlappingRegion(IRegion base, IRegion damage) {
+		if(base == null || damage == null)
+			return false;
+		
+		int baseEnd = base.getOffset() + base.getLength();
+		int damageEnd = damage.getOffset() + damage.getLength();
+		
+		return damage.getOffset() <= base.getOffset() && (damageEnd >= baseEnd);
+	}
+
+	/**
+	 * Processes the given damage.
+	 * @param damage the damage to be repaired
+	 * @param document the document whose presentation must be repaired
+	 */
+	void processDamage(IRegion damage, IDocument document) {
+		if (damage != null && damage.getLength() > 0) {
+			TextPresentation p = createPresentation(damage, document);
+			if (p != null) {
+				/**
+				 * 229749 - Read-Only highlighting support missing
+				 * 272981 - Read-only highlighting moved to semantic highlighting
+				 */
+				applyTextRegionCollection(p);
+			}
+		}
+	}
+
+	/**
+	 * Processes the given damage.
+	 * @param damage the damage to be repaired
+	 * @param document the document whose presentation must be repaired
+	 */
+	void recordDamage(IRegion damage, IDocument document) {
+		if (damage != null && damage.getLength() > 0) {
+			synchronized (fRecordedDamages) {
+				fRecordedDamages.add(new RecordedDamage(damage, document));
+			}
+		}
+	}
+
+	/**
+	 * Applies the given text presentation to the text viewer the presentation
+	 * reconciler is installed on.
+	 *
+	 * @param presentation the text presentation to be applied to the text viewer
+	 */
+	void applyTextRegionCollection(TextPresentation presentation) {
+		fViewer.changeTextPresentation(presentation, false);
+	}
+
+	/**
+	 * Returns the partition for the given offset in the given document.
+	 *
+	 * @param document the document
+	 * @param offset the offset
+	 * @return the partition
+	 * @throws BadLocationException if offset is invalid in the given document
+	 * @since 3.0
+	 */
+	ITypedRegion getPartition(IDocument document, int offset) throws BadLocationException {
+		return TextUtilities.getPartition(document, getDocumentPartitioning(), offset, false);
+	}
+
+	/**
+	 * Constructs a "repair description" for the given damage and returns this
+	 * description as a text presentation, essentially making
+	 * {@link #createPresentation(IRegion, IDocument)} publicly callable.
+	 * <p>
+	 * NOTE: Should not be used if this reconciler is installed on a viewer.
+	 * This method is considered EXPERIMENTAL and may not be available in
+	 * subsequent versions.
+	 * </p>
+	 * 
+	 * @param damage
+	 *            the damage to be repaired
+	 * @param document
+	 *            the document whose presentation must be repaired
+	 * @return the presentation repair description as text presentation
+	 */
+	public TextPresentation createRepairDescription(IRegion damage, IDocument document) {
+		if (document != fLastDocument) {
+			setDocumentToDamagers(document);
+			setDocumentToRepairers(document);
+			fLastDocument= document;
+		}
+		return createPresentation(damage, document);
+	}	
+
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/QuickOutlineHandler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/QuickOutlineHandler.java
new file mode 100644
index 0000000..1fa7e13
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/QuickOutlineHandler.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.quickoutline;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.text.information.IInformationPresenter;
+
+public class QuickOutlineHandler extends AbstractHandler {
+
+	IInformationPresenter fPresenter;
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+	 */
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		if (fPresenter != null)
+			fPresenter.showInformation();
+		return null;
+	}
+
+	public void configure(IInformationPresenter presenter) {
+		fPresenter = presenter;
+	}
+
+	public void dispose() {
+		super.dispose();
+		if (fPresenter != null) {
+			fPresenter.uninstall();
+			fPresenter = null;
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/QuickOutlinePopupDialog.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/QuickOutlinePopupDialog.java
new file mode 100644
index 0000000..6a2f62c
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/QuickOutlinePopupDialog.java
@@ -0,0 +1,435 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.quickoutline;
+
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.dialogs.PopupDialog;
+import org.eclipse.jface.text.IInformationControl;
+import org.eclipse.jface.text.IInformationControlExtension;
+import org.eclipse.jface.text.IInformationControlExtension2;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.ui.IContentSelectionProvider;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+import org.eclipse.wst.sse.ui.internal.quickoutline.StringPatternFilter.StringMatcher;
+import org.eclipse.wst.sse.ui.quickoutline.AbstractQuickOutlineConfiguration;
+
+/**
+ * Popup dialog that contains the filtering input and the outline
+ * view of the editor's input.
+ * 
+ * <p>
+ * Based on {@link org.eclipse.jdt.internal.ui.text.AbstractInformationControl}
+ * </p>
+ * 
+ */
+public class QuickOutlinePopupDialog extends PopupDialog implements IInformationControl, IInformationControlExtension, IInformationControlExtension2, DisposeListener {
+
+	/** Section used for storing the dialog's size and position settings */
+	private static final String DIALOG_SECTION = "org.eclipse.wst.sse.ui.quick_outline"; //$NON-NLS-1$
+
+	/** Text field for entering filter patterns */
+	private Text fFilterText;
+
+	/** Tree for presenting the information outline */
+	private TreeViewer fTreeViewer;
+
+	/** The model to be outlined */
+	private IStructuredModel fModel;
+
+	private ILabelProvider fLabelProvider;
+	private ITreeContentProvider fContentProvider;
+
+	private IContentSelectionProvider fSelectionProvider;
+
+	private StringPatternFilter fFilter;
+	
+	public QuickOutlinePopupDialog(Shell parent, int shellStyle, IStructuredModel model, AbstractQuickOutlineConfiguration configuration) {
+		super(parent, shellStyle, true, true, true, true, true, null, null);
+		fContentProvider = configuration.getContentProvider();
+		fLabelProvider = configuration.getLabelProvider();
+		fSelectionProvider = configuration.getContentSelectionProvider();
+		fModel = model;
+		create();
+	}
+
+	protected Control createDialogArea(Composite parent) {
+		createTreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL);
+		addListeners(fTreeViewer.getTree());
+
+		installFilter();
+		return fTreeViewer.getControl();
+	}
+
+	protected Control createTitleControl(Composite parent) {
+		createFilterText(parent);
+
+		return fFilterText;
+	}
+
+	protected void createTreeViewer(Composite parent, int style) {
+		Tree tree = new Tree(parent, style);
+		GridData gd = new GridData(GridData.FILL_BOTH);
+		gd.heightHint = tree.getItemHeight() * 12;
+		tree.setLayoutData(gd);
+
+		fTreeViewer = new TreeViewer(tree);
+		fTreeViewer.setContentProvider(fContentProvider);
+		fTreeViewer.setLabelProvider(fLabelProvider);
+		fTreeViewer.setAutoExpandLevel(2);
+		fTreeViewer.setUseHashlookup(true);
+		fTreeViewer.setInput(fModel);
+	}
+
+	protected void createFilterText(Composite parent) {
+		fFilterText = new Text(parent, SWT.NONE);
+		Dialog.applyDialogFont(fFilterText);
+
+		GridData data= new GridData(GridData.FILL_HORIZONTAL);
+		data.horizontalAlignment= GridData.FILL;
+		data.verticalAlignment= GridData.CENTER;
+		fFilterText.setLayoutData(data);
+		fFilterText.addKeyListener(new KeyListener() {
+			public void keyPressed(KeyEvent e) {
+				if (e.keyCode == 0x0D) // return
+					gotoSelectedElement();
+				if (e.keyCode == SWT.ARROW_DOWN)
+					fTreeViewer.getTree().setFocus();
+				if (e.keyCode == SWT.ARROW_UP)
+					fTreeViewer.getTree().setFocus();
+				if (e.character == 0x1B) // ESC
+					dispose();
+			}
+			public void keyReleased(KeyEvent e) {
+				// do nothing
+			}
+		});
+	}
+
+	protected void installFilter() {
+		fFilter = new StringPatternFilter();
+		fTreeViewer.addFilter(fFilter);
+		fFilterText.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent e) {
+				String text = ((Text) e.widget).getText();
+				int length = text.length();
+				if (length > 0 && text.charAt(length -1 ) != '*') {
+					text = text + '*';
+				}
+				setMatcherString(text, true);
+			}
+		});
+	}
+
+	protected void setMatcherString(String pattern, boolean update) {
+		fFilter.updatePattern(pattern);
+		if (update)
+			stringMatcherUpdated();
+	}
+	/**
+	 * The string matcher has been modified. The default implementation
+	 * refreshes the view and selects the first matched element
+	 */
+	protected void stringMatcherUpdated() {
+		// refresh viewer to re-filter
+		fTreeViewer.getControl().setRedraw(false);
+		fTreeViewer.refresh();
+		fTreeViewer.expandAll();
+		selectFirstMatch();
+		fTreeViewer.getControl().setRedraw(true);
+	}
+
+	private void selectFirstMatch() {
+		TreeItem item = findItem(fTreeViewer.getTree().getItems(), fFilter.getStringMatcher());
+		if (item != null) {
+			fTreeViewer.getTree().setSelection(item);
+		}
+		else {
+			fTreeViewer.setSelection(StructuredSelection.EMPTY);
+		}
+	}
+
+	private TreeItem findItem(TreeItem[] items, StringMatcher matcher) {
+		if (matcher == null)
+			return items.length > 0 ? items[0] : null;
+		int length = items.length;
+		TreeItem result = null;
+		for (int i = 0; i < length; i++) {
+			if (matcher.match(items[i].getText()))
+				return items[i];
+			if (items[i].getItemCount() > 0) {
+				result = findItem(items[i].getItems(), matcher);
+				if (result != null)
+					return result;
+			}
+				
+		}
+		return result;
+	}
+
+	protected IDialogSettings getDialogSettings() {
+		IDialogSettings settings= SSEUIPlugin.getDefault().getDialogSettings().getSection(DIALOG_SECTION);
+		if (settings == null)
+			settings = SSEUIPlugin.getDefault().getDialogSettings().addNewSection(DIALOG_SECTION);
+
+		return settings;
+	}
+
+	private void gotoSelectedElement() {
+		Object element = getSelectedElement();
+		dispose();
+		ITextEditor editor = getActiveTextEditor();
+		if (editor != null) {
+			editor.selectAndReveal(((IndexedRegion) element).getStartOffset(), ((IndexedRegion) element).getEndOffset() - ((IndexedRegion) element).getStartOffset());
+		}
+	}
+
+	private ITextEditor getActiveTextEditor() {
+		IWorkbench wb = PlatformUI.getWorkbench();
+		ITextEditor editor = null;
+		if (wb != null) {
+			IWorkbenchWindow ww = wb.getActiveWorkbenchWindow();
+			IWorkbenchPage page = ww.getActivePage();
+			if (page != null) {
+				IEditorPart part = page.getActiveEditor();
+				if (part instanceof ITextEditor)
+					editor = (ITextEditor) part;
+				else
+					editor = part != null ? (ITextEditor) part.getAdapter(ITextEditor.class) : null;
+			}
+		}
+		return editor;
+	}
+
+	private Object getSelectedElement() {
+		if (fTreeViewer == null)
+			return null;
+
+		return ((IStructuredSelection) fTreeViewer.getSelection()).getFirstElement();
+	}
+
+	private void addListeners(final Tree tree) {
+		tree.addKeyListener(new KeyListener() {
+			public void keyPressed(KeyEvent e)  {
+				if (e.character == 0x1B) // ESC
+					dispose();
+			}
+			public void keyReleased(KeyEvent e) {
+				// do nothing
+			}
+		});
+
+		tree.addSelectionListener(new SelectionListener() {
+			public void widgetSelected(SelectionEvent e) {
+				// do nothing
+			}
+			public void widgetDefaultSelected(SelectionEvent e) {
+				gotoSelectedElement();
+			}
+		});
+
+		/* Mouse hover */
+		tree.addMouseMoveListener(new MouseMoveListener()	 {
+			TreeItem fLastItem= null;
+			public void mouseMove(MouseEvent e) {
+				if (tree.equals(e.getSource())) {
+					Object o= tree.getItem(new Point(e.x, e.y));
+					if (o instanceof TreeItem) {
+						Rectangle clientArea = tree.getClientArea();
+						if (!o.equals(fLastItem)) {
+							fLastItem= (TreeItem)o;
+							tree.setSelection(new TreeItem[] { fLastItem });
+						} else if (e.y - clientArea.y < tree.getItemHeight() / 4) {
+							// Scroll up
+							Point p= tree.toDisplay(e.x, e.y);
+							Item item= fTreeViewer.scrollUp(p.x, p.y);
+							if (item instanceof TreeItem) {
+								fLastItem= (TreeItem)item;
+								tree.setSelection(new TreeItem[] { fLastItem });
+							}
+						} else if (clientArea.y + clientArea.height - e.y < tree.getItemHeight() / 4) {
+							// Scroll down
+							Point p= tree.toDisplay(e.x, e.y);
+							Item item= fTreeViewer.scrollDown(p.x, p.y);
+							if (item instanceof TreeItem) {
+								fLastItem= (TreeItem)item;
+								tree.setSelection(new TreeItem[] { fLastItem });
+							}
+						}
+					}
+				}
+			}
+		});
+
+		tree.addMouseListener(new MouseAdapter() {
+			public void mouseUp(MouseEvent e) {
+
+				if (tree.getSelectionCount() < 1)
+					return;
+
+				if (e.button != 1)
+					return;
+
+				if (tree.equals(e.getSource())) {
+					Object o= tree.getItem(new Point(e.x, e.y));
+					TreeItem selection= tree.getSelection()[0];
+					if (selection.equals(o))
+						gotoSelectedElement();
+				}
+			}
+		});
+	}
+	public void addDisposeListener(DisposeListener listener) {
+		getShell().addDisposeListener(listener);
+	}
+
+	public void addFocusListener(FocusListener listener) {
+		getShell().addFocusListener(listener);
+	}
+
+	public Point computeSizeHint() {
+		return getShell().getSize();
+	}
+
+	public void dispose() {
+		close();
+	}
+
+	public boolean isFocusControl() {
+		return getShell().getDisplay().getActiveShell() == getShell();
+	}
+
+	public void removeDisposeListener(DisposeListener listener) {
+		getShell().removeDisposeListener(listener);
+	}
+
+	public void removeFocusListener(FocusListener listener) {
+		getShell().removeFocusListener(listener);
+	}
+
+	public void setBackgroundColor(Color background) {
+		applyBackgroundColor(background, getContents());
+	}
+
+	public void setFocus() {
+		getShell().forceFocus();
+		fFilterText.setFocus();
+	}
+
+	public void setForegroundColor(Color foreground) {
+		applyForegroundColor(foreground, getContents());
+	}
+
+	public void setInformation(String information) {
+		// nothing to do
+	}
+
+	public void setLocation(Point location) {
+		/*
+		 * If the location is persisted, it gets managed by PopupDialog - fine. Otherwise, the location is
+		 * computed in Window#getInitialLocation, which will center it in the parent shell / main
+		 * monitor, which is wrong for two reasons:
+		 * - we want to center over the editor / subject control, not the parent shell
+		 * - the center is computed via the initalSize, which may be also wrong since the size may
+		 *   have been updated since via min/max sizing of AbstractInformationControlManager.
+		 * In that case, override the location with the one computed by the manager. Note that
+		 * the call to constrainShellSize in PopupDialog.open will still ensure that the shell is
+		 * entirely visible.
+		 */
+		if (!getPersistLocation() || getDialogSettings() == null)
+			getShell().setLocation(location);
+	}
+
+	public void setSize(int width, int height) {
+		getShell().setSize(width, height);
+	}
+
+	public void setSizeConstraints(int maxWidth, int maxHeight) {
+	}
+
+	public void setVisible(boolean visible) {
+		if (visible) {
+			open();
+		} else {
+			saveDialogBounds(getShell());
+			getShell().setVisible(false);
+		}
+	}
+
+	public boolean hasContents() {
+		return fTreeViewer != null && fTreeViewer.getInput() != null;
+	}
+
+	public void setInput(Object input) {
+		if (!(input instanceof ISelection)) {
+			fTreeViewer.setSelection(new StructuredSelection(input));
+		}
+		else {
+			if (fSelectionProvider != null) {
+				ISelection selection = fSelectionProvider.getSelection(fTreeViewer, (ISelection) input);
+				fTreeViewer.setSelection(selection);
+			}
+			else {
+				fTreeViewer.setSelection((ISelection) input);
+			}
+		}
+	}
+
+	public void widgetDisposed(DisposeEvent e) {
+		fTreeViewer = null;
+		fFilterText = null;
+		fModel = null;
+	}
+
+	protected void fillDialogMenu(IMenuManager dialogMenu) {
+		// Add custom actions
+		super.fillDialogMenu(dialogMenu);
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/StringPatternFilter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/StringPatternFilter.java
new file mode 100644
index 0000000..86c19f2
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/StringPatternFilter.java
@@ -0,0 +1,508 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.quickoutline;
+
+import java.util.Vector;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.osgi.util.TextProcessor;
+
+/**
+ * Default Viewer Filter to be used by the {@link QuickOutlinePopupDialog}
+ * <p>
+ * Based on {@link org.eclipse.jdt.internal.ui.text.AbstractInformationControl.NamePatternFilter}
+ * </p>
+ */
+public class StringPatternFilter extends ViewerFilter {
+
+	private StringMatcher fStringMatcher;
+
+	/*
+	 * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+	 */
+	public boolean select(Viewer viewer, Object parentElement, Object element) {
+		StringMatcher matcher = fStringMatcher;
+		if (matcher == null || !(viewer instanceof TreeViewer))
+			return true;
+		TreeViewer treeViewer = (TreeViewer) viewer;
+
+		String matchName = ((ILabelProvider) treeViewer.getLabelProvider()).getText(element);
+		matchName = TextProcessor.deprocess(matchName);
+		if (matchName != null && matcher.match(matchName))
+			return true;
+
+		return hasUnfilteredChild(treeViewer, element);
+	}
+
+	private boolean hasUnfilteredChild(TreeViewer viewer, Object element) {
+		Object[] children=  ((ITreeContentProvider) viewer.getContentProvider()).getChildren(element);
+		for (int i= 0; i < children.length; i++)
+			if (select(viewer, element, children[i]))
+				return true;
+		return false;
+	}
+
+	public void updatePattern(String pattern) {
+		if (pattern.length() == 0) {
+			fStringMatcher = null;
+		}
+		else {
+			fStringMatcher = new StringMatcher(pattern, pattern.toLowerCase().equals(pattern), false);
+		}
+		
+	}
+
+	public StringMatcher getStringMatcher() {
+		return fStringMatcher;
+	}
+
+	/**
+	 * String matcher based on {@link org.eclipse.ui.internal.misc.StringMatcher}
+	 */
+	static class StringMatcher {
+		protected String fPattern;
+
+	    protected int fLength; // pattern length
+
+	    protected boolean fIgnoreWildCards;
+
+	    protected boolean fIgnoreCase;
+
+	    protected boolean fHasLeadingStar;
+
+	    protected boolean fHasTrailingStar;
+
+	    protected String fSegments[]; //the given pattern is split into * separated segments
+
+	    /* boundary value beyond which we don't need to search in the text */
+	    protected int fBound = 0;
+
+	    protected static final char fSingleWildCard = '\u0000';
+
+	    public static class Position {
+	        int start; //inclusive
+
+	        int end; //exclusive
+
+	        public Position(int start, int end) {
+	            this.start = start;
+	            this.end = end;
+	        }
+
+	        public int getStart() {
+	            return start;
+	        }
+
+	        public int getEnd() {
+	            return end;
+	        }
+	    }
+
+	    /**
+	     * StringMatcher constructor takes in a String object that is a simple 
+	     * pattern which may contain '*' for 0 and many characters and
+	     * '?' for exactly one character.  
+	     *
+	     * Literal '*' and '?' characters must be escaped in the pattern 
+	     * e.g., "\*" means literal "*", etc.
+	     *
+	     * Escaping any other character (including the escape character itself), 
+	     * just results in that character in the pattern.
+	     * e.g., "\a" means "a" and "\\" means "\"
+	     *
+	     * If invoking the StringMatcher with string literals in Java, don't forget
+	     * escape characters are represented by "\\".
+	     *
+	     * @param pattern the pattern to match text against
+	     * @param ignoreCase if true, case is ignored
+	     * @param ignoreWildCards if true, wild cards and their escape sequences are ignored
+	     * 		  (everything is taken literally).
+	     */
+	    public StringMatcher(String pattern, boolean ignoreCase,
+	            boolean ignoreWildCards) {
+	        if (pattern == null) {
+				throw new IllegalArgumentException();
+			}
+	        fIgnoreCase = ignoreCase;
+	        fIgnoreWildCards = ignoreWildCards;
+	        fPattern = pattern;
+	        fLength = pattern.length();
+
+	        if (fIgnoreWildCards) {
+	            parseNoWildCards();
+	        } else {
+	            parseWildCards();
+	        }
+	    }
+
+	    /**
+	     * Find the first occurrence of the pattern between <code>start</code)(inclusive) 
+	     * and <code>end</code>(exclusive).  
+	     * @param text the String object to search in 
+	     * @param start the starting index of the search range, inclusive
+	     * @param end the ending index of the search range, exclusive
+	     * @return an <code>StringMatcher.Position</code> object that keeps the starting 
+	     * (inclusive) and ending positions (exclusive) of the first occurrence of the 
+	     * pattern in the specified range of the text; return null if not found or subtext
+	     * is empty (start==end). A pair of zeros is returned if pattern is empty string
+	     * Note that for pattern like "*abc*" with leading and trailing stars, position of "abc"
+	     * is returned. For a pattern like"*??*" in text "abcdf", (1,3) is returned
+	     */
+	    public StringMatcher.Position find(String text, int start, int end) {
+	        if (text == null) {
+				throw new IllegalArgumentException();
+			}
+
+	        int tlen = text.length();
+	        if (start < 0) {
+				start = 0;
+			}
+	        if (end > tlen) {
+				end = tlen;
+			}
+	        if (end < 0 || start >= end) {
+				return null;
+			}
+	        if (fLength == 0) {
+				return new Position(start, start);
+			}
+	        if (fIgnoreWildCards) {
+	            int x = posIn(text, start, end);
+	            if (x < 0) {
+					return null;
+				}
+	            return new Position(x, x + fLength);
+	        }
+
+	        int segCount = fSegments.length;
+	        if (segCount == 0) {
+				return new Position(start, end);
+			}
+
+	        int curPos = start;
+	        int matchStart = -1;
+	        int i;
+	        for (i = 0; i < segCount && curPos < end; ++i) {
+	            String current = fSegments[i];
+	            int nextMatch = regExpPosIn(text, curPos, end, current);
+	            if (nextMatch < 0) {
+					return null;
+				}
+	            if (i == 0) {
+					matchStart = nextMatch;
+				}
+	            curPos = nextMatch + current.length();
+	        }
+	        if (i < segCount) {
+				return null;
+			}
+	        return new Position(matchStart, curPos);
+	    }
+
+	    /**
+	     * match the given <code>text</code> with the pattern 
+	     * @return true if matched otherwise false
+	     * @param text a String object 
+	     */
+	    public boolean match(String text) {
+	    	if(text == null) {
+				return false;
+			}
+	        return match(text, 0, text.length());
+	    }
+
+	    /**
+	     * Given the starting (inclusive) and the ending (exclusive) positions in the   
+	     * <code>text</code>, determine if the given substring matches with aPattern  
+	     * @return true if the specified portion of the text matches the pattern
+	     * @param text a String object that contains the substring to match 
+	     * @param start marks the starting position (inclusive) of the substring
+	     * @param end marks the ending index (exclusive) of the substring 
+	     */
+	    public boolean match(String text, int start, int end) {
+	        if (null == text) {
+				throw new IllegalArgumentException();
+			}
+
+	        if (start > end) {
+				return false;
+			}
+
+	        if (fIgnoreWildCards) {
+				return (end - start == fLength)
+	                    && fPattern.regionMatches(fIgnoreCase, 0, text, start,
+	                            fLength);
+			}
+	        int segCount = fSegments.length;
+	        if (segCount == 0 && (fHasLeadingStar || fHasTrailingStar)) {
+				return true;
+			}
+	        if (start == end) {
+				return fLength == 0;
+			}
+	        if (fLength == 0) {
+				return start == end;
+			}
+
+	        int tlen = text.length();
+	        if (start < 0) {
+				start = 0;
+			}
+	        if (end > tlen) {
+				end = tlen;
+			}
+
+	        int tCurPos = start;
+	        int bound = end - fBound;
+	        if (bound < 0) {
+				return false;
+			}
+	        int i = 0;
+	        String current = fSegments[i];
+	        int segLength = current.length();
+
+	        /* process first segment */
+	        if (!fHasLeadingStar) {
+	            if (!regExpRegionMatches(text, start, current, 0, segLength)) {
+	                return false;
+	            } else {
+	                ++i;
+	                tCurPos = tCurPos + segLength;
+	            }
+	        }
+	        if ((fSegments.length == 1) && (!fHasLeadingStar)
+	                && (!fHasTrailingStar)) {
+	            // only one segment to match, no wildcards specified
+	            return tCurPos == end;
+	        }
+	        /* process middle segments */
+	        while (i < segCount) {
+	            current = fSegments[i];
+	            int currentMatch;
+	            int k = current.indexOf(fSingleWildCard);
+	            if (k < 0) {
+	                currentMatch = textPosIn(text, tCurPos, end, current);
+	                if (currentMatch < 0) {
+						return false;
+					}
+	            } else {
+	                currentMatch = regExpPosIn(text, tCurPos, end, current);
+	                if (currentMatch < 0) {
+						return false;
+					}
+	            }
+	            tCurPos = currentMatch + current.length();
+	            i++;
+	        }
+
+	        /* process final segment */
+	        if (!fHasTrailingStar && tCurPos != end) {
+	            int clen = current.length();
+	            return regExpRegionMatches(text, end - clen, current, 0, clen);
+	        }
+	        return i == segCount;
+	    }
+
+	    /**
+	     * This method parses the given pattern into segments seperated by wildcard '*' characters.
+	     * Since wildcards are not being used in this case, the pattern consists of a single segment.
+	     */
+	    private void parseNoWildCards() {
+	        fSegments = new String[1];
+	        fSegments[0] = fPattern;
+	        fBound = fLength;
+	    }
+
+	    /**
+	     * Parses the given pattern into segments seperated by wildcard '*' characters.
+	     * @param p, a String object that is a simple regular expression with '*' and/or '?'
+	     */
+	    private void parseWildCards() {
+	        if (fPattern.startsWith("*")) { //$NON-NLS-1$
+				fHasLeadingStar = true;
+			}
+	        if (fPattern.endsWith("*")) {//$NON-NLS-1$
+	            /* make sure it's not an escaped wildcard */
+	            if (fLength > 1 && fPattern.charAt(fLength - 2) != '\\') {
+	                fHasTrailingStar = true;
+	            }
+	        }
+
+	        Vector temp = new Vector();
+
+	        int pos = 0;
+	        StringBuffer buf = new StringBuffer();
+	        while (pos < fLength) {
+	            char c = fPattern.charAt(pos++);
+	            switch (c) {
+	            case '\\':
+	                if (pos >= fLength) {
+	                    buf.append(c);
+	                } else {
+	                    char next = fPattern.charAt(pos++);
+	                    /* if it's an escape sequence */
+	                    if (next == '*' || next == '?' || next == '\\') {
+	                        buf.append(next);
+	                    } else {
+	                        /* not an escape sequence, just insert literally */
+	                        buf.append(c);
+	                        buf.append(next);
+	                    }
+	                }
+	                break;
+	            case '*':
+	                if (buf.length() > 0) {
+	                    /* new segment */
+	                    temp.addElement(buf.toString());
+	                    fBound += buf.length();
+	                    buf.setLength(0);
+	                }
+	                break;
+	            case '?':
+	                /* append special character representing single match wildcard */
+	                buf.append(fSingleWildCard);
+	                break;
+	            default:
+	                buf.append(c);
+	            }
+	        }
+
+	        /* add last buffer to segment list */
+	        if (buf.length() > 0) {
+	            temp.addElement(buf.toString());
+	            fBound += buf.length();
+	        }
+
+	        fSegments = new String[temp.size()];
+	        temp.copyInto(fSegments);
+	    }
+
+	    /** 
+	     * @param text a string which contains no wildcard
+	     * @param start the starting index in the text for search, inclusive
+	     * @param end the stopping point of search, exclusive
+	     * @return the starting index in the text of the pattern , or -1 if not found 
+	     */
+	    protected int posIn(String text, int start, int end) {//no wild card in pattern
+	        int max = end - fLength;
+
+	        if (!fIgnoreCase) {
+	            int i = text.indexOf(fPattern, start);
+	            if (i == -1 || i > max) {
+					return -1;
+				}
+	            return i;
+	        }
+
+	        for (int i = start; i <= max; ++i) {
+	            if (text.regionMatches(true, i, fPattern, 0, fLength)) {
+					return i;
+				}
+	        }
+
+	        return -1;
+	    }
+
+	    /** 
+	     * @param text a simple regular expression that may only contain '?'(s)
+	     * @param start the starting index in the text for search, inclusive
+	     * @param end the stopping point of search, exclusive
+	     * @param p a simple regular expression that may contains '?'
+	     * @return the starting index in the text of the pattern , or -1 if not found 
+	     */
+	    protected int regExpPosIn(String text, int start, int end, String p) {
+	        int plen = p.length();
+
+	        int max = end - plen;
+	        for (int i = start; i <= max; ++i) {
+	            if (regExpRegionMatches(text, i, p, 0, plen)) {
+					return i;
+				}
+	        }
+	        return -1;
+	    }
+
+	    /**
+	     * 
+	     * @return boolean
+	     * @param text a String to match
+	     * @param start int that indicates the starting index of match, inclusive
+	     * @param end</code> int that indicates the ending index of match, exclusive
+	     * @param p String,  String, a simple regular expression that may contain '?'
+	     * @param ignoreCase boolean indicating wether code>p</code> is case sensitive
+	     */
+	    protected boolean regExpRegionMatches(String text, int tStart, String p,
+	            int pStart, int plen) {
+	        while (plen-- > 0) {
+	            char tchar = text.charAt(tStart++);
+	            char pchar = p.charAt(pStart++);
+
+	            /* process wild cards */
+	            if (!fIgnoreWildCards) {
+	                /* skip single wild cards */
+	                if (pchar == fSingleWildCard) {
+	                    continue;
+	                }
+	            }
+	            if (pchar == tchar) {
+					continue;
+				}
+	            if (fIgnoreCase) {
+	                if (Character.toUpperCase(tchar) == Character
+	                        .toUpperCase(pchar)) {
+						continue;
+					}
+	                // comparing after converting to upper case doesn't handle all cases;
+	                // also compare after converting to lower case
+	                if (Character.toLowerCase(tchar) == Character
+	                        .toLowerCase(pchar)) {
+						continue;
+					}
+	            }
+	            return false;
+	        }
+	        return true;
+	    }
+
+	    /** 
+	     * @param text the string to match
+	     * @param start the starting index in the text for search, inclusive
+	     * @param end the stopping point of search, exclusive
+	     * @param p a pattern string that has no wildcard
+	     * @return the starting index in the text of the pattern , or -1 if not found 
+	     */
+	    protected int textPosIn(String text, int start, int end, String p) {
+
+	        int plen = p.length();
+	        int max = end - plen;
+
+	        if (!fIgnoreCase) {
+	            int i = text.indexOf(p, start);
+	            if (i == -1 || i > max) {
+					return -1;
+				}
+	            return i;
+	        }
+
+	        for (int i = start; i <= max; ++i) {
+	            if (text.regionMatches(true, i, p, 0, plen)) {
+					return i;
+				}
+	        }
+
+	        return -1;
+	    }
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java
index 2aa9d76..d5cc519 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java
@@ -33,6 +33,7 @@
 import org.eclipse.jface.text.source.IAnnotationModel;
 import org.eclipse.jface.text.source.IAnnotationModelExtension;
 import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewer;
 import org.eclipse.wst.sse.ui.internal.IReleasable;
 import org.eclipse.wst.sse.ui.internal.ITemporaryAnnotation;
 import org.eclipse.wst.sse.ui.internal.Logger;
@@ -64,18 +65,23 @@
 	public static final int ELEMENT_ERROR_LIMIT = 25;
 
 	private IDocument fDocument = null;
-	// private IReconcileStep fFirstStep = null;
 	private IProgressMonitor fProgressMonitor = null;
 	private ISourceViewer fSourceViewer = null;
-//	private Comparator fComparator;
 
 	// list of "validator" annotations
 	// for gray/un-gray capability
 	private HashSet fMarkerAnnotations = null;
 
 	/**
-	 * Creates a new strategy. The editor parameter is for access to the
-	 * annotation model.
+	 * Creates a new strategy. The source viewer must be set manually
+	 * after creation before a reconciler using this constructor will work.
+	 */
+	public AbstractStructuredTextReconcilingStrategy() {
+		init();
+	}
+
+	/**
+	 * Creates a new strategy.
 	 * 
 	 * @param editor
 	 */
@@ -378,6 +384,16 @@
 	}
 
 	/**
+	 * The user needs to manually set the viewer if the default
+	 * constructor was used. 
+	 *
+	 * @param viewer
+	 */
+	public void setViewer(SourceViewer viewer) {
+		fSourceViewer = viewer;
+	}
+
+	/**
 	 * Set the document for this strategy.
 	 * 
 	 * @param document
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DirtyRegionProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DirtyRegionProcessor.java
index 1a500b9..5649fd6 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DirtyRegionProcessor.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DirtyRegionProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -186,8 +186,13 @@
 				if (DEBUG) {
 					time0 = System.currentTimeMillis();
 				}
-				flushDirtyRegionQueue();
-				fReprocessAfterRewrite = false;
+				// bug 235446 - source validation annotations lost after rewrite session
+				if (!getDirtyRegionQueue().isEmpty()) {
+					flushDirtyRegionQueue();
+					fReprocessAfterRewrite = true;	
+				} else {
+					fReprocessAfterRewrite = false;
+				}
 			}
 			else if (event.getChangeType().equals(DocumentRewriteSessionEvent.SESSION_STOP)) {
 				if (fInRewriteSession ^ oldValue && fDocument != null) {
@@ -210,7 +215,7 @@
 
 	/** debug flag */
 	protected static final boolean DEBUG;
-	private static final long UPDATE_DELAY = 750;
+	private static final long UPDATE_DELAY = 500;
 
 	static {
 		String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerjob"); //$NON-NLS-1$
@@ -259,6 +264,12 @@
 	 */
 	boolean fReprocessAfterRewrite = false;
 
+	/** The job should be reset because of document changes */
+	private boolean fReset = false;
+	private boolean fIsCanceled = false;
+	private boolean fHasReconciled = false;
+	private Object LOCK = new Object();
+
 	/**
 	 * Creates a new StructuredRegionProcessor
 	 */
@@ -282,21 +293,23 @@
 	private synchronized void addRequest(DirtyRegion newDirtyRegion) {
 		// NOTE: This method is called a lot so make sure it's fast
 		List dirtyRegionQueue = getDirtyRegionQueue();
-		for (Iterator it = dirtyRegionQueue.iterator(); it.hasNext();) {
-			// go through list of existing dirty regions and check if any
-			// dirty regions need to be discarded
-			DirtyRegion currentExisting = (DirtyRegion) it.next();
-			DirtyRegion outer = getOuterRegion(currentExisting, newDirtyRegion);
-			// if we already have a request which contains the new request,
-			// discard the new request
-			if (outer == currentExisting)
-				return;
-			// if new request contains any existing requests,
-			// remove those
-			if (outer == newDirtyRegion)
-				it.remove();
+		synchronized (dirtyRegionQueue) {
+			for (Iterator it = dirtyRegionQueue.iterator(); it.hasNext();) {
+				// go through list of existing dirty regions and check if any
+				// dirty regions need to be discarded
+				DirtyRegion currentExisting = (DirtyRegion) it.next();
+				DirtyRegion outer = getOuterRegion(currentExisting, newDirtyRegion);
+				// if we already have a request which contains the new request,
+				// discard the new request
+				if (outer == currentExisting)
+					return;
+				// if new request contains any existing requests,
+				// remove those
+				if (outer == newDirtyRegion)
+					it.remove();
+			}
+			dirtyRegionQueue.add(newDirtyRegion);
 		}
-		dirtyRegionQueue.add(newDirtyRegion);
 	}
 
 	/**
@@ -318,27 +331,28 @@
 	}
 
 	protected ITypedRegion[] computePartitioning(int drOffset, int drLength) {
-		IDocument doc = getDocument();
-		int docLength = doc.getLength();
-
 		ITypedRegion[] tr = new ITypedRegion[0];
-
-		if (drOffset > docLength) {
-			drOffset = docLength;
-			drLength = 0;
-		}
-		else if (drOffset + drLength > docLength) {
-			drLength = docLength - drOffset;
-		}
-
-		try {
-			// dirty region may span multiple partitions
-			tr = TextUtilities.computePartitioning(doc, getDocumentPartitioning(), drOffset, drLength, true);
-		}
-		catch (BadLocationException e) {
-			String info = "dr: [" + drOffset + ":" + drLength + "] doc: [" + docLength + "] "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-			Logger.logException(info, e);
-			tr = new ITypedRegion[0];
+		IDocument doc = getDocument();
+		if (doc != null){
+			int docLength = doc.getLength();
+	
+			if (drOffset > docLength) {
+				drOffset = docLength;
+				drLength = 0;
+			}
+			else if (drOffset + drLength > docLength) {
+				drLength = docLength - drOffset;
+			}
+	
+			try {
+				// dirty region may span multiple partitions
+				tr = TextUtilities.computePartitioning(doc, getDocumentPartitioning(), drOffset, drLength, true);
+			}
+			catch (BadLocationException e) {
+				String info = "dr: [" + drOffset + ":" + drLength + "] doc: [" + docLength + "] "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+				Logger.logException(info, e);
+				tr = new ITypedRegion[0];
+			}
 		}
 		return tr;
 	}
@@ -581,7 +595,7 @@
 	 * @param dirtyRegion
 	 */
 	protected void process(DirtyRegion dirtyRegion) {
-		if (isInRewriteSession()) {
+		if (!isInstalled() || isInRewriteSession() || dirtyRegion == null || getDocument() == null) {
 			return;
 		}
 		/*
@@ -605,12 +619,13 @@
 	 * @param node
 	 */
 	public final void processDirtyRegion(DirtyRegion dr) {
-		if (dr == null)
+		if (dr == null || !isInstalled())
 			return;
 
-		cancel();
 		addRequest(dr);
-		schedule(getDelay());
+		synchronized (LOCK) {
+			fReset = true;
+		}
 
 		if (DEBUG) {
 			System.out.println("added request for: [" + dr.getText() + "]"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -623,11 +638,30 @@
 		if (!PlatformUI.isWorkbenchRunning())
 			return status;
 
+		if (!fHasReconciled) {
+			initialReconcile();
+			fHasReconciled = true;
+		}
+
+		Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
+		boolean processed = false;
 		try {
-			beginProcessing();
+			synchronized (LOCK) {
+				if (fReset) {
+					fReset = false;
+					return status;
+				}
+			}
+			if (fIsCanceled)
+				return status;
 
 			DirtyRegion[] toRefresh = getRequests();
-			for (int i = 0; i < toRefresh.length; i++) {
+			if (toRefresh.length > 0) {
+				processed = true;
+				beginProcessing();
+			}
+
+			for (int i = 0; i < toRefresh.length && fDocument != null; i++) {
 				if (monitor.isCanceled())
 					throw new OperationCanceledException();
 				process(toRefresh[i]);
@@ -644,7 +678,10 @@
 				Logger.logException("problem with reconciling", e); //$NON-NLS-1$
 		}
 		finally {
-			endProcessing();
+			if (processed)
+				endProcessing();
+			if (!fIsCanceled)
+				schedule(getDelay());
 
 			monitor.done();
 		}
@@ -672,9 +709,15 @@
 			}
 			// hook up new document listener
 			fDocument.addDocumentListener(fDocumentListener);
+
+			setEntireDocumentDirty(doc);
 		}
-		
-		setEntireDocumentDirty(doc);
+	}
+
+	/**
+	 * This method is called before the initial reconciling of the document. 
+	 */
+	protected void initialReconcile() {
 	}
 
 	/**
@@ -688,6 +731,16 @@
 	}
 
 	/**
+	 * Forces reconciling of the entire document.
+	 */
+	protected void forceReconciling() {
+		if (!fHasReconciled)
+			return;
+
+		setEntireDocumentDirty(getDocument());
+	}
+
+	/**
 	 * Basically means process the entire document.
 	 * 
 	 * @param document
@@ -719,6 +772,7 @@
 				DirtyRegion entireDocument = createDirtyRegion(0, document.getLength(), DirtyRegion.INSERT);
 				processDirtyRegion(entireDocument);
 			}
+			schedule(getDelay());
 		}
 	}
 
@@ -751,7 +805,10 @@
 			// removes widget listener
 			getTextViewer().removeTextInputListener(fTextInputListener);
 			setInstalled(false);
+			cancel();
+			fIsCanceled = true;
 		}
+		fDirtyRegionQueue.clear();
 		setDocument(null);
 	}
 }
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 9488df9..032bc28 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,30 +7,43 @@
  * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
- *     
+ *     David Carver (Intalio) - bug 307323 - remove extraneous call to spell check strategy
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal.reconcile;
 
 import java.io.IOException;
 import java.io.StringReader;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.content.IContentDescription;
 import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.core.runtime.content.IContentTypeManager;
 import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.ITypedRegion;
 import org.eclipse.jface.text.Region;
 import org.eclipse.jface.text.reconciler.DirtyRegion;
 import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
+import org.eclipse.jface.text.source.IAnnotationModel;
 import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.projection.ProjectionViewer;
+import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
 import org.eclipse.wst.sse.ui.internal.IReleasable;
 import org.eclipse.wst.sse.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy;
+import org.eclipse.wst.sse.ui.internal.provisional.preferences.CommonEditorPreferenceNames;
 import org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorBuilder;
 import org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorMetaData;
 import org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorStrategy;
 import org.eclipse.wst.sse.ui.internal.spelling.SpellcheckStrategy;
+import org.eclipse.wst.sse.ui.reconcile.ISourceReconcilingListener;
 
 /**
  * Adds to DirtyRegionProcessor Job: - IDocumentListener - ValidatorStrategy -
@@ -38,7 +51,6 @@
  * validator strategies - DirtyRegion processing logic.
  */
 public class DocumentRegionProcessor extends DirtyRegionProcessor {
-
 	private static final boolean DEBUG_VALIDATORS = Boolean.TRUE.toString().equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerValidators")); //$NON-NLS-1$
 
 	/**
@@ -53,8 +65,28 @@
 	 */
 	private ValidatorStrategy fValidatorStrategy;
 
+	private ISourceReconcilingListener[] fReconcileListeners = new ISourceReconcilingListener[0];
+
+	private IReconcilingStrategy fSemanticHighlightingStrategy;
+	
+	/**
+	 * The folding strategy for this processor
+	 */
+	private AbstractStructuredFoldingStrategy fFoldingStrategy;
+	
 	private final String SSE_UI_ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$
 
+	/**
+	 * true if as you type validation is enabled,
+	 * false otherwise
+	 */
+	private boolean fValidationEnabled;
+
+	public void addReconcilingListener(ISourceReconcilingListener listener) {
+		Set listeners = new HashSet(Arrays.asList(fReconcileListeners));
+		listeners.add(listener);
+		fReconcileListeners = (ISourceReconcilingListener[]) listeners.toArray(new ISourceReconcilingListener[listeners.size()]);
+	}
 
 	protected void beginProcessing() {
 		super.beginProcessing();
@@ -62,6 +94,11 @@
 		if (validatorStrategy != null) {
 			validatorStrategy.beginProcessing();
 		}
+		if ((getTextViewer() instanceof ISourceViewer)) {
+			for (int i = 0; i < fReconcileListeners.length; i++) {
+				fReconcileListeners[i].aboutToBeReconciled();
+			}
+		}
 	}
 
 	protected void endProcessing() {
@@ -70,6 +107,29 @@
 		if (validatorStrategy != null) {
 			validatorStrategy.endProcessing();
 		}
+		/* single spell-check for everything to ensure that SpellingProblem offsets are correct */
+		IReconcilingStrategy spellingStrategy = getSpellcheckStrategy();
+		IDocument document = getDocument();
+		if (spellingStrategy != null && document != null) {
+			 spellingStrategy.reconcile(new Region(0, document.getLength()));
+		}
+		
+		IReconcilingStrategy semanticHighlightingStrategy = getSemanticHighlightingStrategy();
+		if (semanticHighlightingStrategy != null && document != null) {
+			semanticHighlightingStrategy.reconcile(new Region(0, document.getLength()));
+		}
+
+		if ((getTextViewer() instanceof ISourceViewer)) {
+			ISourceViewer sourceViewer = (ISourceViewer) getTextViewer();
+			IAnnotationModel annotationModel = sourceViewer.getAnnotationModel();
+			for (int i = 0; i < fReconcileListeners.length; i++) {
+				fReconcileListeners[i].reconciled(document, annotationModel, false, new NullProgressMonitor());
+			}
+		}
+	}
+
+	public void forceReconciling() {
+		super.forceReconciling();
 	}
 
 	protected String getContentType(IDocument doc) {
@@ -94,26 +154,82 @@
 	}
 
 	protected IReconcilingStrategy getSpellcheckStrategy() {
-		if (fSpellcheckStrategy == null) {
+		if (fSpellcheckStrategy == null && getDocument() != null) {
 			String contentTypeId = getContentType(getDocument());
-			if (contentTypeId != null) {
-				if (getTextViewer() instanceof ISourceViewer) {
-					ISourceViewer viewer = (ISourceViewer) getTextViewer();
-					fSpellcheckStrategy = new SpellcheckStrategy(viewer, contentTypeId);
-					fSpellcheckStrategy.setDocument(getDocument());
-				}
+			if (contentTypeId == null) {
+				contentTypeId = IContentTypeManager.CT_TEXT;
+			}
+			if (getTextViewer() instanceof ISourceViewer) {
+				ISourceViewer viewer = (ISourceViewer) getTextViewer();
+				fSpellcheckStrategy = new SpellcheckStrategy(viewer, contentTypeId);
+				fSpellcheckStrategy.setDocument(getDocument());
 			}
 		}
 		return fSpellcheckStrategy;
 	}
+	
+	/**
+	 * <p>Get the folding strategy for this processor. Retrieved from the 
+	 * extended configuration builder.  The processor chosen is set by the plugin.</p>
+	 * 
+	 * <p>EX:<br />
+	 * <code>&lt;extension point="org.eclipse.wst.sse.ui.editorConfiguration"&gt;<br />
+	 *  &lt;provisionalConfiguration<br />
+	 *			type="foldingstrategy"<br />
+	 *			class="org.eclipse.wst.xml.ui.internal.projection.XMLFoldingStrategy"<br />
+	 *			target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" /&gt;<br />
+	 *	&lt;/extension&gt;</code></p>
+	 * 
+	 * <p>The type must be equal to <code>AbstractFoldingStrategy.ID</code> (AKA: foldingstrategy)
+	 * and the class must extend <code>org.eclipse.wst.sse.ui.internal.projection.AbstractFoldingStrategy</code>
+	 * and the target must be a structured editor content type ID</p>
+	 * 
+	 * @return the requested folding strategy or null if none can be found
+	 */
+	protected IReconcilingStrategy getFoldingStrategy() {
+		if(fFoldingStrategy == null && getDocument() != null) {
+			String contentTypeId = getContentType(getDocument());
+			if (contentTypeId == null) {
+				contentTypeId = IContentTypeManager.CT_TEXT;
+			}
+			
+			ITextViewer viewer = getTextViewer();
+			if(viewer instanceof ProjectionViewer) {
+				ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
+				
+				IContentType type = Platform.getContentTypeManager().getContentType(contentTypeId);
+				while(fFoldingStrategy == null && type != null) {
+					fFoldingStrategy =(AbstractStructuredFoldingStrategy) builder.getConfiguration(
+							AbstractStructuredFoldingStrategy.ID, type.getId());
+				
+					type = type.getBaseType();
+				}
+				
+				if(fFoldingStrategy != null) {
+					fFoldingStrategy.setViewer((ProjectionViewer)viewer);
+					fFoldingStrategy.setDocument(getDocument());
+				}
+			}
+		}
+		
+		return fFoldingStrategy;
+	}
+	
+	/**
+	 * Enable or disable as you type validation. Typically set by a user preference
+	 * 
+	 * @param enable true to enable as you type validation, false to disable
+	 */
+	public void setValidatorStrategyEnabled(boolean enable) {
+		fValidationEnabled = enable;
+	}
 
 	/**
 	 * @return Returns the ValidatorStrategy.
 	 */
 	protected ValidatorStrategy getValidatorStrategy() {
-		if (fValidatorStrategy == null) {
-			ValidatorStrategy validatorStrategy = null;
-
+		ValidatorStrategy validatorStrategy = null;
+		if (fValidatorStrategy == null && fValidationEnabled) {
 			if (getTextViewer() instanceof ISourceViewer) {
 				ISourceViewer viewer = (ISourceViewer) getTextViewer();
 				String contentTypeId = null;
@@ -151,46 +267,75 @@
 				}
 			}
 			fValidatorStrategy = validatorStrategy;
+		} else if(fValidatorStrategy != null && fValidationEnabled) {
+			validatorStrategy = fValidatorStrategy;
 		}
-		return fValidatorStrategy;
+		return validatorStrategy;
 	}
-
+	
+	public void setSemanticHighlightingStrategy(IReconcilingStrategy semanticHighlightingStrategy) {
+		fSemanticHighlightingStrategy = semanticHighlightingStrategy;
+		fSemanticHighlightingStrategy.setDocument(getDocument());
+	}
+	
+	protected IReconcilingStrategy getSemanticHighlightingStrategy() {
+		return fSemanticHighlightingStrategy;
+	}
+	
 	/**
 	 * @param dirtyRegion
 	 */
 	protected void process(DirtyRegion dirtyRegion) {
-		if (!isInstalled() || isInRewriteSession())
+		if (!isInstalled() || isInRewriteSession() || dirtyRegion == null || getDocument() == null)
 			return;
 
 		super.process(dirtyRegion);
-
-		// Also call the validation and spell-check strategies
+		
 		ITypedRegion[] partitions = computePartitioning(dirtyRegion);
-
+		
+		// call the validator strategy once for each effected partition
 		DirtyRegion dirty = null;
 		for (int i = 0; i < partitions.length; i++) {
+			dirty = createDirtyRegion(partitions[i], DirtyRegion.INSERT);
+
 			// [source]validator (extension) for this partition
 			if (getValidatorStrategy() != null) {
-				dirty = createDirtyRegion(partitions[i], DirtyRegion.INSERT);
 				getValidatorStrategy().reconcile(partitions[i], dirty);
 			}
 		}
-
-		// single spell-check for everything
-		if (getSpellcheckStrategy() != null) {
-			getSpellcheckStrategy().reconcile(dirtyRegion, dirtyRegion);
+		
+		/* if there is a folding strategy then reconcile it for the
+		 * entire dirty region.
+		 * NOTE: the folding strategy does not care about the sub regions.
+		 */
+		if(getFoldingStrategy() != null) {
+			getFoldingStrategy().reconcile(dirtyRegion, null);
 		}
 	}
+	
+	public void removeReconcilingListener(ISourceReconcilingListener listener) {
+		Set listeners = new HashSet(Arrays.asList(fReconcileListeners));
+		listeners.remove(listener);
+		fReconcileListeners = (ISourceReconcilingListener[]) listeners.toArray(new ISourceReconcilingListener[listeners.size()]);
+	}
+
 
 	public void setDocument(IDocument doc) {
 		super.setDocument(doc);
+		
 		IReconcilingStrategy validatorStrategy = getValidatorStrategy();
 		if (validatorStrategy != null) {
 			validatorStrategy.setDocument(doc);
 		}
-		if (fSpellcheckStrategy != null) {
-			fSpellcheckStrategy.setDocument(doc);
+		if (fSemanticHighlightingStrategy != null) {
+			fSemanticHighlightingStrategy.setDocument(doc);
 		}
+		
+		fSpellcheckStrategy = null;
+		if(fFoldingStrategy != null) {
+			fFoldingStrategy.uninstall();
+		}
+		fFoldingStrategy = null;
 	}
 
 	protected void setEntireDocumentDirty(IDocument document) {
@@ -210,13 +355,30 @@
 					validatorStrategy.reconcile(fLastPartitions[i], createDirtyRegion(fLastPartitions[i], DirtyRegion.REMOVE));
 				}
 			}
-			if (fSpellcheckStrategy != null) {
-				fSpellcheckStrategy.reconcile(new Region(0, document.getLength()));
+			IReconcilingStrategy spellingStrategy = getSpellcheckStrategy();
+			if (spellingStrategy != null) {
+				spellingStrategy.reconcile(new Region(0, document.getLength()));
+			}
+			
+			//if there is a folding strategy then reconcile it
+			if(getFoldingStrategy() != null) {
+				getFoldingStrategy().reconcile(new Region(0, document.getLength()));
 			}
 		}
 	}
 
 	/**
+	 * @see org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor#install(org.eclipse.jface.text.ITextViewer)
+	 */
+	public void install(ITextViewer textViewer) {
+		super.install(textViewer);
+
+		//determine if validation is enabled
+		this.fValidationEnabled = SSEUIPlugin.getInstance().getPreferenceStore().getBoolean(
+				CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS);
+	}
+	
+	/**
 	 * @see org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor#uninstall()
 	 */
 	public void uninstall() {
@@ -230,9 +392,13 @@
 				if (validatorStrategy instanceof IReleasable)
 					((IReleasable) validatorStrategy).release();
 			}
+			
 			if (fSpellcheckStrategy != null) {
 				fSpellcheckStrategy.setDocument(null);
+				fSpellcheckStrategy = null;
 			}
+
+			fReconcileListeners = new ISourceReconcilingListener[0];
 		}
 		super.uninstall();
 	}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java
index c8aa113..7861f66 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -33,6 +33,7 @@
 public class StructuredRegionProcessor extends DocumentRegionProcessor {
 
 	class ModelLifecycleListener implements IModelLifecycleListener {
+		IStructuredModel changing = null;
 		/**
 		 * @see org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener#processPostModelEvent(org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent)
 		 */
@@ -42,27 +43,18 @@
 			// here...
 			// ex. file is modified outside the workbench
 			if (event.getType() == ModelLifecycleEvent.MODEL_DOCUMENT_CHANGED) {
+				if (changing != null && event.getModel() == changing) {
+					IStructuredDocument sDoc = event.getModel().getStructuredDocument();
 
-				// check that it's this model that changed
-				IStructuredModel thisModel = getStructuredModelForRead(getDocument());
-				try {
-					if (thisModel != null && event.getModel().equals(thisModel)) {
-
-						IStructuredDocument sDoc = event.getModel().getStructuredDocument();
-
-						if (DEBUG) {
-							System.out.println("======================================================"); //$NON-NLS-1$
-							System.out.println("StructuredRegionProcessor: DOCUMENT MODEL CHANGED TO: "); //$NON-NLS-1$
-							System.out.println(sDoc.get());
-							System.out.println("======================================================"); //$NON-NLS-1$
-						}
-						setDocument(sDoc);
+					if (DEBUG) {
+						System.out.println("======================================================"); //$NON-NLS-1$
+						System.out.println("StructuredRegionProcessor: DOCUMENT MODEL CHANGED TO: "); //$NON-NLS-1$
+						System.out.println(sDoc.get());
+						System.out.println("======================================================"); //$NON-NLS-1$
 					}
+					setDocument(sDoc);
 				}
-				finally {
-					if (thisModel != null)
-						thisModel.releaseFromRead();
-				}
+				changing = null;
 			}
 		}
 
@@ -70,17 +62,32 @@
 		 * @see org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener#processPreModelEvent(org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent)
 		 */
 		public void processPreModelEvent(ModelLifecycleEvent event) {
-
-			if (event.getType() == ModelLifecycleEvent.MODEL_DOCUMENT_CHANGED) {
-
-				flushDirtyRegionQueue();
-				// note: old annotations are removed via the strategies on
-				// AbstractStructuredTextReconcilingStrategy#setDocument(...)
+			if(fCurrentDoc != null) {
+				IStructuredModel model = null;
+				try {
+					model = getStructuredModelForRead(fCurrentDoc);
+					if (event.getType() == ModelLifecycleEvent.MODEL_DOCUMENT_CHANGED && event.getModel() == model) {
+						changing = event.getModel();
+						flushDirtyRegionQueue();
+						// note: old annotations are removed via the strategies on
+						// AbstractStructuredTextReconcilingStrategy#setDocument(...)
+					}
+				} finally {
+					if(model != null) {
+						model.releaseFromRead();
+					}
+				}
 			}
 		}
 	}
 
+	/**
+	 * The life cycle listener used to listen to the current documents model even though
+	 * this class does not hold onto a reference to the model.
+	 */
 	private IModelLifecycleListener fLifeCycleListener = new ModelLifecycleListener();
+	/** Used to get the current model on demand so a model does not need to be held by permanently */
+	private IDocument fCurrentDoc = null;
 
 	/*
 	 * (non-Javadoc)
@@ -91,11 +98,12 @@
 	protected DirtyRegion getOuterRegion(DirtyRegion root, DirtyRegion possible) {
 		// first try simple region check if one region contains the other
 		DirtyRegion outer = super.getOuterRegion(root, possible);
-		if (outer == null) {
-			// now compare nodes
-			IStructuredModel sModel = getStructuredModelForRead(getDocument());
+		if (outer == null && fCurrentDoc != null) {
+			IStructuredModel sModel = null;
 			try {
+				sModel = getStructuredModelForRead(fCurrentDoc);
 				if (sModel != null) {
+					// now compare nodes
 					IndexedRegion rootRegion = sModel.getIndexedRegion(root.getOffset());
 					IndexedRegion possRegion = sModel.getIndexedRegion(possible.getOffset());
 					if (rootRegion != null && possRegion != null) {
@@ -113,10 +121,11 @@
 						}
 					}
 				}
-			}
-			finally {
-				if (sModel != null)
+				
+			} finally {
+				if(sModel != null) {
 					sModel.releaseFromRead();
+				}
 			}
 		}
 		return outer;
@@ -185,11 +194,10 @@
 	 * use that.
 	 */
 	protected String getContentType(IDocument doc) {
-
 		String contentTypeId = null;
 		IStructuredModel sModel = null;
 		try {
-			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
+			sModel = getStructuredModelForRead(doc);
 			if (sModel != null) {
 				contentTypeId = sModel.getContentTypeIdentifier();
 			}
@@ -209,55 +217,45 @@
 	 */
 	private IStructuredModel getStructuredModelForRead(IDocument doc) {
 		IStructuredModel sModel = null;
-		if (doc != null)
-			sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
+		if (doc != null && doc instanceof IStructuredDocument)
+			sModel = StructuredModelManager.getModelManager().getModelForRead((IStructuredDocument) doc);
 		return sModel;
 	}
 
-	/**
-	 * @param document
-	 */
-	private void hookUpModelLifecycleListener(IDocument document) {
-		IStructuredModel sModel = getStructuredModelForRead(document);
-		try {
-			if (sModel != null) {
-				sModel.addModelLifecycleListener(fLifeCycleListener);
-			}
-		}
-		finally {
-			if (sModel != null)
-				sModel.releaseFromRead();
-		}
-	}
-
 	protected void process(DirtyRegion dirtyRegion) {
-		if (getDocument() == null || isInRewriteSession())
+		if (!isInstalled() || isInRewriteSession() || dirtyRegion == null || getDocument() == null)
 			return;
 
-		// use structured model to determine area to process
-		IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
-		try {
-			if (sModel != null) {
-				int start = dirtyRegion.getOffset();
-				int end = start + dirtyRegion.getLength();
-				IndexedRegion irStart = sModel.getIndexedRegion(start);
-				IndexedRegion irEnd = sModel.getIndexedRegion(end);
+		// unhook old lifecycle listener
+		if(fCurrentDoc != null) {
+			IStructuredModel sModel = null;
+			try {
+				sModel = getStructuredModelForRead(fCurrentDoc);
+				
+				// use structured model to determine area to process
+				if (sModel != null) {
+					int start = dirtyRegion.getOffset();
+					int end = start + dirtyRegion.getLength();
+					IndexedRegion irStart = sModel.getIndexedRegion(start);
+					IndexedRegion irEnd = sModel.getIndexedRegion(end);
 
-				if (irStart != null) {
-					start = Math.min(start, irStart.getStartOffset());
+					if (irStart != null) {
+						start = Math.min(start, irStart.getStartOffset());
+					}
+					if (irEnd != null) {
+						end = Math.max(end, irEnd.getEndOffset());
+					}
+					super.process(createDirtyRegion(start, end - start, DirtyRegion.INSERT));
+				} else {
+					super.process(dirtyRegion);
 				}
-				if (irEnd != null) {
-					end = Math.max(end, irEnd.getEndOffset());
+			} finally {
+				if(sModel != null) {
+					sModel.releaseFromRead();
 				}
-				super.process(createDirtyRegion(start, end - start, DirtyRegion.INSERT));
 			}
-			else {
-				super.process(dirtyRegion);
-			}
-		}
-		finally {
-			if (sModel != null)
-				sModel.releaseFromRead();
+		} else {
+			super.process(dirtyRegion);
 		}
 	}
 
@@ -271,34 +269,38 @@
 	}
 
 	public void setDocument(IDocument newDocument) {
-		// unhook old lifecycle listner
-		unhookModelLifecycleListener(getDocument());
+		// unhook old lifecycle listener
+		if(fCurrentDoc != null) {
+			IStructuredModel oldModel = null;
+			try {
+				oldModel = getStructuredModelForRead(fCurrentDoc);
+				if(oldModel != null) {
+					oldModel.removeModelLifecycleListener(fLifeCycleListener);
+				}
+			} finally {
+				if(oldModel != null) {
+					oldModel.releaseFromRead();
+				}
+			}
+		}
+		
+		//set the new document
 		super.setDocument(newDocument);
+		fCurrentDoc = newDocument;
+		
 		// add new lifecycle listener
-		if (newDocument != null)
-			hookUpModelLifecycleListener(newDocument);
-	}
-
-	/**
-	 * @param document
-	 */
-	private void unhookModelLifecycleListener(IDocument document) {
-		IStructuredModel sModel = getStructuredModelForRead(document);
-		try {
-			if (sModel != null)
-				sModel.removeModelLifecycleListener(fLifeCycleListener);
-
+		if (newDocument != null) {
+			IStructuredModel newModel = null;
+			try {
+				newModel = getStructuredModelForRead(newDocument);
+				if(newModel != null) {
+					newModel.addModelLifecycleListener(fLifeCycleListener);
+				}
+			} finally {
+				if(newModel != null) {
+					newModel.releaseFromRead();
+				}
+			}
 		}
-		finally {
-			if (sModel != null)
-				sModel.releaseFromRead();
-		}
-	}
-
-	public void uninstall() {
-
-		// removes model listeners
-		unhookModelLifecycleListener(getDocument());
-		super.uninstall();
 	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalHelper.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalHelper.java
index e0a916b..9615163 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalHelper.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalHelper.java
@@ -45,7 +45,7 @@
 		return null;
 	}
 
-	void setURI(String uri) {
+	public void setURI(String uri) {
 		fURI = uri;
 	}
 	
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ReconcileStepForValidator.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ReconcileStepForValidator.java
index e940bb7..94b41cd 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ReconcileStepForValidator.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ReconcileStepForValidator.java
@@ -24,6 +24,7 @@
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.Region;
 import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
 import org.eclipse.jface.text.reconciler.DirtyRegion;
 import org.eclipse.jface.text.reconciler.IReconcilableModel;
@@ -32,6 +33,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.ui.internal.Logger;
 import org.eclipse.wst.sse.ui.internal.reconcile.DocumentAdapter;
+import org.eclipse.wst.sse.ui.internal.reconcile.IReconcileAnnotationKey;
 import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
 import org.eclipse.wst.sse.ui.internal.reconcile.StructuredReconcileStep;
 import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
@@ -57,6 +59,11 @@
 	private final IReconcileResult[] EMPTY_RECONCILE_RESULT_SET = new IReconcileResult[0];
 	private IncrementalHelper fHelper = null;
 	private IncrementalReporter fReporter = null;
+
+	/**
+	 * Declared scope of this validator, either ReconcileAnnotationKey.TOTAL
+	 * or ReconcileAnnotationKey.PARTIAL
+	 */
 	private int fScope = -1;
 	private IValidator fValidator = null;
 	private final String QUICKASSISTPROCESSOR = IQuickAssistProcessor.class.getName();
@@ -243,7 +250,8 @@
 		IReconcileResult[] results = EMPTY_RECONCILE_RESULT_SET;
 		if (dirtyRegion != null) {
 			try {
-				if (fValidator instanceof ISourceValidator) {
+				// https://bugs.eclipse.org/bugs/show_bug.cgi?id=247714
+				if (fValidator instanceof ISourceValidator && getScope() == ReconcileAnnotationKey.PARTIAL) {
 					results = validate(dirtyRegion, subRegion);
 				}
 				else {
@@ -337,7 +345,10 @@
 
 			if (fValidator instanceof ISourceValidator) {
 				IncrementalReporter reporter = getReporter();
-				((ISourceValidator) fValidator).validate(dirtyRegion, helper, reporter);
+				if (getScope() == IReconcileAnnotationKey.PARTIAL)
+					((ISourceValidator) fValidator).validate(dirtyRegion, helper, reporter);
+				else
+					((ISourceValidator) fValidator).validate(new Region(0, getDocument().getLength()), helper, reporter);
 				// call IValidator.cleanup() during release()
 				// results = createAnnotations(reporter.getMessages());
 				results = createAnnotations(reporter.getAnnotationInfo());
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorMetaData.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorMetaData.java
index 47bcdcb..8a412c1 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorMetaData.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorMetaData.java
@@ -129,8 +129,8 @@
 	 */
 	public boolean canHandlePartitionType(String contentTypeIds[], String paritionType) {
         for(int i=0; i<contentTypeIds.length; i++) {
-    		if (fMatrix.containsKey(contentTypeIds[i])) {
-    			List partitions = (List) fMatrix.get(contentTypeIds[i]);
+        	List partitions = (List) fMatrix.get(contentTypeIds[i]);
+    		if (partitions != null) {
     			for (int j = 0; j < partitions.size(); j++) {
     				if (paritionType.equals(partitions.get(j)))
     					return true;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java
index e9e9b61..e0f20a9 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,6 +14,7 @@
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -35,7 +36,9 @@
 import org.eclipse.jface.text.source.ISourceViewer;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.utils.StringUtils;
 import org.eclipse.wst.sse.ui.internal.IReleasable;
+import org.eclipse.wst.sse.ui.internal.Logger;
 import org.eclipse.wst.sse.ui.internal.reconcile.DocumentAdapter;
 import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
 import org.eclipse.wst.sse.ui.internal.reconcile.StructuredTextReconcilingStrategy;
@@ -54,6 +57,9 @@
  */
 public class ValidatorStrategy extends StructuredTextReconcilingStrategy {
 
+	private static final boolean DEBUG_VALIDATION_CAPABLE_BUT_DISABLED = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerValidatorEnablement")).booleanValue();
+	private static final boolean DEBUG_VALIDATION_UNSUPPORTED = Boolean.valueOf(Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerValidatorSupported")).booleanValue();
+
 	private String[] fContentTypeIds = null;
 	private List fMetaData = null;
 	/** validator id (as declared in ext point) -> ReconcileStepForValidator * */
@@ -63,7 +69,13 @@
 	 * List of ValidatorMetaDatas of total scope validators that have been run
 	 * since beginProcessing() was called.
 	 */
-	private List fTotalScopeValidatorsAlreadyRun;
+	private List fTotalScopeValidatorsAlreadyRun = new ArrayList();
+	
+	/*
+	 * Whether the Validation Framework has indicated that validation is
+	 * suspended for the current resource
+	 */
+	private boolean fValidatorsSuspended = false;
 
 	public ValidatorStrategy(ISourceViewer sourceViewer, String contentType) {
 		super(sourceViewer);
@@ -77,10 +89,7 @@
 	}
 
 	public void beginProcessing() {
-		if (fTotalScopeValidatorsAlreadyRun == null)
-			fTotalScopeValidatorsAlreadyRun = new ArrayList();
-		else
-			fTotalScopeValidatorsAlreadyRun.clear();
+		fTotalScopeValidatorsAlreadyRun.clear();
 	}
 
 	/**
@@ -155,7 +164,7 @@
 		 * Abort if no workspace file is known (new validation framework does
 		 * not support that scenario) or no validators have been specified
 		 */
-		if (isCanceled() || fMetaData.isEmpty())
+		if (isCanceled() || fMetaData.isEmpty() || fValidatorsSuspended)
 			return;
 
 		IDocument doc = getDocument();
@@ -180,15 +189,42 @@
 		 * validators.
 		 */
 		Set disabledValsByClass = new HashSet(20);
-		if (getFile() != null) {
-			for (Iterator it = ValidationFramework.getDefault().getDisabledValidatorsFor(getFile()).iterator(); it.hasNext();) {
-				Validator v = (Validator) it.next();
-				IValidator iv = v.asIValidator();
-				if (iv != null && v.getSourceId() != null)
-					disabledValsBySourceId.add(v.getSourceId());
-				Validator.V1 v1 = v.asV1Validator();
-				if (v1 != null)
-					disabledValsByClass.add(v1.getId());
+		IFile file = getFile();
+		if (file != null) {
+			if(!file.isAccessible())
+				return;
+
+			Collection disabledValidators = null;
+			try {
+				/*
+				 * Take extra care when calling this external code, as it
+				 * can indirectly cause bundles to start
+				 */
+				disabledValidators = ValidationFramework.getDefault().getDisabledValidatorsFor(file);
+			}
+			catch (Exception e) {
+				Logger.logException(e);
+			}
+
+			if (disabledValidators != null) {
+				for (Iterator it = disabledValidators.iterator(); it.hasNext();) {
+					Validator v = (Validator) it.next();
+					Validator.V1 v1 = null;
+					try {
+						v1 = v.asV1Validator();
+					}
+					catch (Exception e) {
+						Logger.logException(e);
+					}
+					if (v1 != null)
+						disabledValsByClass.add(v1.getId());
+					// not a V1 validator
+					else if (v.getSourceId() != null) {
+						//could be more then one sourceid per batch validator
+						String[] sourceIDs = StringUtils.unpack(v.getSourceId());
+						disabledValsBySourceId.addAll(Arrays.asList(sourceIDs));
+					}
+				}
 			}
 		}
 				
@@ -207,6 +243,9 @@
 				 * preferences before attempting to create/use it
 				 */
 				if (!disabledValsBySourceId.contains(vmd.getValidatorId()) && !disabledValsByClass.contains(vmd.getValidatorClass())) {
+					if (DEBUG_VALIDATION_UNSUPPORTED) {
+						Logger.log(Logger.INFO, "Source validator "+vmd.getValidatorId()+" handling (content types:[" + StringUtils.pack(getContentTypeIds()) + "] partition type:" + partitionType);
+					}
 					int validatorScope = vmd.getValidatorScope();
 					ReconcileStepForValidator validatorStep = null;
 					// get step for partition type
@@ -234,6 +273,13 @@
 						}
 					}
 				}
+				else if (DEBUG_VALIDATION_CAPABLE_BUT_DISABLED) {
+					String message = "Source validator able (id:" + vmd.getValidatorId() + " class:" + vmd.getValidatorClass() + " but skipped because it was reported as disabled";
+					Logger.log(Logger.INFO, message);
+				}
+			}
+			else if (DEBUG_VALIDATION_UNSUPPORTED) {
+				Logger.log(Logger.INFO, "Source validator "+vmd.getValidatorId()+" can not handle (content types:[" + StringUtils.pack(getContentTypeIds()) + "] partition type:" + partitionType);
 			}
 		}
 
@@ -260,6 +306,21 @@
 
 		super.setDocument(document);
 
+		try {
+			fValidatorsSuspended = false;
+			if (document != null) {
+				IFile file = getFile();
+				if (file != null) {
+					// Validation is suspended for this resource, do nothing
+					fValidatorsSuspended = !file.isAccessible() || ValidationFramework.getDefault().isSuspended(file.getProject()) || ValidationFramework.getDefault().getProjectSettings(file.getProject()).getSuspend();
+				}
+			}
+		}
+		catch (Exception e) {
+			fValidatorsSuspended = true;
+			Logger.logException(e);
+		}
+		
 		// validator steps are in "fVIdToVStepMap" (as opposed to fFirstStep >
 		// next step etc...)
 		Iterator it = fVidToVStepMap.values().iterator();
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/rules/PresentationCollector.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/rules/PresentationCollector.java
new file mode 100644
index 0000000..436d510
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/rules/PresentationCollector.java
@@ -0,0 +1,83 @@
+/*******************************************************************************

+ * Copyright (c) 2009 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+

+package org.eclipse.wst.sse.ui.internal.rules;

+

+import java.util.AbstractCollection;

+import java.util.Iterator;

+

+import org.eclipse.core.runtime.Assert;

+import org.eclipse.jface.text.TextPresentation;

+import org.eclipse.swt.custom.StyleRange;

+import org.eclipse.wst.sse.ui.internal.Logger;

+

+/**

+ * Passed to LineStyleProviders as the Collection for which StyleRanges are to

+ * be added. This class provides additional sanity checks on the incoming

+ * StyleRanges so that we do not rely upon SWT to report Errors with no record

+ * of the StyleRange or contributing LineStyleProvider, as well as a slight

+ * performance increase by not allocating a redundant collection for the

+ * StyleRanges.

+ * 

+ * This class intentionally violates the contract for java.util.Collection.

+ */

+

+class PresentationCollector extends AbstractCollection {

+	private final TextPresentation fPresentation;

+	private int lastOffset;

+

+	/**

+	 * @param presentation

+	 *            - the Presentation being added to

+	 * @param applyOnAdd

+	 */

+	PresentationCollector(TextPresentation presentation) {

+		super();

+		Assert.isNotNull(presentation);

+		fPresentation = presentation;

+		lastOffset = 0;

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see java.util.Collection#add(java.lang.Object)

+	 */

+	public boolean add(Object o) {

+		StyleRange range = (StyleRange) o;

+		if (lastOffset > range.start) {

+			IllegalArgumentException e = new IllegalArgumentException("Overlapping start in StyleRange " + range.start + ":" + range.length); //$NON-NLS-1$ //$NON-NLS-2$

+			Logger.logException(e);

+			throw e;

+		}

+		lastOffset = range.start + range.length;

+		fPresentation.addStyleRange(range);

+		return true;

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see java.util.AbstractCollection#iterator()

+	 */

+	public Iterator iterator() {

+		return fPresentation.getNonDefaultStyleRangeIterator();

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see java.util.AbstractCollection#size()

+	 */

+	public int size() {

+		throw new UnsupportedOperationException();

+	}

+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/rules/StructuredDocumentDamagerRepairer.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/rules/StructuredDocumentDamagerRepairer.java
new file mode 100644
index 0000000..f5973d8
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/rules/StructuredDocumentDamagerRepairer.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.sse.ui.internal.rules;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.TextPresentation;
+import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
+import org.eclipse.jface.text.rules.RuleBasedScanner;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider;
+import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+
+/**
+ * An implementation of a presentation damager and presentation repairer.
+ * It uses a LineStyleProvider to retrieve the style ranges associated with
+ * the calculated damaged region.
+ * 
+ * @see LineStyleProvider
+ */
+public class StructuredDocumentDamagerRepairer extends DefaultDamagerRepairer {
+	
+	private LineStyleProvider fProvider = null;
+	
+	public StructuredDocumentDamagerRepairer(LineStyleProvider provider) {
+		super(new RuleBasedScanner());
+		Assert.isNotNull(provider);
+		fProvider = provider;
+	}
+
+	public void createPresentation(TextPresentation presentation, ITypedRegion region) {
+		PresentationCollector collector = new PresentationCollector(presentation);
+		fProvider.prepareRegions(region, region.getOffset(), region.getLength(), collector);
+	}
+	
+	public void setProvider(LineStyleProvider provider) {
+		fProvider = provider;
+	}
+	
+	public void setDocument(IDocument document) {
+		super.setDocument(document);
+		if (fProvider instanceof AbstractLineStyleProvider)
+			((AbstractLineStyleProvider) fProvider).setDocument( (IStructuredDocument) document);
+	}
+	
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchLabelProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchLabelProvider.java
index 3c3d540..c20f38a 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchLabelProvider.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchLabelProvider.java
@@ -1,75 +1,154 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *     IBM Corporation - initial API and implementation
- *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal.search;
 
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.StyledString;
+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
+import org.eclipse.jface.viewers.StyledString.Styler;
+import org.eclipse.search.ui.text.AbstractTextSearchViewPage;
 import org.eclipse.search.ui.text.Match;
 import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.ui.internal.Logger;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
 import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImageHelper;
 import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImages;
 
-
+import com.ibm.icu.text.MessageFormat;
 
 /**
- * Basic label provider that just provides an image and default text.
+ * <p>The label provider designed for use with <code>BasicSearchMatchElement</code><p>
  * 
- * @author pavery
+ * <p>Displays in the format of:<br/>
+ * lineNum: Message (# matches)</br>
+ * 1: <a></a> (2 matches)</p>
  */
-public class BasicSearchLabelProvider implements ILabelProvider {
-
-	public void addListener(ILabelProviderListener listener) {
-		// do nothing
+public class BasicSearchLabelProvider extends LabelProvider implements IStyledLabelProvider {
+	/**
+	 * ID of match highlighting background color
+	 */
+	private static final String MATCH_BG_ID = "org.eclipse.wst.sse.ui.search.MATCH_BG";
+	
+	//register the match highlighting background color once
+	static {
+		JFaceResources.getColorRegistry().put(MATCH_BG_ID, new RGB(206, 204, 247));
 	}
+	
+	/**
+	 * Match highlighting background color styler
+	 */
+	private static final Styler HIGHLIGHT_WRITE_STYLE= StyledString.createColorRegistryStyler(null, MATCH_BG_ID);
+	
+	
+	/**
+	 * Need the page if want to determine the number of matches, but this can be <code>null</code>
+	 */
+	private AbstractTextSearchViewPage fPage;
 
-	public void dispose() {
-		// do nothing
+	/**
+	 * <p>Construct the provider without a <code>AbstractTextSearchViewPage</code><p>
+	 * <p><b>NOTE:</b>If this constructor is used then the provider will not be able to determine
+	 * the number of matches that are all on the same line for a given element</p>
+	 */
+	public BasicSearchLabelProvider() {
+		this(null);
 	}
-
+	
+	/**
+	 * <p>Construct the provider with a <code>AbstractTextSearchViewPage</code> so that the
+	 * number of matches that are all on the same line for a given element can be determined.</p>
+	 * 
+	 * @param page Will be used to determine the number of matches that are all on the same line
+	 */
+	public BasicSearchLabelProvider(AbstractTextSearchViewPage page) {
+		fPage= page;
+	}
+	
+	/**
+	 * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
+	 */
 	public Image getImage(Object element) {
 		return EditorPluginImageHelper.getInstance().getImage(EditorPluginImages.IMG_OBJ_OCC_MATCH);
 	}
+	
+	/**
+	 * <p><b>Note:</b> Because this class implements <code>IStyledLabelProvider</code> the <code>getStyledText</code>
+	 * function should be being called and not this one, but better save then sorry</p>
+	 * 
+	 * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
+	 * @see org.eclipse.wst.sse.ui.internal.search.BasicSearchLabelProvider#getStyledText(Object)
+	 */
+	public final String getText(Object element) {
+		return getStyledText(element).getString();
+	}
+	
+	/**
+	 * <p>Given a <code>Match</code> object containing a <code>BasicSearchMatchElement</code> element
+	 * returns a <code>StyledString</code> in the form of:</p>
+	 * 
+	 * <p>lineNum: Message (# matches)</br>
+	 * 1: <a></a> (2 matches)</p>
+	 * 
+	 * @see org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider#getStyledText(java.lang.Object)
+	 */
+	public StyledString getStyledText(Object obj) {
+		StyledString styledText = new StyledString();
+		BasicSearchMatchElement element = null;
+		if (obj instanceof Match) {
+			Match match = (Match) obj;
 
-	public String getText(Object element) {
-
-		StringBuffer text = new StringBuffer();
-		if (element instanceof Match) {
-			Match m = (Match) element;
-
-			IMarker marker = (IMarker) m.getElement();
-			if (marker.exists()) {
-				String resultText = ""; //$NON-NLS-1$
-				try {
-					resultText = (String) marker.getAttribute(IMarker.MESSAGE);
-				} catch (CoreException e) {
-					Logger.logException(e);
-				}
-				text.append(resultText);
+			if(match.getElement() instanceof BasicSearchMatchElement) {
+				element = (BasicSearchMatchElement) match.getElement();
 			}
-		} else {
-			text.append(element.toString());
+		} else if(obj instanceof BasicSearchMatchElement) {
+			element = (BasicSearchMatchElement)obj;
 		}
-		return text.toString();
-	}
-
-	public boolean isLabelProperty(Object element, String property) {
-		return false;
-	}
-
-	public void removeListener(ILabelProviderListener listener) {
-		// do nothing
+		
+		//get the match count if possible
+		int matchCount = 0;
+		Match[] matches = new Match[0];
+		if(fPage != null) {
+			matches = fPage.getInput().getMatches(obj);
+			matchCount = matches.length;
+		}
+		
+		//if everything was of the right type create our formated message,
+		//else use the toString of the given object for the message
+		if(element != null) {
+			String message = element.getLine().trim(); //$NON-NLS-1$
+			int trimedAmount = element.getLine().indexOf(message);
+			String lineNum = element.getLineNum() + 1 + ": "; //$NON-NLS-1$
+			
+			styledText.append(lineNum, StyledString.QUALIFIER_STYLER);
+			styledText.append(message);
+			
+			//get the match count if possible
+			for(int i = 0; i < matchCount; ++i) {
+				int offset = matches[i].getOffset() - element.geLineOffset() + lineNum.length() - trimedAmount;
+				styledText.setStyle(offset, matches[i].getLength(), HIGHLIGHT_WRITE_STYLE);
+			}
+			
+		} else {
+			styledText.append(obj.toString());
+		}
+		
+		//append the match count if its worth appending
+		if (matchCount > 1) {
+			String matchesMsg = " " + MessageFormat.format(
+				SSEUIMessages.TextSearchLabelProvider_matchCountFormat,
+				new Object[] { new Integer(matchCount) });
+			styledText.append(matchesMsg, StyledString.COUNTER_STYLER);
+		}
+	
+		return styledText;
 	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchMatchElement.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchMatchElement.java
new file mode 100644
index 0000000..425c06a
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchMatchElement.java
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.search;
+
+import org.eclipse.core.resources.IFile;
+
+/**
+ * This is used as the element for a <code>Match</code> object by
+ * <code>BasicSearchQuery</code>.  It contains all the needed information
+ * for use by the query, result providers, and label providers.
+ *
+ * @see org.eclipse.search.ui.text.Match
+ * @see org.eclipse.wst.sse.ui.internal.search.BasicSearchQuery
+ */
+public class BasicSearchMatchElement {
+	/**
+	 * The file this element is a match on
+	 */
+	private IFile fFile;
+	
+	/**
+	 * The line number this element is a match on
+	 */
+	private int fLineNumber;
+	
+	/**
+	 * The offset of the line in the file
+	 */
+	private int fLineOffset;
+	
+	/**
+	 * The line this match is on
+	 */
+	private String fLine;
+	
+	/**
+	 * Constructor
+	 * 
+	 * @param file The file this element is a match on
+	 * @param lineNumber The line number this element is a match on
+	 * @param lineOffset The offset of the line in the file
+	 * @param message The message associated with this element
+	 */
+	public BasicSearchMatchElement(IFile file, int lineNumber, int lineOffset, String message) {
+		this.fFile = file;
+		this.fLineNumber = lineNumber;
+		this.fLineOffset = lineOffset;
+		this.fLine = message;
+	}
+	
+	/**
+	 * @return The file this element is a match on
+	 */
+	public IFile getFile() {
+		return this.fFile;
+	}
+	
+	/**
+	 * @return The line number this element is a match on
+	 */
+	public int getLineNum() {
+		return this.fLineNumber;
+	}
+	
+	/**
+	 * @return the offset of the line the match is on in the file
+	 */
+	public int geLineOffset() {
+		return this.fLineOffset;
+	}
+	
+	/**
+	 * @return The line this match is on
+	 */
+	public String getLine() {
+		return this.fLine;
+	}
+	
+	/**
+	 * <p>Two <code>BasicSearchMatchElement</code> are equal if they are
+	 * both on the same line. This helps with determining how many matches
+	 * are all on the same line which is automatically taken care of by
+	 * internal Eclipse search APIs so long as this equal method is structured
+	 * thusly.</p>
+	 * 
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	public boolean equals(Object obj) {
+		boolean equal = false;
+		
+		if(obj instanceof BasicSearchMatchElement) {
+			equal = getLineNum() == ((BasicSearchMatchElement)obj).getLineNum();
+		}
+		
+		return equal;
+	}
+	
+	/**
+	 * Like the <code>#equals</code> method this function is needed so
+	 * that the internal Eclipse search APIs can keep track of matches
+	 * that are on the same line.
+	 * 
+	 * @see java.lang.Object#hashCode()
+	 */
+	public int hashCode() {
+		return getLineNum() + getLine().hashCode();
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchQuery.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchQuery.java
index be29c23..d54823a 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchQuery.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchQuery.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,51 +12,104 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal.search;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
 import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.search.ui.ISearchQuery;
 import org.eclipse.search.ui.ISearchResult;
-import org.eclipse.search.ui.NewSearchUI;
+import org.eclipse.search.ui.text.AbstractTextSearchResult;
 import org.eclipse.search.ui.text.Match;
-import org.eclipse.ui.texteditor.MarkerUtilities;
 import org.eclipse.wst.sse.ui.internal.Logger;
 
 
 /**
- * @author pavery
+ * Defines a basic search query.  This query does not do anything, it needs to be extended
+ * and the <code>{@link #doQuery()}</code> method needs to be overridden to make the query
+ * actually be functional.
+ *
  */
 public class BasicSearchQuery implements ISearchQuery {
-
-	/** attribute to identify markers added by find occurrences */
-	public static final String ATTR_OCCURRENCES_MARKER = "occurrences_marker"; //$NON-NLS-1$
-
-	private static int LINE_LENGTH_LIMIT = 200;
-
-	/** the file we're searching * */
+	/**
+	 * the file we're searching
+	 */
 	private IFile fFile = null;
-	/** occurrence search matches * */
-	private List fMatches = null;
+	
+	/**
+	 * The result of this query
+	 */
+	private AbstractTextSearchResult fResult = null;
 
+	/**
+	 * <p>Construct a new basic query.</p>
+	 * 
+	 * <p><b>IMPORTANT: </b>It is very important that after
+	 * creating the query and <b>before</b> running the query
+	 * that you call {@link #setResult(AbstractTextSearchResult)}.
+	 * This is not a parameter because typically a search result needs
+	 * a reference to its query and thus the query needs to be constructed
+	 * before its result object can be set.</p>
+	 * 
+	 * @param file the file this query will take place on
+	 */
 	public BasicSearchQuery(IFile file) {
 		this.fFile = file;
-		this.fMatches = new ArrayList();
+	}
+	
+	/**
+	 * Runs the query
+	 * 
+	 * @see org.eclipse.search.ui.ISearchQuery#run(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public IStatus run(IProgressMonitor monitor) {
+		return doQuery();
+	}
+	
+	/**
+	 * public to avoid synthetic method access from inner class
+	 *
+	 * @return
+	 */
+	public IFile getFile() {
+		return this.fFile;
 	}
 
+	/**
+	 * There is no default label for a basic query,
+	 * this should be overridden by implementing classes
+	 * 
+	 * @see org.eclipse.search.ui.ISearchQuery#getLabel()
+	 */
+	public String getLabel() {
+		return ""; //$NON-NLS-1$
+	}
+
+	/**
+	 * <p>This will be <code>null</code> if {@link #setResult(AbstractTextSearchResult)}
+	 * has not been called yet.</p>
+	 * 
+	 * @see org.eclipse.search.ui.ISearchQuery#getSearchResult()
+	 */
+	public ISearchResult getSearchResult() {
+		return fResult;
+	}
+
+	/**
+	 * Adds a match to the results of this query.
+	 * 
+	 * <p><b>IMPORTANT: </b>It is very important that after
+	 * creating the query and <b>before</b> running the query
+	 * that you call {@link #setResult(AbstractTextSearchResult)}.
+	 * This is not a parameter because typically a search result needs
+	 * a reference to its query and thus the query needs to be constructed
+	 * before its result object can be set.</p>
+	 * 
+	 * @param document the document the match is being added too
+	 * @param matchStart the start character of the match
+	 * @param matchEnd the end character of the match
+	 */
 	public void addMatch(IDocument document, int matchStart, int matchEnd) {
 
 		try {
@@ -64,24 +117,21 @@
 			int lineStart = document.getLineOffset(lineNumber);
 			int lineLength = document.getLineLength(lineNumber);
 
-			String searchResultString = document.get().substring(lineStart, lineStart + lineLength).trim();
-
-			// create search marker (so annotations show up in editor)
-			IMarker marker = createSearchMarker(matchStart, matchEnd, lineNumber, searchResultString);
-
-			addMatch(new Match(marker, Match.UNIT_CHARACTER, matchStart, matchStart + matchEnd));
-
+			String elementMessage = document.get().substring(lineStart, lineStart + lineLength);
+			
+			//add the match to the result
+				BasicSearchMatchElement element = new BasicSearchMatchElement(fFile, lineNumber, lineStart, elementMessage);
+				fResult.addMatch(new Match(element, Match.UNIT_CHARACTER, matchStart, matchEnd - matchStart));
+			
 		} catch (BadLocationException e) {
 			Logger.logException(e);
 		}
 	}
 
-	private void addMatch(Match match) {
-		if (match != null)
-			this.fMatches.add(match);
-	}
-
 	/**
+	 * <p><i>Note: </i> as of yet no testing has gone into whether this query
+	 * can be re-run or not or what that even entails.<p>
+	 * 
 	 * @see org.eclipse.search.ui.ISearchQuery#canRerun()
 	 */
 	public boolean canRerun() {
@@ -89,129 +139,48 @@
 	}
 
 	/**
+	 * <p>This query can be run in the background</p>
+	 * 
 	 * @see org.eclipse.search.ui.ISearchQuery#canRunInBackground()
 	 */
 	public boolean canRunInBackground() {
 		return true;
 	}
-
-	public void clearMatches() {
-		this.fMatches.clear();
-	}
-
-	protected IMarker createSearchMarker(int matchStart, int matchEnd, int lineNumber, String searchResultString) {
-
-		IMarker marker = null;
-		try {
-			if (getFile() != null) {
-
-				marker = getFile().createMarker(NewSearchUI.SEARCH_MARKER);
-				HashMap attributes = new HashMap(6);
-
-				MarkerUtilities.setCharStart(attributes, matchStart);
-				MarkerUtilities.setCharEnd(attributes, matchEnd);
-				MarkerUtilities.setLineNumber(attributes, lineNumber);
-
-				// this might be bad if line of text is VERY long?
-				if (searchResultString.length() > LINE_LENGTH_LIMIT)
-					searchResultString = searchResultString.substring(0, LINE_LENGTH_LIMIT) + "..."; //$NON-NLS-1$
-				MarkerUtilities.setMessage(attributes, searchResultString);
-
-				// so we can remove them later
-				attributes.put(ATTR_OCCURRENCES_MARKER, new Boolean(true));
-
-				marker.setAttributes(attributes);
-			}
-		} catch (CoreException e) {
-			Logger.logException(e);
-		}
-		return marker;
-	}
-
-	private void deleteOccurrencesMarkers() {
-
-		final List removals = new ArrayList();
-		try {
-			// clear all old find occurrences markers
-			IMarker[] searchMarkers = fFile.findMarkers(NewSearchUI.SEARCH_MARKER, false, IResource.DEPTH_ZERO);
-			for (int i = 0; i < searchMarkers.length; i++) {
-				Object o = searchMarkers[i].getAttribute(BasicSearchQuery.ATTR_OCCURRENCES_MARKER);
-				if (o != null && ((Boolean) o).booleanValue() == true)
-					removals.add(searchMarkers[i]);
-
-			}
-
-			if (removals.size() > 0) {
-				IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
-					public void run(IProgressMonitor monitor) throws CoreException {
-						for (int i = 0; i < removals.size(); i++)
-							((IMarker) removals.get(i)).delete();
-					}
-				};
-				// BUG158846 - deadlock if lock up entire workspace, so only lock
-				// up the file we are searching on
-				ISchedulingRule markerRule = ResourcesPlugin.getWorkspace().getRuleFactory().markerRule(fFile);
-				ResourcesPlugin.getWorkspace().run(runnable, markerRule, IWorkspace.AVOID_UPDATE, null); 
-			}
-		} catch (CoreException e) {
-			Logger.logException(e);
-		}
-	}
-
+	
 	/**
-	 * The acutal work of the query. Will be run in a background Job
-	 * automatically if canRunInBackground(..) returns true.
+	 * <p>The actual work of the query, called by {@link #run(IProgressMonitor)}</p>
+	 * <p><i>Note: </i>This method should be overridden by implementers so that their query
+	 * will actually do something</p>
 	 * 
-	 * @return
+	 * @return the status of the query when it has finished
 	 */
 	protected IStatus doQuery() {
 		return Status.OK_STATUS;
 	}
-
-	/*
-	 * public to avoid synthetic method access from inner class
-	 */
-	public IFile getFile() {
-		return this.fFile;
-	}
-
+	
 	/**
-	 * @see org.eclipse.search.ui.ISearchQuery#getLabel()
+	 * @return the total number of matches this query found
 	 */
-	public String getLabel() {
-		return ""; //$NON-NLS-1$
+	protected int getMatchCount() {
+		return fResult.getMatchCount();
 	}
-
-	public Match[] getMatches() {
-		// get rid of the old markers
-		if(fFile.exists()) {
-			deleteOccurrencesMarkers();
-			doQuery();
-		}
-		return (Match[]) this.fMatches.toArray(new Match[this.fMatches.size()]);
-	}
-
+	
 	/**
-	 * @see org.eclipse.search.ui.ISearchQuery#getSearchResult()
-	 */
-	public ISearchResult getSearchResult() {
-		return null;
-	}
-
-	/**
-	 * used in search result display labels
+	 * <p>used in search result display labels, should be overridden by implementers</p>
 	 * 
 	 * @return
 	 */
 	protected String getSearchText() {
 		return ""; //$NON-NLS-1$
 	}
-
+	
 	/**
-	 * @see org.eclipse.search.ui.ISearchQuery#run(org.eclipse.core.runtime.IProgressMonitor)
+	 * <p>This <b>needs</b> to be called after constructing
+	 * the query but before running it, see note on {@link #BasicSearchQuery(IFile)}</p>
+	 * 
+	 * @param result the result this query will use to store its results
 	 */
-	public IStatus run(IProgressMonitor monitor) {
-		// defer to "get(...)"
-		return Status.OK_STATUS;
+	protected void setResult(AbstractTextSearchResult result) {
+		this.fResult = result;
 	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesActionDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesActionDelegate.java
index f8bb41c..ebc74e4 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesActionDelegate.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesActionDelegate.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -30,6 +30,8 @@
 import org.eclipse.ui.IViewActionDelegate;
 import org.eclipse.ui.IViewPart;
 import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
 import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
 
@@ -83,8 +85,14 @@
 		}
 		else {
 			String errorMessage = SSEUIMessages.FindOccurrencesActionProvider_0; //$NON-NLS-1$
-			PlatformStatusLineUtil.displayErrorMessage(errorMessage);
-			PlatformStatusLineUtil.addOneTimeClearListener();
+			if (fEditor instanceof StructuredTextEditor) {
+				PlatformStatusLineUtil.displayTemporaryErrorMessage(((StructuredTextEditor) fEditor).getTextViewer(), errorMessage);
+
+			}
+			else {
+				PlatformStatusLineUtil.displayErrorMessage(errorMessage);
+				PlatformStatusLineUtil.addOneTimeClearListener();
+			}
 		}
 	}
 
@@ -111,12 +119,25 @@
 		String partition = tr != null ? tr.getType() : ""; //$NON-NLS-1$
 
 		Iterator it = getProcessors().iterator();
-		FindOccurrencesProcessor action = null;
+		FindOccurrencesProcessor processor = null;
 		while (it.hasNext()) {
-			action = (FindOccurrencesProcessor) it.next();
+			processor = (FindOccurrencesProcessor) it.next();
 			// we just choose the first action that can handle the partition
-			if (action.enabledForParitition(partition))
-				return action;
+			if (processor.enabledForParitition(partition))
+				return processor;
+		}
+		List extendedFindOccurrencesProcessors = ExtendedConfigurationBuilder.getInstance().getConfigurations(FindOccurrencesProcessor.class.getName(), partition);
+		for (int i = 0; i < extendedFindOccurrencesProcessors.size(); i++) {
+			Object o = extendedFindOccurrencesProcessors.get(i);
+			if (o instanceof FindOccurrencesProcessor) {
+				/*
+				 * We just choose the first registered processor that
+				 * explicitly says it can handle the partition
+				 */
+				processor = (FindOccurrencesProcessor) o;
+				if (processor.enabledForParitition(partition))
+					return processor;
+			}
 		}
 		return null;
 	}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesProcessor.java
index 0c9d09f..dfe0917 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesProcessor.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesProcessor.java
@@ -76,7 +76,7 @@
 	 * @return <code>true</code> if this action can operate on this region
 	 *         type (ITextRegion), otherwise false.
 	 */
-	private boolean enabledForRegionType(String regionType) {
+	protected boolean enabledForRegionType(String regionType) {
 
 		String[] accept = getRegionTypes();
 		for (int i = 0; i < accept.length; i++) {
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesContentProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesContentProvider.java
index 11251fd..274c9b6 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesContentProvider.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesContentProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -26,8 +26,6 @@
 	private TableViewer fTableViewer = null;
 
 	public void clear() {
-		if (this.fResult != null)
-			this.fResult.clearMatches();
 		if (this.fTableViewer != null)
 			this.fTableViewer.refresh();
 	}
@@ -67,7 +65,7 @@
 	public Object[] getElements(Object inputElement) {
 
 		this.fResult = (OccurrencesSearchResult) inputElement;
-		return this.fResult.getMatches();
+		return this.fResult.getElements();
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchQuery.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchQuery.java
index cf1e48f..b37babf 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchQuery.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchQuery.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,7 +23,6 @@
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.search.ui.ISearchResult;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
@@ -105,9 +104,7 @@
 				Logger.logException(e);
 			}
 		}
-	}
-
-	// end inner class FindRegions
+	}// end inner class FindRegions
 
 
 	private IStructuredDocument fDocument = null;
@@ -116,29 +113,39 @@
 
 	public OccurrencesSearchQuery(IFile file, IStructuredDocument document, String regionText, String regionType) {
 		super(file);
+		super.setResult(new OccurrencesSearchResult(this));
 		this.fDocument = document;
 		this.fRegionText = regionText;
 		this.fRegionType = regionType;
 	}
 
-	public boolean canRerun() {
-		return false;
-	}
-
+	/**
+	 * <p><i>Note: </i>Some investigation needs to be put into how to do this safely</p>
+	 * 
+	 * @see org.eclipse.wst.sse.ui.internal.search.BasicSearchQuery#canRunInBackground()
+	 */
 	public boolean canRunInBackground() {
-		// pa_TODO investigate what is required to do this safely
 		return false;
 	}
+	
+	/**
+	 * <p>The label format is:<br/>
+	 * searchText - # occurrences in file</p>
+	 * 
+	 * @see org.eclipse.wst.sse.ui.internal.search.BasicSearchQuery#getLabel()
+	 */
+	public String getLabel() {
+		String label = SSEUIMessages.OccurrencesSearchQuery_0; //$NON-NLS-1$
+		String[] args = {getSearchText(), "" + super.getMatchCount(), getFilename()};
+		return MessageFormat.format(label, args);
+	}
 
-	/*
-	 * (non-Javadoc)
+	/**
+	 * This query looks for all occurrences of the selected string
 	 * 
 	 * @see org.eclipse.wst.sse.ui.internal.search.BasicSearchQuery#doQuery()
 	 */
 	protected IStatus doQuery() {
-
-		clearMatches();
-
 		IStatus status = Status.OK_STATUS;
 		FindRegions findRegions = new FindRegions(this.fDocument, this.fRegionText, this.fRegionType);
 		try {
@@ -152,33 +159,14 @@
 		return status;
 	}
 
+	protected String getSearchText() {
+		return this.fRegionText;
+	}
+	
 	private String getFilename() {
 		String filename = SSEUIMessages.OccurrencesSearchQuery_2; //$NON-NLS-1$ "file"
 		if (getFile() != null)
 			filename = getFile().getName().toString();
 		return filename;
 	}
-
-	public String getLabel() {
-		String label = SSEUIMessages.OccurrencesSearchQuery_0; //$NON-NLS-1$
-		String[] args = {getSearchText(), getOccurrencesCountText(), getFilename()};
-		return MessageFormat.format(label, args);
-	}
-
-	/**
-	 * @return
-	 */
-	private String getOccurrencesCountText() {
-		String count = ""; //$NON-NLS-1$
-		// pa_TODO dynamically change count
-		return count;
-	}
-
-	public ISearchResult getSearchResult() {
-		return new OccurrencesSearchResult(this);
-	}
-
-	protected String getSearchText() {
-		return this.fRegionText;
-	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchResult.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchResult.java
index 2f7f712..8082773 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchResult.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchResult.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -40,11 +40,6 @@
 		this.fQuery = query;
 	}
 
-	public void clearMatches() {
-		if (getQuery() instanceof OccurrencesSearchQuery)
-			((OccurrencesSearchQuery) getQuery()).clearMatches();
-	}
-
 	/**
 	 * @see org.eclipse.search.ui.text.IEditorMatchAdapter#computeContainedMatches(org.eclipse.search.ui.text.AbstractTextSearchResult,
 	 *      org.eclipse.ui.IEditorPart)
@@ -64,9 +59,25 @@
 	 *      org.eclipse.core.resources.IFile)
 	 */
 	public Match[] computeContainedMatches(AbstractTextSearchResult result, IFile file) {
-		return getMatches();
+		Match[] matches = this.getMatches();
+		Match[] containedMatches = new Match[0];
+		
+		/* only contains matches if the file for one of the matches is the
+		 * same as the given file.
+		 * Note: all matches in a result are related to the same file
+		 */
+		if(matches.length > 0 &&
+			matches[0].getElement() instanceof BasicSearchMatchElement &&
+			((BasicSearchMatchElement)matches[0].getElement()).getFile().equals(file)) {
+			
+			containedMatches = matches;
+		}
+		return containedMatches;
 	}
 
+	/**
+	 * @see org.eclipse.search.ui.text.AbstractTextSearchResult#getEditorMatchAdapter()
+	 */
 	public IEditorMatchAdapter getEditorMatchAdapter() {
 		return this;
 	}
@@ -102,9 +113,11 @@
 		return getQuery().getLabel();
 	}
 
+	/**
+	 * @return the matches associated with this result
+	 */
 	public Match[] getMatches() {
-		// ensure that query is done running
-		return ((OccurrencesSearchQuery) getQuery()).getMatches();
+		return collectMatches(getElements());
 	}
 
 	public ISearchQuery getQuery() {
@@ -115,13 +128,29 @@
 		return getLabel();
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
+	/**
 	 * @see org.eclipse.search.ui.text.IEditorMatchAdapter#isShownInEditor(org.eclipse.search.ui.text.Match,
 	 *      org.eclipse.ui.IEditorPart)
 	 */
 	public boolean isShownInEditor(Match match, IEditorPart editor) {
 		return true;
 	}
+	
+	/**
+	 * <p>Taken from {@link org.eclipse.jdt.internal.ui.search.OccurrencesSearchResult#collectMatches}</p>
+	 * 
+	 * @param elements get the matches for these elements
+	 * @return the matches associated with this result
+	 */
+	private Match[] collectMatches(Object[] elements) {
+		Match[] matches= new Match[getMatchCount()];
+		int writeIndex= 0;
+		for (int i= 0; i < elements.length; i++) {
+			Match[] perElement= getMatches(elements[i]);
+			for (int j= 0; j < perElement.length; j++) {
+				matches[writeIndex++]= perElement[j];
+			}
+		}
+		return matches;
+	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchViewPage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchViewPage.java
index 2d54131..2e61980 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchViewPage.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchViewPage.java
@@ -12,10 +12,12 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal.search;
 
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
 import org.eclipse.search.ui.text.AbstractTextSearchViewPage;
 import org.eclipse.search.ui.text.Match;
 import org.eclipse.ui.IEditorPart;
@@ -25,7 +27,6 @@
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.ide.IGotoMarker;
 import org.eclipse.wst.sse.ui.internal.Logger;
 
 
@@ -55,8 +56,17 @@
 	 */
 	protected void configureTableViewer(TableViewer viewer) {
 
-		// pa_TODO need sorter?
-		viewer.setLabelProvider(new BasicSearchLabelProvider());
+		//sort results by line number, low to high
+		viewer.setComparator(new ViewerComparator() {
+			public int compare(Viewer v, Object obj1, Object obj2) {
+				BasicSearchMatchElement elem1= (BasicSearchMatchElement) obj1;
+				BasicSearchMatchElement elem2= (BasicSearchMatchElement) obj2;
+				return elem1.getLineNum() - elem2.getLineNum();
+			}
+		});
+		
+		//allow for formated labels
+		viewer.setLabelProvider(new DelegatingStyledCellLabelProvider(new BasicSearchLabelProvider(this)));
 		this.fContentProvider = new OccurrencesContentProvider();
 		viewer.setContentProvider(this.fContentProvider);
 	}
@@ -91,50 +101,27 @@
 	}
 
 	/**
-	 * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#getDisplayedMatches(java.lang.Object)
+	 * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#showMatch(org.eclipse.search.ui.text.Match,
+	 *      int, int)
 	 */
-	public Match[] getDisplayedMatches(Object element) {
-		// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=2640
-		// we only ever show one at a time, the element passed in is the match
-		// super was returning null
-		return new Match[]{(Match) element};
-	}
-
-	private void show(IMarker marker) {
-
-		IResource resource = marker.getResource();
-		if (resource == null || !resource.exists())
-			return;
-
+	protected void showMatch(Match match, int currentOffset, int currentLength, boolean activate) throws PartInitException {
+		BasicSearchMatchElement element = (BasicSearchMatchElement) match.getElement();
+		
 		IWorkbenchPage activePage = getActivePage();
 		try {
 			if (activePage != null) {
-
 				// open editor if needed
-				IDE.openEditor(getActivePage(), marker);
-
+				IDE.openEditor(getActivePage(), element.getFile());
+				//set the selection in the open editor
 				IEditorPart editor = activePage.getActiveEditor();
-				if (editor != null) {
-					IGotoMarker gotoMarker = (IGotoMarker) editor.getAdapter(IGotoMarker.class);
-					if (gotoMarker != null)
-						gotoMarker.gotoMarker(marker);
-				}
-
+				if (activate)
+					editor.getSite().getPage().activate(editor);
+				editor.getEditorSite().getSelectionProvider().setSelection(
+					new TextSelection(currentOffset, currentLength));
 			}
 		} catch (PartInitException e) {
 			// possible exception trying to open editor
 			Logger.logException(e);
 		}
 	}
-
-	/**
-	 * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#showMatch(org.eclipse.search.ui.text.Match,
-	 *      int, int)
-	 */
-	protected void showMatch(Match match, int currentOffset, int currentLength) throws PartInitException {
-		Object o = match.getElement();
-		if (o instanceof IMarker) {
-			show((IMarker) o);
-		}
-	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/ISpellcheckDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/ISpellcheckDelegate.java
new file mode 100644
index 0000000..ce55c8f
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/ISpellcheckDelegate.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.spelling;
+
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+
+/**
+ * <p>Defines an interface for deciding if an offset in an <code>IStructuredModel</code>
+ * should be spell checked. Created so that content type specific decisions
+ * could be made as to whether a region should be spell-checked or not.
+ * This is done using the <code>IAdapterFactory</code> framework.</p>
+ */
+public interface ISpellcheckDelegate {
+
+	/**
+	 * Decide if the <code>offset</code> in <code>model</code> should be spell checked or not.
+	 * 
+	 * @param offset decide if this offset in the given <code>model</code> should be spell-checked 
+	 * @param model used to decide if the given <code>offset</code> should be spell-checked
+	 * @return <code>true</code> if the given <code>offset</code> in the given <code>model</code>
+	 * should be spell checked, <code>false</code> otherwise.
+	 */
+	public boolean shouldSpellcheck(int offset, IStructuredModel model);
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellcheckStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellcheckStrategy.java
index 57e17f9..d75e8e6 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellcheckStrategy.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellcheckStrategy.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * Copyright (c) 2006, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -20,7 +20,6 @@
 
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.Position;
@@ -36,13 +35,17 @@
 import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.ui.editors.text.EditorsUI;
 import org.eclipse.ui.texteditor.spelling.ISpellingProblemCollector;
+import org.eclipse.ui.texteditor.spelling.SpellingAnnotation;
 import org.eclipse.ui.texteditor.spelling.SpellingContext;
 import org.eclipse.ui.texteditor.spelling.SpellingProblem;
 import org.eclipse.ui.texteditor.spelling.SpellingService;
+import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.parser.ForeignRegion;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
 import org.eclipse.wst.sse.core.utils.StringUtils;
 import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
 import org.eclipse.wst.sse.ui.internal.Logger;
@@ -78,7 +81,7 @@
 
 		public void accept(SpellingProblem problem) {
 			if (isInterestingProblem(problem)) {
-				TemporaryAnnotation annotation = new TemporaryAnnotation(new Position(problem.getOffset(), problem.getLength()), TemporaryAnnotation.ANNOT_WARNING, problem.getMessage(), fReconcileAnnotationKey);
+				TemporaryAnnotation annotation = new TemporaryAnnotation(new Position(problem.getOffset(), problem.getLength()), SpellingAnnotation.TYPE, problem.getMessage(), fReconcileAnnotationKey);
 
 				SpellingQuickAssistProcessor quickAssistProcessor = new SpellingQuickAssistProcessor();
 				quickAssistProcessor.setSpellingProblem(problem);
@@ -219,16 +222,26 @@
 	protected boolean isInterestingProblem(SpellingProblem problem) {
 		IDocument document = getDocument();
 		if (document instanceof IStructuredDocument) {
+			/*
+			 * If the error is in a read-only section, ignore it. The user
+			 * won't be able to correct it.
+			 */
+			if (((IStructuredDocument) document).containsReadOnly(problem.getOffset(), problem.getLength()))
+				return false;
+
 			IStructuredDocumentRegion documentRegion = ((IStructuredDocument) document).getRegionAtCharacterOffset(problem.getOffset());
 			if (documentRegion != null) {
 				ITextRegion textRegion = documentRegion.getRegionAtCharacterOffset(problem.getOffset());
-				if (textRegion != null && isSupportedContext(textRegion.getType())) {
+				//if the region is not null, and is a supported context and is not a collection of regions,
+				//	and it should be spell-checked, then spell check it.
+				if (textRegion != null && isSupportedContext(textRegion.getType()) && !(textRegion instanceof ITextRegionCollection) && shouldSpellcheck(problem.getOffset())) {
 					return true;
 				}
 				if (documentRegion.getFirstRegion() instanceof ForeignRegion)
 					return false;
-				if (documentRegion.getRegions().size() == 1)
-					return true;
+//				[192572] Simple regions were being spellchecked just for the sake of them being simple
+//				if (documentRegion.getRegions().size() == 1)
+//					return true;
 				return false;
 			}
 		}
@@ -252,11 +265,14 @@
 		return isSupported;
 	}
 
-	void reconcile() {
+	public void reconcile() {
 		IDocument document = getDocument();
 		if (document != null) {
-			IRegion documentRegion = new Region(0, document.getLength());
-			reconcile(documentRegion);
+			IAnnotationModel annotationModel = getAnnotationModel();
+			if (annotationModel != null) {
+				IRegion documentRegion = new Region(0, document.getLength());
+				spellCheck(documentRegion, documentRegion, annotationModel);
+			}
 		}
 	}
 
@@ -287,11 +303,16 @@
 			if (_DEBUG_SPELLING) {
 				Logger.log(Logger.INFO, "Spell Checking [" + dirtyRegion.getOffset() + ":" + dirtyRegion.getLength() + "] : " + (System.currentTimeMillis() - time0));
 			}
-			spellCheck(dirtyRegion, dirtyRegion, annotationModel);
+			if (annotationModel != null) {
+				spellCheck(dirtyRegion, dirtyRegion, annotationModel);
+			}
 		}
 	}
 
-	private void spellCheck(DirtyRegion dirtyRegion, IRegion regionToBeChecked, IAnnotationModel annotationModel) {
+	private void spellCheck(IRegion dirtyRegion, IRegion regionToBeChecked, IAnnotationModel annotationModel) {
+		if (annotationModel == null)
+			return;
+
 		TemporaryAnnotation[] annotationsToRemove;
 		Annotation[] annotationsToAdd;
 		annotationsToRemove = getSpellingAnnotationsToRemove(regionToBeChecked);
@@ -300,7 +321,7 @@
 			Logger.log(Logger.INFO, "Spell checking [" + regionToBeChecked.getOffset() + "-" + (regionToBeChecked.getOffset() + regionToBeChecked.getLength()) + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 		}
 		if (getDocument() != null) {
-			EditorsUI.getSpellingService().check(getDocument(), new IRegion[]{dirtyRegion}, fSpellingContext, fProblemCollector, null);
+			EditorsUI.getSpellingService().check(getDocument(), new IRegion[]{regionToBeChecked}, fSpellingContext, fProblemCollector, null);
 		}
 		annotationsToAdd = fProblemCollector.getAnnotations();
 		fProblemCollector.clear();
@@ -331,15 +352,11 @@
 	 */
 
 	public void reconcile(IRegion partition) {
-		DirtyRegion region = null;
 		IDocument document = getDocument();
 		if (document != null) {
-			try {
-				region = new DirtyRegion(partition.getOffset(), partition.getLength(), DirtyRegion.INSERT, document.get(partition.getOffset(), partition.getLength()));
-				reconcile(region, region);
-			}
-			catch (BadLocationException e) {
-				Logger.logException(e);
+			IAnnotationModel annotationModel = getAnnotationModel();
+			if (annotationModel != null) {
+				spellCheck(partition, partition, annotationModel);
 			}
 		}
 	}
@@ -355,4 +372,36 @@
 			EditorsUI.getPreferenceStore().addPropertyChangeListener(fSpellCheckPreferenceListener);
 		}
 	}
+	
+	/**
+	 * Decides if the given offset should be spell-checked using an <code>IAdapterFactory</code>
+	 * 
+	 * @param offset Decide if this offset should be spell-checked
+	 * @return <code>true</code> if the given <code>offset</code> should be spell-checked,
+	 * <code>false</code> otherwise.
+	 */
+	private boolean shouldSpellcheck(int offset) {
+		boolean decision = true;
+		
+		IStructuredModel model = null;
+		try {
+			model = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
+			
+			/* use an an adapter factory to get a spell-check decision maker,
+			 * and ask it if the  offset should be spell-checked.  It is done
+			 * this way so content type specific decisions can be made without this
+			 * plugin being aware of any content type specifics.
+			 */
+			ISpellcheckDelegate delegate = (ISpellcheckDelegate)Platform.getAdapterManager().getAdapter(model, ISpellcheckDelegate.class);
+			if(delegate != null) {
+				decision = delegate.shouldSpellcheck(offset, model);
+			}
+		}  finally {
+			if(model != null) {
+				model.releaseFromRead();
+			}
+		}
+		
+		return decision;
+	}
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellingQuickAssistProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellingQuickAssistProcessor.java
index d96f0f4..f8e4ddd 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellingQuickAssistProcessor.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellingQuickAssistProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -37,7 +37,7 @@
 		ICompletionProposal[] proposals = null;
 
 		if (fSpellingProblem != null) {
-			proposals = fSpellingProblem.getProposals();
+			proposals = fSpellingProblem.getProposals(quickAssistContext);
 		}
 		return proposals;
 	}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingManager.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingManager.java
new file mode 100644
index 0000000..a7140f5
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingManager.java
@@ -0,0 +1,740 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.style;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.reconciler.IReconciler;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.sse.ui.ISemanticHighlighting;
+import org.eclipse.wst.sse.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
+import org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler;
+import org.eclipse.wst.sse.ui.internal.reconcile.DocumentRegionProcessor;
+import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
+
+/**
+ * Semantic highlighting manager. Responsible for maintaining the semantic highlightings
+ * and the associated styles. Semantic highlighting preference changes are handled
+ * through listeners in this class. Based on org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingManager
+ * 
+ * @since 3.1
+ */
+public class SemanticHighlightingManager implements IPropertyChangeListener {
+	
+	/**
+	 * HighlightingStyle.
+	 */
+	static class HighlightingStyle {
+
+		/** Text attribute */
+		private TextAttribute fTextAttribute;
+		/** Enabled state */
+		private boolean fIsEnabled;
+
+		/**
+		 * Initialize with the given text attribute.
+		 * @param textAttribute The text attribute
+		 * @param isEnabled the enabled state
+		 */
+		public HighlightingStyle(TextAttribute textAttribute, boolean isEnabled) {
+			setTextAttribute(textAttribute);
+			setEnabled(isEnabled);
+		}
+
+		/**
+		 * @return Returns the text attribute.
+		 */
+		public TextAttribute getTextAttribute() {
+			return fTextAttribute;
+		}
+
+		/**
+		 * @param textAttribute The background to set.
+		 */
+		public void setTextAttribute(TextAttribute textAttribute) {
+			fTextAttribute = textAttribute;
+		}
+
+		/**
+		 * @return the enabled state
+		 */
+		public boolean isEnabled() {
+			return fIsEnabled;
+		}
+
+		/**
+		 * @param isEnabled the new enabled state
+		 */
+		public void setEnabled(boolean isEnabled) {
+			fIsEnabled = isEnabled;
+		}
+	}
+	
+	/**
+	 * Highlighted Positions.
+	 */
+	static class HighlightedPosition extends Position {
+
+		/** Highlighting of the position */
+		private HighlightingStyle fStyle;
+
+		private boolean fReadOnly;
+
+		/** Lock object */
+		private Object fLock;
+
+		/**
+		 * Initialize the styled positions with the given offset, length and foreground color.
+		 *
+		 * @param offset The position offset
+		 * @param length The position length
+		 * @param highlighting The position's highlighting
+		 * @param lock The lock object
+		 */
+		public HighlightedPosition(int offset, int length, HighlightingStyle highlighting, Object lock, boolean isReadOnly) {
+			super(offset, length);
+			fStyle = highlighting;
+			fLock = lock;
+			fReadOnly = isReadOnly;
+		}
+
+		public HighlightedPosition(int offset, int length, HighlightingStyle highlighting, Object lock) {
+			this(offset, length, highlighting, lock, false);
+		}
+
+		public HighlightedPosition(Position position, HighlightingStyle highlighting, Object lock) {
+			this(position.offset, position.length, highlighting, lock, false);
+		}
+
+		public HighlightedPosition(Position position, HighlightingStyle highlighting, Object lock, boolean isReadOnly) {
+			this(position.offset, position.length, highlighting, lock, isReadOnly);
+		}
+
+		/**
+		 * @return Returns a corresponding style range.
+		 */
+		public StyleRange createStyleRange() {
+			int len= 0;
+			if (fStyle.isEnabled())
+				len= getLength();
+
+			TextAttribute textAttribute = fStyle.getTextAttribute();
+			int style = textAttribute.getStyle();
+			int fontStyle = style & (SWT.ITALIC | SWT.BOLD | SWT.NORMAL);
+			StyleRange styleRange = new StyleRange(getOffset(), len, textAttribute.getForeground(), textAttribute.getBackground(), fontStyle);
+			styleRange.strikeout = (style & TextAttribute.STRIKETHROUGH) != 0;
+			styleRange.underline = (style & TextAttribute.UNDERLINE) != 0;
+
+			return styleRange;
+		}
+
+		/**
+		 * Uses reference equality for the highlighting.
+		 *
+		 * @param off The offset
+		 * @param len The length
+		 * @param highlighting The highlighting
+		 * @return <code>true</code> iff the given offset, length and highlighting are equal to the internal ones.
+		 */
+		public boolean isEqual(int off, int len, HighlightingStyle highlighting) {
+			synchronized (fLock) {
+				return !isDeleted() && getOffset() == off && getLength() == len && fStyle == highlighting;
+			}
+		}
+		
+		/**
+		 * Uses reference equality for the highlighting.
+		 *
+		 * @param pos The position
+		 * @param highlighting The highlighting
+		 * @return <code>true</code> iff the given offset, length and highlighting are equal to the internal ones.
+		 */
+		public boolean isEqual(Position pos, HighlightingStyle highlighting) {
+			synchronized (fLock) {
+				return !isDeleted() && getOffset() == pos.getOffset() && getLength() == pos.getLength() && fStyle == highlighting;
+			}
+		}
+
+		/**
+		 * Is this position contained in the given range (inclusive)? Synchronizes on position updater.
+		 *
+		 * @param off The range offset
+		 * @param len The range length
+		 * @return <code>true</code> iff this position is not delete and contained in the given range.
+		 */
+		public boolean isContained(int off, int len) {
+			synchronized (fLock) {
+				return !isDeleted() && off <= getOffset() && off + len >= getOffset() + getLength();
+			}
+		}
+
+		public void update(int off, int len) {
+			synchronized (fLock) {
+				super.setOffset(off);
+				super.setLength(len);
+			}
+		}
+
+		/*
+		 * @see org.eclipse.jface.text.Position#setLength(int)
+		 */
+		public void setLength(int length) {
+			synchronized (fLock) {
+				super.setLength(length);
+			}
+		}
+
+		/*
+		 * @see org.eclipse.jface.text.Position#setOffset(int)
+		 */
+		public void setOffset(int offset) {
+			synchronized (fLock) {
+				super.setOffset(offset);
+			}
+		}
+
+		/*
+		 * @see org.eclipse.jface.text.Position#delete()
+		 */
+		public void delete() {
+			synchronized (fLock) {
+				super.delete();
+			}
+		}
+
+		/*
+		 * @see org.eclipse.jface.text.Position#undelete()
+		 */
+		public void undelete() {
+			synchronized (fLock) {
+				super.undelete();
+			}
+		}
+
+		/**
+		 * @return Returns the highlighting.
+		 */
+		public HighlightingStyle getHighlighting() {
+			return fStyle;
+		}
+
+		public boolean isReadOnly() {
+			return fReadOnly;
+		}
+	}
+
+	/**
+	 * Highlighted ranges.
+	 */
+	public static class HighlightedRange extends Region {
+		/** The highlighting key as returned by {@link ISemanticHighlighting#getPreferenceKey()}. */
+		private String fKey;
+
+		/**
+		 * Initialize with the given offset, length and highlighting key.
+		 *
+		 * @param offset
+		 * @param length
+		 * @param key the highlighting key as returned by {@link ISemanticHighlighting#getPreferenceKey()}
+		 */
+		public HighlightedRange(int offset, int length, String key) {
+			super(offset, length);
+			fKey = key;
+		}
+
+		/**
+		 * @return the highlighting key as returned by {@link ISemanticHighlighting#getPreferenceKey()}
+		 */
+		public String getKey() {
+			return fKey;
+		}
+
+		/*
+		 * @see org.eclipse.jface.text.Region#equals(java.lang.Object)
+		 */
+		public boolean equals(Object o) {
+			return super.equals(o) && o instanceof HighlightedRange && fKey.equals(((HighlightedRange)o).getKey());
+		}
+
+		/*
+		 * @see org.eclipse.jface.text.Region#hashCode()
+		 */
+		public int hashCode() {
+			return super.hashCode() | fKey.hashCode();
+		}
+	}
+	
+	private static final String SEMANTIC_HIGHLIGHTING_EXTENSION_POINT = "semanticHighlighting"; //$NON-NLS-1$
+	private static final String TARGET_ATTR = "target"; //$NON-NLS-1$
+	private static final String CLASS_ATTR = "class"; //$NON-NLS-1$
+	private static final String STYLE_KEY_ATTR = "styleStringKey"; //$NON-NLS-1$
+
+	private ISourceViewer fSourceViewer;
+	private IPreferenceStore fPreferenceStore;
+	private SourceViewerConfiguration fConfiguration;
+	private StructuredPresentationReconciler fPresentationReconciler;
+	private String fContentTypeId;
+	
+	private SemanticHighlightingPresenter fPresenter;
+	private SemanticHighlightingReconciler fReconciler;
+	
+	/** The semantic highlightings for the content type */
+	private ISemanticHighlighting[] fHighlightings;
+	/** The semantic highlighting styles associated with the semantic highlightings */
+	private HighlightingStyle[] fHighlightingStyles;
+	/** The semantic highlighting style string preference keys. null of the highlighting doesn't support it */
+	private String[] fHighlightingStyleStringKeys;
+	
+	private IPropertyChangeListener fHighlightingChangeListener = new IPropertyChangeListener() {
+
+		public void propertyChange(PropertyChangeEvent event) {
+				handleHighlightingPropertyChange(event);
+		}
+	};
+	
+	public void propertyChange(PropertyChangeEvent event) {
+		handlePropertyChange(event);
+	}
+	
+	public void install(ISourceViewer sourceViewer, IPreferenceStore preferenceStore, SourceViewerConfiguration configuration, String contentTypeId) {
+		fSourceViewer = sourceViewer;
+		fPreferenceStore = preferenceStore;
+		fConfiguration = configuration;
+		fContentTypeId = contentTypeId;
+		
+		fPreferenceStore.addPropertyChangeListener(this);
+		fPresentationReconciler = (StructuredPresentationReconciler) fConfiguration.getPresentationReconciler(fSourceViewer);
+		
+		if (isEnabled()) {
+			enable();
+		}
+	}
+	
+	/**
+	 * Load the semantic highlightings defined for this content type.
+	 */
+	private void loadSemanticHighlightings() {
+		List semantics = new ArrayList(0);
+		
+		ISemanticHighlighting highlighting = null;
+		String styleKey = null;
+		IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(SSEUIPlugin.ID, SEMANTIC_HIGHLIGHTING_EXTENSION_POINT);
+		
+		IContentType contentType = Platform.getContentTypeManager().getContentType(fContentTypeId);
+		
+		for (int i = 0; i < elements.length; i++) {
+			String[] targets = StringUtils.unpack(elements[i].getAttribute(TARGET_ATTR));
+			for (int j = 0; j < targets.length; j++) {
+				IContentType targetContentType = Platform.getContentTypeManager().getContentType(targets[j]);
+				/* Apply semantic highlighting to kinds of targetContentType */
+				if (contentType.isKindOf(targetContentType)) {
+					try {
+						highlighting = (ISemanticHighlighting) elements[i].createExecutableExtension(CLASS_ATTR);
+						styleKey = elements[i].getAttribute(STYLE_KEY_ATTR);
+					} catch (CoreException e) {
+						Logger.logException(e);
+					}
+					if (highlighting != null)
+						semantics.add(new SemanticContent(targetContentType, highlighting, styleKey));
+
+					break;
+				}
+			}
+		}
+		/* Sort the semantics, so that styles will be applied from general to specific */
+		Collections.sort(semantics);
+		fHighlightings = new ISemanticHighlighting[semantics.size()];
+		fHighlightingStyles = new HighlightingStyle[semantics.size()];
+		fHighlightingStyleStringKeys = new String[semantics.size()];
+
+		for (int i = 0; i < semantics.size(); i++) {
+			fHighlightings[i] = ((SemanticContent) semantics.get(i)).getHighlighting();
+			styleKey = ((SemanticContent) semantics.get(i)).getStyleKey();
+			fHighlightingStyles[i] = createHighlightingStyle(((SemanticContent) semantics.get(i)).getHighlighting(), styleKey);
+			fHighlightingStyleStringKeys[i] = styleKey;
+		}
+	}
+	
+	/**
+	 * This class is used for relating a semantic highlighting to a content type.
+	 * The content type is used in the sorting algorithm. Content types that are more specific
+	 * to the file's content type will cause styles to be applied from general to specific
+	 */
+	private class SemanticContent implements Comparable {
+		public IContentType type;
+		public ISemanticHighlighting highlighting;
+		public String styleKey;
+
+		public SemanticContent(IContentType type, ISemanticHighlighting highlighting, String styleKey) {
+			this.type = type;
+			this.highlighting = highlighting;
+			this.styleKey = styleKey;
+		}
+
+		public int compareTo(Object arg0) {
+			SemanticContent other = (SemanticContent) arg0;
+			/* Equal weighting for the same types */
+			if (this.type.equals(other.type))
+				return 0;
+			/* Subtypes have more weight than base types */
+			if (this.type.isKindOf(other.type))
+				return 1;
+			return -1;
+		}
+		
+		public ISemanticHighlighting getHighlighting() {
+			return highlighting;
+		}
+
+		public String getStyleKey() {
+			return styleKey;
+		}
+	}
+	
+	/**
+	 * Creates a highlighting style based on the preferences defined in the semantic highlighting
+	 * @param highlighting the semantic highlighting
+	 * @return a highlighting style based on the preferences of the semantic highlighting
+	 */
+	private HighlightingStyle createHighlightingStyle(ISemanticHighlighting highlighting, String styleKey) {
+		IPreferenceStore store = highlighting.getPreferenceStore();
+		HighlightingStyle highlightingStyle = null;
+		if (store != null) {
+			TextAttribute attribute = null;
+			// A style string is used instead of separate attribute keys
+			if (styleKey != null) {
+				attribute = createTextAttribute(store.getString(styleKey));
+			}
+			else {
+				int style = getBoolean(store, highlighting.getBoldPreferenceKey()) ? SWT.BOLD : SWT.NORMAL;
+				
+				if (getBoolean(store, highlighting.getItalicPreferenceKey()))
+					style |= SWT.ITALIC;
+				if (getBoolean(store, highlighting.getStrikethroughPreferenceKey()))
+					style |= TextAttribute.STRIKETHROUGH;
+				if (getBoolean(store, highlighting.getUnderlinePreferenceKey()))
+					style |= TextAttribute.UNDERLINE;
+
+				String rgbString = getString(store, highlighting.getColorPreferenceKey());
+				Color color = null;
+				
+				if (rgbString != null)
+					color = EditorUtility.getColor(ColorHelper.toRGB(rgbString));
+				attribute = new TextAttribute(color, null, style);
+			}
+
+			store.addPropertyChangeListener(fHighlightingChangeListener);
+			boolean isEnabled = getBoolean(store, highlighting.getEnabledPreferenceKey());
+			highlightingStyle = new HighlightingStyle(attribute, isEnabled);
+		}
+		return highlightingStyle;
+	}
+
+	/**
+	 * Creates a text attribute from the style string
+	 * 
+	 * @param styleValue style string in the form: <code>RGB foreground (#rrggbb) | RGB background (#rrggbb) | bold (true/false) | italic (true/false) | strikethrough (true/false) | underline (true/false)</code>
+	 * @return text attribute created from the <code>styleValue</code> or null if the <code>styleValue</code> is invalid
+	 */
+	private TextAttribute createTextAttribute(String styleValue) {
+		String[] values = ColorHelper.unpackStylePreferences(styleValue);
+		if (values.length < 6)
+			return null;
+
+		RGB foreground = ColorHelper.toRGB(values[0]);
+		RGB background = ColorHelper.toRGB(values[1]);
+		boolean bold = Boolean.valueOf(values[2]).booleanValue();
+		boolean italic = Boolean.valueOf(values[3]).booleanValue();
+		boolean strikethrough = Boolean.valueOf(values[4]).booleanValue();
+		boolean underline = Boolean.valueOf(values[5]).booleanValue();
+
+		int style = SWT.NORMAL;
+		if (bold)
+			style = style | SWT.BOLD;
+		if (italic)
+			style = style | SWT.ITALIC;
+		if (strikethrough)
+			style = style | TextAttribute.STRIKETHROUGH;
+		if (underline)
+			style = style | TextAttribute.UNDERLINE;
+
+		return createTextAttribute(foreground, background, style);
+	}
+
+	private TextAttribute createTextAttribute(RGB foreground, RGB background, int style) {
+		return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, style);
+	}
+
+	/**
+	 * Looks up a boolean preference by <code>key</code> from the preference store
+	 * @param store the preference store to lookup the preference from
+	 * @param key the key the preference is stored under
+	 * @return the preference value from the preference store iff key is not null
+	 */
+	private boolean getBoolean(IPreferenceStore store, String key) {
+		return (key == null) ? false : store.getBoolean(key);
+	}
+	
+	/**
+	 * Looks up a String preference by <code>key</code> from the preference store
+	 * @param store the preference store to lookup the preference from
+	 * @param key the key the preference is stored under
+	 * @return the preference value from the preference store iff key is not null
+	 */
+	private String getString(IPreferenceStore store, String key) {
+		return (key == null) ? null : store.getString(key);
+	}
+
+	/**
+	 * Enable semantic highlighting.
+	 */
+	private void enable() {
+		
+		loadSemanticHighlightings();
+		
+		fPresenter = new SemanticHighlightingPresenter();
+		fPresenter.install(fSourceViewer, fPresentationReconciler);
+//		if (fEditor != null) {
+			fReconciler = new SemanticHighlightingReconciler();
+			fReconciler.install(fSourceViewer, fPresenter, fHighlightings, fHighlightingStyles);
+			IReconciler reconciler = fConfiguration.getReconciler(fSourceViewer);
+			if (reconciler instanceof DocumentRegionProcessor)
+				((DocumentRegionProcessor) reconciler).setSemanticHighlightingStrategy(fReconciler);
+//		} else {
+//			fPresenter.updatePresentation(null, createHardcodedPositions(), new HighlightedPosition[0]);
+//		}
+	}
+	
+	/**
+	 * Disable semantic highlighting
+	 */
+	private void disable() {
+		if (fReconciler != null) {
+			fReconciler.uninstall();
+			fReconciler = null;
+		}
+		
+		if (fPresenter != null) {
+			fPresenter.uninstall();
+			fPresenter = null;
+		}
+		
+		if (fHighlightings != null)
+			disposeHighlightings();
+	}
+	
+	private void disposeHighlightings() {
+		/* Remove the property change listener before clearing the lists */
+		if (fHighlightings != null) {
+			for (int i = 0; i < fHighlightings.length; i++) {
+				IPreferenceStore store = fHighlightings[i].getPreferenceStore();
+				if (store != null)
+					store.removePropertyChangeListener(fHighlightingChangeListener);
+			}
+		}
+		
+		fHighlightings = null;
+		fHighlightingStyles = null;
+		fHighlightingStyleStringKeys = null;
+	}
+	
+	/**
+	 * Handles property change events for individual semantic highlightings.
+	 * @param event
+	 */
+	private void handleHighlightingPropertyChange(PropertyChangeEvent event) {
+		String property = event.getProperty();
+		if (property == null)
+			return;
+		
+		boolean refreshRequired = false;
+		
+		for (int i = 0; i < fHighlightings.length; i++) {
+			ISemanticHighlighting highlighting = fHighlightings[i];
+
+			if (fHighlightingStyleStringKeys[i] != null) {
+				if (property.equals(fHighlightingStyleStringKeys[i])) {
+					adaptToStyleChange(fHighlightingStyles[i], event);
+					fPresenter.highlightingStyleChanged(fHighlightingStyles[i]);
+					refreshRequired = true;
+					continue;
+				}
+			}
+
+			if (property.equals(highlighting.getBoldPreferenceKey())) {
+				adaptToTextStyleChange(fHighlightingStyles[i], event, SWT.BOLD);
+				fPresenter.highlightingStyleChanged(fHighlightingStyles[i]);
+				refreshRequired = true;
+				continue;
+			}
+			
+			if (property.equals(highlighting.getColorPreferenceKey())) {
+				adaptToTextForegroundChange(fHighlightingStyles[i], event);
+				fPresenter.highlightingStyleChanged(fHighlightingStyles[i]);
+				refreshRequired = true;
+				continue;
+			}
+			
+			if (property.equals(highlighting.getEnabledPreferenceKey())) {
+				adaptToEnablementChange(fHighlightingStyles[i], event);
+				fPresenter.highlightingStyleChanged(fHighlightingStyles[i]);
+				refreshRequired = true;
+				continue;
+			}
+			
+			if (property.equals(highlighting.getItalicPreferenceKey())) {
+				adaptToTextStyleChange(fHighlightingStyles[i], event, SWT.ITALIC);
+				fPresenter.highlightingStyleChanged(fHighlightingStyles[i]);
+				refreshRequired = true;
+				continue;
+			}
+			
+			if (property.equals(highlighting.getStrikethroughPreferenceKey())) {
+				adaptToTextStyleChange(fHighlightingStyles[i], event, TextAttribute.STRIKETHROUGH);
+				fPresenter.highlightingStyleChanged(fHighlightingStyles[i]);
+				refreshRequired = true;
+				continue;
+			}
+			
+			if (property.equals(highlighting.getUnderlinePreferenceKey())) {
+				adaptToTextStyleChange(fHighlightingStyles[i], event, TextAttribute.UNDERLINE);
+				fPresenter.highlightingStyleChanged(fHighlightingStyles[i]);
+				refreshRequired = true;
+				continue;
+			}
+		}
+		
+		if (refreshRequired && fReconciler != null)
+			fReconciler.refresh();
+	}
+	
+	/**
+	 * Handles property changes for enabling and disabling semantic highlighting for
+	 * Structured Source Editors
+	 * @param event
+	 */
+	private void handlePropertyChange(PropertyChangeEvent event) {
+		String property = event.getProperty();
+		if (property == null || !property.equals(EditorPreferenceNames.SEMANTIC_HIGHLIGHTING))
+			return;
+		
+		Object newValue = event.getNewValue();
+		if (newValue instanceof Boolean) {
+			if (((Boolean) newValue).booleanValue())
+				enable();
+			else
+				disable();
+		}
+		
+		if (fReconciler != null)
+			fReconciler.refresh();
+	}
+	
+	private void adaptToEnablementChange(HighlightingStyle highlighting, PropertyChangeEvent event) {
+		Object value = event.getNewValue();
+		boolean eventValue;
+		if (value instanceof Boolean)
+			eventValue = ((Boolean) value).booleanValue();
+		else if (IPreferenceStore.TRUE.equals(value))
+			eventValue = true;
+		else
+			eventValue = false;
+		highlighting.setEnabled(eventValue);
+	}
+
+	private void adaptToTextForegroundChange(HighlightingStyle highlighting, PropertyChangeEvent event) {
+		RGB rgb = null;
+
+		Object value = event.getNewValue();
+		if (value instanceof RGB)
+			rgb= (RGB) value;
+		else if (value instanceof String)
+			rgb= ColorHelper.toRGB( (String) value);
+
+		if (rgb != null) {
+			Color color= EditorUtility.getColor(rgb);
+			TextAttribute oldAttr= highlighting.getTextAttribute();
+			highlighting.setTextAttribute(new TextAttribute(color, oldAttr.getBackground(), oldAttr.getStyle()));
+		}
+	}
+	
+	private void adaptToTextStyleChange(HighlightingStyle highlighting, PropertyChangeEvent event, int styleAttribute) {
+		boolean eventValue = false;
+		Object value = event.getNewValue();
+		if (value instanceof Boolean)
+			eventValue = ((Boolean) value).booleanValue();
+		else if (IPreferenceStore.TRUE.equals(value))
+			eventValue = true;
+
+		TextAttribute oldAttr = highlighting.getTextAttribute();
+		boolean activeValue = (oldAttr.getStyle() & styleAttribute) == styleAttribute;
+
+		if (activeValue != eventValue)
+			highlighting.setTextAttribute(new TextAttribute(oldAttr.getForeground(), oldAttr.getBackground(), eventValue ? oldAttr.getStyle() | styleAttribute : oldAttr.getStyle() & ~styleAttribute));
+	}
+
+	/**
+	 * Adapts to a style string change
+	 * 
+	 * @param highlighting the highlighting style to update
+	 * @param event the event that triggered the change
+	 */
+	private void adaptToStyleChange(HighlightingStyle highlighting, PropertyChangeEvent event) {
+		Object value = event.getNewValue();
+		if (value instanceof String) {
+			TextAttribute attr = createTextAttribute((String) value);
+			if (attr != null)
+				highlighting.setTextAttribute(attr);
+		}
+	}
+
+	/**
+	 * @return <code>true</code> iff semantic highlighting is enabled in the preferences
+	 */
+	private boolean isEnabled() {
+		return (fPreferenceStore != null) ? fPreferenceStore.getBoolean(EditorPreferenceNames.SEMANTIC_HIGHLIGHTING) : false;
+	}
+	
+	public void uninstall() {
+		disable();
+		
+		if (fPreferenceStore != null) {
+			fPreferenceStore.removePropertyChangeListener(this);
+			fPreferenceStore = null;
+		}
+		
+		fSourceViewer = null;
+		fConfiguration = null;
+		fPresentationReconciler = null;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingPresenter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingPresenter.java
new file mode 100644
index 0000000..ad973d3
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingPresenter.java
@@ -0,0 +1,1062 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.style;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.BadPositionCategoryException;
+import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentListener;
+import org.eclipse.jface.text.IPositionUpdater;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ISynchronizable;
+import org.eclipse.jface.text.ITextInputListener;
+import org.eclipse.jface.text.ITextPresentationListener;
+import org.eclipse.jface.text.ITextViewerExtension2;
+import org.eclipse.jface.text.ITextViewerExtension4;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.TextPresentation;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
+import org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler;
+import org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingManager.HighlightedPosition;
+import org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingManager.HighlightingStyle;
+import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
+
+/**
+ * Semantic highlighting presenter - UI thread implementation.  Based on 
+ * org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingPresenter
+ *
+ * @since 3.1
+ */
+public class SemanticHighlightingPresenter implements ITextPresentationListener, ITextInputListener, IDocumentListener {
+
+	/**
+	 * Semantic highlighting position updater.
+	 */
+	private class HighlightingPositionUpdater implements IPositionUpdater {
+
+		/** The position category. */
+		private final String fCategory;
+
+		/**
+		 * Creates a new updater for the given <code>category</code>.
+		 *
+		 * @param category the new category.
+		 */
+		public HighlightingPositionUpdater(String category) {
+			fCategory= category;
+		}
+
+		/*
+		 * @see org.eclipse.jface.text.IPositionUpdater#update(org.eclipse.jface.text.DocumentEvent)
+		 */
+		public void update(DocumentEvent event) {
+
+			int eventOffset= event.getOffset();
+			int eventOldLength= event.getLength();
+			int eventEnd= eventOffset + eventOldLength;
+
+			try {
+				Position[] positions= event.getDocument().getPositions(fCategory);
+
+				for (int i= 0; i != positions.length; i++) {
+
+					HighlightedPosition position= (HighlightedPosition) positions[i];
+
+					// Also update deleted positions because they get deleted by the background thread and removed/invalidated only in the UI runnable
+//					if (position.isDeleted())
+//						continue;
+
+					int offset= position.getOffset();
+					int length= position.getLength();
+					int end= offset + length;
+
+					if (offset > eventEnd)
+						updateWithPrecedingEvent(position, event);
+					else if (end < eventOffset) {
+						// do nothing
+						// updateWithSucceedingEvent(position, event);
+					}
+					else if (offset <= eventOffset && end >= eventEnd)
+						updateWithIncludedEvent(position, event);
+					else if (offset <= eventOffset)
+						updateWithOverEndEvent(position, event);
+					else if (end >= eventEnd)
+						updateWithOverStartEvent(position, event);
+					else
+						updateWithIncludingEvent(position, event);
+				}
+			} catch (BadPositionCategoryException e) {
+				// ignore and return
+			}
+		}
+
+		/**
+		 * Update the given position with the given event. The event precedes the position.
+		 *
+		 * @param position The position
+		 * @param event The event
+		 */
+		private void updateWithPrecedingEvent(HighlightedPosition position, DocumentEvent event) {
+			String newText= event.getText();
+			int eventNewLength= newText != null ? newText.length() : 0;
+			int deltaLength= eventNewLength - event.getLength();
+
+			position.setOffset(position.getOffset() + deltaLength);
+		}
+
+		/**
+		 * Update the given position with the given event. The event succeeds the position.
+		 *
+		 * @param position The position
+		 * @param event The event
+		 */
+//		private void updateWithSucceedingEvent(HighlightedPosition position, DocumentEvent event) {
+//		}
+
+		/**
+		 * Update the given position with the given event. The event is included by the position.
+		 *
+		 * @param position The position
+		 * @param event The event
+		 */
+		private void updateWithIncludedEvent(HighlightedPosition position, DocumentEvent event) {
+			int eventOffset= event.getOffset();
+			String newText= event.getText();
+			if (newText == null)
+				newText= ""; //$NON-NLS-1$
+			int eventNewLength= newText.length();
+
+			int deltaLength= eventNewLength - event.getLength();
+
+			int offset= position.getOffset();
+			int length= position.getLength();
+			int end= offset + length;
+
+			int includedLength= 0;
+			while (includedLength < eventNewLength && !Character.isWhitespace(newText.charAt(includedLength)))
+				includedLength++;
+			if (includedLength == eventNewLength)
+				position.setLength(length + deltaLength);
+			else {
+				int newLeftLength= eventOffset - offset + includedLength;
+
+				int excludedLength= eventNewLength;
+				while (excludedLength > 0 && !Character.isWhitespace(newText.charAt(excludedLength - 1)))
+					excludedLength--;
+				int newRightOffset= eventOffset + excludedLength;
+				int newRightLength= end + deltaLength - newRightOffset;
+
+				if (newRightLength == 0) {
+					position.setLength(newLeftLength);
+				} else {
+					if (newLeftLength == 0) {
+						position.update(newRightOffset, newRightLength);
+					} else {
+						position.setLength(newLeftLength);
+						addPositionFromUI(position);
+					}
+				}
+			}
+		}
+
+		/**
+		 * Update the given position with the given event. The event overlaps with the end of the position.
+		 *
+		 * @param position The position
+		 * @param event The event
+		 */
+		private void updateWithOverEndEvent(HighlightedPosition position, DocumentEvent event) {
+			String newText= event.getText();
+			if (newText == null)
+				newText= ""; //$NON-NLS-1$
+			int eventNewLength= newText.length();
+
+			int includedLength= 0;
+			while (includedLength < eventNewLength && !Character.isWhitespace(newText.charAt(includedLength)))
+				includedLength++;
+			position.setLength(event.getOffset() - position.getOffset() + includedLength);
+		}
+
+		/**
+		 * Update the given position with the given event. The event overlaps with the start of the position.
+		 *
+		 * @param position The position
+		 * @param event The event
+		 */
+		private void updateWithOverStartEvent(HighlightedPosition position, DocumentEvent event) {
+			int eventOffset= event.getOffset();
+			int eventEnd= eventOffset + event.getLength();
+
+			String newText= event.getText();
+			if (newText == null)
+				newText= ""; //$NON-NLS-1$
+			int eventNewLength= newText.length();
+
+			int excludedLength= eventNewLength;
+			while (excludedLength > 0 && !Character.isWhitespace(newText.charAt(excludedLength - 1)))
+				excludedLength--;
+			int deleted= eventEnd - position.getOffset();
+			int inserted= eventNewLength - excludedLength;
+			position.update(eventOffset + excludedLength, position.getLength() - deleted + inserted);
+		}
+
+		/**
+		 * Update the given position with the given event. The event includes the position.
+		 *
+		 * @param position The position
+		 * @param event The event
+		 */
+		private void updateWithIncludingEvent(HighlightedPosition position, DocumentEvent event) {
+			position.delete();
+			position.update(event.getOffset(), 0);
+		}
+	}
+
+	/** Position updater */
+	private IPositionUpdater fPositionUpdater= new HighlightingPositionUpdater(getPositionCategory());
+
+	/** The source viewer this semantic highlighting reconciler is installed on */
+	private ISourceViewer fSourceViewer;
+	/** The background presentation reconciler */
+	private StructuredPresentationReconciler fPresentationReconciler;
+
+	/** UI's current highlighted positions - can contain <code>null</code> elements */
+	private List fPositions= new ArrayList();
+	/** UI position lock */
+	private Object fPositionLock= new Object();
+
+	/** <code>true</code> iff the current reconcile is canceled. */
+	private boolean fIsCanceled= false;
+
+	/** Read-only color support */
+	private YUV_RGBConverter rgbConverter;
+	private Map readOnlyColorTable;
+	double readOnlyForegroundScaleFactor = 30;
+	
+	public SemanticHighlightingPresenter() {
+		// no listener for now since there's no UI to change the value
+		IPreferenceStore editorStore = SSEUIPlugin.getDefault().getPreferenceStore();
+		readOnlyForegroundScaleFactor = editorStore.getInt(EditorPreferenceNames.READ_ONLY_FOREGROUND_SCALE);
+	}
+
+	/**
+	 * Creates and returns a new highlighted position with the given offset, length and highlighting.
+	 * <p>
+	 * NOTE: Also called from background thread.
+	 * </p>
+	 *
+	 * @param offset The offset
+	 * @param length The length
+	 * @param highlighting The highlighting
+	 * @return The new highlighted position
+	 */
+	public HighlightedPosition createHighlightedPosition(int offset, int length, HighlightingStyle highlighting) {
+		// TODO: reuse deleted positions
+		return new HighlightedPosition(offset, length, highlighting, fPositionUpdater);
+	}
+	
+	/**
+	 * Creates and returns a new highlighted position from the given position and highlighting.
+	 * <p>
+	 * NOTE: Also called from background thread.
+	 * </p>
+	 *
+	 * @param position The position
+	 * @param highlighting The highlighting
+	 * @return The new highlighted position
+	 */
+	public HighlightedPosition createHighlightedPosition(Position position, HighlightingStyle highlighting) {
+		// TODO: reuse deleted positions
+		return new HighlightedPosition(position, highlighting, fPositionUpdater);
+	}
+
+	/**
+	 * Creates and returns a new highlighted position from the given position and highlighting.
+	 * <p>
+	 * NOTE: Also called from background thread.
+	 * </p>
+	 *
+	 * @param position The position
+	 * @param highlighting The highlighting
+	 * @param isReadOnly Is this a read-only position
+	 * @return The new highlighted position
+	 */
+	public HighlightedPosition createHighlightedPosition(Position position, HighlightingStyle highlighting, boolean isReadOnly) {
+		// TODO: reuse deleted positions
+		return new HighlightedPosition(position, highlighting, fPositionUpdater, isReadOnly);
+	}
+
+	/**
+	 * Adds all current positions to the given list.
+	 * <p>
+	 * NOTE: Called from background thread.
+	 * </p>
+	 *
+	 * @param list The list
+	 */
+	public void addAllPositions(List list) {
+		synchronized (fPositionLock) {
+			list.addAll(fPositions);
+		}
+	}
+
+	/**
+	 * Create a text presentation in the background.
+	 * <p>
+	 * NOTE: Called from background thread.
+	 * </p>
+	 *
+	 * @param addedPositions the added positions
+	 * @param removedPositions the removed positions
+	 * @return the text presentation or <code>null</code>, if reconciliation should be canceled
+	 */
+	public TextPresentation createPresentation(List addedPositions, List removedPositions) {
+		ISourceViewer sourceViewer= fSourceViewer;
+		StructuredPresentationReconciler presentationReconciler= fPresentationReconciler;
+		if (sourceViewer == null || presentationReconciler == null)
+			return null;
+
+		if (isCanceled())
+			return null;
+
+		IDocument document= sourceViewer.getDocument();
+		if (document == null)
+			return null;
+
+		int minStart= Integer.MAX_VALUE;
+		int maxEnd= Integer.MIN_VALUE;
+		for (int i= 0, n= removedPositions.size(); i < n; i++) {
+			Position position= (Position) removedPositions.get(i);
+			int offset= position.getOffset();
+			minStart= Math.min(minStart, offset);
+			maxEnd= Math.max(maxEnd, offset + position.getLength());
+		}
+		for (int i= 0, n= addedPositions.size(); i < n; i++) {
+			Position position= (Position) addedPositions.get(i);
+			int offset= position.getOffset();
+			minStart= Math.min(minStart, offset);
+			maxEnd= Math.max(maxEnd, offset + position.getLength());
+		}
+
+		if (minStart < maxEnd)
+			try {
+				return presentationReconciler.createRepairDescription(new Region(minStart, maxEnd - minStart), document);
+			} catch (RuntimeException e) {
+				// Assume concurrent modification from UI thread
+			}
+
+		return null;
+	}
+
+	/**
+	 * Create a runnable for updating the presentation.
+	 * <p>
+	 * NOTE: Called from background thread.
+	 * </p>
+	 * @param textPresentation the text presentation
+	 * @param addedPositions the added positions
+	 * @param removedPositions the removed positions
+	 * @return the runnable or <code>null</code>, if reconciliation should be canceled
+	 */
+	public Runnable createUpdateRunnable(final TextPresentation textPresentation, List addedPositions, List removedPositions) {
+		if (fSourceViewer == null || textPresentation == null)
+			return null;
+
+		// TODO: do clustering of positions and post multiple fast runnables
+		final HighlightedPosition[] added= new SemanticHighlightingManager.HighlightedPosition[addedPositions.size()];
+		addedPositions.toArray(added);
+		final SemanticHighlightingManager.HighlightedPosition[] removed= new SemanticHighlightingManager.HighlightedPosition[removedPositions.size()];
+		removedPositions.toArray(removed);
+
+		if (isCanceled())
+			return null;
+
+		Runnable runnable= new Runnable() {
+			public void run() {
+				updatePresentation(textPresentation, added, removed);
+			}
+		};
+		return runnable;
+	}
+
+	/**
+	 * Invalidate the presentation of the positions based on the given added positions and the existing deleted positions.
+	 * Also unregisters the deleted positions from the document and patches the positions of this presenter.
+	 * <p>
+	 * NOTE: Indirectly called from background thread by UI runnable.
+	 * </p>
+	 * @param textPresentation the text presentation or <code>null</code>, if the presentation should computed in the UI thread
+	 * @param addedPositions the added positions
+	 * @param removedPositions the removed positions
+	 */
+	public void updatePresentation(TextPresentation textPresentation, HighlightedPosition[] addedPositions, HighlightedPosition[] removedPositions) {
+		if (fSourceViewer == null)
+			return;
+
+//		checkOrdering("added positions: ", Arrays.asList(addedPositions)); //$NON-NLS-1$
+//		checkOrdering("removed positions: ", Arrays.asList(removedPositions)); //$NON-NLS-1$
+//		checkOrdering("old positions: ", fPositions); //$NON-NLS-1$
+
+		// TODO: double-check consistency with document.getPositions(...)
+		// TODO: reuse removed positions
+		if (isCanceled())
+			return;
+
+		IDocument document= fSourceViewer.getDocument();
+		if (document == null)
+			return;
+
+		String positionCategory= getPositionCategory();
+
+		List removedPositionsList= Arrays.asList(removedPositions);
+
+		try {
+			synchronized (fPositionLock) {
+				List oldPositions= fPositions;
+				int newSize= Math.max(fPositions.size() + addedPositions.length - removedPositions.length, 10);
+
+				/*
+				 * The following loop is a kind of merge sort: it merges two List<Position>, each
+				 * sorted by position.offset, into one new list. The first of the two is the
+				 * previous list of positions (oldPositions), from which any deleted positions get
+				 * removed on the fly. The second of two is the list of added positions. The result
+				 * is stored in newPositions.
+				 */
+				List newPositions= new ArrayList(newSize);
+				Position position= null;
+				Position addedPosition= null;
+				for (int i= 0, j= 0, n= oldPositions.size(), m= addedPositions.length; i < n || position != null || j < m || addedPosition != null;) {
+					// loop variant: i + j < old(i + j)
+
+					// a) find the next non-deleted Position from the old list
+					while (position == null && i < n) {
+						position= (Position) oldPositions.get(i++);
+						if (position.isDeleted() || contain(removedPositionsList, position)) {
+							document.removePosition(positionCategory, position);
+							position= null;
+						}
+					}
+
+					// b) find the next Position from the added list
+					if (addedPosition == null && j < m) {
+						addedPosition= addedPositions[j++];
+						document.addPosition(positionCategory, addedPosition);
+					}
+
+					// c) merge: add the next of position/addedPosition with the lower offset
+					if (position != null) {
+						if (addedPosition != null)
+							if (position.getOffset() <= addedPosition.getOffset()) {
+								newPositions.add(position);
+								position= null;
+							} else {
+								newPositions.add(addedPosition);
+								addedPosition= null;
+							}
+						else {
+							newPositions.add(position);
+							position= null;
+						}
+					} else if (addedPosition != null) {
+						newPositions.add(addedPosition);
+						addedPosition= null;
+					}
+				}
+				fPositions= newPositions;
+				Collections.sort(fPositions, new Comparator() {
+					
+					public int compare(Object arg0, Object arg1) {
+						Position p1 = (Position) arg0;
+						Position p2 = (Position) arg1;
+						return p1.offset - p2.offset;
+					}
+				});
+			}
+		} catch (BadPositionCategoryException e) {
+			// Should not happen
+			Logger.logException(e);
+		} catch (BadLocationException e) {
+			// Should not happen
+			Logger.logException(e);
+		}
+//		checkOrdering("new positions: ", fPositions); //$NON-NLS-1$
+
+		if (textPresentation != null)
+			fSourceViewer.changeTextPresentation(textPresentation, false);
+		else
+			fSourceViewer.invalidateTextPresentation();
+	}
+
+//	private void checkOrdering(String s, List positions) {
+//		Position previous= null;
+//		for (int i= 0, n= positions.size(); i < n; i++) {
+//			Position current= (Position) positions.get(i);
+//			if (previous != null && previous.getOffset() + previous.getLength() > current.getOffset())
+//				return;
+//		}
+//	}
+
+	/**
+	 * Returns <code>true</code> iff the positions contain the position.
+	 * @param positions the positions, must be ordered by offset but may overlap
+	 * @param position the position
+	 * @return <code>true</code> iff the positions contain the position
+	 */
+	private boolean contain(List positions, Position position) {
+		return indexOf(positions, position) != -1;
+	}
+
+	/**
+	 * Returns index of the position in the positions, <code>-1</code> if not found.
+	 * @param positions the positions, must be ordered by offset but may overlap
+	 * @param position the position
+	 * @return the index
+	 */
+	private int indexOf(List positions, Position position) {
+		int index= computeIndexAtOffset(positions, position.getOffset());
+		int size= positions.size();
+		while (index < size) {
+			if (positions.get(index) == position)
+				return index;
+			index++;
+		}
+		return -1;
+	}
+
+	/**
+	 * Insert the given position in <code>fPositions</code>, s.t. the offsets remain in linear order.
+	 *
+	 * @param position The position for insertion
+	 */
+	private void insertPosition(Position position) {
+		int i= computeIndexAfterOffset(fPositions, position.getOffset());
+		fPositions.add(i, position);
+	}
+
+	/**
+	 * Returns the index of the first position with an offset greater than the given offset.
+	 *
+	 * @param positions the positions, must be ordered by offset and must not overlap
+	 * @param offset the offset
+	 * @return the index of the last position with an offset greater than the given offset
+	 */
+	private int computeIndexAfterOffset(List positions, int offset) {
+		int i= -1;
+		int j= positions.size();
+		while (j - i > 1) {
+			int k= (i + j) >> 1;
+			Position position= (Position) positions.get(k);
+			if (position.getOffset() > offset)
+				j= k;
+			else
+				i= k;
+		}
+		return j;
+	}
+
+	/**
+	 * Returns the index of the first position with an offset equal or greater than the given offset.
+	 *
+	 * @param positions the positions, must be ordered by offset and must not overlap
+	 * @param offset the offset
+	 * @return the index of the last position with an offset equal or greater than the given offset
+	 */
+	private int computeIndexAtOffset(List positions, int offset) {
+		int i= -1;
+		int j= positions.size();
+		while (j - i > 1) {
+			int k= (i + j) >> 1;
+			Position position= (Position) positions.get(k);
+			if (position.getOffset() >= offset)
+				j= k;
+			else
+				i= k;
+		}
+		return j;
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.ITextPresentationListener#applyTextPresentation(org.eclipse.jface.text.TextPresentation)
+	 */
+	public void applyTextPresentation(TextPresentation textPresentation) {
+		IRegion region= textPresentation.getExtent();
+		int minStart= Integer.MAX_VALUE;
+		int maxEnd= Integer.MIN_VALUE;
+		int i= computeIndexAtOffset(fPositions, region.getOffset()), n= computeIndexAtOffset(fPositions, region.getOffset() + region.getLength());
+		if (n - i > 2) {
+			List ranges= new ArrayList(n - i);
+			for (; i < n; i++) {
+				HighlightedPosition position= (HighlightedPosition) fPositions.get(i);
+				if (!position.isDeleted()) {
+					if (!position.isReadOnly())
+						ranges.add(position.createStyleRange());
+					else {
+						int offset= position.getOffset();
+						minStart= Math.min(minStart, offset);
+						maxEnd= Math.max(maxEnd, offset + position.getLength());
+					}
+						
+				}
+			}
+			StyleRange[] array= new StyleRange[ranges.size()];
+			array= (StyleRange[]) ranges.toArray(array);
+			textPresentation.replaceStyleRanges(array);
+		} else {
+			for (; i < n; i++) {
+				HighlightedPosition position= (HighlightedPosition) fPositions.get(i);
+				if (!position.isDeleted()) {
+					if (!position.isReadOnly())
+						textPresentation.replaceStyleRange(position.createStyleRange());
+					else {
+						int offset= position.getOffset();
+						minStart= Math.min(minStart, offset);
+						maxEnd= Math.max(maxEnd, offset + position.getLength());
+					}
+				}
+			}
+		}
+		if (minStart < maxEnd) {
+			IStructuredDocument document = (IStructuredDocument) fSourceViewer.getDocument();
+			if (document.containsReadOnly(minStart, maxEnd)) {
+				Iterator nonDefaultStyleRangeIterator = textPresentation.getNonDefaultStyleRangeIterator();
+				while (nonDefaultStyleRangeIterator.hasNext()) {
+					StyleRange styleRange = (StyleRange) nonDefaultStyleRangeIterator.next();
+					if (document.containsReadOnly(styleRange.start, styleRange.length)) {
+						adjustForeground(styleRange);
+					}
+				}
+			}
+		}
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.ITextInputListener#inputDocumentAboutToBeChanged(org.eclipse.jface.text.IDocument, org.eclipse.jface.text.IDocument)
+	 */
+	public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
+		setCanceled(true);
+		releaseDocument(oldInput);
+		resetState();
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.ITextInputListener#inputDocumentChanged(org.eclipse.jface.text.IDocument, org.eclipse.jface.text.IDocument)
+	 */
+	public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
+		manageDocument(newInput);
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
+	 */
+	public void documentAboutToBeChanged(DocumentEvent event) {
+		setCanceled(true);
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
+	 */
+	public void documentChanged(DocumentEvent event) {
+	}
+
+	/**
+	 * @return Returns <code>true</code> iff the current reconcile is canceled.
+	 * <p>
+	 * NOTE: Also called from background thread.
+	 * </p>
+	 */
+	public boolean isCanceled() {
+		IDocument document= fSourceViewer != null ? fSourceViewer.getDocument() : null;
+		if (document == null)
+			return fIsCanceled;
+
+		synchronized (getLockObject(document)) {
+			return fIsCanceled;
+		}
+	}
+
+	/**
+	 * Set whether or not the current reconcile is canceled.
+	 *
+	 * @param isCanceled <code>true</code> iff the current reconcile is canceled
+	 */
+	public void setCanceled(boolean isCanceled) {
+		IDocument document= fSourceViewer != null ? fSourceViewer.getDocument() : null;
+		if (document == null) {
+			fIsCanceled= isCanceled;
+			return;
+		}
+
+		synchronized (getLockObject(document)) {
+			fIsCanceled= isCanceled;
+		}
+	}
+
+	/**
+	 * @param document the document
+	 * @return the document's lock object
+	 */
+	private Object getLockObject(IDocument document) {
+		if (document instanceof ISynchronizable) {
+			Object lock= ((ISynchronizable)document).getLockObject();
+			if (lock != null)
+				return lock;
+		}
+		return document;
+	}
+
+	/**
+	 * Install this presenter on the given source viewer and background presentation
+	 * reconciler.
+	 *
+	 * @param sourceViewer the source viewer
+	 * @param backgroundPresentationReconciler the background presentation reconciler,
+	 * 	can be <code>null</code>, in that case {@link SemanticHighlightingPresenter#createPresentation(List, List)}
+	 * 	should not be called
+	 */
+	public void install(ISourceViewer sourceViewer, StructuredPresentationReconciler backgroundPresentationReconciler) {
+		fSourceViewer= sourceViewer;
+		fPresentationReconciler= backgroundPresentationReconciler;
+
+		if (fSourceViewer instanceof StructuredTextViewer)
+			((StructuredTextViewer) fSourceViewer).prependTextPresentationListener(this);
+		else if(fSourceViewer instanceof ITextViewerExtension4)
+			((ITextViewerExtension4)fSourceViewer).addTextPresentationListener(this);
+
+		fSourceViewer.addTextInputListener(this);
+		manageDocument(fSourceViewer.getDocument());
+	}
+
+	/**
+	 * Uninstall this presenter.
+	 */
+	public void uninstall() {
+		setCanceled(true);
+
+		if (fSourceViewer != null) {
+			if (fSourceViewer instanceof ITextViewerExtension4)
+				((ITextViewerExtension4) fSourceViewer).addTextPresentationListener(this);
+			releaseDocument(fSourceViewer.getDocument());
+			invalidateTextPresentation();
+			resetState();
+
+			fSourceViewer.removeTextInputListener(this);
+			fSourceViewer= null;
+		}
+	}
+
+	/**
+	 * Invalidate text presentation of positions with the given highlighting.
+	 *
+	 * @param highlighting The highlighting
+	 */
+	public void highlightingStyleChanged(HighlightingStyle highlighting) {
+		for (int i= 0, n= fPositions.size(); i < n; i++) {
+			HighlightedPosition position= (HighlightedPosition) fPositions.get(i);
+			if (position.getHighlighting() == highlighting && fSourceViewer instanceof ITextViewerExtension2)
+				((ITextViewerExtension2) fSourceViewer).invalidateTextPresentation(position.getOffset(), position.getLength());
+			else
+				fSourceViewer.invalidateTextPresentation();
+		}
+	}
+
+	/**
+	 * Invalidate text presentation of all positions.
+	 */
+	private void invalidateTextPresentation() {
+		if (fSourceViewer instanceof ITextViewerExtension2) {
+			for (int i = 0, n = fPositions.size(); i < n; i++) {
+				Position position = (Position) fPositions.get(i);
+				((ITextViewerExtension2) fSourceViewer).invalidateTextPresentation(position.getOffset(), position.getLength());
+			}
+		}
+		else {
+			fSourceViewer.invalidateTextPresentation();
+		}
+	}
+
+	/**
+	 * Add a position with the given range and highlighting unconditionally, only from UI thread.
+	 * The position will also be registered on the document. The text presentation is not invalidated.
+	 *
+	 * @param uiPosition the highlighted position to add from the UI
+	 */
+	private void addPositionFromUI(HighlightedPosition uiPosition) {
+		Position position= createHighlightedPosition(uiPosition, uiPosition.getHighlighting(), uiPosition.isReadOnly());
+		synchronized (fPositionLock) {
+			insertPosition(position);
+		}
+
+		IDocument document= fSourceViewer.getDocument();
+		if (document == null)
+			return;
+		String positionCategory= getPositionCategory();
+		try {
+			document.addPosition(positionCategory, position);
+		} catch (BadLocationException e) {
+			// Should not happen
+			Logger.logException(e);
+		} catch (BadPositionCategoryException e) {
+			// Should not happen
+			Logger.logException(e);
+		}
+	}
+
+	/**
+	 * Reset to initial state.
+	 */
+	private void resetState() {
+		synchronized (fPositionLock) {
+			fPositions.clear();
+		}
+	}
+
+	/**
+	 * Start managing the given document.
+	 *
+	 * @param document The document
+	 */
+	private void manageDocument(IDocument document) {
+		if (document != null) {
+			document.addPositionCategory(getPositionCategory());
+			document.addPositionUpdater(fPositionUpdater);
+			document.addDocumentListener(this);
+		}
+	}
+
+	/**
+	 * Stop managing the given document.
+	 *
+	 * @param document The document
+	 */
+	private void releaseDocument(IDocument document) {
+		if (document != null) {
+			document.removeDocumentListener(this);
+			document.removePositionUpdater(fPositionUpdater);
+			try {
+				document.removePositionCategory(getPositionCategory());
+			} catch (BadPositionCategoryException e) {
+				// Should not happen
+				Logger.logException(e);
+			}
+		}
+	}
+
+	/**
+	 * @return The semantic reconciler position's category.
+	 */
+	private String getPositionCategory() {
+		return toString();
+	}
+	
+	private void adjustForeground(StyleRange styleRange) {
+		RGB oldRGB = null;
+		// Color oldColor = styleRange.foreground;
+		Color oldColor = styleRange.background;
+		if (oldColor == null) {
+			// oldRGB = getTextWidget().getForeground().getRGB();
+			oldColor = fSourceViewer.getTextWidget().getBackground();
+			oldRGB = oldColor.getRGB();
+		}
+		else {
+			oldRGB = oldColor.getRGB();
+		}
+		Color newColor = getCachedColorFor(oldRGB);
+		if (newColor == null) {
+			// make text "closer to" background lumanence
+			double target = getRGBConverter().calculateYComponent(oldColor);
+			RGB newRGB = getRGBConverter().transformRGBToGrey(oldRGB, readOnlyForegroundScaleFactor / 100.0, target);
+
+			// save conversion, so calculations only need to be done once
+			cacheColor(oldRGB, newRGB);
+			newColor = getCachedColorFor(oldRGB);
+		}
+		styleRange.foreground = newColor;
+	}
+
+	private YUV_RGBConverter getRGBConverter() {
+		if (rgbConverter == null) {
+			rgbConverter = new YUV_RGBConverter();
+		}
+		return rgbConverter;
+	}
+
+	/**
+	 * Cache read-only color.
+	 * 
+	 * @param oldRGB
+	 * @param newColor
+	 */
+	private void cacheColor(RGB oldRGB, RGB newColor) {
+		if (readOnlyColorTable == null) {
+			readOnlyColorTable = new HashMap();
+		}
+		readOnlyColorTable.put(oldRGB, newColor);
+	}
+
+	/**
+	 * This method is just to get existing read-only colors.
+	 */
+	private Color getCachedColorFor(RGB oldRGB) {
+		Color result = null;
+	
+		if (readOnlyColorTable != null) {
+			RGB readOnlyRGB = (RGB) readOnlyColorTable.get(oldRGB);
+			result = EditorUtility.getColor(readOnlyRGB);
+		}
+	
+		return result;
+	}
+	
+	/**
+	 * A utility class to do various color manipulations
+	 */
+	private class YUV_RGBConverter {
+		/**
+		 * This class "holds" the YUV values corresponding to RGB color
+		 */
+		private class YUV {
+
+			class NormalizedRGB {
+				double blue;
+				double green;
+				private final double maxRGB = 256.0;
+				double red;
+
+				public NormalizedRGB(RGB rgb) {
+					// first normalize to between 0 - 1
+					red = rgb.red / maxRGB;
+					green = rgb.green / maxRGB;
+					blue = rgb.blue / maxRGB;
+
+					red = gammaNormalized(red);
+					green = gammaNormalized(green);
+					blue = gammaNormalized(blue);
+
+				}
+			}
+
+			private NormalizedRGB normalizedRGB;
+
+			private double u = -1;
+			private double v = -1;
+			private double y = -1;
+
+			private YUV() {
+				super();
+			}
+
+			public YUV(RGB rgb) {
+				this();
+				normalizedRGB = new NormalizedRGB(rgb);
+				// force calculations
+				getY();
+				getV();
+				getU();
+			}
+
+			/**
+			 * normalize to "average" gamma 2.2222 or 1/0.45
+			 */
+			double gammaNormalized(double colorComponent) {
+				if (colorComponent < 0.018) {
+					return colorComponent * 0.45;
+				}
+				else {
+					return 1.099 * Math.pow(colorComponent, 0.45) - 0.099;
+				}
+			}
+
+			/**
+			 * @return RGB based on original RGB and current YUV values;
+			 */
+
+			public double getU() {
+				if (u == -1) {
+					u = 0.4949 * (normalizedRGB.blue - getY());
+				}
+				return u;
+
+			}
+
+			public double getV() {
+				if (v == -1) {
+					v = 0.877 * (normalizedRGB.red - getY());
+				}
+				return v;
+			}
+
+			public double getY() {
+				if (y == -1) {
+					y = 0.299 * normalizedRGB.red + 0.587 * normalizedRGB.green + 0.114 * normalizedRGB.blue;
+				}
+				return y;
+			}
+
+		}
+
+		public YUV_RGBConverter() {
+			super();
+		}
+
+		public double calculateYComponent(Color targetColor) {
+			return new YUV(targetColor.getRGB()).getY();
+		}
+
+		public RGB transformRGBToGrey(RGB originalRGB, double scaleFactor, double target) {
+			RGB transformedRGB = null;
+			// we left the "full" API method signature, but this
+			// version does not take into account originalRGB, though
+			// it might someday.
+			// for now, we'll simply make the new RGB grey, either a little
+			// lighter, or a little darker than background.
+			double y = 0;
+			double mid = 0.5;
+			// zero is black, one is white
+			if (target < mid) {
+				// is "dark" make lighter
+				y = target + scaleFactor;
+			}
+			else {
+				// is "light" make darker
+				y = target - scaleFactor;
+			}
+			int c = (int) Math.round(y * 255);
+			// just to gaurd against mis-use, or scale's values greater
+			// than mid point (and possibly rounding error)
+			if (c > 255)
+				c = 255;
+			if (c < 0)
+				c = 0;
+			transformedRGB = new RGB(c, c, c);
+			return transformedRGB;
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingReconciler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingReconciler.java
new file mode 100644
index 0000000..0349175
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/style/SemanticHighlightingReconciler.java
@@ -0,0 +1,296 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.style;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.TextPresentation;
+import org.eclipse.jface.text.reconciler.DirtyRegion;
+import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
+import org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.sse.core.internal.model.ModelManagerImpl;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.ui.ISemanticHighlighting;
+import org.eclipse.wst.sse.ui.ISemanticHighlightingExtension;
+import org.eclipse.wst.sse.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingManager.HighlightedPosition;
+import org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingManager.HighlightingStyle;
+
+/**
+ * Semantic highlighting reconciler for Structured Source Editors. Based on 
+ * org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingReconciler
+ *
+ * @since 3.1
+ */
+public class SemanticHighlightingReconciler implements IReconcilingStrategy, IReconcilingStrategyExtension {
+
+	private IDocument fDocument;
+
+	private ITextViewer fViewer;
+	private SemanticHighlightingPresenter fPresenter;
+	private ISemanticHighlighting[] fSemanticHighlightings;
+	private HighlightingStyle[] fHighlightings;
+
+	private List fAddedPositions = new ArrayList();
+	private List fRemovedPositions = new ArrayList();
+	/** Number of removed positions */
+	private int fNOfRemovedPositions;
+	
+	/** Background job */
+	private Job fJob;
+	/** Background job lock */
+	private final Object fJobLock = new Object();
+	
+	/** Reconcile operation lock. */
+	private final Object fReconcileLock = new Object();
+	private boolean fIsReconciling = false;
+	/** The semantic highlighting presenter - cache for background thread, only valid during {@link #reconcile(IRegion)} */
+	private SemanticHighlightingPresenter fJobPresenter;
+	/** Semantic highlightings - cache for background thread, only valid during {@link #reconcile(IRegion)} */
+	private ISemanticHighlighting[] fJobSemanticHighlightings;
+	/** HighlightingStyle - cache for background thread, only valid during {@link #reconcile(IRegion)} */
+	private HighlightingStyle[] fJobHighlightings;
+
+	private boolean fIsInstalled;
+
+	public void install(ITextViewer sourceViewer, SemanticHighlightingPresenter presenter, ISemanticHighlighting[] semanticHighlightings, HighlightingStyle[] highlightings) {
+		fViewer = sourceViewer;
+		fPresenter = presenter;
+		fSemanticHighlightings = semanticHighlightings;
+		fHighlightings = highlightings;
+		fIsInstalled = true;
+	}
+
+	public void uninstall() {
+		fIsInstalled = false;
+		fViewer = null;
+		fPresenter = null;
+		fSemanticHighlightings = null;
+		fHighlightings = null;
+	}
+
+	public void reconcile(IRegion partition) {
+		// ensure at most one thread can be reconciling at any time
+		synchronized (fReconcileLock) {
+			if (fIsReconciling)
+				return;
+			else
+				fIsReconciling= true;
+		}
+		fJobPresenter = fPresenter;
+		fJobSemanticHighlightings = fSemanticHighlightings;
+		fJobHighlightings = fHighlightings;
+		IStructuredModel model = null;
+		try {
+			if (fJobPresenter == null || fJobSemanticHighlightings == null || fJobHighlightings == null)
+				return;
+
+			fJobPresenter.setCanceled(false);
+		
+			startReconcilingPositions();
+			IStructuredDocument document = (IStructuredDocument) fDocument;
+			model = ModelManagerImpl.getInstance().getModelForRead(document);
+			IStructuredDocumentRegion[] regions = document.getStructuredDocumentRegions(partition.getOffset(), partition.getLength());
+			for (int i = 0; i < regions.length && fIsInstalled; i++) {
+				if (document.containsReadOnly(regions[i].getStartOffset(), regions[i].getLength()))
+					addPosition(new Position(regions[i].getStartOffset(), regions[i].getLength()), null, true);
+				else {
+					for (int j = 0; j < fJobSemanticHighlightings.length && fIsInstalled; j++) {
+						if (fJobHighlightings[j].isEnabled()) {
+							Position[] consumes = null;
+							if (fJobSemanticHighlightings[j] instanceof ISemanticHighlightingExtension && model != null) {
+								consumes = ((ISemanticHighlightingExtension) fJobSemanticHighlightings[j]).consumes(regions[i], model.getIndexedRegion(regions[i].getStartOffset()));
+							}
+							else {
+								consumes = fJobSemanticHighlightings[j].consumes(regions[i]);
+							}
+							if (consumes != null) {
+								for (int k = 0; k < consumes.length; k++)
+									addPosition(consumes[k], fJobHighlightings[j]);
+							}
+						}
+					}
+				}
+			}
+
+			if (fIsInstalled) {
+				List oldPositions = fRemovedPositions;
+				List newPositions = new ArrayList(fNOfRemovedPositions);
+				for (int i = 0, n = oldPositions.size(); i < n && fIsInstalled; i++) {
+					Object current = oldPositions.get(i);
+					if (current != null)
+						newPositions.add(current);
+				}
+				fRemovedPositions = newPositions;
+				
+				TextPresentation presentation = null;
+				if (!fJobPresenter.isCanceled())
+					presentation = fJobPresenter.createPresentation(fAddedPositions, fRemovedPositions);
+				if (!fJobPresenter.isCanceled())
+					updatePresentation(presentation, fAddedPositions, fRemovedPositions);
+			}
+			stopReconcilingPositions();
+		}
+		finally {
+			fJobPresenter= null;
+			fJobSemanticHighlightings= null;
+			fJobHighlightings= null;
+			if (model != null)
+				model.releaseFromRead();
+			synchronized (fReconcileLock) {
+				fIsReconciling= false;
+			}
+		}
+	}
+
+	private void addPosition(Position position, HighlightingStyle highlighting) {
+		addPosition(position, highlighting, false);
+	}
+
+	private void addPosition(Position position, HighlightingStyle highlighting, boolean isReadOnly) {
+		boolean isExisting = false;
+		// TODO: use binary search
+		for (int i = 0, n = fRemovedPositions.size(); i < n; i++) {
+			HighlightedPosition highlightedPosition = (HighlightedPosition) fRemovedPositions.get(i);
+			if (highlightedPosition == null)
+				continue;
+			if (highlightedPosition.isEqual(position, highlighting)) {
+				isExisting = true;
+				fRemovedPositions.set(i, null);
+				fNOfRemovedPositions--;
+				break;
+			}
+		}
+		if (!isExisting) {
+			fAddedPositions.add(fJobPresenter.createHighlightedPosition(position, highlighting, isReadOnly));
+		}
+	}
+
+	/**
+	 * Update the presentation.
+	 * 
+	 * @param textPresentation
+	 *            the text presentation
+	 * @param addedPositions
+	 *            the added positions
+	 * @param removedPositions
+	 *            the removed positions
+	 */
+	private void updatePresentation(TextPresentation textPresentation, List addedPositions, List removedPositions) {
+		Runnable runnable = fJobPresenter.createUpdateRunnable(textPresentation, addedPositions, removedPositions);
+		if (runnable == null)
+			return;
+
+		if (fViewer == null)
+			return;
+
+		Control viewerControl = fViewer.getTextWidget();
+		if (viewerControl == null)
+			return;
+
+		Display display = viewerControl.getDisplay();
+		if (display == null || display.isDisposed())
+			return;
+
+		display.asyncExec(runnable);
+	}
+
+	/**
+	 * Start reconciling positions.
+	 */
+	private void startReconcilingPositions() {
+		fJobPresenter.addAllPositions(fRemovedPositions);
+		fNOfRemovedPositions = fRemovedPositions.size();
+	}
+
+	/**
+	 * Stop reconciling positions.
+	 */
+	private void stopReconcilingPositions() {
+		fRemovedPositions.clear();
+		fNOfRemovedPositions = 0;
+		fAddedPositions.clear();
+	}
+
+	public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) {
+		reconcile(dirtyRegion);
+	}
+
+	public void setDocument(IDocument document) {
+		fDocument = document;
+//		refresh();
+	}
+
+	public void initialReconcile() {
+		// Do nothing
+	}
+
+	public void setProgressMonitor(IProgressMonitor monitor) {
+	}
+	
+	/**
+	 * Schedule a background job for reconciling the Semantic Highlighting model.
+	 */
+	private void scheduleJob() {
+		synchronized (fJobLock) {
+			final Job oldJob= fJob;
+			if (fJob != null) {
+				fJob.cancel();
+				fJob= null;
+			}
+
+			fJob= new Job("Semantic Highlighting Job") {
+				protected IStatus run(IProgressMonitor monitor) {
+					if (oldJob != null) {
+						try {
+							oldJob.join();
+						} catch (InterruptedException e) {
+							Logger.logException(e);
+							return Status.CANCEL_STATUS;
+						}
+					}
+					if (monitor.isCanceled())
+						return Status.CANCEL_STATUS;
+
+					reconcile(new Region(0, fDocument.getLength()));
+					synchronized (fJobLock) {
+						// allow the job to be gc'ed
+						if (fJob == this)
+							fJob= null;
+					}
+					return Status.OK_STATUS;
+				}
+			};
+			fJob.setSystem(true);
+			fJob.setPriority(Job.DECORATE);
+			fJob.schedule();
+		}
+	}
+
+	public void refresh() {
+		if (fDocument != null)
+			scheduleJob();
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AnnotationHoverProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AnnotationHoverProcessor.java
index 5e8475a..39082c9 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AnnotationHoverProcessor.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AnnotationHoverProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -167,7 +167,7 @@
 				if (!isAnnotationValid(a))
 					continue;
 				Position p = model.getPosition(a);
-				if (p.includes(offset)) {
+				if (p != null && p.includes(offset)) {
 					// find the smallest region containing offset
 					if ((hoverRegion == null) || (hoverRegion.getLength() > p.getLength())) {
 						hoverRegion = new Region(p.getOffset(), p.getLength());
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/BestMatchHover.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/BestMatchHover.java
index abcbc8d..230159f 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/BestMatchHover.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/BestMatchHover.java
@@ -30,12 +30,16 @@
  */
 public class BestMatchHover implements ITextHover, ITextHoverExtension {
 	private ITextHover fBestMatchHover; // current best match text hover
-	private ITextHover fTagInfoHover; // documentation/information hover
+	private ITextHover[] fTagInfoHovers; // documentation/information hover
 	private List fTextHovers; // list of text hovers to consider in best
 	// match
 
-	public BestMatchHover(ITextHover infotaghover) {
-		fTagInfoHover = infotaghover;
+	public BestMatchHover(ITextHover infoTagHover) {
+		this(new ITextHover[]{infoTagHover});
+	}
+
+	public BestMatchHover(ITextHover[] infoTagHovers) {
+		fTagInfoHovers = infoTagHovers;
 	}
 
 	/**
@@ -53,8 +57,11 @@
 		}
 
 		hoverList.add(new ProblemAnnotationHoverProcessor());
-		if (fTagInfoHover != null) {
-			hoverList.add(fTagInfoHover);
+		
+		if (fTagInfoHovers != null) {
+			for (int i = 0; i < fTagInfoHovers.length; i++) {
+				hoverList.add(fTagInfoHovers[i]);
+			}
 		}
 		hoverList.add(new AnnotationHoverProcessor());
 		return hoverList;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/SourceInfoProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/SourceInfoProvider.java
new file mode 100644
index 0000000..0b7a4f9
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/SourceInfoProvider.java
@@ -0,0 +1,42 @@
+package org.eclipse.wst.sse.ui.internal.text;
+
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.information.IInformationProvider;
+import org.eclipse.jface.text.information.IInformationProviderExtension;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+public class SourceInfoProvider implements IInformationProvider, IInformationProviderExtension  {
+
+	private ITextEditor fEditor;
+
+	public SourceInfoProvider(ITextEditor editor) {
+		fEditor = editor;
+	}
+	public String getInformation(ITextViewer textViewer, IRegion subject) {
+		return getInformation2(textViewer, subject).toString();
+	}
+
+	public IRegion getSubject(ITextViewer textViewer, int offset) {
+		if (textViewer != null && fEditor != null) {
+			IRegion region= WordFinder.findWord(textViewer.getDocument(), offset);
+			if (region != null)
+				return region;
+			else
+				return new Region(offset, 0);
+		}
+		return null;
+	}
+
+	public Object getInformation2(ITextViewer textViewer, IRegion subject) {
+		if (fEditor == null)
+			return null;
+
+		Object selection = fEditor.getSelectionProvider().getSelection();
+		if (selection == null)
+			selection = new Object();
+		return selection;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/WordFinder.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/WordFinder.java
new file mode 100644
index 0000000..4e708c5
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/WordFinder.java
@@ -0,0 +1,53 @@
+package org.eclipse.wst.sse.ui.internal.text;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
+
+public class WordFinder {
+
+	/* Copied from org.eclipse.jdt.internal.ui.text.JavaWordFinder */
+	public static IRegion findWord(IDocument document, int offset) {
+
+		int start= -2;
+		int end= -1;
+
+		try {
+			int pos= offset;
+			char c;
+
+			while (pos >= 0) {
+				c= document.getChar(pos);
+				if (!Character.isJavaIdentifierPart(c))
+					break;
+				--pos;
+			}
+			start= pos;
+
+			pos= offset;
+			int length= document.getLength();
+
+			while (pos < length) {
+				c= document.getChar(pos);
+				if (!Character.isJavaIdentifierPart(c))
+					break;
+				++pos;
+			}
+			end= pos;
+
+		} catch (BadLocationException x) {
+		}
+
+		if (start >= -1 && end > -1) {
+			if (start == offset && end == offset)
+				return new Region(offset, 0);
+			else if (start == offset)
+				return new Region(start, end - start);
+			else
+				return new Region(start + 1, end - start - 1);
+		}
+
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/OffsetStatusLineContributionItem.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/OffsetStatusLineContributionItem.java
index 2a446c8..22504dd 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/OffsetStatusLineContributionItem.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/OffsetStatusLineContributionItem.java
@@ -11,6 +11,8 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal.ui;
 
+import java.io.IOException;
+import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -21,7 +23,12 @@
 import java.util.Map;
 import java.util.Set;
 
+import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.dialogs.Dialog;
@@ -77,6 +84,7 @@
 import org.eclipse.swt.widgets.TabItem;
 import org.eclipse.swt.widgets.TableColumn;
 import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.ISelectionService;
 import org.eclipse.ui.IWorkbenchWindow;
@@ -109,6 +117,8 @@
 import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
 import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
 
+import com.ibm.icu.text.NumberFormat;
+
 /**
  * @author nsd A Status Line contribution intended to display the selected
  *         offsets in an editor. Double-clicking shows information about
@@ -475,6 +485,13 @@
 			editorInputLabel.setLayoutData(gd);
 			editorInputLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_12 + fTextEditor.getEditorInput().getClass().getName()); //$NON-NLS-1$
 
+			final Text bomLabel = new Text(composite, SWT.SINGLE | SWT.READ_ONLY);
+			gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+			gd.horizontalSpan = 2;
+			bomLabel.setLayoutData(gd);
+			bomLabel.setEnabled(false);
+			bomLabel.setText("Byte Order Mark: ");
+
 			IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
 			if (model != null) {
 				Text modelIdLabel = new Text(composite, SWT.SINGLE | SWT.READ_ONLY);
@@ -501,6 +518,41 @@
 				modelHandlerContentTypeLabel.setLayoutData(gd);
 				modelHandlerContentTypeLabel.setText(SSEUIMessages.OffsetStatusLineContributionItem_5 + model.getModelHandler().getAssociatedContentTypeId() + " (" + model.getModelHandler() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 
+				final Text counts = new Text(composite, SWT.MULTI | SWT.WRAP | SWT.READ_ONLY);
+				gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+				gd.horizontalSpan = 2;
+				counts.setLayoutData(gd);
+				counts.setText("Counting...");
+				counts.setEnabled(false);
+				final IStructuredModel finalModel = model;
+				final Display display = Display.getCurrent();
+				Job counter = new Job("Counting regions") {
+					protected IStatus run(IProgressMonitor monitor) {
+						IStructuredDocumentRegion[] structuredDocumentRegions = finalModel.getStructuredDocument().getStructuredDocumentRegions();
+						int length = finalModel.getStructuredDocument().getLength();
+						int regionCount = 0;
+						for (int i = 0; i < structuredDocumentRegions.length; i++) {
+							regionCount += structuredDocumentRegions[i].getNumberOfRegions();
+						}
+						NumberFormat formatter = NumberFormat.getIntegerInstance();
+						final String regioncount = "Count: " + formatter.format(structuredDocumentRegions.length) + " document regions containing " + formatter.format(regionCount) + " text regions representing " + formatter.format(length) + " characters";//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+						display.asyncExec(new Runnable() {
+							public void run() {
+								if (!counts.isDisposed()) {
+									counts.setText(regioncount);
+									counts.setEnabled(true);
+								}
+								if (!bomLabel.isDisposed()) {
+									bomLabel.setText("Byte Order Mark: " + getBOMText(fTextEditor.getEditorInput())); //$NON-NLS-1$
+									bomLabel.setEnabled(true);
+								}
+							}
+						});
+						return Status.OK_STATUS;
+					}
+				};
+				counter.schedule(1000);
+
 				Label blankRow = new Label(composite, SWT.NONE);
 				gd = new GridData(SWT.FILL, SWT.FILL, true, false);
 				gd.horizontalSpan = 2;
@@ -575,6 +627,52 @@
 			return composite;
 		}
 
+		/**
+		 * @param editorInput
+		 * @return
+		 */
+		private String getBOMText(IEditorInput editorInput) {
+			IFile file = (IFile) editorInput.getAdapter(IFile.class);
+			String detectedBOM = "none"; //$NON-NLS-1$
+			if (file != null) {
+				InputStream s = null;
+				try {
+					s = file.getContents(true);
+					if (s != null) {
+						int b1 = s.read() & 0xFF;
+						int b2 = s.read() & 0xFF;
+						if (b1 == 0xFE && b2 == 0xFF) {
+							detectedBOM = "FE FF (UTF-16BE)"; //$NON-NLS-1$
+						}
+						else if (b1 == 0xFF && b2 == 0xFE) {
+							detectedBOM = "FF FE (UTF-16LE)"; //$NON-NLS-1$
+						}
+						else {
+							int b3 = s.read() & 0xFF;
+							if (b1 == 0xEF && b2 == 0xBB && b3 == 0xBF) {
+								detectedBOM = "EF BB BF (UTF-8)"; //$NON-NLS-1$
+							}
+						}
+					}
+				}
+				catch (Exception e) {
+					detectedBOM = e.getMessage();
+				}
+				finally {
+					if (s != null)
+						try {
+							s.close();
+						}
+						catch (IOException e) {
+						}
+				}
+			}
+			else {
+				detectedBOM = "N/A"; //$NON-NLS-1$
+			}
+			return detectedBOM;
+		}
+
 		private List getIndexedRegions(ITextSelection textSelection) {
 			Set overlappingIndexedRegions = new HashSet(2);
 			int start = textSelection.getOffset();
@@ -807,7 +905,7 @@
 					if (element instanceof ITextRegionContainer) {
 						return ((ITextRegionContainer) element).getParent();
 					}
-					return null;
+					return fDocument;
 				}
 
 				public boolean hasChildren(Object element) {
@@ -1070,9 +1168,11 @@
 				Position p = annotationModel.getPosition(annotation);
 				if (p != null && !p.isDeleted()) {
 					try {
-						line = fDocument.getLineOfOffset(p.getOffset());
+						// don't forget the +1
+						line = fDocument.getLineOfOffset(p.getOffset()) + 1;
 					}
 					catch (BadLocationException e) {
+						return e.getMessage();
 					}
 				}
 			}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PixelConverter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PixelConverter.java
index 7e74b3d..a12e28c 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PixelConverter.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PixelConverter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,56 +10,20 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal.util;
 
-import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.widgets.Control;
 
+
 /**
- * Based on org.eclipse.jdt.internal.ui.util.PixelConverter
+ * @deprecated - use {@link org.eclipse.jface.layout.PixelConverter}
  */
-public class PixelConverter {
-	
-	private final FontMetrics fFontMetrics;
-	
+public class PixelConverter extends org.eclipse.jface.layout.PixelConverter {
+
 	public PixelConverter(Control control) {
-		this(control.getFont());
+		super(control);
 	}
-	
+
 	public PixelConverter(Font font) {
-		GC gc = new GC(font.getDevice());
-		gc.setFont(font);
-		fFontMetrics= gc.getFontMetrics();
-		gc.dispose();
-	}
-	
-	/*
-	 * see org.eclipse.jface.dialogs.DialogPage#convertHeightInCharsToPixels(int)
-	 */
-	public int convertHeightInCharsToPixels(int chars) {
-		return Dialog.convertHeightInCharsToPixels(fFontMetrics, chars);
-	}
-
-	/*
-	 * see org.eclipse.jface.dialogs.DialogPage#convertHorizontalDLUsToPixels(int)
-	 */
-	public int convertHorizontalDLUsToPixels(int dlus) {
-		return Dialog.convertHorizontalDLUsToPixels(fFontMetrics, dlus);
-	}
-
-	/*
-	 * see org.eclipse.jface.dialogs.DialogPage#convertVerticalDLUsToPixels(int)
-	 */
-	public int convertVerticalDLUsToPixels(int dlus) {
-		return Dialog.convertVerticalDLUsToPixels(fFontMetrics, dlus);
-	}
-	
-	/*
-	 * see org.eclipse.jface.dialogs.DialogPage#convertWidthInCharsToPixels(int)
-	 */
-	public int convertWidthInCharsToPixels(int chars) {
-		return Dialog.convertWidthInCharsToPixels(fFontMetrics, chars);
+		super(font);
 	}	
-
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PlatformStatusLineUtil.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PlatformStatusLineUtil.java
index 7d64246..c71017e 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PlatformStatusLineUtil.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PlatformStatusLineUtil.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,6 +12,8 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal.util;
 
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.swt.custom.StyledText;
 import org.eclipse.swt.custom.VerifyKeyListener;
 import org.eclipse.swt.events.FocusAdapter;
@@ -26,7 +28,8 @@
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PlatformUI;
-
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
 
 /**
  * Utility to display (and/or clear) messages on the status line.
@@ -35,22 +38,40 @@
  */
 public class PlatformStatusLineUtil {
 
-	private static class ClearErrorMessage implements Runnable {
+	private static class ClearMessage implements Runnable {
 		public void run() {
 			displayMessage(null);
 		}
 	}
 
+	private static class ClearStatusLine implements Runnable {
+		private IStatusLineManager fManager;
+		private boolean fIsError;
+
+		ClearStatusLine(IStatusLineManager statusLineManager, boolean isError) {
+			fManager = statusLineManager;
+			fIsError = isError;
+		}
+
+		public void run() {
+			if (fIsError) {
+				fManager.setErrorMessage(null);
+			}
+			else {
+				fManager.setMessage(null);
+			}
+		}
+	}
+
 	/**
 	 * Used to clear message on focus loss, change of selection, key type,
 	 * etc...
 	 */
 	private static class OneTimeListener extends FocusAdapter implements VerifyKeyListener, SelectionListener, MouseListener {
-
 		private Runnable fRunner = null;
 		private StyledText fStyledText;
 
-		public OneTimeListener(StyledText target, Runnable r) {
+		OneTimeListener(StyledText target, Runnable r) {
 			fStyledText = target;
 			fRunner = r;
 			fStyledText.addVerifyKeyListener(this);
@@ -97,9 +118,9 @@
 	}
 
 	/**
-	 * Status line will be cleared w/ key type, or selection change
+	 * Status line error message will be cleared w/ key type or selection change
 	 * 
-	 * @param widget
+	 * @deprecated
 	 */
 	public static void addOneTimeClearListener() {
 		IEditorPart editor = getActiveEditor();
@@ -107,7 +128,7 @@
 		if (editor != null) {
 			Control control = (Control) editor.getAdapter(Control.class);
 			if (control instanceof StyledText) {
-				addOneTimeClearListener(((StyledText) control));
+				new OneTimeListener((StyledText) control, new ClearMessage());
 				added = true;
 			}
 		}
@@ -117,12 +138,9 @@
 		}
 	}
 
-	private static void addOneTimeClearListener(StyledText widget) {
-		new OneTimeListener(widget, new ClearErrorMessage());
-	}
-
 	/**
 	 * Clears the status line immediately
+	 * @deprecated
 	 */
 	public static void clearStatusLine() {
 		displayMessage(null);
@@ -130,7 +148,7 @@
 
 	/**
 	 * Display a message on the status line (with a beep)
-	 * 
+	 * @deprecated
 	 * @param msg
 	 */
 	public static void displayErrorMessage(String msg) {
@@ -140,7 +158,7 @@
 
 	/**
 	 * Display a message on the status line (no beep)
-	 * 
+	 * @deprecated
 	 * @param msg
 	 */
 	public static void displayMessage(String msg) {
@@ -155,7 +173,10 @@
 		IEditorPart editor = null;
 		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
 		if (window == null) {
-			window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+			IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
+			if (windows.length > 0) {
+				window = windows[0];
+			}
 		}
 		if (window != null) {
 			IWorkbenchPage page = window.getActivePage();
@@ -168,4 +189,50 @@
 	private PlatformStatusLineUtil() {
 		// force use of singleton
 	}
+
+	/**
+	 * Display an error message on the status line
+	 * 
+	 * @param viewer
+	 * @param msg
+	 */
+	public static boolean displayTemporaryErrorMessage(ITextViewer viewer, String msg) {
+		return _displayTemporaryMessage(viewer, msg, true);
+	}
+
+	/**
+	 * Display a message on the status line
+	 * 
+	 * @param viewer
+	 * @param msg
+	 */
+	public static boolean displayTemporaryMessage(ITextViewer viewer, String msg) {
+		return _displayTemporaryMessage(viewer, msg, false);
+	}
+
+	static boolean _displayTemporaryMessage(ITextViewer viewer, String msg, boolean isError) {
+		boolean messageShown = false;
+		IEditorPart editor = getActiveEditor();
+		if (editor != null) {
+			ITextEditor textEditor = (ITextEditor) editor.getAdapter(ITextEditor.class);
+			if (textEditor != null && textEditor instanceof StructuredTextEditor) {
+				if (((StructuredTextEditor) textEditor).getTextViewer() == viewer) {
+					IStatusLineManager statusLineManager = editor.getEditorSite().getActionBars().getStatusLineManager();
+					if (isError)
+						statusLineManager.setErrorMessage(msg);
+					else
+						statusLineManager.setMessage(msg);
+					new OneTimeListener(viewer.getTextWidget(), new ClearStatusLine(statusLineManager, isError));
+					messageShown = true;
+				}
+			}
+		}
+		
+		if (!messageShown) {
+			displayErrorMessage(msg);
+			addOneTimeClearListener();
+		}
+
+		return messageShown;
+	}
 }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/SWTUtil.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/SWTUtil.java
new file mode 100644
index 0000000..c58494e
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/SWTUtil.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.internal.util;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.layout.PixelConverter;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+
+
+/**
+ * <p>Utility class to simplify access to some SWT resources.</p>
+ * 
+ * @base org.eclipse.jdt.internal.ui.util.SWTUtil
+ */
+public class SWTUtil {
+
+	/**
+	 * Returns a width hint for a button control.
+	 * @param button the button
+	 * @return the width hint
+	 */
+	public static int getButtonWidthHint(Button button) {
+		button.setFont(JFaceResources.getDialogFont());
+		PixelConverter converter= new PixelConverter(button);
+		int widthHint= converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
+		return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
+	}
+
+	/**
+	 * Sets width and height hint for the button control.
+	 * <b>Note:</b> This is a NOP if the button's layout data is not
+	 * an instance of <code>GridData</code>.
+	 *
+	 * @param button	the button for which to set the dimension hint
+	 */
+	public static void setButtonDimensionHint(Button button) {
+		Assert.isNotNull(button);
+		Object gd= button.getLayoutData();
+		if (gd instanceof GridData) {
+			((GridData)gd).widthHint= getButtonWidthHint(button);
+			((GridData)gd).horizontalAlignment = GridData.FILL;
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/AbstractCompletionProposalCategoriesConfiguration.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/AbstractCompletionProposalCategoriesConfiguration.java
new file mode 100644
index 0000000..b6c171f
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/AbstractCompletionProposalCategoriesConfiguration.java
@@ -0,0 +1,392 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.preferences;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposalCategory;
+
+import com.ibm.icu.util.StringTokenizer;
+
+/**
+ * <p>Implements a completion proposal categories configuration
+ * reader and writer using an {@link IPreferenceStore}</p>
+ * 
+ * <p>This class is meant to be subclasses by implementers of the
+ * <code>org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration</code>
+ * extension point as a convince rather then implementing
+ * {@link ICompletionProposalCategoriesConfigurationReader} and
+ * {@link ICompletionProposalCategoriesConfigurationWriter} from scratch.</p>
+ */
+public abstract class AbstractCompletionProposalCategoriesConfiguration
+		implements ICompletionProposalCategoriesConfigurationReader,
+		ICompletionProposalCategoriesConfigurationWriter {
+
+	/** Separator used between preferences stored in the same key */
+	private static final String PREFERENCE_CATEGORY_SEPERATOR = "\0"; //$NON-NLS-1$
+	
+	/**
+	 * <p>{@link CompletionProposalCategory} IDs sorted by the order they should
+	 * be listed on the default page if they are being displayed there</p>
+	 * 
+	 * <code>{@link List}<{@link String}></code>
+	 * <ul><li><b>values:</b> {@link CompletionProposalCategory} IDs</li></ul>
+	 */
+	private List fDefaultPageSortOrder;
+	
+	/**
+	 * <p>{@link CompletionProposalCategory} IDs sorted by the order they should
+	 * be cycled through</p>
+	 * 
+	 * <code>{@link List}<{@link String}></code>
+	 * <ul><li><b>values:</b> {@link CompletionProposalCategory} IDs</li></ul>
+	 */
+	private List fOwnPageSortOrder;
+	
+	/**
+	 * <p>{@link CompletionProposalCategory} IDs that should not be displayed on
+	 * their own page</p>
+	 * 
+	 * <code>{@link Set}<{@link String}></code>
+	 * <ul><li><b>values:</b> {@link CompletionProposalCategory} IDs</li></ul>
+	 */
+	private Set fShouldNotDisplayOnOwnPage;
+	
+	/**
+	 * <p>{@link CompletionProposalCategory} IDs that should not be displayed on
+	 * on the default page</p>
+	 * 
+	 * <code>{@link Set}<{@link String}></code>
+	 * <ul><li><b>values:</b> {@link CompletionProposalCategory} IDs</li></ul>
+	 */
+	private Set fShouldNotDisplayOnDefaultPage;
+	
+	/**
+	 * <p>Create a new configuration by loading from the associated {@link IPreferenceStore}</p>
+	 */
+	public AbstractCompletionProposalCategoriesConfiguration() {
+		this.fOwnPageSortOrder = new ArrayList();
+		this.fDefaultPageSortOrder = new ArrayList();
+		this.fShouldNotDisplayOnOwnPage = new HashSet();
+		this.fShouldNotDisplayOnDefaultPage = new HashSet();
+		
+		this.loadUserConfiguration();
+	}
+	
+	/**
+	 * @return {@link IPreferenceStore} to read and write the configuration to and from
+	 */
+	protected abstract IPreferenceStore getPreferenceStore();
+	
+	/**
+	 * @return Preference key to use in the {@link IPreferenceStore} for the category sort order
+	 * when cycling through the pages
+	 */
+	protected abstract String getPageSortOrderPrefKey();
+	
+	/**
+	 * @return Preference key to use in the {@link IPreferenceStore} for the category sort order
+	 * on the default page
+	 */
+	protected abstract String getDefaultPageSortOrderPrefKey();
+	
+	/**
+	 * @return Preference key to use in the {@link IPreferenceStore} for which
+	 * categories not to display on their own page
+	 */
+	protected abstract String getShouldNotDisplayOnOwnPagePrefKey();
+	
+	/**
+	 * @return Preference key to use in the {@link IPreferenceStore} for which
+	 * categories not to display on the default page
+	 */
+	protected abstract String getShouldNotDisplayOnDefaultPagePrefKey();
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader#getPageSortOrder(java.lang.String)
+	 */
+	public int getPageSortOrder(String categoryID) {
+		int sortOrder = this.fOwnPageSortOrder.indexOf(categoryID);
+		if(sortOrder == -1) {
+			sortOrder = DEFAULT_SORT_ORDER;
+		}
+		
+		return sortOrder;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader#getDefaultPageSortOrder(java.lang.String)
+	 */
+	public int getDefaultPageSortOrder(String categoryID) {
+		int sortOrder = this.fDefaultPageSortOrder.indexOf(categoryID);
+		if(sortOrder == -1) {
+			sortOrder = DEFAULT_SORT_ORDER;
+		}
+		
+		return sortOrder;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader#shouldDisplayOnDefaultPage(java.lang.String)
+	 */
+	public boolean shouldDisplayOnDefaultPage(String categoryID) {
+		return !fShouldNotDisplayOnDefaultPage.contains(categoryID);
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationReader#shouldDisplayOnOwnPage(java.lang.String)
+	 */
+	public boolean shouldDisplayOnOwnPage(String categoryID) {
+		return !this.fShouldNotDisplayOnOwnPage.contains(categoryID);
+	}
+
+	/**
+	 * <p> Loads defaults from the associated {@link IPreferenceStore}</p>
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#loadDefaults()
+	 */
+	public void loadDefaults() {
+		this.loadDefaultPagePreference(true);
+		this.loadPageSortOrder(true);
+		this.loadDefaultPageSortOrder(true);
+		this.loadShouldNotDisplayOnOwnPage(true);
+	}
+
+	/**
+	 * <p>Saves to the associated {@link IPreferenceStore}</p>
+	 * 
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#saveConfiguration()
+	 */
+	public boolean saveConfiguration() {
+		this.saveShouldDisplayOnDefaultPageConfiguration();
+		this.saveShouldDisplayOnOwnPageConfiguration();
+		this.saveDefaultPageSortOrderConfiguration();
+		this.savePageSortOrderConfiguration();
+		
+		return true;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#setShouldDisplayOnDefaultPage(java.lang.String, boolean)
+	 */
+	public void setShouldDisplayOnDefaultPage(String categoryID,
+			boolean shouldDisplay) {
+		
+		if(shouldDisplay) {
+			this.fShouldNotDisplayOnDefaultPage.remove(categoryID);
+		} else {
+			this.fShouldNotDisplayOnDefaultPage.add(categoryID);
+		}
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#setShouldDisplayOnOwnPage(java.lang.String, boolean)
+	 */
+	public void setShouldDisplayOnOwnPage(String categoryID, boolean shouldDisplay) {
+		
+		if(shouldDisplay) {
+			this.fShouldNotDisplayOnOwnPage.remove(categoryID);
+		} else {
+			this.fShouldNotDisplayOnOwnPage.add(categoryID);
+		}
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#setPageOrder(java.util.List)
+	 */
+	public void setPageOrder(List order) {
+		this.fOwnPageSortOrder = order;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#setDefaultPageOrder(java.util.List)
+	 */
+	public void setDefaultPageOrder(List order) {
+		this.fDefaultPageSortOrder = order;
+	}
+
+	/**
+	 * <p>Loads the user configuration from the associated {@link IPreferenceStore}</p>
+	 */
+	private void loadUserConfiguration() {
+		this.loadDefaultPagePreference(false);
+		this.loadPageSortOrder(false);
+		this.loadDefaultPageSortOrder(false);
+		this.loadShouldNotDisplayOnOwnPage(false);
+	}
+	
+	/**
+	 * <p>Loads the user preferences for which categories to
+	 * display on the default content assist page</p>
+	 * 
+	 * @param useDefaults if <code>true</code> then use the {@link IPreferenceStore} defaults,
+	 * otherwise use the user specified preferences
+	 */
+	private void loadDefaultPagePreference(boolean useDefaults) {
+		//clear the current display on default page configuration
+		this.fShouldNotDisplayOnDefaultPage.clear();
+		
+		//parse either the default or user configuration preference
+		String displayOnDefaultPage;
+		if(useDefaults) {
+			displayOnDefaultPage = getPreferenceStore().getDefaultString(getShouldNotDisplayOnDefaultPagePrefKey());
+		} else {
+			displayOnDefaultPage = getPreferenceStore().getString(getShouldNotDisplayOnDefaultPagePrefKey());
+		}
+		StringTokenizer defaultPageTokenizer = new StringTokenizer(displayOnDefaultPage, PREFERENCE_CATEGORY_SEPERATOR);
+		while (defaultPageTokenizer.hasMoreTokens()) {
+			fShouldNotDisplayOnDefaultPage.add(defaultPageTokenizer.nextToken());
+		}
+	}
+	
+	/**
+	 * <p>Loads the user preferences for the sort order of the content assist pages</p>
+	 * 
+	 * @param useDefaults if <code>true</code> then use the {@link IPreferenceStore} defaults,
+	 * otherwise use the user specified preferences
+	 */
+	private void loadPageSortOrder(boolean useDefaults){
+		//clear the current sort order
+		this.fOwnPageSortOrder.clear();
+		
+		//parse either the default or user configuration preference
+		String sortOrder;
+		if(useDefaults) {
+			sortOrder = getPreferenceStore().getDefaultString(getPageSortOrderPrefKey());
+		} else {
+			sortOrder = getPreferenceStore().getString(getPageSortOrderPrefKey());
+		}
+		StringTokenizer tokenizer = new StringTokenizer(sortOrder, PREFERENCE_CATEGORY_SEPERATOR);
+		while (tokenizer.hasMoreTokens()) {
+			String categoryID = tokenizer.nextToken();
+			this.fOwnPageSortOrder.add(categoryID);
+		}
+	}
+	
+	/**
+	 * <p>Loads the user preferences for the sort order of the content assist pages</p>
+	 * 
+	 * @param useDefaults if <code>true</code> then use the {@link IPreferenceStore} defaults,
+	 * otherwise use the user specified preferences
+	 */
+	private void loadDefaultPageSortOrder(boolean useDefaults){
+		//clear the current sort order
+		this.fDefaultPageSortOrder.clear();
+		
+		//parse either the default or user configuration preference
+		String sortOrder;
+		if(useDefaults) {
+			sortOrder = getPreferenceStore().getDefaultString(getDefaultPageSortOrderPrefKey());
+		} else {
+			sortOrder = getPreferenceStore().getString(getDefaultPageSortOrderPrefKey());
+		}
+		StringTokenizer tokenizer = new StringTokenizer(sortOrder, PREFERENCE_CATEGORY_SEPERATOR);
+		while (tokenizer.hasMoreTokens()) {
+			String categoryID = tokenizer.nextToken();
+			this.fDefaultPageSortOrder.add(categoryID);
+		}
+	}
+	
+	/**
+	 * <p>Loads the user preferences for which categories should not be displayed on their own
+	 * content assist page</p>
+	 * 
+	 * @param useDefaults if <code>true</code> then use the {@link IPreferenceStore} defaults,
+	 * otherwise use the user specified preferences
+	 */
+	private void loadShouldNotDisplayOnOwnPage(boolean useDefaults){
+		//clear the current sort order
+		this.fShouldNotDisplayOnOwnPage.clear();
+		
+		//parse either the default or user configuration preference
+		String preference;
+		if(useDefaults) {
+			preference = getPreferenceStore().getDefaultString(getShouldNotDisplayOnOwnPagePrefKey());
+		} else {
+			preference = getPreferenceStore().getString(getShouldNotDisplayOnOwnPagePrefKey());
+		}
+		StringTokenizer tokenizer = new StringTokenizer(preference, PREFERENCE_CATEGORY_SEPERATOR);
+		while (tokenizer.hasMoreTokens()) {
+			String categoryID = tokenizer.nextToken();
+			this.fShouldNotDisplayOnOwnPage.add(categoryID);
+		}
+	}
+	
+	/**
+	 * <p>Saves the user preferences for which categories to
+	 * display on the default content assist page</p>
+	 */
+	private void saveShouldDisplayOnDefaultPageConfiguration() {
+		//create the preference string
+		StringBuffer defaultPageBuff = new StringBuffer();
+		Iterator defaultPageIter = this.fShouldNotDisplayOnDefaultPage.iterator();
+		while(defaultPageIter.hasNext()) {
+			String categoryID = (String)defaultPageIter.next();
+			defaultPageBuff.append(categoryID + PREFERENCE_CATEGORY_SEPERATOR);
+		}
+		
+		//save the preference
+		this.getPreferenceStore().setValue(this.getShouldNotDisplayOnDefaultPagePrefKey(), defaultPageBuff.toString());
+	}
+	
+	/**
+	 * <p>Saves the user preferences for the sort order of the content assist pages</p>
+	 */
+	private void savePageSortOrderConfiguration() {
+		//create the preference string
+		StringBuffer orderBuff = new StringBuffer();
+		for(int i = 0; i < this.fOwnPageSortOrder.size(); ++i) {
+			if(this.fOwnPageSortOrder.get(i) != null) {
+				orderBuff.append(this.fOwnPageSortOrder.get(i) + PREFERENCE_CATEGORY_SEPERATOR);
+			}
+		}
+		
+		//save the preference
+		this.getPreferenceStore().setValue(this.getPageSortOrderPrefKey(), orderBuff.toString());
+	}
+	
+	/**
+	 * <p>Saves the user preferences for the sort order of the categories on the default page</p>
+	 */
+	private void saveDefaultPageSortOrderConfiguration() {
+		//create the preference string
+		StringBuffer orderBuff = new StringBuffer();
+		for(int i = 0; i < this.fDefaultPageSortOrder.size(); ++i) {
+			if(this.fDefaultPageSortOrder.get(i) != null) {
+				orderBuff.append(this.fDefaultPageSortOrder.get(i) + PREFERENCE_CATEGORY_SEPERATOR);
+			}
+		}
+		
+		//save the preference
+		this.getPreferenceStore().setValue(this.getDefaultPageSortOrderPrefKey(), orderBuff.toString());
+	}
+	
+	/**
+	 * <p>Saves the user preferences for which categories should not be displayed on their own
+	 * content assist page</p>
+	 */
+	private void saveShouldDisplayOnOwnPageConfiguration() {
+		//create the preference string
+		StringBuffer buff = new StringBuffer();
+		Iterator iter = this.fShouldNotDisplayOnOwnPage.iterator();
+		while(iter.hasNext()) {
+			String categoryID = (String)iter.next();
+			buff.append(categoryID + PREFERENCE_CATEGORY_SEPERATOR);
+		}
+		
+		//save the preference
+		this.getPreferenceStore().setValue(this.getShouldNotDisplayOnOwnPagePrefKey(), buff.toString());
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/CodeAssistCyclingConfigurationBlock.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/CodeAssistCyclingConfigurationBlock.java
new file mode 100644
index 0000000..e1cfead
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/CodeAssistCyclingConfigurationBlock.java
@@ -0,0 +1,891 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.preferences;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.CommandManager;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.core.commands.contexts.ContextManager;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.bindings.BindingManager;
+import org.eclipse.jface.bindings.Scheme;
+import org.eclipse.jface.bindings.TriggerSequence;
+import org.eclipse.jface.layout.PixelConverter;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.keys.IBindingService;
+import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
+import org.eclipse.wst.sse.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
+import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposalCategory;
+import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposalComputerRegistry;
+import org.eclipse.wst.sse.ui.internal.util.SWTUtil;
+
+
+/**
+ * <p>A helpful preference configuration block implementation for allowing a user to
+ * set their preferences for which content assist categories to show on the default
+ * content assist page as well as on their own separate page and page ordering for
+ * a specific content type</p>
+ * 
+ * @base org.eclipse.jdt.internal.ui.preferences.CodeAssistAdvancedConfigurationBlock
+ */
+public final class CodeAssistCyclingConfigurationBlock  {
+
+	/**
+	 * <p>Used to compare categories based on their assigned page rank</p>
+	 */
+	private final Comparator fCategoryPageComparator = new Comparator() {
+		private int getRank(Object o) {
+			return ((ModelElement) o).getOwnPageRank();
+		}
+
+		public int compare(Object o1, Object o2) {
+			int result = getRank(o1) - getRank(o2);
+			if(result == 0) {
+				result = ((ModelElement) o1).getId().compareTo(((ModelElement) o2).getId());
+			}
+			return result;
+		}
+	};
+	
+	/**
+	 * <p>Used to compare categories based on their assigned default page rank</p>
+	 */
+	private final Comparator fCategoryDefaultPageComparator = new Comparator() {
+		private int getRank(Object o) {
+			return ((ModelElement) o).getDefaultPageRank();
+		}
+
+		public int compare(Object o1, Object o2) {
+			int result = getRank(o1) - getRank(o2);
+			if(result == 0) {
+				result = ((ModelElement) o1).getId().compareTo(((ModelElement) o2).getId());
+			}
+			return result;
+		}
+	};
+
+	/** the preference model for this block */
+	private final PreferenceModel fModel;
+	
+	/**
+	 * <code>{@link Map}<{@link ImageDescriptor}, {@link Image}></code>
+	 */
+	private final Map fImages= new HashMap();
+
+	/** table viewer to configure which categories are displayed on the default page */
+	private CheckboxTableViewer fDefaultPageViewer;
+	
+	/**
+	 * table viewer to configure which categories are displayed
+	 * on their own page, as well as their ordering
+	 */
+	private CheckboxTableViewer fOwnPageViewer;
+	
+	/** categories pages sort order up button */
+	private Button fPageOrderUpButton;
+	
+	/** categories pages sort order down button */
+	private Button fPageOrderDownButton;
+	
+	/** categories default page sort order up button */
+	private Button fDefaultPageOrderUpButton;
+	
+	/** categories default page  sort order down button */
+	private Button fDefaultPageOrderDownButton;
+	
+	/** The content type ID this configuration block is for */
+	private String fContentTypeID;
+	
+	/** The writable categories configuration */
+	private ICompletionProposalCategoriesConfigurationWriter fConfigurationWriter;
+
+	/**
+	 * <p>Creates a new content assist preference block for the given content type
+	 * using the given configuration writer</p>
+	 * 
+	 * @param contentTypeID content type this content assist preference block is for
+	 * @param configurationWriter {@link ICompletionProposalCategoriesConfigurationWriter} used
+	 * to read and write the user preferences 
+	 */
+	public CodeAssistCyclingConfigurationBlock(String contentTypeID, ICompletionProposalCategoriesConfigurationWriter configurationWriter) {
+		this.fContentTypeID = contentTypeID;
+		this.fConfigurationWriter = configurationWriter;
+		
+		List categories = CompletionProposalComputerRegistry.getDefault().getProposalCategories(this.fContentTypeID);
+		this.fModel = new PreferenceModel(categories);
+	}
+	
+	/**
+	 * <p>Saves the user configuration</p>
+	 * @return <code>true</code> if store was successful, <code>false</code> otherwise
+	 */
+	public boolean storeValues() {
+		return this.fConfigurationWriter.saveConfiguration();
+	}
+	
+	/**
+	 * <p>Loads the preference defaults</p>
+	 */
+	public void performDefaults() {
+		this.fConfigurationWriter.loadDefaults();
+		this.initializeValues();
+		this.fModel.performDefaults();
+	}
+	
+	/**
+	 * <p>Disposes of this preference block</p>
+	 */
+	public void dispose() {
+		for (Iterator it= fImages.values().iterator(); it.hasNext();) {
+			Image image= (Image) it.next();
+			image.dispose();
+		}
+	}
+
+	/**
+	 * <p>Creates the contents of this configuration block using a {@link Group} if
+	 * the given <code>groupTitle</code> is not <code>null</code> else creates it
+	 * as a composite and in either case adds itself to the given parent</p>
+	 * 
+	 * @param parent {@link Composite} parent to add this configuration block to
+	 * @param groupTitle Title to use for the configuration block group, if
+	 * <code>null</code> then a {@link Composite} will be used instead of a
+	 * {@link Group}
+	 * 
+	 * @return the created configuration block that has already been added to the parent
+	 */
+	public Control createContents(Composite parent, String groupTitle) {
+		Composite container;
+		if(groupTitle != null) {
+			container = new Group(parent, SWT.NULL);
+			((Group)container).setText(groupTitle);
+		} else {
+			container = new Composite(parent, SWT.NULL);
+		}
+		int columns= 2;
+		GridLayout layout= new GridLayout(columns, false);
+		container.setLayout(layout);
+		
+		GridData data = new GridData(GridData.FILL);
+		data.horizontalIndent = 0;
+		data.verticalAlignment = GridData.FILL;
+		data.horizontalAlignment = GridData.FILL;
+		data.grabExcessHorizontalSpace = true;
+		container.setLayoutData(data);
+
+		createDefaultPageLabel(container, columns);
+		createDefaultPageSection(container);
+
+		createFiller(container, columns);
+
+		createOwnPageLabel(container, columns);
+        createOwnPageSection(container);
+
+        createFiller(container, columns);
+
+		if (fModel.pageElements.size() > 0) {
+			fDefaultPageViewer.getTable().select(0);
+			fOwnPageViewer.getTable().select(0);
+			handleOwnPageTableSelection();
+			handleDefaultPageTableSelection();
+		}
+		
+		return container;
+	}
+	
+	/**
+	 * <p>Initialize the values of the configuration block</p>
+	 */
+	public void initializeValues() {
+		updateCheckedState();
+		fDefaultPageViewer.refresh();
+		fOwnPageViewer.refresh();
+		handleOwnPageTableSelection();
+		handleDefaultPageTableSelection();
+	}
+	
+	private void createDefaultPageSection(Composite composite) {
+		createDefaultPageViewer(composite);
+		createDefaultPageButtonList(composite);
+	}
+
+	private void createDefaultPageLabel(Composite composite, int h_span) {
+	    final ICommandService commandSvc= (ICommandService) PlatformUI.getWorkbench().getAdapter(ICommandService.class);
+		final Command command= commandSvc.getCommand(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
+		ParameterizedCommand pCmd= new ParameterizedCommand(command, null);
+		String key= getKeyboardShortcut(pCmd);
+		if (key == null) {
+			key= SSEUIMessages.CodeAssistAdvancedConfigurationBlock_no_shortcut;
+		}
+
+		PixelConverter pixelConverter= new PixelConverter(composite);
+		int width= pixelConverter.convertWidthInCharsToPixels(40);
+
+		Label label= new Label(composite, SWT.NONE | SWT.WRAP);
+		label.setText(NLS.bind(SSEUIMessages.CodeAssistAdvancedConfigurationBlock_page_description, new Object[] { key }));
+		GridData gd= new GridData(GridData.FILL, GridData.FILL, true, false, h_span, 1);
+		gd.widthHint= width;
+		label.setLayoutData(gd);
+
+		createFiller(composite, h_span);
+
+		label= new Label(composite, SWT.NONE | SWT.WRAP);
+		label.setText(SSEUIMessages.CodeAssistAdvancedConfigurationBlock_default_table_description);
+		gd= new GridData(GridData.FILL, GridData.FILL, true, false, h_span, 1);
+		gd.widthHint= width;
+		label.setLayoutData(gd);
+    }
+
+	private void createDefaultPageViewer(Composite composite) {
+		fDefaultPageViewer= CheckboxTableViewer.newCheckList(composite, SWT.SINGLE | SWT.BORDER);
+		Table table= fDefaultPageViewer.getTable();
+		table.setHeaderVisible(true);
+		table.setLinesVisible(false);
+		table.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 1, 1));
+
+		TableColumn nameColumn= new TableColumn(table, SWT.NONE);
+		nameColumn.setText(SSEUIMessages.CodeAssistAdvancedConfigurationBlock_default_table_category_column_title);
+		nameColumn.setResizable(false);
+
+		fDefaultPageViewer.addCheckStateListener(new ICheckStateListener() {
+			public void checkStateChanged(CheckStateChangedEvent event) {
+				boolean checked= event.getChecked();
+				ModelElement element= (ModelElement) event.getElement();
+				element.setShouldDisplayOnDefaultPage(checked);
+			}
+		});
+
+		fDefaultPageViewer.setContentProvider(new ArrayContentProvider());
+
+		DefaultPageTableLabelProvider labelProvider= new DefaultPageTableLabelProvider();
+		fDefaultPageViewer.setLabelProvider(labelProvider);
+		fDefaultPageViewer.setInput(fModel.defaultPageElements);
+		fDefaultPageViewer.setComparator(new ModelViewerComparator(fCategoryDefaultPageComparator));
+
+		final int ICON_AND_CHECKBOX_WITH= 50;
+		final int HEADER_MARGIN= 20;
+		int minNameWidth= computeWidth(table, nameColumn.getText()) + HEADER_MARGIN;
+		for (int i= 0; i < fModel.defaultPageElements.size(); i++) {
+			minNameWidth= Math.max(minNameWidth, computeWidth(table, labelProvider.getColumnText(fModel.defaultPageElements.get(i), 0)) + ICON_AND_CHECKBOX_WITH);
+		}
+
+		nameColumn.setWidth(minNameWidth);
+		
+		table.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				handleDefaultPageTableSelection();
+			}
+		});
+	}
+	
+	/**
+	 * <p>Create the Up and Down buttons for the default page viewer</p>
+	 * @param parent {@link Composite} to add the button list to 
+	 */
+	private void createDefaultPageButtonList(Composite parent) {
+		Composite composite= new Composite(parent, SWT.NONE);
+		composite.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));
+
+		GridLayout layout= new GridLayout();
+		layout.marginWidth= 0;
+		layout.marginHeight= 0;
+		composite.setLayout(layout);
+
+		fDefaultPageOrderUpButton= new Button(composite, SWT.PUSH | SWT.CENTER);
+		fDefaultPageOrderUpButton.setText(SSEUIMessages.CodeAssistAdvancedConfigurationBlock_Up);
+		fDefaultPageOrderUpButton.addSelectionListener(new SelectionAdapter() {
+        	public void widgetSelected(SelectionEvent e) {
+        		int index = fDefaultPageViewer.getTable().getSelectionIndex();
+        		if (index != -1) {
+        			fModel.moveDefaultPageCategoryUp(index);
+        			fDefaultPageViewer.refresh();
+        			handleDefaultPageTableSelection();
+        		}
+        	}
+        });
+		fDefaultPageOrderUpButton.setLayoutData(new GridData());
+        
+        SWTUtil.setButtonDimensionHint(fDefaultPageOrderUpButton);
+
+        fDefaultPageOrderDownButton= new Button(composite, SWT.PUSH | SWT.CENTER);
+        fDefaultPageOrderDownButton.setText(SSEUIMessages.CodeAssistAdvancedConfigurationBlock_Down);
+        fDefaultPageOrderDownButton.addSelectionListener(new SelectionAdapter() {
+        	public void widgetSelected(SelectionEvent e) {
+        		int index= fDefaultPageViewer.getTable().getSelectionIndex();
+        		if (index != -1) {
+        			fModel.moveDefaultPageCategoryDown(index);
+        			fDefaultPageViewer.refresh();
+        			handleDefaultPageTableSelection();
+        		}
+        	}
+        });
+        fDefaultPageOrderDownButton.setLayoutData(new GridData());
+        SWTUtil.setButtonDimensionHint(fDefaultPageOrderDownButton);
+	}
+
+	private void createFiller(Composite composite, int h_span) {
+	    Label filler= new Label(composite, SWT.NONE);
+		filler.setVisible(false);
+		filler.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, h_span, 1));
+    }
+
+	private void createOwnPageLabel(Composite composite, int h_span) {
+		PixelConverter pixelConverter= new PixelConverter(composite);
+		int width= pixelConverter.convertWidthInCharsToPixels(40);
+
+		Label label= new Label(composite, SWT.NONE | SWT.WRAP);
+		label.setText(SSEUIMessages.CodeAssistAdvancedConfigurationBlock_separate_table_description);
+		GridData gd= new GridData(GridData.FILL, GridData.FILL, false, false, h_span, 1);
+		gd.widthHint= width;
+		label.setLayoutData(gd);
+	}
+
+	private void createOwnPageSection(Composite composite) {
+		createOwnPageViewer(composite);
+		createOwnPageButtonList(composite);
+	}
+
+	private void createOwnPageViewer(Composite composite) {
+		fOwnPageViewer= CheckboxTableViewer.newCheckList(composite, SWT.SINGLE | SWT.BORDER);
+		Table table= fOwnPageViewer.getTable();
+		table.setHeaderVisible(true);
+		table.setLinesVisible(false);
+		table.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false, 1, 1));
+
+		TableColumn nameColumn= new TableColumn(table, SWT.NONE);
+		nameColumn.setText(SSEUIMessages.CodeAssistAdvancedConfigurationBlock_separate_table_category_column_title);
+		nameColumn.setResizable(false);
+
+		fOwnPageViewer.setContentProvider(new ArrayContentProvider());
+
+		ITableLabelProvider labelProvider= new OwnPageTableLabelProvider();
+		fOwnPageViewer.setLabelProvider(labelProvider);
+		fOwnPageViewer.setInput(fModel.pageElements);
+		fOwnPageViewer.setComparator(new ModelViewerComparator(fCategoryPageComparator));
+
+		final int ICON_AND_CHECKBOX_WITH= 50;
+		final int HEADER_MARGIN= 20;
+		int minNameWidth= computeWidth(table, nameColumn.getText()) + HEADER_MARGIN;
+		for (int i= 0; i < fModel.pageElements.size(); i++) {
+			minNameWidth= Math.max(minNameWidth, computeWidth(table, labelProvider.getColumnText(fModel.pageElements.get(i), 0)) + ICON_AND_CHECKBOX_WITH);
+		}
+
+		nameColumn.setWidth(minNameWidth);
+
+		fOwnPageViewer.addCheckStateListener(new ICheckStateListener() {
+			public void checkStateChanged(CheckStateChangedEvent event) {
+				boolean checked= event.getChecked();
+				ModelElement element= (ModelElement) event.getElement();
+				element.setShouldDisplayOnOwnPage(checked);
+			}
+		});
+
+		table.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				handleOwnPageTableSelection();
+			}
+		});
+
+	}
+
+	/**
+	 * <p>Create the Up and Down buttons for the own page viewer</p>
+	 * @param parent {@link Composite} to add the button list to 
+	 */
+	private void createOwnPageButtonList(Composite parent) {
+		Composite composite= new Composite(parent, SWT.NONE);
+		composite.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));
+
+		GridLayout layout= new GridLayout();
+		layout.marginWidth= 0;
+		layout.marginHeight= 0;
+		composite.setLayout(layout);
+
+		fPageOrderUpButton= new Button(composite, SWT.PUSH | SWT.CENTER);
+        fPageOrderUpButton.setText(SSEUIMessages.CodeAssistAdvancedConfigurationBlock_PagesUp);
+        fPageOrderUpButton.addSelectionListener(new SelectionAdapter() {
+        	public void widgetSelected(SelectionEvent e) {
+        		int index = fOwnPageViewer.getTable().getSelectionIndex();
+        		if (index != -1) {
+        			fModel.movePageUp(index);
+        			fOwnPageViewer.refresh();
+        			handleOwnPageTableSelection();
+        		}
+        	}
+        });
+        fPageOrderUpButton.setLayoutData(new GridData());
+        
+        SWTUtil.setButtonDimensionHint(fPageOrderUpButton);
+
+        fPageOrderDownButton= new Button(composite, SWT.PUSH | SWT.CENTER);
+        fPageOrderDownButton.setText(SSEUIMessages.CodeAssistAdvancedConfigurationBlock_PagesDown);
+        fPageOrderDownButton.addSelectionListener(new SelectionAdapter() {
+        	public void widgetSelected(SelectionEvent e) {
+        		int index= fOwnPageViewer.getTable().getSelectionIndex();
+        		if (index != -1) {
+        			fModel.movePageDown(index);
+        			fOwnPageViewer.refresh();
+        			handleOwnPageTableSelection();
+        		}
+        	}
+        });
+        fPageOrderDownButton.setLayoutData(new GridData());
+        SWTUtil.setButtonDimensionHint(fPageOrderDownButton);
+	}
+
+	/**
+	 * <p>Update the enablement of the Up and Down buttons for the own page table viewer</p>
+	 */
+	private void handleOwnPageTableSelection() {
+		ModelElement item= (ModelElement) ((IStructuredSelection) fOwnPageViewer.getSelection()).getFirstElement();
+		if (item != null) {
+			int index= fOwnPageViewer.getTable().getSelectionIndex();
+			fPageOrderUpButton.setEnabled(index > 0);
+			fPageOrderDownButton.setEnabled(index < fModel.pageElements.size() - 1);
+		} else {
+			fPageOrderUpButton.setEnabled(false);
+			fPageOrderDownButton.setEnabled(false);
+		}
+	}
+	
+	/**
+	 * <p>Update the enablement of the Up and Down buttons for the default page table viewer</p>
+	 */
+	private void handleDefaultPageTableSelection() {
+		ModelElement item= (ModelElement) ((IStructuredSelection) fDefaultPageViewer.getSelection()).getFirstElement();
+		if (item != null) {
+			int index = fDefaultPageViewer.getTable().getSelectionIndex();
+			fDefaultPageOrderUpButton.setEnabled(index > 0);
+			fDefaultPageOrderDownButton.setEnabled(index < fModel.defaultPageElements.size() - 1);
+		} else {
+			fDefaultPageOrderUpButton.setEnabled(false);
+			fDefaultPageOrderDownButton.setEnabled(false);
+		}
+	}
+
+	private void updateCheckedState() {
+		/* does not matter which set of elements we use here
+		 * because order does not matter in this case
+		 */
+		final int size= fModel.pageElements.size();
+		List defaultChecked= new ArrayList(size);
+		List separateChecked= new ArrayList(size);
+
+		for (Iterator it= fModel.pageElements.iterator(); it.hasNext();) {
+			ModelElement element= (ModelElement) it.next();
+			if (element.shouldDisplayOnDefaultPage())
+				defaultChecked.add(element);
+			if (element.shouldDisplayOnOwnPage())
+				separateChecked.add(element);
+		}
+
+		fDefaultPageViewer.setCheckedElements(defaultChecked.toArray(new Object[defaultChecked.size()]));
+		fOwnPageViewer.setCheckedElements(separateChecked.toArray(new Object[separateChecked.size()]));
+	}
+
+	private int computeWidth(Control control, String name) {
+		if (name == null)
+			return 0;
+		GC gc= new GC(control);
+		try {
+			gc.setFont(JFaceResources.getDialogFont());
+			return gc.stringExtent(name).x + 10;
+		} finally {
+			gc.dispose();
+		}
+	}
+
+	private static BindingManager fgLocalBindingManager;
+	static {
+		fgLocalBindingManager= new BindingManager(new ContextManager(), new CommandManager());
+		final IBindingService bindingService= (IBindingService)PlatformUI.getWorkbench().getService(IBindingService.class);
+		final Scheme[] definedSchemes= bindingService.getDefinedSchemes();
+		if (definedSchemes != null) {
+			try {
+				for (int i = 0; i < definedSchemes.length; i++) {
+					final Scheme scheme= definedSchemes[i];
+					final Scheme copy= fgLocalBindingManager.getScheme(scheme.getId());
+					copy.define(scheme.getName(), scheme.getDescription(), scheme.getParentId());
+				}
+			} catch (final NotDefinedException e) {
+				Logger.logException(e);
+			}
+		}
+		fgLocalBindingManager.setLocale(bindingService.getLocale());
+		fgLocalBindingManager.setPlatform(bindingService.getPlatform());
+	}
+
+	private static String getKeyboardShortcut(ParameterizedCommand command) {
+		IBindingService bindingService= (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class);
+		fgLocalBindingManager.setBindings(bindingService.getBindings());
+		try {
+			Scheme activeScheme= bindingService.getActiveScheme();
+			if (activeScheme != null)
+				fgLocalBindingManager.setActiveScheme(activeScheme);
+		} catch (NotDefinedException e) {
+			Logger.logException(e);
+		}
+
+		TriggerSequence[] bindings= fgLocalBindingManager.getActiveBindingsDisregardingContextFor(command);
+		if (bindings.length > 0)
+			return bindings[0].format();
+		return null;
+	}
+
+	/**
+	 * <p>Gets and image based on an image descriptor, and stores the image so it
+	 * does not have to be created more then once</p>
+	 * 
+	 * @param imgDesc {@link ImageDescriptor} to get the {@link Image} for
+	 * @return {@link Image} created from the {@link ImageDescriptor}, or stored
+	 * {@link Image} associated with the given {@link ImageDescriptor} if an
+	 * {@link Image} had already been created for the given {@link ImageDescriptor}
+	 */
+	private Image getImage(ImageDescriptor imgDesc) {
+		if (imgDesc == null)
+			return null;
+
+		Image img= (Image) fImages.get(imgDesc);
+		if (img == null) {
+			img= imgDesc.createImage(false);
+			fImages.put(imgDesc, img);
+		}
+		return img;
+	}
+
+	/**
+	 * <p>Label provider for the table for configuring which categories should be displayed on the
+	 * default assist page</p>
+	 */
+	private final class DefaultPageTableLabelProvider extends LabelProvider implements ITableLabelProvider {
+		/**
+		 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
+		 */
+		public Image getColumnImage(Object element, int columnIndex) {
+			if (columnIndex == 0)
+				return ((ModelElement) element).getImage();
+			return null;
+		}
+
+		/**
+		 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
+		 */
+		public String getColumnText(Object element, int columnIndex) {
+			switch (columnIndex) {
+	            case 0:
+	            	return ((ModelElement) element).getName();
+	            default:
+	            	Assert.isTrue(false);
+	            	return null;
+            }
+		}
+
+		/**
+		 * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
+		 */
+		public String getText(Object element) {
+		    return getColumnText(element, 0); // needed to make the sorter work
+		}
+	}
+
+	/**
+	 * <p>Label provider for the table for configuring which categories should be displayed on their
+	 * own content assist page</p>
+	 */
+	private final class OwnPageTableLabelProvider extends LabelProvider implements ITableLabelProvider {
+		/**
+		 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
+		 */
+		public Image getColumnImage(Object element, int columnIndex) {
+			if (columnIndex == 0)
+				return ((ModelElement) element).getImage();
+			return null;
+		}
+
+		/**
+		 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
+		 */
+		public String getColumnText(Object element, int columnIndex) {
+			switch (columnIndex) {
+				case 0:
+					return ((ModelElement) element).getName();
+				default:
+					Assert.isTrue(false);
+				return null;
+			}
+		}
+	}
+	
+	/**
+	 * <p>PreferenceModel used to read and write the user preferences
+	 * using the {@link ICompletionProposalCategoriesConfigurationWriter}</p>
+	 */
+	private final class PreferenceModel {
+		/** private modifiable page element list */
+		private final List fPageElements;
+		
+		/** public unmodifiable page element list */
+		final List pageElements;
+		
+		/** private modifiable default page element list */
+		private final List fDefaultPageElements;
+		
+		/** public unmodifiable default page element list */
+		final List defaultPageElements;
+
+		/**
+		 * <p>Create the preference model for the given categories</p>
+		 * 
+		 * @param categories <code>{@link List}<{@link CompletionProposalCategory}></code>
+		 */
+		public PreferenceModel(List categories) {
+			//need separate lists because they will be ordered differently
+			this.fPageElements = new ArrayList();
+			this.fDefaultPageElements = new ArrayList();
+			for (Iterator it= categories.iterator(); it.hasNext();) {
+				CompletionProposalCategory category= (CompletionProposalCategory) it.next();
+				if (category.hasComputers()) {
+					ModelElement elem = new ModelElement(category);
+					fPageElements.add(elem);
+					fDefaultPageElements.add(elem);
+				}
+			}
+			//sort the lists
+			this.performDefaults();
+			
+			pageElements = Collections.unmodifiableList(fPageElements);
+			defaultPageElements = Collections.unmodifiableList(fDefaultPageElements);
+		}
+
+		/**
+		 * <p>Move the model element specified by the given index
+		 * up in the content assist page order</p>
+		 * 
+		 * @param elementIndex the index of the model element to move up
+		 */
+        public void movePageUp(int elementIndex) {
+        	Object removed = fPageElements.remove(elementIndex);
+        	fPageElements.add(elementIndex-1, removed);
+        	
+        	fConfigurationWriter.setPageOrder(getPageOrderedCategoryIDs());
+        }
+        
+        /**
+		 * <p>Move the model element specified by the given index
+		 * down in the content assist page order</p>
+		 * 
+		 * @param elementIndex the index of the model element to move up
+		 */
+        public void movePageDown(int elementIndex) {
+        	Object removed = fPageElements.remove(elementIndex);
+        	fPageElements.add(elementIndex+1, removed);
+        	
+        	fConfigurationWriter.setPageOrder(getPageOrderedCategoryIDs());
+        }
+        
+        /**
+		 * <p>Move the model element specified by the given index
+		 * up in the content assist page order</p>
+		 * 
+		 * @param elementIndex the index of the model element to move up
+		 */
+        public void moveDefaultPageCategoryUp(int elementIndex) {
+        	Object removed = fDefaultPageElements.remove(elementIndex);
+        	fDefaultPageElements.add(elementIndex-1, removed);
+        	
+        	fConfigurationWriter.setDefaultPageOrder(getDefaultPageOrderedCategoryIDs());
+        }
+        
+        /**
+		 * <p>Move the model element specified by the given index
+		 * down in the content assist page order</p>
+		 * 
+		 * @param elementIndex the index of the model element to move up
+		 */
+        public void moveDefaultPageCategoryDown(int elementIndex) {
+        	Object removed = fDefaultPageElements.remove(elementIndex);
+        	fDefaultPageElements.add(elementIndex+1, removed);
+        	
+        	fConfigurationWriter.setDefaultPageOrder(getDefaultPageOrderedCategoryIDs());
+        }
+        
+        /**
+         * @return <code>{@link List}<{@link String}></code> -
+         * List of category IDs by page order
+         */
+        private List getPageOrderedCategoryIDs() {
+        	List ordered = new ArrayList(pageElements.size());
+        	for(int i = 0; i < pageElements.size(); ++i) {
+        		ordered.add(((ModelElement)pageElements.get(i)).getId());
+        	}
+        	
+        	return ordered;
+        }
+        
+        /**
+         * @return <code>{@link List}<{@link String}></code> -
+         * List of category IDs by default page order
+         */
+        private List getDefaultPageOrderedCategoryIDs() {
+        	List ordered = new ArrayList(defaultPageElements.size());
+        	for(int i = 0; i < defaultPageElements.size(); ++i) {
+        		ordered.add(((ModelElement)defaultPageElements.get(i)).getId());
+        	}
+        	
+        	return ordered;
+        }
+        
+        /**
+         * <p>need to re-sort the lists after performing defaults</p>
+         */
+        public void performDefaults() {
+        	Collections.sort(fPageElements, fCategoryPageComparator);
+			Collections.sort(fDefaultPageElements, fCategoryDefaultPageComparator);
+        }
+	}
+	
+	/**
+	 * <p>Wraps a {@link CompletionProposalCategory} for use in the {@link PreferenceModel}</p>
+	 */
+	private final class ModelElement {
+		/** The wrapped category */
+		private final CompletionProposalCategory fCategory;
+
+		/**
+		 * <p>Create a new model element wrapping the given category</p>
+		 * 
+		 * @param category {@link CompletionProposalCategory} to be wrapped by this model element
+		 * for use in the {@link PreferenceModel}
+		 */
+		ModelElement(CompletionProposalCategory category) {
+			fCategory= category;
+		}
+		
+		/**
+		 * @return {@link Image} associated with the wrapped category
+		 */
+		Image getImage() {
+			return CodeAssistCyclingConfigurationBlock.this.getImage(fCategory.getImageDescriptor());
+		}
+		
+		/**
+		 * @return name of the wrapped category
+		 */
+		String getName() {
+			return fCategory.getDisplayName();
+		}
+		
+		String getId() {
+			return fCategory.getId();
+		}
+		
+		/**
+		 * @return <code>true</code> if the wrapped category should be displayed on the
+		 * default content assist page, <code>false</code> otherwise
+		 */
+		boolean shouldDisplayOnDefaultPage() {
+			return fConfigurationWriter.shouldDisplayOnDefaultPage(this.getId());
+		}
+		
+		/**
+		 * @param included <code>true</code> if the wrapped category should be displayed on the
+		 * default content assist page, <code>false</code> otherwise
+		 */
+		void setShouldDisplayOnDefaultPage(boolean included) {
+			fConfigurationWriter.setShouldDisplayOnDefaultPage(this.getId(), included);
+		}
+		
+		/**
+		 * @return <code>true</code> if the wrapped category should be displayed on the
+		 * its own content assist page, <code>false</code> otherwise
+		 */
+		boolean shouldDisplayOnOwnPage() {
+			return fConfigurationWriter.shouldDisplayOnOwnPage(this.getId());
+		}
+		
+		/**
+		 * @param shouldDisplay <code>true</code> if the wrapped category should be displayed on the
+		 * its own content assist page, <code>false</code> otherwise
+		 */
+		void setShouldDisplayOnOwnPage(boolean shouldDisplay) {
+			fConfigurationWriter.setShouldDisplayOnOwnPage(this.getId(), shouldDisplay);
+		}
+		
+		/**
+		 * @return the wrapped categories content assist page sort rank compared to the
+		 * other categories
+		 */
+		int getOwnPageRank() {
+			return fConfigurationWriter.getPageSortOrder(this.getId());
+		}
+		
+		/**
+		 * @return the wrapped categories content assist page sort rank compared to the
+		 * other categories
+		 */
+		int getDefaultPageRank() {
+			return fConfigurationWriter.getDefaultPageSortOrder(this.getId());
+		}
+	}
+	
+	private class ModelViewerComparator extends ViewerComparator {
+		/**
+		 * 
+		 */
+		public ModelViewerComparator(Comparator comparator) {
+			super(comparator);
+		}
+		
+		/**
+		 * @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+		 */
+		public int compare(Viewer viewer, Object e1, Object e2) {
+			return this.getComparator().compare(e1, e2);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ICompletionProposalCategoriesConfigurationReader.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ICompletionProposalCategoriesConfigurationReader.java
new file mode 100644
index 0000000..74c95df
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ICompletionProposalCategoriesConfigurationReader.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.preferences;
+
+/**
+ * <p>Implementers of the <code>org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration</code>
+ * extension will need an implementation of this interface for their extension</p>
+ * 
+ * <p><b>NOTE: </b>Implementers must have a 0 argument constructor so class can be instantiated by
+ * extension.</p>
+ * 
+ * @see ICompletionProposalCategoriesConfigurationWriter
+ */
+public interface ICompletionProposalCategoriesConfigurationReader {
+	/** 
+	 * The default is to display a category on its own page
+	 * if not otherwise defined by a property.
+	 */
+	boolean DEFAULT_DISPLAY_ON_OWN_PAGE = true;
+	
+	/** The default is to display a category on the default content assist page. */
+	boolean DEFAULT_INCLUDE_ON_DEFAULTS_PAGE = true;
+	
+	/** the default sort order if none is defined by a properties extension */
+	int DEFAULT_SORT_ORDER = Integer.MAX_VALUE;
+	
+	/**
+	 * <p>Determines if the given category should be displayed on its own content
+	 * assist page</p>
+	 * 
+	 * @param categoryID determine if this category should be displayed on its own
+	 * content assist page
+	 * 
+	 * @return <code>true</code> if the given category should be displayed on its
+	 * own content assist page, <code>false</code> otherwise
+	 */
+	boolean shouldDisplayOnOwnPage(String categoryID);
+	
+	/**
+	 * <p>Determines if the given category should be displayed on the default
+	 * content assist page</p>
+	 * 
+	 * @param categoryID determine if this category should be displayed on the
+	 * default content assist page
+	 * 
+	 * @return <code>true</code> if the given category should be displayed on the
+	 * default content assist page, <code>false</code> otherwise
+	 */
+	boolean shouldDisplayOnDefaultPage(String categoryID);
+	
+	/**
+	 * <p>Determines the sort order ranking of the given category when compared
+	 * to the other categories, this is used to determine the order in which
+	 * the separate content assist pages should be displayed</p>
+	 * 
+	 * @param categoryID determine the sort order ranking of this category
+	 * 
+	 * @return the sort order ranking of the given category when compared
+	 * to the other categories
+	 */
+	int getPageSortOrder(String categoryID);
+	
+	/**
+	 * <p>Determines the sort order ranking of the given category when compared
+	 * to the other categories, this is used to determine the order in which
+	 * categories should be listed on the default page</p>
+	 * 
+	 * @param categoryID determine the sort order ranking of this category
+	 * 
+	 * @return the sort order ranking of the given category when compared
+	 * to the other categories
+	 */
+	int getDefaultPageSortOrder(String categoryID);
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ICompletionProposalCategoriesConfigurationWriter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ICompletionProposalCategoriesConfigurationWriter.java
new file mode 100644
index 0000000..0462819
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ICompletionProposalCategoriesConfigurationWriter.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.preferences;
+
+import java.util.List;
+
+import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposalCategory;
+
+/**
+ * <p>Implementers of the <code>org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration</code>
+ * extension can implement this interface if their configuration should be user edible and thus
+ * needs writing capabilities</p>
+ * 
+ * <p><b>NOTE: </b>Implementers must have a 0 argument constructor so class can be instantiated by
+ * extension.</p>
+ * 
+ * @see ICompletionProposalCategoriesConfigurationReader
+ */
+public interface ICompletionProposalCategoriesConfigurationWriter extends
+		ICompletionProposalCategoriesConfigurationReader {
+	
+	/**
+	 * <p>If a writer has a known associated properties page then that properties
+	 * page ID can be used so that error messages during the content assist process
+	 * can link to that preference page to allow the user to change the settings</p>
+	 * 
+	 * @return <code>true</code> if this writer has a known associated properties
+	 * preference page, <code>false</code> otherwise
+	 */
+	boolean hasAssociatedPropertiesPage();
+	
+	/**
+	 * @return If {@link #hasAssociatedPropertiesPage()} returns <code>true</code> then
+	 * this method must return a valid properties page ID where the user can edit the
+	 * content assist configuration, else it can return <code>null</code>
+	 */
+	String getPropertiesPageID();
+	
+	/**
+	 * <p>Sets whether or not the given category should be displayed on its own content
+	 * assist page.<p>
+	 * 
+	 * <p><b>NOTE: </b>This preference should <b>NOT</b> be saved permanently here, that action
+	 * should wait until {@link #saveConfiguration()} is called</p>
+	 * 
+	 * @param categoryID the category that should either be displayed on its own content
+	 * assist page or not
+	 * @param shouldDisplay <code>true</code> if the given category should be displayed
+	 * on its own content assist page, <code>false</code> otherwise
+	 */
+	void setShouldDisplayOnDefaultPage(String categoryID, boolean shouldDisplay);
+	
+	/**
+	 * <p>Sets whether or not the given category should be displayed on the default content
+	 * assist page.<p>
+	 * 
+	 * <p><b>NOTE: </b>This preference should <b>NOT</b> be saved permanently here, that action
+	 * should wait until {@link #saveConfiguration()} is called</p>
+	 * 
+	 * @param categoryID the category that should either be displayed on the default content
+	 * assist page or not
+	 * @param shouldDisplay <code>true</code> if the given category should be displayed
+	 * on the default content assist page, <code>false</code> otherwise
+	 */
+	void setShouldDisplayOnOwnPage(String categoryID, boolean shouldDisplay);
+	
+	/**
+	 * <p>Sets the order in which the categories should be cycled when invoking content
+	 * assist multiple times.  Event categories that are not activated to display on their
+	 * own content assist page can be listed here so that when activated to display on their
+	 * own page they have a rank.  The entire order needs to be re-set each time one category
+	 * moves because the writer has no way of knowing how to move just one category in the order</p>
+	 * 
+	 * <p><b>NOTE: </b>This preference should <b>NOT</b> be saved permanently here, that action
+	 * should wait until {@link #saveConfiguration()} is called</p>
+	 * 
+	 * @param order <code>{@link List}<{@link String}></code>
+	 * <ul><li><b>values:</b> {@link CompletionProposalCategory} IDs</li></ul>
+	 */
+	void setPageOrder(List order);
+	
+	/**
+	 * <p>Sets the order in which the categories should be listed on the default page.
+	 * Event categories that are not activated to display on the default content assist
+	 * page can be listed here so that when activated to display on the default page
+	 * they have a rank.  The entire order needs to be re-set each time one category
+	 * moves because the writer has no way of knowing how to move just one category in the order</p>
+	 * 
+	 * <p><b>NOTE: </b>This preference should <b>NOT</b> be saved permanently here, that action
+	 * should wait until {@link #saveConfiguration()} is called</p>
+	 * 
+	 * @param order <code>{@link List}<{@link String}></code>
+	 * <ul><li><b>values:</b> {@link CompletionProposalCategory} IDs</li></ul>
+	 */
+	void setDefaultPageOrder(List order);
+	
+	/**
+	 * <p>Should load the default settings from wherever they are being stored</p>
+	 */
+	void loadDefaults();
+	
+	/**
+	 * <p>Should save the configuration permanently.  Typically called after the user
+	 * changes some preferences using a preference page and then applies them, but if they do
+	 * not apply the changes then this function should not be called.  This is the reason why the
+	 * various <code>set*</code> methods should not permanently save the configuration</p>
+	 * 
+	 * @return <code>true</code> if the save was successful, <code>false</code> otherwise
+	 */
+	boolean saveConfiguration();
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/quickoutline/AbstractQuickOutlineConfiguration.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/quickoutline/AbstractQuickOutlineConfiguration.java
new file mode 100644
index 0000000..33ff2d8
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/quickoutline/AbstractQuickOutlineConfiguration.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.quickoutline;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.wst.sse.ui.IContentSelectionProvider;
+
+/**
+ * Base class that provides configuration for a quick outline.
+ *
+ */
+public abstract class AbstractQuickOutlineConfiguration {
+
+	/**
+	 * Provides the label provider to be used by the quick outline
+	 * 
+	 * @return an <code>ILabelProvider</code> to be used by the quick outline
+	 */
+	public abstract ILabelProvider getLabelProvider();
+
+	/**
+	 * Provides the content provider to be used by the quick outline
+	 * 
+	 * @return a <code>ITreeContentProvider</code> to be used when providing the content of the quick outline
+	 */
+	public abstract ITreeContentProvider getContentProvider();
+
+	/**
+	 * Provides the content selection provider to be used by the quick outline. This allows
+	 * for adjusting the selection to be displayed in the outline based on the editor's selection
+	 * 
+	 * @return an <code>IContentSelectionProvider</code> used by the quick outline. By default, returns
+	 * null indicating that the selection in the editor translates to the selection in the outline.
+	 */
+	public IContentSelectionProvider getContentSelectionProvider() {
+		return null;
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/reconcile/ISourceReconcilingListener.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/reconcile/ISourceReconcilingListener.java
new file mode 100644
index 0000000..1109386
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/reconcile/ISourceReconcilingListener.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.sse.ui.reconcile;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.source.IAnnotationModel;
+
+/**
+ * A course listener for source viewer "reconciling" of a document
+ * 
+ */
+public interface ISourceReconcilingListener {
+
+	/**
+	 * Called before reconciling is started.
+	 */
+	void aboutToBeReconciled();
+
+	/**
+	 * Called after reconciling has been finished.
+	 * 
+	 * @param document
+	 *            the text document or <code>null</code> if reconciliation has
+	 *            been cancelled
+	 * @param model
+	 *            the annotation model that was changed or <code>null</code>
+	 *            if reconciliation has been cancelled
+	 * @param forced
+	 *            <code>true</code> iff this reconciliation was forced
+	 * @param progressMonitor
+	 *            the progress monitor
+	 */
+	void reconciled(IDocument document, IAnnotationModel model, boolean forced, IProgressMonitor progressMonitor);
+}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/typing/AbstractCharacterPairInserter.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/typing/AbstractCharacterPairInserter.java
new file mode 100644
index 0000000..653965b
--- /dev/null
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/typing/AbstractCharacterPairInserter.java
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.sse.ui.typing;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.link.ILinkedModeListener;
+import org.eclipse.jface.text.link.LinkedModeModel;
+import org.eclipse.jface.text.link.LinkedModeUI;
+import org.eclipse.jface.text.link.LinkedPosition;
+import org.eclipse.jface.text.link.LinkedPositionGroup;
+import org.eclipse.jface.text.link.LinkedModeUI.ExitFlags;
+import org.eclipse.jface.text.link.LinkedModeUI.IExitPolicy;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.wst.sse.ui.internal.Logger;
+
+abstract public class AbstractCharacterPairInserter {
+
+	class ExitPolicy implements IExitPolicy {
+
+		private char fExit;
+		private char fEscape;
+		private IDocument fDocument;
+
+		public ExitPolicy(char exit, char escape, IDocument document) {
+			fExit = exit;
+			fEscape = escape;
+			fDocument = document;
+		}
+
+		public ExitFlags doExit(LinkedModeModel model, VerifyEvent event, int offset, int length) {
+			if(!isMasked(offset)) {
+				if (event.character == fExit)
+					return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
+			}
+			return null;
+		}
+
+		private boolean isMasked(int offset) {
+			try {
+				return fEscape == fDocument.getChar(offset - 1);
+			} catch (BadLocationException e) {
+			}
+			return false;
+		}
+	}
+
+	/**
+	 * Pair the character <code>c</code> in the source viewer <code>viewer</code>.
+	 * Positions are linked before and after the inserted character.
+	 * 
+	 * @param viewer the source viewer to add the linked mode to
+	 * @param c the character to pair with
+	 * @return true if the character was successfully paired; false otherwise
+	 */
+	public boolean pair(final ISourceViewer viewer, final char c) {
+		if (!shouldPair(viewer, c))
+			return false;
+
+		final char mc = getPair(c);
+		final char[] chars = new char[2];
+		chars[0] = c;
+		chars[1] = mc;
+
+		IDocument document = viewer.getDocument();
+
+		final Point selection= viewer.getSelectedRange();
+		final int offset= selection.x;
+		final int length= selection.y;
+
+		boolean paired = false;
+		try {
+			document.replace(offset, length, new String(chars));
+			LinkedModeModel model = new LinkedModeModel();
+			LinkedPositionGroup group = new LinkedPositionGroup();
+			group.addPosition(new LinkedPosition(document, offset + 1, 0, LinkedPositionGroup.NO_STOP));
+			model.addGroup(group);
+			model.forceInstall();
+
+			LinkedModeUI ui = new LinkedModeUI(model, viewer);
+			ui.setCyclingMode(LinkedModeUI.CYCLE_NEVER);
+			ui.setExitPosition(viewer, offset + 2, 0, Integer.MAX_VALUE);
+			ui.setExitPolicy(getExitPolicy(mc, getEscapeChar(c), document));
+			ui.setSimpleMode(true);
+			ui.enter();
+
+			paired = true;
+		} catch (BadLocationException e) {
+			Logger.logException(e);
+		}
+		return paired;
+	}
+
+	/**
+	 * Hook to evaluate if the character should be paired. Clients may override
+	 * to evaluate the case.
+	 * @param viewer the source viewer where the character would be paired
+	 * @param c the character to pair
+	 * @return true if the character should have its pair character inserted; false otherwise
+	 */
+	protected boolean shouldPair(ISourceViewer viewer, char c) {
+		return true;
+	}
+
+	/**
+	 * Can the character be paired by the inserter
+	 * @param c the character of interest
+	 * @return true if the character can be paired by the inserter; false otherwise
+	 */
+	abstract public boolean hasPair(char c);
+
+	/**
+	 * Get the paired character for <code>c</code>
+	 * @param c the character to find the pair of
+	 * @return the pair character
+	 */
+	abstract protected char getPair(char c);
+
+	/**
+	 * Gets the escape character for <code>c</code> in case <code>c</code> is to be used
+	 * within the paired characters
+	 * @param c the character to find the escape character of
+	 * @return the escape character
+	 */
+	protected char getEscapeChar(char c) {
+		return 0;
+	}
+
+	public void initialize() {
+	}
+
+	public void dispose() {
+	}
+
+	protected IExitPolicy getExitPolicy(char exit, char escape, IDocument document) {
+		return new ExitPolicy(exit, escape, document);
+	}
+}
diff --git a/bundles/org.eclipse.wst.standard.schemas/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.standard.schemas/META-INF/MANIFEST.MF
index a19268b..c66f08e 100644
--- a/bundles/org.eclipse.wst.standard.schemas/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.standard.schemas/META-INF/MANIFEST.MF
@@ -2,8 +2,8 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name.0
 Bundle-SymbolicName: org.eclipse.wst.standard.schemas;singleton:=true
-Bundle-Version: 1.0.1.qualifier
+Bundle-Version: 1.0.300.qualifier
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: plugin
-Require-Bundle: org.eclipse.wst.xml.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.0,1.2.0)"
+Require-Bundle: org.eclipse.wst.xml.core;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.wst.sse.core;bundle-version="[1.1.0,2.0.0)"
diff --git a/bundles/org.eclipse.wst.standard.schemas/about.html b/bundles/org.eclipse.wst.standard.schemas/about.html
index 021ac10..fc2a7cd 100644
--- a/bundles/org.eclipse.wst.standard.schemas/about.html
+++ b/bundles/org.eclipse.wst.standard.schemas/about.html
@@ -7,7 +7,7 @@
 <body lang="EN-US">
 <h2>About This Content</h2>
 
-<p>June 16, 2006</p>
+<p>June, 2008</p>
 <h3>License</h3>
 
 <p>The Eclipse Foundation makes available all content in this
diff --git a/bundles/org.eclipse.wst.standard.schemas/build.properties b/bundles/org.eclipse.wst.standard.schemas/build.properties
index a8d1418..f16450e 100644
--- a/bundles/org.eclipse.wst.standard.schemas/build.properties
+++ b/bundles/org.eclipse.wst.standard.schemas/build.properties
@@ -19,10 +19,8 @@
                @dot/**,\
                temp.folder/**
 src.includes = xsd/,\
-               plugin.xml,\
-               plugin.properties,\
                dtds/,\
                about_files/,\
-               about.html,\
-               META-INF/
+               about.html
+generateSourceBundle=false
 
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/HTMLlat1.ent b/bundles/org.eclipse.wst.standard.schemas/dtds/HTMLlat1.ent
new file mode 100644
index 0000000..c644486
--- /dev/null
+++ b/bundles/org.eclipse.wst.standard.schemas/dtds/HTMLlat1.ent
@@ -0,0 +1,194 @@
+<!-- Portions (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+-->
+<!-- Character entity set. Typical invocation:
+     <!ENTITY % HTMLlat1 PUBLIC
+       "-//W3C//ENTITIES Latin 1//EN//HTML">
+     %HTMLlat1;
+-->
+
+<!ENTITY nbsp   CDATA "&#160;" -- no-break space = non-breaking space,
+                                  U+00A0 ISOnum -->
+<!ENTITY iexcl  CDATA "&#161;" -- inverted exclamation mark, U+00A1 ISOnum -->
+<!ENTITY cent   CDATA "&#162;" -- cent sign, U+00A2 ISOnum -->
+<!ENTITY pound  CDATA "&#163;" -- pound sign, U+00A3 ISOnum -->
+<!ENTITY curren CDATA "&#164;" -- currency sign, U+00A4 ISOnum -->
+<!ENTITY yen    CDATA "&#165;" -- yen sign = yuan sign, U+00A5 ISOnum -->
+<!ENTITY brvbar CDATA "&#166;" -- broken bar = broken vertical bar,
+                                  U+00A6 ISOnum -->
+<!ENTITY sect   CDATA "&#167;" -- section sign, U+00A7 ISOnum -->
+<!ENTITY uml    CDATA "&#168;" -- diaeresis = spacing diaeresis,
+                                  U+00A8 ISOdia -->
+<!ENTITY copy   CDATA "&#169;" -- copyright sign, U+00A9 ISOnum -->
+<!ENTITY ordf   CDATA "&#170;" -- feminine ordinal indicator, U+00AA ISOnum -->
+<!ENTITY laquo  CDATA "&#171;" -- left-pointing double angle quotation mark
+                                  = left pointing guillemet, U+00AB ISOnum -->
+<!ENTITY not    CDATA "&#172;" -- not sign, U+00AC ISOnum -->
+<!ENTITY shy    CDATA "&#173;" -- soft hyphen = discretionary hyphen,
+                                  U+00AD ISOnum -->
+<!ENTITY reg    CDATA "&#174;" -- registered sign = registered trade mark sign,
+                                  U+00AE ISOnum -->
+<!ENTITY macr   CDATA "&#175;" -- macron = spacing macron = overline
+                                  = APL overbar, U+00AF ISOdia -->
+<!ENTITY deg    CDATA "&#176;" -- degree sign, U+00B0 ISOnum -->
+<!ENTITY plusmn CDATA "&#177;" -- plus-minus sign = plus-or-minus sign,
+                                  U+00B1 ISOnum -->
+<!ENTITY sup2   CDATA "&#178;" -- superscript two = superscript digit two
+                                  = squared, U+00B2 ISOnum -->
+<!ENTITY sup3   CDATA "&#179;" -- superscript three = superscript digit three
+                                  = cubed, U+00B3 ISOnum -->
+<!ENTITY acute  CDATA "&#180;" -- acute accent = spacing acute,
+                                  U+00B4 ISOdia -->
+<!ENTITY micro  CDATA "&#181;" -- micro sign, U+00B5 ISOnum -->
+<!ENTITY para   CDATA "&#182;" -- pilcrow sign = paragraph sign,
+                                  U+00B6 ISOnum -->
+<!ENTITY middot CDATA "&#183;" -- middle dot = Georgian comma
+                                  = Greek middle dot, U+00B7 ISOnum -->
+<!ENTITY cedil  CDATA "&#184;" -- cedilla = spacing cedilla, U+00B8 ISOdia -->
+<!ENTITY sup1   CDATA "&#185;" -- superscript one = superscript digit one,
+                                  U+00B9 ISOnum -->
+<!ENTITY ordm   CDATA "&#186;" -- masculine ordinal indicator,
+                                  U+00BA ISOnum -->
+<!ENTITY raquo  CDATA "&#187;" -- right-pointing double angle quotation mark
+                                  = right pointing guillemet, U+00BB ISOnum -->
+<!ENTITY frac14 CDATA "&#188;" -- vulgar fraction one quarter
+                                  = fraction one quarter, U+00BC ISOnum -->
+<!ENTITY frac12 CDATA "&#189;" -- vulgar fraction one half
+                                  = fraction one half, U+00BD ISOnum -->
+<!ENTITY frac34 CDATA "&#190;" -- vulgar fraction three quarters
+                                  = fraction three quarters, U+00BE ISOnum -->
+<!ENTITY iquest CDATA "&#191;" -- inverted question mark
+                                  = turned question mark, U+00BF ISOnum -->
+<!ENTITY Agrave CDATA "&#192;" -- latin capital letter A with grave
+                                  = latin capital letter A grave,
+                                  U+00C0 ISOlat1 -->
+<!ENTITY Aacute CDATA "&#193;" -- latin capital letter A with acute,
+                                  U+00C1 ISOlat1 -->
+<!ENTITY Acirc  CDATA "&#194;" -- latin capital letter A with circumflex,
+                                  U+00C2 ISOlat1 -->
+<!ENTITY Atilde CDATA "&#195;" -- latin capital letter A with tilde,
+                                  U+00C3 ISOlat1 -->
+<!ENTITY Auml   CDATA "&#196;" -- latin capital letter A with diaeresis,
+                                  U+00C4 ISOlat1 -->
+<!ENTITY Aring  CDATA "&#197;" -- latin capital letter A with ring above
+                                  = latin capital letter A ring,
+                                  U+00C5 ISOlat1 -->
+<!ENTITY AElig  CDATA "&#198;" -- latin capital letter AE
+                                  = latin capital ligature AE,
+                                  U+00C6 ISOlat1 -->
+<!ENTITY Ccedil CDATA "&#199;" -- latin capital letter C with cedilla,
+                                  U+00C7 ISOlat1 -->
+<!ENTITY Egrave CDATA "&#200;" -- latin capital letter E with grave,
+                                  U+00C8 ISOlat1 -->
+<!ENTITY Eacute CDATA "&#201;" -- latin capital letter E with acute,
+                                  U+00C9 ISOlat1 -->
+<!ENTITY Ecirc  CDATA "&#202;" -- latin capital letter E with circumflex,
+                                  U+00CA ISOlat1 -->
+<!ENTITY Euml   CDATA "&#203;" -- latin capital letter E with diaeresis,
+                                  U+00CB ISOlat1 -->
+<!ENTITY Igrave CDATA "&#204;" -- latin capital letter I with grave,
+                                  U+00CC ISOlat1 -->
+<!ENTITY Iacute CDATA "&#205;" -- latin capital letter I with acute,
+                                  U+00CD ISOlat1 -->
+<!ENTITY Icirc  CDATA "&#206;" -- latin capital letter I with circumflex,
+                                  U+00CE ISOlat1 -->
+<!ENTITY Iuml   CDATA "&#207;" -- latin capital letter I with diaeresis,
+                                  U+00CF ISOlat1 -->
+<!ENTITY ETH    CDATA "&#208;" -- latin capital letter ETH, U+00D0 ISOlat1 -->
+<!ENTITY Ntilde CDATA "&#209;" -- latin capital letter N with tilde,
+                                  U+00D1 ISOlat1 -->
+<!ENTITY Ograve CDATA "&#210;" -- latin capital letter O with grave,
+                                  U+00D2 ISOlat1 -->
+<!ENTITY Oacute CDATA "&#211;" -- latin capital letter O with acute,
+                                  U+00D3 ISOlat1 -->
+<!ENTITY Ocirc  CDATA "&#212;" -- latin capital letter O with circumflex,
+                                  U+00D4 ISOlat1 -->
+<!ENTITY Otilde CDATA "&#213;" -- latin capital letter O with tilde,
+                                  U+00D5 ISOlat1 -->
+<!ENTITY Ouml   CDATA "&#214;" -- latin capital letter O with diaeresis,
+                                  U+00D6 ISOlat1 -->
+<!ENTITY times  CDATA "&#215;" -- multiplication sign, U+00D7 ISOnum -->
+<!ENTITY Oslash CDATA "&#216;" -- latin capital letter O with stroke
+                                  = latin capital letter O slash,
+                                  U+00D8 ISOlat1 -->
+<!ENTITY Ugrave CDATA "&#217;" -- latin capital letter U with grave,
+                                  U+00D9 ISOlat1 -->
+<!ENTITY Uacute CDATA "&#218;" -- latin capital letter U with acute,
+                                  U+00DA ISOlat1 -->
+<!ENTITY Ucirc  CDATA "&#219;" -- latin capital letter U with circumflex,
+                                  U+00DB ISOlat1 -->
+<!ENTITY Uuml   CDATA "&#220;" -- latin capital letter U with diaeresis,
+                                  U+00DC ISOlat1 -->
+<!ENTITY Yacute CDATA "&#221;" -- latin capital letter Y with acute,
+                                  U+00DD ISOlat1 -->
+<!ENTITY THORN  CDATA "&#222;" -- latin capital letter THORN,
+                                  U+00DE ISOlat1 -->
+<!ENTITY szlig  CDATA "&#223;" -- latin small letter sharp s = ess-zed,
+                                  U+00DF ISOlat1 -->
+<!ENTITY agrave CDATA "&#224;" -- latin small letter a with grave
+                                  = latin small letter a grave,
+                                  U+00E0 ISOlat1 -->
+<!ENTITY aacute CDATA "&#225;" -- latin small letter a with acute,
+                                  U+00E1 ISOlat1 -->
+<!ENTITY acirc  CDATA "&#226;" -- latin small letter a with circumflex,
+                                  U+00E2 ISOlat1 -->
+<!ENTITY atilde CDATA "&#227;" -- latin small letter a with tilde,
+                                  U+00E3 ISOlat1 -->
+<!ENTITY auml   CDATA "&#228;" -- latin small letter a with diaeresis,
+                                  U+00E4 ISOlat1 -->
+<!ENTITY aring  CDATA "&#229;" -- latin small letter a with ring above
+                                  = latin small letter a ring,
+                                  U+00E5 ISOlat1 -->
+<!ENTITY aelig  CDATA "&#230;" -- latin small letter ae
+                                  = latin small ligature ae, U+00E6 ISOlat1 -->
+<!ENTITY ccedil CDATA "&#231;" -- latin small letter c with cedilla,
+                                  U+00E7 ISOlat1 -->
+<!ENTITY egrave CDATA "&#232;" -- latin small letter e with grave,
+                                  U+00E8 ISOlat1 -->
+<!ENTITY eacute CDATA "&#233;" -- latin small letter e with acute,
+                                  U+00E9 ISOlat1 -->
+<!ENTITY ecirc  CDATA "&#234;" -- latin small letter e with circumflex,
+                                  U+00EA ISOlat1 -->
+<!ENTITY euml   CDATA "&#235;" -- latin small letter e with diaeresis,
+                                  U+00EB ISOlat1 -->
+<!ENTITY igrave CDATA "&#236;" -- latin small letter i with grave,
+                                  U+00EC ISOlat1 -->
+<!ENTITY iacute CDATA "&#237;" -- latin small letter i with acute,
+                                  U+00ED ISOlat1 -->
+<!ENTITY icirc  CDATA "&#238;" -- latin small letter i with circumflex,
+                                  U+00EE ISOlat1 -->
+<!ENTITY iuml   CDATA "&#239;" -- latin small letter i with diaeresis,
+                                  U+00EF ISOlat1 -->
+<!ENTITY eth    CDATA "&#240;" -- latin small letter eth, U+00F0 ISOlat1 -->
+<!ENTITY ntilde CDATA "&#241;" -- latin small letter n with tilde,
+                                  U+00F1 ISOlat1 -->
+<!ENTITY ograve CDATA "&#242;" -- latin small letter o with grave,
+                                  U+00F2 ISOlat1 -->
+<!ENTITY oacute CDATA "&#243;" -- latin small letter o with acute,
+                                  U+00F3 ISOlat1 -->
+<!ENTITY ocirc  CDATA "&#244;" -- latin small letter o with circumflex,
+                                  U+00F4 ISOlat1 -->
+<!ENTITY otilde CDATA "&#245;" -- latin small letter o with tilde,
+                                  U+00F5 ISOlat1 -->
+<!ENTITY ouml   CDATA "&#246;" -- latin small letter o with diaeresis,
+                                  U+00F6 ISOlat1 -->
+<!ENTITY divide CDATA "&#247;" -- division sign, U+00F7 ISOnum -->
+<!ENTITY oslash CDATA "&#248;" -- latin small letter o with stroke,
+                                  = latin small letter o slash,
+                                  U+00F8 ISOlat1 -->
+<!ENTITY ugrave CDATA "&#249;" -- latin small letter u with grave,
+                                  U+00F9 ISOlat1 -->
+<!ENTITY uacute CDATA "&#250;" -- latin small letter u with acute,
+                                  U+00FA ISOlat1 -->
+<!ENTITY ucirc  CDATA "&#251;" -- latin small letter u with circumflex,
+                                  U+00FB ISOlat1 -->
+<!ENTITY uuml   CDATA "&#252;" -- latin small letter u with diaeresis,
+                                  U+00FC ISOlat1 -->
+<!ENTITY yacute CDATA "&#253;" -- latin small letter y with acute,
+                                  U+00FD ISOlat1 -->
+<!ENTITY thorn  CDATA "&#254;" -- latin small letter thorn,
+                                  U+00FE ISOlat1 -->
+<!ENTITY yuml   CDATA "&#255;" -- latin small letter y with diaeresis,
+                                  U+00FF ISOlat1 -->
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/HTMLspecial.ent b/bundles/org.eclipse.wst.standard.schemas/dtds/HTMLspecial.ent
new file mode 100644
index 0000000..5ce5c6a
--- /dev/null
+++ b/bundles/org.eclipse.wst.standard.schemas/dtds/HTMLspecial.ent
@@ -0,0 +1,77 @@
+<!-- Special characters for HTML -->
+
+<!-- Character entity set. Typical invocation:
+     <!ENTITY % HTMLspecial PUBLIC
+       "-//W3C//ENTITIES Special//EN//HTML">
+     %HTMLspecial; -->
+
+<!-- Portions (C) International Organization for Standardization 1986:
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+-->
+
+<!-- Relevant ISO entity set is given unless names are newly introduced.
+     New names (i.e., not in ISO 8879 list) do not clash with any
+     existing ISO 8879 entity names. ISO 10646 character numbers
+     are given for each character, in hex. CDATA values are decimal
+     conversions of the ISO 10646 values and refer to the document
+     character set. Names are ISO 10646 names. 
+
+-->
+
+<!-- C0 Controls and Basic Latin -->
+<!ENTITY quot    CDATA "&#34;"   -- quotation mark = APL quote,
+                                    U+0022 ISOnum -->
+<!ENTITY amp     CDATA "&#38;"   -- ampersand, U+0026 ISOnum -->
+<!ENTITY lt      CDATA "&#60;"   -- less-than sign, U+003C ISOnum -->
+<!ENTITY gt      CDATA "&#62;"   -- greater-than sign, U+003E ISOnum -->
+
+<!-- Latin Extended-A -->
+<!ENTITY OElig   CDATA "&#338;"  -- latin capital ligature OE,
+                                    U+0152 ISOlat2 -->
+<!ENTITY oelig   CDATA "&#339;"  -- latin small ligature oe, U+0153 ISOlat2 -->
+<!-- ligature is a misnomer, this is a separate character in some languages -->
+<!ENTITY Scaron  CDATA "&#352;"  -- latin capital letter S with caron,
+                                    U+0160 ISOlat2 -->
+<!ENTITY scaron  CDATA "&#353;"  -- latin small letter s with caron,
+                                    U+0161 ISOlat2 -->
+<!ENTITY Yuml    CDATA "&#376;"  -- latin capital letter Y with diaeresis,
+                                    U+0178 ISOlat2 -->
+
+<!-- Spacing Modifier Letters -->
+<!ENTITY circ    CDATA "&#710;"  -- modifier letter circumflex accent,
+                                    U+02C6 ISOpub -->
+<!ENTITY tilde   CDATA "&#732;"  -- small tilde, U+02DC ISOdia -->
+
+<!-- General Punctuation -->
+<!ENTITY ensp    CDATA "&#8194;" -- en space, U+2002 ISOpub -->
+<!ENTITY emsp    CDATA "&#8195;" -- em space, U+2003 ISOpub -->
+<!ENTITY thinsp  CDATA "&#8201;" -- thin space, U+2009 ISOpub -->
+<!ENTITY zwnj    CDATA "&#8204;" -- zero width non-joiner,
+                                    U+200C NEW RFC 2070 -->
+<!ENTITY zwj     CDATA "&#8205;" -- zero width joiner, U+200D NEW RFC 2070 -->
+<!ENTITY lrm     CDATA "&#8206;" -- left-to-right mark, U+200E NEW RFC 2070 -->
+<!ENTITY rlm     CDATA "&#8207;" -- right-to-left mark, U+200F NEW RFC 2070 -->
+<!ENTITY ndash   CDATA "&#8211;" -- en dash, U+2013 ISOpub -->
+<!ENTITY mdash   CDATA "&#8212;" -- em dash, U+2014 ISOpub -->
+<!ENTITY lsquo   CDATA "&#8216;" -- left single quotation mark,
+                                    U+2018 ISOnum -->
+<!ENTITY rsquo   CDATA "&#8217;" -- right single quotation mark,
+                                    U+2019 ISOnum -->
+<!ENTITY sbquo   CDATA "&#8218;" -- single low-9 quotation mark, U+201A NEW -->
+<!ENTITY ldquo   CDATA "&#8220;" -- left double quotation mark,
+                                    U+201C ISOnum -->
+<!ENTITY rdquo   CDATA "&#8221;" -- right double quotation mark,
+                                    U+201D ISOnum -->
+<!ENTITY bdquo   CDATA "&#8222;" -- double low-9 quotation mark, U+201E NEW -->
+<!ENTITY dagger  CDATA "&#8224;" -- dagger, U+2020 ISOpub -->
+<!ENTITY Dagger  CDATA "&#8225;" -- double dagger, U+2021 ISOpub -->
+<!ENTITY permil  CDATA "&#8240;" -- per mille sign, U+2030 ISOtech -->
+<!ENTITY lsaquo  CDATA "&#8249;" -- single left-pointing angle quotation mark,
+                                    U+2039 ISO proposed -->
+<!-- lsaquo is proposed but not yet ISO standardized -->
+<!ENTITY rsaquo  CDATA "&#8250;" -- single right-pointing angle quotation mark,
+                                    U+203A ISO proposed -->
+<!-- rsaquo is proposed but not yet ISO standardized -->
+<!ENTITY euro   CDATA "&#8364;"  -- euro sign, U+20AC NEW -->
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/HTMLsymbol.ent b/bundles/org.eclipse.wst.standard.schemas/dtds/HTMLsymbol.ent
new file mode 100644
index 0000000..524bfe1
--- /dev/null
+++ b/bundles/org.eclipse.wst.standard.schemas/dtds/HTMLsymbol.ent
@@ -0,0 +1,241 @@
+<!-- Mathematical, Greek and Symbolic characters for HTML -->
+
+<!-- Character entity set. Typical invocation:
+     <!ENTITY % HTMLsymbol PUBLIC
+       "-//W3C//ENTITIES Symbols//EN//HTML">
+     %HTMLsymbol; -->
+
+<!-- Portions (C) International Organization for Standardization 1986:
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+-->
+
+<!-- Relevant ISO entity set is given unless names are newly introduced.
+     New names (i.e., not in ISO 8879 list) do not clash with any
+     existing ISO 8879 entity names. ISO 10646 character numbers
+     are given for each character, in hex. CDATA values are decimal
+     conversions of the ISO 10646 values and refer to the document
+     character set. Names are ISO 10646 names. 
+
+-->
+
+<!-- Latin Extended-B -->
+<!ENTITY fnof     CDATA "&#402;" -- latin small f with hook = function
+                                    = florin, U+0192 ISOtech -->
+
+<!-- Greek -->
+<!ENTITY Alpha    CDATA "&#913;" -- greek capital letter alpha, U+0391 -->
+<!ENTITY Beta     CDATA "&#914;" -- greek capital letter beta, U+0392 -->
+<!ENTITY Gamma    CDATA "&#915;" -- greek capital letter gamma,
+                                    U+0393 ISOgrk3 -->
+<!ENTITY Delta    CDATA "&#916;" -- greek capital letter delta,
+                                    U+0394 ISOgrk3 -->
+<!ENTITY Epsilon  CDATA "&#917;" -- greek capital letter epsilon, U+0395 -->
+<!ENTITY Zeta     CDATA "&#918;" -- greek capital letter zeta, U+0396 -->
+<!ENTITY Eta      CDATA "&#919;" -- greek capital letter eta, U+0397 -->
+<!ENTITY Theta    CDATA "&#920;" -- greek capital letter theta,
+                                    U+0398 ISOgrk3 -->
+<!ENTITY Iota     CDATA "&#921;" -- greek capital letter iota, U+0399 -->
+<!ENTITY Kappa    CDATA "&#922;" -- greek capital letter kappa, U+039A -->
+<!ENTITY Lambda   CDATA "&#923;" -- greek capital letter lambda,
+                                    U+039B ISOgrk3 -->
+<!ENTITY Mu       CDATA "&#924;" -- greek capital letter mu, U+039C -->
+<!ENTITY Nu       CDATA "&#925;" -- greek capital letter nu, U+039D -->
+<!ENTITY Xi       CDATA "&#926;" -- greek capital letter xi, U+039E ISOgrk3 -->
+<!ENTITY Omicron  CDATA "&#927;" -- greek capital letter omicron, U+039F -->
+<!ENTITY Pi       CDATA "&#928;" -- greek capital letter pi, U+03A0 ISOgrk3 -->
+<!ENTITY Rho      CDATA "&#929;" -- greek capital letter rho, U+03A1 -->
+<!-- there is no Sigmaf, and no U+03A2 character either -->
+<!ENTITY Sigma    CDATA "&#931;" -- greek capital letter sigma,
+                                    U+03A3 ISOgrk3 -->
+<!ENTITY Tau      CDATA "&#932;" -- greek capital letter tau, U+03A4 -->
+<!ENTITY Upsilon  CDATA "&#933;" -- greek capital letter upsilon,
+                                    U+03A5 ISOgrk3 -->
+<!ENTITY Phi      CDATA "&#934;" -- greek capital letter phi,
+                                    U+03A6 ISOgrk3 -->
+<!ENTITY Chi      CDATA "&#935;" -- greek capital letter chi, U+03A7 -->
+<!ENTITY Psi      CDATA "&#936;" -- greek capital letter psi,
+                                    U+03A8 ISOgrk3 -->
+<!ENTITY Omega    CDATA "&#937;" -- greek capital letter omega,
+                                    U+03A9 ISOgrk3 -->
+
+<!ENTITY alpha    CDATA "&#945;" -- greek small letter alpha,
+                                    U+03B1 ISOgrk3 -->
+<!ENTITY beta     CDATA "&#946;" -- greek small letter beta, U+03B2 ISOgrk3 -->
+<!ENTITY gamma    CDATA "&#947;" -- greek small letter gamma,
+                                    U+03B3 ISOgrk3 -->
+<!ENTITY delta    CDATA "&#948;" -- greek small letter delta,
+                                    U+03B4 ISOgrk3 -->
+<!ENTITY epsilon  CDATA "&#949;" -- greek small letter epsilon,
+                                    U+03B5 ISOgrk3 -->
+<!ENTITY zeta     CDATA "&#950;" -- greek small letter zeta, U+03B6 ISOgrk3 -->
+<!ENTITY eta      CDATA "&#951;" -- greek small letter eta, U+03B7 ISOgrk3 -->
+<!ENTITY theta    CDATA "&#952;" -- greek small letter theta,
+                                    U+03B8 ISOgrk3 -->
+<!ENTITY iota     CDATA "&#953;" -- greek small letter iota, U+03B9 ISOgrk3 -->
+<!ENTITY kappa    CDATA "&#954;" -- greek small letter kappa,
+                                    U+03BA ISOgrk3 -->
+<!ENTITY lambda   CDATA "&#955;" -- greek small letter lambda,
+                                    U+03BB ISOgrk3 -->
+<!ENTITY mu       CDATA "&#956;" -- greek small letter mu, U+03BC ISOgrk3 -->
+<!ENTITY nu       CDATA "&#957;" -- greek small letter nu, U+03BD ISOgrk3 -->
+<!ENTITY xi       CDATA "&#958;" -- greek small letter xi, U+03BE ISOgrk3 -->
+<!ENTITY omicron  CDATA "&#959;" -- greek small letter omicron, U+03BF NEW -->
+<!ENTITY pi       CDATA "&#960;" -- greek small letter pi, U+03C0 ISOgrk3 -->
+<!ENTITY rho      CDATA "&#961;" -- greek small letter rho, U+03C1 ISOgrk3 -->
+<!ENTITY sigmaf   CDATA "&#962;" -- greek small letter final sigma,
+                                    U+03C2 ISOgrk3 -->
+<!ENTITY sigma    CDATA "&#963;" -- greek small letter sigma,
+                                    U+03C3 ISOgrk3 -->
+<!ENTITY tau      CDATA "&#964;" -- greek small letter tau, U+03C4 ISOgrk3 -->
+<!ENTITY upsilon  CDATA "&#965;" -- greek small letter upsilon,
+                                    U+03C5 ISOgrk3 -->
+<!ENTITY phi      CDATA "&#966;" -- greek small letter phi, U+03C6 ISOgrk3 -->
+<!ENTITY chi      CDATA "&#967;" -- greek small letter chi, U+03C7 ISOgrk3 -->
+<!ENTITY psi      CDATA "&#968;" -- greek small letter psi, U+03C8 ISOgrk3 -->
+<!ENTITY omega    CDATA "&#969;" -- greek small letter omega,
+                                    U+03C9 ISOgrk3 -->
+<!ENTITY thetasym CDATA "&#977;" -- greek small letter theta symbol,
+                                    U+03D1 NEW -->
+<!ENTITY upsih    CDATA "&#978;" -- greek upsilon with hook symbol,
+                                    U+03D2 NEW -->
+<!ENTITY piv      CDATA "&#982;" -- greek pi symbol, U+03D6 ISOgrk3 -->
+
+<!-- General Punctuation -->
+<!ENTITY bull     CDATA "&#8226;" -- bullet = black small circle,
+                                     U+2022 ISOpub  -->
+<!-- bullet is NOT the same as bullet operator, U+2219 -->
+<!ENTITY hellip   CDATA "&#8230;" -- horizontal ellipsis = three dot leader,
+                                     U+2026 ISOpub  -->
+<!ENTITY prime    CDATA "&#8242;" -- prime = minutes = feet, U+2032 ISOtech -->
+<!ENTITY Prime    CDATA "&#8243;" -- double prime = seconds = inches,
+                                     U+2033 ISOtech -->
+<!ENTITY oline    CDATA "&#8254;" -- overline = spacing overscore,
+                                     U+203E NEW -->
+<!ENTITY frasl    CDATA "&#8260;" -- fraction slash, U+2044 NEW -->
+
+<!-- Letterlike Symbols -->
+<!ENTITY weierp   CDATA "&#8472;" -- script capital P = power set
+                                     = Weierstrass p, U+2118 ISOamso -->
+<!ENTITY image    CDATA "&#8465;" -- blackletter capital I = imaginary part,
+                                     U+2111 ISOamso -->
+<!ENTITY real     CDATA "&#8476;" -- blackletter capital R = real part symbol,
+                                     U+211C ISOamso -->
+<!ENTITY trade    CDATA "&#8482;" -- trade mark sign, U+2122 ISOnum -->
+<!ENTITY alefsym  CDATA "&#8501;" -- alef symbol = first transfinite cardinal,
+                                     U+2135 NEW -->
+<!-- alef symbol is NOT the same as hebrew letter alef,
+     U+05D0 although the same glyph could be used to depict both characters -->
+
+<!-- Arrows -->
+<!ENTITY larr     CDATA "&#8592;" -- leftwards arrow, U+2190 ISOnum -->
+<!ENTITY uarr     CDATA "&#8593;" -- upwards arrow, U+2191 ISOnum-->
+<!ENTITY rarr     CDATA "&#8594;" -- rightwards arrow, U+2192 ISOnum -->
+<!ENTITY darr     CDATA "&#8595;" -- downwards arrow, U+2193 ISOnum -->
+<!ENTITY harr     CDATA "&#8596;" -- left right arrow, U+2194 ISOamsa -->
+<!ENTITY crarr    CDATA "&#8629;" -- downwards arrow with corner leftwards
+                                     = carriage return, U+21B5 NEW -->
+<!ENTITY lArr     CDATA "&#8656;" -- leftwards double arrow, U+21D0 ISOtech -->
+<!-- ISO 10646 does not say that lArr is the same as the 'is implied by' arrow
+    but also does not have any other character for that function. So ? lArr can
+    be used for 'is implied by' as ISOtech suggests -->
+<!ENTITY uArr     CDATA "&#8657;" -- upwards double arrow, U+21D1 ISOamsa -->
+<!ENTITY rArr     CDATA "&#8658;" -- rightwards double arrow,
+                                     U+21D2 ISOtech -->
+<!-- ISO 10646 does not say this is the 'implies' character but does not have 
+     another character with this function so ?
+     rArr can be used for 'implies' as ISOtech suggests -->
+<!ENTITY dArr     CDATA "&#8659;" -- downwards double arrow, U+21D3 ISOamsa -->
+<!ENTITY hArr     CDATA "&#8660;" -- left right double arrow,
+                                     U+21D4 ISOamsa -->
+
+<!-- Mathematical Operators -->
+<!ENTITY forall   CDATA "&#8704;" -- for all, U+2200 ISOtech -->
+<!ENTITY part     CDATA "&#8706;" -- partial differential, U+2202 ISOtech  -->
+<!ENTITY exist    CDATA "&#8707;" -- there exists, U+2203 ISOtech -->
+<!ENTITY empty    CDATA "&#8709;" -- empty set = null set = diameter,
+                                     U+2205 ISOamso -->
+<!ENTITY nabla    CDATA "&#8711;" -- nabla = backward difference,
+                                     U+2207 ISOtech -->
+<!ENTITY isin     CDATA "&#8712;" -- element of, U+2208 ISOtech -->
+<!ENTITY notin    CDATA "&#8713;" -- not an element of, U+2209 ISOtech -->
+<!ENTITY ni       CDATA "&#8715;" -- contains as member, U+220B ISOtech -->
+<!-- should there be a more memorable name than 'ni'? -->
+<!ENTITY prod     CDATA "&#8719;" -- n-ary product = product sign,
+                                     U+220F ISOamsb -->
+<!-- prod is NOT the same character as U+03A0 'greek capital letter pi' though
+     the same glyph might be used for both -->
+<!ENTITY sum      CDATA "&#8721;" -- n-ary sumation, U+2211 ISOamsb -->
+<!-- sum is NOT the same character as U+03A3 'greek capital letter sigma'
+     though the same glyph might be used for both -->
+<!ENTITY minus    CDATA "&#8722;" -- minus sign, U+2212 ISOtech -->
+<!ENTITY lowast   CDATA "&#8727;" -- asterisk operator, U+2217 ISOtech -->
+<!ENTITY radic    CDATA "&#8730;" -- square root = radical sign,
+                                     U+221A ISOtech -->
+<!ENTITY prop     CDATA "&#8733;" -- proportional to, U+221D ISOtech -->
+<!ENTITY infin    CDATA "&#8734;" -- infinity, U+221E ISOtech -->
+<!ENTITY ang      CDATA "&#8736;" -- angle, U+2220 ISOamso -->
+<!ENTITY and      CDATA "&#8743;" -- logical and = wedge, U+2227 ISOtech -->
+<!ENTITY or       CDATA "&#8744;" -- logical or = vee, U+2228 ISOtech -->
+<!ENTITY cap      CDATA "&#8745;" -- intersection = cap, U+2229 ISOtech -->
+<!ENTITY cup      CDATA "&#8746;" -- union = cup, U+222A ISOtech -->
+<!ENTITY int      CDATA "&#8747;" -- integral, U+222B ISOtech -->
+<!ENTITY there4   CDATA "&#8756;" -- therefore, U+2234 ISOtech -->
+<!ENTITY sim      CDATA "&#8764;" -- tilde operator = varies with = similar to,
+                                     U+223C ISOtech -->
+<!-- tilde operator is NOT the same character as the tilde, U+007E,
+     although the same glyph might be used to represent both  -->
+<!ENTITY cong     CDATA "&#8773;" -- approximately equal to, U+2245 ISOtech -->
+<!ENTITY asymp    CDATA "&#8776;" -- almost equal to = asymptotic to,
+                                     U+2248 ISOamsr -->
+<!ENTITY ne       CDATA "&#8800;" -- not equal to, U+2260 ISOtech -->
+<!ENTITY equiv    CDATA "&#8801;" -- identical to, U+2261 ISOtech -->
+<!ENTITY le       CDATA "&#8804;" -- less-than or equal to, U+2264 ISOtech -->
+<!ENTITY ge       CDATA "&#8805;" -- greater-than or equal to,
+                                     U+2265 ISOtech -->
+<!ENTITY sub      CDATA "&#8834;" -- subset of, U+2282 ISOtech -->
+<!ENTITY sup      CDATA "&#8835;" -- superset of, U+2283 ISOtech -->
+<!-- note that nsup, 'not a superset of, U+2283' is not covered by the Symbol 
+     font encoding and is not included. Should it be, for symmetry?
+     It is in ISOamsn  --> 
+<!ENTITY nsub     CDATA "&#8836;" -- not a subset of, U+2284 ISOamsn -->
+<!ENTITY sube     CDATA "&#8838;" -- subset of or equal to, U+2286 ISOtech -->
+<!ENTITY supe     CDATA "&#8839;" -- superset of or equal to,
+                                     U+2287 ISOtech -->
+<!ENTITY oplus    CDATA "&#8853;" -- circled plus = direct sum,
+                                     U+2295 ISOamsb -->
+<!ENTITY otimes   CDATA "&#8855;" -- circled times = vector product,
+                                     U+2297 ISOamsb -->
+<!ENTITY perp     CDATA "&#8869;" -- up tack = orthogonal to = perpendicular,
+                                     U+22A5 ISOtech -->
+<!ENTITY sdot     CDATA "&#8901;" -- dot operator, U+22C5 ISOamsb -->
+<!-- dot operator is NOT the same character as U+00B7 middle dot -->
+
+<!-- Miscellaneous Technical -->
+<!ENTITY lceil    CDATA "&#8968;" -- left ceiling = apl upstile,
+                                     U+2308 ISOamsc  -->
+<!ENTITY rceil    CDATA "&#8969;" -- right ceiling, U+2309 ISOamsc  -->
+<!ENTITY lfloor   CDATA "&#8970;" -- left floor = apl downstile,
+                                     U+230A ISOamsc  -->
+<!ENTITY rfloor   CDATA "&#8971;" -- right floor, U+230B ISOamsc  -->
+<!ENTITY lang     CDATA "&#9001;" -- left-pointing angle bracket = bra,
+                                     U+2329 ISOtech -->
+<!-- lang is NOT the same character as U+003C 'less than' 
+     or U+2039 'single left-pointing angle quotation mark' -->
+<!ENTITY rang     CDATA "&#9002;" -- right-pointing angle bracket = ket,
+                                     U+232A ISOtech -->
+<!-- rang is NOT the same character as U+003E 'greater than' 
+     or U+203A 'single right-pointing angle quotation mark' -->
+
+<!-- Geometric Shapes -->
+<!ENTITY loz      CDATA "&#9674;" -- lozenge, U+25CA ISOpub -->
+
+<!-- Miscellaneous Symbols -->
+<!ENTITY spades   CDATA "&#9824;" -- black spade suit, U+2660 ISOpub -->
+<!-- black here seems to mean filled as opposed to hollow -->
+<!ENTITY clubs    CDATA "&#9827;" -- black club suit = shamrock,
+                                     U+2663 ISOpub -->
+<!ENTITY hearts   CDATA "&#9829;" -- black heart suit = valentine,
+                                     U+2665 ISOpub -->
+<!ENTITY diams    CDATA "&#9830;" -- black diamond suit, U+2666 ISOpub -->
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/frameset.dtd b/bundles/org.eclipse.wst.standard.schemas/dtds/frameset.dtd
new file mode 100644
index 0000000..2449dd4
--- /dev/null
+++ b/bundles/org.eclipse.wst.standard.schemas/dtds/frameset.dtd
@@ -0,0 +1,37 @@
+<!--
+    This is the HTML 4.01 Frameset DTD, which should be
+    used for documents with frames. This DTD is identical
+    to the HTML 4.01 Transitional DTD except for the
+    content model of the "HTML" element: in frameset 
+    documents, the "FRAMESET" element replaces the "BODY" 
+    element.
+
+          Draft: $Date: 2008/07/22 07:37:01 $
+
+          Authors:
+              Dave Raggett <dsr@w3.org>
+              Arnaud Le Hors <lehors@w3.org>
+              Ian Jacobs <ij@w3.org>
+
+    Further information about HTML 4.01 is available at:
+
+          http://www.w3.org/TR/1999/REC-html401-19991224.
+-->
+<!ENTITY % HTML.Version "-//W3C//DTD HTML 4.01 Frameset//EN"
+  -- Typical usage:
+
+    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
+            "http://www.w3.org/TR/html4/frameset.dtd">
+    <html>
+    <head>
+    ...
+    </head>
+    <frameset>
+    ...
+    </frameset>
+    </html>
+-->
+
+<!ENTITY % HTML.Frameset "INCLUDE">
+<!ENTITY % HTML4.dtd PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+%HTML4.dtd;
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/loose.dtd b/bundles/org.eclipse.wst.standard.schemas/dtds/loose.dtd
new file mode 100644
index 0000000..501fb48
--- /dev/null
+++ b/bundles/org.eclipse.wst.standard.schemas/dtds/loose.dtd
@@ -0,0 +1,1093 @@
+<!--
+    This is the HTML 4.01 Transitional DTD, which includes
+    presentation attributes and elements that W3C expects to phase out
+    as support for style sheets matures. Authors should use the Strict
+    DTD when possible, but may use the Transitional DTD when support
+    for presentation attribute and elements is required.
+
+    HTML 4 includes mechanisms for style sheets, scripting,
+    embedding objects, improved support for right to left and mixed
+    direction text, and enhancements to forms for improved
+    accessibility for people with disabilities.
+
+          Draft: $Date: 2008/07/22 07:37:01 $
+
+          Authors:
+              Dave Raggett <dsr@w3.org>
+              Arnaud Le Hors <lehors@w3.org>
+              Ian Jacobs <ij@w3.org>
+
+    Further information about HTML 4.01 is available at:
+
+        http://www.w3.org/TR/1999/REC-html401-19991224
+
+
+    The HTML 4.01 specification includes additional
+    syntactic constraints that cannot be expressed within
+    the DTDs.
+
+-->
+<!ENTITY % HTML.Version "-//W3C//DTD HTML 4.01 Transitional//EN"
+  -- Typical usage:
+
+    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+            "http://www.w3.org/TR/html4/loose.dtd">
+    <html>
+    <head>
+    ...
+    </head>
+    <body>
+    ...
+    </body>
+    </html>
+
+    The URI used as a system identifier with the public identifier allows
+    the user agent to download the DTD and entity sets as needed.
+
+    The FPI for the Strict HTML 4.01 DTD is:
+
+        "-//W3C//DTD HTML 4.01//EN"
+
+    This version of the strict DTD is:
+
+        http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd
+
+    Authors should use the Strict DTD unless they need the
+    presentation control for user agents that don't (adequately)
+    support style sheets.
+
+    If you are writing a document that includes frames, use 
+    the following FPI:
+
+        "-//W3C//DTD HTML 4.01 Frameset//EN"
+
+    This version of the frameset DTD is:
+
+        http://www.w3.org/TR/1999/REC-html401-19991224/frameset.dtd
+
+    Use the following (relative) URIs to refer to 
+    the DTDs and entity definitions of this specification:
+
+    "strict.dtd"
+    "loose.dtd"
+    "frameset.dtd"
+    "HTMLlat1.ent"
+    "HTMLsymbol.ent"
+    "HTMLspecial.ent"
+
+-->
+
+<!--================== Imported Names ====================================-->
+<!-- Feature Switch for frameset documents -->
+<!ENTITY % HTML.Frameset "IGNORE">
+
+<!ENTITY % ContentType "CDATA"
+    -- media type, as per [RFC2045]
+    -->
+
+<!ENTITY % ContentTypes "CDATA"
+    -- comma-separated list of media types, as per [RFC2045]
+    -->
+
+<!ENTITY % Charset "CDATA"
+    -- a character encoding, as per [RFC2045]
+    -->
+
+<!ENTITY % Charsets "CDATA"
+    -- a space-separated list of character encodings, as per [RFC2045]
+    -->
+
+<!ENTITY % LanguageCode "NAME"
+    -- a language code, as per [RFC1766]
+    -->
+
+<!ENTITY % Character "CDATA"
+    -- a single character from [ISO10646] 
+    -->
+
+<!ENTITY % LinkTypes "CDATA"
+    -- space-separated list of link types
+    -->
+
+<!ENTITY % MediaDesc "CDATA"
+    -- single or comma-separated list of media descriptors
+    -->
+
+<!ENTITY % URI "CDATA"
+    -- a Uniform Resource Identifier,
+       see [URI]
+    -->
+
+<!ENTITY % Datetime "CDATA" -- date and time information. ISO date format -->
+
+
+<!ENTITY % Script "CDATA" -- script expression -->
+
+<!ENTITY % StyleSheet "CDATA" -- style sheet data -->
+
+<!ENTITY % FrameTarget "CDATA" -- render in this frame -->
+
+
+<!ENTITY % Text "CDATA">
+
+
+<!-- Parameter Entities -->
+
+<!ENTITY % head.misc "SCRIPT|STYLE|META|LINK|OBJECT" -- repeatable head elements -->
+
+<!ENTITY % heading "H1|H2|H3|H4|H5|H6">
+
+<!ENTITY % list "UL | OL |  DIR | MENU">
+
+<!ENTITY % preformatted "PRE">
+
+<!ENTITY % Color "CDATA" -- a color using sRGB: #RRGGBB as Hex values -->
+
+<!-- There are also 16 widely known color names with their sRGB values:
+
+    Black  = #000000    Green  = #008000
+    Silver = #C0C0C0    Lime   = #00FF00
+    Gray   = #808080    Olive  = #808000
+    White  = #FFFFFF    Yellow = #FFFF00
+    Maroon = #800000    Navy   = #000080
+    Red    = #FF0000    Blue   = #0000FF
+    Purple = #800080    Teal   = #008080
+    Fuchsia= #FF00FF    Aqua   = #00FFFF
+ -->
+
+<!ENTITY % bodycolors "
+  bgcolor     %Color;        #IMPLIED  -- document background color --
+  text        %Color;        #IMPLIED  -- document text color --
+  link        %Color;        #IMPLIED  -- color of links --
+  vlink       %Color;        #IMPLIED  -- color of visited links --
+  alink       %Color;        #IMPLIED  -- color of selected links --
+  ">
+
+<!--================ Character mnemonic entities =========================-->
+
+<!ENTITY % HTMLlat1 PUBLIC
+   "-//W3C//ENTITIES Latin1//EN//HTML"
+   "HTMLlat1.ent">
+%HTMLlat1;
+
+<!ENTITY % HTMLsymbol PUBLIC
+   "-//W3C//ENTITIES Symbols//EN//HTML"
+   "HTMLsymbol.ent">
+%HTMLsymbol;
+
+<!ENTITY % HTMLspecial PUBLIC
+   "-//W3C//ENTITIES Special//EN//HTML"
+   "HTMLspecial.ent">
+%HTMLspecial;
+<!--=================== Generic Attributes ===============================-->
+
+<!ENTITY % coreattrs
+ "id          ID             #IMPLIED  -- document-wide unique id --
+  class       CDATA          #IMPLIED  -- space-separated list of classes --
+  style       %StyleSheet;   #IMPLIED  -- associated style info --
+  title       %Text;         #IMPLIED  -- advisory title --"
+  >
+
+<!ENTITY % i18n
+ "lang        %LanguageCode; #IMPLIED  -- language code --
+  dir         (ltr|rtl)      #IMPLIED  -- direction for weak/neutral text --"
+  >
+
+<!ENTITY % events
+ "onclick     %Script;       #IMPLIED  -- a pointer button was clicked --
+  ondblclick  %Script;       #IMPLIED  -- a pointer button was double clicked--
+  onmousedown %Script;       #IMPLIED  -- a pointer button was pressed down --
+  onmouseup   %Script;       #IMPLIED  -- a pointer button was released --
+  onmouseover %Script;       #IMPLIED  -- a pointer was moved onto --
+  onmousemove %Script;       #IMPLIED  -- a pointer was moved within --
+  onmouseout  %Script;       #IMPLIED  -- a pointer was moved away --
+  onkeypress  %Script;       #IMPLIED  -- a key was pressed and released --
+  onkeydown   %Script;       #IMPLIED  -- a key was pressed down --
+  onkeyup     %Script;       #IMPLIED  -- a key was released --"
+  >
+
+<!-- Reserved Feature Switch -->
+<!ENTITY % HTML.Reserved "IGNORE">
+
+<!-- The following attributes are reserved for possible future use -->
+<![ %HTML.Reserved; [
+<!ENTITY % reserved
+ "datasrc     %URI;          #IMPLIED  -- a single or tabular Data Source --
+  datafld     CDATA          #IMPLIED  -- the property or column name --
+  dataformatas (plaintext|html) plaintext -- text or html --"
+  >
+]]>
+
+<!ENTITY % reserved "">
+
+<!ENTITY % attrs "%coreattrs; %i18n; %events;">
+
+<!ENTITY % align "align (left|center|right|justify)  #IMPLIED"
+                   -- default is left for ltr paragraphs, right for rtl --
+  >
+
+<!--=================== Text Markup ======================================-->
+
+<!ENTITY % fontstyle
+ "TT | I | B | U | S | STRIKE | BIG | SMALL">
+
+<!ENTITY % phrase "EM | STRONG | DFN | CODE |
+                   SAMP | KBD | VAR | CITE | ABBR | ACRONYM" >
+
+<!ENTITY % special
+   "A | IMG | APPLET | OBJECT | FONT | BASEFONT | BR | SCRIPT |
+    MAP | Q | SUB | SUP | SPAN | BDO | IFRAME">
+
+<!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON">
+
+<!-- %inline; covers inline or "text-level" elements -->
+<!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; | %formctrl;">
+
+<!ELEMENT (%fontstyle;|%phrase;) - - (%inline;)*>
+<!ATTLIST (%fontstyle;|%phrase;)
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!ELEMENT (SUB|SUP) - - (%inline;)*    -- subscript, superscript -->
+<!ATTLIST (SUB|SUP)
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!ELEMENT SPAN - - (%inline;)*         -- generic language/style container -->
+<!ATTLIST SPAN
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  %reserved;			       -- reserved for possible future use --
+  >
+
+<!ELEMENT BDO - - (%inline;)*          -- I18N BiDi over-ride -->
+<!ATTLIST BDO
+  %coreattrs;                          -- id, class, style, title --
+  lang        %LanguageCode; #IMPLIED  -- language code --
+  dir         (ltr|rtl)      #REQUIRED -- directionality --
+  >
+
+<!ELEMENT BASEFONT - O EMPTY           -- base font size -->
+<!ATTLIST BASEFONT
+  id          ID             #IMPLIED  -- document-wide unique id --
+  size        CDATA          #REQUIRED -- base font size for FONT elements --
+  color       %Color;        #IMPLIED  -- text color --
+  face        CDATA          #IMPLIED  -- comma-separated list of font names --
+  >
+
+<!ELEMENT FONT - - (%inline;)*         -- local change to font -->
+<!ATTLIST FONT
+  %coreattrs;                          -- id, class, style, title --
+  %i18n;		               -- lang, dir --
+  size        CDATA          #IMPLIED  -- [+|-]nn e.g. size="+1", size="4" --
+  color       %Color;        #IMPLIED  -- text color --
+  face        CDATA          #IMPLIED  -- comma-separated list of font names --
+  >
+
+<!ELEMENT BR - O EMPTY                 -- forced line break -->
+<!ATTLIST BR
+  %coreattrs;                          -- id, class, style, title --
+  clear       (left|all|right|none) none -- control of text flow --
+  >
+
+<!--================== HTML content models ===============================-->
+
+<!--
+    HTML has two basic content models:
+
+        %inline;     character level elements and text strings
+        %block;      block-like elements e.g. paragraphs and lists
+-->
+
+<!ENTITY % block
+     "P | %heading; | %list; | %preformatted; | DL | DIV | CENTER |
+      NOSCRIPT | NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR |
+      TABLE | FIELDSET | ADDRESS">
+
+<!ENTITY % flow "%block; | %inline;">
+
+<!--=================== Document Body ====================================-->
+
+<!ELEMENT BODY O O (%flow;)* +(INS|DEL) -- document body -->
+<!ATTLIST BODY
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  onload          %Script;   #IMPLIED  -- the document has been loaded --
+  onunload        %Script;   #IMPLIED  -- the document has been removed --
+  background      %URI;      #IMPLIED  -- texture tile for document
+                                          background --
+  %bodycolors;                         -- bgcolor, text, link, vlink, alink --
+  >
+
+<!ELEMENT ADDRESS - - ((%inline;)|P)*  -- information on author -->
+<!ATTLIST ADDRESS
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!ELEMENT DIV - - (%flow;)*            -- generic language/style container -->
+<!ATTLIST DIV
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  %align;                              -- align, text alignment --
+  %reserved;                           -- reserved for possible future use --
+  >
+
+<!ELEMENT CENTER - - (%flow;)*         -- shorthand for DIV align=center -->
+<!ATTLIST CENTER
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!--================== The Anchor Element ================================-->
+
+<!ENTITY % Shape "(rect|circle|poly|default)">
+<!ENTITY % Coords "CDATA" -- comma-separated list of lengths -->
+
+<!ELEMENT A - - (%inline;)* -(A)       -- anchor -->
+<!ATTLIST A
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  charset     %Charset;      #IMPLIED  -- char encoding of linked resource --
+  type        %ContentType;  #IMPLIED  -- advisory content type --
+  name        CDATA          #IMPLIED  -- named link end --
+  href        %URI;          #IMPLIED  -- URI for linked resource --
+  hreflang    %LanguageCode; #IMPLIED  -- language code --
+  target      %FrameTarget;  #IMPLIED  -- render in this frame --
+  rel         %LinkTypes;    #IMPLIED  -- forward link types --
+  rev         %LinkTypes;    #IMPLIED  -- reverse link types --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  shape       %Shape;        rect      -- for use with client-side image maps --
+  coords      %Coords;       #IMPLIED  -- for use with client-side image maps --
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  >
+
+<!--================== Client-side image maps ============================-->
+
+<!-- These can be placed in the same document or grouped in a
+     separate document although this isn't yet widely supported -->
+
+<!ELEMENT MAP - - ((%block;) | AREA)+ -- client-side image map -->
+<!ATTLIST MAP
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  name        CDATA          #REQUIRED -- for reference by usemap --
+  >
+
+<!ELEMENT AREA - O EMPTY               -- client-side image map area -->
+<!ATTLIST AREA
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  shape       %Shape;        rect      -- controls interpretation of coords --
+  coords      %Coords;       #IMPLIED  -- comma-separated list of lengths --
+  href        %URI;          #IMPLIED  -- URI for linked resource --
+  target      %FrameTarget;  #IMPLIED  -- render in this frame --
+  nohref      (nohref)       #IMPLIED  -- this region has no action --
+  alt         %Text;         #REQUIRED -- short description --
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  >
+
+<!--================== The LINK Element ==================================-->
+
+<!--
+  Relationship values can be used in principle:
+
+   a) for document specific toolbars/menus when used
+      with the LINK element in document head e.g.
+        start, contents, previous, next, index, end, help
+   b) to link to a separate style sheet (rel=stylesheet)
+   c) to make a link to a script (rel=script)
+   d) by stylesheets to control how collections of
+      html nodes are rendered into printed documents
+   e) to make a link to a printable version of this document
+      e.g. a postscript or pdf version (rel=alternate media=print)
+-->
+
+<!ELEMENT LINK - O EMPTY               -- a media-independent link -->
+<!ATTLIST LINK
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  charset     %Charset;      #IMPLIED  -- char encoding of linked resource --
+  href        %URI;          #IMPLIED  -- URI for linked resource --
+  hreflang    %LanguageCode; #IMPLIED  -- language code --
+  type        %ContentType;  #IMPLIED  -- advisory content type --
+  rel         %LinkTypes;    #IMPLIED  -- forward link types --
+  rev         %LinkTypes;    #IMPLIED  -- reverse link types --
+  media       %MediaDesc;    #IMPLIED  -- for rendering on these media --
+  target      %FrameTarget;  #IMPLIED  -- render in this frame --
+  >
+
+<!--=================== Images ===========================================-->
+
+<!-- Length defined in strict DTD for cellpadding/cellspacing -->
+<!ENTITY % Length "CDATA" -- nn for pixels or nn% for percentage length -->
+<!ENTITY % MultiLength "CDATA" -- pixel, percentage, or relative -->
+
+<![ %HTML.Frameset; [
+<!ENTITY % MultiLengths "CDATA" -- comma-separated list of MultiLength -->
+]]>
+
+<!ENTITY % Pixels "CDATA" -- integer representing length in pixels -->
+
+<!ENTITY % IAlign "(top|middle|bottom|left|right)" -- center? -->
+
+<!-- To avoid problems with text-only UAs as well as 
+   to make image content understandable and navigable 
+   to users of non-visual UAs, you need to provide
+   a description with ALT, and avoid server-side image maps -->
+<!ELEMENT IMG - O EMPTY                -- Embedded image -->
+<!ATTLIST IMG
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  src         %URI;          #REQUIRED -- URI of image to embed --
+  alt         %Text;         #REQUIRED -- short description --
+  longdesc    %URI;          #IMPLIED  -- link to long description
+                                          (complements alt) --
+  name        CDATA          #IMPLIED  -- name of image for scripting --
+  height      %Length;       #IMPLIED  -- override height --
+  width       %Length;       #IMPLIED  -- override width --
+  usemap      %URI;          #IMPLIED  -- use client-side image map --
+  ismap       (ismap)        #IMPLIED  -- use server-side image map --
+  align       %IAlign;       #IMPLIED  -- vertical or horizontal alignment --
+  border      %Pixels;       #IMPLIED  -- link border width --
+  hspace      %Pixels;       #IMPLIED  -- horizontal gutter --
+  vspace      %Pixels;       #IMPLIED  -- vertical gutter --
+  >
+
+<!-- USEMAP points to a MAP element which may be in this document
+  or an external document, although the latter is not widely supported -->
+
+<!--==================== OBJECT ======================================-->
+<!--
+  OBJECT is used to embed objects as part of HTML pages 
+  PARAM elements should precede other content. SGML mixed content
+  model technicality precludes specifying this formally ...
+-->
+
+<!ELEMENT OBJECT - - (PARAM | %flow;)*
+ -- generic embedded object -->
+<!ATTLIST OBJECT
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  declare     (declare)      #IMPLIED  -- declare but don't instantiate flag --
+  classid     %URI;          #IMPLIED  -- identifies an implementation --
+  codebase    %URI;          #IMPLIED  -- base URI for classid, data, archive--
+  data        %URI;          #IMPLIED  -- reference to object's data --
+  type        %ContentType;  #IMPLIED  -- content type for data --
+  codetype    %ContentType;  #IMPLIED  -- content type for code --
+  archive     CDATA          #IMPLIED  -- space-separated list of URIs --
+  standby     %Text;         #IMPLIED  -- message to show while loading --
+  height      %Length;       #IMPLIED  -- override height --
+  width       %Length;       #IMPLIED  -- override width --
+  usemap      %URI;          #IMPLIED  -- use client-side image map --
+  name        CDATA          #IMPLIED  -- submit as part of form --
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  align       %IAlign;       #IMPLIED  -- vertical or horizontal alignment --
+  border      %Pixels;       #IMPLIED  -- link border width --
+  hspace      %Pixels;       #IMPLIED  -- horizontal gutter --
+  vspace      %Pixels;       #IMPLIED  -- vertical gutter --
+  %reserved;                           -- reserved for possible future use --
+  >
+
+<!ELEMENT PARAM - O EMPTY              -- named property value -->
+<!ATTLIST PARAM
+  id          ID             #IMPLIED  -- document-wide unique id --
+  name        CDATA          #REQUIRED -- property name --
+  value       CDATA          #IMPLIED  -- property value --
+  valuetype   (DATA|REF|OBJECT) DATA   -- How to interpret value --
+  type        %ContentType;  #IMPLIED  -- content type for value
+                                          when valuetype=ref --
+  >
+
+<!--=================== Java APPLET ==================================-->
+<!--
+  One of code or object attributes must be present.
+  Place PARAM elements before other content.
+-->
+<!ELEMENT APPLET - - (PARAM | %flow;)* -- Java applet -->
+<!ATTLIST APPLET
+  %coreattrs;                          -- id, class, style, title --
+  codebase    %URI;          #IMPLIED  -- optional base URI for applet --
+  archive     CDATA          #IMPLIED  -- comma-separated archive list --
+  code        CDATA          #IMPLIED  -- applet class file --
+  object      CDATA          #IMPLIED  -- serialized applet file --
+  alt         %Text;         #IMPLIED  -- short description --
+  name        CDATA          #IMPLIED  -- allows applets to find each other --
+  width       %Length;       #REQUIRED -- initial width --
+  height      %Length;       #REQUIRED -- initial height --
+  align       %IAlign;       #IMPLIED  -- vertical or horizontal alignment --
+  hspace      %Pixels;       #IMPLIED  -- horizontal gutter --
+  vspace      %Pixels;       #IMPLIED  -- vertical gutter --
+  >
+
+<!--=================== Horizontal Rule ==================================-->
+
+<!ELEMENT HR - O EMPTY -- horizontal rule -->
+<!ATTLIST HR
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  align       (left|center|right) #IMPLIED
+  noshade     (noshade)      #IMPLIED
+  size        %Pixels;       #IMPLIED
+  width       %Length;       #IMPLIED
+  >
+
+<!--=================== Paragraphs =======================================-->
+
+<!ELEMENT P - O (%inline;)*            -- paragraph -->
+<!ATTLIST P
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  %align;                              -- align, text alignment --
+  >
+
+<!--=================== Headings =========================================-->
+
+<!--
+  There are six levels of headings from H1 (the most important)
+  to H6 (the least important).
+-->
+
+<!ELEMENT (%heading;)  - - (%inline;)* -- heading -->
+<!ATTLIST (%heading;)
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  %align;                              -- align, text alignment --
+  >
+
+<!--=================== Preformatted Text ================================-->
+
+<!-- excludes markup for images and changes in font size -->
+<!ENTITY % pre.exclusion "IMG|OBJECT|APPLET|BIG|SMALL|SUB|SUP|FONT|BASEFONT">
+
+<!ELEMENT PRE - - (%inline;)* -(%pre.exclusion;) -- preformatted text -->
+<!ATTLIST PRE
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  width       NUMBER         #IMPLIED
+  >
+
+<!--===================== Inline Quotes ==================================-->
+
+<!ELEMENT Q - - (%inline;)*            -- short inline quotation -->
+<!ATTLIST Q
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  cite        %URI;          #IMPLIED  -- URI for source document or msg --
+  >
+
+<!--=================== Block-like Quotes ================================-->
+
+<!ELEMENT BLOCKQUOTE - - (%flow;)*     -- long quotation -->
+<!ATTLIST BLOCKQUOTE
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  cite        %URI;          #IMPLIED  -- URI for source document or msg --
+  >
+
+<!--=================== Inserted/Deleted Text ============================-->
+
+
+<!-- INS/DEL are handled by inclusion on BODY -->
+<!ELEMENT (INS|DEL) - - (%flow;)*      -- inserted text, deleted text -->
+<!ATTLIST (INS|DEL)
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  cite        %URI;          #IMPLIED  -- info on reason for change --
+  datetime    %Datetime;     #IMPLIED  -- date and time of change --
+  >
+
+<!--=================== Lists ============================================-->
+
+<!-- definition lists - DT for term, DD for its definition -->
+
+<!ELEMENT DL - - (DT|DD)+              -- definition list -->
+<!ATTLIST DL
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  compact     (compact)      #IMPLIED  -- reduced interitem spacing --
+  >
+
+<!ELEMENT DT - O (%inline;)*           -- definition term -->
+<!ELEMENT DD - O (%flow;)*             -- definition description -->
+<!ATTLIST (DT|DD)
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!-- Ordered lists (OL) Numbering style
+
+    1   arablic numbers     1, 2, 3, ...
+    a   lower alpha         a, b, c, ...
+    A   upper alpha         A, B, C, ...
+    i   lower roman         i, ii, iii, ...
+    I   upper roman         I, II, III, ...
+
+    The style is applied to the sequence number which by default
+    is reset to 1 for the first list item in an ordered list.
+
+    This can't be expressed directly in SGML due to case folding.
+-->
+
+<!ENTITY % OLStyle "CDATA"      -- constrained to: "(1|a|A|i|I)" -->
+
+<!ELEMENT OL - - (LI)+                 -- ordered list -->
+<!ATTLIST OL
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  type        %OLStyle;      #IMPLIED  -- numbering style --
+  compact     (compact)      #IMPLIED  -- reduced interitem spacing --
+  start       NUMBER         #IMPLIED  -- starting sequence number --
+  >
+
+<!-- Unordered Lists (UL) bullet styles -->
+<!ENTITY % ULStyle "(disc|square|circle)">
+
+<!ELEMENT UL - - (LI)+                 -- unordered list -->
+<!ATTLIST UL
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  type        %ULStyle;      #IMPLIED  -- bullet style --
+  compact     (compact)      #IMPLIED  -- reduced interitem spacing --
+  >
+
+<!ELEMENT (DIR|MENU) - - (LI)+ -(%block;) -- directory list, menu list -->
+<!ATTLIST DIR
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  compact     (compact)      #IMPLIED -- reduced interitem spacing --
+  >
+<!ATTLIST MENU
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  compact     (compact)      #IMPLIED -- reduced interitem spacing --
+  >
+
+<!ENTITY % LIStyle "CDATA" -- constrained to: "(%ULStyle;|%OLStyle;)" -->
+
+<!ELEMENT LI - O (%flow;)*             -- list item -->
+<!ATTLIST LI
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  type        %LIStyle;      #IMPLIED  -- list item style --
+  value       NUMBER         #IMPLIED  -- reset sequence number --
+  >
+
+<!--================ Forms ===============================================-->
+<!ELEMENT FORM - - (%flow;)* -(FORM)   -- interactive form -->
+<!ATTLIST FORM
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  action      %URI;          #REQUIRED -- server-side form handler --
+  method      (GET|POST)     GET       -- HTTP method used to submit the form--
+  enctype     %ContentType;  "application/x-www-form-urlencoded"
+  accept      %ContentTypes; #IMPLIED  -- list of MIME types for file upload --
+  name        CDATA          #IMPLIED  -- name of form for scripting --
+  onsubmit    %Script;       #IMPLIED  -- the form was submitted --
+  onreset     %Script;       #IMPLIED  -- the form was reset --
+  target      %FrameTarget;  #IMPLIED  -- render in this frame --
+  accept-charset %Charsets;  #IMPLIED  -- list of supported charsets --
+  >
+
+<!-- Each label must not contain more than ONE field -->
+<!ELEMENT LABEL - - (%inline;)* -(LABEL) -- form field label text -->
+<!ATTLIST LABEL
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  for         IDREF          #IMPLIED  -- matches field ID value --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  >
+
+<!ENTITY % InputType
+  "(TEXT | PASSWORD | CHECKBOX |
+    RADIO | SUBMIT | RESET |
+    FILE | HIDDEN | IMAGE | BUTTON)"
+   >
+
+<!-- attribute name required for all but submit and reset -->
+<!ELEMENT INPUT - O EMPTY              -- form control -->
+<!ATTLIST INPUT
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  type        %InputType;    TEXT      -- what kind of widget is needed --
+  name        CDATA          #IMPLIED  -- submit as part of form --
+  value       CDATA          #IMPLIED  -- Specify for radio buttons and checkboxes --
+  checked     (checked)      #IMPLIED  -- for radio buttons and check boxes --
+  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
+  readonly    (readonly)     #IMPLIED  -- for text and passwd --
+  size        CDATA          #IMPLIED  -- specific to each type of field --
+  maxlength   NUMBER         #IMPLIED  -- max chars for text fields --
+  src         %URI;          #IMPLIED  -- for fields with images --
+  alt         CDATA          #IMPLIED  -- short description --
+  usemap      %URI;          #IMPLIED  -- use client-side image map --
+  ismap       (ismap)        #IMPLIED  -- use server-side image map --
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  onselect    %Script;       #IMPLIED  -- some text was selected --
+  onchange    %Script;       #IMPLIED  -- the element value was changed --
+  accept      %ContentTypes; #IMPLIED  -- list of MIME types for file upload --
+  align       %IAlign;       #IMPLIED  -- vertical or horizontal alignment --
+  %reserved;                           -- reserved for possible future use --
+  >
+
+<!ELEMENT SELECT - - (OPTGROUP|OPTION)+ -- option selector -->
+<!ATTLIST SELECT
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  name        CDATA          #IMPLIED  -- field name --
+  size        NUMBER         #IMPLIED  -- rows visible --
+  multiple    (multiple)     #IMPLIED  -- default is single selection --
+  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  onchange    %Script;       #IMPLIED  -- the element value was changed --
+  %reserved;                           -- reserved for possible future use --
+  >
+
+<!ELEMENT OPTGROUP - - (OPTION)+ -- option group -->
+<!ATTLIST OPTGROUP
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
+  label       %Text;         #REQUIRED -- for use in hierarchical menus --
+  >
+
+<!ELEMENT OPTION - O (#PCDATA)         -- selectable choice -->
+<!ATTLIST OPTION
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  selected    (selected)     #IMPLIED
+  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
+  label       %Text;         #IMPLIED  -- for use in hierarchical menus --
+  value       CDATA          #IMPLIED  -- defaults to element content --
+  >
+
+<!ELEMENT TEXTAREA - - (#PCDATA)       -- multi-line text field -->
+<!ATTLIST TEXTAREA
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  name        CDATA          #IMPLIED
+  rows        NUMBER         #REQUIRED
+  cols        NUMBER         #REQUIRED
+  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
+  readonly    (readonly)     #IMPLIED
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  onselect    %Script;       #IMPLIED  -- some text was selected --
+  onchange    %Script;       #IMPLIED  -- the element value was changed --
+  %reserved;                           -- reserved for possible future use --
+  >
+
+<!--
+  #PCDATA is to solve the mixed content problem,
+  per specification only whitespace is allowed there!
+ -->
+<!ELEMENT FIELDSET - - (#PCDATA,LEGEND,(%flow;)*) -- form control group -->
+<!ATTLIST FIELDSET
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!ELEMENT LEGEND - - (%inline;)*       -- fieldset legend -->
+<!ENTITY % LAlign "(top|bottom|left|right)">
+
+<!ATTLIST LEGEND
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  align       %LAlign;       #IMPLIED  -- relative to fieldset --
+  >
+
+<!ELEMENT BUTTON - -
+     (%flow;)* -(A|%formctrl;|FORM|ISINDEX|FIELDSET|IFRAME)
+     -- push button -->
+<!ATTLIST BUTTON
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  name        CDATA          #IMPLIED
+  value       CDATA          #IMPLIED  -- sent to server when submitted --
+  type        (button|submit|reset) submit -- for use as form button --
+  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  %reserved;                           -- reserved for possible future use --
+  >
+
+<!--======================= Tables =======================================-->
+
+<!-- IETF HTML table standard, see [RFC1942] -->
+
+<!--
+ The BORDER attribute sets the thickness of the frame around the
+ table. The default units are screen pixels.
+
+ The FRAME attribute specifies which parts of the frame around
+ the table should be rendered. The values are not the same as
+ CALS to avoid a name clash with the VALIGN attribute.
+
+ The value "border" is included for backwards compatibility with
+ <TABLE BORDER> which yields frame=border and border=implied
+ For <TABLE BORDER=1> you get border=1 and frame=implied. In this
+ case, it is appropriate to treat this as frame=border for backwards
+ compatibility with deployed browsers.
+-->
+<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
+
+<!--
+ The RULES attribute defines which rules to draw between cells:
+
+ If RULES is absent then assume:
+     "none" if BORDER is absent or BORDER=0 otherwise "all"
+-->
+
+<!ENTITY % TRules "(none | groups | rows | cols | all)">
+  
+<!-- horizontal placement of table relative to document -->
+<!ENTITY % TAlign "(left|center|right)">
+
+<!-- horizontal alignment attributes for cell contents -->
+<!ENTITY % cellhalign
+  "align      (left|center|right|justify|char) #IMPLIED
+   char       %Character;    #IMPLIED  -- alignment char, e.g. char=':' --
+   charoff    %Length;       #IMPLIED  -- offset for alignment char --"
+  >
+
+<!-- vertical alignment attributes for cell contents -->
+<!ENTITY % cellvalign
+  "valign     (top|middle|bottom|baseline) #IMPLIED"
+  >
+
+<!ELEMENT TABLE - -
+     (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)>
+<!ELEMENT CAPTION  - - (%inline;)*     -- table caption -->
+<!ELEMENT THEAD    - O (TR)+           -- table header -->
+<!ELEMENT TFOOT    - O (TR)+           -- table footer -->
+<!ELEMENT TBODY    O O (TR)+           -- table body -->
+<!ELEMENT COLGROUP - O (COL)*          -- table column group -->
+<!ELEMENT COL      - O EMPTY           -- table column -->
+<!ELEMENT TR       - O (TH|TD)+        -- table row -->
+<!ELEMENT (TH|TD)  - O (%flow;)*       -- table header cell, table data cell-->
+
+<!ATTLIST TABLE                        -- table element --
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  summary     %Text;         #IMPLIED  -- purpose/structure for speech output--
+  width       %Length;       #IMPLIED  -- table width --
+  border      %Pixels;       #IMPLIED  -- controls frame width around table --
+  frame       %TFrame;       #IMPLIED  -- which parts of frame to render --
+  rules       %TRules;       #IMPLIED  -- rulings between rows and cols --
+  cellspacing %Length;       #IMPLIED  -- spacing between cells --
+  cellpadding %Length;       #IMPLIED  -- spacing within cells --
+  align       %TAlign;       #IMPLIED  -- table position relative to window --
+  bgcolor     %Color;        #IMPLIED  -- background color for cells --
+  %reserved;                           -- reserved for possible future use --
+  datapagesize CDATA         #IMPLIED  -- reserved for possible future use --
+  >
+
+<!ENTITY % CAlign "(top|bottom|left|right)">
+
+<!ATTLIST CAPTION
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  align       %CAlign;       #IMPLIED  -- relative to table --
+  >
+
+<!--
+COLGROUP groups a set of COL elements. It allows you to group
+several semantically related columns together.
+-->
+<!ATTLIST COLGROUP
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  span        NUMBER         1         -- default number of columns in group --
+  width       %MultiLength;  #IMPLIED  -- default width for enclosed COLs --
+  %cellhalign;                         -- horizontal alignment in cells --
+  %cellvalign;                         -- vertical alignment in cells --
+  >
+
+<!--
+ COL elements define the alignment properties for cells in
+ one or more columns.
+
+ The WIDTH attribute specifies the width of the columns, e.g.
+
+     width=64        width in screen pixels
+     width=0.5*      relative width of 0.5
+
+ The SPAN attribute causes the attributes of one
+ COL element to apply to more than one column.
+-->
+<!ATTLIST COL                          -- column groups and properties --
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  span        NUMBER         1         -- COL attributes affect N columns --
+  width       %MultiLength;  #IMPLIED  -- column width specification --
+  %cellhalign;                         -- horizontal alignment in cells --
+  %cellvalign;                         -- vertical alignment in cells --
+  >
+
+<!--
+    Use THEAD to duplicate headers when breaking table
+    across page boundaries, or for static headers when
+    TBODY sections are rendered in scrolling panel.
+
+    Use TFOOT to duplicate footers when breaking table
+    across page boundaries, or for static footers when
+    TBODY sections are rendered in scrolling panel.
+
+    Use multiple TBODY sections when rules are needed
+    between groups of table rows.
+-->
+<!ATTLIST (THEAD|TBODY|TFOOT)          -- table section --
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  %cellhalign;                         -- horizontal alignment in cells --
+  %cellvalign;                         -- vertical alignment in cells --
+  >
+
+<!ATTLIST TR                           -- table row --
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  %cellhalign;                         -- horizontal alignment in cells --
+  %cellvalign;                         -- vertical alignment in cells --
+  bgcolor     %Color;        #IMPLIED  -- background color for row --
+  >
+
+
+<!-- Scope is simpler than headers attribute for common tables -->
+<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
+
+<!-- TH is for headers, TD for data, but for cells acting as both use TD -->
+<!ATTLIST (TH|TD)                      -- header or data cell --
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  abbr        %Text;         #IMPLIED  -- abbreviation for header cell --
+  axis        CDATA          #IMPLIED  -- comma-separated list of related headers--
+  headers     IDREFS         #IMPLIED  -- list of id's for header cells --
+  scope       %Scope;        #IMPLIED  -- scope covered by header cells --
+  rowspan     NUMBER         1         -- number of rows spanned by cell --
+  colspan     NUMBER         1         -- number of cols spanned by cell --
+  %cellhalign;                         -- horizontal alignment in cells --
+  %cellvalign;                         -- vertical alignment in cells --
+  nowrap      (nowrap)       #IMPLIED  -- suppress word wrap --
+  bgcolor     %Color;        #IMPLIED  -- cell background color --
+  width       %Length;       #IMPLIED  -- width for cell --
+  height      %Length;       #IMPLIED  -- height for cell --
+  >
+
+<!--================== Document Frames ===================================-->
+
+<!--
+  The content model for HTML documents depends on whether the HEAD is
+  followed by a FRAMESET or BODY element. The widespread omission of
+  the BODY start tag makes it impractical to define the content model
+  without the use of a marked section.
+-->
+
+<![ %HTML.Frameset; [
+<!ELEMENT FRAMESET - - ((FRAMESET|FRAME)+ & NOFRAMES?) -- window subdivision-->
+<!ATTLIST FRAMESET
+  %coreattrs;                          -- id, class, style, title --
+  rows        %MultiLengths; #IMPLIED  -- list of lengths,
+                                          default: 100% (1 row) --
+  cols        %MultiLengths; #IMPLIED  -- list of lengths,
+                                          default: 100% (1 col) --
+  onload      %Script;       #IMPLIED  -- all the frames have been loaded  -- 
+  onunload    %Script;       #IMPLIED  -- all the frames have been removed -- 
+  >
+]]>
+
+<![ %HTML.Frameset; [
+<!-- reserved frame names start with "_" otherwise starts with letter -->
+<!ELEMENT FRAME - O EMPTY              -- subwindow -->
+<!ATTLIST FRAME
+  %coreattrs;                          -- id, class, style, title --
+  longdesc    %URI;          #IMPLIED  -- link to long description
+                                          (complements title) --
+  name        CDATA          #IMPLIED  -- name of frame for targetting --
+  src         %URI;          #IMPLIED  -- source of frame content --
+  frameborder (1|0)          1         -- request frame borders? --
+  marginwidth %Pixels;       #IMPLIED  -- margin widths in pixels --
+  marginheight %Pixels;      #IMPLIED  -- margin height in pixels --
+  noresize    (noresize)     #IMPLIED  -- allow users to resize frames? --
+  scrolling   (yes|no|auto)  auto      -- scrollbar or none --
+  >
+]]>
+
+<!ELEMENT IFRAME - - (%flow;)*         -- inline subwindow -->
+<!ATTLIST IFRAME
+  %coreattrs;                          -- id, class, style, title --
+  longdesc    %URI;          #IMPLIED  -- link to long description
+                                          (complements title) --
+  name        CDATA          #IMPLIED  -- name of frame for targetting --
+  src         %URI;          #IMPLIED  -- source of frame content --
+  frameborder (1|0)          1         -- request frame borders? --
+  marginwidth %Pixels;       #IMPLIED  -- margin widths in pixels --
+  marginheight %Pixels;      #IMPLIED  -- margin height in pixels --
+  scrolling   (yes|no|auto)  auto      -- scrollbar or none --
+  align       %IAlign;       #IMPLIED  -- vertical or horizontal alignment --
+  height      %Length;       #IMPLIED  -- frame height --
+  width       %Length;       #IMPLIED  -- frame width --
+  >
+
+<![ %HTML.Frameset; [
+<!ENTITY % noframes.content "(BODY) -(NOFRAMES)">
+]]>
+
+<!ENTITY % noframes.content "(%flow;)*">
+
+<!ELEMENT NOFRAMES - - %noframes.content;
+ -- alternate content container for non frame-based rendering -->
+<!ATTLIST NOFRAMES
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!--================ Document Head =======================================-->
+<!-- %head.misc; defined earlier on as "SCRIPT|STYLE|META|LINK|OBJECT" -->
+<!ENTITY % head.content "TITLE & ISINDEX? & BASE?">
+
+<!ELEMENT HEAD O O (%head.content;) +(%head.misc;) -- document head -->
+<!ATTLIST HEAD
+  %i18n;                               -- lang, dir --
+  profile     %URI;          #IMPLIED  -- named dictionary of meta info --
+  >
+
+<!-- The TITLE element is not considered part of the flow of text.
+       It should be displayed, for example as the page header or
+       window title. Exactly one title is required per document.
+    -->
+<!ELEMENT TITLE - - (#PCDATA) -(%head.misc;) -- document title -->
+<!ATTLIST TITLE %i18n>
+
+<!ELEMENT ISINDEX - O EMPTY            -- single line prompt -->
+<!ATTLIST ISINDEX
+  %coreattrs;                          -- id, class, style, title --
+  %i18n;                               -- lang, dir --
+  prompt      %Text;         #IMPLIED  -- prompt message -->
+
+<!ELEMENT BASE - O EMPTY               -- document base URI -->
+<!ATTLIST BASE
+  href        %URI;          #IMPLIED  -- URI that acts as base URI --
+  target      %FrameTarget;  #IMPLIED  -- render in this frame --
+  >
+
+<!ELEMENT META - O EMPTY               -- generic metainformation -->
+<!ATTLIST META
+  %i18n;                               -- lang, dir, for use with content --
+  http-equiv  NAME           #IMPLIED  -- HTTP response header name  --
+  name        NAME           #IMPLIED  -- metainformation name --
+  content     CDATA          #REQUIRED -- associated information --
+  scheme      CDATA          #IMPLIED  -- select form of content --
+  >
+
+<!ELEMENT STYLE - - %StyleSheet        -- style info -->
+<!ATTLIST STYLE
+  %i18n;                               -- lang, dir, for use with title --
+  type        %ContentType;  #REQUIRED -- content type of style language --
+  media       %MediaDesc;    #IMPLIED  -- designed for use with these media --
+  title       %Text;         #IMPLIED  -- advisory title --
+  >
+
+<!ELEMENT SCRIPT - - %Script;          -- script statements -->
+<!ATTLIST SCRIPT
+  charset     %Charset;      #IMPLIED  -- char encoding of linked resource --
+  type        %ContentType;  #REQUIRED -- content type of script language --
+  language    CDATA          #IMPLIED  -- predefined script language name --
+  src         %URI;          #IMPLIED  -- URI for an external script --
+  defer       (defer)        #IMPLIED  -- UA may defer execution of script --
+  event       CDATA          #IMPLIED  -- reserved for possible future use --
+  for         %URI;          #IMPLIED  -- reserved for possible future use --
+  >
+
+<!ELEMENT NOSCRIPT - - (%flow;)*
+  -- alternate content container for non script-based rendering -->
+<!ATTLIST NOSCRIPT
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!--================ Document Structure ==================================-->
+<!ENTITY % version "version CDATA #FIXED '%HTML.Version;'">
+
+<![ %HTML.Frameset; [
+<!ENTITY % html.content "HEAD, FRAMESET">
+]]>
+
+<!ENTITY % html.content "HEAD, BODY">
+
+<!ELEMENT HTML O O (%html.content;)    -- document root element -->
+<!ATTLIST HTML
+  %i18n;                               -- lang, dir --
+  %version;
+  >
diff --git a/bundles/org.eclipse.wst.standard.schemas/dtds/strict.dtd b/bundles/org.eclipse.wst.standard.schemas/dtds/strict.dtd
new file mode 100644
index 0000000..7032cb8
--- /dev/null
+++ b/bundles/org.eclipse.wst.standard.schemas/dtds/strict.dtd
@@ -0,0 +1,870 @@
+<!--
+    This is HTML 4.01 Strict DTD, which excludes the presentation 
+    attributes and elements that W3C expects to phase out as 
+    support for style sheets matures. Authors should use the Strict
+    DTD when possible, but may use the Transitional DTD when support
+    for presentation attribute and elements is required.
+    
+    HTML 4 includes mechanisms for style sheets, scripting,
+    embedding objects, improved support for right to left and mixed
+    direction text, and enhancements to forms for improved
+    accessibility for people with disabilities.
+
+          Draft: $Date: 2008/07/22 07:37:01 $
+
+          Authors:
+              Dave Raggett <dsr@w3.org>
+              Arnaud Le Hors <lehors@w3.org>
+              Ian Jacobs <ij@w3.org>
+
+    Further information about HTML 4.01 is available at:
+
+        http://www.w3.org/TR/1999/REC-html401-19991224
+
+
+    The HTML 4.01 specification includes additional
+    syntactic constraints that cannot be expressed within
+    the DTDs.
+
+-->
+<!--
+    Typical usage:
+
+    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+            "http://www.w3.org/TR/html4/strict.dtd">
+    <html>
+    <head>
+    ...
+    </head>
+    <body>
+    ...
+    </body>
+    </html>
+
+    The URI used as a system identifier with the public identifier allows
+    the user agent to download the DTD and entity sets as needed.
+
+    The FPI for the Transitional HTML 4.01 DTD is:
+
+        "-//W3C//DTD HTML 4.01 Transitional//EN"
+
+    This version of the transitional DTD is:
+
+        http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd
+
+    If you are writing a document that includes frames, use 
+    the following FPI:
+
+        "-//W3C//DTD HTML 4.01 Frameset//EN"
+
+    This version of the frameset DTD is:
+
+        http://www.w3.org/TR/1999/REC-html401-19991224/frameset.dtd
+
+    Use the following (relative) URIs to refer to 
+    the DTDs and entity definitions of this specification:
+
+    "strict.dtd"
+    "loose.dtd"
+    "frameset.dtd"
+    "HTMLlat1.ent"
+    "HTMLsymbol.ent"
+    "HTMLspecial.ent"
+
+-->
+
+<!--================== Imported Names ====================================-->
+<!-- Feature Switch for frameset documents -->
+<!ENTITY % HTML.Frameset "IGNORE">
+
+<!ENTITY % ContentType "CDATA"
+    -- media type, as per [RFC2045]
+    -->
+
+<!ENTITY % ContentTypes "CDATA"
+    -- comma-separated list of media types, as per [RFC2045]
+    -->
+
+<!ENTITY % Charset "CDATA"
+    -- a character encoding, as per [RFC2045]
+    -->
+
+<!ENTITY % Charsets "CDATA"
+    -- a space-separated list of character encodings, as per [RFC2045]
+    -->
+
+<!ENTITY % LanguageCode "NAME"
+    -- a language code, as per [RFC1766]
+    -->
+
+<!ENTITY % Character "CDATA"
+    -- a single character from [ISO10646] 
+    -->
+
+<!ENTITY % LinkTypes "CDATA"
+    -- space-separated list of link types
+    -->
+
+<!ENTITY % MediaDesc "CDATA"
+    -- single or comma-separated list of media descriptors
+    -->
+
+<!ENTITY % URI "CDATA"
+    -- a Uniform Resource Identifier,
+       see [URI]
+    -->
+
+<!ENTITY % Datetime "CDATA" -- date and time information. ISO date format -->
+
+
+<!ENTITY % Script "CDATA" -- script expression -->
+
+<!ENTITY % StyleSheet "CDATA" -- style sheet data -->
+
+
+
+<!ENTITY % Text "CDATA">
+
+
+<!-- Parameter Entities -->
+
+<!ENTITY % head.misc "SCRIPT|STYLE|META|LINK|OBJECT" -- repeatable head elements -->
+
+<!ENTITY % heading "H1|H2|H3|H4|H5|H6">
+
+<!ENTITY % list "UL | OL">
+
+<!ENTITY % preformatted "PRE">
+
+
+<!--================ Character mnemonic entities =========================-->
+
+<!ENTITY % HTMLlat1 PUBLIC
+   "-//W3C//ENTITIES Latin1//EN//HTML"
+   "HTMLlat1.ent">
+%HTMLlat1;
+
+<!ENTITY % HTMLsymbol PUBLIC
+   "-//W3C//ENTITIES Symbols//EN//HTML"
+   "HTMLsymbol.ent">
+%HTMLsymbol;
+
+<!ENTITY % HTMLspecial PUBLIC
+   "-//W3C//ENTITIES Special//EN//HTML"
+   "HTMLspecial.ent">
+%HTMLspecial;
+<!--=================== Generic Attributes ===============================-->
+
+<!ENTITY % coreattrs
+ "id          ID             #IMPLIED  -- document-wide unique id --
+  class       CDATA          #IMPLIED  -- space-separated list of classes --
+  style       %StyleSheet;   #IMPLIED  -- associated style info --
+  title       %Text;         #IMPLIED  -- advisory title --"
+  >
+
+<!ENTITY % i18n
+ "lang        %LanguageCode; #IMPLIED  -- language code --
+  dir         (ltr|rtl)      #IMPLIED  -- direction for weak/neutral text --"
+  >
+
+<!ENTITY % events
+ "onclick     %Script;       #IMPLIED  -- a pointer button was clicked --
+  ondblclick  %Script;       #IMPLIED  -- a pointer button was double clicked--
+  onmousedown %Script;       #IMPLIED  -- a pointer button was pressed down --
+  onmouseup   %Script;       #IMPLIED  -- a pointer button was released --
+  onmouseover %Script;       #IMPLIED  -- a pointer was moved onto --
+  onmousemove %Script;       #IMPLIED  -- a pointer was moved within --
+  onmouseout  %Script;       #IMPLIED  -- a pointer was moved away --
+  onkeypress  %Script;       #IMPLIED  -- a key was pressed and released --
+  onkeydown   %Script;       #IMPLIED  -- a key was pressed down --
+  onkeyup     %Script;       #IMPLIED  -- a key was released --"
+  >
+
+<!-- Reserved Feature Switch -->
+<!ENTITY % HTML.Reserved "IGNORE">
+
+<!-- The following attributes are reserved for possible future use -->
+<![ %HTML.Reserved; [
+<!ENTITY % reserved
+ "datasrc     %URI;          #IMPLIED  -- a single or tabular Data Source --
+  datafld     CDATA          #IMPLIED  -- the property or column name --
+  dataformatas (plaintext|html) plaintext -- text or html --"
+  >
+]]>
+
+<!ENTITY % reserved "">
+
+<!ENTITY % attrs "%coreattrs; %i18n; %events;">
+
+
+<!--=================== Text Markup ======================================-->
+
+<!ENTITY % fontstyle
+ "TT | I | B | BIG | SMALL">
+
+<!ENTITY % phrase "EM | STRONG | DFN | CODE |
+                   SAMP | KBD | VAR | CITE | ABBR | ACRONYM" >
+
+<!ENTITY % special
+   "A | IMG | OBJECT | BR | SCRIPT | MAP | Q | SUB | SUP | SPAN | BDO">
+
+<!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON">
+
+<!-- %inline; covers inline or "text-level" elements -->
+<!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; | %formctrl;">
+
+<!ELEMENT (%fontstyle;|%phrase;) - - (%inline;)*>
+<!ATTLIST (%fontstyle;|%phrase;)
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!ELEMENT (SUB|SUP) - - (%inline;)*    -- subscript, superscript -->
+<!ATTLIST (SUB|SUP)
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!ELEMENT SPAN - - (%inline;)*         -- generic language/style container -->
+<!ATTLIST SPAN
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  %reserved;			       -- reserved for possible future use --
+  >
+
+<!ELEMENT BDO - - (%inline;)*          -- I18N BiDi over-ride -->
+<!ATTLIST BDO
+  %coreattrs;                          -- id, class, style, title --
+  lang        %LanguageCode; #IMPLIED  -- language code --
+  dir         (ltr|rtl)      #REQUIRED -- directionality --
+  >
+
+
+<!ELEMENT BR - O EMPTY                 -- forced line break -->
+<!ATTLIST BR
+  %coreattrs;                          -- id, class, style, title --
+  >
+
+<!--================== HTML content models ===============================-->
+
+<!--
+    HTML has two basic content models:
+
+        %inline;     character level elements and text strings
+        %block;      block-like elements e.g. paragraphs and lists
+-->
+
+<!ENTITY % block
+     "P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
+      BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">
+
+<!ENTITY % flow "%block; | %inline;">
+
+<!--=================== Document Body ====================================-->
+
+<!ELEMENT BODY O O (%block;|SCRIPT)+ +(INS|DEL) -- document body -->
+<!ATTLIST BODY
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  onload          %Script;   #IMPLIED  -- the document has been loaded --
+  onunload        %Script;   #IMPLIED  -- the document has been removed --
+  >
+
+<!ELEMENT ADDRESS - - (%inline;)* -- information on author -->
+<!ATTLIST ADDRESS
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!ELEMENT DIV - - (%flow;)*            -- generic language/style container -->
+<!ATTLIST DIV
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  %reserved;                           -- reserved for possible future use --
+  >
+
+
+<!--================== The Anchor Element ================================-->
+
+<!ENTITY % Shape "(rect|circle|poly|default)">
+<!ENTITY % Coords "CDATA" -- comma-separated list of lengths -->
+
+<!ELEMENT A - - (%inline;)* -(A)       -- anchor -->
+<!ATTLIST A
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  charset     %Charset;      #IMPLIED  -- char encoding of linked resource --
+  type        %ContentType;  #IMPLIED  -- advisory content type --
+  name        CDATA          #IMPLIED  -- named link end --
+  href        %URI;          #IMPLIED  -- URI for linked resource --
+  hreflang    %LanguageCode; #IMPLIED  -- language code --
+  rel         %LinkTypes;    #IMPLIED  -- forward link types --
+  rev         %LinkTypes;    #IMPLIED  -- reverse link types --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  shape       %Shape;        rect      -- for use with client-side image maps --
+  coords      %Coords;       #IMPLIED  -- for use with client-side image maps --
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  >
+
+<!--================== Client-side image maps ============================-->
+
+<!-- These can be placed in the same document or grouped in a
+     separate document although this isn't yet widely supported -->
+
+<!ELEMENT MAP - - ((%block;) | AREA)+ -- client-side image map -->
+<!ATTLIST MAP
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  name        CDATA          #REQUIRED -- for reference by usemap --
+  >
+
+<!ELEMENT AREA - O EMPTY               -- client-side image map area -->
+<!ATTLIST AREA
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  shape       %Shape;        rect      -- controls interpretation of coords --
+  coords      %Coords;       #IMPLIED  -- comma-separated list of lengths --
+  href        %URI;          #IMPLIED  -- URI for linked resource --
+  nohref      (nohref)       #IMPLIED  -- this region has no action --
+  alt         %Text;         #REQUIRED -- short description --
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  >
+
+<!--================== The LINK Element ==================================-->
+
+<!--
+  Relationship values can be used in principle:
+
+   a) for document specific toolbars/menus when used
+      with the LINK element in document head e.g.
+        start, contents, previous, next, index, end, help
+   b) to link to a separate style sheet (rel=stylesheet)
+   c) to make a link to a script (rel=script)
+   d) by stylesheets to control how collections of
+      html nodes are rendered into printed documents
+   e) to make a link to a printable version of this document
+      e.g. a postscript or pdf version (rel=alternate media=print)
+-->
+
+<!ELEMENT LINK - O EMPTY               -- a media-independent link -->
+<!ATTLIST LINK
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  charset     %Charset;      #IMPLIED  -- char encoding of linked resource --
+  href        %URI;          #IMPLIED  -- URI for linked resource --
+  hreflang    %LanguageCode; #IMPLIED  -- language code --
+  type        %ContentType;  #IMPLIED  -- advisory content type --
+  rel         %LinkTypes;    #IMPLIED  -- forward link types --
+  rev         %LinkTypes;    #IMPLIED  -- reverse link types --
+  media       %MediaDesc;    #IMPLIED  -- for rendering on these media --
+  >
+
+<!--=================== Images ===========================================-->
+
+<!-- Length defined in strict DTD for cellpadding/cellspacing -->
+<!ENTITY % Length "CDATA" -- nn for pixels or nn% for percentage length -->
+<!ENTITY % MultiLength "CDATA" -- pixel, percentage, or relative -->
+
+<![ %HTML.Frameset; [
+<!ENTITY % MultiLengths "CDATA" -- comma-separated list of MultiLength -->
+]]>
+
+<!ENTITY % Pixels "CDATA" -- integer representing length in pixels -->
+
+
+<!-- To avoid problems with text-only UAs as well as 
+   to make image content understandable and navigable 
+   to users of non-visual UAs, you need to provide
+   a description with ALT, and avoid server-side image maps -->
+<!ELEMENT IMG - O EMPTY                -- Embedded image -->
+<!ATTLIST IMG
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  src         %URI;          #REQUIRED -- URI of image to embed --
+  alt         %Text;         #REQUIRED -- short description --
+  longdesc    %URI;          #IMPLIED  -- link to long description
+                                          (complements alt) --
+  name        CDATA          #IMPLIED  -- name of image for scripting --
+  height      %Length;       #IMPLIED  -- override height --
+  width       %Length;       #IMPLIED  -- override width --
+  usemap      %URI;          #IMPLIED  -- use client-side image map --
+  ismap       (ismap)        #IMPLIED  -- use server-side image map --
+  >
+
+<!-- USEMAP points to a MAP element which may be in this document
+  or an external document, although the latter is not widely supported -->
+
+<!--==================== OBJECT ======================================-->
+<!--
+  OBJECT is used to embed objects as part of HTML pages 
+  PARAM elements should precede other content. SGML mixed content
+  model technicality precludes specifying this formally ...
+-->
+
+<!ELEMENT OBJECT - - (PARAM | %flow;)*
+ -- generic embedded object -->
+<!ATTLIST OBJECT
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  declare     (declare)      #IMPLIED  -- declare but don't instantiate flag --
+  classid     %URI;          #IMPLIED  -- identifies an implementation --
+  codebase    %URI;          #IMPLIED  -- base URI for classid, data, archive--
+  data        %URI;          #IMPLIED  -- reference to object's data --
+  type        %ContentType;  #IMPLIED  -- content type for data --
+  codetype    %ContentType;  #IMPLIED  -- content type for code --
+  archive     CDATA          #IMPLIED  -- space-separated list of URIs --
+  standby     %Text;         #IMPLIED  -- message to show while loading --
+  height      %Length;       #IMPLIED  -- override height --
+  width       %Length;       #IMPLIED  -- override width --
+  usemap      %URI;          #IMPLIED  -- use client-side image map --
+  name        CDATA          #IMPLIED  -- submit as part of form --
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  %reserved;                           -- reserved for possible future use --
+  >
+
+<!ELEMENT PARAM - O EMPTY              -- named property value -->
+<!ATTLIST PARAM
+  id          ID             #IMPLIED  -- document-wide unique id --
+  name        CDATA          #REQUIRED -- property name --
+  value       CDATA          #IMPLIED  -- property value --
+  valuetype   (DATA|REF|OBJECT) DATA   -- How to interpret value --
+  type        %ContentType;  #IMPLIED  -- content type for value
+                                          when valuetype=ref --
+  >
+
+
+<!--=================== Horizontal Rule ==================================-->
+
+<!ELEMENT HR - O EMPTY -- horizontal rule -->
+<!ATTLIST HR
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!--=================== Paragraphs =======================================-->
+
+<!ELEMENT P - O (%inline;)*            -- paragraph -->
+<!ATTLIST P
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!--=================== Headings =========================================-->
+
+<!--
+  There are six levels of headings from H1 (the most important)
+  to H6 (the least important).
+-->
+
+<!ELEMENT (%heading;)  - - (%inline;)* -- heading -->
+<!ATTLIST (%heading;)
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!--=================== Preformatted Text ================================-->
+
+<!-- excludes markup for images and changes in font size -->
+<!ENTITY % pre.exclusion "IMG|OBJECT|BIG|SMALL|SUB|SUP">
+
+<!ELEMENT PRE - - (%inline;)* -(%pre.exclusion;) -- preformatted text -->
+<!ATTLIST PRE
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!--===================== Inline Quotes ==================================-->
+
+<!ELEMENT Q - - (%inline;)*            -- short inline quotation -->
+<!ATTLIST Q
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  cite        %URI;          #IMPLIED  -- URI for source document or msg --
+  >
+
+<!--=================== Block-like Quotes ================================-->
+
+<!ELEMENT BLOCKQUOTE - - (%block;|SCRIPT)+ -- long quotation -->
+<!ATTLIST BLOCKQUOTE
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  cite        %URI;          #IMPLIED  -- URI for source document or msg --
+  >
+
+<!--=================== Inserted/Deleted Text ============================-->
+
+
+<!-- INS/DEL are handled by inclusion on BODY -->
+<!ELEMENT (INS|DEL) - - (%flow;)*      -- inserted text, deleted text -->
+<!ATTLIST (INS|DEL)
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  cite        %URI;          #IMPLIED  -- info on reason for change --
+  datetime    %Datetime;     #IMPLIED  -- date and time of change --
+  >
+
+<!--=================== Lists ============================================-->
+
+<!-- definition lists - DT for term, DD for its definition -->
+
+<!ELEMENT DL - - (DT|DD)+              -- definition list -->
+<!ATTLIST DL
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!ELEMENT DT - O (%inline;)*           -- definition term -->
+<!ELEMENT DD - O (%flow;)*             -- definition description -->
+<!ATTLIST (DT|DD)
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+
+<!ELEMENT OL - - (LI)+                 -- ordered list -->
+<!ATTLIST OL
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!-- Unordered Lists (UL) bullet styles -->
+<!ELEMENT UL - - (LI)+                 -- unordered list -->
+<!ATTLIST UL
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+
+
+<!ELEMENT LI - O (%flow;)*             -- list item -->
+<!ATTLIST LI
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!--================ Forms ===============================================-->
+<!ELEMENT FORM - - (%block;|SCRIPT)+ -(FORM) -- interactive form -->
+<!ATTLIST FORM
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  action      %URI;          #REQUIRED -- server-side form handler --
+  method      (GET|POST)     GET       -- HTTP method used to submit the form--
+  enctype     %ContentType;  "application/x-www-form-urlencoded"
+  accept      %ContentTypes; #IMPLIED  -- list of MIME types for file upload --
+  name        CDATA          #IMPLIED  -- name of form for scripting --
+  onsubmit    %Script;       #IMPLIED  -- the form was submitted --
+  onreset     %Script;       #IMPLIED  -- the form was reset --
+  accept-charset %Charsets;  #IMPLIED  -- list of supported charsets --
+  >
+
+<!-- Each label must not contain more than ONE field -->
+<!ELEMENT LABEL - - (%inline;)* -(LABEL) -- form field label text -->
+<!ATTLIST LABEL
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  for         IDREF          #IMPLIED  -- matches field ID value --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  >
+
+<!ENTITY % InputType
+  "(TEXT | PASSWORD | CHECKBOX |
+    RADIO | SUBMIT | RESET |
+    FILE | HIDDEN | IMAGE | BUTTON)"
+   >
+
+<!-- attribute name required for all but submit and reset -->
+<!ELEMENT INPUT - O EMPTY              -- form control -->
+<!ATTLIST INPUT
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  type        %InputType;    TEXT      -- what kind of widget is needed --
+  name        CDATA          #IMPLIED  -- submit as part of form --
+  value       CDATA          #IMPLIED  -- Specify for radio buttons and checkboxes --
+  checked     (checked)      #IMPLIED  -- for radio buttons and check boxes --
+  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
+  readonly    (readonly)     #IMPLIED  -- for text and passwd --
+  size        CDATA          #IMPLIED  -- specific to each type of field --
+  maxlength   NUMBER         #IMPLIED  -- max chars for text fields --
+  src         %URI;          #IMPLIED  -- for fields with images --
+  alt         CDATA          #IMPLIED  -- short description --
+  usemap      %URI;          #IMPLIED  -- use client-side image map --
+  ismap       (ismap)        #IMPLIED  -- use server-side image map --
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  onselect    %Script;       #IMPLIED  -- some text was selected --
+  onchange    %Script;       #IMPLIED  -- the element value was changed --
+  accept      %ContentTypes; #IMPLIED  -- list of MIME types for file upload --
+  %reserved;                           -- reserved for possible future use --
+  >
+
+<!ELEMENT SELECT - - (OPTGROUP|OPTION)+ -- option selector -->
+<!ATTLIST SELECT
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  name        CDATA          #IMPLIED  -- field name --
+  size        NUMBER         #IMPLIED  -- rows visible --
+  multiple    (multiple)     #IMPLIED  -- default is single selection --
+  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  onchange    %Script;       #IMPLIED  -- the element value was changed --
+  %reserved;                           -- reserved for possible future use --
+  >
+
+<!ELEMENT OPTGROUP - - (OPTION)+ -- option group -->
+<!ATTLIST OPTGROUP
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
+  label       %Text;         #REQUIRED -- for use in hierarchical menus --
+  >
+
+<!ELEMENT OPTION - O (#PCDATA)         -- selectable choice -->
+<!ATTLIST OPTION
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  selected    (selected)     #IMPLIED
+  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
+  label       %Text;         #IMPLIED  -- for use in hierarchical menus --
+  value       CDATA          #IMPLIED  -- defaults to element content --
+  >
+
+<!ELEMENT TEXTAREA - - (#PCDATA)       -- multi-line text field -->
+<!ATTLIST TEXTAREA
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  name        CDATA          #IMPLIED
+  rows        NUMBER         #REQUIRED
+  cols        NUMBER         #REQUIRED
+  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
+  readonly    (readonly)     #IMPLIED
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  onselect    %Script;       #IMPLIED  -- some text was selected --
+  onchange    %Script;       #IMPLIED  -- the element value was changed --
+  %reserved;                           -- reserved for possible future use --
+  >
+
+<!--
+  #PCDATA is to solve the mixed content problem,
+  per specification only whitespace is allowed there!
+ -->
+<!ELEMENT FIELDSET - - (#PCDATA,LEGEND,(%flow;)*) -- form control group -->
+<!ATTLIST FIELDSET
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!ELEMENT LEGEND - - (%inline;)*       -- fieldset legend -->
+
+<!ATTLIST LEGEND
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  >
+
+<!ELEMENT BUTTON - -
+     (%flow;)* -(A|%formctrl;|FORM|FIELDSET)
+     -- push button -->
+<!ATTLIST BUTTON
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  name        CDATA          #IMPLIED
+  value       CDATA          #IMPLIED  -- sent to server when submitted --
+  type        (button|submit|reset) submit -- for use as form button --
+  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
+  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
+  accesskey   %Character;    #IMPLIED  -- accessibility key character --
+  onfocus     %Script;       #IMPLIED  -- the element got the focus --
+  onblur      %Script;       #IMPLIED  -- the element lost the focus --
+  %reserved;                           -- reserved for possible future use --
+  >
+
+<!--======================= Tables =======================================-->
+
+<!-- IETF HTML table standard, see [RFC1942] -->
+
+<!--
+ The BORDER attribute sets the thickness of the frame around the
+ table. The default units are screen pixels.
+
+ The FRAME attribute specifies which parts of the frame around
+ the table should be rendered. The values are not the same as
+ CALS to avoid a name clash with the VALIGN attribute.
+
+ The value "border" is included for backwards compatibility with
+ <TABLE BORDER> which yields frame=border and border=implied
+ For <TABLE BORDER=1> you get border=1 and frame=implied. In this
+ case, it is appropriate to treat this as frame=border for backwards
+ compatibility with deployed browsers.
+-->
+<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
+
+<!--
+ The RULES attribute defines which rules to draw between cells:
+
+ If RULES is absent then assume:
+     "none" if BORDER is absent or BORDER=0 otherwise "all"
+-->
+
+<!ENTITY % TRules "(none | groups | rows | cols | all)">
+  
+<!-- horizontal placement of table relative to document -->
+<!ENTITY % TAlign "(left|center|right)">
+
+<!-- horizontal alignment attributes for cell contents -->
+<!ENTITY % cellhalign
+  "align      (left|center|right|justify|char) #IMPLIED
+   char       %Character;    #IMPLIED  -- alignment char, e.g. char=':' --
+   charoff    %Length;       #IMPLIED  -- offset for alignment char --"
+  >
+
+<!-- vertical alignment attributes for cell contents -->
+<!ENTITY % cellvalign
+  "valign     (top|middle|bottom|baseline) #IMPLIED"
+  >
+
+<!ELEMENT TABLE - -
+     (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)>
+<!ELEMENT CAPTION  - - (%inline;)*     -- table caption -->
+<!ELEMENT THEAD    - O (TR)+           -- table header -->
+<!ELEMENT TFOOT    - O (TR)+           -- table footer -->
+<!ELEMENT TBODY    O O (TR)+           -- table body -->
+<!ELEMENT COLGROUP - O (COL)*          -- table column group -->
+<!ELEMENT COL      - O EMPTY           -- table column -->
+<!ELEMENT TR       - O (TH|TD)+        -- table row -->
+<!ELEMENT (TH|TD)  - O (%flow;)*       -- table header cell, table data cell-->
+
+<!ATTLIST TABLE                        -- table element --
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  summary     %Text;         #IMPLIED  -- purpose/structure for speech output--
+  width       %Length;       #IMPLIED  -- table width --
+  border      %Pixels;       #IMPLIED  -- controls frame width around table --
+  frame       %TFrame;       #IMPLIED  -- which parts of frame to render --
+  rules       %TRules;       #IMPLIED  -- rulings between rows and cols --
+  cellspacing %Length;       #IMPLIED  -- spacing between cells --
+  cellpadding %Length;       #IMPLIED  -- spacing within cells --
+  %reserved;                           -- reserved for possible future use --
+  datapagesize CDATA         #IMPLIED  -- reserved for possible future use --
+  >
+
+
+<!ATTLIST CAPTION
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!--
+COLGROUP groups a set of COL elements. It allows you to group
+several semantically related columns together.
+-->
+<!ATTLIST COLGROUP
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  span        NUMBER         1         -- default number of columns in group --
+  width       %MultiLength;  #IMPLIED  -- default width for enclosed COLs --
+  %cellhalign;                         -- horizontal alignment in cells --
+  %cellvalign;                         -- vertical alignment in cells --
+  >
+
+<!--
+ COL elements define the alignment properties for cells in
+ one or more columns.
+
+ The WIDTH attribute specifies the width of the columns, e.g.
+
+     width=64        width in screen pixels
+     width=0.5*      relative width of 0.5
+
+ The SPAN attribute causes the attributes of one
+ COL element to apply to more than one column.
+-->
+<!ATTLIST COL                          -- column groups and properties --
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  span        NUMBER         1         -- COL attributes affect N columns --
+  width       %MultiLength;  #IMPLIED  -- column width specification --
+  %cellhalign;                         -- horizontal alignment in cells --
+  %cellvalign;                         -- vertical alignment in cells --
+  >
+
+<!--
+    Use THEAD to duplicate headers when breaking table
+    across page boundaries, or for static headers when
+    TBODY sections are rendered in scrolling panel.
+
+    Use TFOOT to duplicate footers when breaking table
+    across page boundaries, or for static footers when
+    TBODY sections are rendered in scrolling panel.
+
+    Use multiple TBODY sections when rules are needed
+    between groups of table rows.
+-->
+<!ATTLIST (THEAD|TBODY|TFOOT)          -- table section --
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  %cellhalign;                         -- horizontal alignment in cells --
+  %cellvalign;                         -- vertical alignment in cells --
+  >
+
+<!ATTLIST TR                           -- table row --
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  %cellhalign;                         -- horizontal alignment in cells --
+  %cellvalign;                         -- vertical alignment in cells --
+  >
+
+
+<!-- Scope is simpler than headers attribute for common tables -->
+<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
+
+<!-- TH is for headers, TD for data, but for cells acting as both use TD -->
+<!ATTLIST (TH|TD)                      -- header or data cell --
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  abbr        %Text;         #IMPLIED  -- abbreviation for header cell --
+  axis        CDATA          #IMPLIED  -- comma-separated list of related headers--
+  headers     IDREFS         #IMPLIED  -- list of id's for header cells --
+  scope       %Scope;        #IMPLIED  -- scope covered by header cells --
+  rowspan     NUMBER         1         -- number of rows spanned by cell --
+  colspan     NUMBER         1         -- number of cols spanned by cell --
+  %cellhalign;                         -- horizontal alignment in cells --
+  %cellvalign;                         -- vertical alignment in cells --
+  >
+
+
+<!--================ Document Head =======================================-->
+<!-- %head.misc; defined earlier on as "SCRIPT|STYLE|META|LINK|OBJECT" -->
+<!ENTITY % head.content "TITLE & BASE?">
+
+<!ELEMENT HEAD O O (%head.content;) +(%head.misc;) -- document head -->
+<!ATTLIST HEAD
+  %i18n;                               -- lang, dir --
+  profile     %URI;          #IMPLIED  -- named dictionary of meta info --
+  >
+
+<!-- The TITLE element is not considered part of the flow of text.
+       It should be displayed, for example as the page header or
+       window title. Exactly one title is required per document.
+    -->
+<!ELEMENT TITLE - - (#PCDATA) -(%head.misc;) -- document title -->
+<!ATTLIST TITLE %i18n>
+
+
+<!ELEMENT BASE - O EMPTY               -- document base URI -->
+<!ATTLIST BASE
+  href        %URI;          #REQUIRED -- URI that acts as base URI --
+  >
+
+<!ELEMENT META - O EMPTY               -- generic metainformation -->
+<!ATTLIST META
+  %i18n;                               -- lang, dir, for use with content --
+  http-equiv  NAME           #IMPLIED  -- HTTP response header name  --
+  name        NAME           #IMPLIED  -- metainformation name --
+  content     CDATA          #REQUIRED -- associated information --
+  scheme      CDATA          #IMPLIED  -- select form of content --
+  >
+
+<!ELEMENT STYLE - - %StyleSheet        -- style info -->
+<!ATTLIST STYLE
+  %i18n;                               -- lang, dir, for use with title --
+  type        %ContentType;  #REQUIRED -- content type of style language --
+  media       %MediaDesc;    #IMPLIED  -- designed for use with these media --
+  title       %Text;         #IMPLIED  -- advisory title --
+  >
+
+<!ELEMENT SCRIPT - - %Script;          -- script statements -->
+<!ATTLIST SCRIPT
+  charset     %Charset;      #IMPLIED  -- char encoding of linked resource --
+  type        %ContentType;  #REQUIRED -- content type of script language --
+  src         %URI;          #IMPLIED  -- URI for an external script --
+  defer       (defer)        #IMPLIED  -- UA may defer execution of script --
+  event       CDATA          #IMPLIED  -- reserved for possible future use --
+  for         %URI;          #IMPLIED  -- reserved for possible future use --
+  >
+
+<!ELEMENT NOSCRIPT - - (%block;)+
+  -- alternate content container for non script-based rendering -->
+<!ATTLIST NOSCRIPT
+  %attrs;                              -- %coreattrs, %i18n, %events --
+  >
+
+<!--================ Document Structure ==================================-->
+<!ENTITY % html.content "HEAD, BODY">
+
+<!ELEMENT HTML O O (%html.content;)    -- document root element -->
+<!ATTLIST HTML
+  %i18n;                               -- lang, dir --
+  >
diff --git a/bundles/org.eclipse.wst.standard.schemas/plugin.properties b/bundles/org.eclipse.wst.standard.schemas/plugin.properties
index d748df4..f34570b 100644
--- a/bundles/org.eclipse.wst.standard.schemas/plugin.properties
+++ b/bundles/org.eclipse.wst.standard.schemas/plugin.properties
@@ -17,4 +17,4 @@
 documentType.displayName.5 = XHTML MP 1.0
 documentType.displayName.6 = WML 1.3
 Bundle-Name.0 = Standard Schemas and DTDs
-Bundle-Vendor.0 = Eclipse.org
\ No newline at end of file
+Bundle-Vendor.0 = Eclipse Web Tools Platform
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.standard.schemas/plugin.xml b/bundles/org.eclipse.wst.standard.schemas/plugin.xml
index 4c40c32..d03a9d6 100644
--- a/bundles/org.eclipse.wst.standard.schemas/plugin.xml
+++ b/bundles/org.eclipse.wst.standard.schemas/plugin.xml
@@ -66,8 +66,43 @@
                 uri="dtds/wml13.dtd"
                 webURL="http://www.wapforum.org/DTD/wml13.dtd">
             </public>
-
+            
+            
+            <public
+                publicId="-//W3C//DTD HTML 4.01 Frameset//EN"
+                uri="dtds/frameset.dtd"
+                webURL="http://www.w3.org/TR/html4/frameset.dtd">
+            </public>
+            
+            <public
+                publicId="-//W3C//ENTITIES Latin 1//EN//HTML"
+                uri="dtds/HTMLlat1.ent"
+                webURL="HTMLlat1.ent">
+            </public>
+            
+            <public
+                publicId="-//W3C//ENTITIES Special//EN//HTM"
+                uri="dtds/HTMLspecial.ent"
+                webURL="HTMLspecial.ent">
+            </public>
+            
+            <public
+                publicId="-//W3C//ENTITIES Symbols//EN//HTML"
+                uri="dtds/HTMLsymbol.ent"
+                webURL="HTMLsymbol.ent">
+            </public>
+            
+            <public
+                publicId="-//W3C//DTD HTML 4.01 Transitional//EN"
+                uri="dtds/loose.dtd"
+                webURL="http://www.w3.org/TR/html4/loose.dtd">
+            </public>
         
+            <public
+                publicId="-//W3C//DTD HTML 4.01//EN"
+                uri="dtds/strict.dtd"
+                webURL="http://www.w3.org/TR/html4/strict.dtd">
+            </public>
 
             <uri
                 name="http://schemas.xmlsoap.org/wsdl/"
@@ -84,6 +119,9 @@
             <uri
                 name="http://schemas.xmlsoap.org/soap/encoding/"
                 uri="xsd/soapenc.xsd" />
+            <uri
+                name="urn:oasis:names:tc:entity:xmlns:xml:catalog"
+                uri="xsd/xmlcatalog11.xsd" />
 
 
             <!-- these are removed from the catalog, since they are -not- 
diff --git a/bundles/org.eclipse.wst.standard.schemas/xsd/wsdl-mime.xsd b/bundles/org.eclipse.wst.standard.schemas/xsd/wsdl-mime.xsd
index f57a532..a6dfbeb 100644
--- a/bundles/org.eclipse.wst.standard.schemas/xsd/wsdl-mime.xsd
+++ b/bundles/org.eclipse.wst.standard.schemas/xsd/wsdl-mime.xsd
@@ -37,7 +37,7 @@
 			<extension base="wsdl:tExtensibilityElement">
 				<sequence/>
 				<attribute name="type" type="string" use="optional"/>
-				<attribute name="part" type="NMTOKEN" use="required"/>
+				<attribute name="part" type="NMTOKEN" use="optional"/>
 			</extension>
 		</complexContent>
 	</complexType>
diff --git a/bundles/org.eclipse.wst.standard.schemas/xsd/xmlcatalog11.xsd b/bundles/org.eclipse.wst.standard.schemas/xsd/xmlcatalog11.xsd
new file mode 100644
index 0000000..1ac7956
--- /dev/null
+++ b/bundles/org.eclipse.wst.standard.schemas/xsd/xmlcatalog11.xsd
@@ -0,0 +1,266 @@
+<?xml version="1.0" encoding="utf-8"?>

+<!-- 

+Copyright (c) The Organization for the Advancement of Structured Information Standards 

+[OASIS] 2001, 2002, 2003, 2004, 2005. All Rights Reserved.

+

+OASIS takes no position regarding the validity or scope of any intellectual property or other rights

+that might be claimed to pertain to the implementation or use of the technology described in this document

+or the extent to which any license under such rights might or might not be available; neither does it

+represent that it has made any effort to identify any such rights. Information on OASIS's procedures

+with respect to rights in OASIS specifications can be found at the OASIS website. Copies of claims of

+rights made available for publication and any assurances of licenses to be made available, or the result

+of an attempt made to obtain a general license or permission for the use of such proprietary rights by

+implementors or users of this specification, can be obtained from the OASIS Executive Director.

+

+OASIS invites any interested party to bring to its attention any copyrights, patents or patent

+applications, or other proprietary rights which may cover technology that may be required to implement

+this specification. Please address the information to the OASIS Executive Director.

+

+This document and translations of it may be copied and furnished to others, and derivative works that

+comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and

+distributed, in whole or in part, without restriction of any kind, provided that the above copyright

+notice and this paragraph are included on all such copies and derivative works. However, this document

+itself may not be modified in any way, such as by removing the copyright notice or references to OASIS,

+except as needed for the purpose of developing OASIS specifications, in which case the procedures for

+copyrights defined in the OASIS Intellectual Property Rights document must be followed, or as required to

+translate it into languages other than English.

+

+The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors

+or assigns.

+

+This document and the information contained herein is provided on an "AS IS" basis and OASIS DISCLAIMS

+ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE

+INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS

+FOR A PARTICULAR PURPOSE.

+

+OASIS has been notified of intellectual property rights claimed in regard to some or all of the contents

+of this specification. For more information consult the online list of claimed rights.

+ -->

+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

+           xmlns:er="urn:oasis:names:tc:entity:xmlns:xml:catalog"

+           targetNamespace="urn:oasis:names:tc:entity:xmlns:xml:catalog"

+           elementFormDefault="qualified">

+

+  <xs:import namespace="http://www.w3.org/XML/1998/namespace"/>

+

+  <xs:simpleType name="pubIdChars">

+    <!-- A string of the characters defined as pubIdChar in production 13

+         of the Second Edition of the XML 1.0 Recommendation. Does not include

+         the whitespace characters because they're normalized by XML parsing. -->

+    <xs:restriction base="xs:string">

+      <xs:pattern value="[a-zA-Z0-9\-'\(\)+,./:=?;!*#@$_%]*"/>

+    </xs:restriction>

+  </xs:simpleType>

+

+  <xs:simpleType name="publicIdentifier">

+    <xs:restriction base="er:pubIdChars"/>

+  </xs:simpleType>

+

+  <xs:simpleType name="partialPublicIdentifier">

+    <xs:restriction base="er:pubIdChars"/>

+  </xs:simpleType>

+

+  <xs:simpleType name="systemOrPublic">

+    <xs:restriction base="xs:string">

+      <xs:enumeration value="system"/>

+      <xs:enumeration value="public"/>

+    </xs:restriction>

+  </xs:simpleType>

+

+  <!-- The global attribute xml:base is not explicitly declared; -->

+  <!-- it is allowed by the anyAttribute declarations. -->

+

+  <xs:complexType name="catalog">

+    <xs:choice minOccurs="1" maxOccurs="unbounded">

+      <xs:element ref="er:public"/>

+      <xs:element ref="er:system"/>

+      <xs:element ref="er:uri"/>

+      <xs:element ref="er:rewriteSystem"/>

+      <xs:element ref="er:rewriteURI"/>

+      <xs:element ref="er:uriSuffix"/>

+      <xs:element ref="er:systemSuffix"/>

+      <xs:element ref="er:delegatePublic"/>

+      <xs:element ref="er:delegateSystem"/>

+      <xs:element ref="er:delegateURI"/>

+      <xs:element ref="er:nextCatalog"/>

+      <xs:element ref="er:group"/>

+      <xs:any namespace="##other" processContents="skip"/>

+    </xs:choice>

+    <xs:attribute name="id" type="xs:ID"/>

+    <xs:attribute name="prefer" type="er:systemOrPublic"/>

+    <xs:anyAttribute namespace="##other" processContents="lax"/>

+  </xs:complexType>

+

+  <xs:complexType name="public">

+    <xs:complexContent>

+      <xs:restriction base="xs:anyType">

+        <xs:attribute name="publicId" type="er:publicIdentifier"

+                       use="required"/>

+        <xs:attribute name="uri" type="xs:anyURI" use="required"/>

+        <xs:attribute name="id" type="xs:ID"/>

+        <xs:anyAttribute namespace="##other" processContents="lax"/>

+      </xs:restriction>

+    </xs:complexContent>

+  </xs:complexType>

+

+  <xs:complexType name="system">

+    <xs:complexContent>

+      <xs:restriction base="xs:anyType">

+        <xs:attribute name="systemId" type="xs:string"

+                       use="required"/>

+        <xs:attribute name="uri" type="xs:anyURI" use="required"/>

+        <xs:attribute name="id" type="xs:ID"/>

+        <xs:anyAttribute namespace="##other" processContents="lax"/>

+      </xs:restriction>

+    </xs:complexContent>

+  </xs:complexType>

+

+  <xs:complexType name="uri">

+    <xs:complexContent>

+      <xs:restriction base="xs:anyType">

+        <xs:attribute name="name" type="xs:anyURI"

+                       use="required"/>

+        <xs:attribute name="uri" type="xs:anyURI" use="required"/>

+        <xs:attribute name="id" type="xs:ID"/>

+        <xs:anyAttribute namespace="##other" processContents="lax"/>

+      </xs:restriction>

+    </xs:complexContent>

+  </xs:complexType>

+

+  <xs:complexType name="rewriteSystem">

+    <xs:complexContent>

+      <xs:restriction base="xs:anyType">

+        <xs:attribute name="systemIdStartString"

+                       type="xs:string"

+                       use="required"/>

+        <xs:attribute name="rewritePrefix" type="xs:string" use="required"/>

+        <xs:attribute name="id" type="xs:ID"/>

+        <xs:anyAttribute namespace="##other" processContents="lax"/>

+      </xs:restriction>

+    </xs:complexContent>

+  </xs:complexType>

+

+  <xs:complexType name="rewriteURI">

+    <xs:complexContent>

+      <xs:restriction base="xs:anyType">

+        <xs:attribute name="uriStartString"

+                       type="xs:string"

+                       use="required"/>

+        <xs:attribute name="rewritePrefix" type="xs:string" use="required"/>

+        <xs:attribute name="id" type="xs:ID"/>

+        <xs:anyAttribute namespace="##other" processContents="lax"/>

+      </xs:restriction>

+    </xs:complexContent>

+  </xs:complexType>

+

+  <xs:complexType name="systemSuffix">

+    <xs:complexContent>

+      <xs:restriction base="xs:anyType">

+        <xs:attribute name="systemIdSuffix"

+                       type="xs:string"

+                       use="required"/>

+        <xs:attribute name="uri" type="xs:anyURI" use="required"/>

+        <xs:attribute name="id" type="xs:ID"/>

+        <xs:anyAttribute namespace="##other" processContents="lax"/>

+      </xs:restriction>

+    </xs:complexContent>

+  </xs:complexType>

+

+  <xs:complexType name="uriSuffix">

+    <xs:complexContent>

+      <xs:restriction base="xs:anyType">

+        <xs:attribute name="uriSuffix"

+                       type="xs:string"

+                       use="required"/>

+        <xs:attribute name="uri" type="xs:anyURI" use="required"/>

+        <xs:attribute name="id" type="xs:ID"/>

+        <xs:anyAttribute namespace="##other" processContents="lax"/>

+      </xs:restriction>

+    </xs:complexContent>

+  </xs:complexType>

+

+  <xs:complexType name="delegatePublic">

+    <xs:complexContent>

+      <xs:restriction base="xs:anyType">

+        <xs:attribute name="publicIdStartString"

+                       type="er:partialPublicIdentifier"

+                       use="required"/>

+        <xs:attribute name="catalog" type="xs:anyURI" use="required"/>

+        <xs:attribute name="id" type="xs:ID"/>

+        <xs:anyAttribute namespace="##other" processContents="lax"/>

+      </xs:restriction>

+    </xs:complexContent>

+  </xs:complexType>

+

+  <xs:complexType name="delegateSystem">

+    <xs:complexContent>

+      <xs:restriction base="xs:anyType">

+        <xs:attribute name="systemIdStartString"

+                       type="xs:string"

+                       use="required"/>

+        <xs:attribute name="catalog" type="xs:anyURI" use="required"/>

+        <xs:attribute name="id" type="xs:ID"/>

+        <xs:anyAttribute namespace="##other" processContents="lax"/>

+      </xs:restriction>

+    </xs:complexContent>

+  </xs:complexType>

+

+  <xs:complexType name="delegateURI">

+    <xs:complexContent>

+      <xs:restriction base="xs:anyType">

+        <xs:attribute name="uriStartString"

+                       type="xs:string"

+                       use="required"/>

+        <xs:attribute name="catalog" type="xs:anyURI" use="required"/>

+        <xs:attribute name="id" type="xs:ID"/>

+        <xs:anyAttribute namespace="##other" processContents="lax"/>

+      </xs:restriction>

+    </xs:complexContent>

+  </xs:complexType>

+

+  <xs:complexType name="nextCatalog">

+    <xs:complexContent>

+      <xs:restriction base="xs:anyType">

+        <xs:attribute name="catalog" type="xs:anyURI" use="required"/>

+        <xs:attribute name="id" type="xs:ID"/>

+        <xs:anyAttribute namespace="##other" processContents="lax"/>

+      </xs:restriction>

+    </xs:complexContent>

+  </xs:complexType>

+

+  <xs:complexType name="group">

+    <xs:choice minOccurs="1" maxOccurs="unbounded">

+      <xs:element ref="er:public"/>

+      <xs:element ref="er:system"/>

+      <xs:element ref="er:uri"/>

+      <xs:element ref="er:rewriteSystem"/>

+      <xs:element ref="er:rewriteURI"/>

+      <xs:element ref="er:uriSuffix"/>

+      <xs:element ref="er:systemSuffix"/>

+      <xs:element ref="er:delegatePublic"/>

+      <xs:element ref="er:delegateSystem"/>

+      <xs:element ref="er:delegateURI"/>

+      <xs:element ref="er:nextCatalog"/>

+      <xs:any namespace="##other" processContents="skip"/>

+    </xs:choice>

+    <xs:attribute name="prefer" type="er:systemOrPublic"/>

+    <xs:attribute name="id" type="xs:ID"/>

+    <xs:anyAttribute namespace="##other" processContents="lax"/>

+  </xs:complexType>

+

+  <xs:element name="catalog" type="er:catalog"/>

+  <xs:element name="public" type="er:public"/>

+  <xs:element name="system" type="er:system"/>

+  <xs:element name="uri" type="er:uri"/>

+  <xs:element name="rewriteSystem" type="er:rewriteSystem"/>

+  <xs:element name="rewriteURI" type="er:rewriteURI"/>

+  <xs:element name="systemSuffix" type="er:systemSuffix"/>

+  <xs:element name="uriSuffix" type="er:uriSuffix"/>

+  <xs:element name="delegatePublic" type="er:delegatePublic"/>

+  <xs:element name="delegateSystem" type="er:delegateSystem"/>

+  <xs:element name="delegateURI" type="er:delegateURI"/>

+  <xs:element name="nextCatalog" type="er:nextCatalog"/>

+  <xs:element name="group" type="er:group"/>

+

+</xs:schema>

+

diff --git a/bundles/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer.jFlex b/bundles/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer.jFlex
index ff50a31..15d5b0a 100644
--- a/bundles/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer.jFlex
+++ b/bundles/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer.jFlex
@@ -1,256 +1,254 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.wst.xml.core.internal.contenttype;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
-import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;
-
-
-%%
-
-%{
-
-
-	private boolean hasMore = true;
-	private final static int MAX_TO_SCAN = 8000;
-	StringBuffer string = new StringBuffer();
-	// state stack for easier state handling
-	private IntStack fStateStack = new IntStack();
-	private String valueText = null;
-
-
-	public XMLHeadTokenizer() {
-		super();
-	}
-
-	  public void reset (Reader in) {
-                /* the input device */
-                zzReader = in;
-
-                /* the current state of the DFA */
-                zzState = 0;
-
-                /* the current lexical state */
-                zzLexicalState = YYINITIAL;
-
-                /* this buffer contains the current text to be matched and is
-                 the source of the yytext() string */
-                java.util.Arrays.fill(zzBuffer, (char)0);
-
-                /* the textposition at the last accepting state */
-                zzMarkedPos = 0;
-
-                /* the textposition at the last state to be included in yytext */
-                zzPushbackPos = 0;
-
-                /* the current text position in the buffer */
-                zzCurrentPos = 0;
-
-                /* startRead marks the beginning of the yytext() string in the buffer */
-                zzStartRead = 0;
-
-                /**
-                 * endRead marks the last character in the buffer, that has been read
-                 * from input
-                 */
-                zzEndRead = 0;
-
-                /* number of newlines encountered up to the start of the matched text */
-                yyline = 0;
-
-                /* the number of characters up to the start of the matched text */
-                yychar = 0;
-
-                /**
-                 * the number of characters from the last newline up to the start
-                 * of the matched text
-                 */
-                yycolumn = 0;
-
-                /**
-                 * yy_atBOL == true <=> the scanner is currently at the beginning
-                 * of a line
-                 */
-                zzAtBOL = true;
-
-                /* yy_atEOF == true <=> the scanner has returned a value for EOF */
-                zzAtEOF = false;
-
-                /* denotes if the user-EOF-code has already been executed */
-                zzEOFDone = false;
-
-
-                fStateStack.clear();
-
-                hasMore = true;
-  		
-  	}
-
-
-	public final HeadParserToken getNextToken() throws IOException {
-		String context = null;
-		context = primGetNextToken();
-		HeadParserToken result = null;
-		if (valueText != null) {
-			result = createToken(context, yychar, valueText);
-			valueText = null;
-		} else {
-			result = createToken(context, yychar, yytext());
-		}
-		return result;
-	}
-
-	public final boolean hasMoreTokens() {
-		return hasMore && yychar < MAX_TO_SCAN;
-	}
-	private void pushCurrentState() {
-		fStateStack.push(yystate());
-
-	}
-
-	private void popState() {
-		yybegin(fStateStack.pop());
-	}
-	
-	private HeadParserToken createToken(String context, int start, String text) {
-		return new HeadParserToken(context, start, text);
-	}	
-
-%}
-
-%eof{
-	hasMore=false;
-%eof}
-
-%public
-%class XMLHeadTokenizer
-%function primGetNextToken
-%type String
-%char
-%unicode
-%ignorecase 
-//%debug
-%switch
-%buffer 8192
-
-UTF16BE = \xFE\xFF
-UTF16LE = \xFF\xFE
-UTF83ByteBOM = \xEF\xBB\xBF
-
-//SpaceChar = [\x20\x09]
-
-// [3] S ::= (0x20 | 0x9 | 0xD | 0xA)+
-S = [\x20\x09\x0D\x0A]
-
-BeginAttribeValue = {S}* \= {S}*
-
-LineTerminator = \r|\n
-
-
-%state ST_XMLDecl
-%state QuotedAttributeValue
-%state DQ_STRING
-%state SQ_STRING
-%state UnDelimitedString
-
-%%
-
-
-<YYINITIAL>  
-{
-	// force to start at beginning of line (^) and at beginning of file (yychar == 0)
-	^{UTF16BE}   		{if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16BE;}}
-	^{UTF16LE}   		{if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16LE;}}
-	^{UTF83ByteBOM}   	{if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}}
-	
-	// force to be started on first line, but we do allow preceeding spaces
-	^ {S}* "<\?xml" {S}+ {if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}}
-	
-}	
-	
-<ST_XMLDecl> 
-{
-	"version" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;}
-	"encoding" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;}
-	// note the "forced end" (via 'hasMore=false') once the end of XML Declaration found
-	// This is since non-ascii chars may follow and may cause IOExceptions which would not occur once stream is 
-	// read with incorrect encoding (such as if platform encoding is in effect until true encoding detected). 
-	"\?>"    {yybegin(YYINITIAL); hasMore = false; return XMLHeadTokenizerConstants.XMLDeclEnd;}
-}	
-
-	
-
-<QuotedAttributeValue>
-{
-	\"                      { yybegin(DQ_STRING); string.setLength(0); }
-	\'			{ yybegin(SQ_STRING); string.setLength(0); }
-	// in this state, anything other than a space character can start an undelimited string
-	{S}*.           { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);}
-
-}	
-
-
-<DQ_STRING>
-{
-
-	\"                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\?>"			{ yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	'<'			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	.			{ string.append( yytext() ); }
-
-
-}
-
-<SQ_STRING>
-{
-
-	\'                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;}
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"%>"			{ yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	'<'			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	.			{ string.append( yytext() ); }
-
-
-}
-
-<UnDelimitedString>
-{
-
-	{S}                     { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
-  	{LineTerminator}        { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	"\?>"			{ yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	'<'	
-	{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-	// these are a bit special, since we started an undelimit string, but found a quote ... probably indicates a missing beginning quote
-	\'			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-	
-	\"			{ yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-	
-	.			{ string.append( yytext() ); }
-
-}
-
-// The "match anything" rule should always be in effect except for when looking for end of string
-// (That is, remember to update state list if/when new states added)
-<YYINITIAL, ST_XMLDecl, QuotedAttributeValue>
-{
-// this is the fallback (match "anything") rule  (for this scanner, input is ignored, and position advanced, if not recognized)
-.|\n              {if (yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}}
-}
-
-// this rule always in effect
-<<EOF>>         {hasMore = false; return EncodingParserConstants.EOF;}
-
+/*******************************************************************************

+ * Copyright (c) 2005, 2008 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+/*nlsXXX*/

+package org.eclipse.wst.xml.core.internal.contenttype;

+import java.io.IOException;

+import java.io.Reader;

+

+import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;

+import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;

+

+

+%%

+

+%{

+

+

+	private boolean hasMore = true;

+	private final static int MAX_TO_SCAN = 8000;

+	StringBuffer string = new StringBuffer();

+	// state stack for easier state handling

+	private IntStack fStateStack = new IntStack();

+	private String valueText = null;

+

+

+	public XMLHeadTokenizer() {

+		super();

+	}

+

+	  public void reset (Reader in) {

+                /* the input device */

+                zzReader = in;

+

+                /* the current state of the DFA */

+                zzState = 0;

+

+                /* the current lexical state */

+                zzLexicalState = YYINITIAL;

+

+                /* this buffer contains the current text to be matched and is

+                 the source of the yytext() string */

+                java.util.Arrays.fill(zzBuffer, (char)0);

+

+                /* the textposition at the last accepting state */

+                zzMarkedPos = 0;

+

+                /* the textposition at the last state to be included in yytext */

+                zzPushbackPos = 0;

+

+                /* the current text position in the buffer */

+                zzCurrentPos = 0;

+

+                /* startRead marks the beginning of the yytext() string in the buffer */

+                zzStartRead = 0;

+

+                /**

+                 * endRead marks the last character in the buffer, that has been read

+                 * from input

+                 */

+                zzEndRead = 0;

+

+                /* number of newlines encountered up to the start of the matched text */

+                yyline = 0;

+

+                /* the number of characters up to the start of the matched text */

+                yychar = 0;

+

+                /**

+                 * the number of characters from the last newline up to the start

+                 * of the matched text

+                 */

+                yycolumn = 0;

+

+                /**

+                 * yy_atBOL == true <=> the scanner is currently at the beginning

+                 * of a line

+                 */

+                zzAtBOL = true;

+

+                /* yy_atEOF == true <=> the scanner has returned a value for EOF */

+                zzAtEOF = false;

+

+                /* denotes if the user-EOF-code has already been executed */

+                zzEOFDone = false;

+

+

+                fStateStack.clear();

+

+                hasMore = true;

+  		

+  	}

+

+

+	public final HeadParserToken getNextToken() throws IOException {

+		String context = null;

+		context = primGetNextToken();

+		HeadParserToken result = null;

+		if (valueText != null) {

+			result = createToken(context, yychar, valueText);

+			valueText = null;

+		} else {

+			result = createToken(context, yychar, yytext());

+		}

+		return result;

+	}

+

+	public final boolean hasMoreTokens() {

+		return hasMore && yychar < MAX_TO_SCAN;

+	}

+	private void pushCurrentState() {

+		fStateStack.push(yystate());

+

+	}

+

+	private void popState() {

+		yybegin(fStateStack.pop());

+	}

+	

+	private HeadParserToken createToken(String context, int start, String text) {

+		return new HeadParserToken(context, start, text);

+	}	

+

+%}

+

+%eof{

+	hasMore=false;

+%eof}

+

+%public

+%class XMLHeadTokenizer

+%function primGetNextToken

+%type String

+%char

+%unicode

+%ignorecase 

+//%debug

+%switch

+%buffer 8192

+

+UTF16BE = \xFE\xFF

+UTF16LE = \xFF\xFE

+UTF83ByteBOM = \xEF\xBB\xBF

+

+//SpaceChar = [\x20\x09]

+

+// [3] S ::= (0x20 | 0x9 | 0xD | 0xA)+

+S = [\x20\x09\x0D\x0A]

+

+//BeginAttribeValue = {S}* \= {S}*

+

+LineTerminator = \r|\n

+

+// Z is the single-byte zero character to be used in parsing double-byte files

+Z = (\x00)?

+S_UTF = {Z}{S}{Z}

+BeginAttributeValueUTF = {S_UTF}* \= {S_UTF}*

+

+%state ST_XMLDecl

+%state QuotedAttributeValue

+%state DQ_STRING

+%state SQ_STRING

+%state UnDelimitedString

+

+%%

+

+

+<YYINITIAL>  

+{

+	// force to start at beginning of line (^) and at beginning of file (yychar == 0)

+	^{UTF16BE}   		{if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16BE;}}

+	^{UTF16LE}   		{if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16LE;}}

+	^{UTF83ByteBOM}   	{if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}}

+	

+	// force to be started on first line, but we do allow preceeding spaces

+	^ {S_UTF}* ({Z}<{Z}\?{Z}x{Z}m{Z}l{Z}){S_UTF}+ {if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}}

+	

+}	

+	

+<ST_XMLDecl> 

+{

+	({Z}v{Z}e{Z}r{Z}s{Z}i{Z}o{Z}n{Z}) {BeginAttributeValueUTF} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;}

+	({Z}e{Z}n{Z}c{Z}o{Z}d{Z}i{Z}n{Z}g{Z}) {BeginAttributeValueUTF} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;}

+	// note the "forced end" (via 'hasMore=false') once the end of XML Declaration found

+	// This is since non-ascii chars may follow and may cause IOExceptions which would not occur once stream is 

+	// read with incorrect encoding (such as if platform encoding is in effect until true encoding detected). 

+	({Z}\?{Z}>{Z})    {yybegin(YYINITIAL); hasMore = false; return XMLHeadTokenizerConstants.XMLDeclEnd;}

+}	

+

+	

+

+<QuotedAttributeValue>

+{

+	{Z}\"{Z}        { yybegin(DQ_STRING); string.setLength(0); }

+	{Z}\'{Z}			{ yybegin(SQ_STRING); string.setLength(0); }

+	// in this state, anything other than a space character can start an undelimited string

+	{S_UTF}*.           { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);}

+

+}	

+

+

+<DQ_STRING>

+{

+

+	{Z}\"{Z}                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }

+  	{Z}{LineTerminator}{Z}        { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}\?{Z}>{Z}			{ yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}<{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	[^\x00]			{ string.append( yytext() ); }

+

+}

+

+<SQ_STRING>

+{

+

+	{Z}\'{Z}                      { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;}

+  	{Z}{LineTerminator}{Z}        { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}%{Z}>{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}<{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	[^\x00]			{ string.append( yytext() ); }

+

+}

+

+<UnDelimitedString>

+{

+

+	{S_UTF}                     { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }

+  	{Z}{LineTerminator}{Z}        { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}\?{Z}>{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	{Z}<{Z}	

+	{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}

+	// these are a bit special, since we started an undelimit string, but found a quote ... probably indicates a missing beginning quote

+	{Z}\'{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}

+	

+	{Z}\"{Z}			{ yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}

+	

+	[^\x00]			{ string.append( yytext() ); }

+

+}

+

+// The "match anything" rule should always be in effect except for when looking for end of string

+// (That is, remember to update state list if/when new states added)

+.|\n	{if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}}

+

+// this rule always in effect

+<<EOF>>         {hasMore = false; return EncodingParserConstants.EOF;}

+

 	
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF
index 452fd52..4d5afd4 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.1.300.qualifier
+Bundle-Version: 1.1.502.qualifier
 Bundle-Activator: org.eclipse.wst.xml.core.internal.XMLCorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
@@ -57,18 +57,20 @@
  org.eclipse.wst.xml.core.internal.validation.eclipse;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
  org.eclipse.wst.xml.core.internal.validation.errorcustomization;x-friends:="org.eclipse.wst.dtd.core,org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.core,org.eclipse.wst.xsd.ui",
  org.eclipse.wst.xml.core.text
+Import-Package: com.ibm.icu.util; version="3.8",
+ com.ibm.icu.text; version="3.8"
 Require-Bundle: org.apache.xerces;bundle-version="[2.9.0,3.0.0)";visibility:=reexport,
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.filebuffers;bundle-version="[3.5.0,4.0.0)";resolution:=optional,
  org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.jem.util;bundle-version="[2.0.100,3.0.0)";resolution:=optional,
- org.eclipse.wst.validation;bundle-version="[1.2.0,1.3.0)";resolution:=optional,
- org.eclipse.emf.ecore.edit;bundle-version="[2.4.0,3.0.0)";resolution:=optional,
- org.eclipse.wst.common.emf;bundle-version="[1.1.104,1.2.0)";resolution:=optional,
+ org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.jem.util;bundle-version="[2.0.200,3.0.0)";resolution:=optional,
+ org.eclipse.wst.validation;bundle-version="[1.2.100,1.3.0)";resolution:=optional,
+ org.eclipse.wst.common.emf;bundle-version="[1.1.300,1.3.0)";resolution:=optional,
  org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)";resolution:=optional,
- org.eclipse.wst.common.emfworkbench.integration;bundle-version="[1.1.200,1.2.0)";resolution:=optional,
- org.eclipse.wst.common.core;bundle-version="[1.1.101,1.2.0)",
- com.ibm.icu;bundle-version="[3.8.1,4.0.0)"
+ org.eclipse.wst.common.emfworkbench.integration;bundle-version="[1.1.300,1.3.0)";resolution:=optional,
+ org.eclipse.wst.common.core;bundle-version="[1.1.201,1.3.0)",
+ org.eclipse.osgi.services;bundle-version="[3.2.0,4.0.0)"
 Bundle-ActivationPolicy: lazy; exclude:="org.eclipse.wst.xml.core.internal.contenttype"
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.xml.core/about.html b/bundles/org.eclipse.wst.xml.core/about.html
index 73db36e..2199df3 100644
--- a/bundles/org.eclipse.wst.xml.core/about.html
+++ b/bundles/org.eclipse.wst.xml.core/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/bundles/org.eclipse.wst.xml.core/build.properties b/bundles/org.eclipse.wst.xml.core/build.properties
index e49a2dc..8d49b33 100644
--- a/bundles/org.eclipse.wst.xml.core/build.properties
+++ b/bundles/org.eclipse.wst.xml.core/build.properties
@@ -21,10 +21,9 @@
                @dot/**,\
                temp.folder/**
 src.includes = component.xml,\
-               build.properties,\
                schema/,\
                DevTimeSupport/
-source.. = src-catalog,\
+source.. = src-catalog/,\
            src-contentmodel/,\
            src-validation/,\
            src/,\
diff --git a/bundles/org.eclipse.wst.xml.core/plugin.properties b/bundles/org.eclipse.wst.xml.core/plugin.properties
index b954490..09e743b 100644
--- a/bundles/org.eclipse.wst.xml.core/plugin.properties
+++ b/bundles/org.eclipse.wst.xml.core/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2008 IBM Corporation and others.
+# Copyright (c) 2001, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
 #     Jens Lukowski/Innoopract - initial renaming/restructuring
 #     
 ###############################################################################
-providerName=Eclipse.org
+providerName=Eclipse Web Tools Platform
 pluginName=Structured Source XML Model
 Structured_XML_Document_Factory_Extension.name=Structured XML Document Factory Extension
 XML_Content_Type_Extension_Element.name=XML (Illformed)
@@ -24,4 +24,4 @@
 XML_Validator.name=XML Validator
 XML_Validation_Error_Customizer.name=XML Validator Error Customizer Extension Point
 _validationMarker.name=XML Problem
-_taskMarker.name=XML Task
\ No newline at end of file
+_taskMarker.name=XML Task
diff --git a/bundles/org.eclipse.wst.xml.core/plugin.xml b/bundles/org.eclipse.wst.xml.core/plugin.xml
index 8ebaa6f..deab7eb 100644
--- a/bundles/org.eclipse.wst.xml.core/plugin.xml
+++ b/bundles/org.eclipse.wst.xml.core/plugin.xml
@@ -112,7 +112,7 @@
 	<!--  https://bugs.eclipse.org/bugs/show_bug.cgi?id=103083 -->\
 	<!--  FYI: this xmi type *should* be defined in EMF, but, since isn't
 			we will here. In future versions is could be removed -->
-	<extension point="org.eclipse.core.runtime.contentTypes">
+	<extension point="org.eclipse.core.contenttype.contentTypes">
 		<content-type
 			file-extensions="xmi"
 			priority="low"
@@ -192,14 +192,6 @@
                      caseSensitive="false"
                      ext="xml">
                </fileext>
-               <fileext
-                     caseSensitive="false"
-                     ext="gph">
-               </fileext>
-               <fileext
-                     caseSensitive="false"
-                     ext="wdo-connections">
-               </fileext>
             </rules>
          </include>
          <exclude>
diff --git a/bundles/org.eclipse.wst.xml.core/schema/modelQueryExtensions.exsd b/bundles/org.eclipse.wst.xml.core/schema/modelQueryExtensions.exsd
index ecddf01..6b2f977 100644
--- a/bundles/org.eclipse.wst.xml.core/schema/modelQueryExtensions.exsd
+++ b/bundles/org.eclipse.wst.xml.core/schema/modelQueryExtensions.exsd
@@ -1,16 +1,21 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.xml.core">
+<schema targetNamespace="org.eclipse.wst.xml.core" xmlns="http://www.w3.org/2001/XMLSchema">
 <annotation>
-      <appInfo>
+      <appinfo>
          <meta.schema plugin="org.eclipse.wst.xml.core" id="modelQueryExtensions" name="Model Query Extension"/>
-      </appInfo>
+      </appinfo>
       <documentation>
          &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
       </documentation>
    </annotation>
 
    <element name="extension">
+      <annotation>
+         <appinfo>
+            <meta.element internal="true" />
+         </appinfo>
+      </annotation>
       <complexType>
          <sequence>
             <element ref="modelQueryExtension"/>
@@ -34,30 +39,35 @@
                <documentation>
                   an optional name of the extension instance
                </documentation>
-               <appInfo>
+               <appinfo>
                   <meta.attribute translatable="true"/>
-               </appInfo>
+               </appinfo>
             </annotation>
          </attribute>
       </complexType>
    </element>
 
    <element name="modelQueryExtension">
+      <annotation>
+         <documentation>
+            Allows for the customization of returned vaues from a ModelQuery object.
+         </documentation>
+      </annotation>
       <complexType>
          <attribute name="class" type="string" use="required">
             <annotation>
                <documentation>
                   
                </documentation>
-               <appInfo>
-                  <meta.attribute kind="java"/>
-               </appInfo>
+               <appinfo>
+                  <meta.attribute kind="java" basedOn="org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtension:"/>
+               </appinfo>
             </annotation>
          </attribute>
          <attribute name="contentType" type="string" use="required">
             <annotation>
                <documentation>
-                  
+                  Content Types for which to use this extension
                </documentation>
             </annotation>
          </attribute>
@@ -65,45 +75,21 @@
    </element>
 
    <annotation>
-      <appInfo>
+      <appinfo>
          <meta.section type="since"/>
-      </appInfo>
+      </appinfo>
       <documentation>
          &lt;b&gt;This extension point is internal and should not be used by any other plugins.&lt;/b&gt;
       </documentation>
    </annotation>
 
-   <annotation>
-      <appInfo>
-         <meta.section type="examples"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
+
+
 
    <annotation>
-      <appInfo>
-         <meta.section type="apiInfo"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="implementation"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
+      <appinfo>
          <meta.section type="copyright"/>
-      </appInfo>
+      </appinfo>
       <documentation>
          Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
 All rights reserved. This program and the accompanying materials are made 
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/Catalog.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/Catalog.java
index d071382..6586c01 100644
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/Catalog.java
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/Catalog.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
+ * Copyright (c) 2002, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     Jesper Steen Moeller - Added XML Catalogs 1.1 support
  *     
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.catalog;
@@ -17,8 +18,11 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
@@ -30,7 +34,10 @@
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEvent;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogListener;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.IDelegateCatalog;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.IRewriteEntry;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ISuffixEntry;
 public class Catalog implements ICatalog
 {
 
@@ -75,6 +82,42 @@
 		}
 	}
 
+	private static Comparator LONGEST_REWRITE_FIRST = new Comparator() 
+	{
+		public int compare(Object entry1, Object entry2) 
+		{
+			String start1 = ((IRewriteEntry)entry1).getStartString();
+			String start2 = ((IRewriteEntry)entry2).getStartString();
+			
+			// Bigger is earlier
+			return start2.length() - start1.length();
+		}
+	};
+
+	private static Comparator LONGEST_SUFFIX_FIRST = new Comparator() 
+	{
+		public int compare(Object entry1, Object entry2) 
+		{
+			String suffix1 = ((ISuffixEntry)entry1).getSuffix();
+			String suffix2 = ((ISuffixEntry)entry2).getSuffix();
+			
+			// Bigger is earlier
+			return suffix2.length() - suffix1.length();
+		}
+	};
+
+	private static Comparator LONGEST_DELEGATE_PREFIX_FIRST = new Comparator() 
+	{
+		public int compare(Object entry1, Object entry2) 
+		{
+			String prefix1 = ((IDelegateCatalog)entry1).getStartString();
+			String prefix2 = ((IDelegateCatalog)entry2).getStartString();
+			
+			// Bigger is earlier
+			return prefix2.length() - prefix1.length();
+		}
+	};
+
 	class InternalResolver
 	{
 		protected Map publicMap = new HashMap();
@@ -83,6 +126,15 @@
 
 		protected Map uriMap = new HashMap();
 
+		// These are sorted by longest "key" first.
+		protected List rewriteSystemList = new LinkedList();
+		protected List rewriteUriList = new LinkedList();
+		protected List suffixSystemList = new LinkedList();
+		protected List suffixUriList = new LinkedList();
+		protected List delegatePublicList = new LinkedList();
+		protected List delegateSystemList = new LinkedList();
+		protected List delegateUriList = new LinkedList();
+		
 		InternalResolver()
 		{
 			for (Iterator i = catalogElements.iterator(); i.hasNext();)
@@ -93,8 +145,58 @@
 					ICatalogEntry entry = (ICatalogEntry) catalogElement;
 					Map map = getEntryMap(entry.getEntryType());
 					map.put(entry.getKey(), entry);
+				} 
+				else if (catalogElement.getType() == ICatalogElement.TYPE_REWRITE) 
+				{
+					IRewriteEntry entry = (IRewriteEntry) catalogElement;
+					if (entry.getEntryType() == IRewriteEntry.REWRITE_TYPE_SYSTEM) 
+					{
+						rewriteSystemList.add(entry);
+					} 
+					else 
+					{
+						rewriteUriList.add(entry);
+					}
+				} 
+				else if (catalogElement.getType() == ICatalogElement.TYPE_SUFFIX) 
+				{
+					ISuffixEntry entry = (ISuffixEntry) catalogElement;
+					if (entry.getEntryType() == ISuffixEntry.SUFFIX_TYPE_SYSTEM) 
+					{
+						suffixSystemList.add(entry);
+					} 
+					else 
+					{
+						suffixUriList.add(entry);
+					}
+				} 
+				else if (catalogElement.getType() == ICatalogElement.TYPE_DELEGATE) 
+				{
+					IDelegateCatalog delegate = (IDelegateCatalog) catalogElement;
+					if (delegate.getEntryType() == IDelegateCatalog.DELEGATE_TYPE_PUBLIC) 
+					{
+						delegatePublicList.add(delegate);
+					}
+					else if (delegate.getEntryType() == IDelegateCatalog.DELEGATE_TYPE_SYSTEM) 
+					{
+						delegateSystemList.add(delegate);
+					}
+					else 
+					{
+						delegateUriList.add(delegate);
+					}
 				}
 			}
+			
+			Collections.sort(rewriteSystemList, LONGEST_REWRITE_FIRST);
+			Collections.sort(rewriteUriList, LONGEST_REWRITE_FIRST);
+
+			Collections.sort(suffixSystemList, LONGEST_SUFFIX_FIRST);
+			Collections.sort(suffixUriList, LONGEST_SUFFIX_FIRST);
+		
+			Collections.sort(delegatePublicList, LONGEST_DELEGATE_PREFIX_FIRST);
+			Collections.sort(delegateSystemList, LONGEST_DELEGATE_PREFIX_FIRST);
+			Collections.sort(delegateUriList, LONGEST_DELEGATE_PREFIX_FIRST);
 		}
 
 		private Map getEntryMap(int entryType)
@@ -160,6 +262,10 @@
 			}
 			if (result == null)
 			{
+				result = resolveDelegateCatalogs(delegatePublicList, publicId, systemId);
+			}
+			if (result == null)
+			{
 				result = resolveSubordinateCatalogs(
 						ICatalogEntry.ENTRY_TYPE_PUBLIC, publicId, systemId);
 			}
@@ -172,18 +278,103 @@
 			String result = getMappedURI(systemMap, systemId);
 			if (result == null)
 			{
+				result = resolveRewrite(rewriteSystemList, systemId);
+			}
+			if (result == null)
+			{
+				result = resolveSuffix(suffixSystemList, systemId);
+			}
+			if (result == null)
+			{
+				result = resolveDelegateCatalogs(delegateSystemList, systemId, systemId); // systemId is the key for "startString"
+			}
+			if (result == null)
+			{
 				result = resolveSubordinateCatalogs(
 						ICatalogEntry.ENTRY_TYPE_SYSTEM, null, systemId);
 			}
 			return result;
 		}
 
+		private String resolveRewrite(List rewriteList, String searchString) 
+		{
+			for (Iterator it = rewriteList.iterator(); it.hasNext();) 
+			{
+				IRewriteEntry entry = (IRewriteEntry) it.next();
+				String startString = entry.getStartString();
+				if (searchString.startsWith(startString)) 
+				{
+					return entry.getRewritePrefix() + searchString.substring(startString.length());
+				}
+			}
+			return null;
+		}
+
+		private String resolveSuffix(List suffixList, String searchString) {
+			for (Iterator it = suffixList.iterator(); it.hasNext();) {
+				ISuffixEntry entry = (ISuffixEntry) it.next();
+				if (searchString.endsWith(entry.getSuffix())) {
+					return entry.getURI();
+				}
+			}
+			return null;
+		}
+
+		protected String resolveDelegateCatalogs(List delegateCatalogs, String key,
+				String systemId) throws MalformedURLException, IOException
+		{
+			String result = null;
+			for (Iterator iterator = delegateCatalogs.iterator(); iterator
+					.hasNext();) {
+				IDelegateCatalog delegate = (IDelegateCatalog) iterator.next();
+				
+				if (key.startsWith(delegate.getStartString())) {
+	
+					ICatalog catalog = delegate.getReferencedCatalog();
+					if (catalog != null)
+					{
+						switch (delegate.getEntryType())
+						{
+						case IDelegateCatalog.DELEGATE_TYPE_PUBLIC:
+							result = catalog.resolvePublic(key, systemId);
+							break;
+						case IDelegateCatalog.DELEGATE_TYPE_SYSTEM:
+							result = catalog.resolveSystem(systemId);
+							break;
+						case IDelegateCatalog.DELEGATE_TYPE_URI:
+							result = catalog.resolveURI(systemId);
+							break;
+						default:
+							break;
+						}
+						if (result != null)
+						{
+							return result;
+						}
+					}
+				}
+			}
+			return null;
+		}
+		
 		public String resolveURI(String uri) throws MalformedURLException,
 				IOException
 		{
 			String result = getMappedURI(uriMap, uri);
 			if (result == null)
 			{
+				result = resolveRewrite(rewriteUriList, uri);
+			}
+			if (result == null)
+			{
+				result = resolveSuffix(suffixUriList, uri);
+			}
+			if (result == null)
+			{
+				result = resolveDelegateCatalogs(delegateUriList, uri, uri); // uri is treated as the systemId
+			}
+			if (result == null)
+			{
 				result = resolveSubordinateCatalogs(
 						ICatalogEntry.ENTRY_TYPE_URI, null, uri);
 			}
@@ -213,21 +404,29 @@
 			InputStream inputStream = null;
 			try
 			{
-				URL url = new URL(location);
-				inputStream = url.openStream();
-				boolean oldNotificationEnabled = isNotificationEnabled();
-				setNotificationEnabled(false);
-				clear();
-				try
+				if (location != null && location.length() > 0) 
 				{
-					CatalogReader.read(Catalog.this, inputStream);
-				} finally
+					URL url = new URL(location);
+					inputStream = url.openStream();
+					boolean oldNotificationEnabled = isNotificationEnabled();
+					setNotificationEnabled(false);
+					clear();
+					try
+					{
+						CatalogReader.read(Catalog.this, inputStream);
+					} finally
+					{
+						setNotificationEnabled(oldNotificationEnabled);
+					}
+				}
+				else
 				{
-					setNotificationEnabled(oldNotificationEnabled);
+					clear();
 				}
 				notifyChanged();
 			} catch (Exception e)
 			{
+				// This is OK since the catalog may not exist before we create it
 			} finally
 			{
 				if (inputStream != null)
@@ -335,17 +534,28 @@
 		switch (type)
 		{
 		case ICatalogElement.TYPE_ENTRY:
-			return new CatalogEntry();
+			return new CatalogEntry(); // TODO: Should be kind of deprecated
 		case ICatalogElement.TYPE_NEXT_CATALOG:
 			return new NextCatalog();
 		case ICatalogEntry.ENTRY_TYPE_PUBLIC:
-			return new CatalogEntry(ICatalogEntry.ENTRY_TYPE_PUBLIC);
 		case ICatalogEntry.ENTRY_TYPE_SYSTEM:
-			return new CatalogEntry(ICatalogEntry.ENTRY_TYPE_SYSTEM);
 		case ICatalogEntry.ENTRY_TYPE_URI:
-			return new CatalogEntry(ICatalogEntry.ENTRY_TYPE_URI);
+			return new CatalogEntry(type);
+		case ICatalogElement.TYPE_REWRITE:	
+		case IRewriteEntry.REWRITE_TYPE_SYSTEM:
+		case IRewriteEntry.REWRITE_TYPE_URI:
+			return new RewriteEntry(type);
+		case ICatalogElement.TYPE_SUFFIX:	
+		case ISuffixEntry.SUFFIX_TYPE_SYSTEM:
+		case ISuffixEntry.SUFFIX_TYPE_URI:
+			return new SuffixEntry(type);
+		case ICatalogElement.TYPE_DELEGATE:	
+		case IDelegateCatalog.DELEGATE_TYPE_PUBLIC:
+		case IDelegateCatalog.DELEGATE_TYPE_SYSTEM:
+		case IDelegateCatalog.DELEGATE_TYPE_URI:
+			return new DelegateCatalog(type);
 		default:
-			return new CatalogElement(type);
+			throw new IllegalArgumentException("Unknown element type " + type);//$NON-NLS-1 // Makes no sense at all!
 		}
 	}
 
@@ -377,6 +587,27 @@
 				.toArray(new ICatalogEntry[result.size()]);
 	}
 
+	public IDelegateCatalog[] getDelegateCatalogs() 
+	{
+		List result = getCatalogElements(ICatalogElement.TYPE_DELEGATE);
+		return (IDelegateCatalog[]) result
+				.toArray(new IDelegateCatalog[result.size()]);
+	}
+	
+	public IRewriteEntry[] getRewriteEntries() 
+	{
+		List result = getCatalogElements(ICatalogElement.TYPE_REWRITE);
+		return (IRewriteEntry[]) result
+				.toArray(new IRewriteEntry[result.size()]);
+	}
+	
+	public ISuffixEntry[] getSuffixEntries() 
+	{
+		List result = getCatalogElements(ICatalogElement.TYPE_SUFFIX);
+		return (ISuffixEntry[]) result
+				.toArray(new ISuffixEntry[result.size()]);
+	}
+	
 	protected CatalogSet getCatalogSet()
 	{
 		return resourceSet;
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogElement.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogElement.java
index 1e51a04..ef86e22 100644
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogElement.java
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogElement.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
+ * Copyright (c) 2002, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     Jesper Steen Moller - jesper@selskabet.org - bug 112284
  *     
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.catalog;
@@ -30,6 +31,8 @@
 
 	String id;
 
+	String base;
+
 	Map attributes = new HashMap();
 
 	ICatalog ownerCatalog;
@@ -45,6 +48,16 @@
 		return type;
 	}
 
+	public String getBase()
+	{
+		return base;
+	}
+
+	public void setBase(String base)
+	{
+		this.base = base;
+	}
+
 	public String getAttributeValue(String name)
 	{
 		return (String) attributes.get(name);
@@ -117,6 +130,11 @@
 		{
 		}
 
+		if (this.base != null && !this.base.equals("")) //$NON-NLS-1$
+		{
+			return makeAbsolute(base, path);		
+		}
+		
 		String result = path;
 		Catalog catalog = (Catalog) getOwnerCatalog();
 		if (catalog != null)
@@ -148,6 +166,7 @@
 	    }
 		element.setOwnerCatalog(ownerCatalog);
 		element.setId(id);
+		element.setBase(base);
 	    return element;
 	  }
 
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogReader.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogReader.java
index bdb88d3..d53a15b 100644
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogReader.java
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogReader.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
+ * Copyright (c) 2002, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     Jesper Steen Moeller - Added XML Catalogs 1.1 support
  *     
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.catalog;
@@ -26,6 +27,9 @@
 import org.eclipse.wst.xml.core.internal.XMLCoreMessages;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.IDelegateCatalog;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.IRewriteEntry;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ISuffixEntry;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
@@ -43,6 +47,8 @@
     {
       SAXParserFactory factory = SAXParserFactory.newInstance();
       factory.setNamespaceAware(true);
+      factory.setValidating(false);
+      factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);//$NON-NLS-1$
       SAXParser parser = factory.newSAXParser();
       parser.parse(new InputSource(input), new CatalogContentHandler(xmlCatalog));
     }
@@ -72,111 +78,113 @@
 
     public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
     {
-      // set base
+      // set base attribute xml:base
       String base = attributes.getValue(OASISCatalogConstants.ATTR_BASE); //$NON-NLS-1$
       if (base != null && !base.equals("")) //$NON-NLS-1$
       {
-          baseURIStack.push(base);
+          // since the xml:base attribute can be relative to the enclosing element's effective base, we're maintaining a
+          // stack of absolute URIs
+		  if (URI.createURI(base).isRelative())
+          {
+            base = URI.resolveRelativeURI(base, baseURIStack.peek().toString());
+          }
+
+          baseURIStack.push(URIHelper.ensureURIProtocolFormat(base));
       } else {
     	  baseURIStack.push(baseURIStack.peek());
       }
 
-	  // processing for backward compatability start
+	  // processing for backward compatibility start
 	  if (localName.equals(CompatabilityConstants.TAG_USER_ENTRY))
       {
-		int type = ICatalogEntry.ENTRY_TYPE_PUBLIC;
         String typeName = attributes.getValue("", CompatabilityConstants.ATT_TYPE); //$NON-NLS-1$
+        boolean isSystem = false;
         if (typeName != null)
         {
-          if (typeName.compareToIgnoreCase("SYSTEM") == 0) //$NON-NLS-1$
-          {
-            type = ICatalogEntry.ENTRY_TYPE_SYSTEM;
-          }
+        	isSystem = (typeName.compareToIgnoreCase("SYSTEM") == 0); //$NON-NLS-1$
         }
-		  ICatalogElement catalogElement = catalog.createCatalogElement(type);
-	      if (catalogElement instanceof CatalogEntry)
-	      {
-	        CatalogEntry catalogEntry = (CatalogEntry) catalogElement;
-		    String key = attributes.getValue("", CompatabilityConstants.ATT_ID);   		     //$NON-NLS-1$
-	        catalogEntry.setKey(key);
-	        String entryUri = attributes.getValue("", CompatabilityConstants.ATT_URI);    //$NON-NLS-1$
-	        
-	        // For relative URIs, try to resolve them using the corresponding base URI.
-	        if(URI.createURI(entryUri).isRelative()) {
-	        	entryUri = URI.resolveRelativeURI(entryUri, baseURIStack.peek().toString());
-	        }
+        ICatalogEntry catalogEntry = new CatalogEntry(isSystem ? ICatalogEntry.ENTRY_TYPE_SYSTEM : ICatalogEntry.ENTRY_TYPE_PUBLIC);
+        catalogEntry.setKey(attributes.getValue("", CompatabilityConstants.ATT_ID)); //$NON-NLS-1$
+        String entryUri = attributes.getValue("", CompatabilityConstants.ATT_URI); //$NON-NLS-1$
+        
+        // For relative URIs, try to resolve them using the corresponding base URI.
+        catalogEntry.setURI(resolveRelative(entryUri));
 
-	        catalogEntry.setURI(URIHelper.ensureURIProtocolFormat(entryUri));  
-	        String webURL = attributes.getValue("", CompatabilityConstants.ATT_WEB_URL); //$NON-NLS-1$
-			if (webURL != null)
-			{
-				catalogEntry.setAttributeValue(
-						ICatalogEntry.ATTR_WEB_URL, webURL);
-			}
-	      }
-		  catalog.addCatalogElement(catalogElement);
-		  return;
+        String webURL = attributes.getValue("", CompatabilityConstants.ATT_WEB_URL); //$NON-NLS-1$
+        if (webURL != null)
+        {
+        	catalogEntry.setAttributeValue(
+        			ICatalogEntry.ATTR_WEB_URL, webURL);
+        }
+		catalog.addCatalogElement(catalogEntry);
+		return;
       }
-	  //  processing for backward compatability start
-      
-	  int type = ICatalogEntry.ENTRY_TYPE_PUBLIC;
-	  String key = null;
-	 //dw String catalogId = attributes.getValue("", OASISCatalogConstants.ATTR_ID);
+	  //  processing for backward compatibility end
+	  ICatalogElement catalogElement = null;
+
       if (OASISCatalogConstants.TAG_PUBLIC.equals(localName))
       {
-        key = attributes.getValue("", OASISCatalogConstants.ATTR_PUBLIC_ID); //$NON-NLS-1$
+    	  // 6.5.3. The public Entry
+    	  catalogElement = createEntry(attributes, ICatalogEntry.ENTRY_TYPE_PUBLIC, OASISCatalogConstants.ATTR_PUBLIC_ID);
       }
       else if (OASISCatalogConstants.TAG_SYSTEM.equals(localName))
       {
-        key = attributes.getValue("", OASISCatalogConstants.ATTR_SYSTEM_ID); //$NON-NLS-1$
-        type = ICatalogEntry.ENTRY_TYPE_SYSTEM;
+    	  // 6.5.4. The system Element
+    	  catalogElement = createEntry(attributes, ICatalogEntry.ENTRY_TYPE_SYSTEM, OASISCatalogConstants.ATTR_SYSTEM_ID);
       }
       else if (OASISCatalogConstants.TAG_URI.equals(localName))
       {
-        key = attributes.getValue("", OASISCatalogConstants.ATTR_NAME); //$NON-NLS-1$
-        type = ICatalogEntry.ENTRY_TYPE_URI;
+    	  // 6.5.9. The uri Element
+    	  catalogElement = createEntry(attributes, ICatalogEntry.ENTRY_TYPE_URI, OASISCatalogConstants.ATTR_NAME);
+      }
+      else if (OASISCatalogConstants.TAG_REWRITE_SYSTEM.equals(localName))
+      {
+    	  // 6.5.5. The rewriteSystem Element
+    	  catalogElement = createRewrite(attributes, IRewriteEntry.REWRITE_TYPE_SYSTEM, OASISCatalogConstants.ATTR_SYSTEM_ID_START_STRING);
+      }
+      else if (OASISCatalogConstants.TAG_REWRITE_URI.equals(localName))
+      {
+    	  // 6.5.9. The uri Element
+    	  catalogElement = createRewrite(attributes, IRewriteEntry.REWRITE_TYPE_URI, OASISCatalogConstants.ATTR_URI_START_STRING);
+      }
+      else if (OASISCatalogConstants.TAG_DELEGATE_PUBLIC.equals(localName))
+      {
+    	  // 6.5.7. The delegatePublic Element
+    	  catalogElement = createDelegate(attributes, IDelegateCatalog.DELEGATE_TYPE_PUBLIC, OASISCatalogConstants.ATTR_PUBLIC_ID_START_STRING);
+      }
+      else if (OASISCatalogConstants.TAG_DELEGATE_SYSTEM.equals(localName))
+      {
+    	  // 6.5.8. The delegateSystem Element
+    	  catalogElement = createDelegate(attributes, IDelegateCatalog.DELEGATE_TYPE_SYSTEM, OASISCatalogConstants.ATTR_SYSTEM_ID_START_STRING);
+      }
+      else if (OASISCatalogConstants.TAG_DELEGATE_URI.equals(localName))
+      {
+    	  // 6.5.12. The delegateURI Element
+    	  catalogElement = createDelegate(attributes, IDelegateCatalog.DELEGATE_TYPE_URI, OASISCatalogConstants.ATTR_URI_START_STRING);
+      }
+      else if (OASISCatalogConstants.TAG_SYSTEM_SUFFIX.equals(localName))
+      {
+    	  // 6.5.6. The systemSuffix Element
+    	  catalogElement = createSuffix(attributes, ISuffixEntry.SUFFIX_TYPE_SYSTEM, OASISCatalogConstants.ATTR_SYSTEM_ID_SUFFFIX);
+      }
+      else if (OASISCatalogConstants.TAG_URI_SUFFIX.equals(localName))
+      {
+    	  // 6.5.11. The uriSuffix Element
+    	  catalogElement = createSuffix(attributes, ISuffixEntry.SUFFIX_TYPE_URI, OASISCatalogConstants.ATTR_URI_SUFFIX);
       }
       else if (OASISCatalogConstants.TAG_NEXT_CATALOG.equals(localName))
       {
-        String nextCatalogId = attributes.getValue("", OASISCatalogConstants.ATTR_ID); //$NON-NLS-1$
-
-        String location = attributes.getValue("", OASISCatalogConstants.ATTR_CATALOG);    //$NON-NLS-1$
-        NextCatalog delegate = new NextCatalog();
-        delegate.setCatalogLocation(location);  
-        delegate.setId(nextCatalogId);
-        catalog.addCatalogElement(delegate);
+        catalogElement = createNextCatalog(attributes);
+      }
+      
+      if (catalogElement == null)
+      {
+    	// do not set the extra information
         return;
       }
-      else{
-    	  // do not handle other entries
-    	  return;
-      }
-      if (key == null || key.equals("")) //$NON-NLS-1$
-      {
-        Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_entry_key_not_set);
-        return;
-      }
-      String entryURI = attributes.getValue("", OASISCatalogConstants.ATTR_URI); // mandatory //$NON-NLS-1$
-      if (entryURI == null || entryURI.equals("")) //$NON-NLS-1$
-      {
-        Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_entry_uri_not_set);
-        return;
-      }
- 
-      ICatalogElement catalogElement = catalog.createCatalogElement(type);
-      if (catalogElement instanceof CatalogEntry)
-      {
-        CatalogEntry catalogEntry = (CatalogEntry) catalogElement;
-        catalogEntry.setKey(key); 
 
-        //      For relative URIs, try to resolve them using the corresponding base URI.
-        if(URI.createURI(entryURI).isRelative()) {
-        	entryURI = URI.resolveRelativeURI(entryURI, baseURIStack.peek().toString());
-        } 
-
-        catalogEntry.setURI(URIHelper.ensureURIProtocolFormat(entryURI));     
-
-      }
+	  String attrId = attributes.getValue("", OASISCatalogConstants.ATTR_ID);//$NON-NLS-1$
+	  if (attrId != null && ! "".equals(attrId)) catalogElement.setId(attrId);//$NON-NLS-1$
       // process any other attributes
       for (int j = 0; j < attributes.getLength(); j++)
       {
@@ -196,6 +204,99 @@
 
     }
 
+	private ICatalogElement createNextCatalog(Attributes attributes) {
+		String location = attributes.getValue("", OASISCatalogConstants.ATTR_CATALOG);    //$NON-NLS-1$
+        NextCatalog delegate = new NextCatalog();
+        delegate.setBase((String)baseURIStack.peek());
+        delegate.setCatalogLocation(location);  
+		return delegate;
+	}
+
+    private ICatalogEntry createEntry(Attributes attributes, int entryType, String keyAttributeName) {
+    	String key = attributes.getValue("", keyAttributeName); //$NON-NLS-1$
+    	if (key == null || key.equals("")) //$NON-NLS-1$
+    	{
+    		Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_entry_key_not_set);
+    		return null;
+    	}
+    	String entryURI = attributes.getValue("", OASISCatalogConstants.ATTR_URI); //$NON-NLS-1$
+    	if (entryURI == null || entryURI.equals("")) //$NON-NLS-1$
+    	{
+    		Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_entry_uri_not_set);
+    		return null;
+    	}
+    	CatalogEntry entry = new CatalogEntry(entryType);
+    	entry.setKey(key);
+    	entry.setURI(resolveRelative(entryURI));
+    	return entry;
+    }
+
+    private IRewriteEntry createRewrite(Attributes attributes, int entryType, String prefixStringName) {
+    	String startString = attributes.getValue("", prefixStringName); //$NON-NLS-1$
+    	if (startString == null || startString.equals("")) //$NON-NLS-1$
+    	{
+    		Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_rewrite_startString_not_set);
+    		return null;
+    	}
+    	String prefix = attributes.getValue("", OASISCatalogConstants.ATTR_REWRITE_PREFIX); //$NON-NLS-1$
+    	if (prefix == null || prefix.equals("")) //$NON-NLS-1$
+    	{
+    		Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_rewrite_prefix_not_set);
+    		return null;
+    	}
+    	RewriteEntry entry = new RewriteEntry(entryType);
+    	entry.setStartString(startString);
+    	entry.setRewritePrefix(resolveRelative(prefix));
+    	return entry;
+    }
+
+    private IDelegateCatalog createDelegate(Attributes attributes, int entryType, String startStringAttrName) {
+    	String startString = attributes.getValue("", startStringAttrName); //$NON-NLS-1$
+    	if (startString == null || startString.equals("")) //$NON-NLS-1$
+    	{
+    		Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_delegate_prefix_not_set);
+    		return null;
+    	}
+    	String catalogUri = attributes.getValue("", OASISCatalogConstants.ATTR_CATALOG); //$NON-NLS-1$
+    	if (catalogUri == null || catalogUri.equals("")) //$NON-NLS-1$
+    	{
+    		Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_delegate_prefix_not_set);
+    		return null;
+    	}
+    	DelegateCatalog entry = new DelegateCatalog(entryType);
+    	entry.setStartString(startString);
+    	entry.setCatalogLocation(catalogUri);
+    	return entry;
+    }
+
+    private ISuffixEntry createSuffix(Attributes attributes, int entryType, String suffixAttrName) {
+    	String suffix = attributes.getValue("", suffixAttrName); //$NON-NLS-1$
+    	if (suffix == null || suffix.equals("")) //$NON-NLS-1$
+    	{
+    		Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_suffix_string_not_set);
+    		return null;
+    	}
+    	String uri = attributes.getValue("", OASISCatalogConstants.ATTR_URI); //$NON-NLS-1$
+    	if (uri == null || uri.equals("")) //$NON-NLS-1$
+    	{
+    		Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_suffix_uri_not_set);
+    		return null;
+    	}
+    	SuffixEntry entry = new SuffixEntry(entryType);
+    	entry.setSuffix(suffix);
+    	entry.setURI(resolveRelative(uri));
+    	return entry;
+    }
+
+	private String resolveRelative(String entryURI) 
+	{
+		if(URI.createURI(entryURI).isRelative()) 
+		{
+        	entryURI = URI.resolveRelativeURI(entryURI, baseURIStack.peek().toString());
+        }
+		return URIHelper.ensureURIProtocolFormat(entryURI);
+	}
+
     public void endElement(String uri, String localName, String qName) throws SAXException
     {
       if (baseURIStack.size() > 0)
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogWriter.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogWriter.java
index 1cf4de2..30d5169 100644
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogWriter.java
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogWriter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
+ * Copyright (c) 2002, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -29,8 +29,12 @@
 
 import org.eclipse.wst.xml.core.internal.Logger;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.IDelegateCatalog;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.IRewriteEntry;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ISuffixEntry;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
@@ -44,9 +48,17 @@
 
   public void write(ICatalog xmlCatalog, String uri) throws FileNotFoundException, IOException
   {
-    visitCatalog(xmlCatalog);
-    OutputStream outputStream = getOutputStream(uri);
-    serialize(outputStream);
+	OutputStream outputStream = null;
+	try {
+      visitCatalog(xmlCatalog);
+      outputStream = getOutputStream(uri);
+      serialize(outputStream);
+	}
+	finally {
+	  if(outputStream != null) {
+		outputStream.close();
+	  }
+	}
   }
 
   public void write(ICatalog catalog, OutputStream os) throws FileNotFoundException, IOException
@@ -74,6 +86,137 @@
     doc.appendChild(catalogElement);
     processCatalogEntries(xmlCatalog, catalogElement);
     processNextCatalogs(xmlCatalog, catalogElement);
+    processDelegateCatalogs(xmlCatalog, catalogElement);
+    processSuffixEntries(xmlCatalog, catalogElement);
+    processRewriteEntries(xmlCatalog, catalogElement);
+  }
+
+  private void processRewriteEntries(ICatalog catalog, Element parent)
+  {
+    IRewriteEntry[] catalogEntries = catalog.getRewriteEntries();
+    
+    for (int i = 0; i < catalogEntries.length; i++)
+    {
+      IRewriteEntry entry = catalogEntries[i];
+      String startString = entry.getStartString();
+      String prefix = entry.getRewritePrefix();
+	  Element childElement = null;
+	 
+     switch (entry.getEntryType())
+      {
+        case IRewriteEntry.REWRITE_TYPE_SYSTEM :
+          childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_REWRITE_SYSTEM);
+          if (childElement != null)
+          {
+            childElement.setAttribute(OASISCatalogConstants.ATTR_SYSTEM_ID_START_STRING, startString);
+            childElement.setAttribute(OASISCatalogConstants.ATTR_REWRITE_PREFIX, prefix);
+          }
+          break;
+        case IRewriteEntry.REWRITE_TYPE_URI:
+          childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_REWRITE_URI);
+          if (childElement != null)
+          {
+	            childElement.setAttribute(OASISCatalogConstants.ATTR_URI_START_STRING, startString);
+	            childElement.setAttribute(OASISCatalogConstants.ATTR_REWRITE_PREFIX, prefix);
+          }
+          break;
+        default :
+          break;
+      }
+      if (childElement != null)
+      {
+        setAttributes(entry, childElement);
+        parent.appendChild(childElement);
+      }
+    }
+  }
+
+  private void processSuffixEntries(ICatalog catalog, Element parent)
+  {
+    ISuffixEntry[] suffixEntries = catalog.getSuffixEntries();
+    
+    for (int i = 0; i < suffixEntries.length; i++)
+    {
+      ISuffixEntry entry = suffixEntries[i];
+      String suffixString = entry.getSuffix();
+      String uri = entry.getURI();
+	  Element childElement = null;
+	 
+     switch (entry.getEntryType())
+      {
+        case ISuffixEntry.SUFFIX_TYPE_SYSTEM :
+          childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_SYSTEM_SUFFIX);
+          if (childElement != null)
+          {
+            childElement.setAttribute(OASISCatalogConstants.ATTR_SYSTEM_ID_SUFFFIX, suffixString);
+            childElement.setAttribute(OASISCatalogConstants.ATTR_URI, uri);
+          }
+          break;
+        case ISuffixEntry.SUFFIX_TYPE_URI:
+          childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_URI_SUFFIX);
+          if (childElement != null)
+          {
+	            childElement.setAttribute(OASISCatalogConstants.ATTR_URI_SUFFIX, suffixString);
+	            childElement.setAttribute(OASISCatalogConstants.ATTR_URI, uri);
+          }
+          break;
+        default :
+          break;
+      }
+      if (childElement != null)
+      {
+        setAttributes(entry, childElement);
+        parent.appendChild(childElement);
+      }
+    }
+  }
+
+  private void processDelegateCatalogs(ICatalog catalog, Element parent)
+  {
+    IDelegateCatalog[] delegateCatalogs = catalog.getDelegateCatalogs();
+
+    for (int i = 0; i < delegateCatalogs.length; i++)
+    {
+      IDelegateCatalog entry = delegateCatalogs[i];
+      String prefixString = entry.getStartString();
+      String catalogLocation = entry.getCatalogLocation();
+      Element childElement = null;
+
+      switch (entry.getEntryType())
+      {
+      case IDelegateCatalog.DELEGATE_TYPE_PUBLIC:
+        childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_DELEGATE_PUBLIC);
+        if (childElement != null)
+        {
+          childElement.setAttribute(OASISCatalogConstants.ATTR_PUBLIC_ID_START_STRING, prefixString);
+          childElement.setAttribute(OASISCatalogConstants.ATTR_CATALOG, catalogLocation);
+        }
+        break;
+      case IDelegateCatalog.DELEGATE_TYPE_SYSTEM:
+        childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_DELEGATE_SYSTEM);
+        if (childElement != null)
+        {
+          childElement.setAttribute(OASISCatalogConstants.ATTR_SYSTEM_ID_START_STRING, prefixString);
+          childElement.setAttribute(OASISCatalogConstants.ATTR_CATALOG, catalogLocation);
+        }
+        break;
+      case IDelegateCatalog.DELEGATE_TYPE_URI:
+        childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_DELEGATE_URI);
+        if (childElement != null)
+        {
+          childElement.setAttribute(OASISCatalogConstants.ATTR_URI_START_STRING, prefixString);
+          childElement.setAttribute(OASISCatalogConstants.ATTR_CATALOG, catalogLocation);
+        }
+        break;
+      default :
+        break;
+      }
+      if (childElement != null)
+      {
+        setAttributes(entry, childElement);
+        parent.appendChild(childElement);
+      }
+    }
   }
 
   private void processCatalogEntries(ICatalog catalog, Element parent)
@@ -85,10 +228,9 @@
       ICatalogEntry entry = catalogEntries[i];
       String key = entry.getKey();
       String uri = entry.getURI();
-	  String id = entry.getId();
-	  Element childElement = null;
+      Element childElement = null;
 	 
-     switch (entry.getEntryType())
+      switch (entry.getEntryType())
       {
         case ICatalogEntry.ENTRY_TYPE_PUBLIC :
           childElement = parent.getOwnerDocument().createElement(OASISCatalogConstants.TAG_PUBLIC);
@@ -117,30 +259,36 @@
         default :
           break;
       }
-	  if(childElement != null && id != null && !id.equals("")){ //$NON-NLS-1$
-		  childElement.setAttribute(OASISCatalogConstants.ATTR_ID, id);
-	  }
-      
-      String[] attributes = entry.getAttributes();   
-      for (int j = 0; j < attributes.length; j++)
-      {
-        String attrName = attributes[j];
-        if (attrName != null && !attrName.equals("")) //$NON-NLS-1$
-        {
-		  String attrValue = entry.getAttributeValue(attrName);
-          if (childElement != null && attrValue != null)
-          {
-            childElement.setAttribute(attrName, attrValue);
-          }
-        }
-      }
       if (childElement != null)
       {
+    	  setAttributes(entry, childElement);
         parent.appendChild(childElement);
       }
     }
   }
 
+  private void setAttributes(ICatalogElement entry, Element childElement)
+  {
+    String[] attributes = entry.getAttributes();   
+    for (int j = 0; j < attributes.length; j++)
+    {
+      String attrName = attributes[j];
+      if (attrName != null && !attrName.equals("")) //$NON-NLS-1$
+      {
+        String attrValue = entry.getAttributeValue(attrName);
+        if (childElement != null && attrValue != null)
+        {
+          childElement.setAttribute(attrName, attrValue);
+        }
+      }
+    }
+    String id = entry.getId();
+    if (id != null)
+    {
+      childElement.setAttribute(OASISCatalogConstants.ATTR_ID, id);
+    }
+  }
+
   private void processNextCatalogs(ICatalog catalog, Element parent)
   {
     // handle catalog entries
@@ -159,11 +307,7 @@
         {
           childElement.setAttribute(OASISCatalogConstants.ATTR_CATALOG, location);
         }
-		 String id = delegate.getId();
-		 if (id != null)
-		 {
-			 childElement.setAttribute(OASISCatalogConstants.ATTR_ID, id);
-		 }
+        setAttributes(delegate, childElement);
       }
     }
   }
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/DelegateCatalog.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/DelegateCatalog.java
new file mode 100644
index 0000000..57e729b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/DelegateCatalog.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Jesper Steen Moeller
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Jesper Steen Moeller - Added XML Catalogs 1.1 support
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.catalog;
+
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.IDelegateCatalog;
+
+
+
+public class DelegateCatalog extends TypedCatalogElement implements IDelegateCatalog
+{
+  private String location;
+  private ICatalog referencedCatalog;
+  private String startString; 
+
+  public String getStartString() 
+  {
+    return startString;
+  }
+
+  public void setStartString(String startString) 
+  {
+    this.startString = startString;
+  }
+
+  public DelegateCatalog(int type)
+  {
+    super(ICatalogElement.TYPE_DELEGATE, type);
+  }
+
+  public String getCatalogLocation()
+  {
+    return location;
+  }
+
+  public ICatalog getReferencedCatalog()
+  {
+    if (referencedCatalog == null)
+    {
+      referencedCatalog = ((Catalog)ownerCatalog).getCatalogSet().lookupOrCreateCatalog(getId(), getAbsolutePath(location));
+    }
+    return referencedCatalog;
+  }
+
+  public void setCatalogLocation(String uri)
+  {
+    location = uri;
+    referencedCatalog = null;
+  }
+
+  public Object clone()
+  {
+    DelegateCatalog nextCatalog = (DelegateCatalog)super.clone();
+    nextCatalog.setCatalogLocation(location);
+    nextCatalog.setStartString(startString);
+    return nextCatalog;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/OASISCatalogConstants.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/OASISCatalogConstants.java
index a3c578a..d716a62 100644
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/OASISCatalogConstants.java
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/OASISCatalogConstants.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
+ * Copyright (c) 2002, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,76 +8,89 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     Jesper Steen Moeller - Added XML Catalogs 1.1 support
  *     
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.catalog;
 
 public interface OASISCatalogConstants
 {
-  public static final String namespaceName = "urn:oasis:names:tc:entity:xmlns:xml:catalog"; //$NON-NLS-1$
+  String namespaceName = "urn:oasis:names:tc:entity:xmlns:xml:catalog"; //$NON-NLS-1$
   /** Types of the catalog entries */
   /** The CATALOG element name. */
-  public static final String TAG_CATALOG = "catalog"; //$NON-NLS-1$
+  String TAG_CATALOG = "catalog"; //$NON-NLS-1$
   /** The GROUP catalog entry. */
-  public static final String TAG_GROUP = "group"; //$NON-NLS-1$
+  String TAG_GROUP = "group"; //$NON-NLS-1$
   /** The PUBLIC catalog entry. */
-  public static final String TAG_PUBLIC = "public"; //$NON-NLS-1$
+  String TAG_PUBLIC = "public"; //$NON-NLS-1$
   /** The SYSTEM catalog etnry. */
-  public static final String TAG_SYSTEM = "system"; //$NON-NLS-1$
+  String TAG_SYSTEM = "system"; //$NON-NLS-1$
   /** The URI catalog entry. */
-  public static final String TAG_URI = "uri"; //$NON-NLS-1$
+  String TAG_URI = "uri"; //$NON-NLS-1$
   /** The REWRITE_SYSTEM catalog entry. */
-  public static final String TAG_REWRITE_SYSTEM = "rewriteSystem"; //$NON-NLS-1$
+  String TAG_REWRITE_SYSTEM = "rewriteSystem"; //$NON-NLS-1$
   /** The REWRITE_URI catalog entry. */
-  public static final String TAG_REWRITE_URI = "rewritePublic"; //$NON-NLS-1$
+  String TAG_REWRITE_URI = "rewriteURI"; //$NON-NLS-1$
+  /** The systemSuffix catalog entry. */
+  String TAG_SYSTEM_SUFFIX = "systemSuffix"; //$NON-NLS-1$
+  /** The uriSuffix catalog entry. */
+  String TAG_URI_SUFFIX = "uriSuffix"; //$NON-NLS-1$
   /** The DELEGATE_PUBLIC catalog entry. */
-  public static final String TAG_DELEGATE_PUBLIC = "delegatePublic"; //$NON-NLS-1$
+  String TAG_DELEGATE_PUBLIC = "delegatePublic"; //$NON-NLS-1$
   /** The DELEGATE_SYSTEM catalog entry. */
-  public static final String TAG_DELEGATE_SYSTEM = "delegateSystem"; //$NON-NLS-1$
+  String TAG_DELEGATE_SYSTEM = "delegateSystem"; //$NON-NLS-1$
   /** The DELEGATE_URI catalog entry. */
-  public static final String TAG_DELEGATE_URI = "delegateUri"; //$NON-NLS-1$
+  String TAG_DELEGATE_URI = "delegateURI"; //$NON-NLS-1$
   /** The NEXT_CATALOG catalog entry. */
-  public static final String TAG_NEXT_CATALOG = "nextCatalog"; //$NON-NLS-1$
+  String TAG_NEXT_CATALOG = "nextCatalog"; //$NON-NLS-1$
   /** Attributes */
   /** Attribute id used in all catalog entries */
-  public static final String ATTR_ID = "id"; //$NON-NLS-1$
+  String ATTR_ID = "id"; //$NON-NLS-1$
   /** Attribute id base in all catalog entries */
-  public static final String ATTR_BASE = "xml:base"; //$NON-NLS-1$
-  /** Attribute id prefere in catalog entries: CATALOG, GROUP */
-  public static final String ATTR_PREFERE = "prefere"; //$NON-NLS-1$
+  String ATTR_BASE = "xml:base"; //$NON-NLS-1$
+  /** Attribute id prefer in catalog entries: CATALOG, GROUP */
+  String ATTR_PREFERE = "prefer"; //$NON-NLS-1$
   /** Attribute used in catalog entries of type: PUBLIC */
-  public static final String ATTR_PUBLIC_ID = "publicId"; //$NON-NLS-1$
+  String ATTR_PUBLIC_ID = "publicId"; //$NON-NLS-1$
   /**
    * Attribute used in catalog entries of type: SYSTEM
    */
-  public static final String ATTR_SYSTEM_ID = "systemId"; //$NON-NLS-1$
+  String ATTR_SYSTEM_ID = "systemId"; //$NON-NLS-1$
+  /**
+   * Attribute used in catalog entries of type: SYSTEM_SUFFIX
+   */
+  String ATTR_SYSTEM_ID_SUFFFIX = "systemIdSuffix"; //$NON-NLS-1$
   /**
    * Attribute used in catalog entries of type: URI
    */
-  public static final String ATTR_NAME = "name"; //$NON-NLS-1$
+  String ATTR_NAME = "name"; //$NON-NLS-1$
   /**
    * Attribute used in catalog entries of type: PUBLIC, URI
    */
-  public static final String ATTR_URI = "uri"; //$NON-NLS-1$
+  String ATTR_URI = "uri"; //$NON-NLS-1$
+  /**
+   * Attribute used in catalog entries of type: URI_SUFFIX
+   */
+  String ATTR_URI_SUFFIX = "uriSuffix"; //$NON-NLS-1$
   /**
    * Attribute used in catalog entries of type: REWRITE_SYSTEM, DELEGATE_SYSTEM
    */
-  public static final String ATTR_SYSTEM_ID_START_STRING = "systemIdStartString"; //$NON-NLS-1$
+  String ATTR_SYSTEM_ID_START_STRING = "systemIdStartString"; //$NON-NLS-1$
   /**
    * Attribute used in catalog entries of type: REWRITE_SYSTEM, REWRITE_URI
    */
-  public static final String ATTR_REWRITE_PREFIX = "rewritePrefix"; //$NON-NLS-1$
+  String ATTR_REWRITE_PREFIX = "rewritePrefix"; //$NON-NLS-1$
   /**
    * Attribute used in catalog entries of type: DELEGATE_PUBLIC
    */
-  public static final String ATTR_PUBLIC_ID_START_STRING = "publicIdStartString"; //$NON-NLS-1$
+  String ATTR_PUBLIC_ID_START_STRING = "publicIdStartString"; //$NON-NLS-1$
   /**
    * Attribute used in catalog entries of type: DELEGATE_PUBLIC,
    * DELEGATE_SYSTEM, DELEGATE_URI, NEXT_CATALOG
    */
-  public static final String ATTR_CATALOG = "catalog"; //$NON-NLS-1$
+  String ATTR_CATALOG = "catalog"; //$NON-NLS-1$
   /**
    * Attribute used in catalog entries of type: REWRITE_URI, DELEGATE_URI
    */
-  public static final String ATTR_URI_START_STRING = "uriStartString"; //$NON-NLS-1$
+  String ATTR_URI_START_STRING = "uriStartString"; //$NON-NLS-1$
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/RewriteEntry.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/RewriteEntry.java
new file mode 100644
index 0000000..5d9590e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/RewriteEntry.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Jesper Steen Moeller
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Jesper Steen Moeller - Added XML Catalogs 1.1 support
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.catalog;
+
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.IRewriteEntry;
+
+public class RewriteEntry extends TypedCatalogElement implements IRewriteEntry, Cloneable 
+{
+	String startString;
+	String rewritePrefix;
+
+	protected RewriteEntry(int anEntryType) 
+	{
+		super(ICatalogElement.TYPE_REWRITE, anEntryType);
+	}
+
+	public String getStartString() 
+	{
+		return startString;
+	}
+
+	public void setStartString(String startString) 
+	{
+		this.startString = startString;
+	}
+
+	public String getRewritePrefix() 
+	{
+		return rewritePrefix;
+	}
+
+	public void setRewritePrefix(String rewritePrefix) 
+	{
+		this.rewritePrefix = rewritePrefix;
+	}
+
+	public Object clone() 
+	{
+		RewriteEntry entry = (RewriteEntry) super.clone();
+		entry.setRewritePrefix(rewritePrefix);
+		entry.setStartString(startString);
+		return entry;
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/SuffixEntry.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/SuffixEntry.java
new file mode 100644
index 0000000..f9daaa5
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/SuffixEntry.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Jesper Steen Moeller
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Jesper Steen Moeller - Added XML Catalogs 1.1 support
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.catalog;
+
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ISuffixEntry;
+
+public class SuffixEntry extends TypedCatalogElement implements ISuffixEntry, Cloneable
+{
+  String suffix;
+  String uri;
+
+  protected SuffixEntry(int anEntryType)
+  {
+    super(ICatalogElement.TYPE_SUFFIX, anEntryType);
+  }
+
+  public void setSuffix(String value)
+  {
+    suffix = value;
+  }
+
+  public String getSuffix()
+  {
+    return suffix;
+  }
+
+  public String getURI()
+  {
+    return uri;
+  }
+  
+  public void setURI(String value)
+  {
+    uri = value;
+  }
+
+  public Object clone()
+  {
+    SuffixEntry entry = (SuffixEntry)super.clone();
+    entry.setSuffix(suffix);
+    entry.setURI(uri);
+    return entry;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/TypedCatalogElement.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/TypedCatalogElement.java
new file mode 100644
index 0000000..8592d6b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/TypedCatalogElement.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Jesper Steen Moeller
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Jesper Steen Moeller - Added XML Catalogs 1.1 support
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.catalog;
+
+
+public class TypedCatalogElement extends CatalogElement 
+{
+	protected int entryType;
+
+	public TypedCatalogElement(int type, int entryType) 
+	{
+		super(type);
+		this.entryType = entryType;
+	}
+
+	final public void setEntryType(int value) 
+	{
+	    entryType = value;
+	}
+
+	final public int getEntryType() 
+	{
+	    return entryType;
+	}
+	
+	public Object clone() 
+	{
+		TypedCatalogElement temp = (TypedCatalogElement)super.clone();
+		temp.setEntryType(this.getEntryType());
+		return temp;
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalog.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalog.java
index 0637a3c..6796b74 100644
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalog.java
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalog.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
+ * Copyright (c) 2002, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     Jesper Steen Moeller - Added XML Catalogs 1.1 support
  *     
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.catalog.provisional;
@@ -32,29 +33,29 @@
      * 
      * @return catalog id string
      */
-    public String getId();
+    String getId();
     
     /**
      * Sets catalog id string
      * 
      */
-    public void setId(String id);
+    void setId(String id);
     
     
-    public void setLocation(String location);
-    public String getLocation();
+    void setLocation(String location);
+    String getLocation();
     
     /**
-     * Return the applicable PUBLIC or SYSTEM identifier.
+     * Return the applicable or SYSTEM identifier.
      * 
      * <p>
      * This method searches the Catalog and returns the system identifier
-     * specified for the given system or public identifiers. If no appropriate
-     * PUBLIC or SYSTEM entry is found in the Catalog, null is returned.
+     * specified for the given system or identifiers. If no appropriate
+     * or SYSTEM entry is found in the Catalog, null is returned.
      * </p>
      * 
      * @param publicId
-     *            The public identifier to locate in the catalog. Public
+     *            The identifier to locate in the catalog. Public
      *            identifiers are normalized before comparison.
      * @param systemId
      *            The nominal system identifier for the entity in question (as
@@ -71,7 +72,7 @@
      *         catalog, instead null is returned to indicate that no match was
      *         found.
      */
-    public String resolvePublic(String publicId, String systemId)
+    String resolvePublic(String publicId, String systemId)
             throws MalformedURLException, IOException;
 
     /**
@@ -99,7 +100,7 @@
      * @throws IOException
      *             Error reading subordinate catalog file.
      */
-    public String resolveSystem(String systemId) throws MalformedURLException,
+    String resolveSystem(String systemId) throws MalformedURLException,
             IOException;
 
     /**
@@ -125,7 +126,7 @@
      * @throws IOException
      *             Error reading subordinate catalog file.
      */
-    public String resolveURI(String uri) throws MalformedURLException,
+    String resolveURI(String uri) throws MalformedURLException,
             IOException;
 
     /**
@@ -134,7 +135,7 @@
      * @param element -
      *            catalog element
      */
-    public void addCatalogElement(ICatalogElement element);
+    void addCatalogElement(ICatalogElement element);
 
     /**
      * Removes catalog element from the collection of the catalog elements.
@@ -142,14 +143,35 @@
      * @param element -
      *            catalog element
      */
-    public void removeCatalogElement(ICatalogElement element);
+    void removeCatalogElement(ICatalogElement element);
 
     /**
      * Returns an array of catalog elements of type ICatalogElement.TYPE_ENTRY
      * 
      * @return an array of catalog elements
      */
-    public ICatalogEntry[] getCatalogEntries();
+    ICatalogEntry[] getCatalogEntries();
+
+    /**
+     * Returns an array of catalog elements of type ICatalogElement.TYPE_REWRITE
+     * 
+     * @return an array of rewrite catalog elements
+     */
+    IRewriteEntry[] getRewriteEntries();
+
+    /**
+     * Returns an array of catalog elements of type ICatalogElement.TYPE_SUFFIX
+     * 
+     * @return an array of suffix entry elements
+     */
+    ISuffixEntry[] getSuffixEntries();
+
+    /**
+     * Returns an array of catalog elements of type ICatalogElement.TYPE_DELEGATE
+     * 
+     * @return an array of delegate catalog elements
+     */
+    IDelegateCatalog[] getDelegateCatalogs();
 
     /**
      * Returns an array of catalog elements of type
@@ -157,7 +179,7 @@
      * 
      * @return an array of catalog elements
      */
-    public INextCatalog[] getNextCatalogs();
+    INextCatalog[] getNextCatalogs();
 
     /**
      * Returns new catalog element with the specified type. If the type is one
@@ -165,17 +187,17 @@
      * 
      * @return
      */
-    public ICatalogElement createCatalogElement(int type);
+    ICatalogElement createCatalogElement(int type);
 
     /**
      * Removes all the elements from this catalog.
      * 
      */
-    public void clear();
+    void clear();
     
-    //public void load() throws IOException;
+    //void load() throws IOException;
     
-    public void save() throws IOException;
+    void save() throws IOException;
 
     /*
      * Loads catalog from the specified location. Expecting OASIS XML Catalog
@@ -188,7 +210,7 @@
      *             problem loading file
      * 
      */
-    //public void load(InputStream inputStream) throws IOException;
+    //void load(InputStream inputStream) throws IOException;
 
     /*
      * Saves catalog to the specified location in OASIS XML Catalog format
@@ -200,7 +222,7 @@
      *             problem saving file
      * 
      */
-    //public void save(OutputStream outputStream) throws IOException;
+    //void save(OutputStream outputStream) throws IOException;
 
     /**
      * This method copies all catalog entries from source catalog to this one.
@@ -211,7 +233,7 @@
      *            a boolean flag indicating wether to include entries of the
      *            same type from the nested catalogs
      */
-    public void addEntriesFromCatalog(ICatalog catalog);
+    void addEntriesFromCatalog(ICatalog catalog);
 
     /**
      * Adds a listener of the catalog events
@@ -220,7 +242,7 @@
      *            listener of the catalog events
      * @see ICatalogEvent
      */
-    public void addListener(ICatalogListener listener);
+    void addListener(ICatalogListener listener);
 
     /**
      * Removes a listener of the catalog events
@@ -229,5 +251,5 @@
      *            listener of the catalog events
      * @see ICatalogEvent
      */
-    public void removeListener(ICatalogListener listener);      
+    void removeListener(ICatalogListener listener);      
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogElement.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogElement.java
index 15055c3..e011c9b 100644
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogElement.java
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogElement.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
+ * Copyright (c) 2002, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     Jesper Steen Moeller - Added XML Catalogs 1.1 support
  *     
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.catalog.provisional;
@@ -24,10 +25,19 @@
 {
     /** Types of the catalog entries */
     /** The PUBLIC, URI or SYSTEM Catalog Entry. */
-    public static final int TYPE_ENTRY = 1;
+    int TYPE_ENTRY = 1;
 
     /** The NEXT_CATALOG Catalog Entry type. */
-    public static final int TYPE_NEXT_CATALOG = 10;
+    int TYPE_NEXT_CATALOG = 10;
+
+    /** Rewrite types (since XML Catalogs 1.1) */
+    int TYPE_REWRITE = 20;
+
+    /** Delegate types (sinceXML Catalogs 1.1) */
+    int TYPE_DELEGATE = 30;
+    
+    /** Suffix types (since XML Catalogs 1.1)  */
+    int TYPE_SUFFIX = 40;
 
     /**
      * Returns the value of the '<em><b>Type</b></em>' attribute.
@@ -80,4 +90,8 @@
     public void setOwnerCatalog(ICatalog catalog);
     
     public ICatalog getOwnerCatalog();
+
+	void setBase(String base);
+
+	String getBase();
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEntry.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEntry.java
index 271cbe2..372dbfe 100644
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEntry.java
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEntry.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
+ * Copyright (c) 2002, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -21,7 +21,7 @@
  */
 public interface ICatalogEntry extends ICatalogElement
 {
-    /** The SYSTEM Catalog Entry type. */
+    /** The PUBLIC Catalog Entry type. */
     public static final int ENTRY_TYPE_PUBLIC = 2;
 
     /** The SYSTEM Catalog Entry type. */
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/IDelegateCatalog.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/IDelegateCatalog.java
new file mode 100644
index 0000000..82040b0
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/IDelegateCatalog.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Jesper Steen Moeller
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Jesper Steen Moeller - Added XML Catalogs 1.1 support
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.catalog.provisional;
+
+/**
+ * 
+ * <p>
+ * This interface is not intended to be implemented by clients.
+ * </p>
+ * 
+ */
+public interface IDelegateCatalog extends ICatalogElement
+{
+    /** The SYSTEM Catalog Entry type. */
+    int DELEGATE_TYPE_PUBLIC = 31;
+
+    /** The SYSTEM Catalog Entry type. */
+    int DELEGATE_TYPE_SYSTEM = 32;
+
+    /** The URI Catalog Entry type. */
+    int DELEGATE_TYPE_URI = 33;
+
+    /**
+     * 
+     * @param entryType
+     */
+    void setEntryType(int entryType);
+
+    /**
+     * 
+     * @return
+     */
+    int getEntryType();
+
+    /**
+     * 
+     * @param key
+     */
+    void setStartString(String key);
+
+    /**
+     * 
+     * @return
+     */
+    String getStartString();
+    
+    /**
+     * Set location of the referenced catalog.
+     * 
+     * @param uri -
+     *            location uri of the referenced catalog
+     */
+    void setCatalogLocation(String uri);
+
+    /**
+     * Get location uri of the referenced catalog.
+     * 
+     * @return location uri of the referenced catalog
+     */
+    String getCatalogLocation();
+    
+    ICatalog getReferencedCatalog();
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/IRewriteEntry.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/IRewriteEntry.java
new file mode 100644
index 0000000..9d95592
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/IRewriteEntry.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Jesper Steen Moeller
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Jesper Steen Moeller - Added XML Catalogs 1.1 support
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.catalog.provisional;
+
+/**
+ * 
+ * <p>
+ * This interface is not intended to be implemented by clients.
+ * </p>
+ * 
+ */
+public interface IRewriteEntry extends ICatalogElement
+{
+    /** The rewriteSystem Catalog type. */
+    int REWRITE_TYPE_SYSTEM = 21;
+
+    /** The URI Catalog Entry type. */
+    int REWRITE_TYPE_URI = 22;
+
+    /**
+     * 
+     * @param entryType
+     */
+    void setEntryType(int entryType);
+
+    /**
+     * 
+     * @return
+     */
+    int getEntryType();
+
+    /**
+     * 
+     * @param key
+     */
+    void setStartString(String startString);
+
+    /**
+     * 
+     * @return
+     */
+    String getStartString();
+
+    /**
+     * 
+     * @return
+     */
+    String getRewritePrefix();
+
+    /**
+     * 
+     * @param uri
+     */
+    void setRewritePrefix(String uri);
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ISuffixEntry.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ISuffixEntry.java
new file mode 100644
index 0000000..0004014
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ISuffixEntry.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Jesper Steen Moeller
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Jesper Steen Moeller - Added XML Catalogs 1.1 support
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.catalog.provisional;
+
+/**
+ * 
+ * <p>
+ * This interface is not intended to be implemented by clients.
+ * </p>
+ * 
+ */
+public interface ISuffixEntry extends ICatalogElement
+{
+    /** The rewriteSystem Catalog type. */
+    int SUFFIX_TYPE_SYSTEM = 41;
+
+    /** The URI Catalog Entry type. */
+    int SUFFIX_TYPE_URI = 42;
+
+    /**
+     * 
+     * @param entryType
+     */
+    void setEntryType(int entryType);
+
+    /**
+     * 
+     * @return
+     */
+    int getEntryType();
+
+    /**
+     * 
+     * @param key
+     */
+    void setSuffix(String suffixString);
+
+    /**
+     * 
+     * @return
+     */
+    String getSuffix();
+
+    /**
+     * 
+     * @return
+     */
+    String getURI();
+
+    /**
+     * 
+     * @param uri
+     */
+    void setURI(String uri);
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDataType.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDataType.java
index 79d9f5f..b647228 100644
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDataType.java
+++ b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDataType.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
+ * Copyright (c) 2002, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,6 +23,7 @@
 	static final String CDATA = "CDATA"; //$NON-NLS-1$
 	static final String ID = "ID"; //$NON-NLS-1$
 	static final String IDREF = "IDREF"; //$NON-NLS-1$
+	static final String IDREFS = "IDREFS"; //$NON-NLS-1$
 	static final String ENTITY = "ENTITY"; //$NON-NLS-1$
 	static final String ENTITIES = "ENTITIES"; //$NON-NLS-1$
 	static final String NOTATION = "NOTATION"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMAttributeDeclarationImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMAttributeDeclarationImpl.java
index f0df4fa..4b554b6 100644
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMAttributeDeclarationImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMAttributeDeclarationImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
+ * Copyright (c) 2002, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -32,7 +32,7 @@
                 
   public CMAttributeDeclarationImpl(String nodeName, int usage)
   {
-    this(nodeName, usage, null);
+    this(nodeName, usage, new CMDataTypeImpl(CMDataType.CDATA, ""));
   }     
 
   public CMAttributeDeclarationImpl(String nodeName, int usage, CMDataType dataType)
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/CMValidator.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/CMValidator.java
index 3ee535f..2de5590 100644
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/CMValidator.java
+++ b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/CMValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
+ * Copyright (c) 2002, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (STAR) - bug 297005 - Some static constants not made final.
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.contentmodel.internal.util;
 
@@ -18,6 +18,7 @@
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Stack;
 import java.util.Vector;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
@@ -33,7 +34,7 @@
 
 public class CMValidator
 {
-  protected static StringElementContentComparator stringContentComparitor = new StringElementContentComparator();
+  protected static final StringElementContentComparator stringContentComparitor = new StringElementContentComparator();
   protected Hashtable graphNodeTable = new Hashtable();
 
   /**
@@ -307,59 +308,69 @@
   }
 
 
-  public void validateElementList(ElementList list, GraphNode node, ElementContentComparator comparator, Result result, boolean loopFlag)
-  {
-    //println("+validateElementList " + node + " " + list);
-    if (list == null && node.isTerminal)
-    {
-      result.isValid = true;
-    }
-    else
-    {
-      for (Iterator i = node.arcList.iterator(); i.hasNext();)
-      {
-        Arc arc = (Arc)i.next();
-        boolean traverseArc = false;
-        if (arc.kind == Arc.ELEMENT)
-        {
-          if (list != null && comparator.matches(list.head, arc.cmNode))
-          {
-            loopFlag = false;
-            traverseArc = true;
-            list = list.tail; // increment our position in the list
-          }
-        }
-        else if (arc.kind == Arc.REPEAT)
-        {
-          if (!loopFlag)
-          {
-            traverseArc = true;
-          }
-          loopFlag = true;
-        }
-        else
-        {
-          traverseArc = true;
-        }
+  public void validateElementList(ElementList initialList, GraphNode initialGraphNode, ElementContentComparator comparator, Result result, boolean initialLoopFlag) {
+	  Stack arcStack = new Stack();
+	  arcStack.push(new ArcStackItem(null, false));
+	  boolean loopFlag = initialLoopFlag;
+	  ElementList elementList = initialList;
+	  GraphNode graphNode = initialGraphNode;
+	  while(!arcStack.isEmpty() && !result.isValid) {
+		  ArcStackItem stackElement = (ArcStackItem) arcStack.peek();
+		  if(stackElement.isVisited) {
+			  arcStack.pop();
+			  if(stackElement.arc != null) {
+				  result.pop(stackElement.arc);
+				  continue;
+			  }
+		  } else {
+			  stackElement.isVisited = true;
+			  result.push(stackElement.arc);
+			  graphNode = stackElement.arc.node;
+			  loopFlag = stackElement.loopFlag;
+		  } 
+		  if(elementList == null && graphNode.isTerminal) {
+			  result.isValid = true;
+		  } else {
+			  for(Iterator arcIterator = graphNode.arcList.iterator(); arcIterator.hasNext();) {
+				  Arc arc = (Arc)arcIterator.next();
+				  boolean traverseArc = false;
+				  if (arc.kind == Arc.ELEMENT) {
+					  if(elementList != null && comparator.matches(elementList.head, arc.cmNode)) {
+						  loopFlag = false;
+						  traverseArc = true;
+						  elementList = elementList.tail; // increment our position in the list
+					  }
+				  } else if(arc.kind == Arc.REPEAT) {
+					  if(!loopFlag) {
+						  traverseArc = true;
+					  }
+					  loopFlag = true;
+				  } else {
+					  traverseArc = true;
+				  }
+				  if(traverseArc) {
+					  if (result.canPush(arc)) { // test to see if we can push this arc due to facet constraints  
+						  arcStack.push(new ArcStackItem(arc, loopFlag));
+					  }
+				  }
+			  }
+		  }
+	  }
+  }
+  
+  
+  private class ArcStackItem {
+	  
+	  Arc arc;
+	  boolean loopFlag;
+	  boolean isVisited;
+	  
+	  public ArcStackItem(Arc arc, boolean loopflag) {
+		  this.arc = arc;
+		  this.loopFlag = loopflag;
+		  this.isVisited = arc == null;
+	  }
 
-        if (traverseArc)
-        {
-          // test to see if we can push this arc due to facet constraints
-          //
-          if (result.canPush(arc))
-          {          
-            // see if this arc leads to a correct solution          
-            result.push(arc);
-            validateElementList(list, arc.node, comparator, result, loopFlag);
-            if (result.isValid)
-            {
-              break;
-            }
-            result.pop(arc);
-          }
-        }
-      }
-    }
   }
 
 
@@ -416,16 +427,12 @@
       ElementList elementList = createElementList(contentType, elementContent, comparator, result);
       if (result.isValid == true)
       {  
-        // defect 226213 ... elements with a large number of children will cause the recursion based validation
-        // algorithm to stack overflow ... as a quick fix assume any element with a large number of children is valid        
-        if (elementContent.size() < 500)
-        {
           boolean isGraphValidationNeeded = !(elementList == null && contentType == CMElementDeclaration.MIXED);
                       
-          // exlicity handle 'All' groups
+          // explicitly handle 'All' groups
           //
           CMContent content = ed.getContent();
-          if (content.getNodeType() == CMNode.GROUP)
+          if (content != null && content.getNodeType() == CMNode.GROUP)
           {
             CMGroup group = (CMGroup)content;
             if (group.getOperator() == CMGroup.ALL)
@@ -443,7 +450,6 @@
             GraphNode node = lookupOrCreateGraph(ed);
             validateElementList(elementList, node, comparator, result, false);
           }
-        }
       }
     }
     else if (contentType == CMElementDeclaration.PCDATA)
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentManagerImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentManagerImpl.java
index c4cbfc4..3e4af8c 100644
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentManagerImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentManagerImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2007 IBM Corporation and others.
+ * Copyright (c) 2002, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -19,38 +19,45 @@
 
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Preferences;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.wst.xml.core.internal.Logger;
 import org.eclipse.wst.xml.core.internal.XMLCoreMessages;
+import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
 import org.eclipse.wst.xml.core.internal.contentmodel.ContentModelManager;
 import org.eclipse.wst.xml.core.internal.contentmodel.internal.annotation.AnnotationUtility;
 import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
 import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManagerListener;
 import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentReferenceProvider;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.GlobalCMDocumentCache.GlobalCacheQueryResponse;
 import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
+import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
 
+import com.ibm.icu.text.MessageFormat;
 
 /**
  *
  */
 public class CMDocumentManagerImpl implements CMDocumentManager
-{                                
+{
   protected CMDocumentCache cmDocumentCache;
   protected CMDocumentReferenceProvider cmDocumentReferenceProvider;
   protected List listenerList = new Vector(); 
   protected Hashtable propertyTable = new Hashtable();
   protected Hashtable publicIdTable = new Hashtable();
+  private boolean globalCMDocumentCacheEnabled ;
 
        
   public CMDocumentManagerImpl(CMDocumentCache cmDocumentCache, CMDocumentReferenceProvider cmDocumentReferenceProvider)
-  {                                                       
+  {
     this.cmDocumentCache = cmDocumentCache;                                                                            
     this.cmDocumentReferenceProvider = cmDocumentReferenceProvider;
     setPropertyEnabled(PROPERTY_AUTO_LOAD, true);
     setPropertyEnabled(PROPERTY_USE_CACHED_RESOLVED_URI, false);
     setPropertyEnabled(PROPERTY_PERFORM_URI_RESOLUTION, true);
+    initializeGlobalCMDocumentCacheSettings();
   }         
 
        
@@ -240,7 +247,7 @@
           }
           catch (Exception e)
           {
-        	  Logger.logException(e);
+        	  Logger.logException(MessageFormat.format(XMLCoreMessages.CMDocument_load_exception, new Object[]{resolvedURI, publicId}), e);
           }
           return Status.OK_STATUS;
         }
@@ -259,7 +266,17 @@
   public synchronized CMDocument buildCMDocument(String publicId, String resolvedURI, String type)
   {                                     
     cmDocumentCache.setStatus(resolvedURI, CMDocumentCache.STATUS_LOADING);
-  
+    boolean documentCacheable = false;
+    if(globalCMDocumentCacheEnabled) {
+    	GlobalCacheQueryResponse response = GlobalCMDocumentCache.getInstance().getCMDocument(resolvedURI);
+    	CMDocument cachedCMDocument = response.getCachedCMDocument();
+    	documentCacheable = response.isDocumentCacheable();
+    	if(cachedCMDocument != null) {
+    		cmDocumentCache.putCMDocument(resolvedURI, cachedCMDocument);
+    		return cachedCMDocument;
+    	}
+    }
+
     CMDocument result = null;         
     if (resolvedURI != null && resolvedURI.length() > 0)
     {
@@ -273,6 +290,9 @@
       {    
         AnnotationUtility.loadAnnotationsForGrammar(publicId, result);
       }
+      if(globalCMDocumentCacheEnabled && documentCacheable) {
+    	  GlobalCMDocumentCache.getInstance().putCMDocument(resolvedURI, result);
+      }
       cmDocumentCache.putCMDocument(resolvedURI, result);
     }
     else
@@ -287,4 +307,12 @@
     // TODO... initiate a timed release of the entries in the CMDocumentCache
     publicIdTable = new Hashtable();
   }
+  
+  private void initializeGlobalCMDocumentCacheSettings() {
+	  Preferences preferences = XMLCorePlugin.getDefault().getPluginPreferences();
+	  if(preferences != null) {
+		  globalCMDocumentCacheEnabled = preferences.getBoolean(XMLCorePreferenceNames.CMDOCUMENT_GLOBAL_CACHE_ENABLED);
+	  }
+  }
+
 }                                            
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/GlobalCMDocumentCache.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/GlobalCMDocumentCache.java
new file mode 100644
index 0000000..ca981f1
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/GlobalCMDocumentCache.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl;
+
+import java.lang.ref.SoftReference;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.wst.sse.core.internal.util.AbstractMemoryListener;
+import org.eclipse.wst.xml.core.internal.Logger;
+import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
+import org.osgi.service.event.Event;
+import org.osgi.service.event.EventConstants;
+
+public class GlobalCMDocumentCache {
+	
+	private static GlobalCMDocumentCache globalDocumentCache = new GlobalCMDocumentCache();
+	private Map systemCatalogEntries = getSystemCatalogEntries();
+	private MemoryListener memoryListener;
+	private final static String CATEGORY = "CMDocumentGlobalCache"; //$NON-NLS-1$
+	
+	protected GlobalCMDocumentCache() {
+		Logger.trace(CATEGORY, "Cache initialized"); //$NON-NLS-1$
+		memoryListener = new MemoryListener();
+		memoryListener.connect();
+	}
+
+	public static GlobalCMDocumentCache getInstance() {
+		return globalDocumentCache;
+	}
+	
+	public synchronized GlobalCacheQueryResponse getCMDocument(String grammarURI) {
+		//Logger.trace(CATEGORY, "Query for: " + grammarURI); //$NON-NLS-1$
+		Object systemCatalogEntry = systemCatalogEntries.get(grammarURI);
+		if(systemCatalogEntry != null) {
+			//Logger.trace(CATEGORY, "Document " + grammarURI + " is in system catalog"); //$NON-NLS-1$ //$NON-NLS-2$
+			Object object = ((SoftReference)systemCatalogEntry).get();
+			if(object != null) {
+				//Logger.trace(CATEGORY, "Document " + grammarURI + "is in cache, returning cached version"); //$NON-NLS-1$ //$NON-NLS-2$
+				return new GlobalCacheQueryResponse((CMDocument)object, true);
+			} else {
+				//Logger.trace(CATEGORY, "Document " + grammarURI + " is not in cache"); //$NON-NLS-1$ //$NON-NLS-2$
+				return new GlobalCacheQueryResponse(null, true);
+			}
+		}
+		//Logger.trace(CATEGORY, "Document " + grammarURI + " is not in system catalog, not cached"); //$NON-NLS-1$ //$NON-NLS-2$
+		return new GlobalCacheQueryResponse(null, false);
+	}
+	
+	public synchronized void putCMDocument(String grammarURI, CMDocument cmDocument) {
+		//Logger.trace(CATEGORY, "Document: " + grammarURI + " added to global cache"); //$NON-NLS-1$ //$NON-NLS-2$
+		systemCatalogEntries.put(grammarURI, new SoftReference(cmDocument));
+	}
+	
+	private synchronized static HashMap getSystemCatalogEntries(){
+		HashMap systemCatalogURIs = new HashMap();
+		ICatalog systemCatalog = null;
+		ICatalog defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
+		INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs();
+		for (int i = 0; i < nextCatalogs.length; i++) {
+			INextCatalog catalog = nextCatalogs[i];
+			ICatalog referencedCatalog = catalog.getReferencedCatalog();
+			if (referencedCatalog != null) {
+				if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) {
+					systemCatalog = referencedCatalog;
+				}
+			}
+		}
+		if(systemCatalog != null) {
+			ICatalogEntry[] catalogEntries = systemCatalog.getCatalogEntries();
+			for (int i = 0; i < catalogEntries.length; i++) {
+				systemCatalogURIs.put(catalogEntries[i].getURI(), new SoftReference(null));
+			}
+		}
+		return systemCatalogURIs;
+	}
+	
+	public class GlobalCacheQueryResponse {
+		
+		private CMDocument cachedDocument;
+		private boolean documentCacheable;
+		
+		public GlobalCacheQueryResponse(CMDocument cachedCMDocument, boolean documentCacheable) {
+			this.cachedDocument = cachedCMDocument;
+			this.documentCacheable = documentCacheable;
+		}
+		
+		public CMDocument getCachedCMDocument() {
+			return cachedDocument;
+		}
+		
+		public boolean isDocumentCacheable() {
+			return documentCacheable;
+		}
+		
+	}
+
+	private class MemoryListener extends AbstractMemoryListener {
+		protected void handleMemoryEvent(Event event) {
+			Object topic = event.getProperty(EventConstants.EVENT_TOPIC);
+			if(SEV_SERIOUS.equals(topic) || SEV_CRITICAL.equals(topic)) {
+				Logger.trace(CATEGORY, "Serious severity low memory event received, flushing global CMDocument cache."); //$NON-NLS-1$
+				systemCatalogEntries = getSystemCatalogEntries();
+			}
+		}
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ModelQueryImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ModelQueryImpl.java
index 436d8ff..3c6485e 100644
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ModelQueryImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ModelQueryImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
+ * Copyright (c) 2002, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,12 +12,12 @@
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Vector;
 
 import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
@@ -138,7 +138,7 @@
 
   public List getCMDocumentList(Element element, CMElementDeclaration ed, String uri)
   {                
-    List result = new Vector();
+    List result = new ArrayList();
     if (modelQueryAssociationProvider instanceof XMLAssociationProvider)
     {              
       XMLAssociationProvider xmlAssociationProvider = (XMLAssociationProvider)modelQueryAssociationProvider;
@@ -582,7 +582,7 @@
   protected List nodeListToList(NodeList nodeList)
   {
     int size = nodeList.getLength();
-    Vector v = new Vector(size);
+    List v = new ArrayList(size);
     for (int i = 0; i < size; i++)
     {
       v.add(nodeList.item(i));
@@ -644,7 +644,7 @@
 
     public List computeAvailableContent(int includeOptions)
     {                   
-      Vector v = new Vector();  
+      List v = new ArrayList();  
 
       int contentType = rootElementDeclaration.getContentType();
       includeSequenceGroups = ((includeOptions & INCLUDE_SEQUENCE_GROUPS) != 0);
@@ -679,17 +679,6 @@
             } 
           }
         }
-              
-        if (contentType == CMElementDeclaration.MIXED ||
-            contentType == CMElementDeclaration.PCDATA || 
-            contentType == CMElementDeclaration.ANY)
-        {
-          CMDataType dataType = rootElementDeclaration.getDataType();
-          if (dataType != null)
-          {
-            v.add(dataType);
-          }                                       
-        }
       }
       return v;
     }   
@@ -793,7 +782,7 @@
    */
   public String[] getPossibleDataTypeValues(Element element, CMNode cmNode)
   {
-    List list = new Vector();                            
+    List list = new ArrayList();                            
                                
     if (cmNode != null)
     {       
@@ -823,14 +812,18 @@
     {                    
       list.addAll(extensionManager.getDataTypeValues(element, cmNode));
     }          
-                        
-    int listSize = list.size();
-    String[] result = new String[listSize];
-    for (int i = 0; i < listSize; i++)
-    {
-      result[i] = (String)list.get(i);
-    }     
-    return result;
+    
+    // Remove duplicates
+    List duplicateFreeList = new ArrayList();
+    Iterator iterator = list.iterator();
+    while(iterator.hasNext()) {
+    	Object next = iterator.next();
+    	if(duplicateFreeList.indexOf(next) == -1) {
+    		duplicateFreeList.add(next);
+    	}
+    }
+    
+    return (String[]) duplicateFreeList.toArray(new String[duplicateFreeList.size()]);
   }    
 
            
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/XMLAssociationProvider.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/XMLAssociationProvider.java
index 9e20be6..8937395 100644
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/XMLAssociationProvider.java
+++ b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/XMLAssociationProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
+ * Copyright (c) 2002, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -296,8 +296,8 @@
     String xsiPrefix = namespaceTable.getPrefixForURI("http://www.w3.org/2001/XMLSchema-instance"); //$NON-NLS-1$
     if (xsiPrefix != null)
     {
-      String xsiTypeValue = element.getAttribute(xsiPrefix + ":type"); //$NON-NLS-1$
-      if (xsiTypeValue != null)
+      String xsiTypeValue = element.hasAttribute(xsiPrefix + ":type") ? element.getAttribute(xsiPrefix + ":type") : null; //$NON-NLS-1$ //$NON-NLS-2$
+      if (xsiTypeValue != null && xsiTypeValue.length() > 0)
       {  
         String typePrefix = DOMNamespaceHelper.getPrefix(xsiTypeValue);
         String typeName = DOMNamespaceHelper.getUnprefixedName(xsiTypeValue);
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDescriptionBuilder.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDescriptionBuilder.java
index 49c9da1..a82ab1c 100644
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDescriptionBuilder.java
+++ b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDescriptionBuilder.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
+ * Copyright (c) 2002, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.contentmodel.util;
 
+
 import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
@@ -27,7 +28,6 @@
   protected StringBuffer sb;
   protected CMNode root;
   protected boolean isRootVisited;
-
   public String buildDescription(CMNode node)
   {
     sb = new StringBuffer();
@@ -73,7 +73,8 @@
     {
       separator = " | "; //$NON-NLS-1$
     }
-
+    
+   
     CMNodeList nodeList = group.getChildNodes();
     int size = nodeList.getLength();
     for (int i = 0; i < size; i++)
@@ -84,6 +85,7 @@
         sb.append(separator);
       }
     }
+    
     sb.append(")"); //$NON-NLS-1$
     addOccurenceSymbol(group);
   }
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMVisitor.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMVisitor.java
index fc4f35d..89bb9d6 100644
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMVisitor.java
+++ b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMVisitor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
+ * Copyright (c) 2002, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,6 +12,8 @@
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.contentmodel.util;
 
+import java.util.Stack;
+
 import org.eclipse.wst.xml.core.internal.contentmodel.CMAnyElement;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
@@ -25,6 +27,7 @@
 public class CMVisitor
 {
   protected int indent = 0;
+  protected Stack visitedCMGroupStack = new Stack();
 
   public void visitCMNode(CMNode node)
   {
@@ -62,7 +65,21 @@
         }
         case CMNode.GROUP :
         {
-          visitCMGroup((CMGroup)node);
+          CMGroup group = (CMGroup)node;
+          
+          // This is to prevent recursion.
+          if (visitedCMGroupStack.contains(group))
+          {
+            break;
+          }
+          
+          // Push the current group to check later to avoid potential recursion
+          visitedCMGroupStack.push(group);
+          
+          visitCMGroup(group);
+
+          // Pop the current group
+          visitedCMGroupStack.pop();
           break;
         }
       }
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilderImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilderImpl.java
index 532a484..60341ad 100644
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilderImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilderImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
+ * Copyright (c) 2002, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -66,7 +66,11 @@
 
 	protected int numOfRepeatableElements = 1;
 	protected Stack cmGroupStack = new Stack();
+	protected int depthLimit = -1;
 
+	protected int domLevel;
+	private int originalBuildPolicy;
+	
 	public interface ExternalCMDocumentSupport {
 		public CMDocument getCMDocument(Element element, String uri);
 	}
@@ -186,6 +190,7 @@
 	public void createDefaultContent(Node parent, CMElementDeclaration ed) {
 		currentParent = parent;
 		alwaysVisit = true;
+		originalBuildPolicy = buildPolicy;
 		visitCMElementDeclaration(ed);
 	}
 
@@ -209,9 +214,11 @@
 	}
 
 	protected void handlePushParent(Element parent, CMElementDeclaration ed) {
+	  domLevel++;
 	}
 
 	protected void handlePopParent(Element element, CMElementDeclaration ed) {
+      domLevel--;
 	}
 
 	// The range must be between 1 and 99.
@@ -349,6 +356,16 @@
 		linkNode(text);
 	}
 
+	public void visitCMNode(CMNode node) {
+		if (depthLimit != -1) {
+			if (domLevel > depthLimit) {
+				buildPolicy = buildPolicy &= ~BUILD_OPTIONAL_ELEMENTS;
+			} else {
+				buildPolicy = originalBuildPolicy;
+			}
+		}
+		super.visitCMNode(node);
+	}
 
 	public void visitCMGroup(CMGroup e) {
 		cmGroupStack.push(e);
@@ -581,6 +598,11 @@
 			e.printStackTrace();
 		}
 	}
+	
+	public void setOptionalElementDepthLimit(int depth) {
+		depthLimit = depth;
+	}
+	
 
 	// test
 	//
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMWriter.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMWriter.java
index d5a1150..736c1f3 100644
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMWriter.java
+++ b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMWriter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
+ * Copyright (c) 2002, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -156,7 +156,7 @@
        boolean isRootElement = element.getParentNode().getNodeType() == Node.DOCUMENT_NODE;
        if (hasChildNodes || isRootElement)
        {
-         if (currentElementHasChildElements || isRootElement)
+         if (currentElementHasChildElements)
          {
            println(">"); //$NON-NLS-1$
          }
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceTable.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceTable.java
index 18a2541..71d115d 100644
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceTable.java
+++ b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceTable.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2007 IBM Corporation and others.
+ * Copyright (c) 2002, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -29,7 +29,11 @@
 {                   
   public Hashtable hashtable = new Hashtable();
 
-  public NamespaceTable(Document document)
+/**
+ * @deprecated
+ * @param document - no longer used
+ */
+public NamespaceTable(Document document)
   {         
 	  this();
     //DOMExtension domExtension = DOMExtensionProviderRegistry.getInstance().getDOMExtension(document);
diff --git a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSEAdapter.java b/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSEAdapter.java
index d64e0b2..318f731 100644
--- a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSEAdapter.java
+++ b/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSEAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -30,7 +30,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.xml.core.internal.Logger;
-import org.eclipse.wst.xml.core.internal.document.ElementImpl;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.w3c.dom.Document;
@@ -39,6 +39,8 @@
 import org.w3c.dom.Text;
 
 public class EMF2DOMSSEAdapter extends EMF2DOMAdapterImpl implements INodeAdapter {
+	
+	private Class resourceClass;
 	public EMF2DOMSSEAdapter(Node node, EMF2DOMRenderer renderer, Translator translator) {
 		super(node, renderer, translator);
 	}
@@ -192,7 +194,7 @@
 	}
 
 	protected boolean isEmptyTag(Element parent) {
-		return ((ElementImpl) parent).isEmptyTag();
+		return ((IDOMElement) parent).isEmptyTag();
 	}
 
 	/*
@@ -269,7 +271,102 @@
 	protected EMF2DOMAdapter primCreateAdapter(Node node, Translator childMap) {
 		return new EMF2DOMSSEAdapter(node, fRenderer, childMap);
 	}
+	protected EMF2DOMAdapter createAdapter(Node node, Translator childMap) {
 
+		//Assert.isNotNull(childMap.getChildAdapterClass());
+		Assert.isNotNull(node);
+
+		EMF2DOMAdapter adapter = primGetExistingAdapter(node,childMap);
+
+		if (adapter != null) {
+			if (adapter.isMOFProxy() || adapter.getTarget() == null) {
+				removeDOMAdapter(node, adapter);
+				if (adapter.getTarget() != null) {
+					adapter.getTarget().eAdapters().remove(adapter);
+				}
+				adapter = null;
+			}
+		}
+		if (adapter == null) {
+			adapter = primCreateAdapter(node, childMap);
+		}
+		return adapter;
+	}
+	protected void addDOMAdapter(Node childNode) {
+
+		// Only add the adapter if this is an child node that will not be
+		// adapted. For instance a subtree that maps to a MOF attribute
+		// setting.
+		if (childNode.getNodeType() == Node.ELEMENT_NODE) {
+			EMF2DOMAdapter attrAdapter = primGetExistingAdapter(childNode);
+
+			if (attrAdapter == null || attrAdapter.getNode() != getNode()) {
+				// If the node is adapted, but not by this adapter then remove
+				// it. This happens to non-object children when the parent tag
+				// name is changed.
+				removeDOMAdapter(childNode, attrAdapter);
+
+				if (fDebug) {
+					org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError("\tCHILD: Adding DOM adapter: " + this); //$NON-NLS-1$
+					org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError("\t\tto: " + childNode); //$NON-NLS-1$
+				}
+				primAddDOMAdapter(childNode, this);
+			}
+		}
+	}
+	
+	protected EMF2DOMAdapter primGetExistingAdapter(Node aNode, Translator childMap) {
+		INodeNotifier sseNode = (INodeNotifier) aNode;
+		Collection adapters = sseNode.getAdapters();
+		for (Iterator iterator = adapters.iterator(); iterator.hasNext();) {
+			INodeAdapter adapter = (INodeAdapter) iterator.next();
+			// First Check if it's an EMF2DOMAdapter
+			if (adapter != null && adapter.isAdapterForType(EMF2DOMAdapter.ADAPTER_CLASS)) {
+				// Cast to EMF2DOMAdapter
+				EMF2DOMSSEAdapter e2DAdapter = (EMF2DOMSSEAdapter) adapter;
+				Object adapterTarget = e2DAdapter.getTarget();
+				//Translator adapterTranslator = e2DAdapter.fTranslator;
+				
+				//Handle the cases where either adapter's target is null 
+				if ((getTarget() == null) || (adapterTarget == null))
+					if (resourceClass != null && resourceClass.equals(e2DAdapter.getResourceClass()))
+						return e2DAdapter;
+					else
+						continue;
+				
+				
+				// Check if target is an EMF resource
+				if (getTarget() instanceof Resource) {
+					/*
+					 * Now check if it's the right one (Multiple resources
+					 * could be attached)
+					 */
+					if (adapterTarget != null && adapterTarget == getTarget()) {
+						return e2DAdapter;
+					}
+				}
+				else {
+					// Check if targets are EObjects with the same resources
+					EObject myTarget = (EObject) getTarget();
+					/*
+					 * Now check if it's the right one (Multiple resources could
+					 * be attached)
+					 */
+					if (adapterTarget != null && ((EObject)adapterTarget).eResource() == myTarget.eResource()) {
+						return e2DAdapter;
+					}
+				}
+				
+				if (adapterTarget instanceof EObject) {
+					if (((EObject) e2DAdapter.getTarget()).eResource() == null && e2DAdapter.fTranslator == childMap) {
+						return e2DAdapter;
+					}
+				}
+			}
+		}
+		return null;
+	}
+	
 	protected EMF2DOMAdapter primGetExistingAdapter(Node aNode) {
 		INodeNotifier sseNode = (INodeNotifier) aNode;
 		Collection adapters = sseNode.getAdapters();
@@ -278,34 +375,46 @@
 			// First Check if it's an EMF2DOMAdapter
 			if (adapter != null && adapter.isAdapterForType(EMF2DOMAdapter.ADAPTER_CLASS)) {
 				// Cast to EMF2DOMAdapter
-				EMF2DOMAdapter e2DAdapter = (EMF2DOMAdapter) adapter;
-				// Check if targets are the resources
+				EMF2DOMSSEAdapter e2DAdapter = (EMF2DOMSSEAdapter) adapter;
+				Object adapterTarget = e2DAdapter.getTarget();
+				
+				//Handle the cases where either adapter's target is null 
+				if ((getTarget() == null) || (adapterTarget == null))
+					if (resourceClass != null && resourceClass.equals(e2DAdapter.getResourceClass()))
+						return e2DAdapter;
+					else
+						continue;
+				
+				
+				// Check if target is an EMF resource
 				if (getTarget() instanceof Resource) {
 					/*
 					 * Now check if it's the right one (Multiple resources
 					 * could be attached)
 					 */
-					if (e2DAdapter.getTarget() == getTarget()) {
+					if (adapterTarget != null && adapterTarget == getTarget()) {
 						return e2DAdapter;
 					}
-					else
-						continue;
 				}
-				// Check if targets are EObjects with the same resources
-				EObject myTarget = (EObject) getTarget();
-				EObject adapterTarget = (EObject) e2DAdapter.getTarget();
-				/*
-				 * Now check if it's the right one (Multiple resources could
-				 * be attached)
-				 */
-				if (adapterTarget != null && myTarget != null && adapterTarget.eResource() == myTarget.eResource()) {
-					return e2DAdapter;
+				else {
+					// Check if targets are EObjects with the same resources
+					EObject myTarget = (EObject) getTarget();
+					/*
+					 * Now check if it's the right one (Multiple resources could
+					 * be attached)
+					 */
+					if (adapterTarget != null && ((EObject)adapterTarget).eResource() == myTarget.eResource()) {
+						return e2DAdapter;
+					}
+				}
+				
+				if (adapterTarget instanceof EObject) {
+					if (((EObject) e2DAdapter.getTarget()).eResource() == null) {
+						return e2DAdapter;
+					}
 				}
 			}
 		}
-		/*
-		 * if we didn't find one in our list, return the null result
-		 */
 		return null;
 	}
 
@@ -340,7 +449,7 @@
 	}
 
 	protected void removeDOMAdapter(Node aNode, EMF2DOMAdapter anAdapter) {
-		((IDOMNode) aNode).removeAdapter((EMF2DOMSSEAdapter) anAdapter);
+		((IDOMNode) aNode).removeAdapter((INodeAdapter) anAdapter);
 	}
 
 
@@ -355,7 +464,7 @@
 	}
 
 	protected void setEmptyTag(Element element) {
-		((ElementImpl) element).setEmptyTag(true);
+		((IDOMElement) element).setEmptyTag(true);
 	}
 
 	public void updateDOM() {
@@ -369,4 +478,15 @@
 			enableUndoManagement();
 		}
 	}
+
+	public Class getResourceClass() {
+		return resourceClass;
+	}
+
+	protected void initChildTranslators() {
+		if (fRenderer != null && fRenderer.getResource() != null)
+			resourceClass = fRenderer.getResource().getClass();
+		super.initChildTranslators();
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERenderer.java b/bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERenderer.java
index 6d6a546..40289d7 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,6 +18,8 @@
 import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -27,6 +29,7 @@
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
 import org.eclipse.emf.ecore.resource.ResourceSet;
 import org.eclipse.emf.ecore.util.EcoreUtil;
 import org.eclipse.jem.util.emf.workbench.ProjectResourceSet;
@@ -42,6 +45,8 @@
 import org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.xml.core.internal.Logger;
 import org.eclipse.wst.xml.core.internal.document.DocumentTypeImpl;
@@ -59,6 +64,10 @@
 	private boolean isSaving = false;
 
 	private IModelManager modelManager;
+	
+	private Class resourceClass;
+	
+	private boolean reverting = false;
 
 	/** The XML DOM model */
 	protected IDOMModel xmlModel;
@@ -173,7 +182,7 @@
 					is.close();
 				}
 			}
-			initializeXMLModel(file, true);
+			initializeXMLModel(file, resource.getWriteCount() != 0);
 		}
 		catch (IOException ex) {
 			Logger.log(Logger.ERROR, "IWAE0017E Unexpected IO exception occurred creating xml document");//$NON-NLS-1$
@@ -258,8 +267,50 @@
 	}
 
 	public EMF2DOMAdapter getExistingDOMAdapter(Node node) {
-		IDOMNode xNode = (IDOMNode) node;
-		return (EMF2DOMSSEAdapter) xNode.getAdapterFor(EMF2DOMAdapter.ADAPTER_CLASS);
+		//IDOMNode xNode = (IDOMNode) node;
+		//return (EMF2DOMSSEAdapter) xNode.getAdapterFor(EMF2DOMAdapter.ADAPTER_CLASS);
+
+		INodeNotifier sseNode = (INodeNotifier) node;
+		Collection adapters = sseNode.getAdapters();
+		for (Iterator iterator = adapters.iterator(); iterator.hasNext();) {
+			INodeAdapter adapter = (INodeAdapter) iterator.next();
+			// First Check if it's an EMF2DOMAdapter
+			if (adapter != null && adapter.isAdapterForType(EMF2DOMAdapter.ADAPTER_CLASS)) {
+				// Cast to EMF2DOMSSEAdapter
+				EMF2DOMSSEAdapter e2DAdapter = (EMF2DOMSSEAdapter) adapter;
+				//Handle the cases where either adapter's target is null 
+				//Use the resourceClass to make sure the resource type is identical
+				if (getResource() == null || e2DAdapter.getTarget() == null)
+					if(resourceClass.equals(e2DAdapter.getResourceClass()))
+						return e2DAdapter;
+					else
+						continue;
+				
+				// First check if targets are resources
+				if (e2DAdapter.getTarget() instanceof Resource) {
+					/*
+					 * Now check if it's the right one (Multiple resources
+					 * could be attached)
+					 */
+					if (e2DAdapter.getTarget() == getResource()) {
+						return e2DAdapter;
+					}
+				} else {
+					// Check if targets are EObjects with the same resources
+					TranslatorResource myTarget = getResource();
+					EObject adapterTarget = (EObject) e2DAdapter.getTarget();
+					/*
+					 * Now check if it's the right one (Multiple resources could
+					 * be attached)
+					 */
+					if (adapterTarget.eResource() == myTarget || adapterTarget.eResource() == null) {
+						return e2DAdapter;
+					}
+				}
+			}
+		}
+		return null;
+	
 	}
 
 	protected IModelManager getModelManager() {
@@ -344,7 +395,12 @@
 	}
 
 	public boolean isShared() {
-		if (getResourceSet() == null || xmlModel == null)
+		
+		if( xmlModel == null) { //resource could be in process of being unloaded - check with model manager
+			String id = getModelManagerId();
+			return getModelManager().isShared(id);
+		}
+		if (getResourceSet() == null)
 			return false;
 		return xmlModel.isShared();
 	}
@@ -386,26 +442,26 @@
 		if (isBatchChanges)
 			return;
 		try {
-			if (aboutToChangeNode != null && model.getStructuredDocument() != null && model.getStructuredDocument().getFirstStructuredDocumentRegion() != aboutToChangeNode) {
+			if (reverting && aboutToChangeNode != null && model.getStructuredDocument() != null
+					&& model.getStructuredDocument().getFirstStructuredDocumentRegion() != aboutToChangeNode) {
 				String id = getModelManagerId();
 				IStructuredModel tempModel = null;
 				try {
 					tempModel = getModelManager().getExistingModelForEdit(id);
 					xmlModelReverted = true;
 					resource.unload();
-				}
-				finally {
-					if (tempModel != null) {
+				} finally {
+					if (tempModel != null && (tempModel.getReferenceCountForEdit() > 0)) {
 						tempModel.releaseFromEdit();
 					}
+					reverting = false;
 				}
 			}
-		}
-		finally {
+		} finally {
 			aboutToChangeNode = null;
 		}
-	}
-
+	} 
+	
 	public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty) {
 		if (!isDirty && resource.isModified()) { // The XMLModel was saved
 			resource.setModified(false);
@@ -447,11 +503,15 @@
 	}
 
 	public void processPostModelEvent(ModelLifecycleEvent event) {
-		// TODO Auto-generated method stub
+		if (event.getType() == ModelLifecycleEvent.MODEL_REVERT)
+			reverting = false;
 
 	}
 
 	public void processPreModelEvent(ModelLifecycleEvent event) {
+		if (event.getType() == ModelLifecycleEvent.MODEL_REVERT)
+			reverting = true;
+			
 		if (!isSaving) {
 			if (event.getType() == ModelLifecycleEvent.MODEL_SAVED) {
 				ResourceSetWorkbenchEditSynchronizer synchronizer = (ResourceSetWorkbenchEditSynchronizer) ((ProjectResourceSet) resource.getResourceSet()).getSynchronizer();
@@ -459,6 +519,7 @@
 				synchronizer.preSave(aFile, resource);
 			}
 		}
+		
 	}
 
 
@@ -581,4 +642,15 @@
 	public boolean wasReverted() {
 		return xmlModelReverted;
 	}
+
+	public void setResource(TranslatorResource resource) {
+		super.setResource(resource);
+		if (resource != null)
+			resourceClass = resource.getClass();
+	}
+	public boolean isReverting() {
+		return this.reverting;
+	}
+
+
 }
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
index 7abd04b..dff3048 100644
--- 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,7 +11,11 @@
 
 package org.eclipse.wst.xml.core.internal.search;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import org.eclipse.core.resources.IFile;
+import org.eclipse.wst.common.core.search.SearchParticipant;
 import org.eclipse.wst.common.core.search.pattern.ComponentSearchPattern;
 import org.eclipse.wst.common.core.search.pattern.QualifiedName;
 
@@ -23,10 +27,15 @@
 	
 	/**
 	 * Containing element patterns
+	 * @deprecated
 	 */
 	XMLSearchPattern[] children = new XMLSearchPattern[0];
 	
-
+	/**
+	 * A map of XMLSearchPattern[] by {@link SearchParticipant search participant}.
+	 */
+	protected Map childPatternsByParticipant = new HashMap();
+	
 	public XMLComponentSearchPattern(IFile file, QualifiedName elementQName, QualifiedName typeQName, int matchRule) {
 		super(file, elementQName, typeQName, matchRule);
 		
@@ -38,13 +47,50 @@
 		
 	}
 
+	/**
+	 * @deprecated Use {@link #getChildren(SearchParticipant)} instead.
+	 */
 	public XMLSearchPattern[] getChildren(){
 		return children;
 	}
 	
+    /**
+     * @deprecated Use {@link #addChildren(SearchParticipant, XMLSearchPattern[])} instead.
+     */
 	public void setChildren(XMLSearchPattern[] patterns){
 		children = patterns;
 		
 	}
+	
+	/**
+	 * Provides the child patterns contributed by the given search participant. 
+	 * @param searchParticipant the {@link SearchParticipant search participant} that contributed the patterns.
+     * @see XMLComponentSearchPattern#addChildren(SearchParticipant, XMLSearchPattern[]) addChildren
+	 * @return an array with the {@link XMLSearchPattern patterns} contributed by the {@link SearchParticipant search participant}.
+	 */
+	public XMLSearchPattern[] getChildren(SearchParticipant searchParticipant){
+	  XMLSearchPattern[] childPatterns = getChildren();
+	  if (searchParticipant != null){
+	    childPatterns = (XMLSearchPattern[])childPatternsByParticipant.get(searchParticipant);
+	    if (childPatterns == null){
+	      childPatterns = getChildren();
+	    }
+	  }
+	  return childPatterns;
+	}
 
+	/**
+	 * Saves the child patterns contributed by the given search participant.
+	 * @param searchParticipant the {@link SearchParticipant search participant} that is contributing the child search patterns.
+	 * @param childPatterns the child patterns contributed by the {@link SearchParticipant searchParticipant search participant}.
+	 * @see XMLComponentSearchPattern#getChildren(SearchParticipant) getChildren
+	 */
+	public void addChildren(SearchParticipant searchParticipant, XMLSearchPattern[] childPatterns){
+	  if (searchParticipant != null && childPatterns != null) {
+	    childPatternsByParticipant.put(searchParticipant, childPatterns);
+	  }
+	  else {
+	    children = childPatterns;
+	  }
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchParticipant.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchParticipant.java
index 0327e77..b709f58 100644
--- 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -126,7 +126,7 @@
 		if (PatternMatcher.class.equals(adapterType) &&
 				(adaptableObject instanceof XMLSearchPattern ||
 				adaptableObject instanceof XMLComponentSearchPattern) ) {
-			return new XMLSearchPatternMatcher();
+			return new XMLSearchPatternMatcher(this);
 		} 
 		return null; 
 	}
@@ -199,7 +199,7 @@
 			if(childPattern != null){
 					childPattern.setSearchName(componentPattern.getName().getLocalName());
 					childPattern.setSearchNamespace(componentPattern.getName().getNamespace());
-	     			componentPattern.setChildren(new XMLSearchPattern[]{childPattern});
+	     			componentPattern.addChildren(this, new XMLSearchPattern[]{childPattern});
 			}
 			
 		}
@@ -211,7 +211,7 @@
 				childPattern.setSearchName(componentPattern.getName().getLocalName());
 				childPattern.setSearchNamespace(componentPattern.getName().getNamespace());				
 			}
-			componentPattern.setChildren(childPatterns);
+			componentPattern.addChildren(this, childPatterns);
 			
 		}
 	}
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
index 0b9c3d3..b38e354 100644
--- 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.wst.common.core.search.SearchMatch;
+import org.eclipse.wst.common.core.search.SearchParticipant;
 import org.eclipse.wst.common.core.search.SearchRequestor;
 import org.eclipse.wst.common.core.search.pattern.QualifiedName;
 import org.eclipse.wst.common.core.search.pattern.SearchPattern;
@@ -25,7 +26,20 @@
 
 public class XMLSearchPatternMatcher extends PatternMatcher{
 	
-
+   /**
+    * The active search participant.
+    */
+    private SearchParticipant searchParticipant;
+  
+    /**
+     * Constructs a pattern matcher given a search participant.
+     * @param searchParticipant the active {@link SearchParticipant search participant}.
+     */
+    public XMLSearchPatternMatcher(SearchParticipant searchParticipant)
+    {
+      this.searchParticipant = searchParticipant;
+    }
+    
 	protected String computeNamespaceForPrefix(Element element, String prefix)
 	{
 	  String result = null;
@@ -35,8 +49,8 @@
 		{
 		  Element e = (Element)node;
 		  String attributeName = (prefix != null && prefix.length() > 0) ? ("xmlns:" + prefix) : "xmlns";  //$NON-NLS-1$ //$NON-NLS-2$
-		  result = e.getAttribute(attributeName);
-		  if (result != null)
+		  result = e.hasAttribute(attributeName) ? e.getAttribute(attributeName) : null;
+		  if (result != null && result.length() > 0)
 		  {
 			 break;  
 		  }	  
@@ -52,8 +66,8 @@
 			pattern.setElementNamespace(domElement.getNamespaceURI());
             // TODO (cs) set the depth attribute on the pattern
             //
-			String actualValue = domElement.getAttribute(pattern.getAttributeName());
-			 if(actualValue != null){
+			String actualValue = domElement.hasAttribute(pattern.getAttributeName()) ? domElement.getAttribute(pattern.getAttributeName()) : null;
+			 if(actualValue != null && actualValue.length() > 0){
 					int n = actualValue.indexOf(":"); //$NON-NLS-1$
 					if(n > 0){
 						String prefix = actualValue.substring(0, n);
@@ -110,7 +124,10 @@
 	
 	public void locateMatches(SearchPattern pattern, IFile file, Element element, SearchRequestor requestor) {
 		if(pattern instanceof XMLComponentSearchPattern){
-			XMLSearchPattern[] childPatterns = ((XMLComponentSearchPattern)pattern).getChildren();
+			XMLSearchPattern[] childPatterns = ((XMLComponentSearchPattern)pattern).getChildren(searchParticipant);
+			if (childPatterns == null){
+			  return;
+			}
 			for (int i = 0; i < childPatterns.length; i++) {
 				PatternMatcher matcher = (PatternMatcher)childPatterns[i].getAdapter(PatternMatcher.class);
 				if(matcher == null){
@@ -135,7 +152,10 @@
 	 */
 	public boolean matches(SearchPattern pattern, Object element){
 		if(pattern instanceof XMLComponentSearchPattern){
-			XMLSearchPattern[] childPatterns = ((XMLComponentSearchPattern)pattern).getChildren();
+			XMLSearchPattern[] childPatterns = ((XMLComponentSearchPattern)pattern).getChildren(searchParticipant);
+            if (childPatterns == null){
+              return false;
+            }
 			for (int i = 0; i < childPatterns.length; i++) {
 				PatternMatcher matcher = (PatternMatcher)childPatterns[i].getAdapter(PatternMatcher.class);
 				if(matcher == null){
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/AnnotationMsg.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/AnnotationMsg.java
new file mode 100644
index 0000000..5ba65d9
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/AnnotationMsg.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ ********************************************************************************/
+package org.eclipse.wst.xml.core.internal.validation;
+
+public class AnnotationMsg {
+	public static String PROBMLEM_ID = "ProblemId"; //$NON-NLS-1$
+	public static String LENGTH = "Length"; //$NON-NLS-1$
+	public static String ATTRVALUETEXT = "AttributeValueText"; //$NON-NLS-1$
+	public static String ATTRVALUENO = "AttributeValueNo"; //$NON-NLS-1$
+	public static String ATTRNO = "AttrNo"; //$NON-NLS-1$
+	private int problemId;
+	private Object attributeValueText;
+	private int length;
+	
+	public AnnotationMsg(int problemId, Object attributeValueText, int length) {
+		super();
+		this.problemId = problemId;
+		this.attributeValueText = attributeValueText;
+		this.length = length;
+	}
+	public int getProblemId() {
+		return problemId;
+	}
+
+	public Object getAttributeValueText() {
+		return attributeValueText;
+	}
+
+	public int getLength(){
+		return length;
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/MarkupValidator.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/MarkupValidator.java
new file mode 100644
index 0000000..a6d19bf
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/MarkupValidator.java
@@ -0,0 +1,929 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.validation;
+
+import java.util.Locale;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceProxy;
+import org.eclipse.core.resources.IResourceProxyVisitor;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.validation.AbstractValidator;
+import org.eclipse.wst.validation.ValidationResult;
+import org.eclipse.wst.validation.ValidationState;
+import org.eclipse.wst.validation.internal.core.Message;
+import org.eclipse.wst.validation.internal.core.ValidationException;
+import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
+import org.eclipse.wst.validation.internal.operations.LocalizedMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
+import org.eclipse.wst.validation.internal.provisional.core.IValidator;
+import org.eclipse.wst.xml.core.internal.Logger;
+import org.eclipse.wst.xml.core.internal.XMLCoreMessages;
+import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
+import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.w3c.dom.Node;
+
+/**
+ * Basic XML syntax checking step.
+ */
+public class MarkupValidator extends AbstractValidator implements IValidator {
+	public static final int ELEMENT_ERROR_LIMIT = 25;
+    public static final int PARTIAL = 1;
+    public static final int TOTAL = 0;
+	private String DQUOTE = "\""; //$NON-NLS-1$
+	private String SQUOTE = "'"; //$NON-NLS-1$
+	
+
+	private IDocument fDocument;
+
+	private IContentType fRootContentType = null;
+
+    private IReporter fReporter = null;
+  
+	private static final String ANNOTATIONMSG = AnnotationMsg.class.getName();
+
+	public void getAnnotationMsg(IReporter reporter, int problemId, LocalizedMessage message, Object attributeValueText, int len){
+		AnnotationMsg annotation = new AnnotationMsg(problemId, attributeValueText,len);
+		message.setAttribute(ANNOTATIONMSG, annotation);
+		reporter.addMessage(this, message);
+	}
+	
+		
+	private void addAttributeError(String messageText, String attributeValueText, int start, int length, int problemId, IStructuredDocumentRegion sdRegion, IReporter reporter, int messageSeverity) {
+
+		if (sdRegion.isDeleted()) {
+			return;
+		}
+
+		int lineNo = getLineNumber(start);
+		LocalizedMessage message = new LocalizedMessage(messageSeverity, messageText);
+		message.setOffset(start);
+		message.setLength(length);
+		message.setLineNo(lineNo);
+		
+
+		getAnnotationMsg(reporter, problemId, message, attributeValueText,length);
+		
+	}
+
+	private void checkAttributesInEndTag(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
+
+		if (structuredDocumentRegion.isDeleted()) {
+			return;
+		}
+
+		ITextRegionList textRegions = structuredDocumentRegion.getRegions();
+		int errorCount = 0;
+		int start = structuredDocumentRegion.getEndOffset();
+		int end = structuredDocumentRegion.getEndOffset();
+		for (int i = 0; (i < textRegions.size()) && (errorCount < ELEMENT_ERROR_LIMIT) && !structuredDocumentRegion.isDeleted(); i++) {
+			ITextRegion textRegion = textRegions.get(i);
+			if ((textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) || (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) || (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)) {
+				if (start > structuredDocumentRegion.getStartOffset(textRegion)) {
+					start = structuredDocumentRegion.getStartOffset(textRegion);
+				}
+				end = structuredDocumentRegion.getEndOffset(textRegion);
+				errorCount++;
+			}
+		}
+		// create one error for all attributes in the end tag
+		if (errorCount > 0) {
+			// Position p = new Position(start, end - start);
+			String messageText = XMLCoreMessages.End_tag_has_attributes;
+			LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.END_TAG_WITH_ATTRIBUTES), messageText);
+			message.setOffset(start);
+			message.setLength(end - start);
+			message.setLineNo(getLineNumber(start));
+
+			getAnnotationMsg(reporter, ProblemIDsXML.AttrsInEndTag, message, null,end-start);
+			
+		}
+	}
+
+
+	private void checkClosingBracket(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
+
+		if (structuredDocumentRegion.isDeleted()) {
+			return;
+		}
+
+		ITextRegionList regions = structuredDocumentRegion.getRegions();
+		ITextRegion r = null;
+		boolean closed = false;
+		for (int i = 0; (i < regions.size()) && !structuredDocumentRegion.isDeleted(); i++) {
+			r = regions.get(i);
+			if ((r.getType() == DOMRegionContext.XML_TAG_CLOSE) || (r.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE)) {
+				closed = true;
+			}
+		}
+		if (!closed) {
+
+			String messageText = XMLCoreMessages.ReconcileStepForMarkup_6;
+
+			int start = structuredDocumentRegion.getStartOffset();
+			int length = structuredDocumentRegion.getText().trim().length();
+			int lineNo = getLineNumber(start);
+
+			LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.MISSING_CLOSING_BRACKET) , messageText);
+			message.setOffset(start);
+			message.setLength(length);
+			message.setLineNo(lineNo);
+			getAnnotationMsg(reporter, ProblemIDsXML.MissingClosingBracket, message, null,length);
+
+			
+		}
+	}
+
+	private void checkEmptyTag(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
+
+		if (structuredDocumentRegion.isDeleted()) {
+			return;
+		}
+
+		// navigate to name
+		ITextRegionList regions = structuredDocumentRegion.getRegions();
+		if (regions.size() == 2) {
+			// missing name region
+			if ((regions.get(0).getType() == DOMRegionContext.XML_TAG_OPEN) && (regions.get(1).getType() == DOMRegionContext.XML_TAG_CLOSE)) {
+				String messageText = XMLCoreMessages.ReconcileStepForMarkup_3;
+				int start = structuredDocumentRegion.getStartOffset();
+				int length = structuredDocumentRegion.getLength();
+				int lineNo = getLineNumber(start);
+
+				LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.MISSING_TAG_NAME) , messageText);
+				message.setOffset(start);
+				message.setLength(length);
+				message.setLineNo(lineNo);
+
+				getAnnotationMsg(reporter, ProblemIDsXML.EmptyTag, message, null,length);
+			}
+		}
+	}
+
+	private int getLineNumber(int start) {
+		int lineNo = -1;
+		try {
+			lineNo = getDocument().getLineOfOffset(start) + 1;
+		}
+		catch (BadLocationException e) {
+			Logger.logException(e);
+		}
+		return lineNo;
+	}
+
+	private void checkForAttributeValue(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
+		if (structuredDocumentRegion.isDeleted()) {
+			return;
+		}
+
+		// check for attributes without a value
+		// track the attribute/equals/value sequence using a state of 0, 1 ,2
+		// representing the name, =, and value, respectively
+		int attrState = 0;
+		ITextRegionList textRegions = structuredDocumentRegion.getRegions();
+		// ReconcileAnnotationKey key = createKey(structuredDocumentRegion,
+		// getScope());
+
+		int errorCount = 0;
+		for (int i = 0; (i < textRegions.size()) && (errorCount < ELEMENT_ERROR_LIMIT); i++) {
+			ITextRegion textRegion = textRegions.get(i);
+			if ((textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) || isTagCloseTextRegion(textRegion)) {
+				// dangling name and '='
+				if ((attrState == 2) && (i >= 2)) {
+					// create annotation
+					ITextRegion nameRegion = textRegions.get(i - 2);
+					if (!(nameRegion instanceof ITextRegionContainer)) {
+						Object[] args = {structuredDocumentRegion.getText(nameRegion)};
+						String messageText = NLS.bind(XMLCoreMessages.Attribute__is_missing_a_value, args);
+
+						int start = structuredDocumentRegion.getStartOffset(nameRegion);
+						int end = structuredDocumentRegion.getEndOffset();
+						int lineNo = getLineNumber(start);
+						int textLength = structuredDocumentRegion.getText(nameRegion).trim().length();
+
+						LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.ATTRIBUTE_HAS_NO_VALUE) , messageText);
+						message.setOffset(start);
+						message.setLength(textLength);
+						message.setLineNo(lineNo);
+
+						// quick fix info
+						ITextRegion equalsRegion = textRegions.get(i - 2 + 1);
+						int insertOffset = structuredDocumentRegion.getTextEndOffset(equalsRegion) - end;
+						Object[] additionalFixInfo = {structuredDocumentRegion.getText(nameRegion), new Integer(insertOffset)};
+
+						getAnnotationMsg(reporter, ProblemIDsXML.MissingAttrValue, message, additionalFixInfo,textLength);
+						errorCount++;
+					}
+				}
+				// name but no '=' (XML only)
+				else if ((attrState == 1) && (i >= 1)) {
+					// create annotation
+					ITextRegion previousRegion = textRegions.get(i - 1);
+					if (!(previousRegion instanceof ITextRegionContainer)) {
+						Object[] args = {structuredDocumentRegion.getText(previousRegion)};
+						String messageText = NLS.bind(XMLCoreMessages.Attribute__has_no_value, args);
+						int start = structuredDocumentRegion.getStartOffset(previousRegion);
+						int textLength = structuredDocumentRegion.getText(previousRegion).trim().length();
+						int lineNo = getLineNumber(start);
+
+						LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.ATTRIBUTE_HAS_NO_VALUE), messageText);
+						message.setOffset(start);
+						message.setLength(textLength);
+						message.setLineNo(lineNo);
+
+						getAnnotationMsg(reporter, ProblemIDsXML.NoAttrValue, message, structuredDocumentRegion.getText(previousRegion),textLength);
+				
+
+						errorCount++;
+					}
+				}
+				attrState = 1;
+			}
+			else if (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
+				attrState = 2;
+			}
+			else if (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+				attrState = 0;
+			}
+		}
+
+	}
+
+	private void checkForSpaceBeforeName(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
+
+		if (structuredDocumentRegion.isDeleted()) {
+			return;
+		}
+
+		String sdRegionText = structuredDocumentRegion.getFullText();
+		if (sdRegionText.startsWith(" ")) { //$NON-NLS-1$
+			IStructuredDocumentRegion prev = structuredDocumentRegion.getPrevious();
+			if (prev != null) {
+				// this is possibly the case of "< tag"
+				if ((prev.getRegions().size() == 1) && isStartTag(prev)) {
+					// add the error for preceding space in tag name
+					String messageText = XMLCoreMessages.ReconcileStepForMarkup_2;
+					int start = structuredDocumentRegion.getStartOffset();
+					// find length of whitespace
+					int length = sdRegionText.trim().equals("") ? sdRegionText.length() : sdRegionText.indexOf(sdRegionText.trim()); //$NON-NLS-1$
+
+					LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.WHITESPACE_BEFORE_TAGNAME) , messageText);
+					message.setOffset(start);
+					message.setLength(length);
+					message.setLineNo(getLineNumber(start));
+					getAnnotationMsg(reporter, ProblemIDsXML.SpacesBeforeTagName, message, null,length);
+				}
+			}
+		}
+	}
+
+	private void checkNoNamespaceInPI(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
+
+		if (structuredDocumentRegion.isDeleted()) {
+			return;
+		}
+
+		// navigate to name
+		ITextRegionList regions = structuredDocumentRegion.getRegions();
+		ITextRegion r = null;
+		int errorCount = 0;
+		for (int i = 0; (i < regions.size()) && (errorCount < ELEMENT_ERROR_LIMIT) && !structuredDocumentRegion.isDeleted(); i++) {
+			r = regions.get(i);
+			if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
+				String piText = structuredDocumentRegion.getText(r);
+				int index = piText.indexOf(":"); //$NON-NLS-1$
+				if (index != -1) {
+					String messageText = XMLCoreMessages.ReconcileStepForMarkup_4;
+					int start = structuredDocumentRegion.getStartOffset(r) + index;
+					int length = piText.trim().length() - index;
+
+					LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.NAMESPACE_IN_PI_TARGET) , messageText);
+					message.setOffset(start);
+					message.setLength(length);
+					message.setLineNo(getLineNumber(start));
+
+					
+					getAnnotationMsg(reporter, ProblemIDsXML.NamespaceInPI, message, null,length);
+
+					errorCount++;
+				}
+			}
+		}
+	}
+
+	private void checkQuotesForAttributeValues(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
+		ITextRegionList regions = structuredDocumentRegion.getRegions();
+		ITextRegion r = null;
+		String attrValueText = ""; //$NON-NLS-1$
+		int errorCount = 0;
+		for (int i = 0; (i < regions.size()) && (errorCount < ELEMENT_ERROR_LIMIT); i++) {
+			r = regions.get(i);
+			if (r.getType() != DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+				continue;
+			}
+
+			attrValueText = structuredDocumentRegion.getText(r);
+			// attribute value includes quotes in the string
+			// split up attribute value on quotes
+			/*
+			 * WORKAROUND till
+			 * http://dev.icu-project.org/cgi-bin/icu-bugs/incoming?findid=5207
+			 * is fixed. (Also see BUG143628)
+			 */
+
+			java.util.StringTokenizer st = new java.util.StringTokenizer(attrValueText, "\"'", true); //$NON-NLS-1$
+			int size = st.countTokens();
+			// get the pieces of the attribute value
+			String one = "", two = ""; //$NON-NLS-1$ //$NON-NLS-2$
+			if (size > 0) {
+				one = st.nextToken();
+			}
+			if (size > 1) {
+				two = st.nextToken();
+			}
+			if (size > 2) {
+				// should be handled by parsing...
+				// as in we can't have an attribute value like: <element
+				// attr="a"b"c"/>
+				// and <element attr='a"b"c' /> is legal
+				continue;
+			}
+
+
+			if (size == 1) {
+				if (one.equals(DQUOTE) || one.equals(SQUOTE)) {
+					// missing closing quote
+					String message = XMLCoreMessages.ReconcileStepForMarkup_0;
+					addAttributeError(message, attrValueText, structuredDocumentRegion.getStartOffset(r), attrValueText.trim().length(), ProblemIDsXML.Unclassified, structuredDocumentRegion, reporter, getPluginPreference().getInt(XMLCorePreferenceNames.MISSING_CLOSING_QUOTE));
+					errorCount++;
+				}
+				else {
+					// missing both
+					String message = XMLCoreMessages.ReconcileStepForMarkup_1;
+					addAttributeError(message, attrValueText, structuredDocumentRegion.getStartOffset(r), attrValueText.trim().length(), ProblemIDsXML.AttrValueNotQuoted, structuredDocumentRegion, reporter, getPluginPreference().getInt(XMLCorePreferenceNames.MISSING_CLOSING_QUOTE));
+					errorCount++;
+				}
+			}
+			else if (size == 2) {
+				if ((one.equals(SQUOTE) && !two.equals(SQUOTE)) || (one.equals(DQUOTE) && !two.equals(DQUOTE))) {
+					// missing closing quote
+					String message = XMLCoreMessages.ReconcileStepForMarkup_0;
+					addAttributeError(message, attrValueText, structuredDocumentRegion.getStartOffset(r), attrValueText.trim().length(), ProblemIDsXML.Unclassified, structuredDocumentRegion, reporter, getPluginPreference().getInt(XMLCorePreferenceNames.MISSING_CLOSING_QUOTE));
+					errorCount++;
+				}
+			}
+		}
+		// end of region for loop
+	}
+
+	private void checkStartEndTagPairs(IStructuredDocumentRegion sdRegion, IReporter reporter) {
+
+		if (sdRegion.isDeleted()) {
+			return;
+		}
+
+		// check start/end tag pairs
+		IDOMNode xmlNode = getXMLNode(sdRegion);
+
+		if (xmlNode == null) {
+			return;
+		}
+
+		boolean selfClosed = false;
+		String tagName = null;
+
+		/**
+		 * For tags that aren't meant to be EMPTY, make sure it's empty or has an end tag
+		 */
+		if (xmlNode.isContainer()) {
+			IStructuredDocumentRegion endRegion = xmlNode.getEndStructuredDocumentRegion();
+			if (endRegion == null) {
+				IStructuredDocumentRegion startRegion = xmlNode.getStartStructuredDocumentRegion();
+				if (startRegion != null && !startRegion.isDeleted() && DOMRegionContext.XML_TAG_OPEN.equals(startRegion.getFirstRegion().getType())) {
+					// analyze the tag (check self closing)
+					ITextRegionList regions = startRegion.getRegions();
+					ITextRegion r = null;
+					int start = sdRegion.getStart();
+					int length = sdRegion.getTextLength();
+					for (int i = 0; i < regions.size(); i++) {
+						r = regions.get(i);
+						if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
+							tagName = sdRegion.getText(r);
+							start = sdRegion.getStartOffset(r);
+							length = r.getTextLength();
+						}
+						else if (r.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
+							selfClosed = true;
+						}
+					}
+
+
+					if (!selfClosed && (tagName != null)) {
+						Object[] args = {tagName};
+						String messageText = NLS.bind(XMLCoreMessages.Missing_end_tag_, args);
+
+						int lineNumber = getLineNumber(start);
+
+						LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.MISSING_END_TAG) , messageText);
+						message.setOffset(start);
+						message.setLength(length);
+						message.setLineNo(lineNumber);
+						Object[] additionalFixInfo = getStartEndFixInfo(xmlNode, tagName, r);
+	
+						getAnnotationMsg(reporter, ProblemIDsXML.MissingEndTag, message, additionalFixInfo,length);
+					}
+				}
+			}
+			else {
+				IStructuredDocumentRegion startRegion = xmlNode.getStartStructuredDocumentRegion();
+				if (startRegion == null || startRegion.isDeleted()) {
+					// analyze the tag (check self closing)
+					ITextRegionList regions = endRegion.getRegions();
+					ITextRegion r = null;
+					int start = sdRegion.getStart();
+					int length = sdRegion.getTextLength();
+					for (int i = 0; i < regions.size(); i++) {
+						r = regions.get(i);
+						if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
+							tagName = sdRegion.getText(r);
+							start = sdRegion.getStartOffset(r);
+							length = r.getTextLength();
+						}
+					}
+
+					if (tagName != null) {
+						Object[] args = {tagName};
+						String messageText = NLS.bind(XMLCoreMessages.Missing_start_tag_, args);
+
+						int lineNumber = getLineNumber(start);
+
+						LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.MISSING_START_TAG), messageText);
+						message.setOffset(start);
+						message.setLength(length);
+						message.setLineNo(lineNumber);
+						Object[] additionalFixInfo = getStartEndFixInfo(xmlNode, tagName, r);
+												
+						getAnnotationMsg(reporter, ProblemIDsXML.MissingStartTag, message, additionalFixInfo,length);
+						
+					}
+				}
+			}
+
+		}
+		/*
+		 * Check for an end tag that has no start tag
+		 */
+		else {
+			IStructuredDocumentRegion startRegion = xmlNode.getStartStructuredDocumentRegion();
+			if (startRegion == null) {
+				IStructuredDocumentRegion endRegion = xmlNode.getEndStructuredDocumentRegion();
+				if (!endRegion.isDeleted()) {
+					// get name
+					ITextRegionList regions = endRegion.getRegions();
+					ITextRegion r = null;
+					for (int i = 0; i < regions.size(); i++) {
+						r = regions.get(i);
+						if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
+							tagName = sdRegion.getText(r);
+						}
+					}
+
+					if (!selfClosed && (tagName != null)) {
+						String messageText = XMLCoreMessages.Indicate_no_grammar_specified_severities_error;
+
+						int start = sdRegion.getStart();
+						int lineNumber = getLineNumber(start);
+
+						// SEVERITY_STRUCTURE == IMessage.HIGH_SEVERITY
+						IMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
+						message.setOffset(start);
+						message.setLength(sdRegion.getTextLength());
+						message.setLineNo(lineNumber);
+
+						reporter.addMessage(this, message);
+					}
+				}
+			}
+		}
+	}
+
+	private Object[] getStartEndFixInfo(IDOMNode xmlNode, String tagName, ITextRegion r) {
+		// quick fix info
+		String tagClose = "/>"; //$NON-NLS-1$
+		int tagCloseOffset = xmlNode.getFirstStructuredDocumentRegion().getEndOffset();
+		if ((r != null) && (r.getType() == DOMRegionContext.XML_TAG_CLOSE)) {
+			tagClose = "/"; //$NON-NLS-1$
+			tagCloseOffset--;
+		}
+		IDOMNode firstChild = (IDOMNode) xmlNode.getFirstChild();
+		while ((firstChild != null) && (firstChild.getNodeType() == Node.TEXT_NODE)) {
+			firstChild = (IDOMNode) firstChild.getNextSibling();
+		}
+		int endOffset = xmlNode.getEndOffset(); 
+		int firstChildStartOffset = firstChild == null ? endOffset : firstChild.getStartOffset();
+		Object[] additionalFixInfo = {tagName, tagClose, new Integer(tagCloseOffset), new Integer(xmlNode.getFirstStructuredDocumentRegion().getEndOffset()), // startTagEndOffset
+					new Integer(firstChildStartOffset), // firstChildStartOffset
+					new Integer(endOffset)}; // endOffset
+		return additionalFixInfo;
+	}
+
+	private void checkStartingSpaceForPI(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
+
+		if (structuredDocumentRegion.isDeleted()) {
+			return;
+		}
+
+		IStructuredDocumentRegion prev = structuredDocumentRegion.getPrevious();
+		if ((prev != null) && prev.getStartOffset() == 0) {
+			if (prev.getType() == DOMRegionContext.XML_CONTENT) {
+				String messageText = XMLCoreMessages.ReconcileStepForMarkup_5;
+				int start = prev.getStartOffset();
+				int length = prev.getLength();
+
+				LocalizedMessage message = new LocalizedMessage(getPluginPreference().getInt(XMLCorePreferenceNames.WHITESPACE_AT_START) , messageText);
+				message.setOffset(start);
+				message.setLength(length);
+				message.setLineNo(getLineNumber(start));
+
+			
+				getAnnotationMsg(reporter, ProblemIDsXML.SpacesBeforePI, message, null,length);
+				
+				// Position p = new Position(start, length);
+				//				
+				// ReconcileAnnotationKey key =
+				// createKey(structuredDocumentRegion, getScope());
+				// TemporaryAnnotation annotation = new TemporaryAnnotation(p,
+				// SEVERITY_SYNTAX_ERROR, message, key,
+				// ProblemIDsXML.SpacesBeforePI);
+				// results.add(annotation);
+			}
+		}
+	}
+
+	public int getScope() {
+		return PARTIAL;
+	}
+
+	private IDOMNode getXMLNode(IStructuredDocumentRegion sdRegion) {
+
+		if (sdRegion == null) {
+			return null;
+		}
+
+		IStructuredModel xModel = null;
+		IDOMNode xmlNode = null;
+		// get/release models should always be in a try/finally block
+		try {
+			xModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
+			// xModel is sometime null, when closing editor, for example
+			if (xModel != null) {
+				xmlNode = (IDOMNode) xModel.getIndexedRegion(sdRegion.getStart());
+			}
+		}
+		finally {
+			if (xModel != null) {
+				xModel.releaseFromRead();
+			}
+		}
+		return xmlNode;
+	}
+
+	/**
+	 * Determines whether the IStructuredDocumentRegion is a XML "end tag"
+	 * since they're not allowed to have attribute ITextRegions
+	 * 
+	 * @param structuredDocumentRegion
+	 */
+	private boolean isEndTag(IStructuredDocumentRegion structuredDocumentRegion) {
+		if ((structuredDocumentRegion == null) || structuredDocumentRegion.isDeleted()) {
+			return false;
+		}
+		return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_END_TAG_OPEN;
+	}
+
+	/**
+	 * Determines if the IStructuredDocumentRegion is an XML Processing
+	 * Instruction
+	 * 
+	 * @param structuredDocumentRegion
+	 * 
+	 */
+	private boolean isPI(IStructuredDocumentRegion structuredDocumentRegion) {
+		if ((structuredDocumentRegion == null) || structuredDocumentRegion.isDeleted()) {
+			return false;
+		}
+		return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_PI_OPEN;
+	}
+
+	/**
+	 * Determines whether the IStructuredDocumentRegion is a XML "start tag"
+	 * since they need to be checked for proper XML attribute region sequences
+	 * 
+	 * @param structuredDocumentRegion
+	 * 
+	 */
+	private boolean isStartTag(IStructuredDocumentRegion structuredDocumentRegion) {
+		if ((structuredDocumentRegion == null) || structuredDocumentRegion.isDeleted()) {
+			return false;
+		}
+		return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_TAG_OPEN;
+	}
+
+	// Because we check the "proper" closing separately from attribute
+	// sequencing, we need to know what's
+	// an appropriate close.
+	private boolean isTagCloseTextRegion(ITextRegion textRegion) {
+		return (textRegion.getType() == DOMRegionContext.XML_TAG_CLOSE) || (textRegion.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE);
+	}
+
+	/**
+	 * Determines if the IStructuredDocumentRegion is XML Content
+	 * 
+	 * @param structuredDocumentRegion
+	 * 
+	 */
+	private boolean isXMLContent(IStructuredDocumentRegion structuredDocumentRegion) {
+		if ((structuredDocumentRegion == null) || structuredDocumentRegion.isDeleted()) {
+			return false;
+		}
+		return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_CONTENT;
+	}
+
+	private IDocument getDocument() {
+		return fDocument;
+	}
+
+	public void connect(IDocument document) {
+		fDocument = document;
+	}
+
+	public void disconnect(IDocument document) {
+		fDocument = null;
+	}
+
+	public void validate(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
+
+		if (structuredDocumentRegion == null) {
+			return;
+		}
+
+		if (isStartTag(structuredDocumentRegion)) {
+			// check for attributes without a value
+			checkForAttributeValue(structuredDocumentRegion, reporter);
+			// check if started tag is ended
+			checkStartEndTagPairs(structuredDocumentRegion, reporter);
+			// check empty tag <>
+			checkEmptyTag(structuredDocumentRegion, reporter);
+			// check that each attribute has quotes
+			checkQuotesForAttributeValues(structuredDocumentRegion, reporter);
+			// check that the closing '>' is there
+			checkClosingBracket(structuredDocumentRegion, reporter);
+		}
+		else if (isEndTag(structuredDocumentRegion)) {
+			// check if ending tag was started
+			checkStartEndTagPairs(structuredDocumentRegion, reporter);
+			// check for attributes in an end tag
+			checkAttributesInEndTag(structuredDocumentRegion, reporter);
+			// check that the closing '>' is there
+			checkClosingBracket(structuredDocumentRegion, reporter);
+		}
+		else if (isPI(structuredDocumentRegion)) {
+			// check validity of processing instruction
+			checkStartingSpaceForPI(structuredDocumentRegion, reporter);
+			checkNoNamespaceInPI(structuredDocumentRegion, reporter);
+		}
+		else if (isXMLContent(structuredDocumentRegion)) {
+			checkForSpaceBeforeName(structuredDocumentRegion, reporter);
+		}
+		else if (isXMLDoctypeDeclaration(structuredDocumentRegion)) {
+			checkDocumentTypeReferences(structuredDocumentRegion, reporter);
+		}
+	}
+
+	/**
+	 * @param structuredDocumentRegion
+	 * @param reporter
+	 */
+	private void checkDocumentTypeReferences(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
+	}
+
+	/**
+	 * @param structuredDocumentRegion
+	 * @return
+	 */
+	private boolean isXMLDoctypeDeclaration(IStructuredDocumentRegion structuredDocumentRegion) {
+		if ((structuredDocumentRegion == null) || structuredDocumentRegion.isDeleted()) {
+			return false;
+		}
+		return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_DECLARATION_OPEN && structuredDocumentRegion.getType().equals(DOMRegionContext.XML_DOCTYPE_DECLARATION);
+	}
+
+	public void cleanup(IReporter reporter) {
+		fDocument = null;
+	}
+
+	public void validate(IValidationContext helper, IReporter reporter) throws ValidationException {
+		String[] uris = helper.getURIs();
+		IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
+		if (uris.length > 0) {
+			IFile currentFile = null;
+
+			for (int i = 0; i < uris.length && !reporter.isCancelled(); i++) {
+				// might be called with just project path?
+				IPath path = new Path(uris[i]);
+				if (path.segmentCount() > 1) {
+					currentFile = wsRoot.getFile(path);
+					if (shouldValidate(currentFile, true)) {
+						validateV1File(currentFile, reporter);
+					}
+				}
+				else if (uris.length == 1) {
+					validateV1Project(helper, reporter);
+				}
+			}
+		}
+		else
+			validateV1Project(helper, reporter);
+	}
+	
+	private boolean shouldValidate(IResourceProxy proxy) {
+		if(proxy.getType() == IResource.FILE) {
+			String name = proxy.getName();
+			if(name.toLowerCase(Locale.US).endsWith(".xml")) { //$NON-NLS-1$
+				return true;
+			}
+		}
+		return shouldValidate(proxy.requestResource(), false);
+	}
+	
+	private boolean shouldValidate(IResource file, boolean checkExtension) {
+		if (file == null || !file.exists() || file.getType() != IResource.FILE)
+			return false;
+		if (checkExtension) {
+			String extension = file.getFileExtension();
+			if (extension != null && "xml".endsWith(extension.toLowerCase(Locale.US))) //$NON-NLS-1$
+				return true;
+		}
+
+		IContentDescription contentDescription = null;
+		try {
+			contentDescription = ((IFile) file).getContentDescription();
+			if (contentDescription != null) {
+				IContentType contentType = contentDescription.getContentType();
+				return contentDescription != null && contentType.isKindOf(getXMLContentType());
+			}
+		}
+		catch (CoreException e) {
+			Logger.logException(e);
+		}
+		return false;
+	}
+
+	/**
+	 * @param helper
+	 * @param reporter
+	 */
+	private void validateV1Project(IValidationContext helper, final IReporter reporter) {
+		// if uris[] length 0 -> validate() gets called for each project
+		if (helper instanceof IWorkbenchContext) {
+			IProject project = ((IWorkbenchContext) helper).getProject();
+			IResourceProxyVisitor visitor = new IResourceProxyVisitor() {
+				public boolean visit(IResourceProxy proxy) throws CoreException {
+					if (shouldValidate(proxy)) {
+						validateV1File((IFile) proxy.requestResource(), reporter);
+					}
+					return true;
+				}
+			};
+			try {
+				// collect all jsp files for the project
+				project.accept(visitor, IResource.DEPTH_INFINITE);
+			}
+			catch (CoreException e) {
+				Logger.logException(e);
+			}
+		}
+	}
+	
+
+	/**
+	 * @param currentFile
+	 * @param reporter
+	 */
+	private void validateV1File(IFile currentFile, IReporter reporter) {
+		Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, currentFile.getFullPath().toString().substring(1));
+		reporter.displaySubtask(MarkupValidator.this, message);
+
+		IStructuredModel model = null;
+		try {
+			model = StructuredModelManager.getModelManager().getModelForRead(currentFile);
+			IStructuredDocument document = null;
+			if (model != null) {
+				document = model.getStructuredDocument();
+				connect(document);
+				IStructuredDocumentRegion validationRegion = document.getFirstStructuredDocumentRegion();
+				while (validationRegion != null) {
+					validate(validationRegion, reporter);
+					validationRegion = validationRegion.getNext();
+				}
+				disconnect(document);
+			}
+		}
+		catch (Exception e) {
+			Logger.logException(e);
+		}
+		finally {
+			if (model != null) {
+				model.releaseFromRead();
+			}
+		}
+	}
+
+	/**
+	 * @return
+	 */
+	private IContentType getXMLContentType() {
+		if (fRootContentType == null) {
+			fRootContentType = Platform.getContentTypeManager().getContentType("org.eclipse.core.runtime.xml"); //$NON-NLS-1$
+		}
+		return fRootContentType;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.validation.AbstractValidator#validate(org.eclipse.core.resources.IResource, int, org.eclipse.wst.validation.ValidationState, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
+		if (resource.getType() != IResource.FILE)
+			return null;
+		ValidationResult result = new ValidationResult();
+		fReporter = result.getReporter(monitor);
+
+		validateV1File((IFile) resource, fReporter);
+		
+		return result;
+	}
+	
+	public IReporter validate(IResource resource, int kind, ValidationState state) {
+		validate(resource,kind,state,new NullProgressMonitor());
+		return fReporter;
+	}
+	private Preferences getPluginPreference(){
+		return XMLCorePlugin.getDefault().getPluginPreferences();
+	}
+
+	public void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter) {
+		if (getDocument() == null) {
+			return;
+		}
+		if (!(getDocument() instanceof IStructuredDocument)) {
+			return;
+		}
+
+		// remove old messages
+		reporter.removeAllMessages(this);
+
+		IStructuredDocumentRegion[] regions = ((IStructuredDocument) fDocument).getStructuredDocumentRegions(dirtyRegion.getOffset(), dirtyRegion.getLength());
+		for (int i = 0; i < regions.length; i++) {
+			validate(regions[i], reporter);
+		}
+	}
+	
+
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ProblemIDsXML.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ProblemIDsXML.java
new file mode 100644
index 0000000..cf34e74
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ProblemIDsXML.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 20010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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;
+
+public interface ProblemIDsXML {
+	int AttrsInEndTag = 3;
+	int AttrValueNotQuoted = 13;
+	int EmptyTag = 1;
+	int InvalidAttrValue = 11;
+	int MissingAttrValue = 4;
+	int MissingClosingBracket = 14;
+	int MissingEndTag = 2;
+	int MissingRequiredAttr = 12;
+	int MissingStartTag = 15;
+	int NamespaceInPI = 8;
+	int NoAttrValue = 5;
+	int SpacesBeforePI = 7;
+	int SpacesBeforeTagName = 6;
+	int Unclassified = 0;
+	int UnknownAttr = 10;
+	int UnknownElement = 9;
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java
index 96c578c..57cae08 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java
@@ -15,7 +15,6 @@
 import java.io.Reader;
 import java.net.URL;
 import java.util.List;
-import com.ibm.icu.util.StringTokenizer;
 import java.util.Vector;
 
 import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
@@ -28,6 +27,8 @@
 import org.xml.sax.XMLReader;
 import org.xml.sax.ext.LexicalHandler;
 
+import com.ibm.icu.util.StringTokenizer;
+
 /**
  * A helper class for the XML validator.
  * 
@@ -255,8 +256,11 @@
         }
         
         location = URIResolverPlugin.createResolver().resolve(baseURI, rootElementNamespace, location);    
-        location = URIResolverPlugin.createResolver().resolvePhysicalLocation(baseURI, rootElementNamespace, location);                                                    
-        location = URIHelper.addImpliedFileProtocol(location);
+        location = URIResolverPlugin.createResolver().resolvePhysicalLocation(baseURI, rootElementNamespace, location);
+        if (location != null)
+        {
+          location = URIHelper.addImpliedFileProtocol(location);
+        }
         
         schemaLocationString = location;
         
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLNestedValidatorContext.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLNestedValidatorContext.java
new file mode 100644
index 0000000..29c5e7e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLNestedValidatorContext.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.validation;
+
+
+import java.util.HashSet;
+
+import org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext;
+
+
+/**
+ * XMLNestedValidatorContext is used to store state data needed during an XML
+ * validation session.
+ */
+public class XMLNestedValidatorContext extends NestedValidatorContext
+{
+  /**
+   * A set of inaccessible locations URIs (String).
+   */
+  private HashSet inaccessibleLocationURIs = new HashSet();
+
+  /**
+   * Determines if a location URI was marked as inaccessible.
+   * 
+   * @param locationURI
+   *          the location URI to test. Must not be null.
+   * @return true if a location URI was marked as inaccessible, false otherwise.
+   */
+  public boolean isURIMarkedInaccessible(String locationURI)
+  {
+    return locationURI != null && inaccessibleLocationURIs.contains(locationURI);
+  }
+
+  /**
+   * Marks the given location URI as inaccessible.
+   * 
+   * @param locationURI
+   *          the location URI to mark as inaccessible. Must not be null.
+   */
+  public void markURIInaccessible(String locationURI)
+  {
+    if (locationURI != null)
+    {
+      inaccessibleLocationURIs.add(locationURI);
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationConfiguration.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationConfiguration.java
index 2b01b88..dd451551 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationConfiguration.java
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationConfiguration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2006, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     David Carver (STAR) - bug 297005 - Some static constants not made final.
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.validation;
 
@@ -22,10 +23,15 @@
   /**
    * @deprecated
    */
-  public static String WARN_NO_GRAMMAR = "WARN_NO_GRAMMAR"; //$NON-NLS-1$
-  public static String INDICATE_NO_GRAMMAR = "INDICATE_NO_GRAMMAR"; //$NON-NLS-1$
+  public static final String WARN_NO_GRAMMAR = "WARN_NO_GRAMMAR"; //$NON-NLS-1$
+  public static final String INDICATE_NO_GRAMMAR = "INDICATE_NO_GRAMMAR"; //$NON-NLS-1$
+  public static final String USE_XINCLUDE = "USE_XINCLUDE"; //$NON-NLS-1$
+  public static final String HONOUR_ALL_SCHEMA_LOCATIONS = "HONOUR_ALL_SCHEMA_LOCATIONS"; //$NON-NLS-1$
+
   private boolean warn_no_grammar_value = false;
   private int indicate_no_grammar_value = 1;
+  private boolean use_xinclude = false;
+  private boolean honour_all_schema_locations_value = false;
   
   /**
    * Set a feature of this configuration.
@@ -41,6 +47,10 @@
   {
 	if(WARN_NO_GRAMMAR.equals(feature))
 	  warn_no_grammar_value = value;
+    else if(USE_XINCLUDE.equals(feature))
+      use_xinclude = value;
+    else if(HONOUR_ALL_SCHEMA_LOCATIONS.equals(feature))
+      honour_all_schema_locations_value = value;
 	else
 	  throw new Exception("Feature not recognized."); //$NON-NLS-1$
 	
@@ -81,7 +91,11 @@
   {
 	if(WARN_NO_GRAMMAR.equals(feature))
 	  return warn_no_grammar_value;
-	
+	else if(USE_XINCLUDE.equals(feature))
+      return use_xinclude;
+    if(HONOUR_ALL_SCHEMA_LOCATIONS.equals(feature))
+      return honour_all_schema_locations_value;
+			
 	throw new Exception("Feature not recognized."); //$NON-NLS-1$
   }
 
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationInfo.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationInfo.java
index 888bc40..1113eb9 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationInfo.java
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationInfo.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -190,6 +190,9 @@
 	  return errorCustomizationManager;
   }
   
+  /**
+   * @deprecated Use {@link XMLValidationConfiguration} instead.
+   */
   public boolean isUseXInclude() {
 	  return XMLCorePlugin.getDefault().getPluginPreferences().getBoolean(XMLCorePreferenceNames.USE_XINCLUDE);
   }
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 1a44faf..e088fca 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -40,6 +40,7 @@
 import org.apache.xerces.xni.XNIException;
 import org.apache.xerces.xni.parser.XMLEntityResolver;
 import org.apache.xerces.xni.parser.XMLInputSource;
+import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.IWorkspace;
 import org.eclipse.core.resources.ResourcesPlugin;
@@ -49,8 +50,14 @@
 import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
 import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
 import org.eclipse.wst.validation.ValidationResult;
+import org.eclipse.wst.validation.internal.ValOperation;
+import org.eclipse.wst.validation.internal.operations.LocalizedMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
 import org.eclipse.wst.xml.core.internal.Logger;
+import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
+import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
 import org.eclipse.wst.xml.core.internal.validation.core.LazyURLInputStream;
+import org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
@@ -81,7 +88,11 @@
   protected static final String NO_GRAMMAR_FOUND = "NO_GRAMMAR_FOUND"; //$NON-NLS-1$
   
   private static final String FILE_NOT_FOUND_KEY = "FILE_NOT_FOUND"; //$NON-NLS-1$
-
+   
+  private MarkupValidator val = new MarkupValidator();
+  
+  private final String ANNOTATIONMSG = AnnotationMsg.class.getName();
+ 
   /**
    * Constructor.
    */
@@ -96,10 +107,10 @@
     // Here we add some error keys that we need to adjust the location information for.
     // The location information will be adjusted to place the message on the line of the starting
     // element instead of on the line of the closing element.
-    adjustLocationErrorKeySet.add("MSG_CONTENT_INVALID");
-    adjustLocationErrorKeySet.add("MSG_CONTENT_INCOMPLETE");
-    adjustLocationErrorKeySet.add("cvc-complex-type.2.4.b");
-    adjustLocationErrorKeySet.add("cvc-complex-type.2.3");
+    adjustLocationErrorKeySet.add("MSG_CONTENT_INVALID"); //$NON-NLS-1$
+    adjustLocationErrorKeySet.add("MSG_CONTENT_INCOMPLETE"); //$NON-NLS-1$
+    adjustLocationErrorKeySet.add("cvc-complex-type.2.4.b"); //$NON-NLS-1$
+    adjustLocationErrorKeySet.add("cvc-complex-type.2.3"); //$NON-NLS-1$
   }
 
   /**
@@ -166,7 +177,6 @@
       reader.setFeature("http://xml.org/sax/features/namespaces", valinfo.isNamespaceEncountered());               //$NON-NLS-1$
       reader.setFeature("http://xml.org/sax/features/validation", valinfo.isGrammarEncountered());  //$NON-NLS-1$
       reader.setFeature("http://apache.org/xml/features/validation/schema", valinfo.isGrammarEncountered()); //$NON-NLS-1$
-   	  reader.setFeature("http://apache.org/xml/features/xinclude", valinfo.isUseXInclude()); //$NON-NLS-1$      
       reader.setContentHandler(new DefaultHandler()
       {
         public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
@@ -214,7 +224,7 @@
     StringBuffer fileString = new StringBuffer();
     try
     {
-      InputStreamReader inputReader = new InputStreamReader(inputStream, "UTF-8");
+      InputStreamReader inputReader = new InputStreamReader(inputStream, "UTF-8"); //$NON-NLS-1$
       BufferedReader reader = new BufferedReader(inputReader);
       char[] chars = new char[1024];
       int numberRead = reader.read(chars);
@@ -275,7 +285,28 @@
    */
   public XMLValidationReport validate(String uri, InputStream inputStream, XMLValidationConfiguration configuration, ValidationResult result)
   {
-    String grammarFile = "";
+	  return validate(uri, inputStream, configuration, null, null);
+  }
+  
+  /**
+   * Validate the inputStream
+   * 
+   * @param uri 
+   *    The URI of the file to validate.
+   * @param inputstream
+   *    The inputStream of the file to validate
+   * @param configuration
+   *    A configuration for this validation session.
+   * @param result
+   *    The validation result
+   * @param context
+   *    The validation context   
+   * @return 
+   *    Returns an XML validation report.
+   */
+  public XMLValidationReport validate(String uri, InputStream inputStream, XMLValidationConfiguration configuration, ValidationResult result, NestedValidatorContext context)
+  {
+    String grammarFile = ""; //$NON-NLS-1$
     Reader reader1 = null; // Used for the preparse.
     Reader reader2 = null; // Used for validation parse.
     
@@ -287,7 +318,7 @@
     } 
         
     XMLValidationInfo valinfo = new XMLValidationInfo(uri);
-    MyEntityResolver entityResolver = new MyEntityResolver(uriResolver); 
+    MyEntityResolver entityResolver = new MyEntityResolver(uriResolver, context); 
     ValidatorHelper helper = new ValidatorHelper(); 
     try
     {  
@@ -298,6 +329,15 @@
         valinfo.setGrammarEncountered(helper.isGrammarEncountered);
         
         XMLReader reader = createXMLReader(valinfo, entityResolver);
+        // Set the configuration option
+        if (configuration.getFeature(XMLValidationConfiguration.HONOUR_ALL_SCHEMA_LOCATIONS))
+        {
+            reader.setFeature("http://apache.org/xml/features/honour-all-schemaLocations", true); //$NON-NLS-1$
+        }
+        if (configuration.getFeature(XMLValidationConfiguration.USE_XINCLUDE))
+        {
+          reader.setFeature("http://apache.org/xml/features/xinclude", true); //$NON-NLS-1$      
+        }
         XMLErrorHandler errorhandler = new XMLErrorHandler(valinfo);
         reader.setErrorHandler(errorhandler);
         
@@ -350,11 +390,53 @@
         Logger.logException(e.getLocalizedMessage(), e);
       }
     }
+
+    if ( XMLCorePlugin.getDefault().getPluginPreferences().getBoolean(XMLCorePreferenceNames.MARKUP_VALIDATION)){
+	    IReporter reporter = executeMarkupValidator(uri);
+	    if (reporter != null){
+		    List msgList = reporter.getMessages();
+		    for (int i = 0;i < msgList.size();i++){
+		    	LocalizedMessage msg = (LocalizedMessage)msgList.get(i);
+		    	if (msg.getSeverity() == 2)
+		    		valinfo.addError(msg.getLocalizedMessage(), msg.getLineNumber(), msg.getOffset(),valinfo.getFileURI(),"null",getMsgArguments(msg) ); //$NON-NLS-1$
+		    	else if (msg.getSeverity() == 1)
+		    		valinfo.addWarning(msg.getLocalizedMessage(), msg.getLineNumber(), msg.getOffset(),valinfo.getFileURI(),"null", getMsgArguments(msg)); //$NON-NLS-1$
+		    }
+	    }
+    }
     
     return valinfo;
        
   }
 
+  private Object[] getMsgArguments(LocalizedMessage msg){
+	  Object obj = msg.getAttribute(ANNOTATIONMSG);
+	  return new Object[]{obj};
+  }
+ 
+
+	private IReporter executeMarkupValidator(String uri){
+		Path path = new Path(uri);
+		String fileProtocol = "file://"; //$NON-NLS-1$
+		int index = uri.indexOf(fileProtocol);
+		
+		IFile resource = null;
+		if (index == 0){
+			String transformedUri = uri.substring(fileProtocol.length());
+			Path transformedPath = new Path(transformedUri);
+			resource = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(transformedPath);
+		}
+		else {
+			resource = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+			
+		}
+		IReporter reporter = null;
+		if (resource != null){
+		    reporter = val.validate(resource, 0, new ValOperation().getState()) ;
+		}
+		return reporter;
+	}
+  
   /**
    * Add a validation message to the specified list.
    * 
@@ -419,15 +501,18 @@
   {
     private URIResolver uriResolver;
     private String resolvedDTDLocation;
+    private NestedValidatorContext context;
    
     /**
      * Constructor.
      * 
      * @param uriResolver The URI resolver to use with this entity resolver.
+     * @param context The XML validator context.
      */
-    public MyEntityResolver(URIResolver uriResolver)
+    public MyEntityResolver(URIResolver uriResolver, NestedValidatorContext context)
     {
       this.uriResolver = uriResolver;
+      this.context = context;
     }
     
     /* (non-Javadoc)
@@ -435,20 +520,12 @@
      */
     public XMLInputSource resolveEntity(XMLResourceIdentifier rid) throws XNIException, IOException
     {
-      try
-      {
-        XMLInputSource inputSource = _internalResolveEntity(uriResolver, rid);
+        XMLInputSource inputSource = _internalResolveEntity(uriResolver, rid, context);
         if (inputSource != null)
         {
           resolvedDTDLocation = inputSource.getSystemId();
         }
         return inputSource;
-      }
-      catch(IOException e)
-      {
-        //e.printStackTrace();   
-      }      
-      return null;
     }
    
     public String getLocation()
@@ -462,6 +539,11 @@
   // identical code.  In any case we should strive to ensure that the validators perform resolution consistently. 
   public static XMLInputSource _internalResolveEntity(URIResolver uriResolver, XMLResourceIdentifier rid) throws  IOException
   {
+    return _internalResolveEntity(uriResolver, rid, null);
+  }
+  
+  public static XMLInputSource _internalResolveEntity(URIResolver uriResolver, XMLResourceIdentifier rid, NestedValidatorContext context) throws  IOException
+  {
     XMLInputSource is = null;
     
     if (uriResolver != null)
@@ -481,6 +563,18 @@
       if (location != null)
       {                     
         String physical = uriResolver.resolvePhysicalLocation(rid.getBaseSystemId(), id, location);
+
+        // if physical is already a known bad uri, just go ahead and throw an exception
+        if (context instanceof XMLNestedValidatorContext)
+        {
+          XMLNestedValidatorContext xmlContext = ((XMLNestedValidatorContext)context);
+
+          if (xmlContext.isURIMarkedInaccessible(physical))
+          {
+        	 throw new FileNotFoundException(physical);
+          }
+        }
+        
         is = new XMLInputSource(rid.getPublicId(), location, location);
         
         // This block checks that the file exists. If it doesn't we need to throw
@@ -492,6 +586,16 @@
         {
           isTemp = new URL(physical).openStream();
         }
+        catch (IOException e)
+        {
+          // physical was a bad url, so cache it so we know next time
+          if (context instanceof XMLNestedValidatorContext)
+          {
+            XMLNestedValidatorContext xmlContext = ((XMLNestedValidatorContext)context);
+            xmlContext.markURIInaccessible(physical);
+          }
+          throw e;
+        }
         finally
         {
           if(isTemp != null)
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/AbstractNestedValidator.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/AbstractNestedValidator.java
index 2398980..4183f42 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/AbstractNestedValidator.java
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/AbstractNestedValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,7 +18,6 @@
 import java.util.Locale;
 
 import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -35,6 +34,7 @@
 import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
 import org.eclipse.wst.validation.internal.provisional.core.IValidator;
 import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob;
+import org.eclipse.wst.xml.core.internal.validation.AnnotationMsg;
 
 /**
  * An abstract validator that assists validators in running and contributing
@@ -48,10 +48,8 @@
   // Locally used, non-UI strings.
   private static final String REFERENCED_FILE_ERROR_OPEN = "referencedFileError("; //$NON-NLS-1$
   private static final String REFERENCED_FILE_ERROR_CLOSE = ")"; //$NON-NLS-1$
-  private static final String REFERENCED_FILE_ERROR = "referencedFileError"; //$NON-NLS-1$
   private static final String FILE_PROTOCOL_NO_SLASH = "file:"; //$NON-NLS-1$
   private static final String FILE_PROTOCOL = "file:///"; //$NON-NLS-1$
-  private static final String GROUP_NAME = "groupName"; //$NON-NLS-1$
   private final String GET_FILE = "getFile"; //$NON-NLS-1$
   private final String GET_PROJECT_FILES = "getAllFiles"; //$NON-NLS-1$
   private final String GET_INPUTSTREAM = "inputStream"; //$NON-NLS-1$
@@ -67,12 +65,25 @@
   public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor){
 	  ValidationResult result = new ValidationResult();  
 	  IReporter reporter = result.getReporter(monitor);
-	  NestedValidatorContext nestedcontext = new NestedValidatorContext();
-		setupValidation(nestedcontext);
 		IFile file = null;
 		if (resource instanceof IFile)file = (IFile)resource;
-		if (file != null)validate(file, null, result, reporter, nestedcontext);
-		teardownValidation(nestedcontext);
+		if (file != null)
+		{
+		  NestedValidatorContext nestedcontext = getNestedContext(state, false);
+	      boolean teardownRequired = false;
+	      if (nestedcontext == null)
+	      {
+	        // validationstart was not called, so manually setup and tear down
+	        nestedcontext = getNestedContext(state, true);
+	        setupValidation(nestedcontext);
+	        teardownRequired = true;
+	      }
+
+		  validate(file, null, result, reporter, nestedcontext);
+
+	      if (teardownRequired)
+	        teardownValidation(nestedcontext);
+		}
 	    return result;
   }
  
@@ -100,9 +111,9 @@
 	      { 
 	    	// The helper may not have a file stored in it but may have an InputStream if being
 	    	// called from a source other than the validation framework such as an editor.
-	        if (context.loadModel(GET_INPUTSTREAM) instanceof InputStream) //$NON-NLS-1$
+	        if (context.loadModel(GET_INPUTSTREAM) instanceof InputStream)
 	        {
-	          validate(file, (InputStream)context.loadModel(GET_INPUTSTREAM), null, reporter, nestedcontext); //do we need the fileName?  what is int ruleGroup? //$NON-NLS-1$
+	          validate(file, (InputStream)context.loadModel(GET_INPUTSTREAM), null, reporter, nestedcontext); //do we need the fileName?  what is int ruleGroup?
 	        }
 	        else
 	        {
@@ -118,14 +129,17 @@
     {
       Object []parms = {getValidatorID()};
       Collection files = (Collection) context.loadModel(GET_PROJECT_FILES, parms);
-      Iterator iter = files.iterator();
-      while (iter.hasNext() && !reporter.isCancelled()) 
-      {
-        IFile file = (IFile) iter.next();
-        if(shouldValidate(file))
-        {
-	      validate(file, null, null, reporter, nestedcontext);
-        }
+      // files can be null if they're outside of the workspace
+      if (files != null) {
+	      Iterator iter = files.iterator();
+	      while (iter.hasNext() && !reporter.isCancelled()) 
+	      {
+	        IFile file = (IFile) iter.next();
+	        if(shouldValidate(file))
+	        {
+		      validate(file, null, null, reporter, nestedcontext);
+	        }
+	      }
       }
     }
 	
@@ -403,7 +417,28 @@
       
       message.setLineNo(validationMessage.getLineNumber());
       addInfoToMessage(validationMessage, message);
-      
+      Object[] objlist = validationMessage.getMessageArguments();
+      if (objlist != null && objlist.length ==1 ){
+    	  Object obj = objlist[0];
+    	  if (obj instanceof AnnotationMsg){
+	    	 message.setAttribute(AnnotationMsg.PROBMLEM_ID, new Integer(((AnnotationMsg)obj).getProblemId()));
+	    	 message.setAttribute(AnnotationMsg.LENGTH, new Integer(((AnnotationMsg)obj).getLength()));
+	    	  Object obj1 = ((AnnotationMsg)obj).getAttributeValueText();
+	    	  if (obj1 instanceof String){
+	    		  message.setAttribute(AnnotationMsg.ATTRVALUETEXT, obj1);
+	    	  }
+	    	  else if ( obj1 instanceof Object[]){
+	    		  Object[] objArray = (Object[])obj1;
+	    		  message.setAttribute(AnnotationMsg.ATTRVALUENO, new Integer(objArray.length));
+	    		  for (int j=0; j <objArray.length;j++){
+	    			  Object obj2 = objArray[j];
+	    			  String attrName = AnnotationMsg.ATTRNO + j;
+	    			  message.setAttribute(attrName, obj2);
+	    		  }
+	    		  
+	    	  }
+    	  }
+      }
       List nestederrors = validationMessage.getNestedMessages();
       if (nestederrors != null && !nestederrors.isEmpty())
       {
@@ -413,30 +448,6 @@
       reporter.addMessage(this, message);
 	      
     }
-    try
-    {
-      IMarker[] markers = iFile.findMarkers(null, true, IResource.DEPTH_INFINITE);
-      for (int i = 0; i < markers.length; i++)
-      {
-        IMarker marker = markers[i];
-        String groupName = null;
-        try
-        {
-          groupName = (String) marker.getAttribute(GROUP_NAME);
-        }
-        catch (Exception e)
-        {
-        }
-        if (groupName != null && groupName.startsWith(REFERENCED_FILE_ERROR))
-        {
-          marker.setAttribute(IMarker.DONE, true);
-        }
-      }
-    }
-    catch (CoreException e)
-    {
-      e.printStackTrace();
-    }
   }
 	  
   /**
@@ -448,9 +459,28 @@
    */
   protected void addInfoToMessage (ValidationMessage validationmessage, IMessage message)
   { 
-	// This method may be overidden by subclasses
+	// This method may be overridden by subclasses
   }
-	  
+
+  /**
+   * Get the nested validation context.
+   * 
+   * @param state
+   *          the validation state.
+   * @param create
+   *          when true, a new context will be created if one is not found
+   * @return the nested validation context.
+   */
+  protected NestedValidatorContext getNestedContext(ValidationState state, boolean create)
+  {
+    NestedValidatorContext context = null;
+    if (create)
+    {
+      context = new NestedValidatorContext();
+    }
+    return context;
+  }
+
   /**
    * A localized message is a specialized type of IMessage that allows setting
    * and using a localized message string for a message.
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationInfo.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationInfo.java
index fa2e1a5..f8f5e07 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationInfo.java
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationInfo.java
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     David Carver (STAR) - bug 297005 - Some static constants not made final.
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.validation.core;
 
@@ -27,8 +28,8 @@
 public class ValidationInfo implements ValidationReport
 {
   private boolean WRAPPER_ERROR_SUPPORT_ENABLED = true;
-  public static int SEV_ERROR = 0;
-  public static int SEV_WARNING = 1;
+  public static final int  SEV_ERROR = 0;
+  public static final int SEV_WARNING = 1;
   
   private String validating_file_uri = null;
   private URL validating_file_url = null;
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 5e1dcf7..e2662c0 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
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     David Carver (STAR) - bug 297005 - Some static constants not made final.
  *******************************************************************************/
 
 package org.eclipse.wst.xml.core.internal.validation.core;
@@ -34,9 +35,9 @@
   protected Object[] messageArguments;
   protected int startOffset;
   protected int severity = IMessage.NORMAL_SEVERITY;
-  public static int SEV_HIGH = IMessage.HIGH_SEVERITY;
-  public static int SEV_NORMAL = IMessage.NORMAL_SEVERITY;
-  public static int SEV_LOW = IMessage.LOW_SEVERITY;
+  public static final int SEV_HIGH = IMessage.HIGH_SEVERITY;
+  public static final int SEV_NORMAL = IMessage.NORMAL_SEVERITY;
+  public static final int SEV_LOW = IMessage.LOW_SEVERITY;
 
   /**
    * Constructor.
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/Validator.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/Validator.java
index 79acb37..4aae874 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/Validator.java
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/Validator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,10 +13,15 @@
 
 import java.io.InputStream;
 
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Preferences;
 import org.eclipse.wst.validation.ValidationResult;
+import org.eclipse.wst.validation.ValidationState;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
 import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
 import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
+import org.eclipse.wst.xml.core.internal.validation.XMLNestedValidatorContext;
 import org.eclipse.wst.xml.core.internal.validation.XMLValidationConfiguration;
 import org.eclipse.wst.xml.core.internal.validation.XMLValidationReport;
 import org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator;
@@ -26,6 +31,7 @@
 
 public class Validator extends AbstractNestedValidator
 {
+  private static final String XML_VALIDATOR_CONTEXT = "org.eclipse.wst.xml.core.validatorContext"; //$NON-NLS-1$
   protected int indicateNoGrammar = 0;
   
   /**
@@ -54,22 +60,17 @@
     XMLValidationConfiguration configuration = new XMLValidationConfiguration();
     try
     {
+      Preferences pluginPreferences = XMLCorePlugin.getDefault().getPluginPreferences();
       configuration.setFeature(XMLValidationConfiguration.INDICATE_NO_GRAMMAR, indicateNoGrammar);
+      configuration.setFeature(XMLValidationConfiguration.USE_XINCLUDE, pluginPreferences.getBoolean(XMLCorePreferenceNames.USE_XINCLUDE));
+      configuration.setFeature(XMLValidationConfiguration.HONOUR_ALL_SCHEMA_LOCATIONS, pluginPreferences.getBoolean(XMLCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS));
     }
     catch(Exception e)
     {
       // TODO: Unable to set the preference. Log this problem.
     }
     
-    XMLValidationReport valreport = null;
-    if (inputstream != null)
-    {
-      valreport = validator.validate(uri, inputstream, configuration, result);
-    }
-    else
-    {
-      valreport = validator.validate(uri, null, configuration, result);
-    }
+    XMLValidationReport valreport = validator.validate(uri, inputstream, configuration, result, context);
               
     return valreport;
   }
@@ -96,4 +97,55 @@
       message.setAttribute(SQUIGGLE_NAME_OR_VALUE_ATTRIBUTE, messageInfo[1]);
 	}
   }
+  
+  /**
+   * Get the nested validation context.
+   * 
+   * @param state
+   *          the validation state.
+   * @param create
+   *          when true, a new context will be created if one is not found
+   * @return the nested validation context.
+   */
+  protected NestedValidatorContext getNestedContext(ValidationState state, boolean create)
+  {
+    NestedValidatorContext context = null;
+    Object o = state.get(XML_VALIDATOR_CONTEXT);
+    if (o instanceof XMLNestedValidatorContext)
+      context = (XMLNestedValidatorContext)o;
+    else if (create)
+    {
+      context = new XMLNestedValidatorContext();
+    }
+    return context;
+  }
+  
+  public void validationStarting(IProject project, ValidationState state, IProgressMonitor monitor)
+  {
+    if (project != null)
+    {
+      NestedValidatorContext context = getNestedContext(state, false);
+      if (context == null)
+      {
+        context = getNestedContext(state, true);
+        setupValidation(context);
+        state.put(XML_VALIDATOR_CONTEXT, context);
+      }
+      super.validationStarting(project, state, monitor);
+    }
+  }
+  
+  public void validationFinishing(IProject project, ValidationState state, IProgressMonitor monitor)
+  {
+    if (project != null)
+    {
+      super.validationFinishing(project, state, monitor);
+      NestedValidatorContext context = getNestedContext(state, false);
+      if (context != null)
+      {
+        teardownValidation(context);
+        state.put(XML_VALIDATOR_CONTEXT, null);
+      }
+    }
+  }
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/xmlvalidation.properties b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/xmlvalidation.properties
index 91fc0ce..161065a 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/xmlvalidation.properties
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/xmlvalidation.properties
@@ -18,14 +18,14 @@
 ! Usage:
 !   {0} replaced with the file name
 !
-_UI_PROBLEMS_VALIDATING_FILE_NOT_FOUND           = The file cannot be validated as the XML Schema "{0}" that is specified as describing the syntax of the file cannot be located.
+_UI_PROBLEMS_VALIDATING_FILE_NOT_FOUND           = The file cannot be validated as the XML definition "{0}" that is specified as describing the syntax of the file cannot be located.
 
 _UI_PROBLEMS_CONNECTION_REFUSED                  = The file cannot be validated as there was a connection problem.
 
 !
 ! Referenced File Dialog Related Message
 !
-_UI_REF_FILE_ERROR_MESSAGE                       = Referenced file contains errors ({0}).  For more information, right click on the message and select "Show Details..."
+_UI_REF_FILE_ERROR_MESSAGE                       = Referenced file contains errors ({0}).  For more information, right click on the message in the Problems View and select "Show Details..."
 
 # Warning when no grammar is located.
 _WARN_NO_GRAMMAR                                 = No grammar constraints (DTD or XML schema) detected for the document.
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCoreMessages.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCoreMessages.java
index 7d05ad0..831c0a2 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCoreMessages.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCoreMessages.java
@@ -1,11 +1,12 @@
 /**********************************************************************
- * Copyright (c) 2005 IBM Corporation and others. All rights reserved.   This
+ * Copyright (c) 2005, 2010 IBM Corporation and others. All rights reserved.   This
  * program and the accompanying materials are made available under the terms of
  * the Eclipse Public License v1.0 which accompanies this distribution, and is
  * available at http://www.eclipse.org/legal/epl-v10.html
  * 
  * Contributors: 
  * IBM - Initial API and implementation
+ * Jesper Steen Moeller - Added XML Catalogs 1.1 support
  **********************************************************************/
 package org.eclipse.wst.xml.core.internal;
 
@@ -26,10 +27,30 @@
 	public static String loading;
 	public static String Catalog_entry_key_not_set;
 	public static String Catalog_entry_uri_not_set;
+	public static String Catalog_rewrite_startString_not_set;
+	public static String Catalog_rewrite_prefix_not_set;
+	public static String Catalog_suffix_string_not_set;
+	public static String Catalog_suffix_uri_not_set;
+	public static String Catalog_delegate_prefix_not_set;
+	public static String Catalog_delegate_catalog_not_set;
 	public static String Catalog_next_catalog_location_uri_not_set;
 	public static String Catalog_resolution_null_catalog;
 	public static String Catalog_resolution_malformed_url;
 	public static String Catalog_resolution_io_exception;
+	public static String CMDocument_load_exception;
+	public static String End_tag_has_attributes;
+	public static String Attribute__is_missing_a_value;
+	public static String Attribute__has_no_value;
+	public static String Missing_end_tag_;
+	public static String Missing_start_tag_;
+	public static String ReconcileStepForMarkup_0;
+	public static String ReconcileStepForMarkup_1;
+	public static String ReconcileStepForMarkup_2;
+	public static String ReconcileStepForMarkup_3;
+	public static String ReconcileStepForMarkup_4;
+	public static String ReconcileStepForMarkup_5;
+	public static String ReconcileStepForMarkup_6;
+	public static String Indicate_no_grammar_specified_severities_error;
 
 	static {
 		// load message values from bundle file
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePluginResources.properties b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePluginResources.properties
index ca630a2..d9f1fb7 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePluginResources.properties
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePluginResources.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2005 IBM Corporation and others.
+# Copyright (c) 2001, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
 # Contributors:
 #     IBM Corporation - initial API and implementation
 #     Jens Lukowski/Innoopract - initial renaming/restructuring
+#     Jesper Steen Moeller - Added XML Catalogs 1.1 support
 #     
 ###############################################################################
 Invalid_character_lt_fo_ERROR_=Invalid character ('<') found
@@ -19,8 +20,28 @@
 loading=loading 
 # catalog strings
 Catalog_entry_key_not_set=Catalog entry key is not set
-Catalog_entry_uri_not_set=Catalog entry uri is not set
-Catalog_next_catalog_location_uri_not_set=Next catalog location uri is not set
+Catalog_entry_uri_not_set=Catalog entry URI is not set
+Catalog_rewrite_startString_not_set=Catalog rewrite start string is not set
+Catalog_rewrite_prefix_not_set=Catalog rewrite prefix is not set
+Catalog_suffix_string_not_set=Catalog suffix string is not set
+Catalog_suffix_uri_not_set=Catalog suffix URI is not set
+Catalog_delegate_prefix_not_set=Catalog delegate prefix is not set
+Catalog_delegate_catalog_not_set=Catalog delegate URI is not set
+Catalog_next_catalog_location_uri_not_set=Next catalog location URI is not set
 Catalog_resolution_null_catalog=Catalog resolution attempted with null catalog; ignored
 Catalog_resolution_malformed_url=Malformed URL exception trying to resolve
 Catalog_resolution_io_exception=I/O exception trying to resolve
+CMDocument_load_exception=An error occurred while loading document {0} with publicId {1}
+End_tag_has_attributes=End tag has attributes
+Attribute__is_missing_a_value=Attribute \"{0}\" is missing a value
+Attribute__has_no_value=Attribute \"{0}\"  has no value
+Missing_start_tag_=Missing start tag \"{0}\"
+Missing_end_tag_=Missing end tag \"{0}\"
+ReconcileStepForMarkup_0=Missing closing quote
+ReconcileStepForMarkup_1=Missing quotes for attribute value
+ReconcileStepForMarkup_2=A tagname cannot start with a space
+ReconcileStepForMarkup_3=Empty tags are not allowed
+ReconcileStepForMarkup_4=Namespaces are not allowed in a Processing Instruction target
+ReconcileStepForMarkup_5=Spaces are not allowed before a Processing Instruction
+ReconcileStepForMarkup_6=Tag missing closing bracket '>'
+Indicate_no_grammar_specified_severities_error=ErrorCMDocument_load_exception=An error occurred while loading document {0} with publicId {1}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/CleanupProcessorXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/CleanupProcessorXML.java
index e62e98b..05a4af4 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/CleanupProcessorXML.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/CleanupProcessorXML.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,16 +17,56 @@
 import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupHandler;
 import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences;
 import org.eclipse.wst.sse.core.internal.cleanup.StructuredCleanupPreferences;
+import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
 import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
+import org.eclipse.wst.xml.core.internal.document.DOMModelImpl;
+import org.eclipse.wst.xml.core.internal.document.TextImpl;
 import org.eclipse.wst.xml.core.internal.formatter.XMLFormatterFormatProcessor;
 import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
 import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.w3c.dom.Node;
+import org.w3c.dom.ProcessingInstruction;
 
 
 public class CleanupProcessorXML extends AbstractStructuredCleanupProcessor {
 	protected IStructuredCleanupPreferences fCleanupPreferences = null;
+	
+	public void cleanupModel(IStructuredModel structuredModel) {
+		Preferences preferences = getModelPreferences();
+		if (preferences != null && preferences.getBoolean(XMLCorePreferenceNames.FIX_XML_DECLARATION)) {
+			IDOMDocument document = ((DOMModelImpl) structuredModel).getDocument();
+			if (!fixExistingXmlDecl(document)) {
+				String encoding = preferences.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
+				Node xml = document.createProcessingInstruction("xml", "version=\"1.0\" " + "encoding=\"" + encoding +"\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+				document.insertBefore(xml, document.getFirstChild());
+			}
+		}
+		super.cleanupModel(structuredModel);
+	}
+
+	/**
+	 * Is the node an XML declaration
+	 * @param node
+	 * @return true if the node is an XML declaration; otherwise, false.
+	 */
+	private boolean isXMLDecl(IDOMNode node) {
+		return node != null && node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE && "xml".equalsIgnoreCase(((ProcessingInstruction) node).getTarget()); //$NON-NLS-1$
+	}
+
+	private boolean fixExistingXmlDecl(IDOMDocument document) {
+		IDOMNode node = (IDOMNode) document.getFirstChild();
+		while (node != null && node.getNodeType() == Node.TEXT_NODE && ((TextImpl) node).isWhitespace())
+			node = (IDOMNode) node.getNextSibling();
+		if (isXMLDecl(node)) {
+			document.insertBefore(node, document.getFirstChild());
+			return true;
+		}
+		return false;
+	}
 
 	protected IStructuredCleanupHandler getCleanupHandler(Node node) {
 		short nodeType = node.getNodeType();
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/ElementNodeCleanupHandler.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/ElementNodeCleanupHandler.java
index fcf9a21..10baa53 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/ElementNodeCleanupHandler.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/ElementNodeCleanupHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (Intalion) - Cleanup Repeated Conditional check in isXMLType method
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.cleanup;
 
@@ -469,7 +469,7 @@
 	private boolean isXMLType(IDOMModel structuredModel) {
 		boolean result = false;
 
-		if (structuredModel != null && structuredModel != null) {
+		if (structuredModel != null) {
 			IDOMDocument document = structuredModel.getDocument();
 
 			if (document != null)
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementConfiguration.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementConfiguration.java
index 73133b2..ef49f57 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementConfiguration.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementConfiguration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,10 +14,13 @@
 
 
 
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.InvalidRegistryObjectException;
 import org.eclipse.wst.xml.core.internal.Logger;
 import org.eclipse.wst.xml.core.internal.commentelement.CommentElementAdapter;
 import org.eclipse.wst.xml.core.internal.commentelement.CommentElementHandler;
@@ -40,28 +43,24 @@
 	private String[] fPrefix = null;
 	private boolean fXMLComment;
 
-	CommentElementConfiguration() {
-		super();
-	}
-
 	CommentElementConfiguration(IConfigurationElement element) {
 		super();
 		fElement = element;
-		fCustom = (element.getName().equalsIgnoreCase("handler-custom")) ? true : false; //$NON-NLS-1$
+		fCustom = element.getName().equalsIgnoreCase("handler-custom"); //$NON-NLS-1$
 
 		fillAttributes(element);
 
 		fXMLComment = fJSPComment = false;
 		String commentType = getProperty("commenttype"); //$NON-NLS-1$
-		if (commentType.equalsIgnoreCase("xml")) { //$NON-NLS-1$
+		if ("xml".equalsIgnoreCase(commentType)) { //$NON-NLS-1$
 			fXMLComment = true;
-		} else if (commentType.equalsIgnoreCase("jsp")) { //$NON-NLS-1$
+		} else if ("jsp".equalsIgnoreCase(commentType)) { //$NON-NLS-1$
 			fJSPComment = true;
-		} else if (commentType.equalsIgnoreCase("both")) { //$NON-NLS-1$
+		} else if ("both".equalsIgnoreCase(commentType)) { //$NON-NLS-1$
 			fXMLComment = fJSPComment = true;
 		}
 		String empty = getProperty("isempty"); //$NON-NLS-1$
-		fEmpty = (empty != null && !empty.equals("false")) ? true : false; //$NON-NLS-1$
+		fEmpty = Boolean.valueOf(empty).booleanValue(); //$NON-NLS-1$
 	}
 
 	public boolean acceptJSPComment() {
@@ -108,7 +107,9 @@
 						fHandler = (CommentElementHandler) fElement.createExecutableExtension("class"); //$NON-NLS-1$
 					} else {
 						String elementName = getProperty("elementname"); //$NON-NLS-1$
-						fHandler = new BasicCommentElementHandler(elementName, fEmpty);
+						if (elementName != null) {
+							fHandler = new BasicCommentElementHandler(elementName, fEmpty);
+						}
 					}
 					//					((AbstractCommentElementHandler)fHandler).setElementPrefix(fElement.getAttribute("prefix"));
 				} catch (Exception e) {
@@ -175,9 +176,23 @@
 				if (isCustom()) { // custom
 					IConfigurationElement[] prefixes = fElement.getChildren("startwith"); //$NON-NLS-1$	
 					if (prefixes != null) {
-						fPrefix = new String[prefixes.length];
+						List prefixValues = new ArrayList(prefixes.length);
 						for (int i = 0; i < prefixes.length; i++) {
-							fPrefix[i] = prefixes[i].getAttribute("prefix"); //$NON-NLS-1$	
+							String prefix = prefixes[i].getAttribute("prefix"); //$NON-NLS-1$
+							if (prefix != null) {
+								prefixValues.add(prefix);
+							}
+							else {
+								try {
+									Logger.log(Logger.WARNING, "misconfigured comment element in" + fElement.getContributor().getName(), new IllegalArgumentException("startwith")); //$NON-NLS-1$ //$NON-NLS-2$
+								}
+								catch (InvalidRegistryObjectException e) {
+									// stale bundle?
+								}
+							}
+						}
+						if (!prefixValues.isEmpty()) {
+							fPrefix = (String[]) prefixValues.toArray(new String[prefixValues.size()]);
 						}
 					}
 				} else { // basic
@@ -196,8 +211,7 @@
 			}
 		}
 		if (fPrefix == null) {
-			fPrefix = new String[1];
-			fPrefix[0] = ""; //$NON-NLS-1$
+			fPrefix = new String[0];
 		}
 		return fPrefix;
 	}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/IntStack.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/IntStack.java
index 1d1052d..52dbae6 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/IntStack.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/IntStack.java
@@ -94,6 +94,21 @@
 	}
 
 	public int size() {
-		return list.length;
+		return size;
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	public String toString() {
+		StringBuffer s = new StringBuffer(getClass().getName() + ":" +size + " [");
+		for (int i = 0; i < size; i++) {
+			s.append(list[i]);
+			if(i < size - 1) {
+				s.append(", ");
+			}
+		}
+		s.append("]");
+		return s.toString();
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLDeclDetector.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLDeclDetector.java
index 40d0fde..4bc3552 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLDeclDetector.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLDeclDetector.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (STAR) - bug 297006 - String Comparison
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.contenttype;
 
@@ -32,13 +32,13 @@
 
 	private boolean canHandleAsUnicodeStream(String tokenType) {
 		boolean canHandleAsUnicodeStream = false;
-		if (tokenType == EncodingParserConstants.UTF83ByteBOM) {
+		if (EncodingParserConstants.UTF83ByteBOM.equals(tokenType)) {
 			canHandleAsUnicodeStream = true;
 			//fUnicode = "UTF-8"; //$NON-NLS-1$
-		} else if (tokenType == EncodingParserConstants.UTF16BE) {
+		} else if (EncodingParserConstants.UTF16BE.equals(tokenType)) {
 			canHandleAsUnicodeStream = true;
 			//fUnicode = "UTF-16BE"; //$NON-NLS-1$
-		} else if (tokenType == EncodingParserConstants.UTF16LE) {
+		} else if (EncodingParserConstants.UTF16LE.equals(tokenType)) {
 			canHandleAsUnicodeStream = true;
 			//fUnicode = "UTF-16"; //$NON-NLS-1$
 		}
@@ -95,7 +95,7 @@
 				//fReader = new InputStreamReader(fReader, fUnicode);
 				// parseInput();
 			} else {
-				if (tokenType == XMLHeadTokenizerConstants.XMLDelEncoding) {
+				if (XMLHeadTokenizerConstants.XMLDelEncoding.equals(tokenType)) {
 					fIsXML = true;
 				}
 			}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizer.java
index 3eab68b..76fb40b 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizer.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizer.java
@@ -1,7 +1,7 @@
-/* The following code was generated by JFlex 1.4 on 7/5/05 1:19 AM */
+/* The following code was generated by JFlex 1.4.2 on 7/28/08 9:29 AM */
 
 /*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -22,9 +22,9 @@
 
 /**
  * This class is a scanner generated by 
- * <a href="http://www.jflex.de/">JFlex</a> 1.4
- * on 7/5/05 1:19 AM from the specification file
- * <tt>D:/builds/Workspaces/PureHeadWTP_M7/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer.jFlex</tt>
+ * <a href="http://www.jflex.de/">JFlex</a> 1.4.2
+ * on 7/28/08 9:29 AM from the specification file
+ * <tt>D:/workspaces/wtp301/workspace/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer.jFlex</tt>
  */
 public class XMLHeadTokenizer {
 
@@ -56,14 +56,14 @@
    * Translates characters to character classes
    */
   private static final String ZZ_CMAP_PACKED = 
-    "\11\0\1\6\1\11\2\0\1\10\22\0\1\6\1\0\1\32\2\0"+
-    "\1\34\1\0\1\33\24\0\1\12\1\7\1\31\1\13\3\0\1\26"+
-    "\1\27\1\20\1\0\1\30\1\0\1\23\2\0\1\16\1\15\1\25"+
-    "\1\24\2\0\1\21\1\22\2\0\1\17\1\0\1\14\12\0\1\26"+
-    "\1\27\1\20\1\0\1\30\1\0\1\23\2\0\1\16\1\15\1\25"+
-    "\1\24\2\0\1\21\1\22\2\0\1\17\1\0\1\14\102\0\1\4"+
-    "\3\0\1\5\17\0\1\3\16\0\1\1\20\0\1\3\16\0\1\1"+
-    "\1\2\170\0\1\2\ufe87\0";
+    "\1\11\10\0\1\6\1\10\2\0\1\7\22\0\1\6\1\0\1\33"+
+    "\2\0\1\35\1\0\1\34\24\0\1\13\1\12\1\32\1\14\3\0"+
+    "\1\27\1\30\1\21\1\0\1\31\1\0\1\24\2\0\1\17\1\16"+
+    "\1\26\1\25\2\0\1\22\1\23\2\0\1\20\1\0\1\15\12\0"+
+    "\1\27\1\30\1\21\1\0\1\31\1\0\1\24\2\0\1\17\1\16"+
+    "\1\26\1\25\2\0\1\22\1\23\2\0\1\20\1\0\1\15\102\0"+
+    "\1\4\3\0\1\5\17\0\1\3\16\0\1\1\20\0\1\3\16\0"+
+    "\1\1\1\2\170\0\1\2\ufe87\0";
 
   /** 
    * Translates characters to character classes
@@ -76,13 +76,16 @@
   private static final int [] ZZ_ACTION = zzUnpackAction();
 
   private static final String ZZ_ACTION_PACKED_0 =
-    "\7\0\11\1\2\2\1\1\1\3\1\4\1\5\1\6"+
-    "\1\5\1\7\1\5\1\7\1\5\1\10\2\11\1\12"+
-    "\1\13\4\0\1\14\3\0\1\15\1\0\1\16\1\17"+
-    "\11\0\1\20\4\0\1\21\1\0\1\22";
+    "\7\0\13\1\2\2\1\1\1\2\1\3\1\4\1\5"+
+    "\1\6\1\1\1\5\1\7\1\1\1\5\1\10\1\1"+
+    "\1\11\1\12\1\13\12\0\1\14\5\0\1\2\1\3"+
+    "\1\4\1\6\2\0\1\15\1\7\2\0\1\10\1\11"+
+    "\1\16\3\0\1\14\4\0\1\2\1\15\14\0\1\17"+
+    "\5\0\1\17\6\0\1\20\3\0\1\20\2\0\1\21"+
+    "\1\0\1\21\1\0";
 
   private static int [] zzUnpackAction() {
-    int [] result = new int[62];
+    int [] result = new int[111];
     int offset = 0;
     offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
     return result;
@@ -129,9 +132,6 @@
   /** the textposition at the last accepting state */
   private int zzMarkedPos;
 
-  /** the textposition at the last state to be included in yytext */
-  private int zzPushbackPos;
-
   /** the current text position in the buffer */
   private int zzCurrentPos;
 
@@ -198,7 +198,7 @@
                 zzMarkedPos = 0;
 
                 /* the textposition at the last state to be included in yytext */
-                zzPushbackPos = 0;
+//                zzPushbackPos = 0;
 
                 /* the current text position in the buffer */
                 zzCurrentPos = 0;
@@ -305,7 +305,7 @@
     char [] map = new char[0x10000];
     int i = 0;  /* index in packed string  */
     int j = 0;  /* index in unpacked array */
-    while (i < 148) {
+    while (i < 150) {
       int  count = packed.charAt(i++);
       char value = packed.charAt(i++);
       do map[j++] = value; while (--count > 0);
@@ -333,7 +333,6 @@
       zzEndRead-= zzStartRead;
       zzCurrentPos-= zzStartRead;
       zzMarkedPos-= zzStartRead;
-      zzPushbackPos-= zzStartRead;
       zzStartRead = 0;
     }
 
@@ -349,13 +348,23 @@
     int numRead = zzReader.read(zzBuffer, zzEndRead,
                                             zzBuffer.length-zzEndRead);
 
-    if (numRead < 0) {
-      return true;
-    }
-    else {
+    if (numRead > 0) {
       zzEndRead+= numRead;
       return false;
     }
+    // unlikely but not impossible: read 0 characters, but not at end of stream    
+    if (numRead == 0) {
+      int c = zzReader.read();
+      if (c == -1) {
+        return true;
+      } else {
+        zzBuffer[zzEndRead++] = (char) c;
+        return false;
+      }     
+    }
+
+	// numRead < 0
+    return true;
   }
 
     
@@ -386,7 +395,7 @@
     zzAtBOL  = true;
     zzAtEOF  = false;
     zzEndRead = zzStartRead = 0;
-    zzCurrentPos = zzMarkedPos = zzPushbackPos = 0;
+    zzCurrentPos = zzMarkedPos = 0;
     yychar = 0;
     zzLexicalState = YYINITIAL;
   }
@@ -540,6 +549,7 @@
           else {
             boolean eof = zzRefill();
             zzMarkedPosL = zzMarkedPos;
+            zzEndReadL = zzEndRead;
             zzBufferL = zzBuffer;
             if (eof) 
               zzAtBOL = false;
@@ -605,323 +615,733 @@
                 case 2: zzIsFinal = true; zzState = 9; break zzForNext;
                 case 3: zzIsFinal = true; zzState = 10; break zzForNext;
                 case 6: 
-                case 8: 
-                case 9: zzIsFinal = true; zzState = 11; break zzForNext;
-                case 10: zzIsFinal = true; zzState = 12; break zzForNext;
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 11; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 12; break zzForNext;
+                case 11: zzIsFinal = true; zzState = 13; break zzForNext;
                 default: zzIsFinal = true; zzNoLookAhead = true; zzState = 7; break zzForNext;
               }
 
             case 2:
               switch (zzInput) {
-                case 11: zzIsFinal = true; zzState = 13; break zzForNext;
-                case 15: zzIsFinal = true; zzState = 14; break zzForNext;
-                case 16: zzIsFinal = true; zzState = 15; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 14; break zzForNext;
+                case 12: zzIsFinal = true; zzState = 15; break zzForNext;
+                case 16: zzIsFinal = true; zzState = 16; break zzForNext;
+                case 17: zzIsFinal = true; zzState = 17; break zzForNext;
                 default: zzIsFinal = true; zzNoLookAhead = true; zzState = 7; break zzForNext;
               }
 
             case 3:
               switch (zzInput) {
                 case 6: 
-                case 8: zzIsFinal = true; zzState = 17; break zzForNext;
-                case 9: zzIsFinal = true; zzState = 18; break zzForNext;
-                case 26: zzIsFinal = true; zzNoLookAhead = true; zzState = 19; break zzForNext;
-                case 27: zzIsFinal = true; zzNoLookAhead = true; zzState = 20; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 16; break zzForNext;
+                case 7: zzIsFinal = true; zzState = 19; break zzForNext;
+                case 8: zzIsFinal = true; zzState = 20; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 21; break zzForNext;
+                case 27: zzIsFinal = true; zzState = 22; break zzForNext;
+                case 28: zzIsFinal = true; zzState = 23; break zzForNext;
+                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 18; break zzForNext;
               }
 
             case 4:
               switch (zzInput) {
+                case 7: 
                 case 8: 
-                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 22; break zzForNext;
-                case 11: zzIsFinal = true; zzState = 23; break zzForNext;
-                case 26: zzIsFinal = true; zzNoLookAhead = true; zzState = 24; break zzForNext;
-                case 27: zzIsFinal = true; zzState = 25; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 21; break zzForNext;
+                case 11: zzIsFinal = true; zzState = 25; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 26; break zzForNext;
+                case 12: zzIsFinal = true; zzState = 27; break zzForNext;
+                case 27: zzIsFinal = true; zzState = 28; break zzForNext;
+                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 24; break zzForNext;
               }
 
             case 5:
               switch (zzInput) {
+                case 7: 
                 case 8: 
-                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 22; break zzForNext;
-                case 27: zzIsFinal = true; zzState = 26; break zzForNext;
-                case 28: zzIsFinal = true; zzState = 27; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 21; break zzForNext;
+                case 11: zzIsFinal = true; zzState = 25; break zzForNext;
+                case 28: zzIsFinal = true; zzState = 28; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 29; break zzForNext;
+                case 29: zzIsFinal = true; zzState = 30; break zzForNext;
+                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 24; break zzForNext;
               }
 
             case 6:
               switch (zzInput) {
-                case 11: zzIsFinal = true; zzState = 27; break zzForNext;
+                case 11: zzIsFinal = true; zzState = 25; break zzForNext;
+                case 12: zzIsFinal = true; zzState = 30; break zzForNext;
                 case 6: 
-                case 8: 
-                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 28; break zzForNext;
-                case 26: zzIsFinal = true; zzNoLookAhead = true; zzState = 29; break zzForNext;
-                case 27: zzIsFinal = true; zzState = 30; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 21; break zzForNext;
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 31; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 32; break zzForNext;
+                case 27: 
+                case 28: zzIsFinal = true; zzState = 33; break zzForNext;
+                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 24; break zzForNext;
               }
 
             case 8:
               switch (zzInput) {
-                case 2: zzIsFinal = true; zzNoLookAhead = true; zzState = 31; break zzForNext;
+                case 2: zzIsFinal = true; zzNoLookAhead = true; zzState = 34; break zzForNext;
                 default: break zzForAction;
               }
 
             case 9:
               switch (zzInput) {
-                case 1: zzIsFinal = true; zzNoLookAhead = true; zzState = 32; break zzForNext;
+                case 1: zzIsFinal = true; zzNoLookAhead = true; zzState = 35; break zzForNext;
                 default: break zzForAction;
               }
 
             case 10:
               switch (zzInput) {
-                case 4: zzState = 33; break zzForNext;
+                case 4: zzState = 36; break zzForNext;
                 default: break zzForAction;
               }
 
             case 11:
               switch (zzInput) {
                 case 6: 
-                case 8: 
-                case 9: zzState = 34; break zzForNext;
-                case 10: zzState = 35; break zzForNext;
+                case 7: 
+                case 8: zzState = 37; break zzForNext;
+                case 9: zzState = 38; break zzForNext;
+                case 11: zzState = 39; break zzForNext;
                 default: break zzForAction;
               }
 
             case 12:
               switch (zzInput) {
-                case 11: zzState = 36; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzState = 37; break zzForNext;
+                case 11: zzState = 39; break zzForNext;
                 default: break zzForAction;
               }
 
             case 13:
               switch (zzInput) {
-                case 25: zzIsFinal = true; zzNoLookAhead = true; zzState = 37; break zzForNext;
+                case 9: zzState = 40; break zzForNext;
+                case 12: zzState = 41; break zzForNext;
                 default: break zzForAction;
               }
 
             case 14:
               switch (zzInput) {
-                case 16: zzState = 38; break zzForNext;
+                case 12: zzState = 42; break zzForNext;
+                case 16: zzState = 43; break zzForNext;
+                case 17: zzState = 44; break zzForNext;
                 default: break zzForAction;
               }
 
             case 15:
               switch (zzInput) {
-                case 21: zzState = 39; break zzForNext;
+                case 9: zzState = 45; break zzForNext;
+                case 26: zzIsFinal = true; zzState = 46; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 16:
+              switch (zzInput) {
+                case 9: zzState = 47; break zzForNext;
+                case 17: zzState = 48; break zzForNext;
                 default: break zzForAction;
               }
 
             case 17:
               switch (zzInput) {
-                case 6: 
-                case 8: zzIsFinal = true; zzState = 17; break zzForNext;
-                case 9: zzState = 40; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 16; break zzForNext;
+                case 9: zzState = 49; break zzForNext;
+                case 22: zzState = 50; break zzForNext;
+                default: break zzForAction;
               }
 
-            case 18:
+            case 19:
               switch (zzInput) {
                 case 6: 
-                case 8: zzIsFinal = true; zzState = 17; break zzForNext;
-                case 9: zzState = 40; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 16; break zzForNext;
+                case 7: zzIsFinal = true; break zzForNext;
+                case 8: zzState = 51; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 52; break zzForNext;
+                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 18; break zzForNext;
+              }
+
+            case 20:
+              switch (zzInput) {
+                case 6: 
+                case 7: zzIsFinal = true; zzState = 19; break zzForNext;
+                case 8: zzState = 51; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 52; break zzForNext;
+                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 18; break zzForNext;
+              }
+
+            case 21:
+              switch (zzInput) {
+                case 27: zzIsFinal = true; zzState = 22; break zzForNext;
+                case 28: zzIsFinal = true; zzState = 23; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzState = 51; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 22:
+              switch (zzInput) {
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 53; break zzForNext;
+                default: break zzForAction;
               }
 
             case 23:
               switch (zzInput) {
-                case 25: zzIsFinal = true; zzNoLookAhead = true; zzState = 41; break zzForNext;
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 54; break zzForNext;
                 default: break zzForAction;
               }
 
             case 25:
               switch (zzInput) {
-                case 10: zzState = 42; break zzForNext;
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 55; break zzForNext;
                 default: break zzForAction;
               }
 
             case 26:
               switch (zzInput) {
-                case 10: zzState = 42; break zzForNext;
+                case 7: 
+                case 8: 
+                case 11: zzIsFinal = true; zzState = 25; break zzForNext;
+                case 27: zzIsFinal = true; zzState = 28; break zzForNext;
+                case 12: zzState = 56; break zzForNext;
                 default: break zzForAction;
               }
 
             case 27:
               switch (zzInput) {
-                case 25: zzIsFinal = true; zzNoLookAhead = true; zzState = 43; break zzForNext;
+                case 9: zzState = 57; break zzForNext;
+                case 26: zzIsFinal = true; zzState = 58; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 28:
+              switch (zzInput) {
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 59; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 29:
+              switch (zzInput) {
+                case 7: 
+                case 8: 
+                case 11: zzIsFinal = true; zzState = 25; break zzForNext;
+                case 28: zzIsFinal = true; zzState = 28; break zzForNext;
+                case 29: zzState = 60; break zzForNext;
                 default: break zzForAction;
               }
 
             case 30:
               switch (zzInput) {
-                case 10: zzState = 42; break zzForNext;
+                case 26: zzIsFinal = true; zzState = 25; break zzForNext;
+                case 9: zzState = 61; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 31:
+              switch (zzInput) {
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 62; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 32:
+              switch (zzInput) {
+                case 11: zzIsFinal = true; zzState = 25; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 31; break zzForNext;
+                case 27: 
+                case 28: zzIsFinal = true; zzState = 33; break zzForNext;
+                case 12: zzState = 60; break zzForNext;
                 default: break zzForAction;
               }
 
             case 33:
               switch (zzInput) {
-                case 5: zzIsFinal = true; zzNoLookAhead = true; zzState = 44; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 34:
-              switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: zzState = 34; break zzForNext;
-                case 10: zzState = 35; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 35:
-              switch (zzInput) {
-                case 11: zzState = 36; break zzForNext;
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 63; break zzForNext;
                 default: break zzForAction;
               }
 
             case 36:
               switch (zzInput) {
-                case 12: zzState = 45; break zzForNext;
+                case 5: zzIsFinal = true; zzNoLookAhead = true; zzState = 64; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 37:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: break zzForNext;
+                case 9: zzState = 38; break zzForNext;
+                case 11: zzState = 39; break zzForNext;
                 default: break zzForAction;
               }
 
             case 38:
               switch (zzInput) {
-                case 17: zzState = 46; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzState = 37; break zzForNext;
+                case 11: zzState = 39; break zzForNext;
+                case 9: zzState = 65; break zzForNext;
                 default: break zzForAction;
               }
 
             case 39:
               switch (zzInput) {
-                case 22: zzState = 47; break zzForNext;
+                case 9: zzState = 40; break zzForNext;
+                case 12: zzState = 41; break zzForNext;
                 default: break zzForAction;
               }
 
             case 40:
               switch (zzInput) {
-                case 6: 
-                case 8: zzIsFinal = true; zzState = 17; break zzForNext;
-                case 9: zzState = 40; break zzForNext;
-                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 16; break zzForNext;
+                case 12: zzState = 41; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 41:
+              switch (zzInput) {
+                case 9: zzState = 66; break zzForNext;
+                case 13: zzState = 67; break zzForNext;
+                default: break zzForAction;
               }
 
             case 42:
               switch (zzInput) {
-                case 27: zzIsFinal = true; zzNoLookAhead = true; zzState = 22; break zzForNext;
+                case 9: zzState = 45; break zzForNext;
+                case 26: zzIsFinal = true; zzState = 46; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 43:
+              switch (zzInput) {
+                case 9: zzState = 47; break zzForNext;
+                case 17: zzState = 48; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 44:
+              switch (zzInput) {
+                case 9: zzState = 49; break zzForNext;
+                case 22: zzState = 50; break zzForNext;
                 default: break zzForAction;
               }
 
             case 45:
               switch (zzInput) {
-                case 13: zzState = 48; break zzForNext;
+                case 26: zzIsFinal = true; zzState = 46; break zzForNext;
                 default: break zzForAction;
               }
 
             case 46:
               switch (zzInput) {
-                case 18: zzState = 49; break zzForNext;
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 68; break zzForNext;
                 default: break zzForAction;
               }
 
             case 47:
               switch (zzInput) {
-                case 20: zzState = 50; break zzForNext;
+                case 17: zzState = 48; break zzForNext;
                 default: break zzForAction;
               }
 
             case 48:
               switch (zzInput) {
-                case 14: zzState = 51; break zzForNext;
+                case 9: zzState = 69; break zzForNext;
+                case 18: zzState = 70; break zzForNext;
                 default: break zzForAction;
               }
 
             case 49:
               switch (zzInput) {
-                case 19: zzState = 52; break zzForNext;
+                case 22: zzState = 50; break zzForNext;
                 default: break zzForAction;
               }
 
             case 50:
               switch (zzInput) {
-                case 23: zzState = 53; break zzForNext;
+                case 9: zzState = 71; break zzForNext;
+                case 23: zzState = 72; break zzForNext;
                 default: break zzForAction;
               }
 
             case 51:
               switch (zzInput) {
                 case 6: 
-                case 8: 
-                case 9: zzIsFinal = true; zzState = 54; break zzForNext;
-                default: break zzForAction;
+                case 7: zzIsFinal = true; zzState = 19; break zzForNext;
+                case 8: break zzForNext;
+                case 9: zzIsFinal = true; zzState = 52; break zzForNext;
+                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 18; break zzForNext;
               }
 
             case 52:
               switch (zzInput) {
-                case 20: zzState = 55; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 53:
-              switch (zzInput) {
-                case 19: zzState = 56; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 54:
-              switch (zzInput) {
                 case 6: 
-                case 8: 
-                case 9: zzIsFinal = true; zzState = 54; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 55:
-              switch (zzInput) {
-                case 21: zzState = 57; break zzForNext;
-                default: break zzForAction;
+                case 7: zzIsFinal = true; zzState = 19; break zzForNext;
+                case 8: zzState = 51; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 73; break zzForNext;
+                default: zzIsFinal = true; zzNoLookAhead = true; zzState = 18; break zzForNext;
               }
 
             case 56:
               switch (zzInput) {
-                case 21: zzState = 58; break zzForNext;
+                case 9: zzState = 57; break zzForNext;
+                case 26: zzIsFinal = true; zzState = 58; break zzForNext;
                 default: break zzForAction;
               }
 
             case 57:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: zzState = 57; break zzForNext;
-                case 7: zzIsFinal = true; zzState = 59; break zzForNext;
+                case 26: zzIsFinal = true; zzState = 58; break zzForNext;
                 default: break zzForAction;
               }
 
             case 58:
               switch (zzInput) {
-                case 24: zzState = 60; break zzForNext;
-                default: break zzForAction;
-              }
-
-            case 59:
-              switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: zzIsFinal = true; zzState = 59; break zzForNext;
+                case 9: zzIsFinal = true; zzNoLookAhead = true; zzState = 74; break zzForNext;
                 default: break zzForAction;
               }
 
             case 60:
               switch (zzInput) {
-                case 6: 
-                case 8: 
-                case 9: zzState = 60; break zzForNext;
-                case 7: zzIsFinal = true; zzState = 61; break zzForNext;
+                case 26: zzIsFinal = true; zzState = 25; break zzForNext;
+                case 9: zzState = 61; break zzForNext;
                 default: break zzForAction;
               }
 
             case 61:
               switch (zzInput) {
+                case 26: zzIsFinal = true; zzState = 25; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 65:
+              switch (zzInput) {
                 case 6: 
-                case 8: 
-                case 9: zzIsFinal = true; zzState = 61; break zzForNext;
+                case 7: 
+                case 8: zzState = 37; break zzForNext;
+                case 11: zzState = 39; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 66:
+              switch (zzInput) {
+                case 13: zzState = 67; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 67:
+              switch (zzInput) {
+                case 9: zzState = 75; break zzForNext;
+                case 14: zzState = 76; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 69:
+              switch (zzInput) {
+                case 18: zzState = 70; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 70:
+              switch (zzInput) {
+                case 9: zzState = 77; break zzForNext;
+                case 19: zzState = 78; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 71:
+              switch (zzInput) {
+                case 23: zzState = 72; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 72:
+              switch (zzInput) {
+                case 9: zzState = 79; break zzForNext;
+                case 21: zzState = 80; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 73:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 51; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 75:
+              switch (zzInput) {
+                case 14: zzState = 76; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 76:
+              switch (zzInput) {
+                case 9: zzState = 81; break zzForNext;
+                case 15: zzState = 82; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 77:
+              switch (zzInput) {
+                case 19: zzState = 78; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 78:
+              switch (zzInput) {
+                case 9: zzState = 83; break zzForNext;
+                case 20: zzState = 84; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 79:
+              switch (zzInput) {
+                case 21: zzState = 80; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 80:
+              switch (zzInput) {
+                case 9: zzState = 85; break zzForNext;
+                case 24: zzState = 86; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 81:
+              switch (zzInput) {
+                case 15: zzState = 82; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 82:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 87; break zzForNext;
+                case 9: zzState = 88; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 83:
+              switch (zzInput) {
+                case 20: zzState = 84; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 84:
+              switch (zzInput) {
+                case 9: zzState = 89; break zzForNext;
+                case 21: zzState = 90; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 85:
+              switch (zzInput) {
+                case 24: zzState = 86; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 86:
+              switch (zzInput) {
+                case 9: zzState = 91; break zzForNext;
+                case 20: zzState = 92; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 87:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; break zzForNext;
+                case 9: zzIsFinal = true; zzState = 93; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 88:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 87; break zzForNext;
+                case 9: zzState = 94; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 89:
+              switch (zzInput) {
+                case 21: zzState = 90; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 90:
+              switch (zzInput) {
+                case 9: zzState = 95; break zzForNext;
+                case 22: zzState = 96; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 91:
+              switch (zzInput) {
+                case 20: zzState = 92; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 92:
+              switch (zzInput) {
+                case 9: zzState = 97; break zzForNext;
+                case 22: zzState = 98; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 93:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 87; break zzForNext;
+                case 9: zzState = 94; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 94:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 87; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 95:
+              switch (zzInput) {
+                case 22: zzState = 96; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 96:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: break zzForNext;
+                case 9: zzState = 99; break zzForNext;
+                case 10: zzIsFinal = true; zzState = 100; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 97:
+              switch (zzInput) {
+                case 22: zzState = 98; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 98:
+              switch (zzInput) {
+                case 9: zzState = 101; break zzForNext;
+                case 25: zzState = 102; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 99:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 96; break zzForNext;
+                case 10: zzIsFinal = true; zzState = 100; break zzForNext;
+                case 9: zzState = 103; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 100:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 104; break zzForNext;
+                case 9: zzState = 105; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 101:
+              switch (zzInput) {
+                case 25: zzState = 102; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 102:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: break zzForNext;
+                case 9: zzState = 106; break zzForNext;
+                case 10: zzIsFinal = true; zzState = 107; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 103:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 96; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 104:
+              switch (zzInput) {
+                case 9: zzIsFinal = true; zzState = 100; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 105:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 104; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 106:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 102; break zzForNext;
+                case 10: zzIsFinal = true; zzState = 107; break zzForNext;
+                case 9: zzState = 108; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 107:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 109; break zzForNext;
+                case 9: zzState = 110; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 108:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzState = 102; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 109:
+              switch (zzInput) {
+                case 9: zzIsFinal = true; zzState = 107; break zzForNext;
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; break zzForNext;
+                default: break zzForAction;
+              }
+
+            case 110:
+              switch (zzInput) {
+                case 6: 
+                case 7: 
+                case 8: zzIsFinal = true; zzState = 109; break zzForNext;
                 default: break zzForAction;
               }
 
@@ -944,83 +1364,81 @@
       zzMarkedPos = zzMarkedPosL;
 
       switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
-        case 10: 
-          { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16BE;}
-          }
-        case 19: break;
-        case 15: 
-          { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}
-          }
-        case 20: break;
-        case 4: 
-          { yybegin(SQ_STRING); string.setLength(0);
-          }
-        case 21: break;
-        case 5: 
-          { string.append( yytext() );
-          }
-        case 22: break;
-        case 1: 
-          { if (yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}
-          }
-        case 23: break;
-        case 11: 
-          { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16LE;}
-          }
-        case 24: break;
-        case 6: 
-          { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;
-          }
-        case 25: break;
-        case 8: 
-          { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;
-          }
-        case 26: break;
-        case 9: 
-          { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;
-          }
-        case 27: break;
-        case 7: 
-          { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;
-          }
-        case 28: break;
-        case 13: 
-          { yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;
-          }
-        case 29: break;
-        case 16: 
-          { if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}
-          }
-        case 30: break;
-        case 2: 
-          { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);
-          }
-        case 31: break;
-        case 18: 
-          { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;
-          }
-        case 32: break;
-        case 17: 
-          { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;
-          }
-        case 33: break;
-        case 14: 
-          { yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;
-          }
-        case 34: break;
-        case 3: 
-          { yybegin(DQ_STRING); string.setLength(0);
-          }
-        case 35: break;
         case 12: 
           { yybegin(YYINITIAL); hasMore = false; return XMLHeadTokenizerConstants.XMLDeclEnd;
           }
-        case 36: break;
+        case 18: break;
+        case 14: 
+          { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}
+          }
+        case 19: break;
+        case 9: 
+          { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;
+          }
+        case 20: break;
+        case 2: 
+          { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);
+          }
+        case 21: break;
+        case 7: 
+          { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;
+          }
+        case 22: break;
+        case 10: 
+          { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16BE;}
+          }
+        case 23: break;
+        case 1: 
+          { if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}
+          }
+        case 24: break;
+        case 6: 
+          { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;
+          }
+        case 25: break;
+        case 5: 
+          { string.append( yytext() );
+          }
+        case 26: break;
+        case 13: 
+          { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;
+          }
+        case 27: break;
+        case 4: 
+          { yybegin(SQ_STRING); string.setLength(0);
+          }
+        case 28: break;
+        case 3: 
+          { yybegin(DQ_STRING); string.setLength(0);
+          }
+        case 29: break;
+        case 8: 
+          { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue;
+          }
+        case 30: break;
+        case 17: 
+          { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;
+          }
+        case 31: break;
+        case 15: 
+          { if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}
+          }
+        case 32: break;
+        case 11: 
+          { if (yychar == 0 ) {hasMore = false; return EncodingParserConstants.UTF16LE;}
+          }
+        case 33: break;
+        case 16: 
+          { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;
+          }
+        case 34: break;
         default: 
           if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
             zzAtEOF = true;
             zzDoEOF();
-              { hasMore = false; return EncodingParserConstants.EOF; }
+              {
+                hasMore = false; return EncodingParserConstants.EOF;
+              }
           } 
           else {
             zzScanError(ZZ_NO_MATCH);
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLResourceEncodingDetector.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLResourceEncodingDetector.java
index a728792..1f1079b 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLResourceEncodingDetector.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLResourceEncodingDetector.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,12 +8,13 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (STAR) - bug 297006 - String Comparison
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.contenttype;
 
 import java.io.IOException;
 
+import org.eclipse.core.runtime.content.IContentDescription;
 import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
 import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
 
@@ -25,22 +26,19 @@
 
 	private boolean canHandleAsUnicodeStream(String tokenType) {
 		boolean canHandleAsUnicodeStream = false;
-		if (tokenType == EncodingParserConstants.UTF83ByteBOM) {
+		if (EncodingParserConstants.UTF83ByteBOM.equals(tokenType)) {
 			canHandleAsUnicodeStream = true;
 			String enc = "UTF-8"; //$NON-NLS-1$
 			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
 			fEncodingMemento.setUTF83ByteBOMUsed(true);
 		}
-
-		else if (tokenType == EncodingParserConstants.UTF16BE) {
-			canHandleAsUnicodeStream = true;
-			String enc = "UTF-16BE"; //$NON-NLS-1$
-			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
-		}
-		else if (tokenType == EncodingParserConstants.UTF16LE) {
+		else if (EncodingParserConstants.UTF16BE.equals(tokenType) || EncodingParserConstants.UTF16LE.equals(tokenType)) {
 			canHandleAsUnicodeStream = true;
 			String enc = "UTF-16"; //$NON-NLS-1$
+			byte[] bom = (EncodingParserConstants.UTF16BE.equals(tokenType)) ? IContentDescription.BOM_UTF_16BE : IContentDescription.BOM_UTF_16LE;
 			createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
+			fEncodingMemento.setUnicodeStream(true);
+			fEncodingMemento.setUnicodeBOM(bom);
 		}
 		return canHandleAsUnicodeStream;
 	}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/AttrImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/AttrImpl.java
index cf2e968..7c0af33 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/AttrImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/AttrImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,6 +12,8 @@
  *     
  *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
  *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
+ *     
+ *     David Carver (STAR) - bug 296999 - Inefficient use of new String()
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.document;
 
@@ -26,9 +28,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
 import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
 import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
 import org.eclipse.wst.xml.core.internal.provisional.IXMLCharEntity;
@@ -46,14 +46,15 @@
  * AttrImpl class
  */
 public class AttrImpl extends NodeImpl implements IDOMAttr {
+
 	private ITextRegion equalRegion = null;
 
-	private String name = null;
+	private char[] fName = null;
 	private ITextRegion nameRegion = null;
-	private String namespaceURI = null;
 	private ElementImpl ownerElement = null;
-	private ITextRegion valueRegion = null;
-	private String valueSource = null;
+	private ITextRegion fValueRegion = null;
+	private char[] fValueSource = null;
+	private char[] fNamespaceURI = null;
 
 	/**
 	 * AttrImpl constructor
@@ -72,8 +73,10 @@
 		super(that);
 
 		if (that != null) {
-			this.name = that.name;
-			this.valueSource = that.getValueSource();
+			this.fName = that.fName;
+			String valueSource = that.getValueSource();
+			if (valueSource != null)
+				this.fValueSource = valueSource.toCharArray();
 		}
 	}
 
@@ -97,21 +100,16 @@
 		CMElementDeclaration elementDecl = element.getDeclaration();
 		if (elementDecl == null)
 			return null;
-		CMNamedNodeMap attributes = elementDecl.getAttributes();
-		CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attributes);
+
 		List nodes = ModelQueryUtil.getModelQuery(getOwnerDocument()).getAvailableContent(getOwnerElement(), elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
+		String name = getName();
 		for (int k = 0; k < nodes.size(); k++) {
 			CMNode cmnode = (CMNode) nodes.get(k);
-			if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
-				allAttributes.put(cmnode);
+			if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION && name.equals(cmnode.getNodeName())) {
+				return (CMAttributeDeclaration) cmnode;
 			}
 		}
-		attributes = allAttributes;
-		
-
-		if (attributes == null)
-			return null;
-		return (CMAttributeDeclaration) attributes.getNamedItem(getName());
+		return null;
 	}
 
 	/**
@@ -123,8 +121,8 @@
 		if (this.ownerElement == null)
 			return 0;
 		int offset = this.ownerElement.getStartOffset();
-		if (this.valueRegion != null) {
-			return (offset + this.valueRegion.getEnd());
+		if (this.fValueRegion != null) {
+			return (offset + this.fValueRegion.getEnd());
 		}
 		if (this.equalRegion != null) {
 			return (offset + this.equalRegion.getEnd());
@@ -140,15 +138,13 @@
 		return this.equalRegion;
 	}
 
-	/**
-	 */
 	public String getLocalName() {
-		if (this.name == null)
+		if (this.fName == null)
 			return null;
-		int index = this.name.indexOf(':');
+		int index = CharOperation.indexOf(this.fName, ':');
 		if (index < 0)
-			return this.name;
-		return this.name.substring(index + 1);
+			return new String(this.fName);
+		return new String(this.fName, index + 1, this.fName.length - index - 1);
 	}
 
 	/**
@@ -157,9 +153,9 @@
 	 * @return java.lang.String
 	 */
 	public String getName() {
-		if (this.name == null)
-			return new String();
-		return this.name;
+		if (this.fName == null)
+			return NodeImpl.EMPTY_STRING;
+		return new String(this.fName);
 	}
 
 
@@ -211,8 +207,6 @@
 		return flatNode.getTextEndOffset(this.nameRegion);
 	}
 
-	/**
-	 */
 	public String getNamespaceURI() {
 		String nsAttrName = null;
 		String prefix = getPrefix();
@@ -221,6 +215,11 @@
 				// fixed URI
 				return IXMLNamespace.XMLNS_URI;
 			}
+			else if (prefix.equals(IXMLNamespace.XML)) {
+				// fixed URI
+				return IXMLNamespace.XML_URI;
+			}
+
 			nsAttrName = IXMLNamespace.XMLNS_PREFIX + prefix;
 		}
 		else {
@@ -232,7 +231,9 @@
 			// does not inherit namespace from owner element
 			// if (this.ownerElement != null) return
 			// this.ownerElement.getNamespaceURI();
-			return this.namespaceURI;
+			if (this.fNamespaceURI == null)
+				return null;
+			return new String(this.fNamespaceURI);
 		}
 
 		for (Node node = this.ownerElement; node != null; node = node.getParentNode()) {
@@ -244,7 +245,9 @@
 				return attr.getValue();
 		}
 
-		return this.namespaceURI;
+		if (this.fNamespaceURI == null)
+			return null;
+		return new String(this.fNamespaceURI);
 	}
 
 	/**
@@ -286,15 +289,15 @@
 	/**
 	 */
 	public String getPrefix() {
-		if (this.name == null)
+		if (this.fName == null)
 			return null;
-		int index = this.name.indexOf(':');
+		int index = CharOperation.indexOf(this.fName, ':');
 		if (index <= 0)
 			return null;
 		// exclude JSP tag in name
-		if (this.name.charAt(0) == '<')
+		if (this.fName[0] == '<')
 			return null;
-		return this.name.substring(0, index);
+		return new String(this.fName, 0, index);
 	}
 
 	/**
@@ -308,7 +311,7 @@
 		// yet in the document, and any returned values, such as 
 		// an empty string or a default value are being supplied
 		// as per spec, not per what's in the users document.
-		return this.valueRegion != null;
+		return this.fValueRegion != null;
 	}
 
 	/**
@@ -326,8 +329,8 @@
 		if (this.equalRegion != null) {
 			return (offset + this.equalRegion.getStart());
 		}
-		if (this.valueRegion != null) {
-			return (offset + this.valueRegion.getStart());
+		if (this.fValueRegion != null) {
+			return (offset + this.fValueRegion.getStart());
 		}
 		return 0;
 	}
@@ -346,7 +349,7 @@
 	 */
 	private String getValue(String source) {
 		if (source == null)
-			return new String();
+			return NodeImpl.EMPTY_STRING;
 		if (source.length() == 0)
 			return source;
 		StringBuffer buffer = null;
@@ -378,7 +381,7 @@
 	}
 
 	public ITextRegion getValueRegion() {
-		return this.valueRegion;
+		return this.fValueRegion;
 	}
 
 	/**
@@ -396,10 +399,10 @@
 		if (structuredDocumentRegion == null)
 			return 0;
 		// ensure we never pass null to getStartOffset.
-		if (this.valueRegion == null) {
+		if (this.fValueRegion == null) {
 			return 0;
 		}
-		return structuredDocumentRegion.getStartOffset(this.valueRegion);
+		return structuredDocumentRegion.getStartOffset(this.fValueRegion);
 	}
 
 	public String getValueRegionText() {
@@ -410,16 +413,16 @@
 		IStructuredDocumentRegion flatNode = this.ownerElement.getFirstStructuredDocumentRegion();
 		if (flatNode == null)
 			return null;
-		if (this.valueRegion == null)
+		if (this.fValueRegion == null)
 			return null;
-		return flatNode.getText(this.valueRegion);
+		return flatNode.getText(this.fValueRegion);
 	}
 
 	/**
 	 */
 	public String getValueSource() {
-		if (this.valueSource != null)
-			return this.valueSource;
+		if (this.fValueSource != null)
+			return new String(this.fValueSource);
 		// DW: 4/16/2003 due to change in structuredDocument ... we need a
 		// flatnode to
 		// get at region values. For now I'll assume this is always the first
@@ -432,28 +435,29 @@
 		// doesn't
 		// seem to hurt to simply return null in those cases. I saw this null
 		// case,
-		// when tryint go format an XML file.
+		// when trying go format an XML file.
 		if (this.ownerElement == null)
 			return null;
-		IStructuredDocumentRegion ownerRegion = this.ownerElement.getFirstStructuredDocumentRegion();
+		//attribute values will always be in the start region
+		IStructuredDocumentRegion ownerRegion = this.ownerElement.getStartStructuredDocumentRegion();
 		if (ownerRegion == null)
 			return null;
-		if (this.valueRegion != null)
-			return StructuredDocumentRegionUtil.getAttrValue(ownerRegion, this.valueRegion);
-		return new String();
+		if (this.fValueRegion != null)
+			return StructuredDocumentRegionUtil.getAttrValue(ownerRegion, this.fValueRegion);
+		return NodeImpl.EMPTY_STRING;
 	}
 
 	private String getValueSource(ElementImpl ownerElement) {
-		if (this.valueSource != null)
-			return this.valueSource;
+		if (this.fValueSource != null)
+			return new String(this.fValueSource);
 		// DW: 4/16/2003 due to change in structuredDocument ... we need a
 		// flatnode to
 		// get at region values. For now I'll assume this is always the first
 		// flatnode .. may need to make smarter later (e.g. to search for
 		// the flatnode that this.valueRegion belongs to.
-		if (this.valueRegion != null)
-			return StructuredDocumentRegionUtil.getAttrValue(ownerElement.getStructuredDocumentRegion(), this.valueRegion);
-		return new String();
+		if (this.fValueRegion != null)
+			return StructuredDocumentRegionUtil.getAttrValue(ownerElement.getStructuredDocumentRegion(), this.fValueRegion);
+		return NodeImpl.EMPTY_STRING;
 	}
 
 	/**
@@ -487,11 +491,11 @@
 	 * Check if Attr has JSP in value
 	 */
 	public boolean hasNestedValue() {
-		if (this.valueRegion == null)
+		if (this.fValueRegion == null)
 			return false;
-		if (!(this.valueRegion instanceof ITextRegionContainer))
+		if (!(this.fValueRegion instanceof ITextRegionContainer))
 			return false;
-		ITextRegionList regions = ((ITextRegionContainer) this.valueRegion).getRegions();
+		ITextRegionList regions = ((ITextRegionContainer) this.fValueRegion).getRegions();
 		if (regions == null)
 			return false;
 		Iterator e = regions.iterator();
@@ -510,22 +514,17 @@
 	 * Check if Attr has only name but not equal sign nor value
 	 */
 	public boolean hasNameOnly() {
-		return (this.nameRegion != null && this.equalRegion == null && this.valueRegion == null);
+		return (this.nameRegion != null && this.equalRegion == null && this.fValueRegion == null);
 	}
 
 	/**
 	 */
 	protected final boolean hasPrefix() {
-		if (this.name == null)
+		if (this.fName == null || this.fName.length == 0)
 			return false;
-		if (this.name.indexOf(':') <= 0)
-			return false;
-		// exclude JSP tag in name
-		if (this.name.charAt(0) == '<')
-			return false;
-		return true;
+		return CharOperation.indexOf(this.fName, ':') > 0 && this.fName[0] != '<';
 	}
-
+	
 	/**
 	 */
 	protected final boolean ignoreCase() {
@@ -582,14 +581,18 @@
 	 */
 	protected boolean matchName(String name) {
 		if (name == null)
-			return (this.name == null);
-		if (this.name == null)
+			return (this.fName == null);
+		if (this.fName == null)
 			return false;
-		if (this.name.length() != name.length())
+		return CharOperation.equals(this.fName, name.toCharArray(), ignoreCase());
+	}
+
+	protected boolean matchName(char[] name) {
+		if (name == null)
+			return (this.fName == null);
+		if (this.fName == null)
 			return false;
-		if (this.name.equals(name))
-			return true;
-		return this.name.equalsIgnoreCase(name) && ignoreCase();
+		return CharOperation.equals(this.fName, name, ignoreCase());
 	}
 
 
@@ -628,21 +631,21 @@
 	 */
 	void removeRegions() {
 		this.nameRegion = null;
-		this.valueRegion = null;
+		this.fValueRegion = null;
 		this.equalRegion = null;
 	}
 
 	/**
 	 */
 	void resetRegions() {
-		this.valueSource = getValueSource();
+		this.fValueSource = getValueSource().toCharArray();
 		removeRegions();
 	}
 
 	/**
 	 */
 	void resetRegions(ElementImpl ownerElement) {
-		this.valueSource = getValueSource(ownerElement);
+		this.fValueSource = getValueSource(ownerElement).toCharArray();
 		removeRegions();
 	}
 
@@ -662,11 +665,11 @@
 		if (this.ownerElement != null) {
 			value = getValue();
 			startOffset = this.ownerElement.getStartOffset();
-			this.ownerElement.notify(CHANGE, this, value, null, startOffset);
+			this.ownerElement.notify(REMOVE, this, value, null, startOffset);
 		}
-		this.name = name;
+		this.fName = CharacterStringPool.getCharString(name);
 		if (this.ownerElement != null) {
-			this.ownerElement.notify(CHANGE, this, null, value, startOffset);
+			this.ownerElement.notify(ADD, this, null, value, startOffset);
 		}
 	}
 
@@ -675,7 +678,10 @@
 	}
 
 	protected void setNamespaceURI(String namespaceURI) {
-		this.namespaceURI = namespaceURI;
+		if (namespaceURI == null)
+			this.fNamespaceURI = null;
+		else
+			this.fNamespaceURI = namespaceURI.toCharArray();
 	}
 
 	/**
@@ -702,7 +708,7 @@
 	 */
 	public void setPrefix(String prefix) throws DOMException {
 		if (this.ownerElement != null && !this.ownerElement.isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 		int prefixLength = (prefix != null ? prefix.length() : 0);
 		String localName = getLocalName();
@@ -711,7 +717,7 @@
 			return;
 		}
 		if (localName == null)
-			localName = new String();
+			localName = NodeImpl.EMPTY_STRING;
 		int localLength = localName.length();
 		StringBuffer buffer = new StringBuffer(prefixLength + 1 + localLength);
 		buffer.append(prefix);
@@ -747,16 +753,16 @@
 	}
 
 	void setValueRegion(ITextRegion valueRegion) {
-		this.valueRegion = valueRegion;
+		this.fValueRegion = valueRegion;
 		if (valueRegion != null)
-			this.valueSource = null;
+			this.fValueSource = null;
 	}
 
 	public void setValueSource(String source) {
 		if (this.ownerElement != null && !this.ownerElement.isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
-		this.valueSource = source;
+		this.fValueSource = (source != null) ? source.toCharArray() : null;
 
 		notifyValueChanged();
 	}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CDATASectionImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CDATASectionImpl.java
index 563eeec..1a3ad57 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CDATASectionImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CDATASectionImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@
  *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
  *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
  *     
+ *     David Carver (STAR) - bug 296999 - Inefficient use of new String()
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.document;
 
@@ -72,13 +73,14 @@
 	 */
 	public String getData() throws DOMException {
 		// instead of super(TextImpl).getData(), call getCharacterData()
-		String data = getCharacterData();
+		char[] data = getCharacterData();
 		if (data == null) {
-			data = getData(getStructuredDocumentRegion());
-			if (data == null)
-				data = new String();
+			String sdata = getData(getStructuredDocumentRegion());
+			if (sdata != null)
+				return sdata;
+			return NodeImpl.EMPTY_STRING;
 		}
-		return data;
+		return new String(data);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharOperation.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharOperation.java
new file mode 100644
index 0000000..a446bde
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharOperation.java
@@ -0,0 +1,91 @@
+/*******************************************************************************

+ * Copyright (c) 2009 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ *

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+package org.eclipse.wst.xml.core.internal.document;

+

+class CharOperation {

+

+	private CharOperation() {

+	}

+

+	static int indexOf(char[] array, char c) {

+		return indexOf(array, c, 0);

+	}

+

+	static int indexOf(char[] array, char c, int start) {

+		for (int i = start; i < array.length; i++) {

+			if (array[i] == c)

+				return i;

+		}

+		return -1;

+	}

+

+

+	/**

+	 * note: This method taken from org.eclipse.jdt.core.compiler.CharOperation

+	 * 

+	 * Answers true if the two arrays are identical character by character, otherwise false.

+	 * The equality is case sensitive.

+	 * <br>

+	 * <br>

+	 * For example:

+	 * <ol>

+	 * <li><pre>

+	 *    first = null

+	 *    second = null

+	 *    result => true

+	 * </pre>

+	 * </li>

+	 * <li><pre>

+	 *    first = { }

+	 *    second = null

+	 *    result => false

+	 * </pre>

+	 * </li>

+	 * <li><pre>

+	 *    first = { 'a' }

+	 *    second = { 'a' }

+	 *    result => true

+	 * </pre>

+	 * </li>

+	 * <li><pre>

+	 *    first = { 'a' }

+	 *    second = { 'A' }

+	 *    result => false

+	 * </pre>

+	 * </li>

+	 * </ol>

+	 * @param first the first array

+	 * @param second the second array

+	 * @return true if the two arrays are identical character by character, otherwise false

+	 */

+	public static final boolean equals(char[] first, char[] second, boolean ignoreCase) {

+		if (first == second)

+			return true;

+		if (first == null || second == null)

+			return false;

+		if (first.length != second.length)

+			return false;

+

+		for (int i = first.length; --i >= 0;) {

+			if (ignoreCase) {

+				if (Character.toUpperCase(first[i]) != Character.toUpperCase(second[i])) {

+					return false;

+				}

+			}

+			else {

+				if (first[i] != second[i]) {

+					return false;

+				}

+			}

+		}

+		return true;

+	}

+}

diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharacterDataImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharacterDataImpl.java
index 6bf9c65..d1b931e 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharacterDataImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharacterDataImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (STAR) - bug 296999 - Inefficient use of new String()
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.document;
 
@@ -25,7 +25,7 @@
  */
 public abstract class CharacterDataImpl extends NodeImpl implements CharacterData {
 
-	private String data = null;
+	private char[] data = null;
 
 	/**
 	 * CharacterDataImpl constructor
@@ -44,7 +44,7 @@
 		super(that);
 
 		if (that != null) {
-			this.data = that.getData();
+			this.data = that.getData().toCharArray();
 		}
 	}
 
@@ -78,33 +78,33 @@
 		if (count == 0)
 			return;
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		if (count < 0 || offset < 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 
 		String data = getData();
 		if (data == null) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 		int length = data.length();
 		if (offset > length) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 		if (offset == 0) {
 			if (count > length) {
-				throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+				throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 			}
 			if (count == length)
-				data = new String();
+				data = NodeImpl.EMPTY_STRING;
 			else
 				data = data.substring(count);
 		} else {
 			int end = offset + count;
 			if (end > length) {
-				throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+				throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 			}
 			if (end == length)
 				data = data.substring(0, offset);
@@ -116,7 +116,7 @@
 
 	/**
 	 */
-	protected final String getCharacterData() {
+	protected final char[] getCharacterData() {
 		return this.data;
 	}
 
@@ -126,7 +126,10 @@
 	 * @return java.lang.String
 	 */
 	public String getData() throws DOMException {
-		return getCharacterData();
+		char[] cdata = getCharacterData();
+		if (cdata != null)
+			return new String(cdata);
+		return null;
 	}
 
 	/**
@@ -163,17 +166,17 @@
 			return;
 
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		if (offset < 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 
 		String data = getData();
 		if (data == null) {
 			if (offset > 0) {
-				throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+				throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 			}
 			data = arg;
 		} else if (offset == 0) {
@@ -181,7 +184,7 @@
 		} else {
 			int length = data.length();
 			if (offset > length) {
-				throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+				throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 			}
 			if (offset == length)
 				data += arg;
@@ -216,7 +219,7 @@
 	 */
 	public void replaceData(int offset, int count, String arg) throws DOMException {
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		if (arg == null) {
@@ -228,16 +231,16 @@
 			return;
 		}
 		if (offset < 0 || count < 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 
 		String data = getData();
 		if (data == null) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		} else if (offset == 0) {
 			int length = data.length();
 			if (count > length) {
-				throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+				throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 			}
 			if (count == length)
 				data = arg;
@@ -247,7 +250,7 @@
 			int length = data.length();
 			int end = offset + count;
 			if (end > length) {
-				throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+				throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 			}
 			if (end == length)
 				data = data.substring(0, offset) + arg;
@@ -260,7 +263,7 @@
 	/**
 	 */
 	void resetStructuredDocumentRegions() {
-		this.data = getData();
+		this.data = getData().toCharArray();
 		setStructuredDocumentRegion(null);
 	}
 
@@ -272,10 +275,10 @@
 	 */
 	public void setData(String data) throws DOMException {
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
-		this.data = data;
+		this.data = (data != null ? data.toCharArray() : null);
 
 		notifyValueChanged();
 	}
@@ -309,24 +312,24 @@
 	 */
 	public String substringData(int offset, int count) throws DOMException {
 		if (count == 0)
-			return new String();
+			return NodeImpl.EMPTY_STRING;
 		if (offset < 0 || count < 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 
 		String data = getData();
 		if (data == null) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 		int length = data.length();
 		if (offset == 0 && count == length)
 			return data;
 		if (offset > length) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 		int end = offset + count;
 		if (end > length) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 		return data.substring(offset, end);
 	}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharacterStringPool.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharacterStringPool.java
new file mode 100644
index 0000000..3bdb388
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CharacterStringPool.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.document;
+
+import java.util.LinkedHashMap;
+
+/**
+ * Organizes a pool of frequently used Strings as character arrays.
+ * 
+ */
+final class CharacterStringPool {
+
+	static private LinkedHashMap fPool = new LimitedHashMap();
+
+	static private class LimitedHashMap extends LinkedHashMap {
+		private static final long serialVersionUID = 1L;
+		private static final int MAX = 500;
+
+		public LimitedHashMap() {
+			super(MAX / 10, .75f, true);
+		}
+		protected boolean removeEldestEntry(java.util.Map.Entry eldest) {
+			return size() > MAX;
+		}
+	}
+
+	static private class CharArray {
+		char[] fArray;
+		/**
+		 * Answers a hashcode for the array. Algorithm from org.eclipse.jdt.core.compiler.CharOperation
+		 *
+		 * @param array the array for which a hashcode is required
+		 * @return the hashcode
+		 * @throws NullPointerException if array is null
+		 */
+		public int hashCode() {
+			int length = fArray.length;
+			int hash = length == 0 ? 31 : fArray[0];
+			if (length < 8) {
+				for (int i = length; --i > 0;)
+					hash = (hash * 31) + fArray[i];
+			} else {
+				// 8 characters is enough to compute a decent hash code, don't waste time examining every character
+				for (int i = length - 1, last = i > 16 ? i - 16 : 0; i > last; i -= 2)
+					hash = (hash * 31) + fArray[i];
+			}
+			return hash & 0x7FFFFFFF;
+		}
+
+		public boolean equals(Object obj) {
+			if (this == obj)
+				return true;
+			if (!(obj instanceof CharArray))
+				return false;
+			CharArray other = (CharArray) obj;
+			if (fArray.length != other.fArray.length)
+				return false;
+			for (int i = 0; i < fArray.length; i++) {
+				if (fArray[i] != other.fArray[i])
+					return false;
+			}
+			return true;
+		}
+	}
+
+	private CharacterStringPool() {
+	}
+
+	/**
+	 * Returns the character array for <code>string</code>. If
+	 * the character array is already in the pool for character arrays,
+	 * the array is reused.
+	 * 
+	 * @param string the string to retrieve the character array for
+	 * @return a pooled instance of the character array
+	 */
+	public static char[] getCharString(String string) {
+		CharArray array = new CharArray();
+		array.fArray = string.toCharArray();
+
+		Object obj = null;
+		synchronized (fPool) {
+			obj = fPool.get(array);
+			if (obj == null) {
+				obj = array;
+				fPool.put(obj, obj);
+			}
+		}
+		return ((CharArray) obj).fArray;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CommentImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CommentImpl.java
index f834768..4a817e0 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CommentImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CommentImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,7 +12,7 @@
  *     
  *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
  *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
+ *     David Carver (STAR) - bug 296999 - Inefficient use of new String()
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.document;
 
@@ -77,13 +77,14 @@
 	 * @return java.lang.String
 	 */
 	public String getData() throws DOMException {
-		String data = getCharacterData();
+		char[] data = getCharacterData();
 		if (data == null) {
-			data = getData(getStructuredDocumentRegion());
-			if (data == null)
-				data = new String();
+			String sdata = getData(getStructuredDocumentRegion());
+			if (sdata != null)
+				return sdata;
+			return NodeImpl.EMPTY_STRING;
 		}
-		return data;
+		return new String(data);
 	}
 
 	/**
@@ -184,7 +185,7 @@
 			return;
 
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		DocumentImpl document = (DocumentImpl) getOwnerDocument();
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMMessages.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMMessages.java
new file mode 100644
index 0000000..562f4b1
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMMessages.java
@@ -0,0 +1,43 @@
+/*******************************************************************************

+ * Copyright (c) 2010 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ *

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *     

+ *******************************************************************************/

+package org.eclipse.wst.xml.core.internal.document;

+

+import org.eclipse.osgi.util.NLS;

+

+class DOMMessages extends NLS {

+	private static String BUNDLE_NAME = "org.eclipse.wst.xml.core.internal.document.DOMMessages"; //$NON-NLS-1$

+

+	static {

+		NLS.initializeMessages(BUNDLE_NAME, DOMMessages.class);

+	}

+

+	private DOMMessages() {

+	}

+

+	static String DOMSTRING_SIZE_ERR;

+	static String HIERARCHY_REQUEST_ERR;

+	static String INDEX_SIZE_ERR;

+	static String INUSE_ATTRIBUTE_ERR;

+	static String INVALID_ACCESS_ERR;

+	static String INVALID_CHARACTER_ERR;

+	static String INVALID_MODIFICATION_ERR;

+	static String INVALID_STATE_ERR;

+	static String NAMESPACE_ERR;

+	static String NO_DATA_ALLOWED_ERR;

+	static String NO_MODIFICATION_ALLOWED_ERR;

+	static String NOT_FOUND_ERR;

+	static String NOT_SUPPORTED_ERR;

+	static String SYNTAX_ERR;

+	static String TYPE_MISMATCH_ERR;

+	static String VALIDATION_ERR;

+	static String WRONG_DOCUMENT_ERR;

+}

diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMMessages.properties b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMMessages.properties
new file mode 100644
index 0000000..d0eac25
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMMessages.properties
@@ -0,0 +1,17 @@
+DOMSTRING_SIZE_ERR=DOMString Size Error

+HIERARCHY_REQUEST_ERR=Invalid Hierarchy Request

+INDEX_SIZE_ERR=Incorrect Index Error

+INUSE_ATTRIBUTE_ERR=Attribute Node In Use Error

+INVALID_ACCESS_ERR=Invalid Access Error

+INVALID_CHARACTER_ERR=Invalid Characer Error

+INVALID_MODIFICATION_ERR=Invalid Modification Error

+INVALID_STATE_ERR=Invalid State Error

+NAMESPACE_ERR=Namespace Error

+NO_DATA_ALLOWED_ERR=No Data Allowed

+NO_MODIFICATION_ALLOWED_ERR=No Modification Allowed

+NOT_FOUND_ERR=Not Found

+NOT_SUPPORTED_ERR=Not Supported

+SYNTAX_ERR=Syntax Error

+TYPE_MISMATCH_ERR=Type Mismatch Error

+VALIDATION_ERR=Validation Error

+WRONG_DOCUMENT_ERR=Wrong Document

diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMModelImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMModelImpl.java
index d2149b9..feeb87c 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMModelImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMModelImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -702,7 +702,7 @@
 		XMLModelUpdater updater = getActiveUpdater();
 		if (updater != null) { // being updated
 			try {
-				updater.changeRegion(flatNode, region);
+				updater.changeRegion(event, flatNode, region);
 			}
 			catch (Exception ex) {
 				Logger.logException(ex);
@@ -722,7 +722,7 @@
 		XMLModelParser parser = getModelParser();
 		setActive(parser);
 		try {
-			parser.changeRegion(flatNode, region);
+			parser.changeRegion(event, flatNode, region);
 		}
 		catch (Exception ex) {
 			Logger.logException(ex);
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentImpl.java
index 3c862d2..4082ff7 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,7 +12,8 @@
  *     
  *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
  *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
+ *     David Carver (STAR) - bug 296999 - Inefficient use of new String()
+ *     David Carver (Intalio) - bug 273004 - add check for valid xml characters in createAttribute
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.document;
 
@@ -21,13 +22,16 @@
 // for org.apache.xerces 3.2.1
 // import org.apache.xerces.utils.XMLCharacterProperties;
 // DMW modified for XML4J 4.0.1
+import java.util.Collections;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.Map;
 
 import org.apache.xerces.dom.TreeWalkerImpl;
 import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
 import org.eclipse.wst.xml.core.internal.commentelement.impl.CommentElementRegistry;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMEntityDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
 import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
@@ -118,6 +122,18 @@
 
 	}
 
+	private class LimitedCache extends LinkedHashMap {
+		private static final long serialVersionUID = 1L;
+		private static final int MAX_SIZE = 10;
+		public LimitedCache() {
+			super(0, 0.75f, true);
+		}
+
+		protected boolean removeEldestEntry(java.util.Map.Entry entry) {
+			return size() > MAX_SIZE;
+		}
+	}
+
 	// this is a constant just to give compile-time control over
 	// whether or not to use the cache. If, in future, its found that
 	// there are no (or few) "duplicate requests" ... then this cache
@@ -129,6 +145,7 @@
 	private DOMModelImpl model = null;
 	private TagNameCache tagNameCache;
 
+	private Map fCMCache;
 	/**
 	 * DocumentImpl constructor
 	 */
@@ -137,6 +154,7 @@
 		if (usetagnamecache) {
 			tagNameCache = new TagNameCache();
 		}
+		fCMCache = Collections.synchronizedMap(new LimitedCache());
 	}
 
 	/**
@@ -150,6 +168,7 @@
 		if (usetagnamecache) {
 			tagNameCache = new TagNameCache();
 		}
+		fCMCache = Collections.synchronizedMap(new LimitedCache());
 	}
 
 	/**
@@ -263,6 +282,7 @@
 	 *            java.lang.String
 	 */
 	public Attr createAttribute(String name) throws DOMException {
+		checkTagNameValidity(name);
 		AttrImpl attr = new AttrImpl();
 		attr.setOwnerDocument(this);
 		attr.setName(name);
@@ -272,6 +292,7 @@
 	/**
 	 */
 	public Attr createAttributeNS(String uri, String name) throws DOMException {
+		checkTagNameValidity(name);
 		AttrImpl attr = new AttrImpl();
 		attr.setOwnerDocument(this);
 		attr.setName(name);
@@ -317,7 +338,7 @@
 	public Element createCommentElement(String tagName, boolean isJSPTag) throws DOMException {
 		Element result = null;
 		if (!isJSPType() && isJSPTag) {
-			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, new String());
+			throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, DOMMessages.INVALID_MODIFICATION_ERR);
 		}
 		ElementImpl element = (ElementImpl) createElement(tagName);
 		element.setJSPTag(isJSPTag);
@@ -326,7 +347,7 @@
 			result = element;
 		}
 		else {
-			throw new DOMException(DOMException.INVALID_CHARACTER_ERR, new String());
+			throw new DOMException(DOMException.INVALID_CHARACTER_ERR, DOMMessages.INVALID_CHARACTER_ERR);
 		}
 		return result;
 	}
@@ -376,7 +397,7 @@
 	 */
 	public Element createElementNS(String uri, String tagName) throws DOMException {
 		if (!isValidName(tagName)) {
-			throw new DOMException(DOMException.INVALID_CHARACTER_ERR, new String());
+			throw new DOMException(DOMException.INVALID_CHARACTER_ERR, DOMMessages.INVALID_CHARACTER_ERR);
 		}
 
 		ElementImpl element = (ElementImpl) createElement(tagName);
@@ -407,7 +428,7 @@
 	 */
 	public EntityReference createEntityReference(String name) throws DOMException {
 		if (!isXMLType()) {
-			throw new DOMException(DOMException.NOT_SUPPORTED_ERR, new String());
+			throw new DOMException(DOMException.NOT_SUPPORTED_ERR, DOMMessages.NOT_SUPPORTED_ERR);
 		}
 
 		EntityReferenceImpl ref = new EntityReferenceImpl();
@@ -487,7 +508,7 @@
 	 */
 	public TreeWalker createTreeWalker(Node root, int whatToShow, NodeFilter filter, boolean entityReferenceExpansion) {
 		if (root == null) {
-			String msg = "Program Error: root node can not be null for TreeWalker";
+			String msg = DOMMessages.NOT_SUPPORTED_ERR + " - Program Error: root node can not be null for TreeWalker";
 			throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
 		}
 		// ISSUE: we just use Xerces implementation for now, but longer term,
@@ -721,8 +742,6 @@
 		return id;
 	}
 
-	/**
-	 */
 	public Element getElementById(String id) {
 		if (id == null)
 			return null;
@@ -734,21 +753,13 @@
 			if (node.getNodeType() != ELEMENT_NODE)
 				continue;
 			ElementImpl element = (ElementImpl) node;
-			String value = element.getAttribute("id");//$NON-NLS-1$
-			if (value != null && value.equals(id))
+			if (element.hasAttribute("id") && id.equals(element.getAttribute("id"))) //$NON-NLS-1$ //$NON-NLS-2$
 				return element;
 		}
 
 		return null;
 	}
 
-	/**
-	 * getElementsByTagName method
-	 * 
-	 * @return org.w3c.dom.NodeList
-	 * @param tagName
-	 *            java.lang.String
-	 */
 	public NodeList getElementsByTagName(String tagName) {
 		if (tagName == null)
 			return new NodeListImpl();
@@ -1055,6 +1066,23 @@
 	}
 
 	/**
+	 * Provides an element's attribute declarations
+	 * @param element the element to retrieve the attribute map of
+	 * @return a <code>CMNamedNodeMap</code> of attributes if the declaration exists; null otherwise.
+	 */
+	CMNamedNodeMap getCMAttributes(Element element) {
+		CMNamedNodeMap map = (CMNamedNodeMap) fCMCache.get(element);
+		if (map == null) {
+			CMElementDeclaration decl = ModelQueryUtil.getModelQuery(this).getCMElementDeclaration(element);
+			if (decl != null) {
+				map = decl.getAttributes();
+				fCMCache.put(element, map);
+			}
+		}
+		return map;
+	}
+
+	/**
 	 * <p>
 	 * EXPERIMENTAL! Based on the <a
 	 * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
@@ -1104,76 +1132,76 @@
 	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
 	 */
 	public String getInputEncoding() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
+		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
 	}
 
 	/**
 	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
 	 */
 	public String getXmlEncoding() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
+		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
 	}
 
 	/**
 	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
 	 */
 	public boolean getXmlStandalone() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
+		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
 	}
 
 	/**
 	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
 	 */
 	public void setXmlStandalone(boolean xmlStandalone) throws DOMException {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
+		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
 	}
 
 	/**
 	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
 	 */
 	public String getXmlVersion() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
+		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
 	}
 
 	/**
 	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
 	 */
 	public void setXmlVersion(String xmlVersion) throws DOMException {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
+		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
 	}
 
 	/**
 	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
 	 */
 	public String getDocumentURI() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
+		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
 	}
 
 	/**
 	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
 	 */
 	public void setDocumentURI(String documentURI) {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
+		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
 	}
 
 	/**
 	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
 	 */
 	public DOMConfiguration getDomConfig() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
+		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
 	}
 
 	/**
 	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
 	 */
 	public void normalizeDocument() {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
+		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
 	}
 
 	/**
 	 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
 	 */
 	public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implmented in this version"); //$NON-NLS-1$
+		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version"); //$NON-NLS-1$
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeImpl.java
index 769543f..5ff86bf 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,7 +12,7 @@
  *     
  *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
  *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
+ *     David Carver (STAR) - bug 296999 - Inefficient use of new String()
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.document;
 
@@ -93,7 +93,7 @@
 	 */
 	public String getName() {
 		if (this.name == null)
-			return new String();
+			return NodeImpl.EMPTY_STRING;
 		return this.name;
 	}
 
@@ -156,7 +156,7 @@
 	 */
 	public void setInternalSubset(String internalSubset) {
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		this.internalSubset = internalSubset;
@@ -180,7 +180,7 @@
 	 */
 	public void setPublicId(String publicId) {
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		this.publicId = publicId;
@@ -196,7 +196,7 @@
 	 */
 	public void setSystemId(String systemId) {
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		this.systemId = systemId;
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ElementImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ElementImpl.java
index 8db82f1..10a6a84 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ElementImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ElementImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,7 +14,7 @@
  *     
  *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
  *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
+ *     David Carver (STAR) - bug 296999 - Inefficient use of new String()
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.document;
 
@@ -28,7 +28,10 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.xml.core.internal.commentelement.CommentElementAdapter;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
 import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
 import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
 import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
@@ -96,14 +99,19 @@
 		}
 	}
 
+//	private static final char[] XMLNS_PREFIX = IXMLNamespace.XMLNS_PREFIX.toCharArray();
+	private static final byte FLAG_COMMENT = 0x1;
+	private static final byte FLAG_EMPTY = 0x2;
+	private static final byte FLAG_JSP = 0x4;
+	
+	private byte fTagFlags = 0;
+	
 	NodeListImpl attrNodes = null;
 	private IStructuredDocumentRegion endStructuredDocumentRegion = null;
-	private boolean isCommentTag = false;
-	private boolean isEmptyTag = false;
-	private boolean isJSPTag = false;
-	private String namespaceURI = null;
+	
+	private char[] fTagName = null;
 
-	private String tagName = null;
+	private char[] fNamespaceURI = null;
 
 	/**
 	 * ElementImpl constructor
@@ -122,10 +130,8 @@
 		super(that);
 
 		if (that != null) {
-			this.tagName = that.tagName;
-			this.isEmptyTag = that.isEmptyTag;
-			this.isJSPTag = that.isJSPTag;
-			this.isCommentTag = that.isCommentTag;
+			this.fTagName = that.fTagName;
+			this.fTagFlags = that.fTagFlags;
 
 			// clone attributes
 			that.cloneAttributes(this);
@@ -168,7 +174,7 @@
 			return null;
 
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		if (this.attrNodes == null)
@@ -232,12 +238,30 @@
 	 */
 	public String getAttribute(String name) {
 		Attr attr = getAttributeNode(name);
-		if (attr == null)
-			return null;
+		// In the absence of the attribute, get the default value
+		if (attr == null) {
+			String defaultValue = getDefaultValue(name);
+			return (defaultValue != null) ? defaultValue : NodeImpl.EMPTY_STRING;
+		}
 		return attr.getValue();
 	}
 
 	/**
+	 * get the default value for attribute <code>name</code>. Returns an empty string
+	 * @param name
+	 * @return
+	 */
+	private String getDefaultValue(String name) {
+		CMNamedNodeMap map = ((DocumentImpl) getOwnerDocument()).getCMAttributes(this);
+		if (map != null) {
+			CMNode attribute = map.getNamedItem(name);
+			if (attribute instanceof CMAttributeDeclaration)
+				return ((CMAttributeDeclaration) attribute).getAttrType().getImpliedValue();
+		}
+		return NodeImpl.EMPTY_STRING;
+	}
+
+	/**
 	 * getAttributeNode method
 	 * 
 	 * @return org.w3c.dom.Attr
@@ -251,11 +275,12 @@
 			return null; // no attribute
 
 		int length = this.attrNodes.getLength();
+		char[] nameChars = name.toCharArray();
 		for (int i = 0; i < length; i++) {
 			AttrImpl attr = (AttrImpl) this.attrNodes.item(i);
 			if (attr == null)
 				continue;
-			if (attr.matchName(name))
+			if (attr.matchName(nameChars))
 				return attr; // found
 		}
 
@@ -299,8 +324,11 @@
 	 */
 	public String getAttributeNS(String uri, String name) {
 		Attr attr = getAttributeNodeNS(uri, name);
-		if (attr == null)
-			return null;
+		// In the absence of the attribute, get the default value
+		if (attr == null) {
+			String defaultValue = getDefaultValue(name);
+			return (defaultValue != null) ? defaultValue : NodeImpl.EMPTY_STRING;
+		}
 		return attr.getValue();
 	}
 
@@ -348,6 +376,7 @@
 			tagName = null; // do not care
 		}
 
+		it.nextNode(); // skip the first node since it is the root from createNodeIterator
 		for (Node node = it.nextNode(); node != null; node = it.nextNode()) {
 			if (node.getNodeType() != ELEMENT_NODE)
 				continue;
@@ -383,6 +412,7 @@
 			tagName = null; // do not care
 		}
 
+		it.nextNode(); // skip the first node since it is the root from createNodeIterator
 		for (Node node = it.nextNode(); node != null; node = it.nextNode()) {
 			if (node.getNodeType() != ELEMENT_NODE)
 				continue;
@@ -481,16 +511,14 @@
 	/**
 	 */
 	public String getLocalName() {
-		if (this.tagName == null)
+		if (this.fTagName == null)
 			return null;
-		int index = this.tagName.indexOf(':');
+		int index = CharOperation.indexOf(this.fTagName, ':');
 		if (index < 0)
-			return this.tagName;
-		return this.tagName.substring(index + 1);
+			return new String(this.fTagName);
+		return new String(this.fTagName, index + 1, this.fTagName.length - index - 1);
 	}
 
-	/**
-	 */
 	public String getNamespaceURI() {
 		String nsAttrName = null;
 		String prefix = getPrefix();
@@ -510,7 +538,9 @@
 				return attr.getValue();
 		}
 
-		return this.namespaceURI;
+		if (this.fNamespaceURI == null)
+			return null;
+		return new String(this.fNamespaceURI);
 	}
 
 	/**
@@ -534,15 +564,15 @@
 	/**
 	 */
 	public String getPrefix() {
-		if (this.tagName == null)
+		if (this.fTagName == null)
 			return null;
-		int index = this.tagName.indexOf(':');
+		int index = CharOperation.indexOf(this.fTagName, ':');
 		if (index <= 0)
 			return null;
-		// exclude JSP tag in tag name
-		if (this.tagName.charAt(0) == '<')
+		// exclude JSP tag in name
+		if (this.fTagName[0] == '<')
 			return null;
-		return this.tagName.substring(0, index);
+		return new String(this.fTagName, 0, index);
 	}
 
 	/**
@@ -583,9 +613,9 @@
 	 * @return java.lang.String
 	 */
 	public String getTagName() {
-		if (this.tagName == null)
-			return new String();
-		return this.tagName;
+		if (this.fTagName == null)
+			return NodeImpl.EMPTY_STRING;
+		return new String(fTagName);
 	}
 
 	/**
@@ -618,14 +648,9 @@
 	/**
 	 */
 	protected final boolean hasPrefix() {
-		if (this.tagName == null)
+		if (this.fTagName == null || this.fTagName.length == 0)
 			return false;
-		if (this.tagName.indexOf(':') <= 0)
-			return false;
-		// exclude JSP tag in tag name
-		if (this.tagName.charAt(0) == '<')
-			return false;
-		return true;
+		return CharOperation.indexOf(this.fTagName, ':') > 0 && this.fTagName[0] != '<';
 	}
 
 	/**
@@ -681,13 +706,13 @@
 		if (newChild == null)
 			return null;
 		if (!isContainer()) { // never be container
-			throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, new String());
+			throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, DOMMessages.HIERARCHY_REQUEST_ERR);
 		}
-		if (newChild.getNodeType() != TEXT_NODE) {
+		if (newChild.getNodeType() != TEXT_NODE && newChild.getNodeType() != CDATA_SECTION_NODE) {
 			if (isJSPContainer() || isCDATAContainer()) { // accepts only
 				// Text
 				// child
-				throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, new String());
+				throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, DOMMessages.HIERARCHY_REQUEST_ERR);
 			}
 		}
 		return super.insertBefore(newChild, refChild);
@@ -702,12 +727,12 @@
 		if (model == null)
 			return false; // error
 		IStructuredDocument structuredDocument = model.getStructuredDocument();
-		if (structuredDocument == null)
+		if (structuredDocument == null || fTagName == null)
 			return false; // eror
 		RegionParser parser = structuredDocument.getParser();
 		if (parser == null || !(parser instanceof XMLSourceParser))
 			return false;
-		return (((XMLSourceParser) parser).getBlockMarker(this.tagName) != null);
+		return (((XMLSourceParser) parser).getBlockMarker(new String(this.fTagName)) != null);
 		/*
 		 * CMElementDeclaration decl = getDeclaration(); if (decl == null)
 		 * return false; if (decl instanceof CMNodeWrapper) { decl =
@@ -759,7 +784,7 @@
 	/**
 	 */
 	public final boolean isCommentTag() {
-		return this.isCommentTag;
+		return (fTagFlags & FLAG_COMMENT) != 0;
 	}
 
 	/**
@@ -800,7 +825,7 @@
 			return false;
 		if (!isXMLTag())
 			return false;
-		return this.isEmptyTag;
+		return (fTagFlags & FLAG_EMPTY) != 0;
 	}
 
 	/**
@@ -837,7 +862,7 @@
 	 * @return boolean
 	 */
 	public final boolean isJSPTag() {
-		return this.isJSPTag;
+		return (fTagFlags & FLAG_JSP) != 0;
 	}
 
 	/**
@@ -899,12 +924,15 @@
 	 */
 	public boolean matchTagName(String tagName) {
 		if (tagName == null)
-			return (this.tagName == null);
-		if (this.tagName == null)
+			return (this.fTagName == null);
+		if (this.fTagName == null)
 			return false;
+		if (this.fTagName.length != tagName.length())
+			return false;
+		String stringName = new String(this.fTagName);
 		if (!ignoreCase())
-			return this.tagName.equals(tagName);
-		return this.tagName.equalsIgnoreCase(tagName);
+			return stringName.equals(tagName);
+		return stringName.equalsIgnoreCase(tagName);
 	}
 
 	/**
@@ -989,11 +1017,11 @@
 			return null; // invalid parameter
 
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		if (this.attrNodes == null) { // no attribute
-			throw new DOMException(DOMException.NOT_FOUND_ERR, new String());
+			throw new DOMException(DOMException.NOT_FOUND_ERR, DOMMessages.NOT_FOUND_ERR);
 		}
 
 		int length = this.attrNodes.getLength();
@@ -1011,7 +1039,7 @@
 		}
 
 		// not found
-		throw new DOMException(DOMException.NOT_FOUND_ERR, new String());
+		throw new DOMException(DOMException.NOT_FOUND_ERR, DOMMessages.NOT_FOUND_ERR);
 	}
 
 	/**
@@ -1028,7 +1056,7 @@
 			return null; // no attribute
 
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		int length = this.attrNodes.getLength();
@@ -1059,7 +1087,7 @@
 			return null; // no attribute
 
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		int length = this.attrNodes.getLength();
@@ -1105,7 +1133,7 @@
 			return;
 
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		int length = this.attrNodes.getLength();
@@ -1182,7 +1210,7 @@
 			return;
 
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		Attr attr = getAttributeNode(name);
@@ -1214,7 +1242,7 @@
 			return null; // nothing to do
 
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		AttrImpl attr = (AttrImpl) newAttr;
@@ -1222,7 +1250,7 @@
 		if (owner != null) {
 			if (owner == this)
 				return null; // nothing to do
-			throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR, new String());
+			throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR, DOMMessages.INUSE_ATTRIBUTE_ERR);
 		}
 
 		Attr oldAttr = removeAttributeNode(newAttr.getName());
@@ -1237,7 +1265,7 @@
 			return null; // nothing to do
 
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		AttrImpl attr = (AttrImpl) newAttr;
@@ -1245,7 +1273,7 @@
 		if (owner != null) {
 			if (owner == this)
 				return null; // nothing to do
-			throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR, new String());
+			throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR, DOMMessages.INUSE_ATTRIBUTE_ERR);
 		}
 
 		String name = newAttr.getLocalName();
@@ -1263,7 +1291,7 @@
 			return;
 
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=139552
@@ -1294,10 +1322,13 @@
 	public void setCommentTag(boolean isCommentTag) {
 		IDOMNode parent = (IDOMNode) getParentNode();
 		if (parent != null && !parent.isChildEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
-		this.isCommentTag = isCommentTag;
+		if (isCommentTag)
+			fTagFlags |= FLAG_COMMENT;
+		else
+			fTagFlags &= ~FLAG_COMMENT;
 	}
 
 	/**
@@ -1309,10 +1340,13 @@
 	public void setEmptyTag(boolean isEmptyTag) {
 		IDOMNode parent = (IDOMNode) getParentNode();
 		if (parent != null && !parent.isChildEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
-		this.isEmptyTag = isEmptyTag;
+		if (isEmptyTag)
+			fTagFlags |= FLAG_EMPTY;
+		else
+			fTagFlags &= ~FLAG_EMPTY;
 	}
 
 	/**
@@ -1338,16 +1372,20 @@
 	public void setJSPTag(boolean isJSPTag) {
 		IDOMNode parent = (IDOMNode) getParentNode();
 		if (parent != null && !parent.isChildEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, NodeImpl.EMPTY_STRING);
 		}
 
-		this.isJSPTag = isJSPTag;
+		if (isJSPTag)
+			fTagFlags |= FLAG_JSP;
+		else
+			fTagFlags &= ~FLAG_JSP;
 	}
 
-	/**
-	 */
 	protected void setNamespaceURI(String namespaceURI) {
-		this.namespaceURI = namespaceURI;
+		if (namespaceURI == null)
+			this.fNamespaceURI = null;
+		else
+			this.fNamespaceURI = namespaceURI.toCharArray();
 	}
 
 	/**
@@ -1372,7 +1410,7 @@
 	public void setPrefix(String prefix) throws DOMException {
 		IDOMNode parent = (IDOMNode) getParentNode();
 		if (parent != null && !parent.isChildEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, NodeImpl.EMPTY_STRING);
 		}
 
 		int prefixLength = (prefix != null ? prefix.length() : 0);
@@ -1416,7 +1454,7 @@
 	 *            java.lang.String
 	 */
 	protected void setTagName(String tagName) {
-		this.tagName = tagName;
+		this.fTagName = CharacterStringPool.getCharString(tagName);
 	}
 
 	/**
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityImpl.java
index 924546d..fae39ca 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,7 +12,7 @@
  *     
  *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
  *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
+ *     David Carver (STAR) - bug 296999 - Inefficient use of new String()
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.document;
 
@@ -93,7 +93,7 @@
 	 */
 	public String getNodeName() {
 		if (this.name == null)
-			return new String();
+			return NodeImpl.EMPTY_STRING;
 		return this.name;
 	}
 
@@ -182,7 +182,7 @@
 	 */
 	public void setNotationName(String notationName) {
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		this.notationName = notationName;
@@ -196,7 +196,7 @@
 	 */
 	public void setPublicId(String publicId) {
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		this.publicId = publicId;
@@ -210,7 +210,7 @@
 	 */
 	public void setSystemId(String systemId) {
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		this.systemId = systemId;
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityReferenceImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityReferenceImpl.java
index f8a8071..a4edb32 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityReferenceImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityReferenceImpl.java
@@ -12,7 +12,7 @@
  *     
  *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
  *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
+ *     David Carver (STAR) - bug 296999 - Inefficient use of new String()
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.document;
 
@@ -70,7 +70,7 @@
 	 */
 	public String getNodeName() {
 		if (this.name == null)
-			return new String();
+			return NodeImpl.EMPTY_STRING;
 		return this.name;
 	}
 
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ModelParserAdapter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ModelParserAdapter.java
index 0b7e13d..e61907d 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ModelParserAdapter.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ModelParserAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -52,4 +52,6 @@
 	/**
 	 */
 	public boolean isEndTag(IDOMElement element);
+
+	boolean isEndTagOmissible(Element element);
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeContainer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeContainer.java
index f653163..b8f6d66 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeContainer.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeContainer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (STAR) - bug 296999 - Inefficient use of new String()
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.document;
 
@@ -245,13 +245,17 @@
 		if (newChild == null)
 			return null; // nothing to do
 		if (refChild != null && refChild.getParentNode() != this) {
-			throw new DOMException(DOMException.NOT_FOUND_ERR, new String());
+			throw new DOMException(DOMException.NOT_FOUND_ERR, DOMMessages.NOT_FOUND_ERR);
 		}
 		if (!isChildEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 		if (newChild == refChild)
 			return newChild; // nothing to do
+		//new child can not be a parent of this, would cause cycle
+		if(isParent(newChild)) {
+			throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, DOMMessages.HIERARCHY_REQUEST_ERR);
+		}
 
 		if (newChild.getNodeType() == DOCUMENT_FRAGMENT_NODE) {
 			// insert child nodes instead
@@ -368,11 +372,11 @@
 		if (oldChild == null)
 			return null;
 		if (oldChild.getParentNode() != this) {
-			throw new DOMException(DOMException.NOT_FOUND_ERR, new String());
+			throw new DOMException(DOMException.NOT_FOUND_ERR, DOMMessages.NOT_FOUND_ERR);
 		}
 
 		if (!isChildEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		// synchronized in case another thread is getting item, or length
@@ -408,7 +412,7 @@
 	 */
 	public void removeChildNodes() {
 		if (!isChildEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		Node nextChild = null;
@@ -431,7 +435,7 @@
 		if (!hasChildNodes())
 			return null;
 		if (!isChildEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		Document document = null;
@@ -472,7 +476,7 @@
 	 */
 	public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
 		if (!isChildEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		if (oldChild == null)
@@ -511,4 +515,20 @@
 			roc.lockNode((NodeImpl) child);
 		}
 	}
+
+	/**
+	 * <p>Checks to see if the given <code>Node</code> is a parent of <code>this</code> node</p>
+	 * 
+	 * @param possibleParent the possible parent <code>Node</code> of <code>this</code> node
+	 * @return <code>true</code> if <code>possibleParent</code> is the parent of <code>this</code>,
+	 * <code>false</code> otherwise.
+	 */
+	private boolean isParent(Node possibleParent) {
+		Node parent = this.getParentNode();
+		while(parent != null && parent != possibleParent) {
+			parent = parent.getParentNode();
+		}
+
+		return parent == possibleParent;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeImpl.java
index a219cff..938deb8 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,14 +13,18 @@
  *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
  *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
  *     
+ *     David Carver (STAR) - bug 295127 - implement isSameNode and compareDocumentPosition methods.
+ *                                        Unit Tests covered in wst.xsl XPath 2.0 tests.
+ *     David Carver (STAR) - bug 296999 - Inefficient use of new String()
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.document;
 
 
 
 import java.io.Serializable;
-import java.util.Enumeration;
 import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
 
 import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
 import org.eclipse.wst.sse.core.internal.provisional.AbstractNotifier;
@@ -47,6 +51,14 @@
 public abstract class NodeImpl extends AbstractNotifier implements Node, IDOMNode {
 	// define one empty nodelist, for repeated use
 	private final static NodeList EMPTY_NODE_LIST = new NodeListImpl();
+	// DocumentPosition
+	//private final static short      DOCUMENT_POSITION_DISCONNECTED = 0x01;
+    private final static short      DOCUMENT_POSITION_PRECEDING    = 0x02;
+	private final static short      DOCUMENT_POSITION_FOLLOWING    = 0x04;
+    //private final static short      DOCUMENT_POSITION_CONTAINS     = 0x08;
+	//private final static short      DOCUMENT_POSITION_CONTAINED_BY = 0x10;
+	private final static short      DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
+
 
 	private boolean fDataEditable = true;
 	private IStructuredDocumentRegion flatNode = null;
@@ -55,9 +67,9 @@
 	private DocumentImpl ownerDocument = null;
 	private NodeImpl parentNode = null;
 	private NodeImpl previousSibling = null;
+	// define one empty String constant for repeated use
+	static final String EMPTY_STRING = "";
 	
-	private Hashtable userDataTable=null;
-
 	/**
 	 * NodeImpl constructor
 	 */
@@ -85,7 +97,7 @@
 	 *            org.w3c.dom.Node
 	 */
 	public Node appendChild(Node newChild) throws DOMException {
-		throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, new String());
+		throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, DOMMessages.HIERARCHY_REQUEST_ERR);
 	}
 
 	/**
@@ -171,10 +183,14 @@
 	 * @return org.w3c.dom.Document
 	 */
 	public Document getContainerDocument() {
-		for (Node node = this; node != null; node = node.getParentNode()) {
+		Node parent = null;
+		for (Node node = this; node != null; node = parent) {
 			if (node.getNodeType() == Node.DOCUMENT_NODE) {
 				return (Document) node;
 			}
+			/* Break out of a bad hierarchy */
+			if ((parent = node.getParentNode()) == node)
+				break;
 		}
 		return null;
 	}
@@ -411,7 +427,7 @@
 	 */
 	public String getSource() {
 		if (this.flatNode == null)
-			return new String();
+			return NodeImpl.EMPTY_STRING;
 		return this.flatNode.getText();
 	}
 
@@ -508,7 +524,7 @@
 	 *            org.w3c.dom.Node
 	 */
 	public Node insertBefore(Node newChild, Node refChild) throws DOMException {
-		throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, new String());
+		throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, DOMMessages.HIERARCHY_REQUEST_ERR);
 	}
 
 	public boolean isChildEditable() {
@@ -559,12 +575,59 @@
 		// TODO: make localized version
 		String result = null;
 		switch (s) {
-			case DOMException.INVALID_CHARACTER_ERR :
-				result = "INVALID_CHARACTER_ERR"; //$NON-NLS-1$
+			case DOMException.DOMSTRING_SIZE_ERR :
+				result = DOMMessages.DOMSTRING_SIZE_ERR;
 				break;
-
+			case DOMException.HIERARCHY_REQUEST_ERR :
+				result = DOMMessages.HIERARCHY_REQUEST_ERR;
+				break;
+			case DOMException.INDEX_SIZE_ERR :
+				result = DOMMessages.INDEX_SIZE_ERR;
+				break;
+			case DOMException.INUSE_ATTRIBUTE_ERR :
+				result = DOMMessages.INUSE_ATTRIBUTE_ERR;
+				break;
+			case DOMException.INVALID_ACCESS_ERR :
+				result = DOMMessages.INVALID_ACCESS_ERR;
+				break;
+			case DOMException.INVALID_CHARACTER_ERR :
+				result = DOMMessages.INVALID_CHARACTER_ERR;
+				break;
+			case DOMException.INVALID_MODIFICATION_ERR :
+				result = DOMMessages.INVALID_MODIFICATION_ERR;
+				break;
+			case DOMException.INVALID_STATE_ERR :
+				result = DOMMessages.INVALID_STATE_ERR;
+				break;
+			case DOMException.NAMESPACE_ERR :
+				result = DOMMessages.NAMESPACE_ERR;
+				break;
+			case DOMException.NO_DATA_ALLOWED_ERR :
+				result = DOMMessages.NO_DATA_ALLOWED_ERR;
+				break;
+			case DOMException.NO_MODIFICATION_ALLOWED_ERR :
+				result = DOMMessages.NO_MODIFICATION_ALLOWED_ERR;
+				break;
+			case DOMException.NOT_FOUND_ERR :
+				result = DOMMessages.NOT_FOUND_ERR;
+				break;
+			case DOMException.NOT_SUPPORTED_ERR :
+				result = DOMMessages.NOT_SUPPORTED_ERR;
+				break;
+			case DOMException.SYNTAX_ERR :
+				result = DOMMessages.SYNTAX_ERR;
+				break;
+			case 17:// DOMException.TYPE_MISMATCH_ERR :
+				result = DOMMessages.TYPE_MISMATCH_ERR;
+				break;
+			case 16:// DOMException.VALIDATION_ERR :
+				result = DOMMessages.VALIDATION_ERR;
+				break;
+			case DOMException.WRONG_DOCUMENT_ERR :
+				result = DOMMessages.WRONG_DOCUMENT_ERR;
+				break;
 			default :
-				result = new String();
+				result = NodeImpl.EMPTY_STRING;
 				break;
 		}
 		return result;
@@ -635,7 +698,7 @@
 	 *            org.w3c.dom.Node
 	 */
 	public Node removeChild(Node oldChild) throws DOMException {
-		throw new DOMException(DOMException.NOT_FOUND_ERR, new String());
+		throw new DOMException(DOMException.NOT_FOUND_ERR, DOMMessages.NOT_FOUND_ERR);
 	}
 
 	/**
@@ -667,7 +730,7 @@
 	 *            org.w3c.dom.Node
 	 */
 	public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
-		throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, new String());
+		throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, DOMMessages.HIERARCHY_REQUEST_ERR);
 	}
 
 	/**
@@ -832,11 +895,23 @@
 		return result;
 	}
 
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
+	/* (non-Javadoc)
+	 * @see org.w3c.dom.Node#compareDocumentPosition(org.w3c.dom.Node)
 	 */
 	public short compareDocumentPosition(Node other) throws DOMException {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
+		if (!(other instanceof IDOMNode))
+			throw new DOMException(DOMException.NOT_SUPPORTED_ERR, DOMMessages.NOT_SUPPORTED_ERR);
+
+		int nodeStart = this.getStartOffset();
+		int otherStart = ((IDOMNode) other).getStartOffset();
+
+		if (otherStart > nodeStart) {
+			return DOCUMENT_POSITION_FOLLOWING;
+		}
+		else if (otherStart < nodeStart) {
+			return DOCUMENT_POSITION_PRECEDING;
+		}
+		return DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;
 	}
 
 	/**
@@ -867,18 +942,18 @@
 		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
 	}
 
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
+	/* (non-Javadoc)
+	 * @see org.w3c.dom.Node#isEqualNode(org.w3c.dom.Node)
 	 */
 	public boolean isEqualNode(Node arg) {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
+		return this.equals(arg);
 	}
 
-	/**
-	 * NOT IMPLEMENTED, is defined here in preparation of DOM Level 3
+	/* (non-Javadoc)
+	 * @see org.w3c.dom.Node#isSameNode(org.w3c.dom.Node)
 	 */
 	public boolean isSameNode(Node other) {
-		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not implemented in this version."); //$NON-NLS-1$
+		return this == other;
 	}
 
 	/**
@@ -928,7 +1003,7 @@
 	public Object getUserData(String key) {
 		
 		if (key==null) return null;
-		
+		Map userDataTable = UserData.getInstance().getUserDataTable(this);
 		if (userDataTable!=null) {
 			UserDataAndHandler userDataAndHandler = (UserDataAndHandler) userDataTable.get(key);
 			if (userDataAndHandler!=null) {
@@ -955,7 +1030,7 @@
 		
 		//return immediately for null keys
 		if (key ==null) return null;
-		
+		Map userDataTable = UserData.getInstance().getUserDataTable(this);
 		//remove association for the key if data is null
 		if (data==null) {
 			if (userDataTable==null) return null;
@@ -1005,12 +1080,13 @@
 				& operation!=UserDataHandler.NODE_IMPORTED
 				& operation!=UserDataHandler.NODE_RENAMED)
 			return; 
-			
+		Map userDataTable = UserData.getInstance().getUserDataTable(this);	
 		if (userDataTable!=null) {
-			Enumeration keys=userDataTable.keys();
-			while (keys.hasMoreElements()) {
-				String key=(String) keys.nextElement(); //should always be a string
-				UserDataAndHandler dataAndHandler = (UserDataAndHandler) userDataTable.get(key);
+			Iterator entries =userDataTable.entrySet().iterator();
+			while (entries.hasNext()) {
+				Map.Entry entry = (Map.Entry) entries.next();
+				String key = entry.getKey().toString(); //should always be a string
+				UserDataAndHandler dataAndHandler = (UserDataAndHandler) entry.getValue();
 				if (dataAndHandler!=null) {
 					UserDataHandler dataHandler=dataAndHandler.getHandler();
 					if (dataHandler!=null) {
@@ -1025,12 +1101,12 @@
 	 * 
 	 * Class for user data and UserDataHandler
 	 */
-	protected class UserDataAndHandler implements Serializable {
+	protected static class UserDataAndHandler implements Serializable {
 
 		/**
 		 * Generated Serial ID
 		 */
-		private static final long serialVersionUID = 4860521237315444840L;
+		private static final long serialVersionUID = 4860521237315444841L;
 		/**
 		 * Generated serialization version
 		 */
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeListImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeListImpl.java
index 4bfed52..a620f32 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeListImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NodeListImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,19 +14,18 @@
 
 
 
-import java.util.Vector;
-
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
 /**
- * NodeListImpl class
+ * An array-backed NodeList, used to keep the array size down
  */
 public class NodeListImpl implements NodeList {
 
-	Object lockObject = new byte[0];
-
-	private Vector nodes = null;
+	private Object fLockObject = new byte[0];
+	private final static int growthConstant = 2;
+	private Node[] fNodes = null;
+	private int fNodeCount = 0;
 
 	/**
 	 * NodeListImpl constructor
@@ -35,6 +34,12 @@
 		super();
 	}
 
+	protected NodeListImpl(NodeListImpl list) {
+		super();
+		fNodeCount = list.fNodeCount;
+		fNodes = list.fNodes;
+	}
+
 	/**
 	 * appendNode method
 	 * 
@@ -45,23 +50,43 @@
 	protected Node appendNode(Node node) {
 		if (node == null)
 			return null;
-		if (this.nodes == null)
-			this.nodes = new Vector();
-		this.nodes.addElement(node);
+		synchronized (fLockObject) {
+			ensureCapacity(fNodeCount + 1);
+			fNodes[fNodeCount++] = node;
+		}
 		return node;
 	}
 
 	/**
-	 * getLength method
+	 * Grow the node array to at least the given size while keeping the
+	 * contents the same
 	 * 
-	 * @return int
+	 * @param needed
+	 */
+	private void ensureCapacity(int needed) {
+		if (fNodes == null) {
+			// first time
+			fNodes = new Node[needed];
+			return;
+		}
+		int oldLength = fNodes.length;
+		if (oldLength < needed) {
+			Node[] oldNodes = fNodes;
+			Node[] newNodes = new Node[needed + growthConstant];
+			System.arraycopy(oldNodes, 0, newNodes, 0, fNodeCount);
+			fNodes = newNodes;
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.w3c.dom.NodeList#getLength()
 	 */
 	public int getLength() {
-		synchronized (lockObject) {
-			if (this.nodes == null)
-				return 0;
-			return this.nodes.size();
-		}
+		return fNodeCount;
+	}
+	
+	protected final Node[] getNodes() {
+		return fNodes;
 	}
 
 	/**
@@ -69,26 +94,39 @@
 	protected Node insertNode(Node node, int index) {
 		if (node == null)
 			return null;
-		if (this.nodes == null || index >= this.nodes.size()) {
-			return appendNode(node);
+		synchronized (fLockObject) {
+			if (fNodes == null) {
+				// first time, ignore index
+				fNodes = new Node[1];
+				fNodes[fNodeCount++] = node;
+				return node;
+			}
+
+			// gracefully handle out of bounds
+			if (index < 0 || index > fNodeCount + 1)
+				return appendNode(node);
+
+			/*
+			 * Grow a new Node array, copying the old contents around the new
+			 * Node
+			 */
+			Node[] newNodes = new Node[fNodeCount + growthConstant];
+			System.arraycopy(fNodes, 0, newNodes, 0, index);
+			newNodes[index] = node;
+			System.arraycopy(fNodes, index, newNodes, index + 1, fNodeCount - index);
+			fNodes = newNodes;
+			fNodeCount++;
 		}
-		this.nodes.insertElementAt(node, index);
 		return node;
 	}
 
-	/**
-	 * item method
-	 * 
-	 * @return org.w3c.dom.Node
+	/* (non-Javadoc)
+	 * @see org.w3c.dom.NodeList#item(int)
 	 */
 	public Node item(int index) {
-		synchronized (lockObject) {
-			if (this.nodes == null)
-				return null;
-			if (index < 0 || index >= this.nodes.size())
-				return null;
-			return (Node) this.nodes.elementAt(index);
-		}
+		if (index < 0 || index >= fNodeCount)
+			return null; // invalid parameter
+		return fNodes[index];
 	}
 
 	/**
@@ -99,13 +137,21 @@
 	 *            int
 	 */
 	protected Node removeNode(int index) {
-		if (this.nodes == null)
+		if (this.fNodes == null)
 			return null; // no node
-		if (index < 0 || index >= this.nodes.size())
-			return null; // invalid parameter
 
-		Node removed = (Node) this.nodes.elementAt(index);
-		this.nodes.removeElementAt(index);
-		return removed;
+		synchronized (fLockObject) {
+			if (index < 0 || index >= fNodeCount)
+				return null; // invalid parameter
+
+			Node removed = fNodes[index];
+			Node[] newNodes = new Node[fNodeCount - 1];
+			// copy around node being removed
+			System.arraycopy(fNodes, 0, newNodes, 0, index);
+			System.arraycopy(fNodes, index + 1, newNodes, index, fNodeCount - index - 1);
+			fNodes = newNodes;
+			fNodeCount--;
+			return removed;
+		}
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NotationImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NotationImpl.java
index 0dbbfe0..186eea2 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NotationImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/NotationImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,7 +12,7 @@
  *     
  *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
  *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
+ *     David Carver (STAR) - bug 296999 - Inefficient use of new String()
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.document;
 
@@ -75,7 +75,7 @@
 	 */
 	public String getNodeName() {
 		if (this.name == null)
-			return new String();
+			return NodeImpl.EMPTY_STRING;
 		return this.name;
 	}
 
@@ -124,7 +124,7 @@
 	 */
 	public void setPublicId(String publicId) {
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 		this.publicId = publicId;
 	}
@@ -137,7 +137,7 @@
 	 */
 	public void setSystemId(String systemId) {
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 		this.systemId = systemId;
 	}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ProcessingInstructionImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ProcessingInstructionImpl.java
index 7a1420b..044eb53 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ProcessingInstructionImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ProcessingInstructionImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,7 +12,7 @@
  *     
  *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
  *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
+ *     David Carver (STAR) - bug 296999 - Inefficient use of new String()
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.document;
 
@@ -84,10 +84,10 @@
 
 		IStructuredDocumentRegion flatNode = getFirstStructuredDocumentRegion();
 		if (flatNode == null)
-			return new String();
+			return NodeImpl.EMPTY_STRING;
 		ITextRegionList regions = flatNode.getRegions();
 		if (regions == null)
-			return new String();
+			return NodeImpl.EMPTY_STRING;
 
 		ITextRegion targetRegion = null;
 		ITextRegion dataRegion = null;
@@ -109,7 +109,7 @@
 			}
 		}
 		if (dataRegion == null)
-			return new String();
+			return NodeImpl.EMPTY_STRING;
 		int offset = dataRegion.getStart();
 		int end = flatNode.getLength();
 		if (closeRegion != null)
@@ -152,7 +152,7 @@
 	 */
 	public String getTarget() {
 		if (this.target == null)
-			return new String();
+			return NodeImpl.EMPTY_STRING;
 		return this.target;
 	}
 
@@ -181,7 +181,7 @@
 	 */
 	public void setData(String data) throws DOMException {
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		this.data = data;
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ReadOnlyController.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ReadOnlyController.java
index f80e718..57c2375 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ReadOnlyController.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ReadOnlyController.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -250,7 +250,7 @@
 				lock(structuredDocument, offset, length, false, false);
 				offset = offset + span.offset + span.length;
 				length = flatNode.getEnd() - offset;
-				lock(structuredDocument, offset, length, canInsert, false);
+				lock(structuredDocument, offset, length, false, canInsert);
 			} else {
 				lock(flatNode, false, canInsert);
 			}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/SourceValidator.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/SourceValidator.java
index 66dd565..2051222 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/SourceValidator.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/SourceValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,6 +12,10 @@
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.document;
 
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.xml.core.internal.XMLCoreMessages;
 import org.eclipse.wst.xml.core.internal.provisional.IXMLCharEntity;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
@@ -226,8 +230,8 @@
 			end = found + 2;
 		} else {
 			// normal tag
-			int found = source.indexOf('>', offset);
-			if (found < 0)
+			int found = source.lastIndexOf('>');
+			if (found < offset)
 				return -1; // invalid tag
 			end = found + 1;
 		}
@@ -243,6 +247,7 @@
 			return false; // error
 		String message = null;
 
+
 		// setup validation conditions
 		boolean acceptTag = false;
 		boolean acceptClose = false;
@@ -276,6 +281,10 @@
 					return false; // error
 				acceptTag = true;
 				acceptClose = true;
+			} else if(hasNestedRegion(text)) {
+				//there are cases (such as with EL) that the text is to complicated
+				//	to be verified by this validator
+				return true;
 			}
 		} else {
 			IDOMDocument document = null;
@@ -343,4 +352,37 @@
 
 		return true;
 	}
+	
+	/**
+	 * True if the text has nested regions, meaning container is probably too
+	 * complicated (like EL regions) to validate with this validator.
+	 *
+	 * @param text
+	 * @return
+	 */
+	private boolean hasNestedRegion(TextImpl text) {
+		boolean done = false;
+
+		IStructuredDocumentRegion currRegion = text.getFirstStructuredDocumentRegion();
+		IStructuredDocumentRegion lastRegion = text.getLastStructuredDocumentRegion();
+
+		while(currRegion != null && !done) {
+			
+			ITextRegionList regions = currRegion.getRegions();
+			for(int i = 0; i < regions.size(); ++i) {
+				ITextRegion container = regions.get(i);
+				if ((container instanceof ITextRegionContainer)) {
+					ITextRegionList regions2 = ((ITextRegionContainer) container).getRegions();
+					if (regions2 != null) {
+						return true;
+					}
+				}
+			}
+
+			done = currRegion == lastRegion;
+			currRegion = currRegion.getNext();
+		}
+
+		return false;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionContainer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionContainer.java
index 1a53784..245211d 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionContainer.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionContainer.java
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (STAR) - bug 296999 - Inefficient use of new String()
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.document;
 
@@ -238,7 +238,7 @@
 	public String getText() {
 		int size = this.flatNodes.size();
 		if (size == 0)
-			return new String();
+			return NodeImpl.EMPTY_STRING;
 		StringBuffer buffer = new StringBuffer();
 		for (int i = 0; i < size; i++) {
 			IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) this.flatNodes.elementAt(i);
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionProxy.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionProxy.java
index cd11447..5312260 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionProxy.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionProxy.java
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (STAR) - bug 296999 - Inefficient use of new String()
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.document;
 
@@ -216,10 +216,10 @@
 	 */
 	public String getText() {
 		if (this.flatNode == null)
-			return new String();
+			return NodeImpl.EMPTY_STRING;
 		String text = this.flatNode.getText();
 		if (text == null)
-			return new String();
+			return NodeImpl.EMPTY_STRING;
 		int end = this.offset + this.length;
 		return text.substring(this.offset, end);
 	}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionUtil.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionUtil.java
index 4bd9b81..84a378b 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionUtil.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionUtil.java
@@ -75,6 +75,9 @@
 	 * Returns the first region.
 	 */
 	static ITextRegion getFirstRegion(IStructuredDocumentRegion flatNode) {
+		if(flatNode instanceof StructuredDocumentRegionProxy) {
+			flatNode = ((StructuredDocumentRegionProxy)flatNode).getStructuredDocumentRegion();
+		}
 		if (flatNode == null)
 			return null;
 		ITextRegionList regions = flatNode.getRegions();
@@ -87,6 +90,9 @@
 	 * Returns the type of the first region.
 	 */
 	static String getFirstRegionType(IStructuredDocumentRegion flatNode) {
+		if(flatNode instanceof StructuredDocumentRegionProxy) {
+			flatNode = ((StructuredDocumentRegionProxy)flatNode).getStructuredDocumentRegion();
+		}
 		if (flatNode == null)
 			return DOMRegionContext.UNDEFINED;
 		ITextRegionList regions = flatNode.getRegions();
@@ -114,6 +120,9 @@
 	 * Returns the last region.
 	 */
 	static ITextRegion getLastRegion(IStructuredDocumentRegion flatNode) {
+		if(flatNode instanceof StructuredDocumentRegionProxy) {
+			flatNode = ((StructuredDocumentRegionProxy)flatNode).getStructuredDocumentRegion();
+		}
 		if (flatNode == null)
 			return null;
 		ITextRegionList regions = flatNode.getRegions();
@@ -126,6 +135,9 @@
 	 * Returns the type of the first region.
 	 */
 	static String getLastRegionType(IStructuredDocumentRegion flatNode) {
+		if(flatNode instanceof StructuredDocumentRegionProxy) {
+			flatNode = ((StructuredDocumentRegionProxy)flatNode).getStructuredDocumentRegion();
+		}
 		if (flatNode == null)
 			return DOMRegionContext.UNDEFINED;
 		ITextRegionList regions = flatNode.getRegions();
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TextImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TextImpl.java
index d386910..cad3207 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TextImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TextImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,12 +12,10 @@
  *     
  *     Balazs Banfai: Bug 154737 getUserData/setUserData support for Node
  *     https://bugs.eclipse.org/bugs/show_bug.cgi?id=154737
- *     
+ *     David Carver (STAR) - bug 296999 - Inefficient use of new String()
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.document;
 
-
-
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
@@ -30,7 +28,6 @@
 import org.w3c.dom.Text;
 import org.w3c.dom.UserDataHandler;
 
-
 /**
  * TextImpl class
  */
@@ -90,7 +87,7 @@
 			return;
 
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		String newSource = getSource(arg);
@@ -140,7 +137,7 @@
 			return;
 
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		TextImpl text = (TextImpl) newText;
@@ -179,15 +176,15 @@
 		if (count == 0)
 			return;
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 		if (count < 0 || offset < 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 
 		String source = getSource();
 		if (source == null || source.length() == 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 		StringPair pair = substringSourceExcluded(source, offset, count);
 		if (pair == null)
@@ -204,7 +201,7 @@
 				source = second;
 		}
 		if (source == null)
-			source = new String(); // delete all
+			source = NodeImpl.EMPTY_STRING; // delete all
 		setTextSource(source);
 	}
 
@@ -226,7 +223,7 @@
 	 */
 	private String getData(IStructuredDocumentRegion flatNode) {
 		if (flatNode == null)
-			return new String();
+			return NodeImpl.EMPTY_STRING;
 
 		if (flatNode instanceof StructuredDocumentRegionContainer) {
 			StructuredDocumentRegionContainer container = (StructuredDocumentRegionContainer) flatNode;
@@ -430,16 +427,16 @@
 		if (arg == null || arg.length() == 0)
 			return;
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 		if (offset < 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 
 		String source = getSource();
 		if (source == null || source.length() == 0) {
 			if (offset > 0) {
-				throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+				throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 			}
 			source = getSource(arg);
 			if (source != null)
@@ -511,20 +508,20 @@
 		if (newText == null)
 			return;
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 		TextImpl text = (TextImpl) newText;
 		String newSource = text.getSource();
-		if (newSource == null && newSource.length() == 0)
+		if (newSource == null || newSource.length() == 0)
 			return;
 		if (offset < 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 
 		String source = getSource();
 		if (source == null || source.length() == 0) {
 			if (offset > 0) {
-				throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+				throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 			}
 			setTextSource(newSource);
 			return;
@@ -737,7 +734,7 @@
 	 */
 	public void replaceData(int offset, int count, String arg) throws DOMException {
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 		if (arg == null || arg.length() == 0) {
 			deleteData(offset, count);
@@ -748,12 +745,12 @@
 			return;
 		}
 		if (offset < 0 || count < 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 
 		String source = getSource();
 		if (source == null || source.length() == 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 
 		StringPair pair = substringSourceExcluded(source, offset, count);
@@ -852,7 +849,7 @@
 	 */
 	public void setData(String data) throws DOMException {
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		this.fSource = null;
@@ -863,7 +860,7 @@
 	 */
 	public void setSource(String source) throws InvalidCharacterException {
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		SourceValidator validator = new SourceValidator(this);
@@ -883,7 +880,7 @@
 	 */
 	public void setTextSource(String source) {
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		this.fSource = source;
@@ -895,7 +892,7 @@
 	 */
 	public void setValueSource(String source) {
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 
 		SourceValidator validator = new SourceValidator(this);
@@ -911,14 +908,14 @@
 	 */
 	public Text splitText(int offset) throws DOMException {
 		if (!isDataEditable()) {
-			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String());
+			throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessages.NO_MODIFICATION_ALLOWED_ERR);
 		}
 		if (offset < 0) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 		int length = getLength();
 		if (offset > length) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 		Document document = getOwnerDocument();
 		if (document == null)
@@ -1005,17 +1002,17 @@
 	private String substringData(String data, int offset, int count) throws DOMException {
 		// sure offset and count are non-negative
 		if (count == 0)
-			return new String();
+			return NodeImpl.EMPTY_STRING;
 		if (data == null) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 		int length = data.length();
 		if (offset > length) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 		int end = offset + count;
 		if (end > length) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 		return data.substring(offset, end);
 	}
@@ -1033,7 +1030,7 @@
 		if (data != null && data.length() > 0) {
 			data = substringData(data, offset, count);
 			if (data == null)
-				return new String();
+				return NodeImpl.EMPTY_STRING;
 			String source = getSource(data);
 			if (source != null)
 				return source;
@@ -1049,9 +1046,9 @@
 	private String substringSource(String source, int offset, int count) throws DOMException {
 		// sure offset and count are non-negative
 		if (count == 0)
-			return new String();
+			return NodeImpl.EMPTY_STRING;
 		if (source == null) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 
 		int length = source.length();
@@ -1079,7 +1076,7 @@
 		}
 
 		if (offset > length || end > length) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 
 		return source.substring(offset, end);
@@ -1094,7 +1091,7 @@
 		if (source == null) {
 			if (offset == 0 && count == 0)
 				return new StringPair(null, null);
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 
 		int length = source.length();
@@ -1122,7 +1119,7 @@
 		}
 
 		if (offset > length || end > length) {
-			throw new DOMException(DOMException.INDEX_SIZE_ERR, new String());
+			throw new DOMException(DOMException.INDEX_SIZE_ERR, DOMMessages.INDEX_SIZE_ERR);
 		}
 
 		String first = (offset > 0 ? source.substring(0, offset) : null);
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/UserData.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/UserData.java
new file mode 100644
index 0000000..695ff71
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/UserData.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.document;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import org.w3c.dom.Node;
+
+/**
+ * Collects user data associated to a Node.
+ * 
+ */
+final class UserData {
+
+	private static UserData fInstance;
+
+	/**
+	 * Mapping of a Node to its User Data table (represented by a Map)
+	 */
+	private Map fData;
+
+	private UserData() {
+		fData = new WeakHashMap(0);
+	}
+
+	public static synchronized UserData getInstance() {
+		if (fInstance == null)
+			fInstance = new UserData();
+		return fInstance;
+	}
+
+	/**
+	 * Get the user data table associated with <code>node</code>.
+	 * 
+	 * @param node the node
+	 * @return the user data table associated with the <code>node</code>
+	 */
+	public synchronized Map getUserDataTable(Node node) {
+		if (fData.containsKey(node))
+			return (Map) fData.get(node);
+		Map table = new HashMap();
+		fData.put(node, table);
+		return table;
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelNotifierImpl.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelNotifierImpl.java
index a518f84..75f89a0 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelNotifierImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelNotifierImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,10 +12,11 @@
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.document;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
-import java.util.Vector;
 
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.sse.core.internal.util.Debug;
@@ -28,8 +29,7 @@
 
 public class XMLModelNotifierImpl implements XMLModelNotifier {
 
-	/* end: for debugging only */
-	private class NotifyEvent {
+	private static class NotifyEvent {
 		Object changedFeature;
 		boolean discarded;
 		Object newValue;
@@ -65,7 +65,7 @@
 
 	private boolean changing = false;
 	private boolean doingNewModel = false;
-	private Vector events = null;
+	private List fEvents = null;
 	private boolean flushing = false;
 
 	/**
@@ -119,13 +119,13 @@
 
 	public void cancelPending() {
 		// we don't want to change the size of this array, since
-		// the array may be being processed, in the defferred notification
+		// the array may be being processed, in the deferred notification
 		// loop, but we can signal that all
 		// should be discarded, so any remaining ones will be ignored.
-		if (this.events != null) {
-			Iterator iterator = this.events.iterator();
-			while (iterator.hasNext()) {
-				NotifyEvent event = (NotifyEvent) iterator.next();
+		if (this.fEvents != null) {
+			int size = fEvents.size();
+			for (int i = 0; i < size; i++) {
+				NotifyEvent event = (NotifyEvent) fEvents.get(i);
 				event.discarded = true;
 			}
 		}
@@ -180,7 +180,7 @@
 			notifyStructureChanged(this.changedRoot);
 			if (Debug.debugNotifyDeferred) {
 				String p = this.changedRoot.getNodeName();
-				System.out.println("Deferred STRUCUTRE_CHANGED: " + p); //$NON-NLS-1$
+				System.out.println("Deferred STRUCTURE_CHANGED: " + p); //$NON-NLS-1$
 			}
 			this.changedRoot = null;
 		}
@@ -201,7 +201,7 @@
 	/**
 	 */
 	public boolean hasChanged() {
-		return (this.events != null);
+		return (this.fEvents != null);
 	}
 
 	/**
@@ -217,15 +217,15 @@
 			return;
 		if (this.changing && !this.flushing) {
 			// defer notification
-			if (this.events == null)
-				this.events = new Vector();
+			if (this.fEvents == null)
+				this.fEvents = new ArrayList();
 			// we do not defer anything if we are doing a new Model,
 			// except for the document event, since all others are
 			// trivial and not needed at that initial point.
 			// But even for that one document event, in the new model case,
 			// it is still important to defer it.
 			if ((!doingNewModel) || (((Node) notifier).getNodeType() == Node.DOCUMENT_NODE)) {
-				this.events.addElement(new NotifyEvent(notifier, eventType, changedFeature, oldValue, newValue, pos));
+				this.fEvents.add(new NotifyEvent(notifier, eventType, changedFeature, oldValue, newValue, pos));
 			}
 			return;
 		}
@@ -244,30 +244,30 @@
 	/**
 	 */
 	private void notifyDeferred() {
-		if (this.events == null)
+		if (this.fEvents == null)
 			return;
 		if (this.flushing)
 			return;
 		this.flushing = true; // force notification
-		int count = this.events.size();
+		int count = this.fEvents.size();
+		
 		if (!doingNewModel && fOptimizeDeferred) {
-			Map values = new HashMap();
+			Map notifyEvents = new HashMap();
 			for (int i = 0; i < count; i++) {
-				NotifyEvent event = (NotifyEvent) this.events.elementAt(i);
+				NotifyEvent event = (NotifyEvent) this.fEvents.get(i);
 				if (event == null)
 					continue; // error
 				event.index = i;
 				if(event.type == INodeNotifier.REMOVE) {
-					addToMap(event.oldValue, event, values);
+					addToMap(event.oldValue, event, notifyEvents);
 				}
 				if(event.type == INodeNotifier.ADD) {
-					addToMap(event.newValue, event, values);
+					addToMap(event.newValue, event, notifyEvents);
 				}
 			}
-			Iterator it = values.keySet().iterator();
-			while(it.hasNext()) {
-				Object value = it.next();
-				NotifyEvent[] es = (NotifyEvent[])values.get(value);
+			Iterator it = notifyEvents.values().iterator();
+			while (it.hasNext()) {
+				NotifyEvent[] es = (NotifyEvent[]) it.next();
 				for (int i = 0; i < es.length - 1; i++) {
 					NotifyEvent event = es[i];
 					if(es[i].discarded) continue;
@@ -284,13 +284,13 @@
 				}
 			}
 			for (int i = 0; i < count; i++) {
-				NotifyEvent event = (NotifyEvent) this.events.elementAt(i);
+				NotifyEvent event = (NotifyEvent) this.fEvents.get(i);
 				if (event == null)
 					continue; // error
 				if(event.discarded) continue;
 				if (event.notifier != null && fOptimizeDeferredAccordingToParentAdded) {
 					if (event.type == INodeNotifier.ADD) {
-						NotifyEvent[] es = (NotifyEvent[])values.get(event.notifier);
+						NotifyEvent[] es = (NotifyEvent[])notifyEvents.get(event.notifier);
 						if(es != null) for (int p = 0; p < es.length && es[p].index < event.index; p++) {
 							NotifyEvent prev = es[p];
 							if (prev.type == INodeNotifier.REMOVE && prev.oldValue == event.notifier) {
@@ -313,7 +313,7 @@
 				if(event.discarded) continue;
 				if (event.notifier != null && fOptimizeDeferredAccordingToParentRemoved) {
 					if (event.type == INodeNotifier.REMOVE) {
-						NotifyEvent[] es = (NotifyEvent[])values.get(event.notifier);
+						NotifyEvent[] es = (NotifyEvent[])notifyEvents.get(event.notifier);
 						if(es != null) for (int n = 0; n < es.length; n++) {
 							NotifyEvent next = es[n];
 							if(next.index > event.index && next.type == INodeNotifier.REMOVE) {
@@ -333,7 +333,7 @@
 			}
 		}
 		for (int i = 0; i < count; i++) {
-			NotifyEvent event = (NotifyEvent) this.events.elementAt(i);
+			NotifyEvent event = (NotifyEvent) this.fEvents.get(i);
 			if (event == null)
 				continue; // error
 			if(event.discarded) continue;
@@ -341,7 +341,7 @@
 		}
 		if (Debug.debugNotifyDeferred) {
 			for (int l = 0; l < count; l++) {
-				NotifyEvent event = (NotifyEvent) this.events.elementAt(l);
+				NotifyEvent event = (NotifyEvent) this.fEvents.get(l);
 				Object o = null;
 				String t = null;
 				if (event.type == INodeNotifier.ADD) {
@@ -360,7 +360,7 @@
 			}
 		}
 		this.flushing = false;
-		this.events = null;
+		this.fEvents = null;
 	}
 
 	void addToMap(Object o, NotifyEvent event, Map map) {
@@ -443,13 +443,13 @@
 			setCommonRootIfNeeded(node);
 			if (Debug.debugNotifyDeferred) {
 				String p = this.changedRoot.getNodeName();
-				System.out.println("requested STRUCUTRE_CHANGED: " + p); //$NON-NLS-1$
+				System.out.println("requested STRUCTURE_CHANGED: " + p); //$NON-NLS-1$
 			}
 			return;
 		}
 		if (Debug.debugNotifyDeferred) {
 			String p = node.getNodeName();
-			System.out.println("STRUCUTRE_CHANGED: " + p); //$NON-NLS-1$
+			System.out.println("STRUCTURE_CHANGED: " + p); //$NON-NLS-1$
 		}
 		notifyStructureChanged(node);
 	}
@@ -467,7 +467,7 @@
 		if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
 			Attr attr = (Attr) node;
 			notifier = (IDOMNode) attr.getOwnerElement();
-			// TODO_dmw: experimental: changed 06/29/2004 to send "strucuture
+			// TODO_dmw: experimental: changed 06/29/2004 to send "structuure
 			// changed" even for attribute value changes
 			// there are pros and cons to considering attribute value
 			// "structure changed". Will (re)consider
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelParser.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelParser.java
index 06d25f8..9f893bb 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelParser.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelParser.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,10 +14,11 @@
 
 
 
-import java.util.Enumeration;
+import java.util.ArrayList;
 import java.util.Iterator;
-import java.util.Vector;
+import java.util.List;
 
+import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
@@ -41,6 +42,7 @@
 public class XMLModelParser {
 	private XMLModelContext context = null;
 	private DOMModelImpl model = null;
+	private TextImpl lastTextNode = null;
 
 	/**
 	 */
@@ -296,12 +298,20 @@
 	 * changeRegion method
 	 * 
 	 */
-	void changeRegion(IStructuredDocumentRegion flatNode, ITextRegion region) {
+	void changeRegion(RegionChangedEvent change, IStructuredDocumentRegion flatNode, ITextRegion region) {
 		if (flatNode == null || region == null)
 			return;
 		if (this.model.getDocument() == null)
 			return;
 		this.context = new XMLModelContext(this.model.getDocument());
+		
+		//determine if change was whitespace only change
+		boolean isWhitespaceChange = false;
+		if(change.getText() != null && change.getText().length() > 0) {
+			isWhitespaceChange = Character.isWhitespace(change.getText().charAt(0));
+		} else if(change.getDeletedText() != null && change.getDeletedText().length() > 0) {
+			isWhitespaceChange = Character.isWhitespace(change.getDeletedText().charAt(0));
+		}
 
 		// optimize typical cases
 		String regionType = region.getType();
@@ -309,15 +319,31 @@
 			changeData(flatNode, region);
 		}
 		else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
+			if (isWhitespaceChange && (change.getOffset() >= flatNode.getStartOffset() + region.getTextEnd())) {
+				// change is entirely in white-space
+				return;
+			}
 			changeAttrName(flatNode, region);
 		}
 		else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+			if (isWhitespaceChange && (change.getOffset() >= flatNode.getStartOffset() + region.getTextEnd())) {
+				// change is entirely in white-space
+				return;
+			}
 			changeAttrValue(flatNode, region);
 		}
 		else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
+			if (isWhitespaceChange && (change.getOffset() >= flatNode.getStartOffset() + region.getTextEnd())) {
+				// change is entirely in white-space
+				return;
+			}
 			changeAttrEqual(flatNode, region);
 		}
 		else if (regionType == DOMRegionContext.XML_TAG_NAME || isNestedTagName(regionType)) {
+			if (isWhitespaceChange && (change.getOffset() >= flatNode.getStartOffset() + region.getTextEnd())) {
+				// change is entirely in white-space
+				return;
+			}
 			changeTagName(flatNode, region);
 		}
 		else {
@@ -636,6 +662,10 @@
 	/**
 	 */
 	private void cleanupText() {
+		if (lastTextNode != null) {
+			lastTextNode.notifyValueChanged();
+			lastTextNode = null;
+		}
 		Node parent = this.context.getParentNode();
 		if (parent == null)
 			return; // error
@@ -892,7 +922,7 @@
 		if (regions == null)
 			return;
 
-		String data = null;
+		StringBuffer data = null;
 		boolean isJSPTag = false;
 		Iterator e = regions.iterator();
 		while (e.hasNext()) {
@@ -903,13 +933,16 @@
 			}
 			else if (regionType == DOMRegionContext.XML_COMMENT_TEXT || isNestedCommentText(regionType)) {
 				if (data == null) {
-					data = flatNode.getText(region);
+					data = new StringBuffer(flatNode.getText(region));
+				}
+				else {
+					data.append(flatNode.getText(region));
 				}
 			}
 		}
 
 		if (data != null) {
-			ElementImpl element = (ElementImpl) createCommentElement(data, isJSPTag);
+			ElementImpl element = (ElementImpl) createCommentElement(data.toString(), isJSPTag);
 			if (element != null) {
 				if (!isEndTag(element)) {
 					element.setStartStructuredDocumentRegion(flatNode);
@@ -1116,8 +1149,10 @@
 			if (text != null) { // existing text found
 				// do not append data
 				text.appendStructuredDocumentRegion(flatNode);
-				// notify the change
-				text.notifyValueChanged();
+				// Adjacent text nodes, where changes were queued
+				if (lastTextNode != null && lastTextNode != text)
+					lastTextNode.notifyValueChanged();
+				lastTextNode = text;
 				return;
 			}
 
@@ -1181,7 +1216,7 @@
 
 		String tagName = null;
 		AttrImpl attr = null;
-		Vector attrNodes = null;
+		List attrNodes = null;
 		boolean isCloseTag = false;
 		Iterator e = regions.iterator();
 		while (e.hasNext()) {
@@ -1199,8 +1234,8 @@
 				if (attr != null) {
 					attr.setNameRegion(region);
 					if (attrNodes == null)
-						attrNodes = new Vector();
-					attrNodes.addElement(attr);
+						attrNodes = new ArrayList();
+					attrNodes.add(attr);
 				}
 			}
 			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
@@ -1245,12 +1280,8 @@
 			return;
 		}
 		if (attrNodes != null) {
-			Enumeration ae = attrNodes.elements();
-			while (ae.hasMoreElements()) {
-				Attr a = (Attr) ae.nextElement();
-				if (a == null)
-					continue;
-				element.appendAttributeNode(a);
+			for (int i = 0; i < attrNodes.size(); i++) {
+				element.appendAttributeNode((Attr) attrNodes.get(i));
 			}
 		}
 		element.setJSPTag(true);
@@ -1279,75 +1310,36 @@
 	 *            org.w3c.dom.Node
 	 */
 	private void insertNode(Node node) {
-		if (node == null)
-			return;
-		if (this.context == null)
-			return;
-
-		Node parent = this.context.getParentNode();
-		if (parent == null)
-			return;
-		Node next = this.context.getNextNode();
-		while (parent.getNodeType() == Node.ELEMENT_NODE) {
-			ElementImpl element = (ElementImpl) parent;
-			if (canContain(element, node)) {
-				if (!element.hasStartTag() && next == element.getFirstChild()) {
-					// first child of implicit tag
-					// deletege to the parent
-					parent = element.getParentNode();
-					if (parent == null)
-						return;
-					next = element;
+		if(node != null && this.context != null) {
+			Node parent = this.context.getParentNode();
+			if(parent != null) {
+				Node next = this.context.getNextNode();
+				// Reset parents which are closed container elements; should not be parents
+				if(parent.getNodeType() == Node.ELEMENT_NODE) {
+					String type = ((ElementImpl)parent).getStartStructuredDocumentRegion().getLastRegion().getType();
+					if(((ElementImpl)parent).isContainer() && type == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
+						next = parent.getNextSibling();
+						parent = parent.getParentNode();
+					}
+					else {
+						ModelParserAdapter adapter = getParserAdapter();
+						if (adapter != null) {
+							while (parent.getNodeType() == Node.ELEMENT_NODE && !adapter.canContain( (Element) parent, node) && adapter.isEndTagOmissible((Element) parent)) {
+								next = parent.getNextSibling();
+								parent = parent.getParentNode();
+							}
+						}
+					}
+				}	
+				insertNode(parent, node, next);
+				next = node.getNextSibling();
+				if (next != null) {
 					this.context.setNextNode(next);
-					continue;
-				}
-				break;
-			}
-			parent = element.getParentNode();
-			if (parent == null)
-				return;
-
-			// promote siblings
-			Node newNext = element.getNextSibling();
-			Node child = next;
-			while (child != null) {
-				Node nextChild = child.getNextSibling();
-				element.removeChild(child);
-				parent.insertBefore(child, newNext);
-				child = nextChild;
-			}
-
-			// leave the old end tag where it is
-			if (element.hasEndTag()) {
-				Element end = element.removeEndTag();
-				if (end != null) {
-					parent.insertBefore(end, newNext);
-					if (next == null)
-						next = end;
+				} else {
+					this.context.setParentNode(node.getParentNode());
 				}
 			}
-			if (!element.hasStartTag()) {
-				// implicit element
-				if (!element.hasChildNodes()) {
-					parent.removeChild(element);
-				}
-			}
-
-			// update context
-			if (next == null)
-				next = newNext;
-			if (next != null)
-				this.context.setNextNode(next);
-			else
-				this.context.setParentNode(parent);
 		}
-
-		insertNode(parent, node, next);
-		next = node.getNextSibling();
-		if (next != null)
-			this.context.setNextNode(next);
-		else
-			this.context.setParentNode(node.getParentNode());
 	}
 
 	/**
@@ -1413,6 +1405,11 @@
 		if (newElement.isEmptyTag() || !newElement.isContainer())
 			return;
 
+		// Ignore container tags that have been closed
+		String type = newElement.getStartStructuredDocumentRegion().getLastRegion().getType();
+		if(newElement.isContainer() && type == DOMRegionContext.XML_EMPTY_TAG_CLOSE)
+			return;
+
 		// demote siblings
 		Node parent = this.context.getParentNode();
 		if (parent == null)
@@ -1440,7 +1437,7 @@
 		String tagName = null;
 		boolean isEmptyTag = false;
 		AttrImpl attr = null;
-		Vector attrNodes = null;
+		List attrNodes = null;
 		Iterator e = regions.iterator();
 		while (e.hasNext()) {
 			ITextRegion region = (ITextRegion) e.next();
@@ -1458,8 +1455,8 @@
 				if (attr != null) {
 					attr.setNameRegion(region);
 					if (attrNodes == null)
-						attrNodes = new Vector();
-					attrNodes.addElement(attr);
+						attrNodes = new ArrayList();
+					attrNodes.add(attr);
 				}
 			}
 			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
@@ -1492,12 +1489,8 @@
 			return;
 		}
 		if (attrNodes != null) {
-			Enumeration ae = attrNodes.elements();
-			while (ae.hasMoreElements()) {
-				Attr a = (Attr) ae.nextElement();
-				if (a == null)
-					continue;
-				element.appendAttributeNode(a);
+			for (int i = 0; i < attrNodes.size(); i++) {
+				element.appendAttributeNode((Attr) attrNodes.get(i));
 			}
 		}
 		if (isEmptyTag)
@@ -1512,6 +1505,7 @@
 	 */
 	protected void insertStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
 		String regionType = StructuredDocumentRegionUtil.getFirstRegionType(flatNode);
+		boolean isTextNode = false;
 		if (regionType == DOMRegionContext.XML_TAG_OPEN) {
 			insertStartTag(flatNode);
 		}
@@ -1523,6 +1517,7 @@
 		}
 		else if (regionType == DOMRegionContext.XML_ENTITY_REFERENCE || regionType == DOMRegionContext.XML_CHAR_REFERENCE) {
 			insertEntityRef(flatNode);
+			isTextNode = true;
 		}
 		else if (regionType == DOMRegionContext.XML_DECLARATION_OPEN) {
 			insertDecl(flatNode);
@@ -1538,6 +1533,13 @@
 		}
 		else {
 			insertText(flatNode);
+			isTextNode = true;
+		}
+
+		// Changes to text regions are queued up, and once the value is done changing a notification is sent
+		if (!isTextNode && lastTextNode != null) {
+			lastTextNode.notifyValueChanged();
+			lastTextNode = null;
 		}
 	}
 
@@ -1576,8 +1578,10 @@
 		TextImpl text = (TextImpl) this.context.findPreviousText();
 		if (text != null) { // existing text found
 			text.appendStructuredDocumentRegion(flatNode);
-			// notify the change
-			text.notifyValueChanged();
+			// Adjacent text nodes, where changes were queued
+			if (lastTextNode != null && lastTextNode != text)
+				lastTextNode.notifyValueChanged();
+			lastTextNode = text;
 			return;
 		}
 
@@ -2330,12 +2334,9 @@
 			setupContext(oldStructuredDocumentRegions.item(0));
 			// Node startParent = this.context.getParentNode();
 
-			Enumeration e = oldStructuredDocumentRegions.elements();
-			while (e.hasMoreElements()) {
-				IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) e.nextElement();
-				if (flatNode == null)
-					continue;
-				removeStructuredDocumentRegion(flatNode);
+			for (int i = 0; i < oldCount; i++) {
+				IStructuredDocumentRegion documentRegion = oldStructuredDocumentRegions.item(i);
+				removeStructuredDocumentRegion(documentRegion);
 			}
 		}
 		else {
@@ -2348,12 +2349,9 @@
 		this.context.setLast();
 
 		if (newCount > 0) {
-			Enumeration e = newStructuredDocumentRegions.elements();
-			while (e.hasMoreElements()) {
-				IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) e.nextElement();
-				if (flatNode == null)
-					continue;
-				insertStructuredDocumentRegion(flatNode);
+			for (int i = 0; i < newCount; i++) {
+				IStructuredDocumentRegion documentRegion = newStructuredDocumentRegions.item(i);
+				insertStructuredDocumentRegion(documentRegion);
 			}
 		}
 
@@ -2374,7 +2372,7 @@
 			return;
 
 		if (offset == 0) {
-			// at the beggining of document
+			// at the beginning of document
 			Node child = root.getFirstChild();
 			if (child != null)
 				this.context.setNextNode(child);
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelUpdater.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelUpdater.java
index a4efc2d..a92b233 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelUpdater.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelUpdater.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (STAR) - bug 296999 - Inefficient use of new String()
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.document;
 
@@ -17,6 +17,7 @@
 import java.util.Enumeration;
 import java.util.Iterator;
 
+import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
@@ -81,7 +82,7 @@
 
 		String name = attr.getName();
 		if (name == null)
-			name = new String();
+			name = NodeImpl.EMPTY_STRING;
 		ITextRegion nameRegion = attr.getNameRegion();
 		if (nameRegion == null)
 			return; // error
@@ -139,7 +140,7 @@
 
 			value = this.generator.generateAttrValue(attr, quote);
 			if (value == null) {
-				value = new String();
+				value = NodeImpl.EMPTY_STRING;
 				// remove equal too
 				ITextRegion equalRegion = attr.getEqualRegion();
 				if (equalRegion != null)
@@ -159,7 +160,7 @@
 			if (value == null) {
 				if (equalRegion == null)
 					return; // nothng to do
-				value = new String();
+				value = NodeImpl.EMPTY_STRING;
 				// remove equal
 				start += equalRegion.getStart();
 				end += equalRegion.getTextEnd();
@@ -232,8 +233,11 @@
 		return;
 	}
 
-	void changeRegion(IStructuredDocumentRegion flatNode, ITextRegion region) {
-		// future_TODO: optimize
+	void changeRegion(RegionChangedEvent change, IStructuredDocumentRegion flatNode, ITextRegion region) {
+		if (change.getOffset() >= flatNode.getStartOffset() + region.getTextEnd()) {
+			// change is entirely in white-space
+			return;
+		}
 
 		NodeImpl root = (NodeImpl) this.model.getDocument();
 		this.parentNode = root;
@@ -521,7 +525,7 @@
 
 		String source = this.generator.generateSource(text);
 		if (source == null)
-			source = new String();
+			source = NodeImpl.EMPTY_STRING;
 		int length = source.length();
 
 		TextImpl impl = (TextImpl) text;
@@ -603,7 +607,7 @@
 
 		String source = this.generator.generateSource(node);
 		if (source == null)
-			source = new String();
+			source = NodeImpl.EMPTY_STRING;
 		int length = source.length();
 
 		NodeImpl impl = (NodeImpl) node;
@@ -1484,7 +1488,7 @@
 				else {
 					String content = this.generator.generateSource(node);
 					if (content == null)
-						content = new String();
+						content = NodeImpl.EMPTY_STRING;
 					int length = content.length();
 					IStructuredDocumentRegion flatNode = null;
 					if (length > 0) {
@@ -1586,7 +1590,7 @@
 	private void replaceSource(String source, int start, int end) {
 		int inserted = 0;
 		if (source == null)
-			source = new String();
+			source = NodeImpl.EMPTY_STRING;
 		else
 			inserted = source.length();
 		int removed = end - start;
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/DefaultXMLPartitionFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/DefaultXMLPartitionFormatter.java
index e258d9d..66b4b8d 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/DefaultXMLPartitionFormatter.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/DefaultXMLPartitionFormatter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,10 +7,11 @@
  * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     David Carver (STAR) - bug 297006 - String Comparison
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.formatter;
 
-import java.util.List;
+import java.util.Iterator;
 
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.text.BadLocationException;
@@ -20,6 +21,7 @@
 import org.eclipse.text.edits.DeleteEdit;
 import org.eclipse.text.edits.InsertEdit;
 import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.ReplaceEdit;
 import org.eclipse.text.edits.TextEdit;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
@@ -33,10 +35,6 @@
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
@@ -57,17 +55,33 @@
 	}
 
 	static private final String PRESERVE = "preserve";//$NON-NLS-1$
+	static private final String COLLAPSE = "collapse";//$NON-NLS-1$
+	static private final String REPLACE = "replace";//$NON-NLS-1$
 	static private final String PRESERVE_QUOTED = "\"preserve\"";//$NON-NLS-1$
 	static private final String XML_SPACE = "xml:space";//$NON-NLS-1$
 	static private final String XSL_NAMESPACE = "http://www.w3.org/1999/XSL/Transform"; //$NON-NLS-1$
 	static private final String XSL_ATTRIBUTE = "attribute"; //$NON-NLS-1$
 	static private final String XSL_TEXT = "text"; //$NON-NLS-1$
 	static private final String SPACE = " "; //$NON-NLS-1$
-	static private final String STRING = "string"; //$NON-NLS-1$
+	static private final String EMPTY = ""; //$NON-NLS-1$
+	static private final String PROPERTY_WHITESPACE_FACET = "org.eclipse.wst.xsd.cm.properties/whitespace"; //$NON-NLS-1$
 
 	private XMLFormattingPreferences fPreferences = null;
 	private IProgressMonitor fProgressMonitor;
 
+	private int replaceSpaces(TextEdit textEdit, int spaceStartOffset, int availableLineWidth, String whitespaceRun) {
+		StringBuffer buff = new StringBuffer(whitespaceRun);
+		for(int i = 0; i < buff.length(); i++) {
+			buff.setCharAt(i, ' '); //$NON-NLS-1$
+		}
+		String replacementString = buff.toString();
+		if (!replacementString.equals(whitespaceRun)) {
+			ReplaceEdit replaceEdit = new ReplaceEdit(spaceStartOffset, whitespaceRun.length(), replacementString);
+			textEdit.addChild(replaceEdit);
+		}
+		return availableLineWidth;
+	}
+	
 	private int collapseSpaces(TextEdit textEdit, int spaceStartOffset, int availableLineWidth, String whitespaceRun) {
 		// prefer to use use existing whitespace
 		int existingWhitespaceOffset = whitespaceRun.indexOf(' ');
@@ -96,6 +110,23 @@
 		--availableLineWidth;
 		return availableLineWidth;
 	}
+	
+	private int collapseAndIndent(TextEdit textEdit, int spaceStartOffset, int availableLineWidth, int indentLevel, String whitespaceRun, IStructuredDocumentRegion currentRegion) {
+		// Need to keep blank lines, but still collapse the whitespace
+		String lineDelimiters = null;
+		if (!getFormattingPreferences().getClearAllBlankLines()) {
+			lineDelimiters = extractLineDelimiters(whitespaceRun, currentRegion);
+			String formattedLine = lineDelimiters + getIndentString(indentLevel);
+			if(lineDelimiters.length() > 0 && !formattedLine.equals(whitespaceRun)) {
+				textEdit.addChild(new ReplaceEdit(spaceStartOffset, whitespaceRun.length(), formattedLine));
+				availableLineWidth = getFormattingPreferences().getMaxLineWidth() - indentLevel;
+			}
+		}
+		if (lineDelimiters == null || lineDelimiters.length() == 0) {
+			availableLineWidth = collapseSpaces(textEdit, spaceStartOffset, availableLineWidth, whitespaceRun);
+		}
+		return availableLineWidth;
+	}
 
 	private void deleteTrailingSpaces(TextEdit textEdit, ITextRegion currentTextRegion, IStructuredDocumentRegion currentDocumentRegion) {
 		int textEnd = currentTextRegion.getTextEnd();
@@ -152,7 +183,7 @@
 				XMLFormattingConstraints parentConstraints = getRegionConstraints(currentDOMNode);
 				
 				/* if the whitespace strategy is declared as default, get it from the preferences */
-				if(parentConstraints.getWhitespaceStrategy() == XMLFormattingConstraints.DEFAULT)
+				if(XMLFormattingConstraints.DEFAULT.equals(parentConstraints.getWhitespaceStrategy()))
 					parentConstraints.setWhitespaceStrategy(preferences.getElementWhitespaceStrategy());
 				
 				// TODO: initialize indentLevel
@@ -214,7 +245,7 @@
 			}
 			
 			/* A parent who has defined a specific whitespace strategy was found */
-			if(XMLFormattingConstraints.PRESERVE == result.getWhitespaceStrategy() || XMLFormattingConstraints.DEFAULT == result.getWhitespaceStrategy())
+			if(XMLFormattingConstraints.PRESERVE.equals(result.getWhitespaceStrategy()) || XMLFormattingConstraints.DEFAULT.equals(result.getWhitespaceStrategy()))
 				return result;
 		}
 		
@@ -256,17 +287,20 @@
 	 */
 	private void formatContent(TextEdit textEdit, Position formatRange, XMLFormattingConstraints parentConstraints, DOMRegion currentDOMRegion, IStructuredDocumentRegion previousRegion) {
 		IStructuredDocumentRegion currentRegion = currentDOMRegion.documentRegion;
-		String fullText = currentRegion.getFullText();
+		String fullText = currentDOMRegion.domNode.getSource();
 
 		// check if in preserve space mode, if so, don't touch anything but
 		// make sure to update available line width
 		String whitespaceMode = parentConstraints.getWhitespaceStrategy();
-		if (whitespaceMode == XMLFormattingConstraints.PRESERVE) {
+		if (XMLFormattingConstraints.PRESERVE.equals(whitespaceMode)) {
 			int availableLineWidth = parentConstraints.getAvailableLineWidth();
 			availableLineWidth = updateLineWidthWithLastLine(fullText, availableLineWidth);
 
 			// update available line width in constraints
 			parentConstraints.setAvailableLineWidth(availableLineWidth);
+			// A text node can contain multiple structured document regions - sync the documentRegion
+			// with the last region of the node since the text from all regions was formatted
+			currentDOMRegion.documentRegion = currentDOMRegion.domNode.getLastStructuredDocumentRegion();
 			return;
 		}
 
@@ -275,29 +309,33 @@
 		boolean isAllWhitespace = ((IDOMText) currentDOMRegion.domNode).isElementContentWhitespace();
 		IStructuredDocumentRegion nextDocumentRegion = null;
 		if (isAllWhitespace) {
+			parentConstraints.setAvailableLineWidth(fPreferences.getMaxLineWidth());
 			nextDocumentRegion = currentRegion.getNext();
 			if (nextDocumentRegion != null)
 				return;
 		}
 
 		// special handling if text follows an entity or cdata region
-		if (whitespaceMode != XMLFormattingConstraints.COLLAPSE && previousRegion != null) {
+		if (!XMLFormattingConstraints.COLLAPSE.equals(whitespaceMode) && previousRegion != null) {
 			String previouRegionType = previousRegion.getType();
-			if (previouRegionType == DOMRegionContext.XML_ENTITY_REFERENCE || previouRegionType == DOMRegionContext.XML_CDATA_TEXT)
+			if (DOMRegionContext.XML_ENTITY_REFERENCE.equals(previouRegionType) || DOMRegionContext.XML_CDATA_TEXT.equals(previouRegionType))
 				whitespaceMode = XMLFormattingConstraints.COLLAPSE;
 		}
 		// also, special handling if text is before an entity or cdata region
-		if (whitespaceMode != XMLFormattingConstraints.COLLAPSE) {
+		if (!XMLFormattingConstraints.COLLAPSE.equals(whitespaceMode)) {
 			// get next document region if dont already have it
 			if (nextDocumentRegion == null)
 				nextDocumentRegion = currentRegion.getNext();
 			if (nextDocumentRegion != null) {
 				String nextRegionType = nextDocumentRegion.getType();
-				if (nextRegionType == DOMRegionContext.XML_ENTITY_REFERENCE || nextRegionType == DOMRegionContext.XML_CDATA_TEXT)
+				if (DOMRegionContext.XML_ENTITY_REFERENCE.equals(nextRegionType) || DOMRegionContext.XML_CDATA_TEXT.equals(nextRegionType))
 					whitespaceMode = XMLFormattingConstraints.COLLAPSE;
 			}
 		}
 		formatTextInContent(textEdit, parentConstraints, currentRegion, fullText, whitespaceMode);
+		// A text node can contain multiple structured document regions - sync the documentRegion
+		// with the last region of the node since the text from all regions was formatted
+		currentDOMRegion.documentRegion = currentDOMRegion.domNode.getLastStructuredDocumentRegion();
 	}
 
 	private void formatEmptyStartTagWithNoAttr(TextEdit textEdit, XMLFormattingConstraints constraints, IStructuredDocumentRegion currentDocumentRegion, IStructuredDocumentRegion previousDocumentRegion, int availableLineWidth, String indentStrategy, String whitespaceStrategy, ITextRegion currentTextRegion) {
@@ -314,7 +352,7 @@
 		}
 		availableLineWidth -= tagNameLineWidth;
 
-		if (indentStrategy == XMLFormattingConstraints.INLINE) {
+		if (XMLFormattingConstraints.INLINE.equals(indentStrategy)) {
 			// if was inlining, need to check if out of available line
 			// width
 			if (availableLineWidth < 0) {
@@ -330,7 +368,7 @@
 				// no need to indent
 				// just make sure to delete previous whitespace if
 				// needed
-				if ((previousDocumentRegion.getType() == DOMRegionContext.XML_CONTENT) && (previousDocumentRegion.getFullText().trim().length() == 0)) {
+				if ((DOMRegionContext.XML_CONTENT.equals(previousDocumentRegion.getType())) && (previousDocumentRegion.getFullText().trim().length() == 0)) {
 					availableLineWidth = collapseSpaces(textEdit, previousDocumentRegion.getStartOffset(), availableLineWidth, previousDocumentRegion.getFullText());
 				}
 			}
@@ -366,7 +404,7 @@
 		// do not format space before start tag if preserving spaces
 		if (whitespaceStrategy != XMLFormattingConstraints.PRESERVE) {
 			// format like indent strategy says
-			if (indentStrategy == XMLFormattingConstraints.INDENT || indentStrategy == XMLFormattingConstraints.NEW_LINE) {
+			if (XMLFormattingConstraints.INDENT.equals(indentStrategy) || XMLFormattingConstraints.NEW_LINE.equals(indentStrategy)) {
 				int availableLineWidth = indentIfPossible(textEdit, constraints, currentDocumentRegion, previousDocumentRegion, whitespaceStrategy, indentStrategy, false);
 				constraints.setAvailableLineWidth(availableLineWidth);
 			}
@@ -393,19 +431,22 @@
 	private DOMRegion formatRegion(TextEdit edit, Position formatRange, XMLFormattingConstraints parentConstraints, DOMRegion domRegion, IStructuredDocumentRegion previousRegion) {
 		IStructuredDocumentRegion currentRegion = domRegion.documentRegion;
 		String regionType = currentRegion.getType();
-		if (regionType == DOMRegionContext.XML_TAG_NAME) {
+		if (DOMRegionContext.XML_TAG_NAME.equals(regionType)) {
 			ITextRegion textRegion = currentRegion.getFirstRegion();
 			String textRegionType = textRegion.getType();
-			if (textRegionType == DOMRegionContext.XML_TAG_OPEN) {
+			if (DOMRegionContext.XML_TAG_OPEN.equals(textRegionType)) {
 				domRegion = formatStartTag(edit, formatRange, parentConstraints, domRegion, previousRegion);
 			}
-			else if (textRegionType == DOMRegionContext.XML_END_TAG_OPEN) {
+			else if (DOMRegionContext.XML_END_TAG_OPEN.equals(textRegionType)) {
 				formatEndTag(edit, formatRange, parentConstraints, domRegion, previousRegion);
 			}
 		}
-		else if (regionType == DOMRegionContext.XML_CONTENT) {
+		else if (DOMRegionContext.XML_CONTENT.equals(regionType) || domRegion.domNode.getNodeType() == Node.TEXT_NODE) {
 			formatContent(edit, formatRange, parentConstraints, domRegion, previousRegion);
 		}
+		else if (DOMRegionContext.XML_COMMENT_TEXT.equals(regionType)) {
+			formatComment(edit, formatRange, parentConstraints, domRegion, previousRegion);
+		}
 		else {
 			// unknown, so just leave alone for now but make sure to update
 			// available line width
@@ -434,7 +475,7 @@
 
 			// need to make sure current document region and current
 			// dom node match up
-			if (currentRegion == currentDOMNode.getFirstStructuredDocumentRegion()) {
+			if (currentDOMNode.getFirstStructuredDocumentRegion().equals(currentRegion)) {
 				// format this document region/node, formatRegion will
 				// return the last node/region formatted
 				domRegion = formatRegion(edit, formatRange, parentConstraints, domRegion, previousRegion);
@@ -471,7 +512,7 @@
 		XMLFormattingConstraints childrenConstraints = new XMLFormattingConstraints();
 		updateFormattingConstraints(parentConstraints, thisConstraints, childrenConstraints, currentDOMRegion);
 
-		if(childrenConstraints.getWhitespaceStrategy() == XMLFormattingConstraints.DEFAULT)
+		if(XMLFormattingConstraints.DEFAULT.equals(childrenConstraints.getWhitespaceStrategy()))
 			childrenConstraints.setWhitespaceStrategy((new XMLFormattingPreferences()).getElementWhitespaceStrategy());
 			
 		String whitespaceStrategy = thisConstraints.getWhitespaceStrategy();
@@ -480,9 +521,9 @@
 
 		// format space before start tag
 		// do not format space before start tag if preserving spaces
-		if (whitespaceStrategy != XMLFormattingConstraints.PRESERVE) {
+		if (!XMLFormattingConstraints.PRESERVE.equals(whitespaceStrategy)) {
 			// format like indent strategy says
-			if (indentStrategy == XMLFormattingConstraints.INDENT || indentStrategy == XMLFormattingConstraints.NEW_LINE) {
+			if (XMLFormattingConstraints.INDENT.equals(indentStrategy) || XMLFormattingConstraints.NEW_LINE.equals(indentStrategy)) {
 				availableLineWidth = indentIfPossible(textEdit, thisConstraints, currentDocumentRegion, previousDocumentRegion, whitespaceStrategy, indentStrategy, true);
 				if (availableLineWidth > 0)
 					thisConstraints.setAvailableLineWidth(availableLineWidth);
@@ -508,7 +549,7 @@
 					DOMRegion childDOMRegion = new DOMRegion();
 					childDOMRegion.documentRegion = nextRegion;
 					childDOMRegion.domNode = childDOMNode;
-					if (nextRegion == childDOMNode.getFirstStructuredDocumentRegion()) {
+					if (nextRegion.equals(childDOMNode.getFirstStructuredDocumentRegion())) {
 						// format children. pass in child constraints
 						childDOMRegion = formatRegion(textEdit, formatRange, childrenConstraints, childDOMRegion, previousDocumentRegion);
 					}
@@ -549,9 +590,9 @@
 					ITextRegionList rs = nextRegion.getRegions();
 					if (rs.size() > 1) {
 						ITextRegion r = rs.get(0);
-						if (r != null && r.getType() == DOMRegionContext.XML_END_TAG_OPEN) {
+						if (r != null && DOMRegionContext.XML_END_TAG_OPEN.equals(r.getType())) {
 							r = rs.get(1);
-							if (r != null && r.getType() == DOMRegionContext.XML_TAG_NAME) {
+							if (r != null && DOMRegionContext.XML_TAG_NAME.equals(r.getType())) {
 								String tagName = nextRegion.getText(r);
 								if (tagName != null && tagName.equals(currentDOMNode.getNodeName()))
 									formatEndTag = true;
@@ -590,7 +631,7 @@
 		int tagNameLineWidth = currentTextRegion.getTextLength() + 2;
 		availableLineWidth -= tagNameLineWidth;
 
-		if (indentStrategy == XMLFormattingConstraints.INLINE) {
+		if (XMLFormattingConstraints.INLINE.equals(indentStrategy)) {
 			// if was inlining, need to check if out of available line
 			// width
 			if (availableLineWidth < 0) {
@@ -607,7 +648,7 @@
 				// just make sure to delete previous whitespace if
 				// needed
 				if (previousDocumentRegion != null) {
-					if (previousDocumentRegion.getType() == DOMRegionContext.XML_CONTENT) {
+					if (DOMRegionContext.XML_CONTENT.equals(previousDocumentRegion.getType())) {
 						String previousDocumentRegionText = previousDocumentRegion.getFullText();
 						if (previousDocumentRegionText.trim().length() == 0) {
 							availableLineWidth = collapseSpaces(textEdit, previousDocumentRegion.getStartOffset(), availableLineWidth, previousDocumentRegionText);
@@ -640,10 +681,10 @@
 		boolean forceInitialIndent = false;
 		int indentLevel = parentConstraints.getIndentLevel() + 1;
 		String indentMode = parentConstraints.getIndentStrategy();
-		if (indentMode == XMLFormattingConstraints.INDENT) {
+		if (XMLFormattingConstraints.INDENT.equals(indentMode)) {
 			forceInitialIndent = true;
 		}
-		if (indentMode == XMLFormattingConstraints.NEW_LINE) {
+		if (XMLFormattingConstraints.NEW_LINE.equals(indentMode)) {
 			indentLevel = parentConstraints.getIndentLevel();
 			forceInitialIndent = true;
 		}
@@ -676,8 +717,16 @@
 						forceInitialIndent = false; // initial indent done
 					}
 					else {
-						// just collapse spaces
-						availableLineWidth = collapseSpaces(textEdit, startOffset, availableLineWidth, whitespaceRun);
+						// just collapse spaces, but adjust for any indenting that may result from preserving line delimiters
+						if (whitespaceStart == 0 && XMLFormattingConstraints.IGNOREANDTRIM.equals(whitespaceMode)) {
+							// if ignore, trim
+							DeleteEdit deleteTrailing = new DeleteEdit(startOffset, whitespaceRun.length());
+							textEdit.addChild(deleteTrailing);
+						}
+						else if(XMLFormattingConstraints.REPLACE.equals(whitespaceMode))
+							availableLineWidth = replaceSpaces(textEdit, startOffset, availableLineWidth, whitespaceRun);
+						else
+							availableLineWidth = collapseAndIndent(textEdit, startOffset, availableLineWidth, indentLevel, whitespaceRun, currentRegion);
 					}
 
 					fullTextOffset += characterRunLength;
@@ -685,16 +734,25 @@
 				else {
 					// handle trailing whitespace
 					int whitespaceOffset = currentRegion.getStartOffset() + whitespaceStart;
-					if (whitespaceMode == XMLFormattingConstraints.IGNORE) {
-						// if ignore, trim
+					if (XMLFormattingConstraints.REPLACE.equals(whitespaceMode))
+						availableLineWidth = replaceSpaces(textEdit, whitespaceOffset, availableLineWidth, whitespaceRun);
+					else if (XMLFormattingConstraints.IGNOREANDTRIM.equals(whitespaceMode)) {
+						// always trim
 						DeleteEdit deleteTrailing = new DeleteEdit(whitespaceOffset, whitespaceRun.length());
 						textEdit.addChild(deleteTrailing);
 					}
-					else {
-						// if collapse, leave a space. but what if end up
-						// wanting to add indent? then need to delete space
-						// added and add indent instead
-						availableLineWidth = collapseSpaces(textEdit, whitespaceOffset, availableLineWidth, whitespaceRun);
+					else if(getFormattingPreferences().getClearAllBlankLines()) {
+						if (XMLFormattingConstraints.IGNORE.equals(whitespaceMode)) {
+							// if ignore, trim
+							DeleteEdit deleteTrailing = new DeleteEdit(whitespaceOffset, whitespaceRun.length());
+							textEdit.addChild(deleteTrailing);
+						}
+						else {
+							// if collapse, leave a space. but what if end up
+							// wanting to add indent? then need to delete space
+							// added and add indent instead
+							availableLineWidth = collapseSpaces(textEdit, whitespaceOffset, availableLineWidth, whitespaceRun);
+						}
 					}
 				}
 			}
@@ -705,8 +763,9 @@
 				if (characterRunLength > 0) {
 					// indent if word is too long or forcing initial
 					// indent
-					availableLineWidth = availableLineWidth - characterRunLength;
-					if (whitespaceMode == XMLFormattingConstraints.IGNORE && (forceInitialIndent || (availableLineWidth <= 0))) {
+					// [243091] - characterRunLength should only be subtracted once or text formatting wraps prematurely
+					// availableLineWidth = availableLineWidth - characterRunLength;
+					if ((XMLFormattingConstraints.IGNORE.equals(whitespaceMode) || XMLFormattingConstraints.IGNOREANDTRIM.equals(whitespaceMode)) && (forceInitialIndent || (availableLineWidth <= 0))) {
 						// indent if not already indented
 						availableLineWidth = indentIfNotAlreadyIndented(textEdit, currentRegion, indentLevel, currentRegion.getStartOffset(), whitespaceRun);
 						// remember to subtract word length
@@ -731,23 +790,24 @@
 		String whitespaceStrategy = constraints.getWhitespaceStrategy();
 		int availableLineWidth = constraints.getAvailableLineWidth();
 		ITextRegionList textRegions = currentDocumentRegion.getRegions();
+		int currentNumberOfRegions = currentDocumentRegion.getNumberOfRegions();
 		int currentTextRegionIndex = 1;
 
 		ITextRegion currentTextRegion = textRegions.get(currentTextRegionIndex);
 		String currentType = currentTextRegion.getType();
 		// tag name should always be the first text region
-		if (currentType == DOMRegionContext.XML_TAG_NAME) {
+		if (DOMRegionContext.XML_TAG_NAME.equals(currentType) && currentTextRegionIndex < currentNumberOfRegions - 1) {
 			ITextRegion nextTextRegion = textRegions.get(currentTextRegionIndex + 1);
-			String nextType = nextTextRegion.getType();
-			if (nextType == DOMRegionContext.XML_TAG_CLOSE) {
+			// Bug 221279 - Some non well-formed documents will not contribute a next region
+			if (nextTextRegion != null && DOMRegionContext.XML_TAG_CLOSE.equals(nextTextRegion.getType())) {
 				// calculate available line width
 				int tagNameLineWidth = currentTextRegion.getTextLength() + 3;
 				availableLineWidth -= tagNameLineWidth;
 
-				if (indentStrategy == XMLFormattingConstraints.INLINE) {
+				if (XMLFormattingConstraints.INLINE.equals(indentStrategy)) {
 					// if was inlining, need to check if out of available line
-					// width
-					if (availableLineWidth < 0) {
+					// width - Whitespace may have been corrected in the text content
+					if (availableLineWidth < 0 && XMLFormattingConstraints.IGNORE.equals(whitespaceStrategy)) {
 						// need to deindent if possible
 						int lineWidth = indentIfPossible(textEdit, constraints, currentDocumentRegion, previousDocumentRegion, whitespaceStrategy, indentStrategy, false);
 						// update available line width
@@ -759,7 +819,7 @@
 						// just make sure to delete previous whitespace if
 						// needed
 						if (previousDocumentRegion != null) {
-							if (previousDocumentRegion.getType() == DOMRegionContext.XML_CONTENT) {
+							if (DOMRegionContext.XML_CONTENT.equals(previousDocumentRegion.getType())) {
 								String previousDocumentRegionText = previousDocumentRegion.getFullText();
 								if (previousDocumentRegionText.trim().length() == 0) {
 									availableLineWidth = collapseSpaces(textEdit, previousDocumentRegion.getStartOffset(), availableLineWidth, previousDocumentRegionText);
@@ -800,15 +860,15 @@
 		ITextRegion currentTextRegion = textRegions.get(currentTextRegionIndex);
 		String currentType = currentTextRegion.getType();
 		// tag name should always be the first text region
-		if (currentType == DOMRegionContext.XML_TAG_NAME) {
+		if (DOMRegionContext.XML_TAG_NAME.equals(currentType)) {
 			ITextRegion nextTextRegion = textRegions.get(currentTextRegionIndex + 1);
 			String nextType = (nextTextRegion != null) ? nextTextRegion.getType() : null;
-			if (nextType == DOMRegionContext.XML_TAG_CLOSE) {
+			if (DOMRegionContext.XML_TAG_CLOSE.equals(nextType)) {
 				// already at tag close
 				formatStartTagWithNoAttr(textEdit, constraints, currentDocumentRegion, previousDocumentRegion, availableLineWidth, indentStrategy, whitespaceStrategy, currentTextRegion);
 				return false;
 			}
-			else if (nextType == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
+			else if (DOMRegionContext.XML_EMPTY_TAG_CLOSE.equals(nextType)) {
 				// already at empty tag close
 				formatEmptyStartTagWithNoAttr(textEdit, constraints, currentDocumentRegion, previousDocumentRegion, availableLineWidth, indentStrategy, whitespaceStrategy, currentTextRegion);
 				return true;
@@ -826,7 +886,7 @@
 					int attributesCount = 0;
 					int i = 2;
 					while (i < textRegions.size() && attributesCount < 2) {
-						if (textRegions.get(i).getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
+						if (DOMRegionContext.XML_TAG_ATTRIBUTE_NAME.equals(textRegions.get(i).getType()))
 							++attributesCount;
 					}
 					indentAllAttributes = (attributesCount > 1);
@@ -835,7 +895,7 @@
 				while ((currentTextRegionIndex + 1) < textRegions.size()) {
 					nextTextRegion = textRegions.get(currentTextRegionIndex + 1);
 					nextType = nextTextRegion.getType();
-					if (nextType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
+					if (DOMRegionContext.XML_TAG_ATTRIBUTE_NAME.equals(nextType)) {
 						boolean indentAttribute = indentAllAttributes;
 						if (!indentAttribute)
 							indentAttribute = shouldIndentBeforeAttribute(constraints, textRegions, availableLineWidth, currentTextRegionIndex, currentTextRegion, nextTextRegion);
@@ -850,7 +910,7 @@
 							availableLineWidth -= (currentTextRegion.getTextLength() + 1);
 						}
 					}
-					else if (nextType == DOMRegionContext.XML_TAG_CLOSE) {
+					else if (DOMRegionContext.XML_TAG_CLOSE.equals(nextType)) {
 						// if need to align bracket on next line, indent
 						if (alignFinalBracket && spanMoreThan1Line) {
 							availableLineWidth = indentIfNotAlreadyIndented(textEdit, indentLevel, currentDocumentRegion, currentTextRegion);
@@ -867,7 +927,7 @@
 						constraints.setAvailableLineWidth(availableLineWidth);
 						return false;
 					}
-					else if (nextType == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
+					else if (DOMRegionContext.XML_EMPTY_TAG_CLOSE.equals(nextType)) {
 						int textLength = currentTextRegion.getTextLength();
 						int regionLength = currentTextRegion.getLength();
 
@@ -887,14 +947,14 @@
 						return true;
 					}
 					else {
-						if (currentType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME && nextType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
+						if (DOMRegionContext.XML_TAG_ATTRIBUTE_NAME.equals(currentType) && DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS.equals(nextType)) {
 							if (currentTextRegion.getTextLength() < currentTextRegion.getLength()) {
 								deleteTrailingSpaces(textEdit, currentTextRegion, currentDocumentRegion);
 							}
 							// update available width
 							availableLineWidth -= currentTextRegion.getTextLength();
 						}
-						else if (currentType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS && nextType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+						else if (DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS.equals(currentType) && DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE.equals(nextType)) {
 							if (currentTextRegion.getTextLength() < currentTextRegion.getLength()) {
 								deleteTrailingSpaces(textEdit, currentTextRegion, currentDocumentRegion);
 							}
@@ -918,6 +978,145 @@
 		constraints.setAvailableLineWidth(availableLineWidth);
 		return false;
 	}
+	
+	/**
+	 * Format an XML comment structured document region.
+	 */
+	private void formatComment(TextEdit textEdit, Position formatRange, XMLFormattingConstraints parentConstraints, DOMRegion currentDOMRegion, IStructuredDocumentRegion previousRegion) {
+		IStructuredDocumentRegion currentRegion = currentDOMRegion.documentRegion;
+		int lineWidth = parentConstraints.getAvailableLineWidth() - currentRegion.getFullText().length();
+		// Don't format if we're not exceeding the available line width, or if the whitespace
+		// strategy is to preserve whitespace - But update line width.
+		if(currentRegion == null ||	XMLFormattingConstraints.PRESERVE.equals(parentConstraints.getWhitespaceStrategy()) || !fPreferences.getFormatCommentText()) {
+			parentConstraints.setAvailableLineWidth(lineWidth);
+			return;
+		}
+
+		Iterator it = currentRegion.getRegions().iterator();
+		ITextRegion previous = null;
+		if (previousRegion == null)
+			previousRegion = currentRegion.getPrevious();
+		// Iterate over each text region of the comment
+		Node parent = currentDOMRegion.domNode.getParentNode();
+		while(it.hasNext()) {
+			ITextRegion text = (ITextRegion) it.next();
+			String type = text.getType();
+			if (type == DOMRegionContext.XML_COMMENT_OPEN) {
+				int indentLevel = (parent != null && parent.getNodeType() == Node.DOCUMENT_NODE) ? 0 : 1;
+				int width = formatCommentStart(textEdit, parentConstraints, indentLevel, currentRegion, previousRegion, text);
+				parentConstraints.setAvailableLineWidth(width);
+			}
+			else if (type == DOMRegionContext.XML_COMMENT_TEXT) {
+				int indentLevel = (parent != null && parent.getNodeType() == Node.DOCUMENT_NODE) ? -1 : parentConstraints.getIndentLevel();
+				formatCommentContent(textEdit, parentConstraints, indentLevel, currentRegion, previous, text);
+			}
+			previous = text;
+		}
+	}
+
+	private void formatCommentContent(TextEdit textEdit, XMLFormattingConstraints parentConstraints, int indentLevel, IStructuredDocumentRegion currentRegion, ITextRegion previous, ITextRegion region) {
+		int lineWidth = parentConstraints.getAvailableLineWidth() - currentRegion.getFullText(previous).length();
+		// If there's more text than line width available, format
+		String text = currentRegion.getFullText(region);
+		compressContent(textEdit, currentRegion, currentRegion.getStartOffset(region), indentLevel + 1, lineWidth, text);
+	}
+
+	private void compressContent(TextEdit textEdit, IStructuredDocumentRegion region, int startOffset, int indentLevel, int lineWidth, String text) {
+		int length = text.length();
+		int start = 0, end = 0;
+		char c = 0;
+		int resultLength = 0;
+		boolean joinLines = fPreferences.getJoinCommentLines();
+		boolean onOwnLine = false;
+
+		String indent = getIndentString(indentLevel + 1);
+
+		for (int i = 0; i < length; i++) {
+			c = text.charAt(i);
+			// Compress whitespace unless its a line delimiter and formatting does not permit joining lines
+			if (Character.isWhitespace(c)) {
+				if ((c != '\r' && c!= '\n') || joinLines) {
+					// Just came off of a word
+					if (start == end) {
+						start = end = i;
+					}
+					end++;
+					resultLength++;
+				}
+				else {
+					// correct the indent of this line
+					lineWidth = fPreferences.getMaxLineWidth();
+					resultLength = 0;
+					onOwnLine = true;
+
+					// Compress any whitespace before the line delimiter
+					if (start != end) {
+						int replaceLength = end - start;
+						textEdit.addChild(new ReplaceEdit(start + startOffset, replaceLength, EMPTY));
+						start = end = i;
+					}
+				}
+			}
+			else {
+				// Transitioned to a new word
+				if (start != end) {
+					int replaceLength = end - start;
+					if (onOwnLine) {
+						// If content is on its own line, replace leading whitespace with proper indent
+						textEdit.addChild(new ReplaceEdit(start + startOffset, replaceLength, indent));
+						resultLength -= (replaceLength - indent.length());
+						onOwnLine = false;
+					}
+					else if (!(replaceLength == 1 && text.charAt(start) == ' ')) {
+						textEdit.addChild(new ReplaceEdit(start + startOffset, replaceLength, SPACE));
+						resultLength -= (replaceLength - 1);
+					}
+					start = end = i;
+					// Make sure the word starts on a new line
+					if (resultLength > lineWidth) {
+						lineWidth = fPreferences.getMaxLineWidth();
+						resultLength = 0;
+						textEdit.addChild(new InsertEdit(start + startOffset, getLineDelimiter(region) + indent));
+					}
+				}
+				// Word is immediately after line delimiters, indent appropriately
+				if (onOwnLine) {
+					textEdit.addChild(new InsertEdit(i + startOffset, indent));
+					onOwnLine = false;
+				}
+				resultLength++;
+			}
+		}
+
+		// Clean up any dangling whitespace
+		int replaceLength = end - start;
+		indent = getIndentString(indentLevel);
+		if (replaceLength == 0) { // No trailing whitespace
+			textEdit.addChild(new InsertEdit(length + startOffset, (onOwnLine) ? indent : SPACE));
+		}
+		else {
+			String whitespace = text.substring(start);
+			String replacement = (onOwnLine) ? indent : SPACE;
+			if (!whitespace.equals(replacement)) {
+				textEdit.addChild(new ReplaceEdit(start + startOffset, replaceLength, replacement));
+			}
+		}
+	}
+
+	private int formatCommentStart(TextEdit textEdit, XMLFormattingConstraints parentConstraints, int indentLevel, IStructuredDocumentRegion currentRegion, IStructuredDocumentRegion previousRegion, ITextRegion region) {
+		int lineWidth = parentConstraints.getAvailableLineWidth();
+		if (previousRegion!=null&&(DOMRegionContext.XML_CONTENT.equals(previousRegion.getType()))) {
+			String previousText = previousRegion.getFullText();
+			String trailingWhitespace = getTrailingWhitespace(previousText);
+			String delimiters = extractLineDelimiters(trailingWhitespace, previousRegion);
+			if (delimiters != null && delimiters.length() > 0){// && previousText.length() == trailingWhitespace.length()) {
+				// Format the comment if it's on a new line
+				int offset = previousRegion.getEnd() - trailingWhitespace.length();
+				lineWidth = indentIfNotAlreadyIndented(textEdit, currentRegion, parentConstraints.getIndentLevel() + indentLevel, offset, trailingWhitespace);
+			}
+		}
+		return lineWidth;
+	}
 
 	/**
 	 * Returns either a String of whitespace or characters depending on
@@ -946,6 +1145,19 @@
 		}
 		return characterRun.toString();
 	}
+	
+	private String getTrailingWhitespace(String text) {
+		StringBuffer whitespaceRun = new StringBuffer();
+		int index = text.length() - 1;
+		while(index >= 0) {
+			char c = text.charAt(index--);
+			if (Character.isWhitespace(c))
+				whitespaceRun.insert(0, c);
+			else
+				break;
+		}
+		return whitespaceRun.toString();
+	}
 
 	private String getIndentString(int indentLevel) {
 		StringBuffer indentString = new StringBuffer();
@@ -981,19 +1193,46 @@
 
 		int availableLineWidth;
 		String indentString = getIndentString(indentLevel);
-		String newLineAndIndent = getLineDelimiter(currentRegion) + indentString;
-
+		String lineDelimiter = getLineDelimiter(currentRegion);
+		String newLineAndIndent = lineDelimiter + indentString;
+		
+		TextEdit indentation = null;
+		
 		// if not already correctly indented
 		if (!newLineAndIndent.equals(whitespaceRun)) {
-			// delete existing whitespace run
-			if (whitespaceRun != null) {
-				DeleteEdit deleteEdit = new DeleteEdit(indentStartOffset, whitespaceRun.length());
-				textEdit.addChild(deleteEdit);
+			if (getFormattingPreferences().getClearAllBlankLines()) {
+				if (whitespaceRun != null) {
+					// replace existing whitespace run
+					indentation = new ReplaceEdit(indentStartOffset, whitespaceRun.length(), newLineAndIndent);
+				}
+				else {
+					// just insert correct indent
+					indentation = new InsertEdit(indentStartOffset, newLineAndIndent);
+				}
 			}
-			// then insert correct indent
-			InsertEdit insertEdit = new InsertEdit(indentStartOffset, newLineAndIndent);
-			textEdit.addChild(insertEdit);
+			// Keep the empty lines
+			else {
+				// just insert correct indent
+				if(whitespaceRun == null)
+					indentation = new InsertEdit(indentStartOffset, newLineAndIndent);
+				// Need to preserve the number of empty lines, but still indent on the current line properly
+				else {
+					String existingDelimiters = extractLineDelimiters(whitespaceRun, currentRegion);
+					if(existingDelimiters != null && existingDelimiters.length() > 0) {
+						String formatted = existingDelimiters + indentString;
+						// Don't perform a replace if the formatted string is the same as the existing whitespaceRun
+						if(!formatted.equals(whitespaceRun))
+							indentation = new ReplaceEdit(indentStartOffset, whitespaceRun.length(), formatted);
+					}
+					// No blank lines to preserve - correct the indent
+					else
+						indentation = new ReplaceEdit(indentStartOffset, whitespaceRun.length(), newLineAndIndent);
+				}
+			}
 		}
+		
+		if(indentation != null)
+			textEdit.addChild(indentation);
 		// update line width
 		availableLineWidth = maxAvailableLineWidth - indentString.length();
 		return availableLineWidth;
@@ -1025,19 +1264,19 @@
 		String previousRegionFullText = null;
 		String previousRegionType = null;
 
-		if (whitespaceStrategy == XMLFormattingConstraints.IGNORE) {
+		if ((XMLFormattingConstraints.IGNORE.equals(whitespaceStrategy)) || XMLFormattingConstraints.IGNOREANDTRIM.equals(whitespaceStrategy)) {
 			// if ignoring, need to check if previous region was cdata
 			previousRegionType = previousDocumentRegion.getType();
-			if (previousRegionType == DOMRegionContext.XML_CDATA_TEXT)
+			if (DOMRegionContext.XML_CDATA_TEXT.equals(previousRegionType))
 				canIndent = false;
 			else
 				canIndent = true;
 		}
-		else if (whitespaceStrategy == XMLFormattingConstraints.COLLAPSE) {
+		else if (XMLFormattingConstraints.COLLAPSE.equals(whitespaceStrategy)) {
 			// if collapsing, need to check if previous region ended in a
 			// whitespace
 			previousRegionType = previousDocumentRegion.getType();
-			if (previousRegionType == DOMRegionContext.XML_CONTENT) {
+			if (DOMRegionContext.XML_CONTENT.equals(previousRegionType)) {
 				previousRegionFullText = previousDocumentRegion.getFullText();
 				int length = previousRegionFullText.length();
 				if (length > 1)
@@ -1053,7 +1292,7 @@
 				previousRegionType = previousDocumentRegion.getType();
 
 			// get previous region's text if it was not previously retrieved
-			if (previousRegionFullText == null && previousRegionType == DOMRegionContext.XML_CONTENT)
+			if (previousRegionFullText == null && DOMRegionContext.XML_CONTENT.equals(previousRegionType))
 				previousRegionFullText = previousDocumentRegion.getFullText();
 
 			// if previous region was only whitespace, this may
@@ -1062,9 +1301,13 @@
 				indentStartOffset = previousDocumentRegion.getStartOffset();
 				whitespaceRun = previousRegionFullText;
 			}
+			if ((previousRegionFullText != null) && (whitespaceRun == null) && !getFormattingPreferences().getClearAllBlankLines()) {
+				whitespaceRun = getTrailingWhitespace(previousRegionFullText);
+				indentStartOffset = previousDocumentRegion.getEndOffset() - whitespaceRun.length();
+			}
 
 			int indentLevel = thisConstraints.getIndentLevel();
-			if (addIndent && indentStrategy == XMLFormattingConstraints.INDENT) {
+			if (addIndent && XMLFormattingConstraints.INDENT.equals(indentStrategy)) {
 				++indentLevel;
 				thisConstraints.setIndentLevel(indentLevel);
 			}
@@ -1115,7 +1358,7 @@
 				// still okay, so try next region
 				// something attrName=
 				ITextRegion textRegion = textRegions.get(currentTextRegionIndex + 2);
-				if (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
+				if (DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS.equals(textRegion.getType())) {
 					++currentWidth;
 					if (currentWidth > availableLineWidth)
 						indentAttribute = true;
@@ -1124,7 +1367,7 @@
 							// still okay, so try next region
 							// something attrName=attrValue
 							textRegion = textRegions.get(currentTextRegionIndex + 3);
-							if (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+							if (DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE.equals(textRegion.getType())) {
 								currentWidth = +textRegion.getTextLength();
 								if (currentWidth > availableLineWidth)
 									indentAttribute = true;
@@ -1212,13 +1455,13 @@
 					boolean preserveFound = false;
 					while (i < textRegions.size() && !xmlSpaceFound) {
 						ITextRegion textRegion = textRegions.get(i);
-						if (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
+						if (DOMRegionContext.XML_TAG_ATTRIBUTE_NAME.equals(textRegion.getType())) {
 							String regionText = currentRegion.getText(textRegion);
 							if (XML_SPACE.equals(regionText)) {
 								if ((i + 1) < textRegions.size()) {
 									++i;
 									textRegion = textRegions.get(i);
-									if (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS && ((i + 1) < textRegions.size())) {
+									if (DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS.equals(textRegion.getType()) && ((i + 1) < textRegions.size())) {
 										++i;
 										textRegion = textRegions.get(i);
 										regionText = currentRegion.getText(textRegion);
@@ -1283,7 +1526,20 @@
 							// follow whitespace strategy preference for
 							// pcdata content
 							int contentType = elementDeclaration.getContentType();
-							if (contentType == CMElementDeclaration.PCDATA && parentConstraints != null && !XMLFormattingConstraints.PRESERVE.equals(parentConstraints.getWhitespaceStrategy())) {
+							
+							String facetValue = null;
+							if(elementDeclaration.getDataType() != null)
+								facetValue = (String) elementDeclaration.getDataType().getProperty(PROPERTY_WHITESPACE_FACET);
+							if(facetValue != null) {
+								if(PRESERVE.equals(facetValue))
+									childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.PRESERVE);
+								// For XSD types, "collapse" corresponds to the IGNOREANDTRIM strategy
+								else if(COLLAPSE.equals(facetValue))
+									childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.IGNOREANDTRIM);
+								else if(REPLACE.equals(facetValue))
+									childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.REPLACE);
+							}
+							else if (contentType == CMElementDeclaration.PCDATA && parentConstraints != null && !XMLFormattingConstraints.PRESERVE.equals(parentConstraints.getWhitespaceStrategy())) {
 								childConstraints.setWhitespaceStrategy(preferences.getPCDataWhitespaceStrategy());
 							}
 							else if (contentType == CMElementDeclaration.ELEMENT && parentConstraints != null && !XMLFormattingConstraints.PRESERVE.equals(parentConstraints.getWhitespaceStrategy())) {
@@ -1293,58 +1549,54 @@
 								childConstraints.setIsIndentStrategyAHint(true);
 							}
 							else {
-								CMDataType dataType = elementDeclaration.getDataType();
-								if (dataType != null && STRING.equals(dataType.getDataTypeName()))
-									childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.PRESERVE);
-								else {
-									// look for xml:space in content model
-									CMNamedNodeMap cmAttributes = elementDeclaration.getAttributes();
+								// look for xml:space in content model
+								CMNamedNodeMap cmAttributes = elementDeclaration.getAttributes();
 
-									CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(cmAttributes);
-										List nodes = ModelQueryUtil.getModelQuery(currentNode.getOwnerDocument()).getAvailableContent((Element) currentNode, elementDeclaration, ModelQuery.INCLUDE_ATTRIBUTES);
-										for (int k = 0; k < nodes.size(); k++) {
-											CMNode cmnode = (CMNode) nodes.get(k);
-											if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
-												allAttributes.put(cmnode);
-											}
+								// Not needed - we're looking for xml:space
+								//CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(cmAttributes);
+								//List nodes = ModelQueryUtil.getModelQuery(currentNode.getOwnerDocument()).getAvailableContent((Element) currentNode, elementDeclaration, ModelQuery.INCLUDE_ATTRIBUTES);
+								//for (int k = 0; k < nodes.size(); k++) {
+								//	CMNode cmnode = (CMNode) nodes.get(k);
+								//	if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
+								//		allAttributes.put(cmnode);
+								//	}
+								//}
+								//cmAttributes = allAttributes;
+
+								// Check implied values from the DTD way.
+								CMAttributeDeclaration attributeDeclaration = (CMAttributeDeclaration) cmAttributes.getNamedItem(XML_SPACE);
+								if (attributeDeclaration != null) {
+									// CMAttributeDeclaration found, check
+									// it
+									// out.
+
+									//BUG214516/196544 - Fixed NPE that was caused by an attr having
+									// a null attr type
+									String defaultValue = null;
+									CMDataType attrType = attributeDeclaration.getAttrType();
+									if (attrType != null) {
+										if ((attrType.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE) && attrType.getImpliedValue() != null)
+											defaultValue = attrType.getImpliedValue();
+										else if ((attrType.getEnumeratedValues() != null) && (attrType.getEnumeratedValues().length > 0)) {
+											defaultValue = attrType.getEnumeratedValues()[0];
 										}
-									cmAttributes = allAttributes;
-									
-									// Check implied values from the DTD way.
-									CMAttributeDeclaration attributeDeclaration = (CMAttributeDeclaration) cmAttributes.getNamedItem(XML_SPACE);
-									if (attributeDeclaration != null) {
-										// CMAttributeDeclaration found, check
-										// it
-										// out.
-										
-										//BUG214516/196544 - Fixed NPE that was caused by an attr having
-										// a null attr type
-										String defaultValue = null;
-										CMDataType attrType = attributeDeclaration.getAttrType();
-										if(attrType != null) {
-											if((attrType.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE) && attrType.getImpliedValue() != null)
-												defaultValue = attrType.getImpliedValue();
-											else if ((attrType.getEnumeratedValues() != null) && (attrType.getEnumeratedValues().length > 0)) {
-												defaultValue = attrType.getEnumeratedValues()[0];
-											}
-										}
-										
-										// xml:space="preserve" means preserve
-										// space,
-										// everything else means back to
-										// default.
-										if(PRESERVE.equals(defaultValue))
-											childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.PRESERVE);
-										else
-											childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.DEFAULT);
 									}
-									// If the node has no attributes, inherit the parents whitespace strategy
-									else {
-										if(parentConstraints != null)
-											childConstraints.setWhitespaceStrategy(parentConstraints.getWhitespaceStrategy());
-										else
-											childConstraints.setWhitespaceStrategy(null);
-									}
+
+									// xml:space="preserve" means preserve
+									// space,
+									// everything else means back to
+									// default.
+									if (PRESERVE.equals(defaultValue))
+										childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.PRESERVE);
+									else
+										childConstraints.setWhitespaceStrategy(XMLFormattingConstraints.DEFAULT);
+								}
+								// If the node has no attributes, inherit the parents whitespace strategy
+								else {
+									if (parentConstraints != null)
+										childConstraints.setWhitespaceStrategy(parentConstraints.getWhitespaceStrategy());
+									else
+										childConstraints.setWhitespaceStrategy(null);
 								}
 							}
 						}
@@ -1412,6 +1664,19 @@
 			lineDelimiter = doc.getLineDelimiter();
 		return lineDelimiter;
 	}
+	
+	private String extractLineDelimiters(String base, IStructuredDocumentRegion currentRegion) {
+		String lineDelimiter = getLineDelimiter(currentRegion);
+		StringBuffer sb = new StringBuffer();
+		for(int index = 0; index < base.length();) {
+			index = base.indexOf(lineDelimiter, index);
+			if(index++ >= 0)
+				sb.append(lineDelimiter);
+			else
+				break;
+		}
+		return sb.toString();
+	}
 
 	void setProgressMonitor(IProgressMonitor monitor) {
 		fProgressMonitor = monitor;
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormatterFormatProcessor.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormatterFormatProcessor.java
index e1bd645..e02ee7e 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormatterFormatProcessor.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormatterFormatProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,7 +15,11 @@
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.text.DocumentRewriteSession;
+import org.eclipse.jface.text.DocumentRewriteSessionType;
 import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentExtension4;
 import org.eclipse.text.edits.TextEdit;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
@@ -84,16 +88,40 @@
 	}
 
 	public void formatModel(IStructuredModel structuredModel, int start, int length) {
+		if(fProgressMonitor != null)
+			fProgressMonitor.beginTask("", 2);
+		IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
+		DocumentRewriteSession activeRewriteSession = ((IDocumentExtension4) structuredDocument).getActiveRewriteSession();
+		boolean startedRewriteSession = false;
+		if (activeRewriteSession == null) {
+			activeRewriteSession = ((IDocumentExtension4) structuredDocument).startRewriteSession(DocumentRewriteSessionType.UNRESTRICTED);
+			startedRewriteSession = true;
+		}
+		getFormatter().setProgressMonitor(new NullProgressMonitor() {
+			public boolean isCanceled() {
+				return fProgressMonitor != null && fProgressMonitor.isCanceled();
+			}
+		});
 		TextEdit edit = getFormatter().format(structuredModel, start, length);
+		if(fProgressMonitor != null)
+			fProgressMonitor.worked(1);
+		
 		try {
 			structuredModel.aboutToChangeModel();
-			edit.apply(structuredModel.getStructuredDocument());
+			edit.apply(structuredDocument);
+			if(fProgressMonitor != null)
+				fProgressMonitor.worked(1);
 		}
 		catch (Exception e) {
 			Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
 		}
 		finally {
+			if (startedRewriteSession && activeRewriteSession != null) {
+				((IDocumentExtension4) structuredDocument).stopRewriteSession(activeRewriteSession);
+			}
 			structuredModel.changedModel();
+			if(fProgressMonitor != null)
+				fProgressMonitor.done();
 		}
 	}
 
@@ -106,7 +134,6 @@
 
 	public void setProgressMonitor(IProgressMonitor monitor) {
 		fProgressMonitor = monitor;
-		getFormatter().setProgressMonitor(fProgressMonitor);
 	}
 
 	private DefaultXMLPartitionFormatter getFormatter() {
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingConstraints.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingConstraints.java
index 6bf3763..fa2a53b 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingConstraints.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingConstraints.java
@@ -15,8 +15,10 @@
 	public final static String PRESERVE = "PRESERVE"; //$NON-NLS-1$
 	public final static String COLLAPSE = "COLLAPSE"; //$NON-NLS-1$
 	public final static String IGNORE = "IGNORE"; //$NON-NLS-1$
+	public final static String IGNOREANDTRIM = "IGNOREANDTRIM"; //$NON-NLS-1$
 	public final static String DEFAULT = "DEFAULT"; //$NON-NLS-1$
-
+	public final static String REPLACE = "REPLACE"; //$NON-NLS-1$
+	
 	public final static String INDENT = "INDENT"; //$NON-NLS-1$
 	public final static String NEW_LINE = "NEW_LINE"; //$NON-NLS-1$
 	public final static String INLINE = "INLINE"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingPreferences.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingPreferences.java
index 93a3896..61c1b46 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingPreferences.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingPreferences.java
@@ -27,6 +27,9 @@
 	private boolean fAlignFinalBracket = false;
 	private boolean fSpaceBeforeEmptyCloseTag = true;
 	private boolean fIndentMultipleAttributes = false;
+	private boolean fFormatCommentText = true;
+	private boolean fJoinCommentLines = false;
+
 	private String fPCDataWhitespaceStrategy = XMLFormattingConstraints.PRESERVE;
 	private String fTextIndentStrategy = XMLFormattingConstraints.INLINE;
 	private String fTextWhitespaceStrategy = XMLFormattingConstraints.COLLAPSE;
@@ -35,10 +38,14 @@
 	private String fMixedIndentStrategy = XMLFormattingConstraints.INDENT;
 	private String fMixedWhitespaceStrategy = XMLFormattingConstraints.IGNORE;
 	private String fOneIndent = "\t"; //$NON-NLS-1$
+	private boolean fClearAllBlankLines = false;
 
 	public XMLFormattingPreferences() {
 		Preferences preferences = XMLCorePlugin.getDefault().getPluginPreferences();
 		if (preferences != null) {
+			setFormatCommentText(preferences.getBoolean(XMLCorePreferenceNames.FORMAT_COMMENT_TEXT));
+			setJoinCommentLines(preferences.getBoolean(XMLCorePreferenceNames.FORMAT_COMMENT_JOIN_LINES));
+
 			setMaxLineWidth(preferences.getInt(XMLCorePreferenceNames.LINE_WIDTH));
 			setIndentMultipleAttributes(preferences.getBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
 			setAlignFinalBracket(preferences.getBoolean(XMLCorePreferenceNames.ALIGN_END_BRACKET));
@@ -62,6 +69,7 @@
 				indent.append(indentChar);
 			}
 			setOneIndent(indent.toString());
+			setClearAllBlankLines(preferences.getBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
 		}
 	}
 
@@ -69,6 +77,10 @@
 		return fMaxLineWidth;
 	}
 
+	public boolean getFormatCommentText() {
+		return fFormatCommentText;
+	}
+
 	public boolean getAlignFinalBracket() {
 		return fAlignFinalBracket;
 	}
@@ -101,6 +113,18 @@
 		return fElementWhitespaceStrategy;
 	}
 	
+	public boolean getJoinCommentLines() {
+		return fJoinCommentLines;
+	}
+
+	public void setJoinCommentLines(boolean joinCommentLines) {
+		fJoinCommentLines = joinCommentLines;
+	}
+
+	public void setFormatCommentText(boolean formatCommentText) {
+		fFormatCommentText = formatCommentText;
+	}
+
 	public void setSpaceBeforeEmptyCloseTag(boolean spaceBeforeEmptyCloseTag) {
 		fSpaceBeforeEmptyCloseTag = spaceBeforeEmptyCloseTag;
 	}
@@ -144,4 +168,12 @@
 	protected void setOneIndent(String oneIndent) {
 		fOneIndent = oneIndent;
 	}
+
+	public boolean getClearAllBlankLines() {
+		return fClearAllBlankLines;
+	}
+
+	public void setClearAllBlankLines(boolean clearAllBlankLines) {
+		fClearAllBlankLines = clearAllBlankLines;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/EmbeddedXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/EmbeddedXML.java
index 566b6ef..abff1a4 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/EmbeddedXML.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/EmbeddedXML.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,7 +16,7 @@
 import java.util.List;
 
 import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.internal.ltk.parser.JSPCapableParser;
+import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
 import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
 import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryAdapterFactoryForEmbeddedXML;
 
@@ -63,10 +63,7 @@
 		//TODO: initialize
 	}
 
-	/*
-	 * @see EmbeddedContentType#initializeParser(RegionParser)
-	 */
-	public void initializeParser(JSPCapableParser parser) {
+	public void initializeParser(RegionParser parser) {
 		// nothing to initialize for "pure" XML
 		// compare with XHTML
 	}
@@ -84,7 +81,7 @@
 
 	}
 
-	public void uninitializeParser(JSPCapableParser parser) {
+	public void uninitializeParser(RegionParser parser) {
 		// need to undo anything we did in initialize
 	}
 
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/ContextRegionContainer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/ContextRegionContainer.java
index a13f814..0de3302 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/ContextRegionContainer.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/ContextRegionContainer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -149,16 +149,29 @@
 	public ITextRegion getRegionAtCharacterOffset(int offset) {
 		ITextRegion result = null;
 		if (regions != null) {
+			int thisStartOffset = getStartOffset();
+			if (offset < thisStartOffset)
+				return null;
+			int thisEndOffset = getStartOffset() + getLength();
+			if (offset > thisEndOffset)
+				return null;
 			// transform the requested offset to the "scale" that
 			// regions are stored in, which are all relative to the
 			// start point.
 			//int transformedOffset = offset - getStartOffset();
 			//
-			int length = getRegions().size();
-			for (int i = 0; i < length; i++) {
-				ITextRegion region = getRegions().get(i);
+			ITextRegionList regions = getRegions();
+			int length = regions.size();
+			int low = 0;
+			int high = length;
+			int mid = 0;
+			// Binary search for the region
+			while (low < high) {
+				mid = low + ((high - low) >> 1);
+				ITextRegion region = regions.get(mid);
 				if (org.eclipse.wst.sse.core.internal.util.Debug.debugStructuredDocument) {
 					System.out.println("region(s) in IStructuredDocumentRegion::getRegionAtCharacterOffset: " + region); //$NON-NLS-1$
+					System.out.println("       midpoint of search:" + mid); //$NON-NLS-1$
 					System.out.println("       requested offset: " + offset); //$NON-NLS-1$
 					//System.out.println(" transformedOffset: " +
 					// transformedOffset); //$NON-NLS-1$
@@ -168,11 +181,15 @@
 					System.out.println("       region class: " + region.getClass()); //$NON-NLS-1$
 
 				}
-				if ((getStartOffset(region) <= offset) && (offset < getEndOffset(region))) {
-					result = region;
-					break;
-				}
+				// Region is before this one
+				if (offset < region.getStart() + thisStartOffset)
+					high = mid;
+				else if (offset > (region.getEnd() + thisStartOffset - 1))
+					low = mid + 1;
+				else
+					return region;
 			}
+			return null;
 		}
 		return result;
 	}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/IntStack.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/IntStack.java
index b871545..5cb8d5a 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/IntStack.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/IntStack.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -92,6 +92,21 @@
 	}
 
 	public int size() {
-		return list.length;
+		return size;
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	public String toString() {
+		StringBuffer s = new StringBuffer(getClass().getName() + ":" +size + " [");
+		for (int i = 0; i < size; i++) {
+			s.append(list[i]);
+			if(i < size - 1) {
+				s.append(", ");
+			}
+		}
+		s.append("]");
+		return s.toString();
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XML10Names.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XML10Names.java
index bbc7836..af91c63 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XML10Names.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XML10Names.java
@@ -3,9 +3,9 @@
 /*******************************************************************************
  * Copyright (c) 2004,2008 IBM Corporation, and others.
  * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
+ * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
+ * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLSourceParser.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLSourceParser.java
index 97a85df..4a8791c 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLSourceParser.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLSourceParser.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -89,10 +89,12 @@
 		getTokenizer().addBlockMarker(marker);
 	}
 
-	public void addStructuredDocumentRegionHandler(StructuredDocumentRegionHandler handler) {
+	public synchronized void addStructuredDocumentRegionHandler(StructuredDocumentRegionHandler handler) {
 		if (fStructuredDocumentRegionHandlers == null)
 			fStructuredDocumentRegionHandlers = new ArrayList();
-		fStructuredDocumentRegionHandlers.add(handler);
+		synchronized (fStructuredDocumentRegionHandlers) {
+			fStructuredDocumentRegionHandlers.add(handler);
+		}
 	}
 
 	public void beginBlockScan(String newTagName) {
@@ -120,16 +122,23 @@
 		 * 
 		 * Protect the user's data above everything.
 		 */
-		try {
-			if (fCurrentNode != null && fStructuredDocumentRegionHandlers != null) {
-				for (int i = 0; i < fStructuredDocumentRegionHandlers.size(); i++) {
-					((StructuredDocumentRegionHandler) fStructuredDocumentRegionHandlers.get(i)).nodeParsed(fCurrentNode);
+		Object[] handlers = null;
+		synchronized (fStructuredDocumentRegionHandlers) {
+			if (fStructuredDocumentRegionHandlers == null)
+				return;
+
+			handlers = fStructuredDocumentRegionHandlers.toArray();
+		}
+		if (fCurrentNode != null && handlers != null) {
+			for (int i = 0; i < handlers.length; i++) {
+				try {
+					((StructuredDocumentRegionHandler) handlers[i]).nodeParsed(fCurrentNode);
+				}
+				catch (Exception e) {
+					Logger.log(Logger.ERROR, "Error occurred while firing Node Parsed event", e); //$NON-NLS-1$
 				}
 			}
 		}
-		catch (Exception e) {
-		    Logger.log(Logger.ERROR, "Error occurred while firing Node Parsed event for "+fDocumentInput.toString(), e); //$NON-NLS-1$
-		}
 	}
 
 	public BlockMarker getBlockMarker(String tagName) {
@@ -483,18 +492,19 @@
 		if (stringToCompare == null)
 			return false;
 
+		int ajustedOffset = fOffset + offset;
 		boolean result = false;
 		if (fCharSequenceSource != null && fCharSequenceSource instanceof IRegionComparible) {
-			result = ((IRegionComparible) fCharSequenceSource).regionMatches(offset, length, stringToCompare);
+			result = ((IRegionComparible) fCharSequenceSource).regionMatches(ajustedOffset, length, stringToCompare);
 		}
 		else {
 			// old fashioned ways
 			String test = null;
 			if (fCharSequenceSource != null) {
-				test = fCharSequenceSource.subSequence(offset, offset + length).toString();
+				test = fCharSequenceSource.subSequence(ajustedOffset, ajustedOffset + length).toString();
 			}
 			else if (fStringInput != null) {
-				test = fStringInput.substring(offset, offset + length);
+				test = fStringInput.substring(ajustedOffset, ajustedOffset + length);
 			}
 			result = stringToCompare.equals(test);
 		}
@@ -506,18 +516,19 @@
 		if (stringToCompare == null)
 			return false;
 
+		int ajustedOffset = fOffset + offset;
 		boolean result = false;
 		if (fCharSequenceSource != null && fCharSequenceSource instanceof IRegionComparible) {
-			result = ((IRegionComparible) fCharSequenceSource).regionMatchesIgnoreCase(offset, length, stringToCompare);
+			result = ((IRegionComparible) fCharSequenceSource).regionMatchesIgnoreCase(ajustedOffset, length, stringToCompare);
 		}
 		else {
 			// old fashioned ways
 			String test = null;
 			if (fCharSequenceSource != null) {
-				test = fCharSequenceSource.subSequence(offset, offset + length).toString();
+				test = fCharSequenceSource.subSequence(ajustedOffset, ajustedOffset + length).toString();
 			}
 			else if (fStringInput != null) {
-				test = fStringInput.substring(offset, offset + length);
+				test = fStringInput.substring(ajustedOffset, ajustedOffset + length);
 			}
 			result = stringToCompare.equalsIgnoreCase(test);
 		}
@@ -535,8 +546,9 @@
 	public void removeStructuredDocumentRegionHandler(StructuredDocumentRegionHandler handler) {
 		if (fStructuredDocumentRegionHandlers == null)
 			return;
-		if (fStructuredDocumentRegionHandlers.contains(handler))
+		synchronized (fStructuredDocumentRegionHandlers) {
 			fStructuredDocumentRegionHandlers.remove(handler);
+		}
 	}
 
 	/**
@@ -600,10 +612,20 @@
 	}
 
 	public void resetHandlers() {
-		if (fStructuredDocumentRegionHandlers != null) {
-			int size = fStructuredDocumentRegionHandlers.size();
-			for (int i = 0; i < size; i++)
-				((StructuredDocumentRegionHandler) fStructuredDocumentRegionHandlers.get(i)).resetNodes();
+		Object[] handlers = null;
+		synchronized (fStructuredDocumentRegionHandlers) {
+			if (fStructuredDocumentRegionHandlers == null)
+				return;
+
+			handlers = fStructuredDocumentRegionHandlers.toArray();
+		}
+		for (int i = 0; i < handlers.length; i++) {
+			try {
+				((StructuredDocumentRegionHandler) handlers[i]).resetNodes();
+			}
+			catch (Exception e) {
+				Logger.log(Logger.ERROR, "Error occurred while resetting handlers", e); //$NON-NLS-1$
+			}
 		}
 	}
 
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLTokenizer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLTokenizer.java
index b4607a2..09a3850 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLTokenizer.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLTokenizer.java
@@ -1,7 +1,7 @@
-/* The following code was generated by JFlex 1.2.2 on 10/17/07 4:27 AM */
+/* The following code was generated by JFlex 1.2.2 on 6/29/10 1:04 PM */
 
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -32,7 +32,7 @@
 /**
  * This class is a scanner generated by 
  * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 10/17/07 4:27 AM from the specification file
+ * on 6/29/10 1:04 PM from the specification file
  * <tt>file:/D:/eclipse.wtp/workspace/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex</tt>
  */
 public class XMLTokenizer implements BlockTokenizer, DOMRegionContext {
@@ -266,42 +266,41 @@
     "\1\0\3\70\1\0\5\70\1\72\2\0\1\207\1\72"+
     "\1\0\3\72\1\0\1\72\2\0\5\72\1\0\45\72"+
     "\1\0\1\206\1\207\1\72\1\0\3\72\1\0\1\72"+
-    "\2\0\5\72\1\0\44\72\1\75\1\0\1\210\1\211"+
-    "\1\75\1\210\3\75\1\212\1\75\2\210\5\75\1\210"+
-    "\44\75\1\76\1\0\1\213\1\214\1\76\1\213\3\76"+
-    "\1\213\1\76\1\212\1\213\5\76\1\213\44\76\2\0"+
-    "\1\100\1\215\71\0\3\102\4\0\1\102\5\0\6\102"+
-    "\1\0\13\102\1\0\7\102\1\0\3\102\1\0\5\102"+
-    "\1\104\2\0\1\216\1\104\1\0\3\104\1\0\1\104"+
-    "\2\0\5\104\1\0\45\104\1\0\1\100\1\217\1\104"+
-    "\1\0\3\104\1\0\1\104\2\0\5\104\1\0\44\104"+
-    "\1\106\1\0\1\220\1\221\1\106\1\220\3\106\1\222"+
-    "\1\106\2\220\5\106\1\220\44\106\1\107\1\0\1\223"+
-    "\1\224\1\107\1\223\3\107\1\223\1\107\1\222\1\223"+
-    "\5\107\1\223\44\107\1\110\3\0\17\110\6\0\1\110"+
-    "\13\0\1\110\7\0\1\110\3\0\1\110\3\0\1\110"+
-    "\4\0\1\167\15\0\1\171\47\0\1\225\64\0\1\110"+
-    "\3\0\2\110\3\114\4\110\1\114\5\110\6\115\1\110"+
-    "\13\115\1\110\7\115\1\110\3\115\1\110\3\115\1\114"+
-    "\1\115\6\0\3\115\4\0\1\115\5\0\6\115\1\0"+
-    "\13\115\1\0\7\115\1\0\3\115\1\0\5\115\6\0"+
-    "\3\116\4\0\1\116\5\0\6\116\1\0\13\116\1\0"+
-    "\7\116\1\0\3\116\1\0\5\116\1\120\2\0\1\226"+
+    "\2\0\5\72\1\0\44\72\1\75\2\210\1\211\1\75"+
+    "\1\210\3\75\1\212\1\75\2\210\5\75\1\210\44\75"+
+    "\1\76\2\213\1\214\1\76\1\213\3\76\1\213\1\76"+
+    "\1\212\1\213\5\76\1\213\44\76\2\0\1\100\1\215"+
+    "\71\0\3\102\4\0\1\102\5\0\6\102\1\0\13\102"+
+    "\1\0\7\102\1\0\3\102\1\0\5\102\1\104\2\0"+
+    "\1\216\1\104\1\0\3\104\1\0\1\104\2\0\5\104"+
+    "\1\0\45\104\1\0\1\100\1\217\1\104\1\0\3\104"+
+    "\1\0\1\104\2\0\5\104\1\0\44\104\1\106\2\220"+
+    "\1\221\1\106\1\220\3\106\1\222\1\106\2\220\5\106"+
+    "\1\220\44\106\1\107\2\223\1\224\1\107\1\223\3\107"+
+    "\1\223\1\107\1\222\1\223\5\107\1\223\44\107\1\110"+
+    "\3\0\17\110\6\0\1\110\13\0\1\110\7\0\1\110"+
+    "\3\0\1\110\3\0\1\110\4\0\1\167\15\0\1\171"+
+    "\47\0\1\225\64\0\1\110\3\0\2\110\3\114\4\110"+
+    "\1\114\5\110\6\115\1\110\13\115\1\110\7\115\1\110"+
+    "\3\115\1\110\3\115\1\114\1\115\6\0\3\115\4\0"+
+    "\1\115\5\0\6\115\1\0\13\115\1\0\7\115\1\0"+
+    "\3\115\1\0\5\115\6\0\3\116\4\0\1\116\5\0"+
+    "\6\116\1\0\13\116\1\0\7\116\1\0\3\116\1\0"+
+    "\5\116\1\120\2\0\1\226\1\120\1\0\3\120\1\0"+
+    "\1\120\2\0\5\120\1\0\45\120\1\0\1\225\1\226"+
     "\1\120\1\0\3\120\1\0\1\120\2\0\5\120\1\0"+
-    "\45\120\1\0\1\225\1\226\1\120\1\0\3\120\1\0"+
-    "\1\120\2\0\5\120\1\0\44\120\1\122\1\0\1\227"+
-    "\1\230\1\122\1\227\3\122\1\231\1\122\2\227\5\122"+
-    "\1\227\44\122\1\123\1\0\1\232\1\233\1\123\1\232"+
-    "\3\123\1\232\1\123\1\231\1\232\5\123\1\232\44\123"+
-    "\3\0\1\167\15\0\1\234\110\0\1\235\60\0\1\236"+
-    "\13\0\1\236\44\0\2\237\36\0\20\240\1\241\46\240"+
-    "\6\0\3\132\4\0\1\132\5\0\6\132\1\0\13\132"+
-    "\1\0\7\132\1\0\3\132\1\0\5\132\46\0\1\242"+
-    "\5\0\1\242\72\0\1\243\6\0\1\135\2\0\1\244"+
-    "\1\135\1\0\3\135\1\0\1\135\2\0\5\135\1\0"+
-    "\44\135\1\137\1\0\1\245\1\246\1\137\1\245\3\137"+
-    "\1\247\1\137\2\245\5\137\1\245\44\137\1\250\1\0"+
-    "\1\251\1\252\1\253\1\251\3\253\1\251\1\250\1\254"+
+    "\44\120\1\122\2\227\1\230\1\122\1\227\3\122\1\231"+
+    "\1\122\2\227\5\122\1\227\44\122\1\123\2\232\1\233"+
+    "\1\123\1\232\3\123\1\232\1\123\1\231\1\232\5\123"+
+    "\1\232\44\123\3\0\1\167\15\0\1\234\110\0\1\235"+
+    "\60\0\1\236\13\0\1\236\44\0\2\237\36\0\20\240"+
+    "\1\241\46\240\6\0\3\132\4\0\1\132\5\0\6\132"+
+    "\1\0\13\132\1\0\7\132\1\0\3\132\1\0\5\132"+
+    "\46\0\1\242\5\0\1\242\72\0\1\243\6\0\1\135"+
+    "\2\0\1\244\1\135\1\0\3\135\1\0\1\135\2\0"+
+    "\5\135\1\0\44\135\1\137\2\245\1\246\1\137\1\245"+
+    "\3\137\1\247\1\137\2\245\5\137\1\245\44\137\1\250"+
+    "\2\251\1\252\1\253\1\251\3\253\1\251\1\250\1\254"+
     "\1\255\3\253\1\250\1\253\1\255\6\253\1\250\32\253"+
     "\2\250\1\253\1\141\2\240\1\256\1\141\1\240\3\141"+
     "\1\240\1\141\2\240\3\141\1\257\1\141\1\240\44\141"+
@@ -313,58 +312,53 @@
     "\1\146\1\240\3\146\1\240\1\146\2\240\3\146\1\267"+
     "\1\146\1\240\44\146\1\147\2\0\1\270\1\147\1\0"+
     "\3\147\1\0\1\147\2\0\5\147\1\0\44\147\1\151"+
-    "\1\0\1\271\1\272\1\151\1\271\3\151\1\273\1\151"+
-    "\2\271\5\151\1\271\44\151\1\274\1\0\1\275\1\276"+
-    "\1\277\1\275\3\277\1\275\1\274\1\300\1\301\3\277"+
-    "\1\274\1\277\1\301\6\277\1\274\32\277\2\274\1\277"+
-    "\2\153\1\0\66\153\1\0\16\153\1\302\45\153\1\156"+
-    "\2\0\1\303\1\156\1\0\3\156\1\0\1\156\2\0"+
-    "\5\156\1\0\44\156\1\160\1\0\1\304\1\305\1\160"+
-    "\1\304\3\160\1\306\1\160\2\304\5\160\1\304\44\160"+
-    "\1\307\1\0\1\310\1\311\1\312\1\310\3\312\1\310"+
-    "\1\307\1\313\1\314\3\312\1\307\1\312\1\314\6\312"+
-    "\1\307\32\312\2\307\1\312\2\162\1\0\66\162\1\0"+
-    "\16\162\1\315\45\162\7\0\1\316\21\0\1\317\42\0"+
-    "\1\172\2\0\1\40\3\0\1\172\5\0\1\172\6\40"+
-    "\1\0\13\40\1\0\7\40\1\0\3\40\1\0\3\40"+
-    "\1\0\1\40\1\320\1\0\3\320\1\321\3\173\1\320"+
-    "\1\0\1\320\1\321\1\173\1\320\1\0\2\320\1\321"+
-    "\6\173\1\320\13\173\1\320\7\173\1\320\3\173\1\322"+
-    "\5\173\15\0\1\323\6\0\1\324\42\0\1\320\1\0"+
-    "\3\320\1\321\3\175\1\320\1\0\1\320\1\321\1\175"+
-    "\1\320\1\0\2\320\1\321\6\175\1\320\13\175\1\320"+
-    "\7\175\1\320\3\175\1\325\5\175\31\0\1\317\37\0"+
-    "\1\326\66\0\1\327\72\0\3\57\4\0\1\57\5\0"+
-    "\4\57\2\330\1\0\13\57\1\0\7\57\1\0\3\57"+
-    "\1\0\5\57\6\0\3\57\4\0\1\57\5\0\4\57"+
-    "\1\330\1\331\1\0\13\57\1\0\7\57\1\0\3\57"+
-    "\1\0\5\57\6\0\3\57\4\0\1\57\5\0\6\57"+
-    "\1\0\13\57\1\0\1\57\1\332\5\57\1\0\3\57"+
-    "\1\0\5\57\1\210\1\0\7\210\1\212\55\210\1\213"+
-    "\1\0\11\213\1\212\53\213\1\220\1\0\7\220\1\222"+
-    "\55\220\1\223\1\0\11\223\1\222\53\223\1\227\1\0"+
-    "\7\227\1\231\55\227\1\232\1\0\11\232\1\231\53\232"+
+    "\2\271\1\272\1\151\1\271\3\151\1\273\1\151\2\271"+
+    "\5\151\1\271\44\151\1\274\2\275\1\276\1\277\1\275"+
+    "\3\277\1\275\1\274\1\300\1\301\3\277\1\274\1\277"+
+    "\1\301\6\277\1\274\32\277\2\274\1\277\2\153\1\0"+
+    "\66\153\1\0\16\153\1\302\45\153\1\156\2\0\1\303"+
+    "\1\156\1\0\3\156\1\0\1\156\2\0\5\156\1\0"+
+    "\44\156\1\160\2\304\1\305\1\160\1\304\3\160\1\306"+
+    "\1\160\2\304\5\160\1\304\44\160\1\307\2\310\1\311"+
+    "\1\312\1\310\3\312\1\310\1\307\1\313\1\314\3\312"+
+    "\1\307\1\312\1\314\6\312\1\307\32\312\2\307\1\312"+
+    "\2\162\1\0\66\162\1\0\16\162\1\315\45\162\7\0"+
+    "\1\316\21\0\1\317\42\0\1\172\2\0\1\40\3\0"+
+    "\1\172\5\0\1\172\6\40\1\0\13\40\1\0\7\40"+
+    "\1\0\3\40\1\0\3\40\1\0\1\40\1\320\1\0"+
+    "\3\320\1\321\3\173\1\320\1\0\1\320\1\321\1\173"+
+    "\1\320\1\0\2\320\1\321\6\173\1\320\13\173\1\320"+
+    "\7\173\1\320\3\173\1\322\5\173\15\0\1\323\6\0"+
+    "\1\324\42\0\1\320\1\0\3\320\1\321\3\175\1\320"+
+    "\1\0\1\320\1\321\1\175\1\320\1\0\2\320\1\321"+
+    "\6\175\1\320\13\175\1\320\7\175\1\320\3\175\1\325"+
+    "\5\175\31\0\1\317\37\0\1\326\66\0\1\327\72\0"+
+    "\3\57\4\0\1\57\5\0\4\57\2\330\1\0\13\57"+
+    "\1\0\7\57\1\0\3\57\1\0\5\57\6\0\3\57"+
+    "\4\0\1\57\5\0\4\57\1\330\1\331\1\0\13\57"+
+    "\1\0\7\57\1\0\3\57\1\0\5\57\6\0\3\57"+
+    "\4\0\1\57\5\0\6\57\1\0\13\57\1\0\1\57"+
+    "\1\332\5\57\1\0\3\57\1\0\5\57\11\210\1\212"+
+    "\55\210\13\213\1\212\53\213\11\220\1\222\55\220\13\223"+
+    "\1\222\53\223\11\227\1\231\55\227\13\232\1\231\53\232"+
     "\32\0\1\333\30\0\1\333\40\0\1\334\13\0\1\334"+
     "\54\0\1\335\10\0\1\335\57\0\1\336\14\0\1\336"+
-    "\72\0\1\337\4\0\1\245\1\0\7\245\1\247\55\245"+
-    "\1\250\1\0\1\251\1\340\1\250\1\251\3\250\1\251"+
-    "\1\250\1\247\1\251\5\250\1\251\44\250\1\251\1\0"+
-    "\11\251\1\247\53\251\1\250\1\0\1\251\1\340\1\250"+
-    "\1\251\3\250\1\251\1\250\1\341\1\251\5\250\1\251"+
-    "\44\250\13\0\1\342\53\0\1\251\1\0\11\251\1\341"+
-    "\53\251\11\261\1\263\55\261\13\264\1\263\53\264\1\271"+
-    "\1\0\7\271\1\273\55\271\1\274\1\0\1\275\1\343"+
-    "\1\274\1\275\3\274\1\275\1\274\1\273\1\275\5\274"+
-    "\1\275\44\274\1\275\1\0\11\275\1\273\53\275\1\274"+
-    "\1\0\1\275\1\343\1\274\1\275\3\274\1\275\1\274"+
-    "\1\344\1\275\5\274\1\275\44\274\13\0\1\345\53\0"+
-    "\1\275\1\0\11\275\1\344\53\275\2\153\1\0\26\153"+
-    "\1\346\35\153\1\304\1\0\7\304\1\306\55\304\1\307"+
-    "\1\0\1\310\1\347\1\307\1\310\3\307\1\310\1\307"+
-    "\1\306\1\310\5\307\1\310\44\307\1\310\1\0\11\310"+
-    "\1\306\53\310\1\307\1\0\1\310\1\347\1\307\1\310"+
-    "\3\307\1\310\1\307\1\350\1\310\5\307\1\310\44\307"+
-    "\13\0\1\351\53\0\1\310\1\0\11\310\1\350\53\310"+
+    "\72\0\1\337\4\0\11\245\1\247\55\245\1\250\2\251"+
+    "\1\340\1\250\1\251\3\250\1\251\1\250\1\247\1\251"+
+    "\5\250\1\251\44\250\13\251\1\247\53\251\1\250\2\251"+
+    "\1\340\1\250\1\251\3\250\1\251\1\250\1\341\1\251"+
+    "\5\250\1\251\44\250\13\0\1\342\53\0\13\251\1\341"+
+    "\53\251\11\261\1\263\55\261\13\264\1\263\53\264\11\271"+
+    "\1\273\55\271\1\274\2\275\1\343\1\274\1\275\3\274"+
+    "\1\275\1\274\1\273\1\275\5\274\1\275\44\274\13\275"+
+    "\1\273\53\275\1\274\2\275\1\343\1\274\1\275\3\274"+
+    "\1\275\1\274\1\344\1\275\5\274\1\275\44\274\13\0"+
+    "\1\345\53\0\13\275\1\344\53\275\2\153\1\0\26\153"+
+    "\1\346\35\153\11\304\1\306\55\304\1\307\2\310\1\347"+
+    "\1\307\1\310\3\307\1\310\1\307\1\306\1\310\5\307"+
+    "\1\310\44\307\13\310\1\306\53\310\1\307\2\310\1\347"+
+    "\1\307\1\310\3\307\1\310\1\307\1\350\1\310\5\307"+
+    "\1\310\44\307\13\0\1\351\53\0\13\310\1\350\53\310"+
     "\2\162\1\0\26\162\1\352\35\162\7\0\1\353\111\0"+
     "\1\354\34\0\1\320\1\0\10\320\1\0\4\320\1\0"+
     "\41\320\1\0\6\320\1\0\3\320\1\321\4\320\1\0"+
@@ -1005,7 +999,7 @@
     int [] trans = new int[11055];
     int i = 0;  /* index in packed string  */
     int j = 0;  /* index in unpacked array */
-    while (i < 3734) {
+    while (i < 3638) {
       int count = packed.charAt(i++);
       int value = packed.charAt(i++);
       value--;
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/EmptyTagCloseRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/EmptyTagCloseRegion.java
new file mode 100644
index 0000000..339d692
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/EmptyTagCloseRegion.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.parser.regions;
+
+import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+
+
+public class EmptyTagCloseRegion implements ITextRegion {
+	private int fLength = 2;
+	static private final byte fTextLength = 2;
+	static private final String fType = DOMRegionContext.XML_EMPTY_TAG_CLOSE;
+	private int fStart;
+
+
+	public EmptyTagCloseRegion() {
+		super();
+	}
+
+	public EmptyTagCloseRegion(int start, int textLength, int length) {
+		super();
+		fStart = start;
+		fLength = length;
+		if (fTextLength != textLength)
+			throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
+	}
+
+	public void adjustLength(int i) {
+		fLength += i;
+	}
+
+	public void adjustStart(int i) {
+		fStart += i;
+
+	}
+
+	public void adjustTextLength(int i) {
+		throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
+	}
+
+	public void equatePositions(ITextRegion region) {
+		fStart = region.getStart();
+	}
+
+	public int getEnd() {
+		return fStart + fLength;
+	}
+
+	public int getLength() {
+		return fLength;
+	}
+
+	public int getStart() {
+		return fStart;
+	}
+
+	public int getTextEnd() {
+		return fStart + fTextLength;
+	}
+
+	public int getTextLength() {
+		return fTextLength;
+	}
+
+	public String getType() {
+		return fType;
+	}
+
+	public String toString() {
+		return RegionToStringUtil.toString(this);
+	}
+
+	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
+		// can never be updated
+		return null;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/EndTagOpenRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/EndTagOpenRegion.java
new file mode 100644
index 0000000..1ad5549
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/EndTagOpenRegion.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.parser.regions;
+
+import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+
+
+public class EndTagOpenRegion implements ITextRegion {
+	static private final String fType = DOMRegionContext.XML_END_TAG_OPEN;
+	private int fLength;
+	private int fStart;
+	static private final byte fTextLength = 2;
+
+
+	public EndTagOpenRegion() {
+		super();
+	}
+
+	public EndTagOpenRegion(int start, int textLength, int length) {
+		this();
+		fStart = start;
+		if (fTextLength != textLength)
+			throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
+		fLength = length;
+	}
+
+	public EndTagOpenRegion(int start, int length) {
+		this();
+		fStart = start;
+		fLength = length;
+	}
+
+	public void adjustLength(int i) {
+		fLength += i;
+
+	}
+
+	public void adjustStart(int i) {
+		fStart += i;
+
+	}
+
+
+	public void adjustTextLength(int i) {
+//		fTextLength += 1;
+		throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
+	}
+
+	public void equatePositions(ITextRegion region) {
+		fStart = region.getStart();
+		fLength = region.getLength();
+//		fTextLength = region.getTextLength();
+	}
+
+	public int getEnd() {
+		return fStart + fLength;
+	}
+
+	public int getLength() {
+		return fLength;
+	}
+
+	public int getStart() {
+		return fStart;
+	}
+
+	public int getTextEnd() {
+		return fStart + fTextLength;
+	}
+
+	public int getTextLength() {
+		return fTextLength;
+	}
+
+	public String getType() {
+		return fType;
+	}
+
+	public String toString() {
+		return RegionToStringUtil.toString(this);
+	}
+
+	public StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace) {
+		// can never be updated
+		return null;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionUpdateRule.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionUpdateRule.java
index d43afed..567d093 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionUpdateRule.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionUpdateRule.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -90,7 +90,9 @@
 		if (region.getEnd() > region.getTextEnd()) {
 			// no need to add one to end of text, as we used to, since we
 			// change definition of length to equate to offset plus one.
-			if (requestStart > parent.getTextEndOffset(region)) {
+			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=105866
+			// watch out for whitespace at end of text
+			if (requestStart >= parent.getTextEndOffset(region)) {
 				// ok, we are in the whitespace region, so we can't handle,
 				// unless
 				// we are just inserting whitespace.
@@ -116,7 +118,9 @@
 		if (region.getEnd() > region.getTextEnd()) {
 			// no need to add one to end of text, as we used to, since we
 			// change definition of length to equate to offset plus one.
-			if (requestStart > region.getTextEnd()) {
+			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=105866
+			// watch out for whitespace at end of text
+			if (requestStart >= region.getTextEnd()) {
 				// ok, we are in the whitespace region, so we can't handle,
 				// unless
 				// we are just inserting whitespace.
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagOpenRegion.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagOpenRegion.java
index 27ad9ae..e8cb85e 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagOpenRegion.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagOpenRegion.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -22,7 +22,7 @@
 	static private final String fType = DOMRegionContext.XML_TAG_OPEN;
 	private int fLength;
 	private int fStart;
-	private int fTextLength;
+	static private final byte fTextLength = 1;
 
 
 	public TagOpenRegion() {
@@ -30,9 +30,14 @@
 	}
 
 	public TagOpenRegion(int start, int textLength, int length) {
+		this(start, length);
+		if (fTextLength != textLength)
+			throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
+	}
+
+	public TagOpenRegion(int start, int length) {
 		this();
 		fStart = start;
-		fTextLength = textLength;
 		fLength = length;
 	}
 
@@ -48,14 +53,13 @@
 
 
 	public void adjustTextLength(int i) {
-		fTextLength += 1;
-
+//		fTextLength += 1;
+		throw new RuntimeException("invalid for this region type"); //$NON-NLS-1$
 	}
 
 	public void equatePositions(ITextRegion region) {
 		fStart = region.getStart();
 		fLength = region.getLength();
-		fTextLength = region.getTextLength();
 	}
 
 	public int getEnd() {
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLParserRegionFactory.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLParserRegionFactory.java
index b967526..581f447 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLParserRegionFactory.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLParserRegionFactory.java
@@ -71,9 +71,15 @@
 		else if (context == DOMRegionContext.XML_TAG_OPEN) {
 			newRegion = new TagOpenRegion(start, textLength, length);
 		}
+		else if (context == DOMRegionContext.XML_END_TAG_OPEN) {
+			newRegion = new EndTagOpenRegion(start, textLength, length);
+		}
 		else if (context == DOMRegionContext.XML_TAG_CLOSE) {
 			newRegion = new TagCloseRegion(start);
 		}
+		else if (context == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
+			newRegion = new EmptyTagCloseRegion(start, textLength, length);
+		}
 		else if (context == DOMRegionContext.WHITE_SPACE) {
 			newRegion = new WhiteSpaceOnlyRegion(start, length);
 		}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceInitializer.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceInitializer.java
index 6c6c59b..b050f9d 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceInitializer.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceInitializer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -39,7 +39,8 @@
 		node.putBoolean(XMLCorePreferenceNames.ALIGN_END_BRACKET, false);
 		node.putBoolean(XMLCorePreferenceNames.PRESERVE_CDATACONTENT, false);
 		node.putBoolean(XMLCorePreferenceNames.SPACE_BEFORE_EMPTY_CLOSE_TAG, true);
-		
+		node.putBoolean(XMLCorePreferenceNames.FORMAT_COMMENT_TEXT, true);
+		node.putBoolean(XMLCorePreferenceNames.FORMAT_COMMENT_JOIN_LINES, true);
 		// cleanup preferences
 		node.putBoolean(XMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS, true);
 		node.putBoolean(XMLCorePreferenceNames.INSERT_REQUIRED_ATTRS, true);
@@ -47,6 +48,7 @@
 		node.putBoolean(XMLCorePreferenceNames.QUOTE_ATTR_VALUES, true);
 		node.putBoolean(XMLCorePreferenceNames.FORMAT_SOURCE, true);
 		node.putBoolean(XMLCorePreferenceNames.CONVERT_EOL_CODES, false);
+		node.putBoolean(XMLCorePreferenceNames.FIX_XML_DECLARATION, true);
 
 		node.put(CommonEncodingPreferenceNames.INPUT_CODESET, ""); //$NON-NLS-1$
 		node.put(CommonEncodingPreferenceNames.OUTPUT_CODESET, "UTF-8");//$NON-NLS-1$
@@ -57,7 +59,23 @@
 		node.put(XMLCorePreferenceNames.DEFAULT_EXTENSION, "xml"); //$NON-NLS-1$
 
 		node.putBoolean(XMLCorePreferenceNames.WARN_NO_GRAMMAR, true);
+		// 1 = IMarker.SEVERITY_WARNING
 		node.putInt(XMLCorePreferenceNames.INDICATE_NO_GRAMMAR, 1);
 		node.putBoolean(XMLCorePreferenceNames.USE_XINCLUDE, false);
+		node.putBoolean(XMLCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS, true);
+		node.putBoolean(XMLCorePreferenceNames.CMDOCUMENT_GLOBAL_CACHE_ENABLED, true);
+		
+		node.putBoolean(XMLCorePreferenceNames.MARKUP_VALIDATION, false);
+		node.putInt(XMLCorePreferenceNames.ATTRIBUTE_HAS_NO_VALUE, 2);
+		node.putInt(XMLCorePreferenceNames.END_TAG_WITH_ATTRIBUTES, 2);
+		node.putInt(XMLCorePreferenceNames.MISSING_START_TAG, 2);
+		node.putInt(XMLCorePreferenceNames.MISSING_END_TAG, 2);
+		node.putInt(XMLCorePreferenceNames.MISSING_TAG_NAME, 2);
+		node.putInt(XMLCorePreferenceNames.MISSING_QUOTES, 2);
+		node.putInt(XMLCorePreferenceNames.MISSING_CLOSING_BRACKET, 2);
+		node.putInt(XMLCorePreferenceNames.MISSING_CLOSING_QUOTE, 2);
+		node.putInt(XMLCorePreferenceNames.NAMESPACE_IN_PI_TARGET, 2);
+		node.putInt(XMLCorePreferenceNames.WHITESPACE_AT_START, 2);
+		node.putInt(XMLCorePreferenceNames.WHITESPACE_BEFORE_TAGNAME, 2);
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceNames.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceNames.java
index f572af5..00f597c 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceNames.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceNames.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
 
 package org.eclipse.wst.xml.core.internal.preferences;
 
+
 /**
  * Common preference keys used by XML core
  * 
@@ -135,6 +136,14 @@
 	public static final String QUOTE_ATTR_VALUES = "quoteAttrValues";//$NON-NLS-1$
 
 	/**
+	 * Indicates whether or not to insert missing XML declarations during cleanup.
+	 * <p>
+	 * Value is of type <code>Boolean</code>
+	 * </p>
+	 */
+	public static final String FIX_XML_DECLARATION = "fixXMLDeclaration"; //$NON-NLS-1$
+
+	/**
 	 * Indicates whether or not to convert all line delimiters during cleanup.
 	 * <p>
 	 * Value is of type <code>Boolean</code>.
@@ -212,4 +221,67 @@
 	 * </p>
 	 */
 	public static final String SPACE_BEFORE_EMPTY_CLOSE_TAG = "spaceBeforeEmptyCloseTag";//$NON-NLS-1$
+	
+    /**
+     * Indicates whether or not all schema locations for XSD should be honoured
+     * during XSD validation of XML.
+     * <p>
+     * Value is of type <code>boolean</code>.<br />
+     * Possible values: {TRUE, FALSE}
+     * </p>
+     * 
+     */
+    public static final String HONOUR_ALL_SCHEMA_LOCATIONS = "honourAllSchemaLocations";//$NON-NLS-1$
+
+    /**
+     * Indicates whether or not the content of comments should be formatted
+     * <p>
+     * Value is of type <code>boolean</code><br />
+     * Possible values: {TRUE, FALSE}
+     * </p>
+     */
+    public static final String FORMAT_COMMENT_TEXT = "formatCommentText"; //$NON-NLS-1$
+
+    /**
+     * Indicates whether or not the lines of comments should be joined when formatting
+     * <p>
+     * Value is of type <code>boolean</code>
+     */
+    public static final String FORMAT_COMMENT_JOIN_LINES = "formatCommentJoinLines"; //$NON-NLS-1$
+    
+    /**
+     * Indicates whether or not CMDocuments should be globally cached
+     * <p>
+     * Value is of type <code>boolean</code>
+     */
+    public static final String CMDOCUMENT_GLOBAL_CACHE_ENABLED = "cmDocumentGlobalCacheEnabled"; //$NON-NLS-1$
+    
+    /**
+	 * Indicates whether or not MarkUpValidator should run as part of XMl Validation.
+	 * <p>
+	 * Value is of type <code>boolean</code>.<br />
+	 * Possible values: {TRUE, FALSE} 
+	 * </p>
+	 */
+    public static final String MARKUP_VALIDATION = "markupValidation"; //$NON-NLS-1$
+    
+    /**
+	 * Indicates whether or not a message should be produced when validating a
+	 * file that specifies following condition.
+	 * <p>
+	 * Value is of type <code>integer</code>.<br />
+	 * Possible values: {0, 1, 2} (none, warning, error)
+	 * </p>
+	 */
+    public static final String ATTRIBUTE_HAS_NO_VALUE = "attributeHasNoValue"; //$NON-NLS-1$
+    public static final String END_TAG_WITH_ATTRIBUTES = "endTagWithAttributes"; //$NON-NLS-1$
+    public static final String WHITESPACE_BEFORE_TAGNAME = "whitespaceBeforeTagName"; //$NON-NLS-1$
+    public static final String MISSING_CLOSING_BRACKET = "missingClosingBracket"; //$NON-NLS-1$
+    public static final String MISSING_CLOSING_QUOTE = "missingClosingQuote"; //$NON-NLS-1$
+    public static final String MISSING_END_TAG = "missingEndTag"; //$NON-NLS-1$
+    public static final String MISSING_START_TAG = "missingStartTag"; //$NON-NLS-1$
+    public static final String MISSING_QUOTES = "missingQuotes"; //$NON-NLS-1$
+    public static final String NAMESPACE_IN_PI_TARGET = "namespaceInPITarget"; //$NON-NLS-1$
+    public static final String MISSING_TAG_NAME = "missingTagName"; //$NON-NLS-1$
+    public static final String WHITESPACE_AT_START = "whitespaceAtStart"; //$NON-NLS-1$
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLNamespace.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLNamespace.java
index 8cb2260..10847db 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLNamespace.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLNamespace.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -20,7 +20,10 @@
  */
 public interface IXMLNamespace {
 
-	static final String XMLNS = "xmlns";//$NON-NLS-1$
-	static final String XMLNS_PREFIX = "xmlns:";//$NON-NLS-1$
-	static final String XMLNS_URI = "http://www.w3.org/2000/xmlns/";//$NON-NLS-1$
+	String XMLNS = "xmlns";//$NON-NLS-1$
+	String XMLNS_PREFIX = "xmlns:";//$NON-NLS-1$
+	String XMLNS_URI = "http://www.w3.org/2000/xmlns/";//$NON-NLS-1$
+	String XML = "xml";//$NON-NLS-1$
+	String XML_PREFIX = "xml:";//$NON-NLS-1$
+	String XML_URI = "http://www.w3.org/XML/1998/namespace";//$NON-NLS-1$
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocType.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocType.java
index 7a3d95f..679cefd 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocType.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocType.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,6 +23,10 @@
 	 */
 	public final static String HTML_DOC_TYPE = "HTML";//$NON-NLS-1$
 	/**
+	 * HTML5 files
+	 */
+	public final static String HTML5_DOC_TYPE = "HTML5";//$NON-NLS-1$
+	/**
 	 * JSP 1.1 files (currently includes 1.2 elements for backward behavioral compatibility)
 	 */
 	public final static String JSP11_DOC_TYPE = "JSP11";//$NON-NLS-1$
@@ -38,4 +42,8 @@
 	 * JSP 2.0 Tag files
 	 */
 	public final static String TAG20_DOC_TYPE = "JSP20.TAG";//$NON-NLS-1$
+	/**
+	 * JSP 2.1 JSP files
+	 */
+	public final static String JSP21_DOC_TYPE = "JSP21";//$NON-NLS-1$
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/CommentNodeFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/CommentNodeFormatter.java
index f30ed3a..7fba905 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/CommentNodeFormatter.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/CommentNodeFormatter.java
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     
+ *     David Carver (STAR) - bug 296999 - Inefficient use of new String()
  *******************************************************************************/
 package org.eclipse.wst.xml.core.internal.provisional.format;
 
@@ -23,7 +23,7 @@
 	static private final String LF = "\n"; //$NON-NLS-1$
 
 	protected String adjustIndentations(String aString, String lineIndent, String singleIndent) {
-		String result = new String();
+		String result = NodeFormatter.EMPTY_STRING;
 
 		int indexOfLineDelimiter = StringUtils.indexOfLineDelimiter(aString);
 		result = aString.substring(0, indexOfLineDelimiter);
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/ElementNodeFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/ElementNodeFormatter.java
index beed8f4..6baf55b 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/ElementNodeFormatter.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/ElementNodeFormatter.java
@@ -404,7 +404,7 @@
 	}
 
 	protected String getUndefinedRegions(IDOMNode node, int startOffset, int length) {
-		String result = new String();
+		String result = NodeFormatter.EMPTY_STRING;
 
 		IStructuredDocumentRegion flatNode = node.getFirstStructuredDocumentRegion();
 		ITextRegionList regions = flatNode.getRegions();
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/AbstractPropagatingValidator.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/AbstractPropagatingValidator.java
index 02fe394..3fddda3 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/AbstractPropagatingValidator.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/AbstractPropagatingValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,7 +16,6 @@
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
 import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
 import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
 
 
 public abstract class AbstractPropagatingValidator extends ValidationComponent {
@@ -46,22 +45,21 @@
 			return;
 		Class clazz = validator.getClass();
 
-		NodeList children = parent.getChildNodes();
-		for (int i = 0; i < children.getLength(); i++) {
-			Node child = children.item(i);
-			if (child == null || child.getNodeType() != Node.ELEMENT_NODE)
-				continue;
-
-			INodeNotifier notifier = (INodeNotifier) child;
-			ValidationAdapter va = (ValidationAdapter) notifier.getExistingAdapter(clazz);
-			if (va == null) {
-				notifier.addAdapter(validator);
-				va = validator;
+		Node child = parent.getFirstChild();
+		while (child != null) {
+			if (child.getNodeType() == Node.ELEMENT_NODE) {
+				INodeNotifier notifier = (INodeNotifier) child;
+				ValidationAdapter va = (ValidationAdapter) notifier.getExistingAdapter(clazz);
+				if (va == null) {
+					notifier.addAdapter(validator);
+					va = validator;
+				}
+				// bug 143213 - Can't batch validate open HTML files when
+				// as-you-type validation is enabled
+				va.setReporter(validator.getReporter());
+				va.validate((IndexedRegion) child);
 			}
-			// bug 143213 - Can't batch validate open HTML files when
-			// as-you-type validation is enabled
-			va.setReporter(validator.getReporter());
-			va.validate((IndexedRegion) child);
+			child = child.getNextSibling();
 		}
 	}
 
diff --git a/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.pde.prefs
index fc522bb..de4a8be 100644
--- a/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.pde.prefs
+++ b/bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.pde.prefs
@@ -1,16 +1,25 @@
-#Mon Apr 17 02:01:33 EDT 2006
+#Wed Jun 04 20:07:47 EDT 2008
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
 compilers.incompatible-environment=0
 compilers.p.build=0
 compilers.p.deprecated=1
+compilers.p.discouraged-class=1
 compilers.p.illegal-att-value=0
+compilers.p.internal=1
+compilers.p.missing-packages=1
 compilers.p.no-required-att=0
 compilers.p.not-externalized-att=0
 compilers.p.unknown-attribute=0
 compilers.p.unknown-class=0
 compilers.p.unknown-element=0
+compilers.p.unknown-identifier=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.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
 compilers.use-project=true
 eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.wst.xml.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xml.ui/META-INF/MANIFEST.MF
index 323ead9..b9f7576 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.400.qualifier
+Bundle-Version: 1.1.102.qualifier
 Bundle-Activator: org.eclipse.wst.xml.ui.internal.XMLUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
@@ -11,9 +11,6 @@
  org.eclipse.wst.xml.ui.internal.actions;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
  org.eclipse.wst.xml.ui.internal.autoedit;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
  org.eclipse.wst.xml.ui.internal.catalog;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.catalog.icons.etool50;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.catalog.icons.obj16;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
- org.eclipse.wst.xml.ui.internal.catalog.icons.ovr16;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
  org.eclipse.wst.xml.ui.internal.contentassist;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
  org.eclipse.wst.xml.ui.internal.contentoutline;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
  org.eclipse.wst.xml.ui.internal.correction;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
@@ -24,13 +21,16 @@
  org.eclipse.wst.xml.ui.internal.handlers;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
  org.eclipse.wst.xml.ui.internal.hyperlink;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
  org.eclipse.wst.xml.ui.internal.nsedit;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
+ org.eclipse.wst.xml.ui.internal.perspective;x-friends:="org.eclipse.wst.xsl.ui",
  org.eclipse.wst.xml.ui.internal.preferences;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
  org.eclipse.wst.xml.ui.internal.projection;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
  org.eclipse.wst.xml.ui.internal.properties;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
  org.eclipse.wst.xml.ui.internal.provisional;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
+ org.eclipse.wst.xml.ui.internal.quickoutline,
  org.eclipse.wst.xml.ui.internal.registry;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
  org.eclipse.wst.xml.ui.internal.search;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
  org.eclipse.wst.xml.ui.internal.selection;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
+ org.eclipse.wst.xml.ui.internal.spelling,
  org.eclipse.wst.xml.ui.internal.style;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
  org.eclipse.wst.xml.ui.internal.tabletree;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
  org.eclipse.wst.xml.ui.internal.taginfo;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
@@ -42,20 +42,21 @@
  org.eclipse.wst.xml.ui.internal.wizards;x-friends:="org.eclipse.wst.xsd.ui,org.eclipse.wst.dtd.ui",
  org.eclipse.wst.xml.ui.views.contentoutline,
  org.eclipse.wst.xml.ui.views.properties
-Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.views;bundle-version="[3.3.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
+Import-Package: com.ibm.icu.util; version="3.8",
+ com.ibm.icu.text; version="3.8"
+Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.views;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.wst.sse.ui;bundle-version="[1.2.0,1.3.0)",
+ org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
  org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.common.ui;bundle-version="[1.1.301,1.2.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.0,1.3.0)",
- com.ibm.icu;bundle-version="[3.8.1,4.0.0)",
- org.eclipse.core.expressions;bundle-version="[3.3.0,4.0.0)"
-Bundle-ActivationPolicy: lazy
+ org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
+ org.eclipse.wst.common.ui;bundle-version="[1.1.400,1.2.0)",
+ org.eclipse.wst.validation;bundle-version="[1.2.100,1.3.0)",
+ org.eclipse.core.expressions;bundle-version="[3.4.100,4.0.0)"
+Bundle-ActivationPolicy: lazy; exclude:="org.eclipse.wst.xml.ui.internal.validation.core.errorinfo"
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.xml.ui/about.html b/bundles/org.eclipse.wst.xml.ui/about.html
index 73db36e..2199df3 100644
--- a/bundles/org.eclipse.wst.xml.ui/about.html
+++ b/bundles/org.eclipse.wst.xml.ui/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/bundles/org.eclipse.wst.xml.ui/about.ini b/bundles/org.eclipse.wst.xml.ui/about.ini
new file mode 100644
index 0000000..68af291
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/about.ini
@@ -0,0 +1,12 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%blurb
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=icons/WTP_icon_x32_v2.png
+
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.mappings b/bundles/org.eclipse.wst.xml.ui/about.mappings
similarity index 98%
copy from features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.mappings
copy to bundles/org.eclipse.wst.xml.ui/about.mappings
index 0dfb735..bddaab4 100644
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.mappings
+++ b/bundles/org.eclipse.wst.xml.ui/about.mappings
@@ -1,6 +1,6 @@
-# about.mappings

-# contains fill-ins for about.properties

-# java.io.Properties file (ISO 8859-1 with "\" escapes)

-# This file does not need to be translated.

-

-0=@build@

+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
+0=@build@
\ No newline at end of file
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.properties b/bundles/org.eclipse.wst.xml.ui/about.properties
similarity index 77%
copy from features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.properties
copy to bundles/org.eclipse.wst.xml.ui/about.properties
index 61f1e6e..8f60396 100644
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.properties
+++ b/bundles/org.eclipse.wst.xml.ui/about.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
+# Copyright (c) 2005, 2009 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -8,19 +8,17 @@
 # Contributors:
 #     IBM Corporation - initial API and implementation
 ###############################################################################
+
 # about.properties
 # contains externalized strings for about.ini
 # java.io.Properties file (ISO 8859-1 with "\" escapes)
 # fill-ins are supplied by about.mappings
 # This file should be translated.
-#
-# Do not translate any values surrounded by {}
 
-blurb=Web Standard Tools - Web Core\n\
+blurb=Eclipse XML Editors and Tools\n\
 \n\
 Version: {featureVersion}\n\
 Build id: {0}\n\
 \n\
-(c) Copyright Eclipse contributors and others 2005.  All rights reserved.\n\
+(c) Copyright Eclipse contributors and others 2005, 2009.  All rights reserved.\n\
 Visit http://www.eclipse.org/webtools
-
diff --git a/bundles/org.eclipse.wst.xml.ui/build.properties b/bundles/org.eclipse.wst.xml.ui/build.properties
index cae15eb..f7dbd12 100644
--- a/bundles/org.eclipse.wst.xml.ui/build.properties
+++ b/bundles/org.eclipse.wst.xml.ui/build.properties
@@ -18,7 +18,10 @@
                META-INF/,\
                .,\
                .options,\
-               about.html
+               about.html,\
+               about.ini,\
+               about.properties,\
+               about.mappings
 bin.excludes = bin/**,\
                @dot/**,\
                temp.folder/**
@@ -26,5 +29,4 @@
            src-multipage/,\
            src-wizards/,\
            src-catalog/,\
-           src-validation
-src.includes = build.properties
+           src-validation/
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/WTP_icon_x32_v2.png b/bundles/org.eclipse.wst.xml.ui/icons/WTP_icon_x32_v2.png
new file mode 100644
index 0000000..6f09c2a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/icons/WTP_icon_x32_v2.png
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/default.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/default.gif
new file mode 100644
index 0000000..9ced204
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/default.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/sort.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/sort.gif
new file mode 100644
index 0000000..23c5d0b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/icons/full/obj16/sort.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/icons/full/xml_perspective.gif b/bundles/org.eclipse.wst.xml.ui/icons/full/xml_perspective.gif
new file mode 100644
index 0000000..f439b47
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/icons/full/xml_perspective.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/plugin.properties b/bundles/org.eclipse.wst.xml.ui/plugin.properties
index d521c58..4ce078d 100644
--- a/bundles/org.eclipse.wst.xml.ui/plugin.properties
+++ b/bundles/org.eclipse.wst.xml.ui/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2008 IBM Corporation and others.
+# Copyright (c) 2001, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -12,18 +12,21 @@
 #                                     bug 192568
 #     David Carver / STAR Standards - bug 212330 - migrate to org.eclipse.ui.menus 	
 ###############################################################################
-providerName=Eclipse.org
-pluginName=XML UI Plugin
+providerName=Eclipse Web Tools Platform
+pluginName=Eclipse XML Editors and Tools
 XML.name=XML
 XML_Files.name=XML Files
 XML_Source.name=Editor
+XML_Content_Assist.name=Content Assist
+XML_Validator.name=Validation
 XML_Templates.name=Templates
 XML_Styles.name=Styles
 XML_Syntax_Coloring=Syntax Coloring
 XML_Typing=Typing
 XML_Editor.name=XML Editor
 ###############################################################################
-_UI_WIZARD_NEW_XML=XML
+_UI_WIZARD_NEW_XML=XML File
+_UI_WIZARD_XML_CATEGORY=XML
 genMenuLabel=&Generate
 _UI_ACTION_CREATE_XML=&XML File...
 _UI_CREATE_NEW_XML_FILE=Create a new XML file
@@ -54,6 +57,7 @@
 _UI_PREF_DTD_FILES=DTD Files
 _UI_PREF_XSD_FILES=XSD Files
 _UI_PREF_TAGLIB_DEF_FILES=Taglib Definition Files
+_UI_PREF_CATALOG_FILES=XML Catalog Files
 ###############################################################################
 _UI_XML_VALIDATOR                   = XML Validator
 _UI_REF_FILE_SHOW_DETAILS           = Show Details...
@@ -71,13 +75,14 @@
 ##
 preferenceKeywords.files=editor xml creating saving files suffix specified encoding iana
 preferenceKeywords.source=editor xml source formatting line width split multiple attributes new clear blank indent tabs spaces size content assist automatically suggestions prompt characters inserted strategy lax strict grammar constraints inferred absence dtd schema
+preferenceKeywords.contentassist=xml editor content code assist complete completion insert overwrite single proposal common prefix automatically import fill argument name guess alphabetical hide auto activation trigger category categories separate specific
 preferenceKeywords.templates=editor xml templates snippet macros
 preferenceKeywords.styles=editor xml style customize syntax highlighting type text content foreground background bold color
 preferenceKeywords.xmlcatalog=xml catalog entries
 preferenceKeywords.severities=xml grammar errors warnings ignore options severity severities suppress project specific projectspecific
 
 ##
-XML_Source_target_name=XML Source
+XML_Source_target_name=XML Editors
 XML_hyperlink=Tags And Attributes
 ##
 DesignMenu_name=&Design
@@ -114,4 +119,29 @@
 scope.structured.text.editor.xml.expand.name=XML Source Expand/Collapse
 scope.structured.text.editor.xml.expand.description=XML Source Expand/Collapse
 scope.structured.text.editor.xml.occurrences.name=XML Source Occurrences
-scope.structured.text.editor.xml.occurrences.description=XML Source Occurrences
\ No newline at end of file
+scope.structured.text.editor.xml.occurrences.description=XML Source Occurrences
+
+Colors.tagAttributeName=Tag Attribute Name
+Colors.tagAttributeValue=Tag Attribute Value
+Colors.commentBorder=Comment Border
+Colors.commentText=Comment Text
+Colors.declBorder=Declaration Border
+Colors.doctypeName=Doctype Name
+Colors.doctypeExternalPubref=Doctype External Public Reference
+Colors.doctypeExternalId=Doctype External Id
+Colors.doctypeExtrenalSysref=Doctype External System Reference
+Colors.tagBorder=Tag Border
+Colors.tagName=Tag Name
+Colors.piBorder=Processing Instruction Border
+Colors.cdataBorder=CDATA Border
+Colors.cdataText=CDATA Text
+Colors.entityReference=Entity Reference
+
+# Menu contributions
+command.toggle.comment.mnemonic=T
+command.add.block.comment.mnemonic=A
+command.remove.block.comment.mnemonic=R
+
+# content assist
+proposalCategory.xmlTags=XML Tag Proposals
+proposalCategory.xmlTemplates=XML Template Proposals
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/plugin.xml b/bundles/org.eclipse.wst.xml.ui/plugin.xml
index 7298380..5e25835 100644
--- a/bundles/org.eclipse.wst.xml.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.xml.ui/plugin.xml
@@ -20,6 +20,11 @@
 			description="%_UI_PREF_TAGLIB_DEF_FILES"
 			id="org.eclipse.wst.xml.core.ui.catalogFileType.tld">
 		</fileType>
+		<fileType
+			extensions="xml, cat, xmlcatalog"
+			description="%_UI_PREF_CATALOG_FILES"
+			id="org.eclipse.wst.xml.core.ui.catalogFileType.cat">
+		</fileType>
 	</extension>
 
 	<!--The org.eclipse.wst.xml.core.xmlsource content type is only for
@@ -34,6 +39,9 @@
 		<contentOutlineConfiguration
 			class="org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration"
 			target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
+		<quickOutlineConfiguration
+			class="org.eclipse.wst.xml.ui.internal.quickoutline.XMLQuickOutlineConfiguration"
+			target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
 		<propertySheetConfiguration
 			class="org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration"
 			target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
@@ -54,8 +62,8 @@
 			class="org.eclipse.wst.xml.ui.internal.text.XMLDocumentRegionEdgeMatcher"
 			target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
 		<provisionalConfiguration
-			type="structuredtextfoldingprovider"
-			class="org.eclipse.wst.xml.ui.internal.projection.StructuredTextFoldingProviderXML"
+			type="foldingstrategy"
+			class="org.eclipse.wst.xml.ui.internal.projection.XMLFoldingStrategy"
 			target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
 		<provisionalConfiguration
 			type="org.eclipse.jface.text.quickassist.IQuickAssistProcessor"
@@ -67,7 +75,7 @@
 			target="org.eclipse.wst.xml.XML_DEFAULT" />
 		<provisionalDefinition
 			type="preferencepages"
-			value="org.eclipse.wst.xml.ui.preferences.xml.xml, org.eclipse.wst.sse.ui.preferences.xml.source, org.eclipse.wst.sse.ui.preferences.xml.templates, org.eclipse.wst.sse.ui.preferences.xml.colors"
+			value="org.eclipse.wst.xml.ui.preferences.xml.xml, org.eclipse.wst.sse.ui.preferences.xml.source, org.eclipse.wst.sse.ui.preferences.xml.templates, org.eclipse.wst.sse.ui.preferences.xml.colors, org.eclipse.wst.sse.ui.preferences.xml.contentassist"
 			target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" />
 		<provisionalDefinition
 			type="spellingregions"
@@ -167,7 +175,6 @@
 			class="org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage"
 			id="org.eclipse.wst.xml.ui.preferences.xml.xml">
          	<keywordReference id="org.eclipse.wst.xml.ui.files"/>
-         	<keywordReference id="preferenceKeywords.severities"/>
         </page>
 		<!-- XML PREFERENCE PAGES -->
 		<page
@@ -178,6 +185,13 @@
          	<keywordReference id="org.eclipse.wst.xml.ui.source"/>
 		</page>
 		<page
+			name="%XML_Content_Assist.name"
+			category="org.eclipse.wst.sse.ui.preferences.xml.source"
+			class="org.eclipse.wst.xml.ui.internal.preferences.XMLContentAssistPreferencePage"
+			id="org.eclipse.wst.sse.ui.preferences.xml.contentassist">
+         	<keywordReference id="org.eclipse.wst.xml.ui.contentassist"/>
+		</page>
+		<page
 			name="%XML_Templates.name"
 			category="org.eclipse.wst.sse.ui.preferences.xml.source"
 			class="org.eclipse.wst.xml.ui.internal.preferences.XMLTemplatePreferencePage"
@@ -204,6 +218,13 @@
 			class="org.eclipse.wst.xml.ui.internal.preferences.XMLTypingPreferencePage"
 			id="org.eclipse.wst.sse.ui.preferences.xml.typing">
 		</page>
+    	<page
+            name="%XML_Validator.name"
+            category="org.eclipse.wst.xml.ui.preferences.xml.xml"
+            class="org.eclipse.wst.xml.ui.internal.preferences.XMLValidatorPreferencePage"
+            id="org.eclipse.wst.sse.ui.preferences.xml.validation">
+       	    <keywordReference id="org.eclipse.wst.xml.ui.severities"/>
+    	</page>
 	</extension>
 	
 	<!-- Keywords for preference and properties pages -->
@@ -215,6 +236,9 @@
 			label="%preferenceKeywords.source"
 			id="org.eclipse.wst.xml.ui.source"/>
 		<keyword
+			label="%preferenceKeywords.contentassist"
+			id="org.eclipse.wst.xml.ui.contentassist"/>
+		<keyword
 			label="%preferenceKeywords.templates"
 			id="org.eclipse.wst.xml.ui.templates"/>
 		<keyword
@@ -223,6 +247,9 @@
 		<keyword
 			label="%preferenceKeywords.xmlcatalog"
 			id="org.eclipse.wst.xml.ui.xmlcatalog"/>
+		<keyword
+			label="%preferenceKeywords.severities"
+			id="org.eclipse.wst.xml.ui.severities"/>
     </extension>
 	
 	<!-- Editor actionsets -->
@@ -278,6 +305,7 @@
 			icon="$nl$/icons/xmldoc.gif"
 			contributorClass="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorActionBarContributor"
 			class="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart"
+			symbolicFontName="org.eclipse.wst.sse.ui.textfont"
 			id="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart">
 			<contentTypeBinding
 				contentTypeId="org.eclipse.core.runtime.xml" />
@@ -310,12 +338,12 @@
 	<!-- ================================================== -->
 	<extension point="org.eclipse.ui.newWizards">
 		<category
-			name="%_UI_WIZARD_NEW_XML"
+			name="%_UI_WIZARD_XML_CATEGORY"
 			id="org.eclipse.wst.XMLCategory">
 		</category>
 		<wizard
 			name="%_UI_WIZARD_NEW_XML"
-			icon="$nl$/icons/XMLFile.gif"
+			icon="/icons/full/etool16/new_xml.gif"
 			category="org.eclipse.wst.XMLCategory"
 			class="org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard"
 			id="org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard">
@@ -384,7 +412,7 @@
 	<!-- define the XMLSamples project wizard -->
 	<extension point="org.eclipse.ui.newWizards">
 		<category
-			name="%_UI_WIZARD_NEW_XML"
+			name="%_UI_WIZARD_XML_CATEGORY"
 			parentCategory="org.eclipse.ui.Examples"
 			id="org.eclipse.wst.xml.examples">
 		</category>
@@ -421,6 +449,21 @@
 		</wizard>
 	</extension>
 
+	<extension point="org.eclipse.core.runtime.adapters">
+		<factory
+			adaptableType="org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel"
+			class="org.eclipse.wst.xml.ui.internal.editor.DOMSelectionConvertorFactory">
+			<adapter
+            	type="org.eclipse.wst.sse.ui.internal.editor.SelectionConvertor"/>
+		</factory>
+		<factory
+			adaptableType="org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel"
+			class="org.eclipse.wst.xml.ui.internal.spelling.SpellcheckDelegateAdapterFactory">
+			<adapter
+            	type="org.eclipse.wst.sse.ui.internal.spelling.ISpellcheckDelegate"/>
+		</factory>
+	</extension>
+
 	<!-- initialize xml ui preferences -->
 	<extension point="org.eclipse.core.runtime.preferences">
 		<initializer
@@ -434,31 +477,18 @@
 			id="org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML">
 			<contentTypeIdentifier id="org.eclipse.core.runtime.xml">
 				<partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
+				<partitionType id="org.eclipse.wst.xml.XML_COMMENT"/>
 				<partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
 			</contentTypeIdentifier>
 			<contentTypeIdentifier id="org.eclipse.wst.xml.core.xmlsource">
 				<partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
+				<partitionType id="org.eclipse.wst.xml.XML_COMMENT"/>
 				<partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
 			</contentTypeIdentifier>
 		</validator>
 	</extension>
 	
-	<extension point="org.eclipse.wst.sse.ui.sourcevalidation">
-		<validator
-			scope="partial"
-			class="org.eclipse.wst.xml.ui.internal.validation.MarkupValidator"
-			id="org.eclipse.wst.xml.ui.internal.validation.markupvalidator">
-			<contentTypeIdentifier id="org.eclipse.core.runtime.xml">
-				<partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
-				<partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
-			</contentTypeIdentifier>
-			<contentTypeIdentifier id="org.eclipse.wst.xml.core.xmlsource">
-				<partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
-				<partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
-			</contentTypeIdentifier>
-		</validator>
-	</extension>
-	
+		
    <extension point="org.eclipse.ui.editors.annotationTypes">
       <type name="org.eclipse.wst.xml.ui.matching.tag"/>
    </extension>
@@ -519,31 +549,61 @@
 		</viewerContribution>
 	</extension>
 
-	<!-- ====================================================== -->
-	<!-- An extension for creating nested validation messages.  -->
-	<!-- This extension should be moved when the referenced     -->
-	<!-- files dialog is moved to another plugin.               -->
-	<!-- ====================================================== -->
-	<extension point="org.eclipse.ui.popupMenus">
-		<objectContribution
-			objectClass="org.eclipse.core.resources.IMarker"
-			id="org.eclipse.wst.xml.ui.internal.validation.nestederrorlist"
-			nameFilter="*">
-			<filter
-				name="done"
-				value="true">
-			</filter>
-			<filter
-				name="type"
-				value="org.eclipse.wst.validation.problemmarker">
-			</filter>
-			<action
-				label="%_UI_REF_FILE_SHOW_DETAILS"
-				class="org.eclipse.wst.xml.ui.internal.validation.core.errorinfo.ReferencedFileErrorActionDelegate"
-				id="org.eclipse.wst.xml.ui.internal.validation.core.errorinfo.ReferencedFileErrorActionDelegate">
-			</action>
-		</objectContribution>
+	<!--======================================================================================-->
+	<!-- Pop-up menu and associated command/handler for nested validation messages.           -->
+	<!--======================================================================================-->
+
+	<extension point="org.eclipse.ui.menus">
+      <menuContribution locationURI="popup:org.eclipse.ui.ide.MarkersView">
+          <command commandId="org.eclipse.wst.xml.ui.referencedFileErrors">
+             <visibleWhen checkEnabled="false">
+				<reference definitionId="org.eclipse.wst.xml.ui.referencedFileErrors" />
+             </visibleWhen>
+         </command>
+      </menuContribution>
 	</extension>
+	
+	<extension point="org.eclipse.ui.commands">
+		<command
+			description="%_UI_REF_FILE_SHOW_DETAILS"
+			id="org.eclipse.wst.xml.ui.referencedFileErrors" 
+			name="%_UI_REF_FILE_SHOW_DETAILS" />
+	</extension>
+	
+    <extension point="org.eclipse.ui.handlers">
+       <handler
+             class="org.eclipse.wst.xml.ui.internal.validation.core.errorinfo.ReferencedFileErrorsHandler"
+             commandId="org.eclipse.wst.xml.ui.referencedFileErrors">
+             <enabledWhen>
+				<reference definitionId="org.eclipse.wst.xml.ui.referencedFileErrors" />
+             </enabledWhen>
+       </handler>
+	</extension>
+	
+	<extension point="org.eclipse.core.expressions.propertyTesters">
+	   <propertyTester
+	         class="org.eclipse.wst.xml.ui.internal.validation.core.errorinfo.GroupNamePropertyTester"
+	         id="org.eclipse.wst.xml.ui.markerGroupNamePropertyTester"
+	         namespace="org.eclipse.wst.xml.ui"
+	         properties="groupNamePrefix"
+	         type="org.eclipse.core.resources.IMarker">
+	   </propertyTester>
+	</extension>
+	 
+	<extension point="org.eclipse.core.expressions.definitions">
+		<definition id="org.eclipse.wst.xml.ui.referencedFileErrors">
+                <and>
+                   <count value="1" />
+                   <with variable="selection">
+                   		<iterate operator="or">
+                      		<adapt type="org.eclipse.core.resources.IMarker">
+                            	<test property="org.eclipse.wst.xml.ui.groupNamePrefix" value="referencedFileError" forcePluginActivation="true" />
+                      		</adapt>
+                   		</iterate>
+                	</with>
+                </and>
+		</definition>
+	</extension>	 
 
 <!--	
 	<extension point="org.eclipse.ui.editorActions">
@@ -660,7 +720,7 @@
        point="org.eclipse.ui.importWizards">
     <category
           id="org.eclipse.wst.XMLCategory"
-          name="%_UI_WIZARD_NEW_XML">
+          name="%_UI_WIZARD_XML_CATEGORY">
     </category>
     <wizard
           category="org.eclipse.wst.XMLCategory"
@@ -677,7 +737,7 @@
        point="org.eclipse.ui.exportWizards">
     <category
           id="org.eclipse.wst.XMLCategory"
-          name="%_UI_WIZARD_NEW_XML">
+          name="%_UI_WIZARD_XML_CATEGORY">
     </category>
     <wizard
           category="org.eclipse.wst.XMLCategory"
@@ -868,7 +928,13 @@
            </separator>
         </menu>
      </menuContribution>
-     		
+     <menuContribution locationURI="menu:edit?after=additions">
+		<command commandId="org.eclipse.ui.edit.text.contentAssist.proposals" id="XMLContentAssist" style="push">
+		   <visibleWhen checkEnabled="false">
+				<reference definitionId="org.eclipse.wst.xml.ui.xmlSourceContributions.definition"></reference>
+			</visibleWhen>
+		</command>
+	</menuContribution>		
      <menuContribution
            locationURI="popup:org.eclipse.ui.popup.any?after=additions">
         <menu
@@ -880,20 +946,20 @@
 	              style="push">
 	           <visibleWhen checkEnabled="false">
 	              <or>
-					<iterate>
+					<iterate ifEmpty="false">
 						<adapt
 							type="org.eclipse.core.resources.IFile">
 							<test
-								property="org.eclipse.core.resources.contentTypeId"
+								property="org.eclipse.wst.sse.core.resources.contentTypeId"
                     			value="org.eclipse.wst.xsd.core.xsdsource">
 							</test>
 						</adapt>
 					</iterate>
-					<iterate>
+					<iterate ifEmpty="false">
 						<adapt
 							type="org.eclipse.core.resources.IFile">
 							<test
-								property="org.eclipse.core.resources.contentTypeId"
+								property="org.eclipse.wst.sse.core.resources.contentTypeId"
                     			value="org.eclipse.wst.dtd.core.dtdsource">
 							</test>
 						</adapt>
@@ -937,36 +1003,55 @@
 	              </reference>
 	           </visibleWhen>
            </command>
-           <separator
-                 name="sed.tabletree.separator.2"
-                 visible="true">
-           </separator>
-           <command
-                 commandId="sed.tabletree.expandAll"
-                 icon="icons/full/etool16/expand_all.gif"
-                 id="ExpandAll"
-                 style="push">
-	           <visibleWhen
-	                 checkEnabled="false">
-	              <reference
-	                    definitionId="org.eclipse.wst.xml.ui.expand">
-	              </reference>
-	           </visibleWhen>
-           </command>
-           <command
-                 commandId="sed.tabletree.collapseAll"
-                 icon="icons/full/etool16/collapse_all.gif"
-                 id="CollapseAll"
-                 style="push">
-	             <visibleWhen
-	                 checkEnabled="false">
-	              <reference
-	                    definitionId="org.eclipse.wst.xml.ui.expand">
-	              </reference>
-	           </visibleWhen>
-           </command>
         </toolbar>
      </menuContribution>
+     
+     <menuContribution locationURI="menu:sourceMenuId?after=sourceBegin">
+			<command commandId="org.eclipse.wst.sse.ui.toggle.comment"
+			         id="ToggleComment"
+			         mnemonic="%command.toggle.comment.mnemonic"
+			         style="push">
+				<visibleWhen checkEnabled="false">
+					<reference definitionId="org.eclipse.wst.xml.ui.comments"/>
+				</visibleWhen>
+			</command>
+			<command commandId="org.eclipse.wst.sse.ui.add.block.comment"
+			         id="AddBlockComment"
+			         mnemonic="%command.add.block.comment.mnemonic"
+			         style="push">
+				<visibleWhen checkEnabled="false">
+					<reference definitionId="org.eclipse.wst.xml.ui.comments"/>
+				</visibleWhen>
+			</command>
+			<command commandId="org.eclipse.wst.sse.ui.remove.block.comment"
+			         id="RemoveBlockComment"
+			         mnemonic="%command.remove.block.comment.mnemonic"
+			         style="push">
+				<visibleWhen checkEnabled="false">
+					<reference definitionId="org.eclipse.wst.xml.ui.comments"/>
+				</visibleWhen>
+			</command>
+		</menuContribution>
+		
+		<menuContribution
+	           locationURI="popup:sourcePopupMenuId?after=sourceBegin">
+				<command commandId="org.eclipse.wst.sse.ui.toggle.comment" id="ToggleComment" style="push">
+					<visibleWhen checkEnabled="false">
+						<reference definitionId="org.eclipse.wst.xml.ui.comments"></reference>
+					</visibleWhen>
+				</command>
+				<command commandId="org.eclipse.wst.sse.ui.add.block.comment" id="AddBlockComment" style="push">
+					<visibleWhen checkEnabled="false">
+						<reference definitionId="org.eclipse.wst.xml.ui.comments"></reference>
+					</visibleWhen>
+				</command>
+				<command commandId="org.eclipse.wst.sse.ui.remove.block.comment" id="RemoveBlockComment" style="push">
+					<visibleWhen checkEnabled="false">
+						<reference definitionId="org.eclipse.wst.xml.ui.comments"></reference>
+					</visibleWhen>
+				</command>
+				<separator name="format" visible="true"></separator>
+		</menuContribution>
 	</extension>
 	
 	<extension point="org.eclipse.core.expressions.definitions">
@@ -1285,5 +1370,342 @@
 	          name="%CollapseAll_name">
 	    </command>
 	</extension> 
+	
+	<!-- Define theme -->
+	<extension
+		point="org.eclipse.ui.themes">
+		<theme
+			id="org.eclipse.ui.ide.systemDefault">
+			<colorOverride
+				id="tagAttributeName"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="tagAttributeValue"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="commentBorder"
+				value="COLOR_LIST_SELECTION">
+			</colorOverride>
+			<colorOverride
+				id="commentText"
+				value="COLOR_LIST_SELECTION">
+			</colorOverride>
+			<colorOverride
+				id="declBoder"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="doctypeName"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="doctypeExternalPubref"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="doctypeExternalId"
+				value="COLOR_WIDGET_NORMAL_SHADOW">
+			</colorOverride>
+			<colorOverride
+				id="doctypeExtrenalSysref"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="tagBorder"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="tagName"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="piBorder"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="cdataBorder"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="cdataText"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+			<colorOverride
+				id="entityReference"
+				value="COLOR_LIST_FOREGROUND">
+			</colorOverride>
+		</theme>
+		<colorDefinition
+			id="tagAttributeName"
+			isEditable="false"
+			label="%Colors.tagAttributeName"
+			value="127, 0, 127">
+		</colorDefinition>
+		<colorDefinition
+			id="tagAttributeValue"
+			isEditable="false"
+			label="%Colors.tagAttributeValue"
+			value="42, 0, 255">
+		</colorDefinition>
+		<colorDefinition
+			id="commentBorder"
+			isEditable="false"
+			label="%Colors.commentBorder"
+			value="63, 95, 191">
+		</colorDefinition>
+		<colorDefinition
+			id="commentText"
+			isEditable="false"
+			label="%Colors.commentText"
+			value="63, 95, 191">
+		</colorDefinition>
+		<colorDefinition
+			id="declBoder"
+			isEditable="false"
+			label="%Colors.declBorder"
+			value="0, 128, 128">
+		</colorDefinition>
+		<colorDefinition
+			id="doctypeName"
+			isEditable="false"
+			label="%Colors.doctypeName"
+			value="0, 128, 128">
+		</colorDefinition>
+		<colorDefinition
+			id="doctypeExternalPubref"
+			isEditable="false"
+			label="%Colors.doctypeExternalPubref"
+			value="0, 128, 128">
+		</colorDefinition>
+		<colorDefinition
+			id="doctypeExternalId"
+			isEditable="false"
+			label="%Colors.doctypeExternalId"
+			value="128, 128, 128">
+		</colorDefinition>
+		<colorDefinition
+			id="doctypeExtrenalSysref"
+			isEditable="false"
+			label="%Colors.doctypeExtrenalSysref"
+			value="63, 127, 95">
+		</colorDefinition>
+		<colorDefinition
+			id="tagBorder"
+			isEditable="false"
+			label="%Colors.tagBorder"
+			value="0, 128, 128">
+		</colorDefinition>
+		<colorDefinition
+			id="tagName"
+			isEditable="false"
+			label="%Colors.tagName"
+			value="63, 127, 127">
+		</colorDefinition>
+		<colorDefinition
+			id="piBorder"
+			isEditable="false"
+			label="%Colors.piBorder"
+			value="0, 128, 128">
+		</colorDefinition>
+		<colorDefinition
+			id="cdataBorder"
+			isEditable="false"
+			label="%Colors.cdataBorder"
+			value="0, 128, 128">
+		</colorDefinition>
+		<colorDefinition
+			id="cdataText"
+			isEditable="false"
+			label="%Colors.cdataText"
+			value="0, 0, 0">
+		</colorDefinition>
+		<colorDefinition
+			id="entityReference"
+			isEditable="false"
+			label="%Colors.entityReference"
+			value="42, 0, 255">
+		</colorDefinition>
+	</extension>
+
+	<!-- Enable the FormatHandler for XML Content Type -->
+	<extension point="org.eclipse.ui.handlers">
+		<handler 
+			class="org.eclipse.wst.sse.ui.internal.handlers.FormatHandler"
+			commandId="org.eclipse.wst.sse.ui.format">
+			<activeWhen>
+				<reference definitionId="org.eclipse.wst.xml.ui.xmlContentType.definition"></reference>
+			</activeWhen>
+			<enabledWhen>
+				<reference definitionId="org.eclipse.wst.xml.ui.xmlContentType.definition"></reference>
+			</enabledWhen>
+		</handler>
+	</extension>
+	
+	<!-- Set up a definition for XML Content Types -->
+	<extension point="org.eclipse.core.expressions.definitions">
+		<definition id="org.eclipse.wst.xml.ui.xmlContentType.definition">
+			<or>
+            	<iterate ifEmpty="false">
+					<adapt type="org.eclipse.core.resources.IFile">
+						<!-- Force property tester to load, should not cause entire plug-in to start -->
+						<test property="org.eclipse.wst.sse.core.resources.contentTypeId" 
+							value="org.eclipse.wst.xml.core.xmlsource" forcePluginActivation="true"/>
+					</adapt>
+				</iterate>
+				<iterate ifEmpty="false">
+					<adapt type="org.eclipse.core.resources.IFile">
+						<!-- Force property tester to load, should not cause entire plug-in to start -->
+						<test property="org.eclipse.wst.sse.core.resources.contentTypeId"
+							value="org.eclipse.core.runtime.xml" forcePluginActivation="true"/>
+					</adapt>
+				</iterate>
+			</or>
+		</definition>
+	</extension>
+
+
+
+
+	<extension point="org.eclipse.ui.perspectives">
+		<perspective id="org.eclipse.wst.xml.ui.perspective"
+			class="org.eclipse.wst.xml.ui.internal.perspective.XMLPerspectiveFactory"
+			icon="$nl$/icons/full/xml_perspective.gif" 
+			name="%XML.name"/>
+	</extension>
+	
+ <extension point="org.eclipse.ui.perspectiveExtensions">
+	<perspectiveExtension targetID="org.eclipse.wst.xml.ui.perspective">
+		<!-- ProjectExplorer on the left -->
+		<!--<view id="org.eclipse.ui.navigator.ProjectExplorer" relative="org.eclipse.ui.editorss" relationship="left" ratio="0.23" />-->
+		<!-- XPath on the "bottom" left from its own UI plug-in since neither this bundle nor its owning feature require it -->
+		<!-- Content Outline on the right -->
+		<view id="org.eclipse.ui.views.ContentOutline" relative="org.eclipse.ui.editorss" relationship="right" ratio="0.7" />
+		<!-- Templates on the bottom right -->
+		<view id="org.eclipse.ui.texteditor.TemplatesView" relative="org.eclipse.ui.views.ContentOutline" relationship="bottom" ratio="0.6" />
+		<!-- everything else on the bottom -->
+		<view id="org.eclipse.ui.views.ProblemView" relative="org.eclipse.ui.editorss" relationship="bottom" ratio="0.6" />
+		<view id="org.eclipse.ui.views.PropertySheet" relative="org.eclipse.ui.views.ProblemView" relationship="stack"/>
+		<view id="org.eclipse.ui.console.ConsoleView" relative="org.eclipse.ui.views.ProblemView" relationship="stack" />
+		<view id="org.eclipse.wst.common.snippets.internal.ui.SnippetsView" relative="org.eclipse.ui.views.ProblemView" relationship="stack" />
+		<!-- view placeholders -->
+		<view id="org.eclipse.search.ui.views.SearchView" relative="org.eclipse.ui.views.ProblemView" relationship="stack" visible="false" />
+		<view id="org.eclipse.ui.views.ProgressView" relative="org.eclipse.ui.views.ProblemView" relationship="stack" visible="false" />
+
+		<actionSet id="org.eclipse.debug.ui.launchActionSet"/>
+	
+		<newWizardShortcut id="org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard"/>
+		<newWizardShortcut id="org.eclipse.wst.xsd.ui.internal.wizards.NewXSDWizard"/>
+		<newWizardShortcut id="org.eclipse.wst.dtd.ui.internal.wizard.NewDTDWizard"/>
+		<newWizardShortcut id="org.eclipse.ui.wizards.new.folder"/>
+		<newWizardShortcut id="org.eclipse.ui.wizards.new.file"/>
+		<newWizardShortcut id="org.eclipse.ui.editors.wizards.UntitledTextFileWizard"/>
+
+		<viewShortcut id="org.eclipse.ui.navigator.ProjectExplorer"/>
+		<viewShortcut id="org.eclipse.ui.views.ResourceNavigator"/>
+		<viewShortcut id="org.eclipse.ui.views.ContentOutline"/>
+		<viewShortcut id="org.eclipse.ui.views.PropertySheet"/>
+		<viewShortcut id="org.eclipse.ui.views.ProblemView"/>
+		<viewShortcut id="org.eclipse.ui.console.ConsoleView"/>
+		<viewShortcut id="org.eclipse.ui.views.TaskList"/>
+		<viewShortcut id="org.eclipse.ui.texteditor.TemplatesView"/>
+		<viewShortcut id="org.eclipse.search.ui.views.SearchView"/>
+		<viewShortcut id="org.eclipse.ui.views.ProgressView"/>
+
+		<perspectiveShortcut id="org.eclipse.debug.ui.DebugPerspective"/>
+		<perspectiveShortcut id="org.eclipse.ui.resourcePerspective"/>
+	</perspectiveExtension>
+	
+	<perspectiveExtension targetID="org.eclipse.ui.resourcePerspective">
+		<perspectiveShortcut id="org.eclipse.wst.xml.ui.perspective"/>
+	</perspectiveExtension>
+	<perspectiveExtension targetID="org.eclipse.debug.ui.DebugPerspective">
+		<perspectiveShortcut id="org.eclipse.wst.xml.ui.perspective"/>
+	</perspectiveExtension>
+ </extension>
+
+ <extension point="org.eclipse.ui.navigator.navigatorContent">
+	<commonWizard type="new" wizardId="org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard" menuGroupId="org.eclipse.wst.xml.new.menuGroup">
+		<enablement>
+			<instanceof value="org.eclipse.core.resources.IResource"/>
+			<with variable="activeWorkbenchWindow.activePerspective">
+			   <equals value="org.eclipse.wst.xml.ui.perspective"/>
+			</with>
+		</enablement>
+	</commonWizard>
+ </extension>
+
+ <extension point="org.eclipse.ui.menus" name="%XML.name" id="XML">
+	<menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
+	 <toolbar id="org.eclipse.wst.xml.ui.perspective.NewFileToolBar">
+		<command
+				commandId="org.eclipse.ui.newWizard"
+				icon="$nl$/icons/full/etool16/new_xml.gif"
+				id="org.eclipse.wst.xml.ui.newXMLFile"
+				style="push"
+				tooltip="%XML_New_context_type_Extension_Element.name">
+			 <parameter name="newWizardId" value="org.eclipse.wst.xml.ui.internal.wizards.NewXMLWizard"/>
+          <visibleWhen checkEnabled="false">
+			<with variable="activeWorkbenchWindow.activePerspective">
+				<equals value="org.eclipse.wst.xml.ui.perspective"/>
+			</with>
+           </visibleWhen>         
+        </command>
+       <separator name="additions" visible="false"/>
+      </toolbar> 
+     </menuContribution>
+  </extension>
+ <extension
+       point="org.eclipse.wst.sse.ui.characterPairing">
+    <inserter
+          class="org.eclipse.wst.xml.ui.internal.text.CharacterPairInserter"
+          id="org.eclipse.wst.xml.ui.inserter">
+       <contentTypeIdentifier
+             id="org.eclipse.core.runtime.xml" partitions="org.eclipse.wst.xml.XML_DEFAULT,org.eclipse.wst.xml.XML_DECL">
+       </contentTypeIdentifier>
+       <contentTypeIdentifier
+             id="org.eclipse.wst.xml.core.xmlsource" partitions="org.eclipse.wst.xml.XML_DEFAULT,org.eclipse.wst.xml.XML_DECL">
+       </contentTypeIdentifier>
+    </inserter>
+ </extension>
+ <extension
+       point="org.eclipse.wst.sse.ui.completionProposal">
+    <proposalCategory
+          icon="icons/full/obj16/tag-generic.gif"
+          id="org.eclipse.wst.xml.ui.proposalCategory.xmlTags"
+          name="%proposalCategory.xmlTags">
+    </proposalCategory>
+    <proposalCategory
+          icon="icons/full/obj16/tag-macro.gif"
+          id="org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates"
+          name="%proposalCategory.xmlTemplates">
+    </proposalCategory>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.wst.xml.ui.proposalCategory.xmlTags"
+          class="org.eclipse.wst.xml.ui.internal.contentassist.XMLTagsCompletionProposalComputer"
+          id="org.eclipse.wst.xml.ui.proposalComputer.xmlTags">
+       <contentType
+             id="org.eclipse.core.runtime.xml">
+       </contentType>
+    </proposalComputer>
+    <proposalComputer
+          activate="false"
+          categoryId="org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates"
+          class="org.eclipse.wst.xml.ui.internal.contentassist.XMLTemplatesCompletionProposalComputer"
+          id="org.eclipse.wst.xml.ui.proposalComputer.xmlTemplates">
+       <contentType
+             id="org.eclipse.core.runtime.xml">
+       </contentType>
+    </proposalComputer>
+ </extension>
+ <extension
+       point="org.eclipse.wst.sse.ui.completionProposalCategoriesConfiguration">
+    <categoriesConfiguration
+          class="org.eclipse.wst.xml.ui.internal.preferences.XMLCompletionProposalCategoriesConfiguration"
+          contentTypeID="org.eclipse.core.runtime.xml">
+    </categoriesConfiguration>
+ </extension>
 
 </plugin>
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/CatalogFileTypeRegistryReader.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/CatalogFileTypeRegistryReader.java
index 6165312..85b57d3 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/CatalogFileTypeRegistryReader.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/CatalogFileTypeRegistryReader.java
@@ -62,7 +62,7 @@
 					fileType = new XMLCatalogFileType();
 					hashMap.put(id, fileType);
 				}
-
+				fileType.id = id;
 				if (fileType.description == null) {
 					String description = element.getAttribute(ATT_DESCRIPTION);
 					fileType.description = description;
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/EditCatalogEntryDialog.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/EditCatalogEntryDialog.java
index d426ff8..578e8a8 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/EditCatalogEntryDialog.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/EditCatalogEntryDialog.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
+ * Copyright (c) 2002, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -22,12 +22,10 @@
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
@@ -40,8 +38,6 @@
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.swt.widgets.ToolBar;
@@ -51,20 +47,28 @@
 import org.eclipse.wst.common.ui.internal.dialogs.SelectSingleFileDialog;
 import org.eclipse.wst.common.uriresolver.internal.URI;
 import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.IDelegateCatalog;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.IRewriteEntry;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ISuffixEntry;
 
 public class EditCatalogEntryDialog extends Dialog {
 	protected static Image borwseImage = ImageFactory.INSTANCE.getImage("icons/obj16/file_expand.gif"); //$NON-NLS-1$
 	protected static Image catalogEntryToolBarImage = ImageFactory.INSTANCE.getImage("icons/etool50/catalogEntry.gif"); //$NON-NLS-1$
 	protected static Image nextCatalogToolBarImage = ImageFactory.INSTANCE.getImage("icons/etool50/nextCatalog.gif"); //$NON-NLS-1$
-
+	protected static Image delegateCatalogToolBarImage = ImageFactory.INSTANCE.getImage("icons/etool50/delegateCatalog.gif"); //$NON-NLS-1$
+	protected static Image rewriteToolBarImage = ImageFactory.INSTANCE.getImage("icons/etool50/rewrite.gif"); //$NON-NLS-1$
+	protected static Image prefixToolBarImage = ImageFactory.INSTANCE.getImage("icons/etool50/prefix.gif"); //$NON-NLS-1$
+	protected static Image suffixToolBarImage = ImageFactory.INSTANCE.getImage("icons/etool50/sufix.gif"); //$NON-NLS-1$
+	
 	protected class CatalogEntryPage extends CatalogElementPage {
 
-		protected Button browseButton;
+		protected Button browseWorkspaceButton;
+		
+		protected Button browseFileSystemButton;
 
 		protected ICatalogEntry catalogEntry;
 
@@ -85,41 +89,45 @@
 		protected String key;
 		
 		protected int type;
+		
+		public void refresh() {
+			computeErrorMessage();
+			updateErrorMessageLabel(errorMessageLabel);
+			updateOKButtonState();
+		}
 
 		protected void computeErrorMessage() {
 			errorMessage = null;
 			warningMessage = null;
 
-			if (errorMessage == null) {
-				String fileName = resourceLocationField.getText();
-				if (fileName.trim().length() > 0) {
-					if ((fileName.indexOf("..") != -1) || (fileName.indexOf("./") != -1) || (fileName.indexOf("/.") != -1) || (fileName.indexOf(".\\") != -1) || (fileName.indexOf("\\.") != -1)) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-						errorMessage = XMLCatalogMessages.UI_WARNING_URI_MUST_NOT_HAVE_DOTS;
-					}
-
-					String uri = fileName;
-					if (!URIHelper.hasProtocol(uri)) {
-						URIHelper.isAbsolute(uri);
-						uri = (URIHelper.isAbsolute(uri)) ? URIHelper.prependFileProtocol(uri) : URIHelper.prependPlatformResourceProtocol(uri);
-					}
-
-					if ((errorMessage == null) && !URIHelper.isReadableURI(uri, false)) {
-						errorMessage = XMLCatalogMessages.UI_WARNING_URI_NOT_FOUND_COLON + fileName;
-					}
-				}
-				else {
-					// this an error that is not actaully
-					// reported ... OK is just disabled
-					errorMessage = ""; //$NON-NLS-1$
+			String fileName = resourceLocationField.getText();
+			if (fileName.trim().length() > 0) {
+				if ((fileName.indexOf("..") != -1) || (fileName.indexOf("./") != -1) || (fileName.indexOf("/.") != -1) || (fileName.indexOf(".\\") != -1) || (fileName.indexOf("\\.") != -1)) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+					errorMessage = XMLCatalogMessages.UI_WARNING_URI_MUST_NOT_HAVE_DOTS;
 				}
 
-				// Make sure the key is a fully qualified URI in the cases
-				// where the key type is "System ID" or "Schema location"
-				if ((keyField.getText().length() > 0) && (getKeyType() == ICatalogEntry.ENTRY_TYPE_SYSTEM)) {
-					URI uri = URI.createURI(keyField.getText());
-					if (uri.scheme() == null) {
-						warningMessage = XMLCatalogMessages.UI_WARNING_SHOULD_BE_FULLY_QUALIFIED_URI;
-					}
+				String uri = fileName;
+				if (!URIHelper.hasProtocol(uri)) {
+					URIHelper.isAbsolute(uri);
+					uri = (URIHelper.isAbsolute(uri)) ? URIHelper.prependFileProtocol(uri) : URIHelper.prependPlatformResourceProtocol(uri);
+				}
+
+				if ((errorMessage == null) && !URIHelper.isReadableURI(uri, false)) {
+					errorMessage = XMLCatalogMessages.UI_WARNING_URI_NOT_FOUND_COLON + fileName;
+				}
+			}
+			else {
+				// this an error that is not actaully
+				// reported ... OK is just disabled
+				errorMessage = ""; //$NON-NLS-1$
+			}
+
+			// Make sure the key is a fully qualified URI in the cases
+			// where the key type is "System ID" or "Schema location"
+			if ((keyField.getText().length() > 0) && (getKeyType() == ICatalogEntry.ENTRY_TYPE_SYSTEM)) {
+				URI uri = URI.createURI(keyField.getText());
+				if (uri.scheme() == null) {
+					warningMessage = XMLCatalogMessages.UI_WARNING_SHOULD_BE_FULLY_QUALIFIED_URI;
 				}
 			}
 
@@ -168,7 +176,7 @@
 			gd = new GridData(GridData.FILL_HORIZONTAL);
 			group.setLayoutData(gd);
 
-			layout = new GridLayout(3, false);
+			layout = new GridLayout(2, false);
 			group.setLayout(layout);
 
 			Label resourceLocationLabel = new Label(group, SWT.NONE);
@@ -186,18 +194,58 @@
 			// XMLBuilderContextIds.XMLP_ENTRY_URI);
 			resourceLocationField.addModifyListener(modifyListener);
 
-
-			browseButton = createBrowseButton(group);
 			// WorkbenchHelp.setHelp(browseButton,
 			// XMLBuilderContextIds.XMLP_ENTRY_BROWSE);
-			browseButton.addSelectionListener(new DropDownSelectionListener(resourceLocationField));
 
+			Composite browseButtonsComposite = new Composite(group, SWT.NONE);
+			gd = new GridData(GridData.FILL_HORIZONTAL);
+			gd.horizontalSpan = 2;
+			gd.horizontalAlignment = GridData.END;
+			browseButtonsComposite.setLayoutData(gd);
+			
+			layout = new GridLayout();
+			layout.numColumns = 2;
+			layout.marginWidth = 0;
+			layout.marginHeight = 0;
+			layout.marginBottom = 5;
+			browseButtonsComposite.setLayout(layout);
+			
+			browseWorkspaceButton = new Button(browseButtonsComposite, SWT.PUSH);
+			browseWorkspaceButton.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_WORKSPACE);
+			browseWorkspaceButton.addSelectionListener(new SelectionListener(){
+
+				public void widgetDefaultSelected(SelectionEvent e) {
+				}
+
+				public void widgetSelected(SelectionEvent e) {
+					String value = invokeWorkspaceFileSelectionDialog();
+					if(value != null) {
+						resourceLocationField.setText(value);
+					}
+				}
+			});
+			
+			browseFileSystemButton = new Button(browseButtonsComposite, SWT.PUSH);
+			browseFileSystemButton.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_FILE_SYSTEM);
+			browseFileSystemButton.addSelectionListener(new SelectionListener(){
+
+				public void widgetDefaultSelected(SelectionEvent e) {
+				}
+
+				public void widgetSelected(SelectionEvent e) {
+					String value = invokeFileSelectionDialog();
+					if(value != null) {
+						resourceLocationField.setText(value);
+					}
+				}
+			});
+			
 			// Key Type
 			//
 			Label keyTypeLabel = new Label(group, SWT.NONE);
 			keyTypeLabel.setText(XMLCatalogMessages.UI_KEY_TYPE_COLON);
 
-			keyTypeCombo = new Combo(group, SWT.NONE);
+			keyTypeCombo = new Combo(group, SWT.READ_ONLY);
 			gd = new GridData();
 			gd.horizontalAlignment = SWT.FILL;
 			gd.grabExcessHorizontalSpace = true;
@@ -207,10 +255,6 @@
 			// WorkbenchHelp.setHelp(keyTypeCombo,
 			// XMLBuilderContextIds.XMLP_ENTRY_KEY_TYPE);
 
-			// a placeholder to fill the 3rd column
-			Button placeHolder = new Button(group, SWT.NONE);
-			placeHolder.setVisible(false);
-
 			// Key
 			// 
 			Label keyValueLabel = new Label(group, SWT.NONE);
@@ -352,40 +396,17 @@
 			String result = null;
 			if (key == null || !key.equals(keyField.getText()) || type != getKeyType())
 			{
-				// get system catalog
-				ICatalog systemCatalog = null;			
-				ICatalog defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
-				INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs();
-				for (int i = 0; i < nextCatalogs.length; i++) {
-					INextCatalog catalog = nextCatalogs[i];
-					ICatalog referencedCatalog = catalog.getReferencedCatalog();
-					if (referencedCatalog != null) {
-						if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) {
-							systemCatalog = referencedCatalog;
-						}
-					}
-				}
-				
 				try {
 					switch( getKeyType() )
 					{
 					case ICatalogEntry.ENTRY_TYPE_PUBLIC:
 						result = catalog.resolvePublic(keyField.getText(), null);		
-						if (result == null) {
-							result = systemCatalog.resolvePublic(keyField.getText(), null);
-						}
 						break;
 					case ICatalogEntry.ENTRY_TYPE_SYSTEM:
 						result = catalog.resolveSystem(keyField.getText());
-						if (result == null) {
-							result = systemCatalog.resolveSystem(keyField.getText());
-						}
 						break;
 					case ICatalogEntry.ENTRY_TYPE_URI:
 						result = catalog.resolveURI(keyField.getText());
-						if (result == null) {
-							result = systemCatalog.resolveURI(keyField.getText());
-						}
 						break;
 					}
 				}
@@ -404,12 +425,12 @@
 					for (Iterator j = theFileType.extensions.iterator(); j.hasNext();) {
 						String extension = (String) j.next();
 						if (resourceLocationField.getText().endsWith(extension)) {
-							if (theFileType.description.equals("XSD Files")) { //$NON-NLS-1$
+							if ("org.eclipse.wst.xml.core.ui.catalogFileType.xsd".equals(theFileType.id)) { //$NON-NLS-1$
 								keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_XSD_PUBLIC);
 								keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_XSD_SYSTEM);
 								keyTypeCombo.setData("keyType", "schema"); //$NON-NLS-1$ //$NON-NLS-2$
 							}
-							else if (theFileType.description.equals("DTD Files")) { //$NON-NLS-1$
+							else if ("org.eclipse.wst.xml.core.ui.catalogFileType.dtd".equals(theFileType.id)) { //$NON-NLS-1$
 								keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_PUBLIC);
 								keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM);
 								keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI);
@@ -474,6 +495,315 @@
 
 	}
 
+	protected class SuffixEntryPage extends CatalogElementPage {
+	
+		protected Button browseWorkspaceButton;
+		
+		protected Button browseFileSystemButton;
+	
+		protected ISuffixEntry catalogEntry;
+	
+		protected Label errorMessageLabel;
+	
+		protected Text suffixField;
+	
+		protected Combo keyTypeCombo;
+	
+		protected Text resourceLocationField;
+	
+		protected Combo resourceTypeCombo;
+
+		protected String key;
+		
+		protected int type;
+		
+		public void refresh() {
+			computeErrorMessage();
+			updateErrorMessageLabel(errorMessageLabel);
+			updateOKButtonState();
+		}
+	
+		protected void computeErrorMessage() {
+			errorMessage = null;
+			warningMessage = null;
+	
+			String fileName = resourceLocationField.getText();
+			if (fileName.trim().length() > 0) {
+				if ((fileName.indexOf("..") != -1) || (fileName.indexOf("./") != -1) || (fileName.indexOf("/.") != -1) || (fileName.indexOf(".\\") != -1) || (fileName.indexOf("\\.") != -1)) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+					errorMessage = XMLCatalogMessages.UI_WARNING_URI_MUST_NOT_HAVE_DOTS;
+				}
+
+				String uri = fileName;
+				if (!URIHelper.hasProtocol(uri)) {
+					URIHelper.isAbsolute(uri);
+					uri = (URIHelper.isAbsolute(uri)) ? URIHelper.prependFileProtocol(uri) : URIHelper.prependPlatformResourceProtocol(uri);
+				}
+
+				if ((errorMessage == null) && !URIHelper.isReadableURI(uri, false)) {
+					errorMessage = XMLCatalogMessages.UI_WARNING_URI_NOT_FOUND_COLON + fileName;
+				}
+			}
+			else {
+				// this an error that is not actaully
+				// reported ... OK is just disabled
+				errorMessage = ""; //$NON-NLS-1$
+			}
+
+	
+			if ((errorMessage == null) && (suffixField.getText().trim().length() == 0)) {
+				// this an error that is not actaully
+				// reported ... OK is just disabled
+				errorMessage = ""; //$NON-NLS-1$
+			}
+		}
+	
+		protected Control createSuffixEntryPanel(Composite parent) {
+	
+			ModifyListener modifyListener = new ModifyListener() {
+				public void modifyText(ModifyEvent e) {
+					if (e.widget == resourceLocationField) {
+						if (suffixField.getText().length() == 0) {
+							String uri = resourceLocationField.getText();
+							if (uri.endsWith("xsd") && !URIHelper.hasProtocol(uri)) { //$NON-NLS-1$
+								uri = URIHelper.isAbsolute(uri) ? URIHelper.prependFileProtocol(uri) : URIHelper.prependPlatformResourceProtocol(uri);
+								String namespaceURI = XMLQuickScan.getTargetNamespaceURIForSchema(uri);
+								if (namespaceURI != null) {
+									suffixField.setText(namespaceURI);
+								}
+							}
+						}
+					}
+					updateWidgets(e.widget);
+				}
+			};
+	
+			Composite composite = new Composite(parent, SWT.NONE);
+			GridData gd = new GridData(GridData.FILL_BOTH);
+			composite.setLayoutData(gd);
+	
+			GridLayout layout = new GridLayout();
+			composite.setLayout(layout);
+	
+			Composite group = new Composite(composite, SWT.NONE);
+			gd = new GridData(GridData.FILL_HORIZONTAL);
+			group.setLayoutData(gd);
+	
+			layout = new GridLayout(2, false);
+			group.setLayout(layout);
+	
+			Label resourceLocationLabel = new Label(group, SWT.NONE);
+			resourceLocationLabel.setText(XMLCatalogMessages.UI_LABEL_LOCATION_COLON);
+	
+			resourceLocationField = new Text(group, SWT.SINGLE | SWT.BORDER);
+			gd = new GridData();
+			gd.horizontalAlignment = SWT.FILL;
+			gd.grabExcessHorizontalSpace = true;
+			resourceLocationField.setLayoutData(gd);
+	
+			resourceLocationField.setText(getDisplayValue(URIUtils.convertURIToLocation(getEntry().getURI())));
+			resourceLocationField.addModifyListener(modifyListener);
+		
+			Composite browseButtonsComposite = new Composite(group, SWT.NONE);
+			gd = new GridData(GridData.FILL_HORIZONTAL);
+			gd.horizontalSpan = 2;
+			gd.horizontalAlignment = GridData.END;
+			browseButtonsComposite.setLayoutData(gd);
+			
+			layout = new GridLayout();
+			layout.numColumns = 2;
+			layout.marginWidth = 0;
+			layout.marginHeight = 0;
+			layout.marginBottom = 5;
+			browseButtonsComposite.setLayout(layout);
+			
+			browseWorkspaceButton = new Button(browseButtonsComposite, SWT.PUSH);
+			browseWorkspaceButton.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_WORKSPACE);
+			browseWorkspaceButton.addSelectionListener(new SelectionListener(){
+	
+				public void widgetDefaultSelected(SelectionEvent e) {
+				}
+	
+				public void widgetSelected(SelectionEvent e) {
+					String value = invokeWorkspaceFileSelectionDialog();
+					if(value != null) {
+						resourceLocationField.setText(value);
+					}
+				}
+			});
+			
+			browseFileSystemButton = new Button(browseButtonsComposite, SWT.PUSH);
+			browseFileSystemButton.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_FILE_SYSTEM);
+			browseFileSystemButton.addSelectionListener(new SelectionListener(){
+	
+				public void widgetDefaultSelected(SelectionEvent e) {
+				}
+	
+				public void widgetSelected(SelectionEvent e) {
+					String value = invokeFileSelectionDialog();
+					if(value != null) {
+						resourceLocationField.setText(value);
+					}
+				}
+			});
+			
+			// Key Type
+			//
+			Label keyTypeLabel = new Label(group, SWT.NONE);
+			keyTypeLabel.setText(XMLCatalogMessages.UI_KEY_TYPE_COLON);
+	
+			keyTypeCombo = new Combo(group, SWT.READ_ONLY);
+			gd = new GridData();
+			gd.horizontalAlignment = SWT.FILL;
+			gd.grabExcessHorizontalSpace = true;
+			keyTypeCombo.setLayoutData(gd);
+			updateKeyTypeCombo(getEntry().getEntryType());
+			keyTypeCombo.addModifyListener(modifyListener);
+	
+			// Suffix
+			// 
+			Label suffixValueLabel = new Label(group, SWT.NONE);
+			suffixValueLabel.setText(XMLCatalogMessages.UI_LABEL_SUFFIX_COLON);
+			suffixField = new Text(group, SWT.SINGLE | SWT.BORDER);
+
+			suffixField.setLayoutData(gd);
+			suffixField.setText(getDisplayValue(getEntry().getSuffix()));
+			suffixField.addModifyListener(modifyListener);
+		
+			errorMessageLabel = new Label(composite, SWT.NONE);
+			errorMessageLabel.setForeground(color);
+			errorMessageLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+	
+			updateWidgets(null);
+			
+			key = getEntry().getSuffix();
+			type = getEntry().getEntryType();
+	
+			return composite;
+		}
+	
+		public Control createControl(Composite parent) {
+	
+			fControl = createSuffixEntryPanel(parent);
+	
+			return fControl;
+		}
+	
+	
+		public ICatalogElement getData() {
+			return getEntry();
+		}
+	
+		protected ISuffixEntry getEntry() {
+			if (catalogEntry == null) {
+				if ((fCatalogElement != null) && (fCatalogElement.getType() == ICatalogElement.TYPE_SUFFIX)) {
+					catalogEntry = (ISuffixEntry) fCatalogElement;
+				}
+				else {
+					if (catalog != null) {
+						catalogEntry = (ISuffixEntry) catalog.createCatalogElement(ICatalogElement.TYPE_SUFFIX);
+					}
+				}
+			}
+			return catalogEntry;
+		}
+	
+		protected int getKeyType() {
+			switch (keyTypeCombo.getSelectionIndex()) {
+				case 0 :
+					return ISuffixEntry.SUFFIX_TYPE_URI; // xsd namespace is URI type key
+				case 1 :
+					return ISuffixEntry.SUFFIX_TYPE_SYSTEM;
+				default :
+					return ISuffixEntry.SUFFIX_TYPE_URI;
+			}
+		}
+	
+		public void saveData() {
+			if (validateData()) {
+				getEntry().setURI(URIUtils.convertLocationToURI(resourceLocationField.getText()));
+				getEntry().setSuffix(suffixField.getText());
+				getEntry().setEntryType(getKeyType());
+				dataSaved = true;
+			}
+			else {
+				errorMessage = XMLCatalogMessages.UI_WARNING_DUPLICATE_SUFFIX;
+				errorMessageLabel.setText(errorMessage);
+				updateOKButtonState();
+				dataSaved = false;
+			}
+		}
+		
+		protected boolean validateData() {
+			ISuffixEntry entry = getEntry();
+			String uri = URIUtils.convertLocationToURI(resourceLocationField.getText());
+			if(entry.getEntryType() != getKeyType() || !entry.getSuffix().equals(suffixField.getText()) || !entry.getURI().equals(uri)) {
+				ISuffixEntry[] entries = catalog.getSuffixEntries();
+				for (int i = 0; i < entries.length; i++) {
+					if (entries[i].getSuffix().equals(suffixField.getText()) && entries[i].getEntryType() == getKeyType()) return false;
+				}
+			}
+			return true;
+		}
+	
+		protected void updateKeyTypeCombo(int type) {
+			keyTypeCombo.removeAll();
+			for (Iterator i = CatalogFileTypeRegistryReader.getXMLCatalogFileTypes().iterator(); i.hasNext();) {
+				XMLCatalogFileType theFileType = (XMLCatalogFileType) i.next();
+				if (theFileType.extensions != null) {
+					for (Iterator j = theFileType.extensions.iterator(); j.hasNext();) {
+						String extension = (String) j.next();
+						if (resourceLocationField.getText().endsWith(extension)) {
+							if ("org.eclipse.wst.xml.core.ui.catalogFileType.xsd".equals(theFileType.id)) { //$NON-NLS-1$
+								keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_XSD_PUBLIC);
+								keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_XSD_SYSTEM);
+							}
+							else if ("org.eclipse.wst.xml.core.ui.catalogFileType.dtd".equals(theFileType.id)) { //$NON-NLS-1$
+								keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI);
+								keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM);
+							}
+							else {
+								keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI);
+							}
+						}
+	
+					}
+	
+				}
+			}
+			if (keyTypeCombo.getItemCount() == 0) {
+				keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI);
+				keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM);
+			}
+	
+			switch (type) {
+				case ISuffixEntry.SUFFIX_TYPE_URI: // handle XML Schema,
+					keyTypeCombo.select(0); // namespace name as URI key
+					break;
+
+				case ISuffixEntry.SUFFIX_TYPE_SYSTEM :
+					keyTypeCombo.select(1);
+					break;
+
+				default :
+					if (keyTypeCombo.getItemCount() > 0) {
+						keyTypeCombo.select(0);
+					}
+					break;
+			}
+	
+		}
+		
+		protected void updateWidgets(Widget widget) {
+			if (widget != keyTypeCombo) {
+				updateKeyTypeCombo(getKeyType());
+			}
+			computeErrorMessage();
+			updateErrorMessageLabel(errorMessageLabel);
+			updateOKButtonState();
+		}
+	
+	}
+
 	protected abstract class CatalogElementPage {
 
 		Control fControl;
@@ -482,6 +812,8 @@
 			super();
 
 		}
+		
+		public abstract void refresh();
 
 		public abstract Control createControl(Composite parent);
 
@@ -515,7 +847,7 @@
 			Label label = new Label(composite, SWT.NONE);
 			label.setText(XMLCatalogMessages.UI_LABEL_SELECT_FILE_FILTER_CONTROL);
 
-			filterControl = new Combo(composite, SWT.NONE);
+			filterControl = new Combo(composite, SWT.READ_ONLY);
 			GridData gd = new GridData(GridData.FILL_HORIZONTAL);
 			filterControl.setLayoutData(gd);
 
@@ -529,6 +861,7 @@
 				}
 			}
 
+			filterControl.select(0);
 			filterControl.addSelectionListener(this);
 		}
 
@@ -543,7 +876,7 @@
 					}
 				}
 				// Any files are now supported with Resource URI
-				// selectSingleFileView.setFilterExtensions(createStringArray(list));
+				selectSingleFileView.setFilterExtensions(createStringArray(list));
 			}
 			else {
 				if (fileType.extensions != null) {
@@ -563,49 +896,44 @@
 		}
 	}
 
-	protected class NextCatalogPage extends CatalogElementPage {
-		protected Button browseButton;
-
+	protected abstract class AbstractDelegatePage extends CatalogElementPage {
+	
+		
+		protected Button browseWorkspaceButton;
+		
+		protected Button browseFileSystemButton;
+		
 		protected Text catalogLocationField;
 
-		protected INextCatalog nextCatalog;
-
 		protected Label errorMessageLabel;
 
 		protected void computeErrorMessage() {
 			errorMessage = null;
-
-			if (errorMessage == null) {
-				String fileName = catalogLocationField.getText();
-				if (fileName.trim().length() > 0) {
-					if ((fileName.indexOf("..") != -1) || (fileName.indexOf("./") != -1) || (fileName.indexOf("/.") != -1) || (fileName.indexOf(".\\") != -1) || (fileName.indexOf("\\.") != -1)) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-						errorMessage = XMLCatalogMessages.UI_WARNING_URI_MUST_NOT_HAVE_DOTS;
-					}
-
-					String uri = fileName;
-					if (!URIHelper.hasProtocol(uri)) {
-						uri = URIHelper.isAbsolute(uri) ? URIHelper.prependFileProtocol(uri) : URIHelper.prependPlatformResourceProtocol(uri);
-					}
-
-					if ((errorMessage == null) && !URIHelper.isReadableURI(uri, false)) {
-						errorMessage = XMLCatalogMessages.UI_WARNING_URI_NOT_FOUND_COLON + fileName;
-					}
+			String fileName = catalogLocationField.getText();
+			if (fileName.trim().length() > 0) {
+				if ((fileName.indexOf("..") != -1) || (fileName.indexOf("./") != -1) || (fileName.indexOf("/.") != -1) || (fileName.indexOf(".\\") != -1) || (fileName.indexOf("\\.") != -1)) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+					errorMessage = XMLCatalogMessages.UI_WARNING_URI_MUST_NOT_HAVE_DOTS;
 				}
-				else {
-					// this an error that is not actually
-					// reported ... OK is just disabled
-					errorMessage = ""; //$NON-NLS-1$
+
+				String uri = fileName;
+				if (!URIHelper.hasProtocol(uri)) {
+					uri = URIHelper.isAbsolute(uri) ? URIHelper.prependFileProtocol(uri) : URIHelper.prependPlatformResourceProtocol(uri);
+				}
+
+				if ((errorMessage == null) && !URIHelper.isReadableURI(uri, false)) {
+					errorMessage = XMLCatalogMessages.UI_WARNING_URI_NOT_FOUND_COLON + fileName;
 				}
 			}
-
+			else {
+				// this an error that is not actually
+				// reported ... OK is just disabled
+				errorMessage = ""; //$NON-NLS-1$
+			}
 		}
 
-		public Control createControl(Composite parent) {
-			fControl = createNextCatalogPanel(parent);
-			return fControl;
-		}
+		public abstract Control createControl(Composite parent);
 
-		protected Control createNextCatalogPanel(Composite parent) {
+		protected Control createNextCatalogPanel(Composite parent, String catalogUriLabel) {
 			ModifyListener modifyListener = new ModifyListener() {
 				public void modifyText(ModifyEvent e) {
 					updateWidgets(e.widget);
@@ -623,24 +951,63 @@
 			gd = new GridData(GridData.FILL_HORIZONTAL);
 			group.setLayoutData(gd);
 
-			layout = new GridLayout(2, false);
+			layout = new GridLayout();
 			group.setLayout(layout);
 
+			createSpecificFields(group);
+			
 			Label resourceLocationLabel = new Label(group, SWT.NONE);
-			resourceLocationLabel.setText(XMLCatalogMessages.UI_LABEL_CATALOG_URI_COLON);
-
-			// filler
-			new Label(group, SWT.NONE);
+			resourceLocationLabel.setText(catalogUriLabel);
 
 			catalogLocationField = new Text(group, SWT.SINGLE | SWT.BORDER);
 			catalogLocationField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-			catalogLocationField.setText(URIUtils.convertURIToLocation(getDisplayValue(getNextCatalog().getCatalogLocation())));
+			catalogLocationField.setText(URIUtils.convertURIToLocation(getDisplayValue(getCatalogLocation())));
 			// WorkbenchHelp.setHelp(resourceLocationField,
 			// XMLBuilderContextIds.XMLP_ENTRY_URI);
 			catalogLocationField.addModifyListener(modifyListener);
+			
+			Composite browseButtonsComposite = new Composite(group, SWT.FLAT);
+			gd = new GridData(GridData.FILL_HORIZONTAL);
+			gd.horizontalSpan = 2;
+			gd.horizontalAlignment = GridData.END;
+			browseButtonsComposite.setLayoutData(gd);
+			
+			layout = new GridLayout();
+			layout.numColumns = 2;
+			layout.marginWidth = 0;
+			layout.marginHeight = 0;
+			layout.marginBottom = 5;
+			browseButtonsComposite.setLayout(layout);
+			
+			browseWorkspaceButton = new Button(browseButtonsComposite, SWT.PUSH);
+			browseWorkspaceButton.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_WORKSPACE);
+			browseWorkspaceButton.addSelectionListener(new SelectionListener(){
 
-			browseButton = createBrowseButton(group);
-			browseButton.addSelectionListener(new DropDownSelectionListener(catalogLocationField));
+				public void widgetDefaultSelected(SelectionEvent e) {
+				}
+
+				public void widgetSelected(SelectionEvent e) {
+					String value = invokeWorkspaceFileSelectionDialog();
+					if(value != null) {
+						catalogLocationField.setText(value);
+					}
+				}
+			});
+			
+			browseFileSystemButton = new Button(browseButtonsComposite, SWT.PUSH);
+			browseFileSystemButton.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_FILE_SYSTEM);
+			browseFileSystemButton.addSelectionListener(new SelectionListener(){
+
+				public void widgetDefaultSelected(SelectionEvent e) {
+				}
+
+				public void widgetSelected(SelectionEvent e) {
+					String value = invokeFileSelectionDialog();
+					if(value != null) {
+						catalogLocationField.setText(value);
+					}
+				}
+			});
 
 			errorMessageLabel = new Label(group, SWT.NONE);
 			errorMessageLabel.setForeground(color);
@@ -649,9 +1016,30 @@
 			return composite;
 		}
 
+		protected void createSpecificFields(Composite group) {
+		}
+
+		protected abstract String getCatalogLocation();
+
+		protected void updateWidgets(Widget widget) {
+			computeErrorMessage();
+			updateErrorMessageLabel(errorMessageLabel);
+			updateOKButtonState();
+		}
+	}
+
+	protected class NextCatalogPage extends AbstractDelegatePage {
+		protected INextCatalog nextCatalog;
+
 		public ICatalogElement getData() {
 			return getNextCatalog();
 		}
+		
+		public void refresh() {
+			computeErrorMessage();
+			updateErrorMessageLabel(errorMessageLabel);
+			updateOKButtonState();
+		}
 
 		protected INextCatalog getNextCatalog() {
 			if (nextCatalog == null) {
@@ -669,6 +1057,226 @@
 
 		public void saveData() {
 			getNextCatalog().setCatalogLocation(URIUtils.convertLocationToURI(catalogLocationField.getText()));
+			dataSaved = true;
+		}
+
+		protected String getCatalogLocation() {
+			return getNextCatalog().getCatalogLocation();
+		}
+		
+		public Control createControl(Composite parent) {
+			fControl = createNextCatalogPanel(parent, XMLCatalogMessages.UI_LABEL_CATALOG_URI_COLON);
+			return fControl;
+		}
+	}
+
+	protected class DelegateCatalogPage extends AbstractDelegatePage {
+		protected IDelegateCatalog delegateCatalog;
+		private Text prefixField;
+		private Combo keyTypeCombo;
+		
+		public void refresh() {
+			computeErrorMessage();
+			updateErrorMessageLabel(errorMessageLabel);
+			updateOKButtonState();
+		}
+
+		protected void computeErrorMessage() {
+			errorMessage = null;
+			String prefix = prefixField.getText();
+			if(prefix.length() > 0) {
+				// good
+			} else {
+				errorMessage = "";
+			}
+		}
+		
+		public ICatalogElement getData() {
+			return getDelegateCatalog();
+		}
+
+		protected void createSpecificFields(Composite group) {
+			
+			Composite prefixComposite = new Composite(group, SWT.NONE);
+			
+			GridLayout layout = new GridLayout();
+			layout.numColumns = 2;
+			layout.marginWidth = 0;
+			layout.marginHeight = 0;
+			layout.marginBottom = 5;
+			prefixComposite.setLayout(layout);
+			
+			// Key Type
+			//
+			Label keyTypeLabel = new Label(prefixComposite, SWT.NONE);
+			keyTypeLabel.setText(XMLCatalogMessages.UI_MATCH_KEY_TYPE_COLON);
+	
+			keyTypeCombo = new Combo(prefixComposite, SWT.READ_ONLY);
+			GridData gd = new GridData();
+			gd.horizontalAlignment = SWT.FILL;
+			gd.grabExcessHorizontalSpace = true;
+			keyTypeCombo.setLayoutData(gd);
+			keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_PUBLIC);
+			keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM);
+			keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI);
+			switch (getDelegateCatalog().getEntryType()) {
+			case IDelegateCatalog.DELEGATE_TYPE_PUBLIC:
+				keyTypeCombo.select(0);
+				break;
+			case IDelegateCatalog.DELEGATE_TYPE_SYSTEM:
+				keyTypeCombo.select(1);
+				break;
+			default:
+			case IDelegateCatalog.DELEGATE_TYPE_URI:
+				keyTypeCombo.select(2);
+				break;
+			}
+
+			Label prefixLabel = new Label(prefixComposite, SWT.NONE);
+			prefixLabel.setText(XMLCatalogMessages.UI_LABEL_START_STRING_COLON);
+
+			prefixField = new Text(prefixComposite, SWT.SINGLE | SWT.BORDER);
+			prefixField.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
+			prefixField.setText(getDisplayValue(getDelegateCatalog().getStartString()));
+			ModifyListener modifyListener = new ModifyListener() {
+				public void modifyText(ModifyEvent e) {
+					updateWidgets(e.widget);
+				}
+			};
+			prefixField.addModifyListener(modifyListener);
+			prefixComposite.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
+		}
+
+		protected IDelegateCatalog getDelegateCatalog() {
+			if (delegateCatalog == null) {
+				if ((fCatalogElement != null) && (fCatalogElement.getType() == ICatalogElement.TYPE_DELEGATE)) {
+					delegateCatalog = (IDelegateCatalog) fCatalogElement;
+				}
+				else {	
+					if (catalog != null) {
+						delegateCatalog = (IDelegateCatalog) catalog.createCatalogElement(IDelegateCatalog.DELEGATE_TYPE_URI);
+					}
+				}
+			}
+			return delegateCatalog;
+		}
+
+		public void saveData() {
+			if (validateData())
+			{
+				getDelegateCatalog().setCatalogLocation(URIUtils.convertLocationToURI(catalogLocationField.getText()));
+				getDelegateCatalog().setStartString(prefixField.getText());
+				getDelegateCatalog().setEntryType(getDelegateType());
+				dataSaved = true;
+			}
+			else {
+				errorMessage = XMLCatalogMessages.UI_WARNING_DUPLICATE_DELEGATE;
+				errorMessageLabel.setText(errorMessage);
+				updateOKButtonState();
+				dataSaved = false;
+			}
+		}
+
+		private int getDelegateType() {
+			switch (keyTypeCombo.getSelectionIndex()) {
+			case 0:
+				return IDelegateCatalog.DELEGATE_TYPE_PUBLIC;
+
+			case 1:
+				return IDelegateCatalog.DELEGATE_TYPE_SYSTEM;
+			
+			case 2:				
+			default:
+				return IDelegateCatalog.DELEGATE_TYPE_URI;
+			}
+		}
+	
+		protected boolean validateData() {
+			IDelegateCatalog entry = getDelegateCatalog();
+			String prefix = prefixField.getText();
+			if(entry.getEntryType() != getDelegateType() || !prefix.equals(entry.getStartString())) {
+				IDelegateCatalog[] entries = catalog.getDelegateCatalogs();
+				for (int i = 0; i < entries.length; i++) {
+					if (entries[i].getStartString().equals(prefixField) && entries[i].getEntryType() == getDelegateType()) return false;
+				}
+			}
+			return true;
+		}
+
+		protected String getCatalogLocation() {
+			return getDelegateCatalog().getCatalogLocation();
+		}
+
+		public Control createControl(Composite parent) {
+			fControl = createNextCatalogPanel(parent, XMLCatalogMessages.UI_LABEL_DELEGATE_CATALOG_URI_COLON);
+			return fControl;
+		}
+	}
+
+	protected class RadioItemSelectionChangeListener implements SelectionListener {
+		public void widgetDefaultSelected(SelectionEvent e) {
+		}
+		
+		public void widgetSelected(SelectionEvent e) {
+			Object selection = e.getSource();
+			if (selection instanceof Button) {
+				Button button = (Button) selection;
+				if (button.getSelection()) {
+					if (!showPage((CatalogElementPage) button.getData())) {
+						// Page flipping wasn't successful
+						// handleError();
+					}
+				}
+			}
+		}
+
+	}
+
+	protected class RewriteEntryPage extends CatalogElementPage {
+		protected IRewriteEntry rewriteEntry;
+		private Text startStringField;
+		private Text prefixField;
+		private Combo keyTypeCombo;
+		
+		public void refresh() {
+			computeErrorMessage();
+			updateErrorMessageLabel(errorMessageLabel);
+			updateOKButtonState();
+		}
+	
+		public ICatalogElement getData() {
+			return getRewriteEntry();
+		}
+	
+		protected Label errorMessageLabel;
+
+		protected void computeErrorMessage() {
+			errorMessage = null;
+			
+			String start = startStringField.getText();
+			String prefix = prefixField.getText();
+			if (start.trim().length() > 0 && prefix.trim().length() > 0) {
+				// good
+			}
+			else {
+				// this an error that is not actually
+				// reported ... OK is just disabled
+				errorMessage = ""; //$NON-NLS-1$
+			}
+		}
+
+		protected IRewriteEntry getRewriteEntry() {
+			if (rewriteEntry == null) {
+				if ((fCatalogElement != null) && (fCatalogElement.getType() == ICatalogElement.TYPE_REWRITE)) {
+					rewriteEntry = (IRewriteEntry) fCatalogElement;
+				}
+				else {
+					if (catalog != null) {
+						rewriteEntry = (IRewriteEntry) catalog.createCatalogElement(IRewriteEntry.REWRITE_TYPE_SYSTEM);
+					}
+				}
+			}
+			return rewriteEntry;
 		}
 
 		protected void updateWidgets(Widget widget) {
@@ -676,26 +1284,149 @@
 			updateErrorMessageLabel(errorMessageLabel);
 			updateOKButtonState();
 		}
+		public void saveData() {
+			if (validateData()) {
+				getRewriteEntry().setRewritePrefix(prefixField.getText());
+				getRewriteEntry().setStartString(startStringField.getText());
+				getRewriteEntry().setEntryType(getEntryType());
+				dataSaved = true;
+			}
+			else {
+				errorMessage = XMLCatalogMessages.UI_WARNING_DUPLICATE_REWRITE;
+				errorMessageLabel.setText(errorMessage);
+				updateOKButtonState();
+				dataSaved = false;
+			}
+		}
+
+		private int getEntryType() {
+			switch (keyTypeCombo.getSelectionIndex()) {
+			case 0:
+				return IRewriteEntry.REWRITE_TYPE_SYSTEM;
+			case 1:
+			default:
+				return IRewriteEntry.REWRITE_TYPE_URI;
+			}
+		}
+		
+		protected boolean validateData() {
+			IRewriteEntry entry = getRewriteEntry();
+			String startString = startStringField.getText();
+			if(entry.getEntryType() != getEntryType() || !entry.getStartString().equals(startString)) {
+				IRewriteEntry[] entries = catalog.getRewriteEntries();
+				for (int i = 0; i < entries.length; i++) {
+					if (entries[i].getStartString().equals(startString) && entries[i].getEntryType() == getEntryType()) return false;
+				}
+			}
+			return true;
+		}
+			
+		public Control createControl(Composite parent) {
+	
+			fControl = createRewriteEntryPanel(parent);
+	
+			return fControl;
+		}
+	
+		public Control createRewriteEntryPanel(Composite parent) {
+			ModifyListener modifyListener = new ModifyListener() {
+				public void modifyText(ModifyEvent e) {
+					updateWidgets(e.widget);
+				}
+			};
+
+			Composite composite = new Composite(parent, SWT.NONE);
+			GridData gd = new GridData(GridData.FILL_BOTH);
+			composite.setLayoutData(gd);
+
+			GridLayout layout = new GridLayout();
+			composite.setLayout(layout);
+
+			Composite group = new Composite(composite, SWT.NONE);
+			gd = new GridData(GridData.FILL_HORIZONTAL);
+			group.setLayoutData(gd);
+
+			layout = new GridLayout();
+			group.setLayout(layout);
+				
+			Composite prefixComposite = new Composite(group, SWT.NONE);
+			
+			layout = new GridLayout();
+			layout.numColumns = 2;
+			layout.marginWidth = 0;
+			layout.marginHeight = 0;
+			layout.marginBottom = 5;
+			prefixComposite.setLayout(layout);
+			
+			// Key Type
+			//
+			Label keyTypeLabel = new Label(prefixComposite, SWT.NONE);
+			keyTypeLabel.setText(XMLCatalogMessages.UI_MATCH_KEY_TYPE_COLON);
+	
+			keyTypeCombo = new Combo(prefixComposite, SWT.READ_ONLY);
+			gd = new GridData();
+			gd.horizontalAlignment = SWT.FILL;
+			gd.grabExcessHorizontalSpace = true;
+			keyTypeCombo.setLayoutData(gd);
+			keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM);
+			keyTypeCombo.add(XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI);
+			switch (getRewriteEntry().getEntryType()) {
+			case IDelegateCatalog.DELEGATE_TYPE_SYSTEM:
+				keyTypeCombo.select(0);
+				break;
+			default:
+			case IDelegateCatalog.DELEGATE_TYPE_URI:
+				keyTypeCombo.select(1);
+				break;
+			}
+			Label startStringLabel = new Label(prefixComposite, SWT.NONE);
+			startStringLabel.setText(XMLCatalogMessages.UI_LABEL_START_STRING_COLON);
+	
+			startStringField = new Text(prefixComposite, SWT.SINGLE | SWT.BORDER);
+			startStringField.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
+			startStringField.setText(getDisplayValue(getRewriteEntry().getStartString()));
+			startStringField.addModifyListener(modifyListener);
+
+			Label prefixLabel = new Label(prefixComposite, SWT.NONE);
+			prefixLabel.setText(XMLCatalogMessages.UI_LABEL_REWRITE_PREFIX_COLON);
+	
+			prefixField = new Text(prefixComposite, SWT.SINGLE | SWT.BORDER);
+			prefixField.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
+			prefixField.setText(getDisplayValue(getRewriteEntry().getRewritePrefix()));
+			prefixField.addModifyListener(modifyListener);
+	
+			prefixComposite.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
+
+			errorMessageLabel = new Label(group, SWT.NONE);
+			errorMessageLabel.setForeground(color);
+			errorMessageLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+			updateWidgets(null);
+			return composite;
+		}
 	}
 
 	protected class ToolBarItemSelectionChangeListener implements SelectionListener {
-		public void widgetDefaultSelected(SelectionEvent e) {
-			// TODO Auto-generated method stub
-
-		}
+		public void widgetDefaultSelected(SelectionEvent e) {}
 
 		public void widgetSelected(SelectionEvent e) {
 			Object selection = e.getSource();
 			if (selection instanceof ToolItem) {
-				if (!showPage((CatalogElementPage) ((ToolItem) selection).getData())) {
+				ToolItem toolItem = (ToolItem)selection;
+				ToolBar toolbar = toolItem.getParent();
+				if(toolbar != null) {
+					ToolItem[] items = toolbar.getItems();
+					for (int i = 0; i < items.length; i++) {
+						items[i].setSelection(items[i] == toolItem);
+					}
+				}
+				if (!showPage((CatalogElementPage) toolItem.getData())) {
 					// Page flipping wasn't successful
 					// handleError();
 				}
 			}
 		}
-
 	}
-
+	
 	public static String[] createStringArray(List list) {
 		String[] stringArray = new String[list.size()];
 		for (int i = 0; i < stringArray.length; i++) {
@@ -732,9 +1463,11 @@
 	protected CatalogElementPage selectedPage;
 
 	// protected TreeViewer treeViewer;
-
+	
 	protected ToolBar toolBar;
 
+	protected Composite elementTypeComposite;
+
 	protected Color color;
 	protected boolean dataSaved;
 
@@ -771,15 +1504,6 @@
 		updateOKButtonState();
 	}
 
-	protected void createCatalogEntryButton() {
-		CatalogElementPage page = new CatalogEntryPage();
-		page.createControl(pageContainer);
-		ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
-		toolItem.setImage(catalogEntryToolBarImage);
-		toolItem.setText(XMLCatalogMessages.EditCatalogEntryDialog_catalogEntryLabel);
-		toolItem.setData(page);
-		toolItem.addSelectionListener(new ToolBarItemSelectionChangeListener());
-	}
 
 	protected Control createDialogArea(Composite parent) {
 		Composite dialogAreaComposite = (Composite) super.createDialogArea(parent);
@@ -789,8 +1513,8 @@
 		layout.marginWidth = 0;
 		dialogAreaComposite.setLayout(layout);
 		GridData gd = new GridData(GridData.FILL_BOTH);
-		gd.widthHint = 500;
-		gd.heightHint = 250;
+		gd.widthHint = 550;
+		//gd.heightHint = 250;
 		dialogAreaComposite.setLayoutData(gd);
 		createMainComponent(dialogAreaComposite);
 		return this.dialogArea;
@@ -825,6 +1549,21 @@
 				nextCatalogPage.createControl(pageContainer);
 				showPage(nextCatalogPage);
 			}
+			else if (fCatalogElement.getType() == ICatalogElement.TYPE_DELEGATE) {
+				DelegateCatalogPage delegateCatalogPage = new DelegateCatalogPage();
+				delegateCatalogPage.createControl(pageContainer);
+				showPage(delegateCatalogPage);
+			}
+			else if (fCatalogElement.getType() == ICatalogElement.TYPE_SUFFIX) {
+				SuffixEntryPage suffixEntryPage = new SuffixEntryPage();
+				suffixEntryPage.createControl(pageContainer);
+				showPage(suffixEntryPage);
+			}
+			else if (fCatalogElement.getType() == ICatalogElement.TYPE_REWRITE) {
+				RewriteEntryPage rewriteEntryPage = new RewriteEntryPage();
+				rewriteEntryPage.createControl(pageContainer);
+				showPage(rewriteEntryPage);
+			}
 
 			return composite1;
 		}
@@ -832,6 +1571,7 @@
 
 	}
 
+	
 	protected Composite createMainComponentWithToolbar(Composite composite) {
 
 		FormLayout formLayout = new FormLayout();
@@ -847,6 +1587,7 @@
 		label.setLayoutData(data);
 
 		toolBar = new ToolBar(composite, SWT.BORDER | SWT.FLAT | SWT.VERTICAL);
+		
 
 		data = new FormData();
 		data.top = new FormAttachment(label, 0);
@@ -874,24 +1615,102 @@
 
 		// add pages for each type of catalog element
 		createCatalogEntryButton();
+		createRewriteButton();
+		createSuffixCatalogButton();
 		createNextCatalogButton();
+		createDelegateCatalogButton();
 		if (toolBar.getItemCount() > 0) {
 			ToolItem item = toolBar.getItem(0);
 			showPage((CatalogElementPage) (item.getData()));
 		}
 		return composite1;
 	}
+	
+	protected void createCatalogEntryButton() {
+		CatalogElementPage page = new CatalogEntryPage();
+		page.createControl(pageContainer);
+		ToolItem toolItem = new ToolItem(toolBar, SWT.CHECK);
+		toolItem.setImage(catalogEntryToolBarImage);
+		toolItem.setText(XMLCatalogMessages.EditCatalogEntryDialog_catalogEntryLabel);
+		toolItem.setData(page);
+		toolItem.addSelectionListener(new ToolBarItemSelectionChangeListener());
+		toolItem.setSelection(true);
+	}
 
 	protected void createNextCatalogButton() {
 		CatalogElementPage page = new NextCatalogPage();
 		page.createControl(pageContainer);
-		ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
+		ToolItem toolItem = new ToolItem(toolBar, SWT.CHECK);
 		toolItem.setImage(nextCatalogToolBarImage);
 		toolItem.setText(XMLCatalogMessages.EditCatalogEntryDialog_nextCatalogLabel);
 		toolItem.setData(page);
 		toolItem.addSelectionListener(new ToolBarItemSelectionChangeListener());
 
 	}
+	
+	protected void createRewriteButton() {
+		CatalogElementPage page = new RewriteEntryPage();
+		page.createControl(pageContainer);
+		ToolItem toolItem = new ToolItem(toolBar, SWT.CHECK);
+		toolItem.setImage(rewriteToolBarImage);
+		toolItem.setText(XMLCatalogMessages.EditCatalogEntryDialog_rewriteEntryLabel);
+		toolItem.setData(page);
+		toolItem.addSelectionListener(new ToolBarItemSelectionChangeListener());
+	}
+	
+	protected void createDelegateCatalogButton() {
+		CatalogElementPage page = new DelegateCatalogPage();
+		page.createControl(pageContainer);
+		ToolItem toolItem = new ToolItem(toolBar, SWT.CHECK);
+		toolItem.setImage(delegateCatalogToolBarImage);
+		toolItem.setText(XMLCatalogMessages.EditCatalogEntryDialog_delegateCatalogLabel);
+		toolItem.setData(page);
+		toolItem.addSelectionListener(new ToolBarItemSelectionChangeListener());
+	}
+	
+	protected void createSuffixCatalogButton() {
+		CatalogElementPage page = new SuffixEntryPage();
+		page.createControl(pageContainer);
+		ToolItem toolItem = new ToolItem(toolBar, SWT.CHECK);
+		toolItem.setImage(suffixToolBarImage);
+		toolItem.setText(XMLCatalogMessages.EditCatalogEntryDialog_suffixEntryLabel);
+		toolItem.setData(page);
+		toolItem.addSelectionListener(new ToolBarItemSelectionChangeListener());
+	}
+	
+	
+	
+	
+	
+	
+//
+//	protected void createRewriteEntryButton() {
+//		CatalogElementPage page = new RewriteEntryPage();
+//		page.createControl(pageContainer);
+//		Button radioButton = new Button(elementTypeComposite, SWT.RADIO);
+//		radioButton.setText(XMLCatalogMessages.EditCatalogEntryDialog_rewriteEntryLabel);
+//		radioButton.setData(page);
+//		radioButton.addSelectionListener(new RadioItemSelectionChangeListener());
+//	}
+//
+//	protected void createSuffixEntryButton() {
+//		CatalogElementPage page = new SuffixEntryPage();
+//		page.createControl(pageContainer);
+//		Button radioButton = new Button(elementTypeComposite, SWT.RADIO);
+//		radioButton.setText(XMLCatalogMessages.EditCatalogEntryDialog_suffixEntryLabel);
+//		radioButton.setData(page);
+//		radioButton.addSelectionListener(new RadioItemSelectionChangeListener());
+//	}
+//
+//	protected void createDelegateCatalogButton() {
+//		CatalogElementPage page = new DelegateCatalogPage();
+//		page.createControl(pageContainer);
+//		Button radioButton = new Button(elementTypeComposite, SWT.RADIO);
+//		radioButton.setText(XMLCatalogMessages.EditCatalogEntryDialog_delegateCatalogLabel);
+//		radioButton.setData(page);
+//		radioButton.addSelectionListener(new RadioItemSelectionChangeListener());
+//
+//	}
 
 	protected ICatalogElement getCatalogElement() {
 		return fCatalogElement;
@@ -920,6 +1739,7 @@
 		pageContainer.setVisible(true);
 		pageContainer.showPage(selectedPage.getControl());
 		fCatalogElement = selectedPage.getData();
+		selectedPage.refresh();
 		return true;
 	}
 
@@ -942,7 +1762,7 @@
 	}
 
 	protected Button createBrowseButton(Composite composite) {
-		Button browseButton = new Button(composite, SWT.FLAT);
+		Button browseButton = new Button(composite, SWT.PUSH);
 		// browseButton.setText(XMLCatalogMessages.
 		// UI_BUTTON_BROWSE"));
 		browseButton.setImage(borwseImage);
@@ -957,96 +1777,40 @@
 		return browseButton;
 
 	}
+	
+	protected Button createWorkspaceBrowseButton(Composite composite) {
+		Button browseWorkspaceButton = new Button(composite, SWT.PUSH);
+		browseWorkspaceButton.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_WORKSPACE);
+		return browseWorkspaceButton;
+	}
+	
+	protected Button createFileSystemBrowseButton(Composite composite) {
+		Button browseFileSystemButton = new Button(composite, SWT.PUSH);
+		browseFileSystemButton.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_WORKSPACE);
+		return browseFileSystemButton;
+	}
 
-	class DropDownSelectionListener extends SelectionAdapter {
-		private Menu menu = null;
-		private Control control;
-
-		public DropDownSelectionListener(Control aControl) {
-			super();
-			this.control = aControl;
-		}
-
-		public void widgetSelected(SelectionEvent event) {
-			// Create the menu if it has not already been created
-			if (menu == null) {
-				// Lazy create the menu.
-				menu = new Menu(getShell());
-				MenuItem menuItem = new MenuItem(menu, SWT.NONE);
-				menuItem.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_WORKSPACE);
-				/*
-				 * Add a menu selection listener so that the menu is hidden
-				 * when the user selects an item from the drop down menu.
-				 */
-				menuItem.addSelectionListener(new SelectionAdapter() {
-					public void widgetSelected(SelectionEvent e) {
-						setMenuVisible(false);
-						invokeWorkspaceFileSelectionDialog();
-					}
-				});
-
-				menuItem = new MenuItem(menu, SWT.NONE);
-				menuItem.setText(XMLCatalogMessages.UI_BUTTON_MENU_BROWSE_FILE_SYSTEM);
-				/*
-				 * Add a menu selection listener so that the menu is hidden
-				 * when the user selects an item from the drop down menu.
-				 */
-				menuItem.addSelectionListener(new SelectionAdapter() {
-					public void widgetSelected(SelectionEvent e) {
-						setMenuVisible(false);
-						invokeFileSelectionDialog();
-					}
-				});
-
-			}
-
-			// Position the menu below and vertically aligned with the the
-			// drop down tool button.
-			Button button = (Button) event.widget;
-
-			// set location
-			Point ptBrowse = button.getLocation();
-			Rectangle rcBrowse = button.getBounds();
-			ptBrowse.y += rcBrowse.height;
-			ptBrowse = button.getParent().toDisplay(ptBrowse);
-			menu.setLocation(ptBrowse.x, ptBrowse.y);
-
-			setMenuVisible(true);
-
-		}
-
-		void setMenuVisible(boolean visible) {
-			menu.setVisible(visible);
-			// this.visible = visible;
-		}
-
-		void invokeWorkspaceFileSelectionDialog() {
-			FilterableSelectSingleFileDialog dialog = new FilterableSelectSingleFileDialog(getShell());
-			dialog.createAndOpen();
-
-			IFile file = dialog.getFile();
-			if (file != null) {
-				// remove leading slash from the value to avoid the
-				// whole leading slash ambiguity problem
-				//                    
-				String uri = file.getFullPath().toString();
-				while (uri.startsWith("/") || uri.startsWith("\\")) { //$NON-NLS-1$ //$NON-NLS-2$
-					uri = uri.substring(1);
-				}
-				if (control instanceof Text) {
-					((Text) control).setText(uri);
-				}
-
+	
+	String invokeWorkspaceFileSelectionDialog() {
+		FilterableSelectSingleFileDialog dialog = new FilterableSelectSingleFileDialog(getShell());
+		dialog.createAndOpen();
+		IFile file = dialog.getFile();
+		String uri = null;
+		if (file != null) {
+			// remove leading slash from the value to avoid the
+			// whole leading slash ambiguity problem
+			//                    
+			uri = file.getFullPath().toString();
+			while (uri.startsWith("/") || uri.startsWith("\\")) { //$NON-NLS-1$ //$NON-NLS-2$
+				uri = uri.substring(1);
 			}
 		}
+		return uri;
+	}
 
-		void invokeFileSelectionDialog() {
-			FileDialog dialog = new FileDialog(getShell(), SWT.SINGLE);
-			String file = dialog.open();
-			if ((control instanceof Text) && (file != null)) {
-				((Text) control).setText(file);
-			}
-		}
+	String invokeFileSelectionDialog() {
+		FileDialog dialog = new FileDialog(getShell(), SWT.SINGLE);
+		return dialog.open();
 	}
 
 }
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntryDetailsView.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntryDetailsView.java
index fe97a1c..0546950 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntryDetailsView.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntryDetailsView.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
+ * Copyright (c) 2002, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -20,8 +20,12 @@
 import org.eclipse.swt.widgets.ScrollBar;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.IDelegateCatalog;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.IRewriteEntry;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ISuffixEntry;
 
 
 
@@ -45,46 +49,121 @@
 		detailsText.setBackground(color);
 	}
 
-	public void setCatalogElement(ICatalogEntry entry) {
+	protected void setCatalogEntry(ICatalogEntry entry) {
 		if (entry == null) {
 			detailsText.setText(""); //$NON-NLS-1$
 			return;
 		}
-
 		String value = getDisplayValue(entry != null ? entry.getURI() : ""); //$NON-NLS-1$
-		String line1 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_COLON + "\t\t" + value; //$NON-NLS-1$
-
-		String line0;
-		if (value.startsWith("jar:file:")) {
-			String jarFile = URIUtils.convertURIToLocation(URIHelper.ensureURIProtocolFormat(value.substring("jar:".length(), value.indexOf('!'))));
-			String internalFile = URIUtils.convertURIToLocation(URIHelper.ensureURIProtocolFormat("file://" + value.substring(value.indexOf('!') + 1)));
-			line0 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_LOCATION + "\t" + internalFile + " " + XMLCatalogMessages.UI_LABEL_DETAILS_IN_JAR_FILE + " " + jarFile;
+		String line0 = XMLCatalogMessages.UI_LABEL_ENTRY_ELEMENT_COLON + "\t\t"; //$NON-NLS-1$
+		String line2 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_COLON + "\t\t\t\t" + value; //$NON-NLS-1$
+		String line1;
+		if (value.startsWith("jar:file:")) { //$NON-NLS-1$
+			String jarFile = URIUtils.convertURIToLocation(URIHelper.ensureURIProtocolFormat(value.substring("jar:".length(), value.indexOf('!')))); //$NON-NLS-1$
+			String internalFile = URIUtils.convertURIToLocation(URIHelper.ensureURIProtocolFormat("file://" + value.substring(value.indexOf('!') + 1))); //$NON-NLS-1$
+			line1 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_LOCATION + "\t\t\t" + internalFile + " " + XMLCatalogMessages.UI_LABEL_DETAILS_IN_JAR_FILE + " " + jarFile; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 		}
 		else {
 			value = URIUtils.convertURIToLocation(value);
-			line0 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_LOCATION + "\t" + value; //$NON-NLS-1$
+			line1 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_LOCATION + "\t\t\t" + value; //$NON-NLS-1$
 
 		}
-
+		switch(entry.getEntryType()) {
+			case ICatalogEntry.ENTRY_TYPE_PUBLIC: line0 += XMLCatalogMessages.UI_LABEL_PUBLIC; break;
+			case ICatalogEntry.ENTRY_TYPE_SYSTEM: line0 += XMLCatalogMessages.UI_LABEL_SYSTEM; break;
+			case ICatalogEntry.ENTRY_TYPE_URI: line0 += XMLCatalogMessages.UI_LABEL_URI; break;
+		}
 		value = entry != null ? getKeyTypeValue(entry) : ""; //$NON-NLS-1$
-		String line2 = XMLCatalogMessages.UI_KEY_TYPE_DETAILS_COLON + "\t" + value; //$NON-NLS-1$
-
+		String line3 = XMLCatalogMessages.UI_KEY_TYPE_DETAILS_COLON + "\t\t\t" + value; //$NON-NLS-1$
 		value = getDisplayValue(entry != null ? entry.getKey() : ""); //$NON-NLS-1$
-		String line3 = XMLCatalogMessages.UI_LABEL_DETAILS_KEY_COLON + "\t\t" + value; //$NON-NLS-1$
-
-		String entireString = "\n" + line0 + "\n" + line1 + "\n" + line2 + "\n" + line3; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		String line4 = XMLCatalogMessages.UI_LABEL_DETAILS_KEY_COLON + "\t\t\t\t" + value; //$NON-NLS-1$
+		String entireString = line0 + "\n" + line1 + "\n" + line2 + "\n" + line3 + "\n" + line4; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 		detailsText.setText(entireString);
 	}
 
-	public void setCatalogElement(INextCatalog nextCatalog) {
+	protected void setNextCatalog(INextCatalog nextCatalog) {
 		String value = getDisplayValue(nextCatalog != null ? nextCatalog.getCatalogLocation() : ""); //$NON-NLS-1$
-		String line1 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_COLON + "\t\t" + value; //$NON-NLS-1$
-
-		String line0 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_LOCATION + "\t" + URIUtils.convertURIToLocation(value);
-
-		String entireString = "\n" + line0 + "\n" + line1; //$NON-NLS-1$
+		String line0 = XMLCatalogMessages.UI_LABEL_ENTRY_ELEMENT_COLON + "\t\t" + XMLCatalogMessages.UI_LABEL_NEXT_CATALOG; //$NON-NLS-1$
+		String line1 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_LOCATION + "\t\t\t" + URIUtils.convertURIToLocation(value); //$NON-NLS-1$
+		String line2 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_COLON + "\t\t\t\t" + value; //$NON-NLS-1$
+		String entireString = line0 + "\n" + line1 + "\n" + line2; //$NON-NLS-1$ //$NON-NLS-2$
 		detailsText.setText(entireString);
 	}
+	
+	protected void setSuffixEntry(ISuffixEntry element) {
+		String value = getDisplayValue(element != null ? element.getURI() : ""); //$NON-NLS-1$
+		String line0 = XMLCatalogMessages.UI_LABEL_ENTRY_ELEMENT_COLON + "\t\t" + XMLCatalogMessages.UI_LABEL_SUFFIX_ENTRY; //$NON-NLS-1$
+		String line1 = XMLCatalogMessages.UI_LABEL_DETAILS_SUFFIX_COLON + "\t\t\t\t" + element.getSuffix(); //$NON-NLS-1$
+		String line2 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_LOCATION + "\t\t\t" + URIUtils.convertURIToLocation(value); //$NON-NLS-1$
+		String line3 = XMLCatalogMessages.UI_KEY_TYPE_DETAILS_COLON + "\t\t\t"; //$NON-NLS-1$
+		String uri = element.getURI();
+		boolean isSchema = false;
+		if(uri != null && uri.endsWith("xsd")) { //$NON-NLS-1$
+			isSchema = true;
+		}
+		switch (element.getEntryType()) {
+		case ISuffixEntry.SUFFIX_TYPE_SYSTEM:
+			line3 += isSchema? XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_XSD_SYSTEM : XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM;
+			break;
+		default:
+		case ISuffixEntry.SUFFIX_TYPE_URI:
+			line3 += isSchema? XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_XSD_PUBLIC : XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI;
+			break;
+		}
+		String entireString = line0 + "\n" + line1 +"\n" + line2 + "\n" + line3; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		detailsText.setText(entireString);
+	}
+
+	protected void setRewriteEntry(IRewriteEntry element) {
+		String line0 = XMLCatalogMessages.UI_LABEL_ENTRY_ELEMENT_COLON + "\t\t" + XMLCatalogMessages.UI_LABEL_REWRITE_ENTRY; //$NON-NLS-1$
+		String line1 = XMLCatalogMessages.UI_LABEL_START_STRING + "\t\t" + element.getStartString(); //$NON-NLS-1$
+		String line2 = XMLCatalogMessages.UI_LABEL_REWRITE_PREFIX + "\t" + element.getRewritePrefix(); //$NON-NLS-1$
+		String line3 = XMLCatalogMessages.UI_KEY_TYPE_DETAILS_COLON  + "\t\t\t" ; //$NON-NLS-1$
+		switch (element.getEntryType()) {
+		case IRewriteEntry.REWRITE_TYPE_SYSTEM:
+			line3 += XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM;
+			break;
+		default:
+		case IRewriteEntry.REWRITE_TYPE_URI:
+			line3 += XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI;
+			break;
+		}
+		String entireString = line0 + "\n" + line1 + "\n" + line2 + "\n" + line3; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		detailsText.setText(entireString);
+	}
+
+	protected void setDelegateCatalog(IDelegateCatalog element) {
+		String value = getDisplayValue(element != null ? element.getCatalogLocation() : ""); //$NON-NLS-1$
+		String line0 = XMLCatalogMessages.UI_LABEL_ENTRY_ELEMENT_COLON + "\t\t" + XMLCatalogMessages.UI_LABEL_DELEGATE_CATALOG; //$NON-NLS-1$
+		String line1 = XMLCatalogMessages.UI_LABEL_START_STRING + "\t\t" + element.getStartString(); //$NON-NLS-1$
+		String line2 = XMLCatalogMessages.UI_LABEL_DETAILS_URI_LOCATION + "\t\t\t" + URIUtils.convertURIToLocation(value); //$NON-NLS-1$
+		String line3 = XMLCatalogMessages.UI_KEY_TYPE_DETAILS_COLON + "\t\t\t"; //$NON-NLS-1$
+		switch (element.getEntryType()) {
+		case IDelegateCatalog.DELEGATE_TYPE_PUBLIC:
+			line3 += XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_PUBLIC;
+			break;
+		case IDelegateCatalog.DELEGATE_TYPE_SYSTEM:
+			line3 += XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM;
+			break;
+		default:
+		case IDelegateCatalog.DELEGATE_TYPE_URI:
+			line3 += XMLCatalogMessages.UI_KEY_TYPE_DESCRIPTION_URI;
+			break;
+		}
+		String entireString = line0 + "\n" + line1 + "\n" + line2 + "\n" + line3; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		detailsText.setText(entireString);
+	}
+
+	public void setCatalogElement(ICatalogElement element) {
+		// I wish we had a visitor for this kind of mess
+		if (element instanceof ICatalogEntry) setCatalogEntry((ICatalogEntry)element);
+		else if (element instanceof INextCatalog) setNextCatalog((INextCatalog)element);
+		else if (element instanceof IDelegateCatalog) setDelegateCatalog((IDelegateCatalog)element);
+		else if (element instanceof IRewriteEntry) setRewriteEntry((IRewriteEntry)element);
+		else if (element instanceof ISuffixEntry) setSuffixEntry((ISuffixEntry)element);
+		else setCatalogEntry(null); // Gives null text
+	}
+
 
 	protected String getDisplayValue(String string) {
 		return string != null ? string : ""; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogFileType.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogFileType.java
index aadb767..c3cbbe8 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogFileType.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogFileType.java
@@ -22,6 +22,7 @@
 
 public class XMLCatalogFileType {
 	public String description;
+    public String id;
 	public List extensions = new ArrayList();
 	public String iconFileName;
 	public Image icon;
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogMessages.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogMessages.java
index 177c196..fc526b6 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogMessages.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogMessages.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -30,14 +30,21 @@
 	public static String UI_LABEL_SELECT_FILE;
 	public static String UI_LABEL_KEY;
 	public static String UI_LABEL_KEY_COLON;
+	public static String UI_LABEL_SUFFIX;
+	public static String UI_LABEL_SUFFIX_COLON;
 	public static String UI_LABEL_DETAILS_KEY_COLON;
 	public static String UI_LABEL_DETAILS_IN_JAR_FILE;
 	public static String UI_LABEL_URI;
 	public static String UI_LABEL_LOCATION_COLON;
+	public static String UI_MATCH_KEY_TYPE_COLON;
+	public static String UI_LABEL_ARROW;
 	public static String UI_LABEL_CATALOG_URI_COLON;
 	public static String UI_LABEL_DETAILS_URI_COLON;
 	public static String UI_LABEL_DETAILS_URI_LOCATION;
 	public static String UI_KEY_TYPE_COLON;
+	public static String UI_ELEMENT_TYPE_COLON;
+	public static String UI_LABEL_START_STRING_COLON;
+	public static String UI_LABEL_REWRITE_PREFIX_COLON;
 	public static String UI_KEY_TYPE_DETAILS_COLON;
 	public static String UI_KEY_TYPE_DESCRIPTION_XSD_PUBLIC;
 	public static String UI_KEY_TYPE_DESCRIPTION_XSD_SYSTEM;
@@ -59,8 +66,10 @@
 	public static String UI_WARNING_NO_ELEMENT_XSD_LONG;
 	public static String UI_WARNING_SHOULD_BE_FULLY_QUALIFIED_URI;
 	public static String UI_WARNING_DUPLICATE_ENTRY;
-
-
+	public static String UI_WARNING_DUPLICATE_SUFFIX;
+	public static String UI_WARNING_DUPLICATE_REWRITE;
+	public static String UI_WARNING_DUPLICATE_DELEGATE;
+	
 	// NewModelWizard
 	public static String UI_INVALID_GRAMMAR_ERROR;
 	public static String UI_BUTTON_BROWSE;
@@ -117,15 +126,31 @@
 	public static String UI_LABEL_FILE_IS_READ_ONLY;
 	public static String UI_LABEL_DIALOG_DESCRIPTION;
 
+	public static String UI_LABEL_NEXT_CATALOG;
+	public static String UI_LABEL_DELEGATE_CATALOG;
+	public static String UI_LABEL_REWRITE_ENTRY;
+	public static String UI_LABEL_SUFFIX_ENTRY;
+
+	public static String UI_LABEL_DELEGATE_CATALOG_URI_COLON;
 	public static String EditCatalogEntryDialog_catalogEntryLabel;
 	public static String EditCatalogEntryDialog_nextCatalogLabel;
+	public static String EditCatalogEntryDialog_rewriteEntryLabel;
+	public static String EditCatalogEntryDialog_suffixEntryLabel;
+	public static String EditCatalogEntryDialog_delegateCatalogLabel;
 	public static String UI_BUTTON_MENU_BROWSE_WORKSPACE;
 	public static String UI_BUTTON_MENU_BROWSE_FILE_SYSTEM;
 	public static String UI_LABEL_SELECT_FILE_FILTER_CONTROL;
 	public static String UI_TEXT_SELECT_FILE_FILTER_CONTROL;
+	
+	public static String UI_LABEL_PUBLIC;
+	public static String UI_LABEL_SYSTEM;
 
+	public static String UI_LABEL_START_STRING;
+	public static String UI_LABEL_REWRITE_PREFIX;
+	public static String UI_LABEL_ENTRY_ELEMENT_COLON;
 
-
+	public static String UI_LABEL_DETAILS_SUFFIX_COLON;
+	
 	static {
 		// load message values from bundle file
 		NLS.initializeMessages(BUNDLE_NAME, XMLCatalogMessages.class);
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogPreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogPreferencePage.java
index 7316e01..e84a82a 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogPreferencePage.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogPreferencePage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
+ * Copyright (c) 2002, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -36,7 +36,7 @@
 import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
 import org.eclipse.wst.xml.core.internal.catalog.CatalogSet;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEvent;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogListener;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
@@ -187,18 +187,11 @@
 			public void selectionChanged(SelectionChangedEvent event) {
 				ISelection selection = event.getSelection();
 				Object selectedObject = (selection instanceof IStructuredSelection) && ((IStructuredSelection) selection).size() == 1 ? ((IStructuredSelection) selection).getFirstElement() : null;
-				if (selectedObject instanceof ICatalogEntry) {
-					ICatalogEntry entry = (ICatalogEntry) selectedObject;
-					detailsView.setCatalogElement(entry);
+				if (selectedObject instanceof ICatalogElement) {
+					detailsView.setCatalogElement((ICatalogElement)selectedObject);
+				} else {
+					detailsView.setCatalogElement(null);
 				}
-				else if (selectedObject instanceof INextCatalog) {
-					INextCatalog entry = (INextCatalog) selectedObject;
-					detailsView.setCatalogElement(entry);
-				}
-				else {
-					detailsView.setCatalogElement((ICatalogEntry) null);
-				}
-
 			}
 		};
 		catalogEntriesView.getViewer().addSelectionChangedListener(listener);
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogResources.properties b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogResources.properties
index 0910d6c..9af908a 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogResources.properties
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogResources.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2008 IBM Corporation and others.
+# Copyright (c) 2004, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -20,24 +20,39 @@
 UI_LABEL_SELECT_FILE                 = Select File
 UI_LABEL_KEY                         = Key
 UI_LABEL_KEY_COLON                   = &Key:
+UI_LABEL_SUFFIX                      = Suffix
+UI_LABEL_SUFFIX_COLON                = S&uffix:
 UI_LABEL_DETAILS_KEY_COLON           = Key:
 UI_LABEL_DETAILS_IN_JAR_FILE		 = in jar file
 UI_LABEL_URI                         = URI
+UI_LABEL_START_STRING_COLON          = &Matching start string:
+UI_LABEL_REWRITE_PREFIX_COLON        = Rewrite prefi&x:   
+UI_LABEL_ARROW				         = ->
 UI_LABEL_LOCATION_COLON              = &Location:  
-UI_LABEL_CATALOG_URI_COLON		      = Location of another XML Catalog file:
+UI_LABEL_DELEGATE_CATALOG_URI_COLON	 = D&elegate to this XML Catalog file:
+UI_LABEL_CATALOG_URI_COLON		      = &Location of another XML Catalog file:
 UI_LABEL_DETAILS_URI_COLON           = URI:   
-UI_KEY_TYPE_COLON                    = Key &Type:
-UI_KEY_TYPE_DETAILS_COLON            = Key Type:
+UI_KEY_TYPE_COLON                    = Key &type:
+UI_KEY_TYPE_DETAILS_COLON            = Key type:
+UI_MATCH_KEY_TYPE_COLON              = &Key type to match:
 UI_LABEL_DETAILS_URI_LOCATION        = Location:
-UI_KEY_TYPE_DESCRIPTION_XSD_PUBLIC   = Namespace Name
-UI_KEY_TYPE_DESCRIPTION_XSD_SYSTEM   = Schema Location
+UI_KEY_TYPE_DESCRIPTION_XSD_PUBLIC   = Namespace name
+UI_KEY_TYPE_DESCRIPTION_XSD_SYSTEM   = Schema location
 UI_KEY_TYPE_DESCRIPTION_DTD_PUBLIC   = Public ID
 UI_KEY_TYPE_DESCRIPTION_DTD_SYSTEM   = System ID
-UI_KEY_TYPE_DESCRIPTION_URI   		  = URI
-UI_LABEL_SPECIFY_ALTERNATIVE_WEB_URL = Specify &alternative web address
-UI_WARNING_URI_MUST_NOT_HAVE_DOTS    = URI must not included '.' or '..'
+UI_KEY_TYPE_DESCRIPTION_URI   		 = URI
+UI_LABEL_SPECIFY_ALTERNATIVE_WEB_URL = &Alternative web address:
+UI_WARNING_URI_MUST_NOT_HAVE_DOTS    = URI must not include '.' or '..'
 UI_LABEL_PLATFORM_RESOURCE 		 	 = Workspace
-UI_LABEL_FILE_SYSTEM_RESOURCE		 = File System
+UI_LABEL_FILE_SYSTEM_RESOURCE		 = File system
+UI_ELEMENT_TYPE_COLON                = Catalog element type:
+UI_LABEL_NEXT_CATALOG				 = Next catalog
+UI_LABEL_DELEGATE_CATALOG			 = Delegate catalog
+UI_LABEL_REWRITE_ENTRY				 = Rewrite
+UI_LABEL_SUFFIX_ENTRY				 = Suffix
+UI_LABEL_ENTRY_ELEMENT_COLON		 = Entry element:
+UI_LABEL_PUBLIC						 = Public
+UI_LABEL_SYSTEM						 = System
 
 UI_WARNING_URI_NOT_FOUND_COLON       = The specified resource can't be located :
 UI_WARNING_SHOULD_BE_FULLY_QUALIFIED_URI = Warning: the key value should be a fully qualified URI
@@ -48,6 +63,9 @@
 UI_WARNING_NO_ELEMENT_DTD_LONG       = The specified file must contain at least one element declaration that can be used as the root element in the generated XML file.
 UI_WARNING_NO_ELEMENT_XSD_LONG       = The specified file must contain at least one global element declaration that can be used as the root element in the generated XML file.
 UI_WARNING_DUPLICATE_ENTRY			 = The specified entry is invalid. An existing entry has the same key and key type.
+UI_WARNING_DUPLICATE_SUFFIX			 = The specified suffix is invalid. An existing entry has the same key type and suffix.
+UI_WARNING_DUPLICATE_REWRITE		 = The specified rewrite start string is invalid. An existing entry has the same start string.
+UI_WARNING_DUPLICATE_DELEGATE		 = The specified delegate start string is invalid. An existing entry has the same prefix.
 
 
 !NewModelWizard
@@ -61,8 +79,8 @@
 UI_BUTTON_EDIT                       = &Edit...
 UI_BUTTON_DELETE                     = &Delete
 UI_BUTTON_REMOVE                     = &Remove
-UI_LABEL_NEW_DIALOG_TITLE            = Add XML Catalog Entry
-UI_LABEL_EDIT_DIALOG_TITLE           = Edit XML Catalog Entry
+UI_LABEL_NEW_DIALOG_TITLE            = Add XML Catalog Element
+UI_LABEL_EDIT_DIALOG_TITLE           = Edit XML Catalog Element
 
 
 !XMLCatalogPreferencePage
@@ -107,9 +125,17 @@
 ERROR_SAVING_FILE					 = Error saving file %1
 UI_LABEL_FILE_IS_READ_ONLY           = File %1 is read only
 
-EditCatalogEntryDialog_catalogEntryLabel=Catalog Entry
-EditCatalogEntryDialog_nextCatalogLabel=Next Catalog
-UI_BUTTON_MENU_BROWSE_WORKSPACE=Workspace...
-UI_BUTTON_MENU_BROWSE_FILE_SYSTEM=File System...
+UI_LABEL_START_STRING = Start string:
+UI_LABEL_REWRITE_PREFIX = Rewrite prefix:
+
+UI_LABEL_DETAILS_SUFFIX_COLON = Suffix:
+
+EditCatalogEntryDialog_catalogEntryLabel=&Catalog Entry
+EditCatalogEntryDialog_nextCatalogLabel=&Next Catalog
+EditCatalogEntryDialog_rewriteEntryLabel=&Rewrite Entry
+EditCatalogEntryDialog_suffixEntryLabel=&Suffix Entry
+EditCatalogEntryDialog_delegateCatalogLabel=&Delegate Catalog
+UI_BUTTON_MENU_BROWSE_WORKSPACE=&Workspace...
+UI_BUTTON_MENU_BROWSE_FILE_SYSTEM=&File System...
 UI_LABEL_SELECT_FILE_FILTER_CONTROL=Files of type:
 UI_TEXT_SELECT_FILE_FILTER_CONTROL=All Supported Files
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogTreeViewer.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogTreeViewer.java
index 30d4959..e09b35c 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogTreeViewer.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogTreeViewer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
+ * Copyright (c) 2002, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -20,8 +20,6 @@
 import java.util.List;
 import java.util.Vector;
 
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.LabelProvider;
@@ -37,7 +35,10 @@
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.IDelegateCatalog;
 import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.IRewriteEntry;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ISuffixEntry;
 
 
 public class XMLCatalogTreeViewer extends TreeViewer {
@@ -45,6 +46,9 @@
 	protected static Image errorImage = ImageFactory.INSTANCE.getImage("icons/ovr16/error-overlay.gif"); //$NON-NLS-1$
 	protected static Image entryImage = ImageFactory.INSTANCE.getImage("icons/obj16/entry_obj.png"); //$NON-NLS-1$
 	protected static Image nextCatalogImage = ImageFactory.INSTANCE.getImage("icons/obj16/nextCatalog_obj.gif"); //$NON-NLS-1$
+	protected static Image rewriteEntryImage = ImageFactory.INSTANCE.getImage("icons/obj16/rewrite_entry.gif"); //$NON-NLS-1$
+	protected static Image suffixEntryImage = ImageFactory.INSTANCE.getImage("icons/obj16/suffix_entry.gif"); //$NON-NLS-1$
+	protected static Image delegateCatalogImage = ImageFactory.INSTANCE.getImage("icons/obj16/delegate_catalog.gif"); //$NON-NLS-1$
 
 	protected static String ERROR_STATE_KEY = "errorstatekey"; //$NON-NLS-1$
 
@@ -76,7 +80,14 @@
 			if (object instanceof ICatalogEntry) {
 				ICatalogEntry catalogEntry = (ICatalogEntry) object;
 				result = catalogEntry.getKey();
-				// result = URIHelper.removePlatformResourceProtocol(result);
+			}
+			else if (object instanceof ISuffixEntry) {
+				ISuffixEntry entry = (ISuffixEntry) object;
+				result = "[...]" + entry.getSuffix() + " " + XMLCatalogMessages.UI_LABEL_ARROW + " " + entry.getURI();
+			}
+			else if (object instanceof IRewriteEntry) {
+				IRewriteEntry entry = (IRewriteEntry) object;
+				result = entry.getStartString() + "[...] " + XMLCatalogMessages.UI_LABEL_ARROW + " " + entry.getRewritePrefix() + "[...]";
 			}
 			else if (object instanceof INextCatalog) {
 				INextCatalog nextCatalog = (INextCatalog) object;
@@ -89,41 +100,75 @@
 					result += " (" + XMLCatalogMessages.UI_LABEL_PLATFORM_RESOURCE + ")";
 				}
 			}
+			else if (object instanceof IDelegateCatalog) {
+				IDelegateCatalog nextCatalog = (IDelegateCatalog) object;
+				// result = nextCatalog.getCatalogLocation();
+				result = nextCatalog.getStartString() + " " + XMLCatalogMessages.UI_LABEL_ARROW + " " + URIUtils.convertURIToLocation(nextCatalog.getCatalogLocation());
+				if (nextCatalog.getCatalogLocation().startsWith("file:")) {
+					result += " (" + XMLCatalogMessages.UI_LABEL_FILE_SYSTEM_RESOURCE + ")";
+				}
+				else if (nextCatalog.getCatalogLocation().startsWith("platform:")) {
+					result += " (" + XMLCatalogMessages.UI_LABEL_PLATFORM_RESOURCE + ")";
+				}
+			}
 			return result != null ? result : object.toString();
 		}
 
 		public Image getImage(Object object) {
 			Image result = null;
-			Image base = null;
 			if (object instanceof String) {
 				result = xmlCatalogImage;
 			}
 			else if (object instanceof ICatalogEntry) {
 				ICatalogEntry catalogEntry = (ICatalogEntry) object;
 				String uri = catalogEntry.getURI();
-				IEditorRegistry er = PlatformUI.getWorkbench().getEditorRegistry();
-				ImageDescriptor imageDescriptor = er.getImageDescriptor(uri);
-				Image image = (Image) imageTable.get(imageDescriptor);
-				if (image == null) {
-					image = imageDescriptor.createImage();
-					imageTable.put(imageDescriptor, image);
-				}
-				base = image;
-
-				if (base != null) {
-					if (URIHelper.isReadableURI(uri, true)) {
-						result = base;
-					}
-					else {
-						result = ImageFactory.INSTANCE.createCompositeImage(base, errorImage, ImageFactory.BOTTOM_LEFT);
-					}
-				}
+				result = getResourceImage(uri);
 			}
 			else if (object instanceof INextCatalog) {
 				// TODO: add image to the imageTable and add error overlay if
 				// next catalog URI is not readable
 				result = nextCatalogImage;
 			}
+			else if (object instanceof IDelegateCatalog) {
+				// TODO: add image to the imageTable and add error overlay if
+				// next catalog URI is not readable
+				result = delegateCatalogImage;
+			}
+			else if (object instanceof ISuffixEntry) {
+				// TODO: add image to the imageTable and add error overlay if
+				// next catalog URI is not readable
+				result = suffixEntryImage;
+			}
+			else if (object instanceof IRewriteEntry) {
+				// TODO: add image to the imageTable and add error overlay if
+				// next catalog URI is not readable
+				result = rewriteEntryImage;
+			}
+			return result;
+		}
+
+		private Image getResourceImage(String uri) {
+			Image result = null;
+			Image base = null;
+
+			IEditorRegistry er = PlatformUI.getWorkbench().getEditorRegistry();
+			ImageDescriptor imageDescriptor = er.getImageDescriptor(uri);
+			Image image = (Image) imageTable.get(imageDescriptor);
+			if (image == null) {
+				image = imageDescriptor.createImage();
+				imageTable.put(imageDescriptor, image);
+			}
+			base = image;
+
+			if (base != null) {
+				// TODO: This should be moved into the catalog
+				if (URIHelper.isReadableURI(uri, false)) {
+					result = base;
+				}
+				else {
+					result = ImageFactory.INSTANCE.createCompositeImage(base, errorImage, ImageFactory.BOTTOM_LEFT);
+				}
+			}
 			return result;
 		}
 
@@ -165,11 +210,14 @@
 				ICatalog nextCatalog = ((INextCatalog) parentElement).getReferencedCatalog();
 				result = getChildrenHelper(nextCatalog);
 			}
+			else if (parentElement instanceof IDelegateCatalog) {
+				ICatalog nextCatalog = ((IDelegateCatalog) parentElement).getReferencedCatalog();
+				result = getChildrenHelper(nextCatalog);
+			}
 			return result;
 		}
 
 		protected Object[] getChildrenHelper(ICatalog catalog) {
-			// TODO add entries from the nested catalogs
 
 			ICatalogEntry[] entries = catalog.getCatalogEntries();
 			if (entries.length > 0) {
@@ -188,6 +236,9 @@
 			}
 			Vector result = new Vector();
 			result.addAll(Arrays.asList(entries));
+			result.addAll(Arrays.asList(catalog.getRewriteEntries()));
+			result.addAll(Arrays.asList(catalog.getSuffixEntries()));
+			result.addAll(Arrays.asList(catalog.getDelegateCatalogs()));
 			INextCatalog[] nextCatalogs = catalog.getNextCatalogs();
 			List nextCatalogsList = Arrays.asList(nextCatalogs);
 			result.addAll(nextCatalogsList);
@@ -217,16 +268,6 @@
 	}
 
 
-	public void menuAboutToShow(IMenuManager menuManager) {
-		Action action = new Action("hello") { //$NON-NLS-1$
-			public void run() {
-				System.out.println("run!"); //$NON-NLS-1$
-			}
-		};
-		menuManager.add(action);
-	}
-
-
 	class XMLCatalogTableViewerFilter extends ViewerFilter {
 		protected String[] extensions;
 
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/delegateCatalog.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/delegateCatalog.gif
new file mode 100644
index 0000000..c0d85ee
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/delegateCatalog.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/prefix.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/prefix.gif
new file mode 100644
index 0000000..6b87692
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/prefix.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/rewrite.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/rewrite.gif
new file mode 100644
index 0000000..f003064
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/rewrite.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/sufix.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/sufix.gif
new file mode 100644
index 0000000..2bd5b41
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/sufix.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/catalog_entry.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/catalog_entry.gif
new file mode 100644
index 0000000..a27e30a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/catalog_entry.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/delegate_catalog.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/delegate_catalog.gif
new file mode 100644
index 0000000..11bd2d0
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/delegate_catalog.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/next_catalog.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/next_catalog.gif
new file mode 100644
index 0000000..976cbc9
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/next_catalog.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/rewrite_entry.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/rewrite_entry.gif
new file mode 100644
index 0000000..9cc8ee9
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/rewrite_entry.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/suffix_entry.gif b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/suffix_entry.gif
new file mode 100644
index 0000000..dc76407
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/suffix_entry.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/SourceEditorActionBarContributor.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/SourceEditorActionBarContributor.java
index fda3b68..d70cdd3 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/SourceEditorActionBarContributor.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/SourceEditorActionBarContributor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,7 +17,8 @@
 import org.eclipse.ui.IEditorActionBarContributor;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.eclipse.ui.part.MultiPageEditorPart;
+import org.eclipse.ui.texteditor.ITextEditor;
 import org.eclipse.wst.sse.ui.internal.ExtendedEditorActionBuilder;
 import org.eclipse.wst.sse.ui.internal.IExtendedContributor;
 import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor;
@@ -27,7 +28,7 @@
 
 	protected IEditorActionBarContributor designViewerActionBarContributor = null;
 	protected IEditorActionBarContributor sourceViewerActionContributor = null;
-	protected XMLMultiPageEditorPart multiPageEditor = null;
+	protected MultiPageEditorPart multiPageEditor = null;
 
 	// EditorExtension
 	private static final String EDITOR_ID = "org.eclipse.wst.xml.ui.XMLMultiPageEditorPart"; //$NON-NLS-1$
@@ -78,6 +79,8 @@
 		if (extendedContributor != null) {
 			extendedContributor.dispose();
 		}
+		
+		multiPageEditor = null;
 	}
 
 	/**
@@ -159,8 +162,8 @@
 		// activeEditor)
 		// multiPageEditor is needed in setActivePage(IEditorPart
 		// activeEditor)
-		if (targetEditor instanceof XMLMultiPageEditorPart) {
-			multiPageEditor = (XMLMultiPageEditorPart) targetEditor;
+		if (targetEditor instanceof MultiPageEditorPart) {
+			multiPageEditor = (MultiPageEditorPart) targetEditor;
 		}
 
 		super.setActiveEditor(targetEditor);
@@ -178,7 +181,7 @@
 		// other editors, the following
 		// check is added.
 		if (multiPageEditor != null) {
-			if ((activeEditor != null) && (activeEditor instanceof StructuredTextEditor)) {
+			if ((activeEditor != null) && (activeEditor instanceof ITextEditor)) {
 				activateSourcePage(activeEditor);
 			}
 			else {
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeContentHelper.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeContentHelper.java
index 11a4dd6..9033227 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeContentHelper.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeContentHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004-2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,8 +17,13 @@
 import java.util.List;
 import java.util.Vector;
 
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMWriter;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
@@ -265,6 +270,34 @@
 	 * 
 	 */
 	public void setNodeValue(Node node, String value) {
+		setNodeValue(node, value, null);
+	}
+
+	/**
+	 * Checks that the resource backing the model is writeable utilizing <code>validateEdit</code>
+	 * on a given <tt>IWorkspace</tt>.
+	 * 
+	 * @param model the model to be checked
+	 * @param context the shell context for which <code>validateEdit</code> will be run
+	 * @return boolean result of checking <code>validateEdit</code>. If the resource is unwriteable, <code>status.isOK()</code>
+	 * will return true; otherwise, false.
+	 */
+	private boolean validateEdit(IStructuredModel model, Shell context) {
+		if (model != null && model.getBaseLocation() != null) {
+			IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(model.getBaseLocation()));
+			return !file.isAccessible() || ResourcesPlugin.getWorkspace().validateEdit(new IFile[] {file}, context).isOK();
+		}
+		return false;
+	}
+
+	/**
+	 * 
+	 */
+	public void setNodeValue(Node node, String value, Shell context) {
+		// Model should not be edited because base location is read-only
+		if (node instanceof IDOMNode && !validateEdit(((IDOMNode) node).getModel(), context)) {
+			return;
+		}
 		int nodeType = node.getNodeType();
 		try {
 			switch (nodeType) {
@@ -392,16 +425,34 @@
 	protected String getValueForTextContent(List list) {
 		String result = null;
 		if (list.size() > 0) {
-			IDOMNode first = (IDOMNode) list.get(0);
-			IDOMNode last = (IDOMNode) list.get(list.size() - 1);
-			IDOMModel model = first.getModel();
-			int start = first.getStartOffset();
-			int end = last.getEndOffset();
-			try {
-				result = model.getStructuredDocument().get(start, end - start);
+			if (list.get(0) instanceof IDOMNode) {
+				IDOMNode first = (IDOMNode) list.get(0);
+				IDOMNode last = (IDOMNode) list.get(list.size() - 1);
+				IDOMModel model = first.getModel();
+				int start = first.getStartOffset();
+				int end = last.getEndOffset();
+				try {
+					result = model.getStructuredDocument().get(start,
+							end - start);
+				} catch (Exception e) {
+
+				}
 			}
-			catch (Exception e) {
-			}
+			else
+			{
+				if (list.get(0) instanceof Node)
+				{
+					Node n = (Node) list.get(0);
+					for (Node node = n.getFirstChild(); node != null; node = node.getNextSibling()) {
+						if (node.getNodeType() == Node.TEXT_NODE) {
+							String text = node.getNodeValue();
+							if(!((text == null) || (text.trim().length() == 0))) {
+								result = text.trim();
+							}
+						}
+					}
+				}
+			}	
 		}
 
 		// we trim the content so that it looks nice when viewed
@@ -420,11 +471,14 @@
 		// String oldValue = getValueForTextContent();
 		// we worry about preserving trimmed text
 		if (list.size() > 0) {
-			IDOMNode first = (IDOMNode) list.get(0);
-			IDOMNode last = (IDOMNode) list.get(list.size() - 1);
-			int start = first.getStartOffset();
-			int end = last.getEndOffset();
-			first.getModel().getStructuredDocument().replaceText(this, start, end - start, value);
+			if (list.get(0) instanceof IDOMNode) {
+				IDOMNode first = (IDOMNode) list.get(0);
+				IDOMNode last = (IDOMNode) list.get(list.size() - 1);
+				int start = first.getStartOffset();
+				int end = last.getEndOffset();
+				first.getModel().getStructuredDocument().replaceText(this,
+						start, end - start, value);
+			}
 		}
 	}
 
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorMessages.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorMessages.java
index c0471bf..4fbac12 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorMessages.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorMessages.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -21,6 +21,8 @@
 	private static final String BUNDLE_NAME = "org.eclipse.wst.xml.ui.internal.tabletree.XMLEditorResources";//$NON-NLS-1$
 
 	public static String XMLTableTreeViewer_0;
+	public static String XMLTableTreeViewer_1;
+	public static String XMLTableTreeViewer_2;
 	public static String XMLMultiPageEditorPart_0;
 	public static String XMLTreeExtension_0;
 	public static String XMLTreeExtension_1;
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginHOLD_OLD.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginHOLD_OLD.java
deleted file mode 100644
index fd3acc0..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginHOLD_OLD.java
+++ /dev/null
@@ -1,53 +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.ui.internal.tabletree;
-
-
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistry;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistryImpl;
-
-/**
- * @deprecated This plugin has combined with the org.eclipse.wst.xml.ui
- *             plugin. Use XMLUIPlugin instead.
- */
-public class XMLEditorPluginHOLD_OLD extends AbstractUIPlugin {
-
-	public final static String PLUGIN_ID = "org.eclipse.wst.xml.ui.internal.XMLEditorPluginHOLD_OLD"; //$NON-NLS-1$
-	protected static XMLEditorPluginHOLD_OLD instance = null;
-
-	/**
-	 * XMLUIPlugin constructor comment.
-	 */
-	public XMLEditorPluginHOLD_OLD() {
-		super();
-		instance = this;
-
-		// reference the preference store so
-		// initializeDefaultPreferences(IPreferenceStore preferenceStore) is
-		// called
-		getPreferenceStore();
-	}
-
-	public static XMLEditorPluginHOLD_OLD getDefault() {
-		return instance;
-	}
-
-	public synchronized static XMLEditorPluginHOLD_OLD getInstance() {
-		return instance;
-	}
-
-	public AdapterFactoryRegistry getAdapterFactoryRegistry() {
-		return AdapterFactoryRegistryImpl.getInstance();
-
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorResources.properties b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorResources.properties
index 2fc1735..1943b11 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorResources.properties
+++ b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorResources.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2004, 2005 IBM Corporation and others.
+# Copyright (c) 2004, 2009 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -9,6 +9,8 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 XMLTableTreeViewer_0=Design
+XMLTableTreeViewer_1=Node
+XMLTableTreeViewer_2=Content
 XMLMultiPageEditorPart_0=Source
 XMLTreeExtension_0=Structure
 XMLTreeExtension_1=Value
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorPart.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorPart.java
index 497bbe0..e7d90b0 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorPart.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorPart.java
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others. All rights reserved. This
+ * Copyright (c) 2004, 2010 IBM Corporation and others. All rights reserved. This
  * program and the accompanying materials are made available under the terms
  * of the Eclipse Public License v1.0 which accompanies this distribution, and
  * is available at http://www.eclipse.org/legal/epl-v10.html
@@ -8,16 +8,22 @@
  ****************************************************************************/
 package org.eclipse.wst.xml.ui.internal.tabletree;
 
+
 import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.action.ToolBarManager;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.ITextInputListener;
 import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.viewers.AbstractTreeViewer;
 import org.eclipse.jface.viewers.ILabelProvider;
 import org.eclipse.jface.viewers.IPostSelectionProvider;
 import org.eclipse.jface.viewers.ISelection;
@@ -27,9 +33,15 @@
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
 import org.eclipse.ui.IEditorActionBarContributor;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
@@ -49,18 +61,23 @@
 import org.eclipse.ui.part.MultiPageEditorSite;
 import org.eclipse.ui.part.MultiPageSelectionProvider;
 import org.eclipse.ui.progress.UIJob;
+import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.ui.StructuredTextEditor;
 import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
 import org.eclipse.wst.xml.core.internal.provisional.IXMLPreferenceNames;
 import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.ui.internal.Logger;
 import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
 import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 public class XMLMultiPageEditorPart extends MultiPageEditorPart {
 
@@ -69,6 +86,12 @@
 	 */
 	class ActivationListener implements IPartListener, IWindowListener {
 
+		/**
+		 * The maximum number of children the root nodes can have for the
+		 * design page to auto expand the root nodes
+		 */
+		private static final int MAX_NUM_CHILD_NODES_FOR_AUTO_EXPAND = 500;
+		
 		/** Cache of the active workbench part. */
 		private IWorkbenchPart fActivePart;
 		/** Indicates whether activation handling is currently be done. */
@@ -137,7 +160,40 @@
 		 * @see IPartListener#partOpened(org.eclipse.ui.IWorkbenchPart)
 		 */
 		public void partOpened(IWorkbenchPart part) {
-			// do nothing
+			if (fDesignViewer instanceof AbstractTreeViewer) {
+				IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
+				try {
+					if (model instanceof IDOMModel) {
+						IDOMDocument modelDocument = ((IDOMModel) model).getDocument();
+						NodeList rootChildren = modelDocument.getChildNodes();
+
+						boolean tooManyChildren = (rootChildren.getLength() > MAX_NUM_CHILD_NODES_FOR_AUTO_EXPAND);
+						/*
+						 * For each root (there should really only be one
+						 * real root but there are also could be empty
+						 * text regions and doc type at the root level)
+						 * determine if it has to many children or not to
+						 * auto expand
+						 */
+						for (int i = 0; i < rootChildren.getLength() && !tooManyChildren; ++i) {
+							tooManyChildren = (rootChildren.item(i).getChildNodes().getLength() > MAX_NUM_CHILD_NODES_FOR_AUTO_EXPAND);
+						}
+
+						/*
+						 * if root node does not have to many children then
+						 * auto expand the root node
+						 */
+						if (!tooManyChildren) {
+							((AbstractTreeViewer) fDesignViewer).expandToLevel(2);
+						}
+					}
+				}
+				finally {
+					if (model != null) {
+						model.releaseFromRead();
+					}
+				}
+			}
 		}
 
 		/**
@@ -237,8 +293,30 @@
 		}
 	}
 
+	private class PageInitializationData {
+		IConfigurationElement fElement;
+		String fPropertyName;
+		Object fData;
+
+		PageInitializationData(IConfigurationElement cfig, String propertyName, Object data) {
+			super();
+			fElement = cfig;
+			fPropertyName = propertyName;
+			fData = data;
+		}
+
+		void sendInitializationData(IExecutableExtension executableExtension) {
+			try {
+				executableExtension.setInitializationData(fElement, fPropertyName, fData);
+			}
+			catch (CoreException e) {
+				Logger.logException(e);
+			}
+		}
+	}
+
 	/**
-	 * Internal IPropertyListener
+	 * Internal IPropertyListener on the source page
 	 */
 	class PropertyListener implements IPropertyListener {
 		public void propertyChanged(Object source, int propId) {
@@ -247,7 +325,23 @@
 				// StructuredTextEditor could tell it containing editor that
 				// the input has change, when a 'resource moved' event is
 				// found.
-				case IEditorPart.PROP_INPUT :
+				case IEditorPart.PROP_INPUT : {
+					if (source == getTextEditor() && fDesignViewer instanceof XMLTableTreeViewer) {
+						IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
+						try {
+							if (model instanceof IDOMModel) {
+								IDOMDocument modelDocument = ((IDOMModel) model).getDocument();
+								Object designInput = ((XMLTableTreeViewer) fDesignViewer).getInput();
+								if (modelDocument != designInput)
+									setInput(getTextEditor().getEditorInput());
+							}
+						}
+						finally {
+							if (model != null)
+								model.releaseFromRead();
+						}
+					}
+				}
 				case IEditorPart.PROP_DIRTY : {
 					if (source == getTextEditor()) {
 						if (getTextEditor().getEditorInput() != getEditorInput()) {
@@ -353,6 +447,8 @@
 
 	/** The design viewer */
 	IDesignViewer fDesignViewer;
+	/** Any container for the design viewer */
+	private Composite fDesignContainer;
 
 	private ActivationListener fActivationListener;
 
@@ -368,6 +464,12 @@
 
 	private ILabelProvider fStatusLineLabelProvider;
 
+	private PageInitializationData fPageInitializer;
+	
+	private ToolBarManager fToolbarManager;
+
+	private boolean fAllocateToolbar = true;
+	
 	/**
 	 * StructuredTextMultiPageEditorPart constructor comment.
 	 */
@@ -413,7 +515,7 @@
 		/*
 		 * Connect selection from the Design page to the selection provider
 		 * for the XMLMultiPageEditorPart so that selection changes in the
-		 * Design page will propogate across the workbench
+		 * Design page will propagate across the workbench
 		 */
 		if (fDesignViewer.getSelectionProvider() instanceof IPostSelectionProvider) {
 			((IPostSelectionProvider) fDesignViewer.getSelectionProvider()).addPostSelectionChangedListener(new ISelectionChangedListener() {
@@ -443,14 +545,6 @@
 					if (getActivePage() != fSourcePageIndex) {
 						getTextEditor().getSelectionProvider().setSelection(event.getSelection());
 					}
-					if (fDesignViewer.equals(event.getSource())) {
-						try {
-							updateStatusLine(event.getSelection());
-						}
-						catch (Exception exception) {
-							Logger.logException(exception);
-						}						
-					}
 				}
 			});
 		}
@@ -464,6 +558,11 @@
 					if (getActivePage() != fSourcePageIndex) {
 						getTextEditor().getSelectionProvider().setSelection(event.getSelection());
 					}
+					/*
+					 * Bug 210481 - Removed call to updateStatusLine because
+					 * this is already handled by the selection in the source
+					 * page
+					 */
 				}
 			});
 		}
@@ -471,6 +570,9 @@
 		/*
 		 * Handle double-click in the Design page by selecting the
 		 * corresponding amount of text in the Source page.
+		 * 
+		 * Warning: This implies more knowledge of the design viewer's underlying
+		 * Control than expressed in the IDesignViewer interface
 		 */
 		fDesignViewer.getControl().addListener(SWT.MouseDoubleClick, new Listener() {
 			public void handleEvent(Event event) {
@@ -540,22 +642,66 @@
 		// note: By adding the design page as a Control instead of an
 		// IEditorPart, page switches will indicate
 		// a "null" active editor when the design page is made active
-		fDesignPageIndex = addPage(designViewer.getControl());
+		if (fDesignContainer != null)
+			fDesignPageIndex = addPage(fDesignContainer);
+		else
+			fDesignPageIndex = addPage(designViewer.getControl());
+			
 		setPageText(fDesignPageIndex, designViewer.getTitle());
 	}
 
-	protected IDesignViewer createDesignPage() {
-		XMLTableTreeViewer tableTreeViewer = new XMLTableTreeViewer(getContainer());
-		// Set the default infopop for XML design viewer.
+	protected IDesignViewer createDesignPage() {		
+		Composite container = getDesignContainer(getContainer());
+
+		XMLTableTreeViewer tableTreeViewer = new XMLTableTreeViewer(container);
+		tableTreeViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
+		// Set the default info-pop for XML design viewer.
 		XMLUIPlugin.getInstance().getWorkbench().getHelpSystem().setHelp(tableTreeViewer.getControl(), XMLTableTreeHelpContextIds.XML_DESIGN_VIEW_HELPID);
+
+		// Toolbar wasn't allocated
+		if (fToolbarManager != null) {
+			addToolBarActions(tableTreeViewer);
+		}
 		return tableTreeViewer;
 	}
 
+	protected Composite getDesignContainer(Composite defaultContainer) {
+		Composite container = defaultContainer;
+		// create a container to hold the toolbar if it should be created
+		if (fAllocateToolbar) {
+			container = new Composite(defaultContainer, SWT.NONE);
+			GridLayout layout = new GridLayout();
+			layout.marginHeight = 0;
+			layout.verticalSpacing = 0;
+			layout.marginWidth = 0;
+			container.setLayout(layout);
+	
+			ToolBar tb = new ToolBar(container, SWT.FLAT);
+			fToolbarManager = new ToolBarManager(tb);
+			tb.setLayoutData(new GridData(GridData.END, GridData.VERTICAL_ALIGN_BEGINNING, true, false));
+			fDesignContainer = container;
+		}
+		return container;
+	}
+
+	private void addToolBarActions(IDesignViewer viewer) {
+		if (viewer instanceof AbstractTreeViewer) {
+			ViewerExpandCollapseAction expand = new ViewerExpandCollapseAction(true);
+			ViewerExpandCollapseAction collapse = new ViewerExpandCollapseAction(false);
+			fToolbarManager.add(expand);
+			fToolbarManager.add(collapse);
+			fToolbarManager.update(true);
+	
+	
+			expand.setViewer((AbstractTreeViewer) viewer);
+			collapse.setViewer((AbstractTreeViewer) viewer);
+		}
+	}
+
 	/**
 	 * Creates the pages of this multi-page editor.
 	 * <p>
-	 * Subclasses of <code>MultiPageEditor</code> must implement this
-	 * method.
+	 * Subclasses of <code>MultiPageEditor</code> must implement this method.
 	 * </p>
 	 */
 	protected void createPages() {
@@ -628,6 +774,15 @@
 		fTextEditor = createTextEditor();
 		fTextEditor.setEditorPart(this);
 
+		/*
+		 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=134301 - XML editor
+		 * does not remember font settings
+		 * 
+		 * @see
+		 * org.eclipse.ui.texteditor.AbstractTextEditor#getSymbolicFontName()
+		 */
+		fPageInitializer.sendInitializationData(fTextEditor);
+
 		if (fPropertyListener == null) {
 			fPropertyListener = new PropertyListener();
 		}
@@ -662,7 +817,7 @@
 		if ((fTextEditor != null) && (fPropertyListener != null)) {
 			fTextEditor.removePropertyListener(fPropertyListener);
 		}
-
+		
 		// moved to last when added window ... seems like
 		// we'd be in danger of losing some data, like site,
 		// or something.
@@ -782,7 +937,7 @@
 	 * (non-Javadoc)
 	 * 
 	 * @see org.eclipse.ui.IEditorPart#init(org.eclipse.ui.IEditorSite,
-	 *      org.eclipse.ui.IEditorInput)
+	 * org.eclipse.ui.IEditorInput)
 	 */
 	public void init(IEditorSite site, IEditorInput input) throws PartInitException {
 		try {
@@ -817,6 +972,14 @@
 		}
 		return isDirty();
 	}
+	
+	/**
+	 * Prevents the creation of the in-editor toolbar, if called before
+	 * createPageContainer() during editor initialization.
+	 */
+	protected final void noToolbar() {
+		fAllocateToolbar = false;
+	}
 
 	/*
 	 * (non-Javadoc)
@@ -844,6 +1007,26 @@
 		getPreferenceStore().setValue(IXMLPreferenceNames.LAST_ACTIVE_PAGE, newPageIndex);
 	}
 
+	public void setFocus() {
+		super.setFocus();
+		Control control = fDesignViewer.getControl();
+		control.setFocus();
+
+		if (control instanceof Tree) {
+			if (((Tree) control).getItemCount() > 0) {
+				TreeItem item = ((Tree) control).getItem(0);
+				((Tree) control).setSelection(item);
+			}
+		}
+		// 271382 - Focus not set properly after activating XML editor
+		control.forceFocus();
+	}
+
+	public void setInitializationData(IConfigurationElement cfig, String propertyName, Object data) {
+		super.setInitializationData(cfig, propertyName, data);
+		fPageInitializer = new PageInitializationData(cfig, propertyName, data);
+	}
+
 	/*
 	 * (non-Javadoc)
 	 * 
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeActionBarContributor.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeActionBarContributor.java
index 9da1fef..4af5032 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeActionBarContributor.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeActionBarContributor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,14 +15,10 @@
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.IContributionManager;
 import org.eclipse.jface.action.IMenuManager;
-//import org.eclipse.jface.action.IToolBarManager;
-//import org.eclipse.jface.action.MenuManager;
-//import org.eclipse.jface.action.Separator;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.ui.IActionBars;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IEditorSite;
-//import org.eclipse.ui.IWorkbenchActionConstants;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchPartSite;
 import org.eclipse.ui.texteditor.ITextEditor;
@@ -208,6 +204,9 @@
 		return (editor == null ? null : editor.getAction(actionId));
 	}
 
+	/**
+	 * @deprecated - not to be used
+	 */
 	protected IStructuredModel getModelForEditorPart(IEditorPart targetEditor) {
 		IStructuredModel result = null;
 		if (editorPart instanceof XMLMultiPageEditorPart) {
@@ -217,6 +216,9 @@
 		return result;
 	}
 
+	/**
+	 * @deprecated - not to be used
+	 */
 	protected XMLTableTreeViewer getTableTreeViewerForEditorPart(IEditorPart targetEditor) {
 		XMLTableTreeViewer result = null;
 		Object object = targetEditor.getAdapter(IDesignViewer.class);
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeContentProvider.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeContentProvider.java
index c713320..95125b6 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeContentProvider.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeContentProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,18 +14,24 @@
 
 import org.eclipse.jface.viewers.ILabelProvider;
 import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ITableColorProvider;
 import org.eclipse.jface.viewers.ITableLabelProvider;
 import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.StructuredViewer;
 import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
 import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapterFactory;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
 import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManagerListener;
 import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
+import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDescriptionBuilder;
 import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
 import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
@@ -39,7 +45,7 @@
 import org.w3c.dom.Text;
 
 
-public class XMLTableTreeContentProvider implements ITreeContentProvider, ITableLabelProvider, ILabelProvider, CMDocumentManagerListener {
+public class XMLTableTreeContentProvider implements ITreeContentProvider, ITableLabelProvider, ITableColorProvider, ILabelProvider, CMDocumentManagerListener {
 
 	protected CMDocumentManager documentManager;
 
@@ -47,6 +53,10 @@
 
 	private TreeContentHelper treeContentHelper = new TreeContentHelper();
 
+	private CMDescriptionBuilder descriptionBuilder = new CMDescriptionBuilder();
+
+	private Color fCMColor = null;
+
 	public XMLTableTreeContentProvider() {
 		super();
 	}
@@ -72,6 +82,20 @@
 	}
 
 	public void dispose() {
+		if (documentManager != null) {
+			documentManager.removeListener(this);
+		}
+		if (fViewer != null && fViewer.getInput() != null) {
+			if (fViewer.getInput() instanceof IDOMNode) {
+				IJFaceNodeAdapterFactory factory = (IJFaceNodeAdapterFactory) ((IDOMNode) fViewer.getInput()).getModel().getFactoryRegistry().getFactoryFor(IJFaceNodeAdapter.class);
+				if (factory != null) {
+					factory.removeListener(fViewer);
+				}
+			}
+		}
+		if (fCMColor != null) {
+			fCMColor.dispose();
+		}
 	}
 
 	private void doDelayedRefreshForViewers() {
@@ -107,6 +131,22 @@
 		}
 		else if ((column == 1) && (object instanceof Node)) {
 			result = treeContentHelper.getNodeValue((Node) object);
+			if (result == null)
+				result = getElementValueHelper((Element) object);
+				
+		}
+		return result != null ? result : ""; //$NON-NLS-1$
+	}
+	
+	private String getElementValueHelper(Element element) {
+		String result = null;
+
+		ModelQuery mq = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
+		if ((result == null) && (mq != null)) {
+			CMElementDeclaration ed = mq.getCMElementDeclaration(element);
+			if ((ed != null) && !Boolean.TRUE.equals(ed.getProperty("isInferred"))) { //$NON-NLS-1$
+				result = descriptionBuilder.buildDescription(ed);
+			}
 		}
 		return result != null ? result : ""; //$NON-NLS-1$
 	}
@@ -317,4 +357,25 @@
 		// since we always return 'false' for "isLabelProperty",
 		// not need to listen. Maybe that should change some day?
 	}
+
+	public Color getBackground(Object element, int columnIndex) {
+		return null;
+	}
+
+	public Color getForeground(Object element, int columnIndex) {
+		if (columnIndex == 1 && treeContentHelper.getNodeValue((Node) element) == null)
+			return getCMColor();
+		return null;
+	}
+	
+	private Color getCMColor() {
+		if (fCMColor == null) {
+			Color background = Display.getCurrent().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
+			int r = Math.abs(background.getRed() - 125);
+			int g = Math.abs(background.getGreen() - 85);
+			int b = Math.abs(background.getBlue() - 105);
+			fCMColor = new Color(Display.getCurrent(), r, g, b);
+		}
+		return fCMColor;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeViewer.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeViewer.java
index 331f2d6..4a994d7 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeViewer.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeViewer.java
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others. All rights reserved. This
+ * Copyright (c) 2004, 2010 IBM Corporation and others. All rights reserved. This
  * program and the accompanying materials are made available under the terms
  * of the Eclipse Public License v1.0 which accompanies this distribution, and
  * is available at http://www.eclipse.org/legal/epl-v10.html
@@ -8,6 +8,8 @@
  ****************************************************************************/
 package org.eclipse.wst.xml.ui.internal.tabletree;
 
+import java.util.Iterator;
+
 import org.eclipse.jface.action.IMenuListener;
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.action.MenuManager;
@@ -17,12 +19,14 @@
 import org.eclipse.jface.util.LocalSelectionTransfer;
 import org.eclipse.jface.util.SafeRunnable;
 import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ICellModifier;
 import org.eclipse.jface.viewers.IPostSelectionProvider;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TextCellEditor;
 import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.dnd.DND;
@@ -33,14 +37,22 @@
 import org.eclipse.swt.dnd.DropTargetEvent;
 import org.eclipse.swt.dnd.DropTargetListener;
 import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
 import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Item;
 import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.TreeColumn;
 import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
@@ -137,22 +149,62 @@
 		}
 	}
 
-	protected CellEditor cellEditor;
+	private PaintListener fContentPaintListener = new PaintListener() {
 
-	protected XMLTreeExtension treeExtension;
-	
+		public void paintControl(PaintEvent e) {
+			GC gc = e.gc;
+			if (getTree().getItemCount() == 0) {
+				gc.setForeground(getTree().getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND));
+				gc.setBackground(getTree().getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
+				gc.drawString(XMLEditorMessages.XMLTreeExtension_3, 10, 10);
+				gc.drawString(XMLEditorMessages.XMLTreeExtension_4, 10, 10 + gc.getFontMetrics().getHeight());
+			}
+		}
+		
+	};
+
 	private ISelectionProvider fSelectionProvider = new SelectionProvider();
+	// node: 40%, content: 60%
+	static final double[] WEIGHTS = { .4, .6 };
+
+	private ControlAdapter fResizeAdapter = new ControlAdapter() {
+		public void controlResized(ControlEvent e) {
+			sizeColumns(getTree().getSize().x, WEIGHTS);
+		}
+
+		private void sizeColumns(int width, double[] weights) {
+			TreeColumn[] columns = getTree().getColumns();
+			int size = columns.length;
+			for (int i = 0; i < size; i++) {
+				columns[i].setWidth((int)(weights[i] * width));
+			}
+		}
+	};
 
 	public XMLTableTreeViewer(Composite parent) {
 		super(parent, SWT.FULL_SELECTION | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+		
+		TreeColumn column = new TreeColumn(this.getTree(), SWT.LEFT);
+		column.setText(XMLEditorMessages.XMLTableTreeViewer_1);
+
+		column = new TreeColumn(this.getTree(), SWT.LEFT);
+		column.setText(XMLEditorMessages.XMLTableTreeViewer_2);
+
+		this.getTree().setHeaderVisible(true);
+		this.getTree().setLinesVisible(true);
+		getTree().addControlListener(fResizeAdapter);
 
 		// set up providers
-		this.treeExtension = new XMLTreeExtension(getTree());
+		propertyDescriptorFactory = new XMLTableTreePropertyDescriptorFactory();
 
 		XMLTableTreeContentProvider provider = new XMLTableTreeContentProvider();
 		setContentProvider(provider);
 		setLabelProvider(provider);
 
+		setColumnProperties(new String[] {STRUCTURE_PROPERTY, VALUE_PROPERTY});
+		setCellEditors(new CellEditor[] {null, new TextCellEditor(this.getTree())});
+
+		setCellModifier(new XMLCMCellModifier());
 		createContextMenu();
 
 		DragSource dragSource = new DragSource(getControl(), DND.DROP_COPY | DND.DROP_MOVE);
@@ -161,6 +213,8 @@
 		DropTarget dropTarget = new DropTarget(getControl(), DND.DROP_COPY | DND.DROP_MOVE);
 		dropTarget.addDropListener(createDropTargetListener());
 		dropTarget.setTransfer(new Transfer[] {LocalSelectionTransfer.getTransfer()});
+
+		this.getTree().addPaintListener(fContentPaintListener);
 	}
 
 	/**
@@ -239,8 +293,23 @@
 					event.feedback = DND.FEEDBACK_INSERT_BEFORE;
 				}
 				event.feedback |= DND.FEEDBACK_EXPAND | DND.FEEDBACK_SCROLL;
+				if ( getLocalNodeSelection(event) == null){
+					event.detail = DND.DROP_NONE;
+				}
 			}
 
+			private IStructuredSelection getLocalNodeSelection(DropTargetEvent event){
+				IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection();
+				if (selection != null && !selection.isEmpty() ) {
+					for (Iterator i = selection.iterator(); i.hasNext();) {
+						Object node = i.next();
+						if (node instanceof Node){
+							return selection;
+						}
+					}
+				}
+				return null;
+			}
 			private float getHeightInItem(DropTargetEvent event) {
 				if(event.item == null) return .5f;
 				if (event.item instanceof TreeItem) {
@@ -265,7 +334,6 @@
 	}
 	
 	protected void doRefresh(Object o, boolean fromDelayed) {
-		treeExtension.resetCachedData();
 		super.refresh(o);
 	}
 
@@ -279,32 +347,11 @@
 
 	protected void handleDispose(DisposeEvent event) {
 		super.handleDispose(event);
-		treeExtension.dispose();
+		this.getTree().removePaintListener(fContentPaintListener);
+		getTree().removeControlListener(fResizeAdapter);
 		setDocument(null);
 	}
 
-	public void refresh() {
-		treeExtension.resetCachedData();
-		super.refresh();
-	}
-
-	public void refresh(Object o) {
-		treeExtension.resetCachedData();
-		super.refresh(o);
-	}
-
-	public void refresh(boolean updateLabels) {
-		treeExtension.resetCachedData();
-		super.refresh(updateLabels);
-		getControl().redraw();
-	}
-
-	public void refresh(Object element, boolean updateLabels) {
-		treeExtension.resetCachedData();
-		super.refresh(element, updateLabels);
-		getControl().redraw();
-	}
-
 	public void setDocument(IDocument document) {
 		/*
 		 * let the text editor to be the one that manages the model's lifetime
@@ -317,10 +364,6 @@
 				Document domDoc = null;
 				domDoc = ((IDOMModel) model).getDocument();
 				setInput(domDoc);
-				treeExtension.setIsUnsupportedInput(false);
-			}
-			else {
-				treeExtension.setIsUnsupportedInput(true);
 			}
 		}
 		finally {
@@ -330,5 +373,56 @@
 		}
 
 	}
+	
+	protected TreeContentHelper treeContentHelper = new TreeContentHelper();
+	protected XMLTableTreePropertyDescriptorFactory propertyDescriptorFactory;
+	
+	private final static String STRUCTURE_PROPERTY = XMLEditorMessages.XMLTreeExtension_0;
+	private final static String VALUE_PROPERTY = XMLEditorMessages.XMLTreeExtension_1;
+	
+	public class XMLCMCellModifier implements ICellModifier, TreeExtension.ICellEditorProvider {
+		public boolean canModify(Object element, String property) {
+			boolean result = false;
+			if (element instanceof Node) {
+				Node node = (Node) element;
+				if (property == VALUE_PROPERTY) {
+					result = treeContentHelper.isEditable(node);
+					if (result) {
+						/* Set up the cell editor based on the element */
+						CellEditor[] editors = getCellEditors();
+						if (editors.length > 0) {
+							if (editors[1] != null)
+								editors[1].dispose();
+							editors[1] = getCellEditor(element, 1);
+						}
+					}
+					
+				}
+			}
+			return result;
+		}
+
+		public Object getValue(Object object, String property) {
+			String result = null;
+			if (object instanceof Node) {
+				result = treeContentHelper.getNodeValue((Node) object);
+			}
+			return (result != null) ? result : ""; //$NON-NLS-1$
+		}
+
+		public void modify(Object element, String property, Object value) {
+			Item item = (Item) element;
+			String oldValue = treeContentHelper.getNodeValue((Node) item.getData());
+			String newValue = value.toString();
+			if ((newValue != null) && !newValue.equals(oldValue)) {
+				treeContentHelper.setNodeValue((Node) item.getData(), value.toString(), getControl().getShell());
+			}
+		}
+
+		public CellEditor getCellEditor(Object o, int col) {
+			IPropertyDescriptor pd = propertyDescriptorFactory.createPropertyDescriptor(o);
+			return pd != null ? pd.createPropertyEditor(XMLTableTreeViewer.this.getTree()) : null;
+		}
+	}
 
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTreeExtension.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTreeExtension.java
index 152166b..b8601f8 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTreeExtension.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTreeExtension.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -28,6 +28,10 @@
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
+/**
+ * 
+ * @deprecated No longer used
+ */
 public class XMLTreeExtension extends TreeExtension {
 
 	public final static String STRUCTURE_PROPERTY = XMLEditorMessages.XMLTreeExtension_0;
@@ -50,7 +54,8 @@
 		String[] properties = {STRUCTURE_PROPERTY, VALUE_PROPERTY};
 		setColumnProperties(properties);
 
-		f1 = tree.getDisplay().getSystemColor(SWT.COLOR_BLACK);
+		/* https://bugs.eclipse.org/bugs/show_bug.cgi?id=185851 - Used to be hardcoded as COLOR_BLACK */
+		f1 = tree.getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND);
 		Color background = tree.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
 
 		int r = Math.abs(background.getRed() - 125);
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/GroupNamePropertyTester.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/GroupNamePropertyTester.java
new file mode 100644
index 0000000..7c3e9bc
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/GroupNamePropertyTester.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.ui.internal.validation.core.errorinfo;
+
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.core.resources.IMarker;
+
+
+/**
+ * Custom property tester used to determine if the groupName attribute is
+ * present on a marker and that its value starts with a given expected value.
+ */
+public class GroupNamePropertyTester extends PropertyTester
+{
+  /**
+   * The group name prefix property name.
+   */
+  private static final String GROUP_NAME_PREFIX = "groupNamePrefix"; //$NON-NLS-1$  
+
+  /**
+   * The group name marker attribute.
+   */
+  private static final String GROUP_NAME = "groupName"; //$NON-NLS-1$
+
+  public boolean test(Object receiver, String property, Object[] args, Object expectedValue)
+  {
+    if (GROUP_NAME_PREFIX.equals(property))
+    {
+      if (receiver instanceof IMarker)
+      {
+        IMarker marker = (IMarker)receiver;
+
+        String groupName = marker.getAttribute(GROUP_NAME, null);
+
+        boolean testValue = groupName != null && expectedValue instanceof String && groupName.startsWith((String)expectedValue);
+        return testValue;
+      }
+    }
+
+    return false;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorActionDelegate.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorActionDelegate.java
deleted file mode 100644
index 44fb87b..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorActionDelegate.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.validation.core.errorinfo;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.actions.ActionDelegate;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.eclipse.wst.xml.ui.internal.validation.XMLValidationUIMessages;
-
-public class ReferencedFileErrorActionDelegate extends ActionDelegate implements IObjectActionDelegate {
-	protected IMarker selectedMarker;
-
-	/**
-	 * 
-	 */
-	public ReferencedFileErrorActionDelegate() {
-		super();
-	}
-
-	public void run(IAction action) {
-		if (selectedMarker != null) {
-			try {
-
-				Map map = (Map) selectedMarker.getResource().getSessionProperty(ValidationMessage.ERROR_MESSAGE_MAP_QUALIFIED_NAME);
-				if (map == null) {
-					String infoUnavailable = XMLValidationUIMessages._UI_DETAILS_INFORMATION_UNAVAILABLE;
-					String revalidateToRegenerateErrors = XMLValidationUIMessages._UI_DETAILS_INFO_REVALIDATE_TO_REGENERATE;
-					MessageDialog.openInformation(Display.getCurrent().getActiveShell(), infoUnavailable, revalidateToRegenerateErrors);
-				}
-				else {
-					String uri = null;
-
-					String groupName = (String) selectedMarker.getAttribute("groupName"); //$NON-NLS-1$
-					if (groupName.startsWith("referencedFileError")) //$NON-NLS-1$
-					{
-						int index1 = groupName.indexOf("("); //$NON-NLS-1$
-						int index2 = groupName.lastIndexOf(")"); //$NON-NLS-1$
-						if ((index1 != -1) && (index2 > index1)) {
-							uri = groupName.substring(index1 + 1, index2);
-						}
-					}
-
-					if (uri != null) {
-						List list = Collections.EMPTY_LIST;
-
-						ValidationMessage message = (ValidationMessage) map.get(uri);
-						if (message != null) {
-							list = message.getNestedMessages();
-						}
-
-						String validatedFileURI = selectedMarker.getResource().getLocation().toOSString();// URIHelper.normalize(selectedMarker.getResource().getLocation().toOSString());
-						validatedFileURI = "file:/" + validatedFileURI; //$NON-NLS-1$
-
-						ReferencedFileErrorDialog dialog = new ReferencedFileErrorDialog(Display.getCurrent().getActiveShell(), list, validatedFileURI, uri);
-						dialog.createAndOpen();
-					}
-				}
-			}
-			catch (CoreException e) {
-				// Do nothing.
-			}
-		}
-	}
-
-	public void selectionChanged(IAction action, ISelection selection) {
-		super.selectionChanged(action, selection);
-		selectedMarker = null;
-		if (selection instanceof IStructuredSelection) {
-			try {
-				Object first = ((IStructuredSelection) selection).getFirstElement();
-
-				IMarker marker = (IMarker) first;
-				selectedMarker = marker;
-				// String groupName = (String)
-				// marker.getAttribute("groupName");
-				// if (groupName.startsWith("referencedFileError"))
-				// {
-				// selectedMarker = marker;
-				// }
-			}
-			catch (Exception e) {
-				// Do nothing.
-			}
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction,
-	 *      org.eclipse.ui.IWorkbenchPart)
-	 */
-	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
-		// dw int i = 0;
-	}
-}
-
-/*
- * private static void printMap(Map map) { for (Iterator i =
- * map.keySet().iterator(); i.hasNext();) { String key = (String) i.next();
- * System.out.println("entry : " + key + " = " + map.get(key)); } }
- * 
- * private void printErrorMap(Map map) { for (Iterator i =
- * map.keySet().iterator(); i.hasNext();) { String key = (String) i.next();
- * ErrorMessage message = (ErrorMessage) map.get(key); if (message != null) {
- * printErrorMessage(message); } } }
- * 
- * private void printErrorMessage(ErrorMessage errorMessage) {
- * System.out.println(errorMessage.getText()); for (Iterator i =
- * errorMessage.getNestedErrors().iterator(); i.hasNext();) {
- * printErrorMessage((ErrorMessage) i.next()); } }
- */
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorUtility.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorUtility.java
index be74372..378ee89 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorUtility.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorUtility.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,19 +16,21 @@
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.content.IContentType;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IEditorDescriptor;
 import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorRegistry;
 import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.editors.text.TextEditor;
 import org.eclipse.ui.part.FileEditorInput;
 import org.eclipse.ui.texteditor.IDocumentProvider;
 import org.eclipse.wst.xml.core.internal.validation.core.logging.LoggerFactory;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
 
 
 public class ReferencedFileErrorUtility {
@@ -46,41 +48,44 @@
 						{
 							path = path.setDevice(device.substring(1));
 						}
-						IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
-						if ((file != null) && file.exists()) {
-							// WorkbenchUtility.openEditor(file);
+						final IFile iFile = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
+						if ((iFile != null) && iFile.exists()) {
 							// Open the editor for this file.
-							final IFile iFile = file;
-							IWorkbench workbench = XMLUIPlugin.getInstance().getWorkbench();
+							final IWorkbench workbench = PlatformUI.getWorkbench();
 							final IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
 
 							Display.getDefault().asyncExec(new Runnable() {
 								public void run() {
 									try {
-										IEditorDescriptor descriptor = XMLUIPlugin.getInstance().getWorkbench().getEditorRegistry().getDefaultEditor(iFile.getName());
+										IContentType contentType = iFile.getContentDescription().getContentType();
+										IEditorRegistry editorRegistry = workbench.getEditorRegistry();
+										String fileName = iFile.getName();
+										IEditorDescriptor descriptor = editorRegistry.getDefaultEditor(fileName, contentType);
 										String editorId;
 										if (descriptor != null) {
 											editorId = descriptor.getId();
 										}
 										else {
-											editorId = XMLUIPlugin.getInstance().getWorkbench().getEditorRegistry().getDefaultEditor(iFile.getName() + ".txt").getId(); //$NON-NLS-1$
+											descriptor = editorRegistry.getDefaultEditor(fileName + ".txt"); //$NON-NLS-1$
+											editorId = descriptor.getId(); 
 										}
-										workbenchWindow.getActivePage().openEditor(new FileEditorInput(iFile), editorId);
+										
+										if (editorId != null)
+										{
+										  FileEditorInput editorInput = new FileEditorInput(iFile);
+										  IWorkbenchPage activePage = workbenchWindow.getActivePage();
+										  activePage.openEditor(editorInput, editorId);
+										}
 									}
-									catch (PartInitException ex) {
+									catch (Exception ex) {
 										LoggerFactory.getLoggerInstance().logError("Exception encountered when attempting to open file: " + iFile + "\n\n", ex); //$NON-NLS-1$ //$NON-NLS-2$
-										// B2BGUIPlugin.getPlugin().getMsgLogger().write("Exception
-										// encountered when attempting to open
-										// file: " + iFile + "\n\n" + ex);
 									}
 								}
 							});
 
 							Runnable runnable = new Runnable() {
 								public void run() {
-									// IEditorPart editorPart =
-									// WorkbenchUtility.getActiveEditor();
-									IEditorPart editorPart = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+									IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
 									gotoError(editorPart, line, column);
 								}
 							};
diff --git a/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorsHandler.java b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorsHandler.java
new file mode 100644
index 0000000..3db6243
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorsHandler.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.ui.internal.validation.core.errorinfo;
+
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.views.markers.MarkerViewHandler;
+import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
+import org.eclipse.wst.xml.ui.internal.validation.XMLValidationUIMessages;
+
+
+/**
+ * Handler for the referenced file errors command. This class replaces the old
+ * ReferencedFileErrorActionDelegate.
+ */
+public class ReferencedFileErrorsHandler extends MarkerViewHandler
+{
+  public Object execute(ExecutionEvent event) throws ExecutionException
+  {
+    final IMarker[] selectedMarkers = getSelectedMarkers(event);
+
+    IMarker selectedMarker = selectedMarkers[0];
+
+    if (selectedMarker != null)
+    {
+      try
+      {
+
+        IResource resource = selectedMarker.getResource();
+        Map map = (Map)resource.getSessionProperty(ValidationMessage.ERROR_MESSAGE_MAP_QUALIFIED_NAME);
+        if (map == null)
+        {
+          String infoUnavailable = XMLValidationUIMessages._UI_DETAILS_INFORMATION_UNAVAILABLE;
+          String revalidateToRegenerateErrors = XMLValidationUIMessages._UI_DETAILS_INFO_REVALIDATE_TO_REGENERATE;
+          MessageDialog.openInformation(Display.getCurrent().getActiveShell(), infoUnavailable, revalidateToRegenerateErrors);
+        }
+        else
+        {
+          String uri = null;
+
+          String groupName = (String)selectedMarker.getAttribute("groupName"); //$NON-NLS-1$
+          if (groupName.startsWith("referencedFileError")) //$NON-NLS-1$
+          {
+            int index1 = groupName.indexOf("("); //$NON-NLS-1$
+            int index2 = groupName.lastIndexOf(")"); //$NON-NLS-1$
+            if ((index1 != -1) && (index2 > index1))
+            {
+              uri = groupName.substring(index1 + 1, index2);
+            }
+          }
+
+          if (uri != null)
+          {
+            List list = Collections.EMPTY_LIST;
+
+            ValidationMessage message = (ValidationMessage)map.get(uri);
+            if (message != null)
+            {
+              list = message.getNestedMessages();
+            }
+
+            IPath resourceLocation = resource.getLocation();
+            
+            if (resourceLocation != null)
+            {
+              String validatedFileURI = resourceLocation.toOSString();
+              validatedFileURI = "file:/" + validatedFileURI; //$NON-NLS-1$
+
+              ReferencedFileErrorDialog dialog = new ReferencedFileErrorDialog(
+                HandlerUtil.getActiveShell(event),
+                list,
+                validatedFileURI,
+                uri);
+              dialog.createAndOpen();
+            }
+          }
+        }
+      }
+      catch (CoreException e)
+      {
+        // Do nothing.
+      }
+    }
+
+    return this;
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExportXMLCatalogWizard.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExportXMLCatalogWizard.java
index a079682..478d459 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExportXMLCatalogWizard.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExportXMLCatalogWizard.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 Standards for Technology in Automotive Retail (STAR) and
+ * Copyright (c) 2007, 2008 Standards for Technology in Automotive Retail (STAR) and
  * others. All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,6 +15,8 @@
 
 import java.io.File;
 
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.IWorkspace;
 import org.eclipse.core.resources.IWorkspaceRoot;
 import org.eclipse.core.resources.ResourcesPlugin;
@@ -22,6 +24,7 @@
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IExportWizard;
 import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
 import org.eclipse.ui.wizards.newresource.BasicNewFileResourceWizard;
 import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
 import org.eclipse.wst.xml.core.internal.catalog.CatalogSet;
@@ -29,7 +32,6 @@
 import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
 import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
 import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
 
 public class ExportXMLCatalogWizard extends BasicNewFileResourceWizard implements IExportWizard {
 
@@ -65,9 +67,10 @@
 		String fullPath = workspacePath + exportPage.getContainerFullPath().toOSString();
 		String requiredString=fullPath + File.separator + exportPage.getFileName();
 		try {
-			exportPage.createNewFile();
+			IFile file = exportPage.createNewFile();
 			workingUserCatalog.setLocation(requiredString);
 			workingUserCatalog.save();
+			file.refreshLocal(IResource.DEPTH_ZERO, null);
 		} catch (Exception ex) {
 			return false;
 		}
@@ -78,6 +81,8 @@
 		exportPage = new WizardNewFileCreationPage("XML Catalog Export",  getSelection());
 		exportPage.setTitle(XMLWizardsMessages._UI_DIALOG_XMLCATALOG_EXPORT_TITLE);
 		exportPage.setDescription(XMLWizardsMessages._UI_DIALOG_XMLCATALOG_EXPORT_DESCRIPTION);
+		exportPage.setFileExtension("xml"); //$NON-NLS-1$
+		
 		addPage(exportPage);
 	}
 	
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ImportXMLCatalogPage.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ImportXMLCatalogPage.java
index c069d54..38e3447 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ImportXMLCatalogPage.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ImportXMLCatalogPage.java
@@ -14,7 +14,9 @@
 package org.eclipse.wst.xml.ui.internal.wizards;
 
 import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
@@ -52,6 +54,11 @@
 		selectSingleFileView.addFilterExtensions(extensions);
 		selectSingleFileView.createControl(composite);
 		selectSingleFileView.setVisibleHelper(true);
+		selectSingleFileView.addSelectionChangedTreeListener(new ISelectionChangedListener(){
+			public void selectionChanged(SelectionChangedEvent event) {
+				ImportXMLCatalogPage.this.setPageComplete(selectSingleFileView.getFile() != null);
+			}
+		});
 		setControl(composite);
 	}
 
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ImportXMLCatalogWizard.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ImportXMLCatalogWizard.java
index 7f86e0f..f1200a2 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ImportXMLCatalogWizard.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ImportXMLCatalogWizard.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 Standards for Technology in Automotive Retail (STAR) and
+ * Copyright (c) 2008 Standards for Technology in Automotive Retail (STAR) and
  * others. All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -54,6 +54,10 @@
 		workingUserCatalog.addEntriesFromCatalog(userCatalog);
 	}
 	
+	public boolean canFinish() {
+		return importPage.isPageComplete();
+	}
+
 	public boolean performFinish() {
 		IFile file = importPage.getFile();
 		if (file != null) {
@@ -86,7 +90,7 @@
 		importPage.setDescription(XMLWizardsMessages._UI_DIALOG_XMLCATALOG_IMPORT_DESCRIPTION);
 		importPage.setMessage(XMLCatalogMessages.UI_LABEL_IMPORT_DIALOG_MESSAGE);
 		addPage(importPage);
-		
+		importPage.setPageComplete(false);
 	}
 }
 
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewModelWizard.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewModelWizard.java
index 9cfcd23..4a400f2 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewModelWizard.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewModelWizard.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -249,7 +249,11 @@
 			}
 			// no fileExtension, let's check for this file with default file
 			// extension
-			fullFileName += defaultFileExtension;
+			if (fullFileName.lastIndexOf('.') == -1)
+			{
+				fullFileName += defaultFileExtension;
+			}
+
 			if ((getContainerFullPath() != null) && (getContainerFullPath().isEmpty() == false) && (getFileName().compareTo("") != 0)) //$NON-NLS-1$
 			{
 				Path fullPath = new Path(getContainerFullPath().toString() + '/' + fullFileName);
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLGenerator.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLGenerator.java
index 406a406..476a754 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLGenerator.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLGenerator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -56,6 +56,7 @@
 	protected String rootElementName;
 
 	protected ICatalogEntry xmlCatalogEntry;
+	protected int optionalElementDepthLimit = -1;
 
 	// info for dtd
 	protected String publicId;
@@ -119,11 +120,15 @@
 	}
 	
 	private String applyLineDelimiter(IFile file, String text) {
-		String lineDelimiter = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, System.getProperty("line.separator"), new IScopeContext[] {new ProjectScope(file.getProject()), new InstanceScope() });//$NON-NLS-1$
-		String convertedText = StringUtils.replace(text, "\r\n", "\n");
-		convertedText = StringUtils.replace(convertedText, "\r", "\n");
-		convertedText = StringUtils.replace(convertedText, "\n", lineDelimiter);
-		return convertedText;
+		String systemLineSeparator = System.getProperty("line.separator");
+		String lineDelimiter = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, systemLineSeparator, new IScopeContext[] {new ProjectScope(file.getProject()), new InstanceScope() });//$NON-NLS-1$
+		if(!systemLineSeparator.equals(lineDelimiter)) {
+			String convertedText = StringUtils.replace(text, "\r\n", "\n");
+			convertedText = StringUtils.replace(convertedText, "\r", "\n");
+			convertedText = StringUtils.replace(convertedText, "\n", lineDelimiter);
+			return convertedText;
+		}
+		return text;
 	}
 
 	/**
@@ -211,6 +216,7 @@
 		//
 		contentBuilder.supressCreationOfDoctypeAndXMLDeclaration = true;
 		contentBuilder.setBuildPolicy(buildPolicy);
+		contentBuilder.setOptionalElementDepthLimit(optionalElementDepthLimit);
 		contentBuilder.setExternalCMDocumentSupport(new MyExternalCMDocumentSupport(namespaceInfoList, xmlFileName));
 		contentBuilder.createDefaultRootContent(cmDocument, cmElementDeclaration, namespaceInfoList);
 
@@ -409,4 +415,8 @@
 		}
 		return result;
 	}
+	
+	public void setOptionalElementDepthLimit(int optionalElementDepthLimit) {
+		this.optionalElementDepthLimit = optionalElementDepthLimit;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLTemplatesWizardPage.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLTemplatesWizardPage.java
index 929a01f..0a4b580 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLTemplatesWizardPage.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLTemplatesWizardPage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -230,16 +230,10 @@
 		GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
 		innerParent.setLayoutData(gd);
 
-		// Create linked text to just to templates preference page
-		Link link = new Link(innerParent, SWT.NONE);
-		link.setText(XMLWizardsMessages.NewXMLTemplatesWizardPage_6);
+		Label label = new Label(innerParent, SWT.NONE);
+		label.setText(XMLWizardsMessages.NewXMLTemplatesWizardPage_7);
 		data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
-		link.setLayoutData(data);
-		link.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				linkClicked();
-			}
-		});
+		label.setLayoutData(data);
 
 		// create table that displays templates
 		Table table = new Table(innerParent, SWT.BORDER | SWT.FULL_SELECTION);
@@ -295,6 +289,17 @@
 		fTemplateStore = XMLUIPlugin.getDefault().getTemplateStore();
 		fTableViewer.setInput(fTemplateStore);
 
+		// Create linked text to just to templates preference page
+		Link link = new Link(parent, SWT.NONE);
+		link.setText(XMLWizardsMessages.NewXMLTemplatesWizardPage_6);
+		data = new GridData(SWT.END, SWT.FILL, true, false, 2, 1);
+		link.setLayoutData(data);
+		link.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				linkClicked();
+			}
+		});
+
 		configureTableResizing(innerParent, table, column1, column2);
 		loadLastSavedPreferences();
 
@@ -325,7 +330,7 @@
 			}
 		};
 		SourceViewer viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
-		((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+		viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
 		IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForXML.ContentTypeID_XML);
 		IDocument document = scratchModel.getStructuredDocument();
 		viewer.configure(sourceViewerConfiguration);
@@ -347,6 +352,8 @@
 		data = new GridData(GridData.FILL_BOTH);
 		data.horizontalSpan = 2;
 		data.heightHint = convertHeightInCharsToPixels(5);
+		// [261274] - source viewer was growing to fit the max line width of the template
+		data.widthHint = convertWidthInCharsToPixels(2);
 		control.setLayoutData(data);
 
 		return viewer;
@@ -439,15 +446,24 @@
 	 * Load the last template name used in New XML File wizard.
 	 */
 	private void loadLastSavedPreferences() {
+		fLastSelectedTemplateName = ""; //$NON-NLS-1$
+		boolean setSelection = false;
 		String templateName = XMLUIPlugin.getDefault().getPreferenceStore().getString(XMLUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
-		if ((templateName == null) || (templateName.length() == 0)) {
-			fLastSelectedTemplateName = ""; //$NON-NLS-1$
-			fUseTemplateButton.setSelection(false);
+		if (templateName == null || templateName.length() == 0) {
+			templateName = XMLUIPlugin.getDefault().getPreferenceStore().getString(XMLUIPreferenceNames.NEW_FILE_TEMPLATE_ID);
+			if (templateName != null && templateName.length() > 0) {
+				Template template = fTemplateStore.findTemplateById(templateName);
+				if (template != null) {
+					fLastSelectedTemplateName = template.getName();
+					setSelection = true;
+				}
+			}
 		}
 		else {
 			fLastSelectedTemplateName = templateName;
-			fUseTemplateButton.setSelection(true);
+			setSelection = true;
 		}
+		fUseTemplateButton.setSelection(setSelection);
 		enableTemplates();
 	}
 
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLWizard.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLWizard.java
index ff05e40..bc77849 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLWizard.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLWizard.java
@@ -11,17 +11,22 @@
  *******************************************************************************/
 package org.eclipse.wst.xml.ui.internal.wizards;
 
+import java.io.File;
+import java.lang.reflect.InvocationTargetException;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Vector;
 
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Preferences;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.util.Assert;
 import org.eclipse.jface.viewers.IStructuredSelection;
@@ -31,6 +36,7 @@
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.GridData;
@@ -39,8 +45,10 @@
 import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.IEditorDescriptor;
@@ -79,6 +87,10 @@
 	protected static final String[] filePageFilterExtensions = {".xml"}; //$NON-NLS-1$
 	protected static final String[] browseXSDFilterExtensions = {".xsd"}; //$NON-NLS-1$
 	protected static final String[] browseDTDFilterExtensions = {".dtd"}; //$NON-NLS-1$
+	
+	protected static final int OPTIONAL_ELEMENT_DEPTH_LIMIT_DEFAULT_VALUE = 2;
+	
+	protected static final long XML_EDITOR_FILE_SIZE_LIMIT = 26214400; // 25 mb
 
 	protected NewFilePage newFilePage;
 	/**
@@ -286,21 +298,33 @@
 					newFilePage.setFileName(fileName.concat(newFilePage.defaultFileExtension));
 				}
 
-				IFile newFile = newFilePage.createNewFile();
-				String xmlFileName = newFile.getLocation().toOSString();
+				final IFile newFile = newFilePage.createNewFile();
+				final String xmlFileName = newFile.getLocation().toOSString();
+				final String grammarFileName = fileName;
 
 				if (getContainer().getCurrentPage() == selectRootElementPage) {
 
-					generator.createXMLDocument(newFile, xmlFileName);
+					int limit = selectRootElementPage.getOptionalElementDepthLimit();
+					generator.setOptionalElementDepthLimit(limit);
+					setNeedsProgressMonitor(true);
+					getContainer().run(true, false, new IRunnableWithProgress(){
+						public void run(IProgressMonitor progressMonitor) throws InvocationTargetException, InterruptedException {
+							progressMonitor.beginTask(XMLWizardsMessages._UI_WIZARD_GENERATING_XML_DOCUMENT, IProgressMonitor.UNKNOWN);
+							try {
+								generator.createXMLDocument(newFile, xmlFileName);
+							} catch (Exception exception) {
+								Logger.logException("Exception completing New XML wizard " + grammarFileName, exception); //$NON-NLS-1$
+							}
+							progressMonitor.done();
+						}
+					});
 				}
 				else {
 					// put template contents into file
 					String templateString = fNewXMLTemplatesWizardPage.getTemplateString();
 					generator.createTemplateXMLDocument(newFile, templateString);
 				}
-
-				newFile.refreshLocal(1, null);
-
+				newFile.refreshLocal(IResource.DEPTH_ONE, null);
 				IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
 				BasicNewResourceWizard.selectAndReveal(newFile, workbenchWindow);
 				openEditor(newFile);
@@ -313,32 +337,39 @@
 	}
 
 	public void openEditor(IFile file) {
-		// Open editor on new file.
-		String editorId = null;
-		try {
-			IEditorDescriptor editor = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(file.getLocation().toOSString(), file.getContentDescription().getContentType());
-			if (editor != null) {
-				editorId = editor.getId();
-			}
+		long length = 0;
+		IPath location = file.getLocation();
+		if (location != null) {
+			File localFile = location.toFile();
+			length = localFile.length();
 		}
-		catch (CoreException e1) {
-			// editor id could not be retrieved, so we can not open editor
-			return;
-		}
-		IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-		try {
-			if (dw != null) {
-				IWorkbenchPage page = dw.getActivePage();
-				if (page != null) {
-					page.openEditor(new FileEditorInput(file), editorId, true);
+		if(length < XML_EDITOR_FILE_SIZE_LIMIT) {
+			// Open editor on new file.
+			String editorId = null;
+			try {
+				IEditorDescriptor editor = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(file.getLocation().toOSString(), file.getContentDescription().getContentType());
+				if (editor != null) {
+					editorId = editor.getId();
 				}
 			}
+			catch (CoreException e1) {
+				// editor id could not be retrieved, so we can not open editor
+				return;
+			}
+			IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+			try {
+				if (dw != null) {
+					IWorkbenchPage page = dw.getActivePage();
+					if (page != null) {
+						page.openEditor(new FileEditorInput(file), editorId, true);
+					}
+				}
+			}
+			catch (PartInitException e) {
+				// editor can not open for some reason
+				return;
+			}
 		}
-		catch (PartInitException e) {
-			// editor can not open for some reason
-			return;
-		}
-
 	}
 
 
@@ -449,6 +480,9 @@
 		protected PageBook pageBook;
 		protected XSDOptionsPanel xsdOptionsPanel;
 		protected DTDOptionsPanel dtdOptionsPanel;
+		protected Text limitOptionalElementDepthTextControl;
+		protected Button limitOptionalElementDepthCheckButtonControl;
+		 
 
 
 		SelectRootElementPage() {
@@ -496,6 +530,51 @@
 				radioButton[1].setSelection(false);
 				PlatformUI.getWorkbench().getHelpSystem().setHelp(radioButton[1], IXMLWizardHelpContextIds.XML_NEWWIZARD_SELECTROOTELEMENT2_HELPID);
 
+				radioButton[1].addSelectionListener(new SelectionAdapter(){
+					public void widgetSelected(SelectionEvent selectionEvent) {
+						boolean enabled = radioButton[1].getSelection();
+						limitOptionalElementDepthCheckButtonControl.setEnabled(enabled);
+						enabled = enabled && limitOptionalElementDepthCheckButtonControl.getSelection();
+						limitOptionalElementDepthTextControl.setEnabled(enabled);
+					}
+				});
+				Composite composite = new Composite(group, SWT.NONE);
+				GridLayout gridLayout = new GridLayout();
+				gridLayout.marginHeight = 0;
+				gridLayout.marginWidth = 0;
+				gridLayout.numColumns = 2;
+				gridLayout.marginLeft = 20;
+				composite.setLayout(gridLayout);
+				limitOptionalElementDepthCheckButtonControl = new Button(composite, SWT.CHECK);
+				limitOptionalElementDepthCheckButtonControl.setText(XMLWizardsMessages._UI_WIZARD_LIMIT_OPTIONAL_ELEMENT_DEPTH);
+				limitOptionalElementDepthCheckButtonControl.setEnabled(false);
+				limitOptionalElementDepthCheckButtonControl.setSelection(true);
+				limitOptionalElementDepthCheckButtonControl.addSelectionListener(new SelectionAdapter(){
+					public void widgetSelected(SelectionEvent selectionEvent) {
+						boolean enabled = limitOptionalElementDepthCheckButtonControl.getSelection();
+						limitOptionalElementDepthTextControl.setEnabled(enabled);
+					}
+				});
+				limitOptionalElementDepthTextControl = new Text(composite, SWT.BORDER);
+				limitOptionalElementDepthTextControl.setText(Integer.toString(OPTIONAL_ELEMENT_DEPTH_LIMIT_DEFAULT_VALUE));
+				limitOptionalElementDepthTextControl.setEnabled(false);
+				GridData gridaData = new GridData();
+				gridaData.widthHint = 25;
+				limitOptionalElementDepthTextControl.setLayoutData(gridaData);
+				limitOptionalElementDepthTextControl.addListener(SWT.Verify, new Listener() {
+					public void handleEvent(Event event) {
+						String string = event.text;
+						char[] chars = new char[string.length()];
+						string.getChars(0, chars.length, chars, 0);
+						for (int i = 0; i < chars.length; i++) {
+							if (!('0' <= chars[i] && chars[i] <= '9')) {
+								event.doit = false;
+								return;
+							}
+						}
+					}
+				});
+				
 				radioButton[2] = new Button(group, SWT.CHECK);
 				radioButton[2].setText(XMLWizardsMessages._UI_WIZARD_CREATE_FIRST_CHOICE);
 				radioButton[2].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -666,6 +745,16 @@
 			}
 			return defaultPrefix;
 		}
+		
+		public int getOptionalElementDepthLimit() {
+			int depth = -1;
+			if(radioButton[1].getSelection() && limitOptionalElementDepthCheckButtonControl.getSelection()) {
+				try {
+					depth = Integer.parseInt(limitOptionalElementDepthTextControl.getText());
+				} catch( Exception exception) {}
+			}
+			return depth;
+		}
 
 		public boolean isPageComplete() {
 			boolean complete = ((generator.getRootElementName() != null) && (generator.getRootElementName().length() > 0)) && (getErrorMessage() == null);
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizardsMessages.java b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizardsMessages.java
index a1e01bb..61e8947 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizardsMessages.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizardsMessages.java
@@ -1,5 +1,5 @@
 /**********************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others. All rights reserved.   This
+ * Copyright (c) 2005, 2010 IBM Corporation and others. All rights reserved.   This
  * program and the accompanying materials are made available under the terms of
  * the Eclipse Public License v1.0 which accompanies this distribution, and is
  * available at http://www.eclipse.org/legal/epl-v10.html
@@ -81,11 +81,15 @@
 	public static String NewXMLTemplatesWizardPage_4;
 	public static String NewXMLTemplatesWizardPage_5;
 	public static String NewXMLTemplatesWizardPage_6;
+	public static String NewXMLTemplatesWizardPage_7;
 	
 	public static String _UI_DIALOG_XMLCATALOG_IMPORT_TITLE;
 	public static String _UI_DIALOG_XMLCATALOG_EXPORT_TITLE;
 	public static String _UI_DIALOG_XMLCATALOG_EXPORT_DESCRIPTION;
     public static String _UI_DIALOG_XMLCATALOG_IMPORT_DESCRIPTION;
+    public static String _UI_WIZARD_LIMIT_OPTIONAL_ELEMENT_DEPTH;
+    public static String _UI_WIZARD_GENERATING_XML_DOCUMENT;
+    
 	static {
 		// load message values from bundle file
 		NLS.initializeMessages(BUNDLE_NAME, XMLWizardsMessages.class);
diff --git a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/wizardResource.properties b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/wizardResource.properties
index 0bd7bac..06a2a6f 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/wizardResource.properties
+++ b/bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/wizardResource.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2007 IBM Corporation and others.
+# Copyright (c) 2001, 2009 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -24,7 +24,7 @@
 _UI_RADIO_XML_FROM_SCRATCH            = Create XML file from an XML &template
 _UI_WIZARD_CREATE_XML_HEADING         = Create XML File From
 _UI_WIZARD_CREATE_XML_EXPL            = Select how you would like to create your XML file.
-_UI_WIZARD_CREATE_XML_FILE_HEADING    = XML File
+_UI_WIZARD_CREATE_XML_FILE_HEADING    = XML
 _UI_WIZARD_CREATE_XML_FILE_EXPL       = Create a new XML file.
 _UI_WIZARD_SELECT_DTD_FILE_DESC       = Select the DTD file to create the XML file.
 _UI_WIZARD_SELECT_DTD_FILE_TITLE      = Select DTD File
@@ -43,6 +43,8 @@
 
 _UI_WIZARD_CREATE_REQUIRED            = &Create required content only
 _UI_WIZARD_CREATE_OPTIONAL            = Create required and &optional content
+_UI_WIZARD_LIMIT_OPTIONAL_ELEMENT_DEPTH = L&imit optional element depth to:
+_UI_WIZARD_GENERATING_XML_DOCUMENT	  = Generating XML document...
 
 _UI_WIZARD_CREATE_OPTIONAL_ATTRIBUTES = Create optional &attributes
 _UI_WIZARD_CREATE_OPTIONAL_ELEMENTS   = Create optional e&lements
@@ -94,6 +96,7 @@
 NewXMLTemplatesWizardPage_1=Select a template as initial content in the XML page.
 NewXMLTemplatesWizardPage_2=Name
 NewXMLTemplatesWizardPage_3=Description
-NewXMLTemplatesWizardPage_4=Use XML Template
-NewXMLTemplatesWizardPage_5=Preview:
+NewXMLTemplatesWizardPage_4=&Use XML Template
+NewXMLTemplatesWizardPage_5=&Preview:
 NewXMLTemplatesWizardPage_6=Templates are 'New XML' templates found in the <a>XML Templates</a> preference page.
+NewXMLTemplatesWizardPage_7=&Templates:
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java
index b3dd5a7..2c11ee3 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -35,10 +35,10 @@
 import org.eclipse.wst.xml.core.text.IXMLPartitions;
 import org.eclipse.wst.xml.ui.internal.XMLFormattingStrategy;
 import org.eclipse.wst.xml.ui.internal.autoedit.AutoEditStrategyForTabs;
-import org.eclipse.wst.xml.ui.internal.contentassist.NoRegionContentAssistProcessor;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistProcessor;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLStructuredContentAssistProcessor;
 import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
 import org.eclipse.wst.xml.ui.internal.style.LineStyleProviderForXML;
+import org.w3c.dom.Attr;
 import org.w3c.dom.Node;
 
 /**
@@ -99,18 +99,15 @@
 		}
 		return fConfiguredContentTypes;
 	}
-
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration#getContentAssistProcessors(
+	 * 	org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
+	 */
 	protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
-		IContentAssistProcessor[] processors = null;
-
-		if ((partitionType == IStructuredPartitions.DEFAULT_PARTITION) || (partitionType == IXMLPartitions.XML_DEFAULT)) {
-			processors = new IContentAssistProcessor[]{new XMLContentAssistProcessor()};
-		}
-		else if (partitionType == IStructuredPartitions.UNKNOWN_PARTITION) {
-			processors = new IContentAssistProcessor[]{new NoRegionContentAssistProcessor()};
-		}
-
-		return processors;
+		IContentAssistProcessor processor = new XMLStructuredContentAssistProcessor(
+				this.getContentAssistant(), partitionType, sourceViewer);
+		return new IContentAssistProcessor[]{processor};
 	}
 
 	public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
@@ -203,7 +200,12 @@
 						if (node.getNodeType() != Node.DOCUMENT_NODE) {
 							s.insert(0, super.getText(node));
 						}
-						node = node.getParentNode();
+
+						if (node.getNodeType() == Node.ATTRIBUTE_NODE)
+							node = ((Attr) node).getOwnerElement();
+						else
+							node = node.getParentNode();
+					
 						if (node != null && node.getNodeType() != Node.DOCUMENT_NODE) {
 							s.insert(0, IPath.SEPARATOR);
 						}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserver.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserver.java
index f799a6a..4b90cfb 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserver.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserver.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -134,11 +134,11 @@
 	class TimerJob extends Job {
 		public TimerJob() {
 			super(SSEUIMessages.LoadingReferencedGrammars);
-			setPriority(Job.SHORT);
 		}
 
 		public IStatus run(IProgressMonitor monitor) {
 			monitor.beginTask("", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
+			Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
 			invokeCMDocumentLoad();
 			monitor.done();
 			return Status.OK_STATUS;
@@ -148,6 +148,15 @@
 	private Job timer = new TimerJob();
 	protected Document fDocument;
 	protected boolean isGrammarInferenceEnabled;
+	/**
+	 * If true, DOMObserver is currently disabled and not loading the content
+	 * model
+	 */
+	private boolean fIsDisabled = false;
+	/**
+	 * If true, DOMObserver is currently trying to load the content model
+	 */
+	private boolean fIsLoading = false;
 
 	public DOMObserver(IStructuredModel model) {
 		fDocument = (model instanceof IDOMModel) ? ((IDOMModel) model).getDocument() : null;
@@ -163,6 +172,15 @@
 				CMDocumentManager cmDocumentManager = modelQuery.getCMDocumentManager();
 				cmDocumentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_AUTO_LOAD, false);
 			}
+			
+			// attach a dom observer adapter to the document so others have access to
+			// domobserver if needed
+			INodeAdapter domObserverAdapter = ((INodeNotifier)fDocument).getExistingAdapter(DOMObserverAdapter.class);
+			if (domObserverAdapter == null) {
+				domObserverAdapter = new DOMObserverAdapter();
+				((INodeNotifier)fDocument).addAdapter(domObserverAdapter);
+			}
+			((DOMObserverAdapter)domObserverAdapter).setDOMObserver(this);
 		}
 	}
 
@@ -171,23 +189,49 @@
 		// immediately
 		// very nasty... I need to revist this problem with Ed Merks
 		//
-		// invokeCMDocumentLoad();
-		invokeDelayedCMDocumentLoad();
+		timer.schedule();
 	}
 
 	public void invokeCMDocumentLoad() {
-		ModelQuery modelQuery = ModelQueryUtil.getModelQuery(fDocument);
-		if ((modelQuery != null) && (modelQuery.getCMDocumentManager() != null)) {
-			CMDocumentLoader loader = isGrammarInferenceEnabled ? new InferredGrammarBuildingCMDocumentLoader(fDocument, modelQuery) : new CMDocumentLoader(fDocument, modelQuery);
-			loader.loadCMDocuments();
+		if (fIsDisabled) return;
+		try {
+			fIsLoading = true;
+			
+			ModelQuery modelQuery = ModelQueryUtil.getModelQuery(fDocument);
+			if ((modelQuery != null) && (modelQuery.getCMDocumentManager() != null)) {
+				CMDocumentLoader loader = isGrammarInferenceEnabled ? new InferredGrammarBuildingCMDocumentLoader(fDocument, modelQuery) : new CMDocumentLoader(fDocument, modelQuery);
+				loader.loadCMDocuments();
+			}
+		} finally {
+			fIsLoading = false;
 		}
 	}
 
 	public void invokeDelayedCMDocumentLoad() {
+		if (fIsDisabled) return;
 		timer.schedule(2000);
 	}
 
 	public void setGrammarInferenceEnabled(boolean isEnabled) {
 		isGrammarInferenceEnabled = isEnabled;
 	}
+	
+	boolean setDisabled(boolean isDisabled, boolean forced) {
+		boolean success = true;
+		
+		if (fIsDisabled != isDisabled) {
+			fIsDisabled = isDisabled;
+			if (forced) {
+				if (isDisabled)
+					success = timer.cancel();
+				else
+					invokeCMDocumentLoad();
+			}
+		}
+		return success;
+	}
+	
+	boolean isLoading() {
+		return fIsLoading;
+	}
 }
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserverAdapter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserverAdapter.java
new file mode 100644
index 0000000..fcd60c4
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserverAdapter.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal;
+
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+
+/**
+ * This is just an adapter that sits on a document node to allow clients
+ * limited access to the DOMObserver. Clients who handle their own content
+ * model document loading (as opposed to letting the DOMObserver do it) may
+ * use this class to stop the DOMObserver from loading and possibly
+ * interfering with the client's document loading.
+ */
+public class DOMObserverAdapter implements INodeAdapter {
+	private DOMObserver fObserver = null;
+
+	public boolean isAdapterForType(Object type) {
+		return type == DOMObserverAdapter.class;
+	}
+
+	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
+		// do nothing
+	}
+
+	/**
+	 * The DOMObserver is the one that adds the adapter to the document node,
+	 * so it'll set itself up here as well.
+	 * 
+	 * @param observer
+	 */
+	void setDOMObserver(DOMObserver observer) {
+		fObserver = observer;
+	}
+
+	/**
+	 * Disable the DOMObserver to prevent it from future content model loading
+	 * for this document.
+	 * 
+	 * @param disable
+	 *            true if caller wants DOMObserver disabled. false if caller
+	 *            wants DOMObserver enabled.
+	 * @param force
+	 *            if true, DOMObserver will forcibly be disabled (if the
+	 *            DOMObserver model loading job is scheduled, it will be
+	 *            cancelled)
+	 * @return true if DOMObserver was successfully disabled. false if
+	 *         DOMObserver was already in the process of loading and was
+	 *         unable to stop
+	 */
+	public boolean disableObserver(boolean disable, boolean force) {
+		return fObserver.setDisabled(disable, force);
+	}
+
+	/**
+	 * Returns whether or not DOMObserver is currently attempting to load the
+	 * content model.
+	 * 
+	 * @return true if DOMObserver is currently in the process of loading the
+	 *         content models. false otherwise.
+	 */
+	public boolean isObserverLoading() {
+		return fObserver.isLoading();
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/IProductConstants.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/IProductConstants.java
new file mode 100644
index 0000000..ab66be9
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/IProductConstants.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal;
+
+public interface IProductConstants {
+	/**
+	 * The explorer view to use when creating the XML perspective
+	 */
+	String PERSPECTIVE_EXPLORER_VIEW = "idPerspectiveHierarchyView"; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/ProductProperties.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/ProductProperties.java
new file mode 100644
index 0000000..6f88be4
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/ProductProperties.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.ui.IPageLayout;
+
+public class ProductProperties {
+	/**
+	 * Default values for WTP level product
+	 */
+	static final String ID_PERSPECTIVE_EXPLORER_VIEW = IPageLayout.ID_PROJECT_EXPLORER;
+
+	/**
+	 * Return the value for the associated key from the Platform Product registry or return the
+	 * WTP default.
+	 * 
+	 * @param key
+	 * @return String value of product's property
+	 */
+	public static String getProperty(String key) {
+		if (key == null)
+			return null;
+		String value = null;
+		if (Platform.getProduct()!=null)
+			value = Platform.getProduct().getProperty(key);
+		if (value == null) {
+			if (key.equals(IProductConstants.PERSPECTIVE_EXPLORER_VIEW))
+				return ID_PERSPECTIVE_EXPLORER_VIEW;
+		}
+		return value;
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIMessages.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIMessages.java
index b460f6d..2f03c15 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIMessages.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIMessages.java
@@ -1,5 +1,5 @@
 /**********************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others. All rights reserved.   This
+ * Copyright (c) 2005, 2010 IBM Corporation and others. All rights reserved.   This
  * program and the accompanying materials are made available under the terms of
  * the Eclipse Public License v1.0 which accompanies this distribution, and is
  * available at http://www.eclipse.org/legal/epl-v10.html
@@ -31,6 +31,7 @@
 	public static String Tag_Delimiters_UI_;
 	public static String Tag_Names_UI_;
 	public static String Attribute_Names_UI_;
+	public static String Attribute_Equals_UI_;
 	public static String Attribute_Values_UI_;
 	public static String Declaration_Delimiters_UI_;
 	public static String Content_UI_;
@@ -170,6 +171,7 @@
 	public static String Attribute__is_missing_a_value;
 	public static String Attribute__has_no_value;
 	public static String Missing_end_tag_;
+	public static String Missing_start_tag_;
 	public static String ReconcileStepForMarkup_0;
 	public static String ReconcileStepForMarkup_1;
 	public static String ReconcileStepForMarkup_2;
@@ -203,6 +205,7 @@
 	public static String Quote_attribute_values_UI_;
 	public static String Format_source_UI_;
 	public static String Convert_EOL_codes_UI_;
+	public static String Insert_XML_decl;
 	public static String EOL_Windows_UI;
 	public static String EOL_Unix_UI;
 	public static String EOL_Mac_UI;
@@ -218,7 +221,8 @@
 	public static String EOL_NoTranslation;
 	public static String XMLFilesPreferencePage_ExtensionLabel;
 	public static String XMLFilesPreferencePage_ExtensionError;
-	public static String Content_assist_UI_;
+	public static String XMLContentAssistPreferencePage_Auto_Activation_UI_;
+	public static String XMLContentAssistPreferencePage_Cycling_UI_;
 	public static String Automatically_make_suggest_UI_;
 	public static String Prompt_when_these_characte_UI_;
 	public static String Formatting_UI_;
@@ -232,6 +236,8 @@
 	public static String Indentation_size;
 	public static String Indentation_size_tip;
 	public static String Clear_all_blank_lines_UI_;
+	public static String Format_comments;
+	public static String Format_comments_join_lines;
 	public static String Grammar_Constraints;
 	public static String Use_inferred_grammar_in_absence_of;
 	public static String Suggestion_Strategy;
@@ -242,6 +248,7 @@
 	public static String Attribute____3;
 	public static String Data_Type____4;
 	public static String Enumerated_Values____5;
+	public static String Default_Value____6;
 	public static String SourceMenu_label;
 	public static String Comment_label; // Resource bundle
 	public static String Comment_tooltip; // Resource bundle
@@ -269,8 +276,13 @@
 	public static String XMLTyping_Auto_Complete;
 	public static String XMLTyping_Auto_Remove;
 	public static String XMLTyping_Complete_Comments;
+	public static String XMLTyping_Close_Strings;
+	public static String XMLTyping_Close_Brackets;
 	public static String XMLTyping_Complete_End_Tags;
+	public static String XMLTyping_Complete_Elements;
 	public static String XMLTyping_Remove_End_Tags;
+	public static String XMLTyping_Start_Tag;
+	public static String XMLTyping_End_Tag;
 	public static String StructureSelectEnclosing_label;
 	public static String StructureSelectEnclosing_tooltip;
 	public static String StructureSelectEnclosing_description;
@@ -282,7 +294,9 @@
 	public static String StructureSelectPrevious_description;
 	public static String MESSAGE_XML_VALIDATION_MESSAGE_UI_;
 	public static String Indicate_no_grammar_specified;
-	public static String Indicate_no_grammar_specified_severities;
+	public static String Indicate_no_grammar_specified_severities_error;
+	public static String Indicate_no_grammar_specified_severities_warning;
+	public static String Indicate_no_grammar_specified_severities_ignore;
 	public static String Validating_files;
 	public static String SyntaxColoringPage_0;
 	public static String SyntaxColoringPage_2;
@@ -294,12 +308,32 @@
 	public static String _UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK;
 	public static String gotoMatchingTag_label;
 	public static String gotoMatchingTag_description;
+	public static String gotoMatchingTag_start;
+	public static String gotoMatchingTag_end;
 	public static String nextSibling_label;
 	public static String nextSibling_description;
 	public static String previousSibling_label;
 	public static String previousSibling_description;
 	public static String Use_XInclude;
-
+    public static String Honour_all_schema_locations;   
+	public static String Open;
+	public static String _UI_BUTTON_SORT;
+	public static String MarkupValidation_files_label;
+	public static String MarkupValidation_files;
+	public static String Severity_error;
+	public static String Severity_warning;
+	public static String Severity_ignore;
+	public static String Empty_element_tag;
+	public static String End_tag_with_attributes;
+	public static String Invalid_whitespace_before_tagname;
+	public static String Missing_closing_bracket;
+	public static String Missing_closing_quote;
+	public static String Missing_end_tag;
+	public static String Missing_start_tag;
+	public static String Missing_quotes;
+	public static String Namespace_in_pi_target;
+	public static String Tag_name_missing;
+	public static String Whitespace_at_start;
 
 	static {
 		// load message values from bundle file
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties
index e44d9aa..7c1f7c3 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2008 IBM Corporation and others.
+# Copyright (c) 2001, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -20,6 +20,7 @@
 Tag_Delimiters_UI_=Tag Delimiters
 Tag_Names_UI_=Tag Names
 Attribute_Names_UI_=Attribute Names
+Attribute_Equals_UI_=Attribute Equal Signs
 Attribute_Values_UI_=Attribute Values
 Declaration_Delimiters_UI_=Declaration Delimiters
 Content_UI_=Content
@@ -192,6 +193,7 @@
 End_tag_has_attributes=End tag has attributes
 Attribute__is_missing_a_value=Attribute \"{0}\" is missing a value
 Attribute__has_no_value=Attribute \"{0}\"  has no value
+Missing_start_tag_=Missing start tag \"{0}\"
 Missing_end_tag_=Missing end tag \"{0}\"
 ReconcileStepForMarkup_0=Missing closing quote
 ReconcileStepForMarkup_1=Missing quotes for attribute value
@@ -228,6 +230,7 @@
 Quote_attribute_values_UI_=&Quote attribute values
 Format_source_UI_=&Format source
 Convert_EOL_codes_UI_=Convert line &delimiters to
+Insert_XML_decl=Fix XML declaration
 EOL_Windows_UI=&Windows
 EOL_Unix_UI=U&NIX
 EOL_Mac_UI=&Mac
@@ -243,12 +246,15 @@
 EOL_Mac=Mac
 EOL_NoTranslation=No translation
 Validating_files=Validating files
-Indicate_no_grammar_specified=Indicate when no grammar is specified:
-Indicate_no_grammar_specified_severities=Error,Warning,Ignore
+Indicate_no_grammar_specified=Indicate when no &grammar is specified:
+Indicate_no_grammar_specified_severities_error=Error
+Indicate_no_grammar_specified_severities_warning=Warning
+Indicate_no_grammar_specified_severities_ignore=Ignore
 XMLFilesPreferencePage_ExtensionLabel=Add this suffix (if not specified):
 XMLFilesPreferencePage_ExtensionError=Suffix must be one of the following {0}.
 ## XML Source preference page
-Content_assist_UI_=Content assist
+XMLContentAssistPreferencePage_Auto_Activation_UI_=Auto Activation
+XMLContentAssistPreferencePage_Cycling_UI_=Cycling
 Automatically_make_suggest_UI_=Automatically ma&ke suggestions
 Prompt_when_these_characte_UI_=P&rompt when these characters are inserted:
 Formatting_UI_=Formatting
@@ -262,6 +268,8 @@
 Indentation_size=In&dentation size:
 Indentation_size_tip=Indentation size
 Clear_all_blank_lines_UI_=Clear all &blank lines
+Format_comments=&Format comments
+Format_comments_join_lines=&Join lines
 Grammar_Constraints=Grammar Constraints
 Use_inferred_grammar_in_absence_of=&Use inferred grammar in absence of DTD/Schema
 Suggestion_Strategy=&Suggestion strategy:
@@ -273,6 +281,7 @@
 Attribute____3=Attribute :
 Data_Type____4=Data Type :
 Enumerated_Values____5=Enumerated Values :
+Default_Value____6=Default Value :
 ## copied from sse.ui
 SourceMenu_label=&Source
 Comment_label=Co&mment
@@ -301,8 +310,13 @@
 XMLTyping_Auto_Complete=Automatically close
 XMLTyping_Auto_Remove=Automatically remove
 XMLTyping_Complete_Comments=&Comments
-XMLTyping_Complete_End_Tags=&End tags
+XMLTyping_Close_Strings=A&ttribute values
+XMLTyping_Close_Brackets=(Parentheses) and [square] brac&kets
+XMLTyping_Complete_End_Tags=&Automatically close the tag
+XMLTyping_Complete_Elements=&Insert a matching end tag
 XMLTyping_Remove_End_Tags=E&nd tags when creating empty self-closing tags
+XMLTyping_Start_Tag=When typing a start tag
+XMLTyping_End_Tag=When typing an end tag
 StructureSelectEnclosing_label=Enclosing Element
 StructureSelectEnclosing_tooltip=Expand selection to include enclosing element
 StructureSelectEnclosing_description=Expand selection to include enclosing element
@@ -317,15 +331,40 @@
 SyntaxColoringPage_2=Enable
 SyntaxColoringPage_3=&Bold
 SyntaxColoringPage_4=&Italic
-SyntaxColoringPage_5=&Strike-through
+SyntaxColoringPage_5=&Strikethrough
 SyntaxColoringPage_6=&Underline
 EmptyFilePreferencePage_0=Expand the tree to edit preferences for a specific feature.
 _UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK=XML editing preferences.  Note that some preferences may be set on the <a>{0}</a> preference page.
-Use_XInclude=Process XML Inclusions
+Use_XInclude=Process XML &Inclusions
+Honour_all_schema_locations=&Honour all XML schema locations
 nextSibling_label=Next Sibling
 nextSibling_description=Go to Next Sibling
 previousSibling_label=Previous Sibling
 previousSibling_description=Go to Previous Sibling
 gotoMatchingTag_label=Matching Tag
 gotoMatchingTag_description=Go To Matching Tag
-
+gotoMatchingTag_start=Start tag of element <{0}>
+gotoMatchingTag_end=End tag of element <{0}>
+Open=Open ''{0}''
+_UI_BUTTON_SORT=Sort
+Validating_files=Validating files
+Indicate_no_grammar_specified=Indicate when no &grammar is specified:
+Indicate_no_grammar_specified_severities_error=Error
+Indicate_no_grammar_specified_severities_warning=Warning
+Indicate_no_grammar_specified_severities_ignore=Ignore
+MarkupValidation_files_label=Errors/Warnings
+MarkupValidation_files=&Enable markup validation
+Severity_error=Error
+Severity_warning=Warning
+Severity_ignore=Ignore
+Empty_element_tag=Invalid e&mpty element tag:
+End_tag_with_attributes=Invalid end &tag with attributes:
+Invalid_whitespace_before_tagname=Invalid &white space before tag name:
+Missing_closing_bracket=Missing &closing bracket:
+Missing_closing_quote=Missing closing &quote:
+Missing_end_tag=Missing e&nd tag:
+Missing_start_tag=Missing &start tag:
+Missing_quotes=Missing q&uotes:
+Namespace_in_pi_target=In&valid name space in PI:
+Tag_name_missing=Missing tag n&ame:
+Whitespace_at_start=Inva&lid white space at start:
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractNodeActionManager.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractNodeActionManager.java
index 028d579..be7e202 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractNodeActionManager.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractNodeActionManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -157,14 +157,16 @@
 
 
 		public void run() {
-			beginNodeAction(this);
-			if (cmnode != null) {
-				addNodeForCMNode();
+			if (validateEdit(getModel(), getWorkbenchWindowShell())) {
+				beginNodeAction(this);
+				if (cmnode != null) {
+					addNodeForCMNode();
+				}
+				else {
+					addNodeForNodeType();
+				}
+				endNodeAction(this);
 			}
-			else {
-				addNodeForNodeType();
-			}
-			endNodeAction(this);
 		}
 	}
 
@@ -191,27 +193,29 @@
 		}
 
 		public void run() {
-			beginNodeAction(this);
-
-			for (Iterator i = list.iterator(); i.hasNext();) {
-				Node node = (Node) i.next();
-				if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
-					Attr attr = (Attr) node;
-					attr.getOwnerElement().removeAttributeNode(attr);
-				}
-				else {
-					Node parent = node.getParentNode();
-					if (parent != null) {
-						Node previousSibling = node.getPreviousSibling();
-						if ((previousSibling != null) && isWhitespaceTextNode(previousSibling)) {
-							parent.removeChild(previousSibling);
+			if (validateEdit(getModel(), getWorkbenchWindowShell())) {
+				beginNodeAction(this);
+	
+				for (Iterator i = list.iterator(); i.hasNext();) {
+					Node node = (Node) i.next();
+					if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
+						Attr attr = (Attr) node;
+						attr.getOwnerElement().removeAttributeNode(attr);
+					}
+					else {
+						Node parent = node.getParentNode();
+						if (parent != null) {
+							Node previousSibling = node.getPreviousSibling();
+							if ((previousSibling != null) && isWhitespaceTextNode(previousSibling)) {
+								parent.removeChild(previousSibling);
+							}
+							parent.removeChild(node);
 						}
-						parent.removeChild(node);
 					}
 				}
-			}
 
-			endNodeAction(this);
+				endNodeAction(this);
+			}
 		}
 	}
 
@@ -335,38 +339,40 @@
 		}
 
 		public void run() {
-			beginNodeAction(this);
-
-			Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document) parent : parent.getOwnerDocument();
-			Node newChildNode = null;
-			boolean format = true;
-			switch (nodeType) {
-				case Node.COMMENT_NODE : {
-					newChildNode = document.createComment(XMLUIMessages._UI_COMMENT_VALUE);
-					break;
+			if (validateEdit(getModel(), getWorkbenchWindowShell())) {
+				beginNodeAction(this);
+	
+				Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document) parent : parent.getOwnerDocument();
+				Node newChildNode = null;
+				boolean format = true;
+				switch (nodeType) {
+					case Node.COMMENT_NODE : {
+						newChildNode = document.createComment(XMLUIMessages._UI_COMMENT_VALUE);
+						break;
+					}
+					case Node.PROCESSING_INSTRUCTION_NODE : {
+						newChildNode = document.createProcessingInstruction(XMLUIMessages._UI_PI_TARGET_VALUE, XMLUIMessages._UI_PI_DATA_VALUE);
+						break;
+					}
+					case Node.CDATA_SECTION_NODE : {
+						newChildNode = document.createCDATASection(""); //$NON-NLS-1$
+						break;
+					}
+					case Node.TEXT_NODE : {
+						format = false;
+						newChildNode = document.createTextNode(parent.getNodeName());
+						break;
+					}
 				}
-				case Node.PROCESSING_INSTRUCTION_NODE : {
-					newChildNode = document.createProcessingInstruction(XMLUIMessages._UI_PI_TARGET_VALUE, XMLUIMessages._UI_PI_DATA_VALUE);
-					break;
+	
+				if (newChildNode != null) {
+					List list = new Vector(1);
+					list.add(newChildNode);
+					insertNodesAtIndex(parent, list, index, format);
 				}
-				case Node.CDATA_SECTION_NODE : {
-					newChildNode = document.createCDATASection(""); //$NON-NLS-1$
-					break;
-				}
-				case Node.TEXT_NODE : {
-					format = false;
-					newChildNode = document.createTextNode(parent.getNodeName());
-					break;
-				}
+	
+				endNodeAction(this);
 			}
-
-			if (newChildNode != null) {
-				List list = new Vector(1);
-				list.add(newChildNode);
-				insertNodesAtIndex(parent, list, index, format);
-			}
-
-			endNodeAction(this);
 		}
 	}
 
@@ -399,13 +405,15 @@
 		}
 
 		public void run() {
-			beginNodeAction(this);
-
-			if ((parent != null) && (cmnode != null)) {
-				remove(parent, startIndex, endIndex);
-				insert(parent, cmnode, startIndex);
+			if (validateEdit(getModel(), getWorkbenchWindowShell())) {
+				beginNodeAction(this);
+	
+				if ((parent != null) && (cmnode != null)) {
+					remove(parent, startIndex, endIndex);
+					insert(parent, cmnode, startIndex);
+				}
+				endNodeAction(this);
 			}
-			endNodeAction(this);
 		}
 	}
 
@@ -544,9 +552,7 @@
 			List selectionList = new ArrayList();
 			if (selection instanceof IStructuredSelection) {
 				IStructuredSelection es = (IStructuredSelection) selection;
-				for (Iterator i = es.iterator(); i.hasNext();) {
-					selectionList.add(i.next());
-				}
+				selectionList.addAll(es.toList());
 			}
 
 			contributeActions(menuManager, selectionList);
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/BaseNodeActionManager.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/BaseNodeActionManager.java
index 4629a23..4465152 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/BaseNodeActionManager.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/BaseNodeActionManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -151,11 +151,14 @@
 		}
 	}
 
+	protected boolean canContributeChildActions(Node node){
+		return true;
+	}
 
 	protected void contributeAddChildActions(IMenuManager menu, Node node, int ic, int vc) {
 		int nodeType = node.getNodeType();
 
-		if (nodeType == Node.ELEMENT_NODE) {
+		if (nodeType == Node.ELEMENT_NODE && canContributeChildActions(node)) {
 			// 'Add Child...' and 'Add Attribute...' actions
 			//
 			Element element = (Element) node;
@@ -164,7 +167,7 @@
 			IMenuManager addChildMenu = new MyMenuManager(XMLUIMessages._UI_MENU_ADD_CHILD);
 			menu.add(addAttributeMenu);
 			menu.add(addChildMenu);
-
+		
 			CMElementDeclaration ed = modelQuery.getCMElementDeclaration(element);
 			if (ed != null) {
 				// add insert attribute actions
@@ -172,7 +175,6 @@
 				List modelQueryActionList = new ArrayList();
 				modelQuery.getInsertActions(element, ed, -1, ModelQuery.INCLUDE_ATTRIBUTES, vc, modelQueryActionList);
 				addActionHelper(addAttributeMenu, modelQueryActionList);
-
 				// add insert child node actions
 				//
 				modelQueryActionList = new ArrayList();
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupDialogXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupDialogXML.java
index 97b718a..199eac0 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupDialogXML.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupDialogXML.java
@@ -37,6 +37,7 @@
 	protected Button fCheckBoxInsertMissingTags;
 	protected Button fCheckBoxInsertRequiredAttrs;
 	protected Button fCheckBoxQuoteAttrValues;
+	protected Button fCheckBoxInsertXMLDeclaration;
 	protected IStructuredModel fModel = null;
 	protected Preferences fPreferences = null;
 	protected Button fRadioButtonAttrNameCaseAsis;
@@ -101,6 +102,10 @@
 		fCheckBoxFormatSource.setText(XMLUIMessages.Format_source_UI_);
 		fCheckBoxFormatSource.addSelectionListener(this);
 
+		fCheckBoxInsertXMLDeclaration = new Button(composite, SWT.CHECK);
+		fCheckBoxInsertXMLDeclaration.setText(XMLUIMessages.Insert_XML_decl);
+		fCheckBoxInsertXMLDeclaration.addSelectionListener(this);
+
 		// Convert EOL code
 		fCheckBoxConvertEOLCodes = new Button(composite, SWT.CHECK);
 		fCheckBoxConvertEOLCodes.setText(XMLUIMessages.Convert_EOL_codes_UI_);
@@ -144,6 +149,7 @@
 		fCheckBoxQuoteAttrValues.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.QUOTE_ATTR_VALUES));
 		fCheckBoxFormatSource.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.FORMAT_SOURCE));
 		fCheckBoxConvertEOLCodes.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.CONVERT_EOL_CODES));
+		fCheckBoxInsertXMLDeclaration.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.FIX_XML_DECLARATION));
 		String EOLCode = getModelPreferences().getString(XMLCorePreferenceNames.CLEANUP_EOL_CODE);
 		if (EOLCode.compareTo(CommonEncodingPreferenceNames.LF) == 0) {
 			fRadioButtonConvertEOLUnix.setSelection(true);
@@ -176,6 +182,7 @@
 		getModelPreferences().setValue(XMLCorePreferenceNames.QUOTE_ATTR_VALUES, fCheckBoxQuoteAttrValues.getSelection());
 		getModelPreferences().setValue(XMLCorePreferenceNames.FORMAT_SOURCE, fCheckBoxFormatSource.getSelection());
 		getModelPreferences().setValue(XMLCorePreferenceNames.CONVERT_EOL_CODES, fCheckBoxConvertEOLCodes.getSelection());
+		getModelPreferences().setValue(XMLCorePreferenceNames.FIX_XML_DECLARATION, fCheckBoxInsertXMLDeclaration.getSelection());
 		if (fRadioButtonConvertEOLUnix.getSelection()) {
 			getModelPreferences().setValue(XMLCorePreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.LF);
 		}
@@ -196,7 +203,16 @@
 
 	public void widgetSelected(SelectionEvent e) {
 
-		getButton(OK).setEnabled(((fRadioButtonTagNameCaseLower != null) && (fRadioButtonTagNameCaseLower.getSelection() || fRadioButtonTagNameCaseUpper.getSelection())) || ((fRadioButtonAttrNameCaseLower != null) && (fRadioButtonAttrNameCaseLower.getSelection() || fRadioButtonAttrNameCaseUpper.getSelection())) || fCheckBoxInsertMissingTags.getSelection() || fCheckBoxQuoteAttrValues.getSelection() || fCheckBoxFormatSource.getSelection() || fCheckBoxConvertEOLCodes.getSelection() || ((fRadioButtonConvertEOLUnix != null) && (fRadioButtonConvertEOLUnix.getSelection() || fRadioButtonConvertEOLMac.getSelection() || fRadioButtonConvertEOLWindows.getSelection())));
+		getButton(OK).setEnabled(((fRadioButtonTagNameCaseLower != null) && (fRadioButtonTagNameCaseLower.getSelection() || fRadioButtonTagNameCaseUpper.getSelection())) 
+				|| ((fRadioButtonAttrNameCaseLower != null) && (fRadioButtonAttrNameCaseLower.getSelection() || fRadioButtonAttrNameCaseUpper.getSelection()))
+				|| fCheckBoxInsertMissingTags.getSelection()
+				|| fCheckBoxQuoteAttrValues.getSelection() 
+				|| fCheckBoxFormatSource.getSelection() 
+				|| fCheckBoxInsertXMLDeclaration.getSelection()
+				|| fCheckBoxCompressEmptyElementTags.getSelection()
+				|| fCheckBoxInsertRequiredAttrs.getSelection()
+				|| (( fCheckBoxConvertEOLCodes.getSelection() && fRadioButtonConvertEOLUnix != null ) && (fRadioButtonConvertEOLUnix.getSelection() || fRadioButtonConvertEOLMac.getSelection()
+						|| fRadioButtonConvertEOLWindows.getSelection())));
 		if (e.widget == fCheckBoxConvertEOLCodes) {
 			enableEOLCodeRadios(fCheckBoxConvertEOLCodes.getSelection());
 		}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditAttributeAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditAttributeAction.java
index 3da8aa7..0cdc771 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditAttributeAction.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditAttributeAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -56,24 +56,26 @@
 	}
 
 	public void run() {
-		manager.beginNodeAction(this);
 		Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-		EditAttributeDialog dialog = new EditAttributeDialog(shell, ownerElement, attr);
-		dialog.create();
-		dialog.getShell().setText(title);
-		dialog.setBlockOnOpen(true);
-		dialog.open();
-
-		if (dialog.getReturnCode() == Window.OK) {
-			if (attr != null) {
-				ownerElement.removeAttributeNode(attr);
+		if (validateEdit(manager.getModel(), shell)) {
+			manager.beginNodeAction(this);
+			EditAttributeDialog dialog = new EditAttributeDialog(shell, ownerElement, attr);
+			dialog.create();
+			dialog.getShell().setText(title);
+			dialog.setBlockOnOpen(true);
+			dialog.open();
+	
+			if (dialog.getReturnCode() == Window.OK) {
+				if (attr != null) {
+					ownerElement.removeAttributeNode(attr);
+				}
+				Document document = ownerElement.getOwnerDocument();
+				Attr newAttribute = document.createAttribute(dialog.getAttributeName());
+				newAttribute.setValue(dialog.getAttributeValue());
+				ownerElement.setAttributeNode(newAttribute);
+				manager.setViewerSelection(newAttribute);
 			}
-			Document document = ownerElement.getOwnerDocument();
-			Attr newAttribute = document.createAttribute(dialog.getAttributeName());
-			newAttribute.setValue(dialog.getAttributeValue());
-			ownerElement.setAttributeNode(newAttribute);
-			manager.setViewerSelection(newAttribute);
+			manager.endNodeAction(this);
 		}
-		manager.endNodeAction(this);
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditDoctypeAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditDoctypeAction.java
index 6330044..4ce515c 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditDoctypeAction.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditDoctypeAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,7 +13,6 @@
 package org.eclipse.wst.xml.ui.internal.actions;
 
 import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.Action;
 import org.eclipse.jface.window.Window;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
@@ -33,7 +32,7 @@
 /**
  * EditDoctypeAction
  */
-public class EditDoctypeAction extends Action {
+public class EditDoctypeAction extends NodeAction {
 	protected DocumentType doctype;
 	protected Document document;
 	protected IStructuredModel model;
@@ -120,24 +119,26 @@
 	}
 
 	public void run() {
-		model.beginRecording(this, getUndoDescription());
-		// Shell shell =
-		// XMLCommonUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
 		Shell shell = getDisplay().getActiveShell();
-		EditDoctypeDialog dialog = showEditDoctypeDialog(shell);
-
-		if (dialog.getReturnCode() == Window.OK) {
-			if (doctype != null) {
-				updateDoctype(dialog, doctype);
-			}
-			else if (document != null) {
-				DocumentType doctype = createDoctype(dialog, document);
+		if (validateEdit(model, shell)) {
+			model.beginRecording(this, getUndoDescription());
+			// Shell shell =
+			// XMLCommonUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
+			EditDoctypeDialog dialog = showEditDoctypeDialog(shell);
+	
+			if (dialog.getReturnCode() == Window.OK) {
 				if (doctype != null) {
-					insertDoctype(doctype, document);
+					updateDoctype(dialog, doctype);
+				}
+				else if (document != null) {
+					DocumentType doctype = createDoctype(dialog, document);
+					if (doctype != null) {
+						insertDoctype(doctype, document);
+					}
 				}
 			}
+			model.endRecording(this);
 		}
-		model.endRecording(this);
 	}
 
 	protected EditDoctypeDialog showEditDoctypeDialog(Shell shell) {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditElementAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditElementAction.java
index b944268..21b55fe 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditElementAction.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditElementAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -69,39 +69,41 @@
 	}
 
 	public void run() {
-		manager.beginNodeAction(this);
 		Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-		EditElementDialog dialog = new EditElementDialog(shell, element);
-		dialog.create();
-		dialog.getShell().setText(title);
-		dialog.setBlockOnOpen(true);
-		dialog.open();
-
-		if (dialog.getReturnCode() == Window.OK) {
-			Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document) parent : parent.getOwnerDocument();
-			if (element != null) {
-				// here we need to do a rename... which seems to be quite hard
-				// to do :-(
-				if (element instanceof IDOMElement) {
-					IDOMElement elementImpl = (IDOMElement) element;
-					IDOMModel model = elementImpl.getModel();
-					String oldName = elementImpl.getNodeName();
-					String newName = dialog.getElementName();
-					setStructuredDocumentRegionElementName(model, elementImpl.getStartStructuredDocumentRegion(), oldName, newName);
-					setStructuredDocumentRegionElementName(model, elementImpl.getEndStructuredDocumentRegion(), oldName, newName);
+		if (validateEdit(manager.getModel(), shell)) {
+			manager.beginNodeAction(this);
+			EditElementDialog dialog = new EditElementDialog(shell, element);
+			dialog.create();
+			dialog.getShell().setText(title);
+			dialog.setBlockOnOpen(true);
+			dialog.open();
+	
+			if (dialog.getReturnCode() == Window.OK) {
+				Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document) parent : parent.getOwnerDocument();
+				if (element != null) {
+					// here we need to do a rename... which seems to be quite hard
+					// to do :-(
+					if (element instanceof IDOMElement) {
+						IDOMElement elementImpl = (IDOMElement) element;
+						IDOMModel model = elementImpl.getModel();
+						String oldName = elementImpl.getNodeName();
+						String newName = dialog.getElementName();
+						setStructuredDocumentRegionElementName(model, elementImpl.getStartStructuredDocumentRegion(), oldName, newName);
+						setStructuredDocumentRegionElementName(model, elementImpl.getEndStructuredDocumentRegion(), oldName, newName);
+					}
+				}
+				else {
+					Element newElement = document.createElement(dialog.getElementName());
+					NodeList nodeList = parent.getChildNodes();
+					int nodeListLength = nodeList.getLength();
+					Node refChild = (insertionIndex < nodeListLength) && (insertionIndex >= 0) ? nodeList.item(insertionIndex) : null;
+					parent.insertBefore(newElement, refChild);
+					manager.reformat(newElement, false);
+					manager.setViewerSelection(newElement);
 				}
 			}
-			else {
-				Element newElement = document.createElement(dialog.getElementName());
-				NodeList nodeList = parent.getChildNodes();
-				int nodeListLength = nodeList.getLength();
-				Node refChild = (insertionIndex < nodeListLength) && (insertionIndex >= 0) ? nodeList.item(insertionIndex) : null;
-				parent.insertBefore(newElement, refChild);
-				manager.reformat(newElement, false);
-				manager.setViewerSelection(newElement);
-			}
+			manager.endNodeAction(this);
 		}
-		manager.endNodeAction(this);
 	}
 
 	protected void setStructuredDocumentRegionElementName(IDOMModel model, IStructuredDocumentRegion flatNode, String oldName, String newName) {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditProcessingInstructionAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditProcessingInstructionAction.java
index 9dec301..5578cf2 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditProcessingInstructionAction.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditProcessingInstructionAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -58,38 +58,41 @@
 	}
 
 	public void run() {
-		manager.beginNodeAction(this);
 		Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-
-		EditProcessingInstructionDialog dialog = null;
-		if (pi != null) {
-			dialog = new EditProcessingInstructionDialog(shell, pi);
-		}
-		else {
-			dialog = new EditProcessingInstructionDialog(shell, XMLUIMessages._UI_PI_TARGET_VALUE, XMLUIMessages._UI_PI_DATA_VALUE);
-		}
-
-		dialog.create();
-		dialog.getShell().setText(title);
-		dialog.setBlockOnOpen(true);
-		dialog.open();
-
-		if (dialog.getReturnCode() == Window.OK) {
+		if (validateEdit(manager.getModel(), shell)) {
+			manager.beginNodeAction(this);
+			
+	
+			EditProcessingInstructionDialog dialog = null;
 			if (pi != null) {
-				childRef = pi;
+				dialog = new EditProcessingInstructionDialog(shell, pi);
 			}
-
-			Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document) parent : parent.getOwnerDocument();
-			Node newNode = document.createProcessingInstruction(dialog.getTarget(), dialog.getData());
-			parent.insertBefore(newNode, childRef);
-
-			if (pi != null) {
-				parent.removeChild(pi);
+			else {
+				dialog = new EditProcessingInstructionDialog(shell, XMLUIMessages._UI_PI_TARGET_VALUE, XMLUIMessages._UI_PI_DATA_VALUE);
 			}
-
-			manager.reformat(newNode, false);
-			manager.setViewerSelection(newNode);
+	
+			dialog.create();
+			dialog.getShell().setText(title);
+			dialog.setBlockOnOpen(true);
+			dialog.open();
+	
+			if (dialog.getReturnCode() == Window.OK) {
+				if (pi != null) {
+					childRef = pi;
+				}
+	
+				Document document = parent.getNodeType() == Node.DOCUMENT_NODE ? (Document) parent : parent.getOwnerDocument();
+				Node newNode = document.createProcessingInstruction(dialog.getTarget(), dialog.getData());
+				parent.insertBefore(newNode, childRef);
+	
+				if (pi != null) {
+					parent.removeChild(pi);
+				}
+	
+				manager.reformat(newNode, false);
+				manager.setViewerSelection(newNode);
+			}
+			manager.endNodeAction(this);
 		}
-		manager.endNodeAction(this);
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditSchemaInfoAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditSchemaInfoAction.java
index 699492c..c07557a 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditSchemaInfoAction.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditSchemaInfoAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -114,53 +114,55 @@
 	}
 
 	public void run() {
-		manager.beginNodeAction(this);
-
-		// todo... change constructor to take an element
-		Element element = getElement(node);
-		if (element != null) {
-			Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-			EditSchemaInfoDialog dialog = new EditSchemaInfoDialog(shell, new Path(resourceLocation));
-
-			List namespaceInfoList = namespaceInfoManager.getNamespaceInfoList(element);
-			List oldNamespaceInfoList = NamespaceInfo.cloneNamespaceInfoList(namespaceInfoList);
-
-			// here we store a copy of the old info for each NamespaceInfo
-			// this info will be used in createPrefixMapping() to figure out
-			// how to update the document
-			// in response to these changes
-			for (Iterator i = namespaceInfoList.iterator(); i.hasNext();) {
-				NamespaceInfo info = (NamespaceInfo) i.next();
-				NamespaceInfo oldCopy = new NamespaceInfo(info);
-				info.setProperty("oldCopy", oldCopy); //$NON-NLS-1$
-			}
-
-			dialog.setNamespaceInfoList(namespaceInfoList);
-			dialog.create();
-			// dialog.getShell().setSize(500, 300);
-			dialog.getShell().setText(XMLUIMessages._UI_MENU_EDIT_SCHEMA_INFORMATION_TITLE);
-			dialog.setBlockOnOpen(true);
-			dialog.open();
-
-			if (dialog.getReturnCode() == Window.OK) {
-				List newInfoList = dialog.getNamespaceInfoList();
-				namespaceInfoManager.removeNamespaceInfo(element);
-				namespaceInfoManager.addNamespaceInfo(element, newInfoList, true);
-
-				// see if we need to rename any prefixes
-				Map prefixMapping = createPrefixMapping(oldNamespaceInfoList, namespaceInfoList);
-				if (prefixMapping.size() > 0) {
-					try {
-						manager.getModel().aboutToChangeModel();
-						ReplacePrefixAction replacePrefixAction = new ReplacePrefixAction(manager, element, prefixMapping);
-						replacePrefixAction.run();
-					}
-					finally {
-						manager.getModel().changedModel();
+		Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
+		if (validateEdit(manager.getModel(), shell)) {
+			manager.beginNodeAction(this);
+	
+			// todo... change constructor to take an element
+			Element element = getElement(node);
+			if (element != null) {
+				EditSchemaInfoDialog dialog = new EditSchemaInfoDialog(shell, new Path(resourceLocation));
+	
+				List namespaceInfoList = namespaceInfoManager.getNamespaceInfoList(element);
+				List oldNamespaceInfoList = NamespaceInfo.cloneNamespaceInfoList(namespaceInfoList);
+	
+				// here we store a copy of the old info for each NamespaceInfo
+				// this info will be used in createPrefixMapping() to figure out
+				// how to update the document
+				// in response to these changes
+				for (Iterator i = namespaceInfoList.iterator(); i.hasNext();) {
+					NamespaceInfo info = (NamespaceInfo) i.next();
+					NamespaceInfo oldCopy = new NamespaceInfo(info);
+					info.setProperty("oldCopy", oldCopy); //$NON-NLS-1$
+				}
+	
+				dialog.setNamespaceInfoList(namespaceInfoList);
+				dialog.create();
+				// dialog.getShell().setSize(500, 300);
+				dialog.getShell().setText(XMLUIMessages._UI_MENU_EDIT_SCHEMA_INFORMATION_TITLE);
+				dialog.setBlockOnOpen(true);
+				dialog.open();
+	
+				if (dialog.getReturnCode() == Window.OK) {
+					List newInfoList = dialog.getNamespaceInfoList();
+					namespaceInfoManager.removeNamespaceInfo(element);
+					namespaceInfoManager.addNamespaceInfo(element, newInfoList, false);
+	
+					// see if we need to rename any prefixes
+					Map prefixMapping = createPrefixMapping(oldNamespaceInfoList, namespaceInfoList);
+					if (prefixMapping.size() > 0) {
+						try {
+							manager.getModel().aboutToChangeModel();
+							ReplacePrefixAction replacePrefixAction = new ReplacePrefixAction(manager, element, prefixMapping);
+							replacePrefixAction.run();
+						}
+						finally {
+							manager.getModel().changedModel();
+						}
 					}
 				}
 			}
+			manager.endNodeAction(this);
 		}
-		manager.endNodeAction(this);
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/GoToMatchingTagAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/GoToMatchingTagAction.java
index 823cd59..5d7e7a3 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/GoToMatchingTagAction.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/GoToMatchingTagAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -30,6 +30,7 @@
 import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.ui.texteditor.IDocumentProvider;
 import org.eclipse.ui.texteditor.ITextEditor;
@@ -37,6 +38,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Node;
 
@@ -248,6 +250,7 @@
 
 				Position pStart = null;
 				Position pEnd = null;
+				String tag = ""; //$NON-NLS-1$
 				if (o instanceof IDOMNode) {
 					IDOMNode node = (IDOMNode) o;
 					IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
@@ -255,6 +258,7 @@
 						if (startStructuredDocumentRegion.getNumberOfRegions() > 1) {
 							ITextRegion nameRegion = startStructuredDocumentRegion.getRegions().get(1);
 							pStart = new Position(startStructuredDocumentRegion.getStartOffset(nameRegion), nameRegion.getTextLength());
+							tag = startStructuredDocumentRegion.getText(nameRegion);
 						}
 						matchRegion = ((IDOMNode) o).getEndStructuredDocumentRegion();
 						if (matchRegion != null && matchRegion.getNumberOfRegions() > 1) {
@@ -268,6 +272,7 @@
 							if (endStructuredDocumentRegion.getNumberOfRegions() > 1) {
 								ITextRegion nameRegion = endStructuredDocumentRegion.getRegions().get(1);
 								pEnd = new Position(endStructuredDocumentRegion.getStartOffset(nameRegion), nameRegion.getTextLength());
+								tag = endStructuredDocumentRegion.getText(nameRegion);
 							}
 							matchRegion = ((IDOMNode) o).getStartStructuredDocumentRegion();
 							if (matchRegion != null && matchRegion.getNumberOfRegions() > 1) {
@@ -278,15 +283,12 @@
 					}
 				}
 				if (pStart != null && pEnd != null) {
-					Annotation annotation = new Annotation(false);
-					annotation.setType(ANNOTATION_TYPE);
+					Annotation annotation = new Annotation(ANNOTATION_TYPE, false, NLS.bind(XMLUIMessages.gotoMatchingTag_start, tag));
 					newAnnotations.put(annotation, pStart);
 					if (DEBUG) {
 						System.out.println("adding " + annotation); //$NON-NLS-1$
 					}
-
-					annotation = new Annotation(false);
-					annotation.setType(ANNOTATION_TYPE);
+					annotation = new Annotation(ANNOTATION_TYPE, false, NLS.bind(XMLUIMessages.gotoMatchingTag_end, tag));
 					newAnnotations.put(annotation, pEnd);
 					if (DEBUG) {
 						System.out.println("adding " + annotation); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/NodeAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/NodeAction.java
index 0974e8f..1ce764a 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/NodeAction.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/NodeAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,7 +14,12 @@
 
 package org.eclipse.wst.xml.ui.internal.actions;
 
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.action.Action;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 
 public abstract class NodeAction extends Action {
 
@@ -22,5 +27,22 @@
 		return null;
 	}
 
+	/**
+	 * Checks that the resource backing the model is writeable utilizing <code>validateEdit</code>
+	 * on a given <tt>IWorkspace</tt>.
+	 * 
+	 * @param model the model to be checked
+	 * @param context the shell context for which <code>validateEdit</code> will be run
+	 * @return boolean result of checking <code>validateEdit</code>. If the resource is unwriteable, <code>status.isOK()</code>
+	 * will return true; otherwise, false.
+	 */
+	protected final boolean validateEdit(IStructuredModel model, Shell context) {
+		if (model != null && model.getBaseLocation() != null) {
+			IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(model.getBaseLocation()));
+			return !file.isAccessible() || ResourcesPlugin.getWorkspace().validateEdit(new IFile[] {file}, context).isOK();
+		}
+		return false; //$NON-NLS-1$
+	}
+
 	public abstract String getUndoDescription();
 }
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ReplacePrefixAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ReplacePrefixAction.java
index e5719a9..18599bd 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ReplacePrefixAction.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ReplacePrefixAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,7 +18,9 @@
 import java.util.Vector;
 
 import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.widgets.Shell;
 import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMVisitor;
+import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -65,14 +67,17 @@
 	}
 
 	public void run() {
-		NodeCollectingDOMVisitor visitor = new NodeCollectingDOMVisitor();
-		visitor.visitNode(element);
-		for (Iterator i = visitor.list.iterator(); i.hasNext();) {
-			Node node = (Node) i.next();
-			String key = node.getPrefix() != null ? node.getPrefix() : ""; //$NON-NLS-1$
-			String newPrefix = (String) prefixMapping.get(key);
-			if (newPrefix != null) {
-				node.setPrefix(newPrefix);
+		Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
+		if (validateEdit(manager.getModel(), shell)) {
+			NodeCollectingDOMVisitor visitor = new NodeCollectingDOMVisitor();
+			visitor.visitNode(element);
+			for (Iterator i = visitor.list.iterator(); i.hasNext();) {
+				Node node = (Node) i.next();
+				String key = node.getPrefix() != null ? node.getPrefix() : ""; //$NON-NLS-1$
+				String newPrefix = (String) prefixMapping.get(key);
+				if (newPrefix != null) {
+					node.setPrefix(newPrefix);
+				}
 			}
 		}
 	}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java
index df619e7..3dc10be 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -25,8 +25,10 @@
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 import org.eclipse.wst.xml.ui.internal.Logger;
 import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
 import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;
@@ -52,6 +54,7 @@
 			model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
 			if (model != null) {
 				if (command.text != null) {
+					smartInsertCloseElement(command, document, model);
 					smartInsertForComment(command, document, model);
 					smartInsertForEndTag(command, document, model);
 					smartRemoveEndTag(command, document, model);
@@ -64,7 +67,7 @@
 			}
 		}
 	}
-	
+
 	private boolean isPreferenceEnabled(String key) {
 		return (key != null && XMLUIPlugin.getDefault().getPreferenceStore().getBoolean(key));
 	}
@@ -88,13 +91,31 @@
 	private void smartRemoveEndTag(DocumentCommand command, IDocument document, IStructuredModel model) {
 		try {
 			// An opening tag is now a self-terminated end-tag
-			if ("/".equals(command.text) && ">".equals(document.get(command.offset, 1)) && isPreferenceEnabled(XMLUIPreferenceNames.TYPING_REMOVE_END_TAGS)) { //$NON-NLS-1$ //$NON-NLS-2$
+			if ("/".equals(command.text) && ">".equals(document.get(command.offset, 1)) && command.length == 0 && isPreferenceEnabled(XMLUIPreferenceNames.TYPING_REMOVE_END_TAGS)) { //$NON-NLS-1$ //$NON-NLS-2$
 				IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset);
 				if (node != null && !node.hasChildNodes()) {
-					IStructuredDocumentRegion region = node.getEndStructuredDocumentRegion();
-
-					if (region != null && region.isEnded())
-						document.replace(region.getStartOffset(), region.getLength(), ""); //$NON-NLS-1$
+					IStructuredDocumentRegion region = node.getFirstStructuredDocumentRegion();
+					if(region.getFirstRegion().getType() == DOMRegionContext.XML_TAG_OPEN && command.offset <= region.getEnd()) {
+						
+						/* if the region before the command offset is a an attribute value region
+						 * check to see if it has both and opening and closing quote
+						 */
+						ITextRegion prevTextRegion = region.getRegionAtCharacterOffset(command.offset-1);
+						boolean inUnclosedAttValueRegion = false;
+						if(prevTextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+							//get the text of the attribute value region
+							String prevText = region.getText(prevTextRegion);
+							inUnclosedAttValueRegion = (prevText.startsWith("'") && ((prevText.length() == 1) || !prevText.endsWith("'"))) ||
+								(prevText.startsWith("\"") && ((prevText.length() == 1) || !prevText.endsWith("\"")));
+						} 
+						//if command offset is in an unclosed attribute value region then done remove the end tag
+						if(!inUnclosedAttValueRegion) {
+							region = node.getEndStructuredDocumentRegion();
+							if (region != null && region.isEnded()) {
+								document.replace(region.getStartOffset(), region.getLength(), ""); //$NON-NLS-1$
+							}
+						}
+					}
 				}
 			}
 		}
@@ -117,6 +138,62 @@
 		}
 
 	}
+	
+	/**
+	 * Attempts to insert the end tag when completing a start-tag with the '&gt;' character.
+	 * 
+	 * @param command
+	 * @param document
+	 * @param model
+	 */
+	private void smartInsertCloseElement(DocumentCommand command, IDocument document, IStructuredModel model) {
+		try {
+			// Check terminating start tag, but ignore empty-element tags
+			if (command.text.equals(">") && document.getLength() > 0 && document.getChar(command.offset - 1) != '/' && isPreferenceEnabled(XMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS)) { //$NON-NLS-1$
+				IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset - 1);
+				boolean isClosedByParent = false;
+				// Only insert an end-tag if necessary. Because of the way the document is parsed, it is possible for a child tag with the same
+				// name as an ancestor to be paired with the end-tag of an ancestor, so the ancestors must be checked for an unclosed tag.
+				if (node != null && node.getNodeType() == Node.ELEMENT_NODE && (!node.isClosed() || (isClosedByParent = hasUnclosedAncestor(node)))) {
+					IStructuredDocumentRegion region = node.getEndStructuredDocumentRegion();
+					if (region != null && region.getRegions().size() > 0 && region.getRegions().get(0).getType() == DOMRegionContext.XML_END_TAG_OPEN && !isClosedByParent)
+						return;
+					command.text += "</" + getElementName(node, command.offset) + ">"; //$NON-NLS-1$ //$NON-NLS-2$
+					command.shiftsCaret = false;
+					command.caretOffset = command.offset + 1;
+				}
+				
+			}
+		} catch (BadLocationException e) {
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * Get the element name that will be created by closing the start tag. Defaults
+	 * to the node's nodeName.
+	 * @param node the node that is being edited
+	 * @param offset the offset in the document where the start tag is closed
+	 * @return The element name of the tag
+	 */
+	private String getElementName(IDOMNode node, int offset) {
+		String name = null;
+		
+		IStructuredDocumentRegion region = node.getFirstStructuredDocumentRegion();
+		ITextRegion textRegion = region.getRegionAtCharacterOffset(offset);
+		if (textRegion != null && textRegion.getType() == DOMRegionContext.XML_TAG_NAME) {
+			int nameStart = region.getStartOffset(textRegion);
+			String regionText = region.getText(textRegion);
+			int length = offset - nameStart;
+			if (length <= regionText.length())
+				name = regionText.substring(0, length);
+		}
+		
+		// Default to the node name
+		if (name == null)
+			name = node.getNodeName();
+		return name;
+	}
 
 	private void smartInsertForEndTag(DocumentCommand command, IDocument document, IStructuredModel model) {
 		try {
@@ -133,7 +210,18 @@
 					// only add end tag if one does not already exist or if
 					// add '/' does not create one already
 					IStructuredDocumentRegion endTagStructuredDocumentRegion = parentNode.getEndStructuredDocumentRegion();
-					if (endTagStructuredDocumentRegion == null) {
+					IDOMNode ancestor = parentNode;
+					boolean smartInsertForEnd = false;
+					if(endTagStructuredDocumentRegion != null) {
+						// Look for ancestors by the same name that are missing end tags
+						while((ancestor = (IDOMNode) ancestor.getParentNode()) != null) {
+							if(ancestor.getEndStructuredDocumentRegion() == null && parentNode.getNodeName().equals(ancestor.getNodeName())) {
+								smartInsertForEnd = true;
+								break;
+							}
+						}
+					}
+					if (endTagStructuredDocumentRegion == null || smartInsertForEnd) {
 						StringBuffer toAdd = new StringBuffer(parentNode.getNodeName());
 						if (toAdd.length() > 0) {
 							toAdd.append(">"); //$NON-NLS-1$
@@ -150,6 +238,22 @@
 			Logger.logException(e);
 		}
 	}
+	
+	/**
+	 * Checks if <code>node</code> has an unclosed ancestor by the same name
+	 * 
+	 * @param node the node to check
+	 * @return true if <code>node</code> has an unclosed parent with the same node name
+	 */
+	private boolean hasUnclosedAncestor(IDOMNode node) {
+		IDOMNode parent = (IDOMNode) node.getParentNode();
+		while (parent != null && parent.getNodeType() != Node.DOCUMENT_NODE && parent.getNodeName().equals(node.getNodeName())) {
+			if (!parent.isClosed())
+				return true;
+			parent = (IDOMNode) parent.getParentNode();
+		}
+		return false;
+	}
 
 	/**
 	 * Return the active text editor if possible, otherwise the active editor
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentAssistProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentAssistProcessor.java
index 4eaebd7..c103fbf 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentAssistProcessor.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentAssistProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -39,6 +39,8 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.sse.core.internal.util.Debug;
+import org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer;
+import org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor;
 import org.eclipse.wst.sse.ui.internal.IReleasable;
 import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
 import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
@@ -80,6 +82,13 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
+/**
+ * @deprecated This class is no longer used locally and will be removed in the future.
+ * Implementers of this class should now use the <code>org.eclipse.wst.sse.ui.completionProposal</code>
+ * extension point in conjunction with the {@link ICompletionProposalComputer} interface.
+ * 
+ * @see StructuredContentAssistProcessor
+ */
 abstract public class AbstractContentAssistProcessor implements IContentAssistProcessor, IReleasable {
 	/**
 	 * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
@@ -109,7 +118,6 @@
 	protected static final String UNKNOWN_CONTEXT = XMLUIMessages.Content_Assist_not_availab_UI_;
 	protected char completionProposalAutoActivationCharacters[] = null;
 	protected char contextInformationAutoActivationCharacters[] = null;
-	private AttributeContextInformationProvider fAttributeInfoProvider = null;
 	private AttributeContextInformationPresenter fContextInformationPresenter = null;
 
 	protected String fErrorMessage = null;
@@ -328,7 +336,8 @@
 				// attribute is known, prompt with values from the declaration
 				proposedInfo = getAdditionalInfo(elementDecl, attrDecl);
 				List possibleValues = getPossibleDataTypeValues(node, attrDecl);
-				if (possibleValues.size() > 0) {
+				String defaultValue = attrDecl.getAttrType().getImpliedValue();
+				if (possibleValues.size() > 0 || defaultValue != null) {
 					// ENUMERATED VALUES
 					String matchString = contentAssistRequest.getMatchString();
 					if (matchString == null) {
@@ -343,21 +352,24 @@
 					// enumerated values as they probably won't help
 					boolean existingComplicatedValue = (contentAssistRequest.getRegion() != null) && (contentAssistRequest.getRegion() instanceof ITextRegionContainer);
 					if (!existingComplicatedValue) {
+						int rOffset = contentAssistRequest.getReplacementBeginPosition();
+						int rLength = contentAssistRequest.getReplacementLength();
 						for (Iterator j = possibleValues.iterator(); j.hasNext();) {
 							String possibleValue = (String) j.next();
-							currentValid = currentValid || possibleValue.equals(currentValue);
-							if ((matchString.length() == 0) || possibleValue.startsWith(matchString)) {
-
-								String rString = "\"" + possibleValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
-								int rOffset = contentAssistRequest.getReplacementBeginPosition();
-								int rLength = contentAssistRequest.getReplacementLength();
-								int cursorAfter = possibleValue.length() + 1;
-								String displayString = "\"" + possibleValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
-
-								CustomCompletionProposal proposal = new CustomCompletionProposal(rString, rOffset, rLength, cursorAfter, image, displayString, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
-								contentAssistRequest.addProposal(proposal);
+							if(!possibleValue.equals(defaultValue)) {
+								currentValid = currentValid || possibleValue.equals(currentValue);
+								if ((matchString.length() == 0) || possibleValue.startsWith(matchString)) {
+									String rString = "\"" + possibleValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
+									CustomCompletionProposal proposal = new CustomCompletionProposal(rString, rOffset, rLength, possibleValue.length() + 1, XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ENUM), rString, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
+									contentAssistRequest.addProposal(proposal);
+								}
 							}
 						}
+						if(defaultValue != null && ((matchString.length() == 0) || defaultValue.startsWith(matchString))) {
+							String rString = "\"" + defaultValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
+							CustomCompletionProposal proposal = new CustomCompletionProposal(rString, rOffset, rLength, defaultValue.length() + 1, XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_DEFAULT), rString, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
+							contentAssistRequest.addProposal(proposal);
+						}
 					}
 				}
 				else if (((attrDecl.getUsage() == CMAttributeDeclaration.FIXED) || (attrDecl.getAttrType().getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED)) && (attrDecl.getAttrType().getImpliedValue() != null)) {
@@ -476,10 +488,11 @@
 						IDOMNode aXMLNode = (IDOMNode) aNode;
 						CMElementDeclaration ed = modelQuery.getCMElementDeclaration((Element) aNode);
 						if ((aXMLNode.getEndStructuredDocumentRegion() == null) && ((ed == null) || (ed.getContentType() != CMElementDeclaration.EMPTY))) {
-							String proposedText = aNode.getNodeName();
+							String replacementText = aNode.getNodeName();
+							String displayText = replacementText;
 							String proposedInfo = (ed != null) ? getAdditionalInfo(null, ed) : null;
-							if ((node.getNodeType() == Node.TEXT_NODE) && !contentAssistRequest.getDocumentRegion().isEnded()) {
-								proposedText += ">"; //$NON-NLS-1$
+							if(!contentAssistRequest.getDocumentRegion().isEnded()) {
+								replacementText += ">"; //$NON-NLS-1$
 							}
 							CustomCompletionProposal proposal = null;
 							// double check to see if the region acted upon is
@@ -489,10 +502,10 @@
 								image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
 							}
 							if (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_NAME) {
-								proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getStartOffset(), contentAssistRequest.getRegion().getTextLength(), proposedText.length(), image, proposedText, null, proposedInfo, XMLRelevanceConstants.R_END_TAG_NAME);
+								proposal = new CustomCompletionProposal(replacementText, contentAssistRequest.getStartOffset(), contentAssistRequest.getRegion().getTextLength(), replacementText.length(), image, displayText, null, proposedInfo, XMLRelevanceConstants.R_END_TAG_NAME);
 							}
 							else {
-								proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), proposedText.length(), image, NLS.bind(XMLUIMessages.Close_with__, (new Object[]{"'" + proposedText + "'"})), //$NON-NLS-1$ //$NON-NLS-2$
+								proposal = new CustomCompletionProposal(replacementText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), replacementText.length(), image, NLS.bind(XMLUIMessages.Close_with__, (new Object[]{"'" + displayText + "'"})), //$NON-NLS-1$ //$NON-NLS-2$
 											null, proposedInfo, XMLRelevanceConstants.R_END_TAG_NAME);
 							}
 							contentAssistRequest.addProposal(proposal);
@@ -855,7 +868,8 @@
 				CMDataType childType = parentDecl.getDataType();
 				if (childType != null) {
 					String[] childStrings = childType.getEnumeratedValues();
-					if (childStrings != null) {
+					String defaultValue = childType.getImpliedValue();
+					if (childStrings != null || defaultValue != null) {
 						// the content string is the sole valid child...so
 						// replace the rest
 						int begin = contentAssistRequest.getReplacementBeginPosition();
@@ -868,7 +882,14 @@
 						}
 						String proposedInfo = getAdditionalInfo(parentDecl, childType);
 						for (int i = 0; i < childStrings.length; i++) {
-							CustomCompletionProposal textProposal = new CustomCompletionProposal(childStrings[i], begin, length, childStrings[i].length(), XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ENUM), childStrings[i], null, proposedInfo, XMLRelevanceConstants.R_TAG_INSERTION);
+							if(!childStrings[i].equals(defaultValue))
+							{
+								CustomCompletionProposal textProposal = new CustomCompletionProposal(childStrings[i], begin, length, childStrings[i].length(), XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ENUM), childStrings[i], null, proposedInfo, XMLRelevanceConstants.R_TAG_INSERTION);
+								contentAssistRequest.addProposal(textProposal);
+							}
+						}
+						if(defaultValue != null) {
+							CustomCompletionProposal textProposal = new CustomCompletionProposal(defaultValue, begin, length, defaultValue.length(), XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_DEFAULT), defaultValue, null, proposedInfo, XMLRelevanceConstants.R_TAG_INSERTION);
 							contentAssistRequest.addProposal(textProposal);
 						}
 					}
@@ -1037,26 +1058,20 @@
 						cursorAdjustment = proposedText.length();
 						if (elementDecl instanceof CMElementDeclaration) {
 							CMElementDeclaration ed = (CMElementDeclaration) elementDecl;
-							if (ed.getContentType() == CMElementDeclaration.EMPTY) {
-								proposedText += getContentGenerator().getStartTagClose(parent, ed);
-								cursorAdjustment = proposedText.length();
-							}
-							else {
-								// https://bugs.eclipse.org/bugs/show_bug.cgi?id=89811
-								StringBuffer sb = new StringBuffer();
-								getContentGenerator().generateTag(parent, ed, sb);
-								// since it's a name proposal, assume '<' is
-								// already there
-								// only return the rest of the tag
-								proposedText = sb.toString().substring(1);
-								cursorAdjustment = getCursorPositionForProposedText(proposedText);
+							// https://bugs.eclipse.org/bugs/show_bug.cgi?id=89811
+							StringBuffer sb = new StringBuffer();
+							getContentGenerator().generateTag(parent, ed, sb);
+							// since it's a name proposal, assume '<' is
+							// already there
+							// only return the rest of the tag
+							proposedText = sb.toString().substring(1);
+							cursorAdjustment = getCursorPositionForProposedText(proposedText);
 
-								// cursorAdjustment = proposedText.length() +
-								// 1;
-								// proposedText += "></" +
-								// getRequiredName(parent, elementDecl) + ">";
-								// //$NON-NLS-2$//$NON-NLS-1$
-							}
+							// cursorAdjustment = proposedText.length() +
+							// 1;
+							// proposedText += "></" +
+							// getRequiredName(parent, elementDecl) + ">";
+							// //$NON-NLS-2$//$NON-NLS-1$
 						}
 					}
 					if (beginsWith(proposedText, matchString)) {
@@ -1105,14 +1120,6 @@
 
 					cursorAdjustment = getCursorPositionForProposedText(proposedText);
 
-					if (ed instanceof CMElementDeclaration) {
-						CMElementDeclaration elementDecl = (CMElementDeclaration) ed;
-						if (elementDecl.getContentType() == CMElementDeclaration.EMPTY) {
-							proposedText += getContentGenerator().getStartTagClose(parent, elementDecl);
-							cursorAdjustment = proposedText.length();
-						}
-					}
-
 					String proposedInfo = getAdditionalInfo(null, ed);
 					Image image = CMImageUtil.getImage(ed);
 					if (image == null) {
@@ -1455,10 +1462,7 @@
 	 *            <code>null</code> if no context could be found
 	 */
 	public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
-		if (fAttributeInfoProvider == null) {
-			fAttributeInfoProvider = new AttributeContextInformationProvider((IStructuredDocument) viewer.getDocument(), (AttributeContextInformationPresenter) getContextInformationValidator());
-		}
-		return fAttributeInfoProvider.getAttributeInformation(documentOffset);
+		return new IContextInformation[0];
 	}
 
 	protected ContentAssistRequest computeEndTagOpenProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
@@ -1688,12 +1692,21 @@
 	protected ContentAssistRequest computeTagOpenProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
 		ContentAssistRequest contentAssistRequest = null;
 		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-		if (sdRegion != nodeAtOffset.getFirstStructuredDocumentRegion()) {
+		if (sdRegion != nodeAtOffset.getFirstStructuredDocumentRegion() || sdRegion.getPrevious() != null && sdRegion.getPrevious().getLastRegion().getType() == DOMRegionContext.XML_TAG_OPEN) {
 			// completing the *first* XML_TAG_OPEN in "<<tagname"
 			IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
 			if (actualNode != null) {
-				contentAssistRequest = newContentAssistRequest(actualNode, actualNode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
-				addTagNameProposals(contentAssistRequest, getElementPositionForModelQuery(actualNode));
+				if(sdRegion.getFirstRegion().getType() == DOMRegionContext.XML_END_TAG_OPEN) {
+					contentAssistRequest = newContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition, 0, matchString);
+					if(actualNode.hasChildNodes())
+						addTagNameProposals(contentAssistRequest, getElementPositionForModelQuery(actualNode.getLastChild()));
+					else
+						addTagNameProposals(contentAssistRequest, 0);
+				}
+				else {
+					contentAssistRequest = newContentAssistRequest(actualNode, actualNode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
+					addTagNameProposals(contentAssistRequest, getElementPositionForModelQuery(actualNode));
+				}
 				addEndTagProposals(contentAssistRequest); // (pa) 220850
 			}
 		}
@@ -1717,7 +1730,7 @@
 				// (pa) ITextRegion refactor
 				// if (name != null && name.containsOffset(documentPosition))
 				// {
-				if ((name != null) && ((sdRegion.getStartOffset(name) <= documentPosition) && (sdRegion.getEndOffset(name) >= documentPosition))) {
+				if ((name != null) && ((sdRegion.getStartOffset(name) <= documentPosition) && (sdRegion.getEndOffset(name) >= documentPosition)) && (sdRegion.getLastRegion().getType() == DOMRegionContext.XML_TAG_CLOSE || sdRegion.getLastRegion().getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE)){ 
 					// replace the existing name
 					contentAssistRequest = newContentAssistRequest(node, node.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(name), name.getTextLength(), matchString);
 				}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractXMLCompletionProposalComputer.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractXMLCompletionProposalComputer.java
new file mode 100644
index 0000000..dd21a18
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractXMLCompletionProposalComputer.java
@@ -0,0 +1,1112 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Vector;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.Logger;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * <p>Implements the framework for making proposals in XML type documents.  Deals with
+ * all the nastiness needed to figure out where in an XML type document the content
+ * assist was invoked and then calls one of many abstract methods depending on the
+ * area the content assist was invoked.  In this way implementers only have to worry about
+ * implementing what to do in each situation while not having to deal with figuring out
+ * which situation the content assist was invoked in.</p>
+ * 
+ * @base org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor
+ * @see DefaultXMLCompletionProposalComputer
+ */
+public abstract class AbstractXMLCompletionProposalComputer implements ICompletionProposalComputer {
+	/**
+	 * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
+	 * way for expedency. Should be evolved in future to depend on
+	 * "nestedContext".
+	 */
+	private class DOMJSPRegionContextsPrivateCopy {
+		private static final String JSP_CLOSE = "JSP_CLOSE"; //$NON-NLS-1$
+		private static final String JSP_COMMENT_CLOSE = "JSP_COMMENT_CLOSE"; //$NON-NLS-1$
+
+		private static final String JSP_COMMENT_OPEN = "JSP_COMMENT_OPEN"; //$NON-NLS-1$
+		private static final String JSP_DECLARATION_OPEN = "JSP_DECLARATION_OPEN"; //$NON-NLS-1$
+		private static final String JSP_DIRECTIVE_CLOSE = "JSP_DIRECTIVE_CLOSE"; //$NON-NLS-1$
+		private static final String JSP_DIRECTIVE_NAME = "JSP_DIRECTIVE_NAME"; //$NON-NLS-1$
+
+		private static final String JSP_DIRECTIVE_OPEN = "JSP_DIRECTIVE_OPEN"; //$NON-NLS-1$
+		private static final String JSP_EXPRESSION_OPEN = "JSP_EXPRESSION_OPEN"; //$NON-NLS-1$
+
+		private static final String JSP_ROOT_TAG_NAME = "JSP_ROOT_TAG_NAME"; //$NON-NLS-1$
+
+		private static final String JSP_SCRIPTLET_OPEN = "JSP_SCRIPTLET_OPEN"; //$NON-NLS-1$
+	}
+
+	private String fErrorMessage;
+	private ITextViewer fTextViewer;
+
+	public AbstractXMLCompletionProposalComputer() {
+		fErrorMessage = null;
+		fTextViewer = null;
+	}
+	
+	/**
+	 * <p>Return a list of proposed code completions based on the specified
+	 * location within the document that corresponds to the current cursor
+	 * position within the text-editor control.</p>
+	 * 
+	 * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeCompletionProposals(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		ITextViewer textViewer = context.getViewer();
+		int documentPosition = context.getInvocationOffset();
+
+		setErrorMessage(null);
+
+		fTextViewer = textViewer;
+
+		IndexedRegion treeNode = ContentAssistUtils.getNodeAt(textViewer, documentPosition);
+
+		Node node = (Node) treeNode;
+		while ((node != null) && (node.getNodeType() == Node.TEXT_NODE) && (node.getParentNode() != null)) {
+			node = node.getParentNode();
+		}
+		IDOMNode xmlnode = (IDOMNode) node;
+
+		ContentAssistRequest contentAssistRequest = null;
+
+		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
+		ITextRegion completionRegion = getCompletionRegion(documentPosition, node);
+
+		String matchString = getMatchString(sdRegion, completionRegion, documentPosition);
+
+		// Handle empty Documents
+		if (completionRegion == null) {
+			if (((treeNode == null) || (((Node) treeNode).getNodeType() == Node.DOCUMENT_NODE)) && (completionRegion == null) &&
+					((xmlnode == null) || (xmlnode.getChildNodes() == null) || (xmlnode.getChildNodes().getLength() == 0))) {
+				
+				IStructuredModel sModel = null;
+				try {
+					if(textViewer.getDocument() instanceof IStructuredDocument) {
+						sModel = StructuredModelManager.getModelManager().getModelForRead((IStructuredDocument)textViewer.getDocument());
+					}
+					if (sModel != null) {
+						IDOMDocument docNode = ((IDOMModel) sModel).getDocument();
+						contentAssistRequest = new ContentAssistRequest(docNode, docNode, sdRegion, completionRegion, documentPosition, 0, null);
+						addEmptyDocumentProposals(contentAssistRequest, context);
+					}
+				}
+				finally {
+					if (sModel != null) {
+						sModel.releaseFromRead();
+					}
+				}
+				if (contentAssistRequest == null) {
+					Logger.logException(new IllegalStateException("problem getting model")); //$NON-NLS-1$
+					return new ArrayList(0);
+				}
+				
+				ICompletionProposal[] props = contentAssistRequest.getCompletionProposals();
+				return (props != null) ? Arrays.asList(props) : new ArrayList(0);
+			}
+			// MASSIVE ERROR CONDITION
+			Logger.logException(new IllegalStateException("completion region was null")); //$NON-NLS-1$
+			setErrorMessage(XMLUIMessages.SEVERE_internal_error_occu_UI_);
+			contentAssistRequest = new ContentAssistRequest((Node) treeNode, node.getParentNode(), sdRegion, completionRegion, documentPosition, 0, ""); //$NON-NLS-1$
+			ICompletionProposal[] props = contentAssistRequest.getCompletionProposals();
+			return (props != null) ? Arrays.asList(props) : new ArrayList(0);
+		}
+
+
+		// catch documents where no region can be determined
+		if ((xmlnode.getNodeType() == Node.DOCUMENT_NODE) && ((completionRegion == null) ||
+				(xmlnode.getChildNodes() == null) || (xmlnode.getChildNodes().getLength() == 0))) {
+			
+			contentAssistRequest = computeStartDocumentProposals(matchString, completionRegion,
+					(IDOMNode) treeNode,xmlnode, context);
+			ICompletionProposal[] props = contentAssistRequest.getCompletionProposals();
+			return (props != null) ? Arrays.asList(props) : new ArrayList(0);
+		}
+
+		// compute normal proposals
+		contentAssistRequest = computeCompletionProposals(matchString, completionRegion, (IDOMNode) treeNode, xmlnode, context);
+		if (contentAssistRequest == null) {
+			contentAssistRequest = new ContentAssistRequest((Node) treeNode, node.getParentNode(), sdRegion, completionRegion, documentPosition, 0, ""); //$NON-NLS-1$
+			setErrorMessage(XMLUIMessages.Content_Assist_not_availab_UI_);
+		}
+
+		/* 
+		 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=123892
+		 * Only set this error message if nothing else was already set 
+		 **/
+		if (contentAssistRequest.getProposals().size() == 0 && getErrorMessage() == null) {
+			setErrorMessage(XMLUIMessages.Content_Assist_not_availab_UI_);
+		}
+
+		ICompletionProposal[] props = contentAssistRequest.getCompletionProposals();
+		return (props != null) ? Arrays.asList(props) : new ArrayList(0);
+	}
+	
+	/**
+	 * <p>Returns information about possible contexts based on the specified
+	 * location within the document that corresponds to the current cursor
+	 * position within the text viewer.</p>
+	 * 
+	 * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#computeContextInformation(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeContextInformation(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		//no default context info
+		return Collections.EMPTY_LIST;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#getErrorMessage()
+	 */
+	public String getErrorMessage() {
+		return fErrorMessage;
+	}
+
+	/**
+	 * Add proposals for attribute names
+	 * 
+	 * @param contentAssistRequest
+	 * @param context
+	 */
+	protected abstract void addAttributeNameProposals(ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context);
+
+	/**
+	 * Add proposals for attribute values
+	 * 
+	 * @param contentAssistRequest
+	 * @param context
+	 */
+	protected abstract void addAttributeValueProposals(ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context);
+
+	/**
+	 * Add comment proposals
+	 * 
+	 * @param contentAssistRequest
+	 * @param context
+	 */
+	protected abstract void addCommentProposal(ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context);
+
+	/**
+	 * Add the proposals for a completely empty document
+	 * 
+	 * @param contentAssistRequest
+	 * @param context
+	 */
+	protected abstract void addEmptyDocumentProposals(ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context);
+	
+	/**
+	 * Add the proposals for the name in an end tag
+	 * 
+	 * @param contentAssistRequest
+	 * @param context
+	 */
+	protected abstract void addEndTagNameProposals(ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context);
+	
+	/**
+	 * Prompt for end tags to a non-empty Node that hasn't ended Handles these
+	 * cases: <br>
+	 * <tagOpen>| <br>
+	 * <tagOpen>< |<br>
+	 * <tagOpen></ |
+	 * 
+	 * @param contentAssistRequest
+	 * @param context
+	 */
+	protected abstract void addEndTagProposals(ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context);
+	
+	/**
+	 * Add entity proposals
+	 * 
+	 * @param contentAssistRequest
+	 * @param completionRegion
+	 * @param treeNode
+	 * @param context
+	 */
+	protected abstract void addEntityProposals(ContentAssistRequest contentAssistRequest,
+			ITextRegion completionRegion, IDOMNode treeNode, CompletionProposalInvocationContext context);
+
+	/**
+	 * add entity proposals
+	 * 
+	 * @param proposals
+	 * @param map
+	 * @param key
+	 * @param nodeOffset
+	 * @param sdRegion
+	 * @param completionRegion
+	 * @param context
+	 */
+	protected abstract void addEntityProposals(Vector proposals, Properties map, String key,
+			int nodeOffset, IStructuredDocumentRegion sdRegion, ITextRegion completionRegion,
+			CompletionProposalInvocationContext context);
+
+	/**
+	 * Add PCData proposals
+	 * 
+	 * @param nodeName
+	 * @param contentAssistRequest
+	 * @param context
+	 */
+	protected abstract void addPCDATAProposal(String nodeName, ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context);
+
+	/**
+	 * Add start document proposals
+	 * 
+	 * @param contentAssistRequest
+	 * @param context
+	 */
+	protected abstract void addStartDocumentProposals(ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context);
+
+	/**
+	 * Close an unclosed start tag
+	 * 
+	 * @param contentAssistRequest
+	 * @param context
+	 */
+	protected abstract void addTagCloseProposals(ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context);
+
+	/**
+	 * Add tag insertion proposals
+	 * 
+	 * @param contentAssistRequest
+	 * @param childPosition
+	 * @param context
+	 */
+	protected abstract void addTagInsertionProposals(ContentAssistRequest contentAssistRequest,
+			int childPosition, CompletionProposalInvocationContext context);
+
+	/**
+	 * Add tag name proposals
+	 * 
+	 * @param contentAssistRequest
+	 * @param childPosition
+	 * @param context
+	 */
+	protected abstract void addTagNameProposals(ContentAssistRequest contentAssistRequest,
+			int childPosition, CompletionProposalInvocationContext context);
+	
+	/**
+	 * @param errorMessage the reason why computeProposals was not able to find any
+	 * completions.
+	 */
+	protected void setErrorMessage(String errorMessage) {
+		fErrorMessage = errorMessage;
+	}
+	
+	/**
+	 * <p>This does all the magic of figuring out where in the XML type document
+	 * the content assist was invoked and then calling the corresponding method
+	 * to add the correct proposals</p>
+	 * 
+	 * <p><b>NOTE: </b>if overriding be sure to make super call back to this method otherwise
+	 * you will loose all of the proposals generated by this method</p>
+	 * 
+	 * @param matchString
+	 * @param completionRegion
+	 * @param treeNode
+	 * @param xmlnode
+	 * @param context
+	 * 
+	 * @return {@link ContentAssistRequest} that now has all the proposals in it
+	 */
+	protected ContentAssistRequest computeCompletionProposals(String matchString, ITextRegion completionRegion,
+			IDOMNode treeNode, IDOMNode xmlnode, CompletionProposalInvocationContext context) {
+		
+		int documentPosition = context.getInvocationOffset();
+		
+		ContentAssistRequest contentAssistRequest = null;
+		String regionType = completionRegion.getType();
+		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
+
+		// Handle the most common and best supported cases
+		if ((xmlnode.getNodeType() == Node.ELEMENT_NODE) || (xmlnode.getNodeType() == Node.DOCUMENT_NODE)) {
+			if (regionType == DOMRegionContext.XML_TAG_OPEN) {
+				contentAssistRequest = computeTagOpenProposals(matchString, completionRegion, treeNode, xmlnode, context);
+			}
+			else if (regionType == DOMRegionContext.XML_TAG_NAME) {
+				contentAssistRequest = computeTagNameProposals(matchString, completionRegion,
+						treeNode, xmlnode, context);
+			}
+			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
+				contentAssistRequest = computeAttributeProposals(matchString, completionRegion, treeNode, xmlnode, context);
+			}
+			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
+				contentAssistRequest = computeEqualsProposals(matchString, completionRegion,
+						treeNode, xmlnode, context);
+			}
+			else if ((regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) && (documentPosition == sdRegion.getTextEndOffset()) &&
+					(sdRegion.getText(completionRegion).endsWith("\"") || sdRegion.getText(completionRegion).endsWith("\'"))) { //$NON-NLS-1$ //$NON-NLS-2$ 
+				// this is for when the cursor is at the end of the closing
+				// quote for an attribute..
+				IDOMNode actualNode = (IDOMNode) xmlnode.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
+				contentAssistRequest = new ContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition, 0, matchString);
+				addTagCloseProposals(contentAssistRequest, context);
+			}
+			else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
+				contentAssistRequest = computeAttributeValueProposals(matchString, completionRegion, treeNode, xmlnode, context);
+			}
+			else if ((regionType == DOMRegionContext.XML_TAG_CLOSE) || (regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE) ||
+					(regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_CLOSE))) {
+				
+				contentAssistRequest = computeTagCloseProposals(matchString, completionRegion, treeNode, xmlnode, context);
+			}
+			else if (regionType == DOMRegionContext.XML_END_TAG_OPEN) {
+				contentAssistRequest = computeEndTagOpenProposals(matchString, completionRegion,
+						treeNode, xmlnode, context);
+			}
+			else if ((regionType == DOMRegionContext.XML_CONTENT) || (regionType == DOMRegionContext.XML_CHAR_REFERENCE) ||
+					(regionType == DOMRegionContext.XML_ENTITY_REFERENCE) || (regionType == DOMRegionContext.XML_PE_REFERENCE)) {
+				
+				contentAssistRequest = computeContentProposals(matchString, completionRegion,
+						treeNode, xmlnode, context);
+			}
+
+			// These ITextRegion types begin DOM Elements as well and although
+			// internally harder to assist,
+			// text insertions directly before them can be made
+			else if ((documentPosition == sdRegion.getStartOffset(completionRegion)) &&
+					(regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_COMMENT_OPEN) ||
+							regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DECLARATION_OPEN) ||
+							regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_OPEN) ||
+							regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_EXPRESSION_OPEN) ||
+							regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_SCRIPTLET_OPEN) ||
+							(regionType == DOMRegionContext.XML_DECLARATION_OPEN) ||
+							(regionType == DOMRegionContext.XML_PI_OPEN) ||
+							(regionType == DOMRegionContext.XML_COMMENT_OPEN) ||
+							(regionType == DOMRegionContext.XML_CDATA_OPEN))) {
+				
+				contentAssistRequest = new ContentAssistRequest(treeNode, xmlnode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
+				addTagInsertionProposals(contentAssistRequest, getElementPosition(treeNode), context);
+				addStartDocumentProposals(contentAssistRequest, context);
+			}
+		}
+		// Not a Document or Element? (odd cases go here for now)
+		else if (isCloseRegion(completionRegion)) {
+			contentAssistRequest = new ContentAssistRequest(treeNode, xmlnode.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion) + completionRegion.getLength(), 0, matchString);
+			addStartDocumentProposals(contentAssistRequest, context);
+			if (documentPosition >= sdRegion.getTextEndOffset(completionRegion)) {
+				addTagInsertionProposals(contentAssistRequest, getElementPosition(treeNode) + 1, context);
+			}
+		}
+		else if ((documentPosition == sdRegion.getStartOffset(completionRegion)) &&
+				(regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_COMMENT_OPEN) ||
+						regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DECLARATION_OPEN) ||
+						regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_OPEN) ||
+						regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_EXPRESSION_OPEN) ||
+						regionType.equals(DOMJSPRegionContextsPrivateCopy.JSP_SCRIPTLET_OPEN) ||
+						(regionType == DOMRegionContext.XML_DECLARATION_OPEN) ||
+						(regionType == DOMRegionContext.XML_PI_OPEN) ||
+						(regionType == DOMRegionContext.XML_COMMENT_OPEN) ||
+						(regionType == DOMRegionContext.XML_CDATA_OPEN))) {
+			
+			contentAssistRequest = new ContentAssistRequest(treeNode, xmlnode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
+			addTagInsertionProposals(contentAssistRequest, getElementPosition(treeNode), context);
+			addStartDocumentProposals(contentAssistRequest, context);
+		}
+		return contentAssistRequest;
+	}
+	
+	/**
+	 * <p>Similar to {@link #computeCompletionProposals(CompletionProposalInvocationContext, IProgressMonitor)} only specificly for
+	 * attribute proposals</p>
+	 * 
+	 * <p>Implementers should not override this method, it is made available to implementers so that if they override
+	 * {@link #computeCompletionProposals(String, ITextRegion, IDOMNode, IDOMNode, CompletionProposalInvocationContext)}
+	 * they can call this method if needed</p>
+	 * 
+	 * @param matchString
+	 * @param completionRegion
+	 * @param nodeAtOffset
+	 * @param node
+	 * @param context
+	 * @return
+	 */
+	protected final ContentAssistRequest computeAttributeProposals(String matchString, ITextRegion completionRegion,
+			IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
+		
+		int documentPosition = context.getInvocationOffset();
+		ITextViewer viewer = context.getViewer();
+		ContentAssistRequest contentAssistRequest = null;
+		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
+		// if the attribute name is selected, replace it instead of creating a new attribute
+		if (documentPosition <= sdRegion.getStartOffset(completionRegion) && (viewer != null && viewer.getSelectedRange().y != (sdRegion.getEndOffset(completionRegion) - sdRegion.getStartOffset(completionRegion)))) {
+			// setup to insert new attributes
+			contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
+		}
+		else {
+			// Setup to replace an existing attribute name
+			contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
+		}
+		addAttributeNameProposals(contentAssistRequest, context);
+		contentAssistRequest.setReplacementBeginPosition(documentPosition);
+		contentAssistRequest.setReplacementLength(0);
+		if ((node.getFirstStructuredDocumentRegion() != null) && (!node.getFirstStructuredDocumentRegion().isEnded())) {
+			addTagCloseProposals(contentAssistRequest, context);
+		}
+		return contentAssistRequest;
+	}
+	
+	/**
+	 * <p>this is the position the cursor should be in after the proposal is
+	 * applied</p>
+	 * 
+	 * @param proposedText
+	 * @return the position the cursor should be in after the proposal is
+	 *         applied
+	 */
+	protected static int getCursorPositionForProposedText(String proposedText) {
+		int cursorAdjustment;
+		cursorAdjustment = proposedText.indexOf("\"\"") + 1; //$NON-NLS-1$
+		// otherwise, after the first tag
+		if (cursorAdjustment == 0) {
+			cursorAdjustment = proposedText.indexOf('>') + 1;
+		}
+		if (cursorAdjustment == 0) {
+			cursorAdjustment = proposedText.length() + 1;
+		}
+
+		return cursorAdjustment;
+	}
+	
+	/**
+	 * <p>helpful utility method for determining if one string starts with another one.
+	 * This is case insensitive. If either are null then result is <code>true</code></p>
+	 * 
+	 * @param aString the string to check to see if it starts with the given prefix
+	 * @param prefix check that the given string starts with this prefix
+	 * 
+	 * @return <code>true</code> if the given string starts with the given prefix,
+	 * <code>false</code> otherwise
+	 */
+	protected static boolean beginsWith(String aString, String prefix) {
+		if ((aString == null) || (prefix == null)) {
+			return true;
+		}
+		return aString.toLowerCase().startsWith(prefix.toLowerCase());
+	}
+
+	private ContentAssistRequest computeAttributeValueProposals(String matchString, ITextRegion completionRegion,
+			IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
+		
+		int documentPosition = context.getInvocationOffset();
+		
+		ContentAssistRequest contentAssistRequest = null;
+		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
+		if ((documentPosition > sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength()) && (sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength() != sdRegion.getStartOffset(completionRegion) + completionRegion.getLength())) {
+			// setup to add a new attribute at the documentPosition
+			IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
+			contentAssistRequest = new ContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition, 0, matchString);
+			addAttributeNameProposals(contentAssistRequest, context);
+			if ((actualNode.getFirstStructuredDocumentRegion() != null) && !actualNode.getFirstStructuredDocumentRegion().isEnded()) {
+				addTagCloseProposals(contentAssistRequest, context);
+			}
+		}
+		else {
+			// setup to replace the existing value
+			if (!nodeAtOffset.getFirstStructuredDocumentRegion().isEnded() && (documentPosition < sdRegion.getStartOffset(completionRegion))) {
+				// if the IStructuredDocumentRegion isn't closed and the
+				// cursor is in front of the value, add
+				contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
+				addAttributeNameProposals(contentAssistRequest, context);
+			}
+			else {
+				int replaceLength = completionRegion.getTextLength();
+				
+				//if container region, be sure replace length is only the attribute value region not the entire container
+				if(completionRegion instanceof ITextRegionContainer){
+					ITextRegion openRegion = ((ITextRegionContainer) completionRegion).getFirstRegion();
+					ITextRegion closeRegion = ((ITextRegionContainer) completionRegion).getLastRegion();
+					
+					/*
+					 * check to see if the container is opened the same way its closed.
+					 * Such as:
+					 * <img src=' '
+					 * But not:
+					 * <img src='
+					 * 
+					 * </body>
+					 * </html>
+					 * In the latter case we only want to replace the opening text of the container
+					 * Admittedly crude test, but effective.
+					 */
+					if(openRegion.getType() != closeRegion.getType()) {
+						replaceLength = openRegion.getTextLength();
+					}
+				} 
+				
+				contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion,
+						completionRegion, sdRegion.getStartOffset(completionRegion),
+						replaceLength, matchString);
+				
+				addAttributeValueProposals(contentAssistRequest, context);
+			}
+		}
+		return contentAssistRequest;
+	}
+
+	private ContentAssistRequest computeContentProposals(String matchString, ITextRegion completionRegion,
+			IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
+		
+		int documentPosition = context.getInvocationOffset();
+		ContentAssistRequest contentAssistRequest = null;
+
+		// setup to add children at the content node's position
+		contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, getStructuredDocumentRegion(documentPosition), completionRegion, documentPosition, 0, matchString);
+		if ((node != null) && (node.getNodeType() == Node.DOCUMENT_NODE) && (((Document) node).getDoctype() == null)) {
+			addStartDocumentProposals(contentAssistRequest, context);
+		}
+		addTagInsertionProposals(contentAssistRequest, getElementPosition(nodeAtOffset), context);
+		if (node.getNodeType() != Node.DOCUMENT_NODE) {
+			addEndTagProposals(contentAssistRequest, context);
+		}
+		// entities?
+		addEntityProposals(contentAssistRequest, completionRegion, node, context);
+		// addEntityProposals(contentAssistRequest);
+		return contentAssistRequest;
+	}
+
+	private ContentAssistRequest computeEndTagOpenProposals(String matchString, ITextRegion completionRegion,
+			IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
+		
+		int documentPosition = context.getInvocationOffset();
+		ContentAssistRequest contentAssistRequest = null;
+		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
+		int completionRegionStart = sdRegion.getStartOffset(completionRegion);
+		int completionRegionLength = completionRegion.getLength();
+		IStructuredDocumentRegion sdRegionAtCompletionOffset = node.getStructuredDocument().getRegionAtCharacterOffset(completionRegionStart + completionRegionLength);
+		ITextRegion regionAtEndOfCompletion = sdRegionAtCompletionOffset.getRegionAtCharacterOffset(completionRegionStart + completionRegionLength);
+
+		if ((documentPosition != completionRegionStart) && (regionAtEndOfCompletion != null) && (regionAtEndOfCompletion.getType() == DOMRegionContext.XML_TAG_NAME)) {
+			ITextRegion nameRegion = regionAtEndOfCompletion;
+			contentAssistRequest = new ContentAssistRequest(nodeAtOffset, nodeAtOffset.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(nameRegion), nameRegion.getTextLength(), matchString);
+		}
+		else {
+			if (nodeAtOffset.getFirstStructuredDocumentRegion() == sdRegion) {
+				// abnormal case, this unmatched end tag will be a sibling
+				contentAssistRequest = new ContentAssistRequest(nodeAtOffset, nodeAtOffset.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
+			}
+			else {
+				// normal case, this end tag is the parent
+				contentAssistRequest = new ContentAssistRequest(nodeAtOffset, nodeAtOffset, sdRegion, completionRegion, documentPosition, 0, matchString);
+			}
+		}
+		// if (documentPosition >= sdRegion.getStartOffset(completionRegion) +
+		// completionRegion.getTextLength())
+		addEndTagProposals(contentAssistRequest, context);
+		// else
+		if (completionRegionStart == documentPosition) {
+			// positioned at start of end tag
+			addTagInsertionProposals(contentAssistRequest, node.getChildNodes().getLength(), context);
+		}
+		return contentAssistRequest;
+	}
+
+
+	private ContentAssistRequest computeEqualsProposals(String matchString, ITextRegion completionRegion,
+			IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
+		
+		int documentPosition = context.getInvocationOffset();
+		ContentAssistRequest contentAssistRequest = null;
+		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
+		ITextRegion valueRegion = node.getStartStructuredDocumentRegion().getRegionAtCharacterOffset(sdRegion.getStartOffset(completionRegion) + completionRegion.getLength());
+		if ((valueRegion != null) && (valueRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) && (sdRegion.getStartOffset(valueRegion) <= documentPosition)) {
+			// replace the adjacent attribute value
+			contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, valueRegion, sdRegion.getStartOffset(valueRegion), valueRegion.getTextLength(), matchString);
+		}
+		else {
+			// append an attribute value after the '='
+			contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
+		}
+		addAttributeValueProposals(contentAssistRequest, context);
+		return contentAssistRequest;
+	}
+
+	private ContentAssistRequest computeStartDocumentProposals(String matchString, ITextRegion completionRegion,
+			IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
+		
+		int documentPosition = context.getInvocationOffset();
+		
+		// setup for a non-empty document, but one that hasn't been formally
+		// started
+		ContentAssistRequest contentAssistRequest = null;
+		contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node,
+				getStructuredDocumentRegion(documentPosition), completionRegion,
+				documentPosition, 0, matchString);
+		addStartDocumentProposals(contentAssistRequest, context);
+		return contentAssistRequest;
+	}
+
+	private ContentAssistRequest computeTagCloseProposals(String matchString, ITextRegion completionRegion,
+			IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
+		
+		int documentPosition = context.getInvocationOffset();
+		ContentAssistRequest contentAssistRequest = null;
+		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
+
+		if ((node.getNodeType() == Node.DOCUMENT_NODE) || (documentPosition >= sdRegion.getEndOffset())) {
+			// this is a content request as the documentPosition is AFTER the
+			// end of the closing region
+			if ((node == nodeAtOffset) && (node.getParentNode() != null)) {
+				node = (IDOMNode) node.getParentNode();
+			}
+			contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
+			addTagInsertionProposals(contentAssistRequest, getElementPosition(nodeAtOffset), context);
+			if ((node.getNodeType() != Node.DOCUMENT_NODE) && (node.getEndStructuredDocumentRegion() == null)) {
+				addEndTagProposals(contentAssistRequest, context);
+			}
+		}
+		else {
+			// at the start of the tag's close or within it
+			ITextRegion closeRegion = sdRegion.getLastRegion();
+			boolean insideTag = !sdRegion.isEnded() || (documentPosition <= sdRegion.getStartOffset(closeRegion));
+			if (insideTag) {
+				// this is a request for completions within a tag
+				contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
+				if ((node.getNodeType() != Node.DOCUMENT_NODE) && (node.getEndStructuredDocumentRegion() != null)) {
+					addTagCloseProposals(contentAssistRequest, context);
+				}
+				if (sdRegion == nodeAtOffset.getFirstStructuredDocumentRegion()) {
+					contentAssistRequest.setReplacementBeginPosition(documentPosition);
+					contentAssistRequest.setReplacementLength(0);
+					addAttributeNameProposals(contentAssistRequest, context);
+				}
+			}
+		}
+		return contentAssistRequest;
+	}
+
+	private ContentAssistRequest computeTagNameProposals(String matchString, ITextRegion completionRegion,
+			IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
+		
+		int documentPosition = context.getInvocationOffset();
+		ContentAssistRequest contentAssistRequest = null;
+		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
+
+		if (sdRegion != nodeAtOffset.getFirstStructuredDocumentRegion()) {
+			// completing the *first* tag in "<tagname1 |<tagname2"
+			IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
+			if (actualNode != null) {
+				if (actualNode.getFirstStructuredDocumentRegion() == sdRegion) {
+					// start tag
+					if (documentPosition > sdRegion.getStartOffset(completionRegion) + completionRegion.getLength()) {
+						// it's attributes
+						contentAssistRequest = new ContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition - matchString.length(), matchString.length(), matchString);
+						if (node.getStructuredDocument().getRegionAtCharacterOffset(sdRegion.getStartOffset(completionRegion) - 1).getRegionAtCharacterOffset(sdRegion.getStartOffset(completionRegion) - 1).getType() == DOMRegionContext.XML_TAG_OPEN) {
+							addAttributeNameProposals(contentAssistRequest, context);
+						}
+						addTagCloseProposals(contentAssistRequest, context);
+					}
+					else {
+						// it's name
+						contentAssistRequest = new ContentAssistRequest(actualNode, actualNode.getParentNode(),
+								sdRegion, completionRegion, documentPosition - matchString.length(),
+								matchString.length(), matchString);
+						addTagNameProposals(contentAssistRequest, getElementPosition(actualNode),
+								context);
+					}
+				}
+				else {
+					if (documentPosition >= sdRegion.getStartOffset(completionRegion) + completionRegion.getLength()) {
+						// insert name
+						contentAssistRequest = new ContentAssistRequest(actualNode, actualNode.getParentNode(),
+								sdRegion, completionRegion, documentPosition, 0, matchString);
+					}
+					else {
+						// replace name
+						contentAssistRequest = new ContentAssistRequest(actualNode, actualNode.getParentNode(),
+								sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion),
+								completionRegion.getTextLength(), matchString);
+					}
+					addEndTagNameProposals(contentAssistRequest, context);
+				}
+			}
+		}
+		else {
+			if (documentPosition > sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength()) {
+				// unclosed tag with only a name; should prompt for attributes
+				// and a close instead
+				contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion,
+						documentPosition - matchString.length(), matchString.length(), matchString);
+				addAttributeNameProposals(contentAssistRequest, context);
+				addTagCloseProposals(contentAssistRequest, context);
+			}
+			else {
+				if (sdRegion.getRegions().get(0).getType() != DOMRegionContext.XML_END_TAG_OPEN) {
+					int replaceLength = documentPosition - sdRegion.getStartOffset(completionRegion);
+					contentAssistRequest = new ContentAssistRequest(node, node.getParentNode(), sdRegion,
+							completionRegion, sdRegion.getStartOffset(completionRegion), replaceLength, matchString);
+					addTagNameProposals(contentAssistRequest, getElementPosition(nodeAtOffset), context);
+				}
+				else {
+					IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(documentPosition);
+					if (actualNode != null) {
+						if (documentPosition >= sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength()) {
+							contentAssistRequest = new ContentAssistRequest(actualNode, actualNode.getParentNode(),
+									sdRegion, completionRegion, documentPosition, 0, matchString);
+						}
+						else {
+							contentAssistRequest = new ContentAssistRequest(actualNode, actualNode.getParentNode(),
+									sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion),
+									completionRegion.getTextLength(), matchString);
+						}
+						addEndTagNameProposals(contentAssistRequest, context);
+					}
+				}
+			}
+		}
+		return contentAssistRequest;
+	}
+
+	private ContentAssistRequest computeTagOpenProposals(String matchString, ITextRegion completionRegion,
+			IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
+		
+		int documentPosition = context.getInvocationOffset();
+		ContentAssistRequest contentAssistRequest = null;
+		IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
+		if (sdRegion != nodeAtOffset.getFirstStructuredDocumentRegion() || sdRegion.getPrevious() != null && sdRegion.getPrevious().getLastRegion().getType() == DOMRegionContext.XML_TAG_OPEN) {
+			// completing the *first* XML_TAG_OPEN in "<<tagname"
+			IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
+			if (actualNode != null) {
+				if(sdRegion.getFirstRegion().getType() == DOMRegionContext.XML_END_TAG_OPEN) {
+					contentAssistRequest = new ContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition, 0, matchString);
+					if(actualNode.hasChildNodes())
+						addTagNameProposals(contentAssistRequest,
+								getElementPosition(actualNode.getLastChild()), context);
+					else
+						addTagNameProposals(contentAssistRequest, 0, context);
+				}
+				else {
+					contentAssistRequest = new ContentAssistRequest(actualNode, actualNode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
+					addTagNameProposals(contentAssistRequest, getElementPosition(actualNode), context);
+				}
+				addEndTagProposals(contentAssistRequest, context); // (pa) 220850
+			}
+		}
+		else {
+			if (documentPosition == sdRegion.getStartOffset(completionRegion)) {
+				if (node.getNodeType() == Node.ELEMENT_NODE) {
+					// at the start of an existing tag, right before the '<'
+					contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node.getParentNode(), sdRegion,
+							completionRegion, documentPosition, 0, matchString);
+					addTagInsertionProposals(contentAssistRequest, getElementPosition(nodeAtOffset), context);
+					addEndTagProposals(contentAssistRequest, context);
+				}
+				else if (node.getNodeType() == Node.DOCUMENT_NODE) {
+					// at the opening of the VERY first tag with a '<'
+					contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node.getParentNode(), sdRegion,
+							completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
+					addStartDocumentProposals(contentAssistRequest, context);
+				}
+			}
+			else {
+				// within the white space
+				ITextRegion name = getNameRegion(node.getStartStructuredDocumentRegion());
+				// (pa) ITextRegion refactor
+				// if (name != null && name.containsOffset(documentPosition))
+				// {
+				if ((name != null) &&
+						((sdRegion.getStartOffset(name) <= documentPosition) && (sdRegion.getEndOffset(name) >= documentPosition)) &&
+						(sdRegion.getLastRegion().getType() == DOMRegionContext.XML_TAG_CLOSE || sdRegion.getLastRegion().getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE)){ 
+					
+					// replace the existing name
+					contentAssistRequest = new ContentAssistRequest(node, node.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(name), name.getTextLength(), matchString);
+				}
+				else {
+					// insert a valid new name, or possibly an end tag
+					contentAssistRequest = new ContentAssistRequest(nodeAtOffset, ((Node) nodeAtOffset).getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
+					addEndTagProposals(contentAssistRequest, context);
+					contentAssistRequest.setReplacementBeginPosition(documentPosition);
+					contentAssistRequest.setReplacementLength(0);
+				}
+				addTagNameProposals(contentAssistRequest, getElementPosition(nodeAtOffset), context);
+			}
+		}
+		return contentAssistRequest;
+	}
+
+	private ITextRegion getCompletionRegion(int offset, IStructuredDocumentRegion sdRegion) {
+		ITextRegion region = sdRegion.getRegionAtCharacterOffset(offset);
+		if (region == null) {
+			return null;
+		}
+
+		if (sdRegion.getStartOffset(region) == offset) {
+			// The offset is at the beginning of the region
+			if ((sdRegion.getStartOffset(region) == sdRegion.getStartOffset()) && (sdRegion.getPrevious() != null) && (!sdRegion.getPrevious().isEnded())) {
+				// Is the region also the start of the node? If so, the
+				// previous IStructuredDocumentRegion is
+				// where to look for a useful region.
+				region = sdRegion.getPrevious().getRegionAtCharacterOffset(offset - 1);
+			}
+			else {
+				// Is there no separating whitespace from the previous region?
+				// If not,
+				// then that region is the important one
+				ITextRegion previousRegion = sdRegion.getRegionAtCharacterOffset(offset - 1);
+				if ((previousRegion != null) && (previousRegion != region) && (previousRegion.getTextLength() == previousRegion.getLength())) {
+					region = previousRegion;
+				}
+			}
+		}
+		else {
+			// The offset is NOT at the beginning of the region
+			if (offset > sdRegion.getStartOffset(region) + region.getTextLength()) {
+				// Is the offset within the whitespace after the text in this
+				// region?
+				// If so, use the next region
+				ITextRegion nextRegion = sdRegion.getRegionAtCharacterOffset(sdRegion.getStartOffset(region) + region.getLength());
+				if (nextRegion != null) {
+					region = nextRegion;
+				}
+			}
+			else {
+				// Is the offset within the important text for this region?
+				// If so, then we've already got the right one.
+			}
+		}
+
+		// valid WHITE_SPACE region handler (#179924)
+		if ((region != null) && (region.getType() == DOMRegionContext.WHITE_SPACE)) {
+			ITextRegion previousRegion = sdRegion.getRegionAtCharacterOffset(sdRegion.getStartOffset(region) - 1);
+			if (previousRegion != null) {
+				region = previousRegion;
+			}
+		}
+
+		return region;
+	}
+
+	/**
+	 * Return the region whose content's require completion. This is something
+	 * of a misnomer as sometimes the user wants to be prompted for contents
+	 * of a non-existant ITextRegion, such as for enumerated attribute values
+	 * following an '=' sign.
+	 */
+	private ITextRegion getCompletionRegion(int documentPosition, Node domnode) {
+		if (domnode == null) {
+			return null;
+		}
+
+		ITextRegion region = null;
+		int offset = documentPosition;
+		IStructuredDocumentRegion flatNode = null;
+		IDOMNode node = (IDOMNode) domnode;
+
+		if (node.getNodeType() == Node.DOCUMENT_NODE) {
+			if (node.getStructuredDocument().getLength() == 0) {
+				return null;
+			}
+			ITextRegion result = node.getStructuredDocument().getRegionAtCharacterOffset(offset).getRegionAtCharacterOffset(offset);
+			while (result == null) {
+				offset--;
+				result = node.getStructuredDocument().getRegionAtCharacterOffset(offset).getRegionAtCharacterOffset(offset);
+			}
+			return result;
+		}
+
+		IStructuredDocumentRegion startTag = node.getStartStructuredDocumentRegion();
+		IStructuredDocumentRegion endTag = node.getEndStructuredDocumentRegion();
+
+		// Determine if the offset is within the start
+		// IStructuredDocumentRegion, end IStructuredDocumentRegion, or
+		// somewhere within the Node's XML content.
+		if ((startTag != null) && (startTag.getStartOffset() <= offset) && (offset < startTag.getStartOffset() + startTag.getLength())) {
+			flatNode = startTag;
+		}
+		else if ((endTag != null) && (endTag.getStartOffset() <= offset) && (offset < endTag.getStartOffset() + endTag.getLength())) {
+			flatNode = endTag;
+		}
+
+		if (flatNode != null) {
+			// the offset is definitely within the start or end tag, continue
+			// on and find the region
+			region = getCompletionRegion(offset, flatNode);
+		}
+		else {
+			// the docPosition is neither within the start nor the end, so it
+			// must be content
+			flatNode = node.getStructuredDocument().getRegionAtCharacterOffset(offset);
+			// (pa) ITextRegion refactor
+			// if (flatNode.contains(documentPosition)) {
+			if ((flatNode.getStartOffset() <= documentPosition) && (flatNode.getEndOffset() >= documentPosition)) {
+				// we're interesting in completing/extending the previous
+				// IStructuredDocumentRegion if the current
+				// IStructuredDocumentRegion isn't plain content or if it's
+				// preceded by an orphan '<'
+				if ((offset == flatNode.getStartOffset()) &&
+						(flatNode.getPrevious() != null) &&
+						(((flatNode.getRegionAtCharacterOffset(documentPosition) != null) &&
+								(flatNode.getRegionAtCharacterOffset(documentPosition).getType() != DOMRegionContext.XML_CONTENT)) ||
+								(flatNode.getPrevious().getLastRegion().getType() == DOMRegionContext.XML_TAG_OPEN) ||
+								(flatNode.getPrevious().getLastRegion().getType() == DOMRegionContext.XML_END_TAG_OPEN))) {
+					
+					// Is the region also the start of the node? If so, the
+					// previous IStructuredDocumentRegion is
+					// where to look for a useful region.
+					region = flatNode.getPrevious().getLastRegion();
+				}
+				else if (flatNode.getEndOffset() == documentPosition) {
+					region = flatNode.getLastRegion();
+				}
+				else {
+					region = flatNode.getFirstRegion();
+				}
+			}
+			else {
+				// catch end of document positions where the docPosition isn't
+				// in a IStructuredDocumentRegion
+				region = flatNode.getLastRegion();
+			}
+		}
+
+		return region;
+	}
+
+	private int getElementPosition(Node child) {
+		Node parent = child.getParentNode();
+		if (parent == null) {
+			return 0;
+		}
+
+		NodeList children = parent.getChildNodes();
+		if (children == null) {
+			return 0;
+		}
+		int count = 0;
+
+		for (int i = 0; i < children.getLength(); i++) {
+			if (children.item(i) == child) {
+				return count;
+			}
+			else {
+				// if (children.item(i).getNodeType() == Node.ELEMENT_NODE)
+				count++;
+			}
+		}
+		return 0;
+	}
+
+	private String getMatchString(IStructuredDocumentRegion parent, ITextRegion aRegion, int offset) {
+		if ((aRegion == null) || isCloseRegion(aRegion)) {
+			return ""; //$NON-NLS-1$
+		}
+		String matchString = null;
+		String regionType = aRegion.getType();
+		if ((regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) || (regionType == DOMRegionContext.XML_TAG_OPEN) || (offset > parent.getStartOffset(aRegion) + aRegion.getTextLength())) {
+			matchString = ""; //$NON-NLS-1$
+		}
+		else if (regionType == DOMRegionContext.XML_CONTENT) {
+			matchString = ""; //$NON-NLS-1$
+		}
+		else {
+			if ((parent.getText(aRegion).length() > 0) && (parent.getStartOffset(aRegion) < offset)) {
+				matchString = parent.getText(aRegion).substring(0, offset - parent.getStartOffset(aRegion));
+			}
+			else {
+				matchString = ""; //$NON-NLS-1$
+			}
+		}
+		return matchString;
+	}
+
+	private ITextRegion getNameRegion(IStructuredDocumentRegion flatNode) {
+		if (flatNode == null) {
+			return null;
+		}
+		Iterator regionList = flatNode.getRegions().iterator();
+		while (regionList.hasNext()) {
+			ITextRegion region = (ITextRegion) regionList.next();
+			if (isNameRegion(region)) {
+				return region;
+			}
+		}
+		return null;
+	}
+
+	private boolean isCloseRegion(ITextRegion region) {
+		String type = region.getType();
+		return ((type == DOMRegionContext.XML_PI_CLOSE) ||
+				(type == DOMRegionContext.XML_TAG_CLOSE) ||
+				(type == DOMRegionContext.XML_EMPTY_TAG_CLOSE) ||
+				(type == DOMRegionContext.XML_CDATA_CLOSE) ||
+				(type == DOMRegionContext.XML_COMMENT_CLOSE) ||
+				(type == DOMRegionContext.XML_ATTLIST_DECL_CLOSE) ||
+				(type == DOMRegionContext.XML_ELEMENT_DECL_CLOSE) ||
+				(type == DOMRegionContext.XML_DOCTYPE_DECLARATION_CLOSE) ||
+				(type == DOMJSPRegionContextsPrivateCopy.JSP_CLOSE) ||
+				(type == DOMJSPRegionContextsPrivateCopy.JSP_COMMENT_CLOSE) ||
+				(type.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_CLOSE)) ||
+				(type == DOMRegionContext.XML_DECLARATION_CLOSE));
+	}
+
+	private boolean isNameRegion(ITextRegion region) {
+		String type = region.getType();
+		return ((type == DOMRegionContext.XML_TAG_NAME) ||
+				(type == DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_NAME) ||
+				(type == DOMRegionContext.XML_ELEMENT_DECL_NAME) ||
+				(type == DOMRegionContext.XML_DOCTYPE_NAME) ||
+				(type == DOMRegionContext.XML_ATTLIST_DECL_NAME) ||
+				(type == DOMJSPRegionContextsPrivateCopy.JSP_ROOT_TAG_NAME) ||
+				type.equals(DOMJSPRegionContextsPrivateCopy.JSP_DIRECTIVE_NAME));
+	}
+	
+	/**
+	 * StructuredTextViewer must be set before using this.
+	 */
+	private IStructuredDocumentRegion getStructuredDocumentRegion(int pos) {
+		return ContentAssistUtils.getStructuredDocumentRegion(fTextViewer, pos);
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractXMLModelQueryCompletionProposalComputer.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractXMLModelQueryCompletionProposalComputer.java
new file mode 100644
index 0000000..55ab966
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractXMLModelQueryCompletionProposalComputer.java
@@ -0,0 +1,1846 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Vector;
+
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.core.internal.util.Debug;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMEntityDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAction;
+import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
+import org.eclipse.wst.xml.core.internal.document.AttrImpl;
+import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
+import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
+import org.eclipse.wst.xml.ui.internal.editor.CMImageUtil;
+import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
+import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
+import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;
+import org.eclipse.wst.xml.ui.internal.taginfo.MarkupTagInfoProvider;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+
+/**
+ * <p>Implementation of an {@link AbstractXMLCompletionProposalComputer} that uses {@link ModelQuery}s
+ * to make its proposals.</p>
+ * 
+ * @base org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor
+ */
+public abstract class AbstractXMLModelQueryCompletionProposalComputer extends AbstractXMLCompletionProposalComputer {
+	
+	private static MarkupTagInfoProvider infoProvider = new MarkupTagInfoProvider();
+	
+	/**
+	 * <p>Default constructor</p>
+	 */
+	public AbstractXMLModelQueryCompletionProposalComputer() {
+	}
+	
+	/**
+	 * <p>default is to do nothing</p>
+	 * 
+	 * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionEnded()
+	 */
+	public void sessionEnded() {
+		//default is to do nothing
+	}
+
+	/**
+	 * <p>default is to do nothing</p>
+	 * 
+	 * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionStarted()
+	 */
+	public void sessionStarted() {
+		//default is to do nothing
+	}
+	
+	/**
+	 * @return {@link XMLContentModelGenerator} used to generate proposals
+	 */
+	protected abstract XMLContentModelGenerator getContentGenerator();
+	
+	/**
+	 * <p>Given a {@link CMNode} generated by a model query should decide if the
+	 * action is valid for this implementation of the model query proposal computer</p>
+	 * 
+	 * <p>This is needed because {@link ModelQuery}s return a lot of {@link CMNode}s that
+	 * can come from multiple sources and a particular computer may not want to propose
+	 * all of the actions as content assist proposals</p>
+	 * 
+	 * @param action {@link CMNode} to decide if it is valid as a result
+	 * for this model query proposal computer
+	 * 
+	 * @return <code>true</code> if the given {@link CMNode} is valid for this
+	 * computer, <code>false</code> otherwise
+	 */
+	protected abstract boolean validModelQueryNode(CMNode node);
+	
+	protected void addAttributeNameProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
+		IStructuredDocumentRegion sdRegion = contentAssistRequest.getDocumentRegion();
+		// retrieve the list of attributes
+		CMElementDeclaration elementDecl = getCMElementDeclaration(node);
+		if (elementDecl != null) {
+			CMNamedNodeMapImpl attributes = new CMNamedNodeMapImpl(elementDecl.getAttributes());
+			addModelQueryAttributeDeclarations(node, elementDecl,attributes);
+
+			String matchString = contentAssistRequest.getMatchString();
+			int cursorOffset = context.getInvocationOffset();
+			// check whether an attribute really exists for the replacement
+			// offsets AND if it possesses a value
+			boolean attrAtLocationHasValue = false;
+			boolean proposalNeedsSpace = false;
+			NamedNodeMap attrs = node.getAttributes();
+			for (int i = 0; i < attrs.getLength(); i++) {
+				AttrImpl existingAttr = (AttrImpl) attrs.item(i);
+				ITextRegion name = existingAttr.getNameRegion();
+				
+				if ((sdRegion.getStartOffset(name) <= contentAssistRequest.getReplacementBeginPosition()) &&
+						(sdRegion.getStartOffset(name) + name.getLength() >= contentAssistRequest.getReplacementBeginPosition() + contentAssistRequest.getReplacementLength()) &&
+						(existingAttr.getValueRegion() != null)) {
+					// selected region is attribute name
+					if (cursorOffset >= sdRegion.getStartOffset(name) && contentAssistRequest.getReplacementLength() != 0)
+						attrAtLocationHasValue = true;
+					// propose new attribute, cursor is at the start of another attribute name
+					else if (cursorOffset == sdRegion.getStartOffset(name))
+						proposalNeedsSpace = true;
+					break;
+				}
+			}
+
+			// only add proposals for the attributes whose names begin with the matchstring
+			if (attributes != null) {
+				for (int i = 0; i < attributes.getLength(); i++) {
+					CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) attributes.item(i);
+
+					if(validModelQueryNode(attrDecl)) {
+						int isRequired = 0;
+						if (attrDecl.getUsage() == CMAttributeDeclaration.REQUIRED) {
+							isRequired = XMLRelevanceConstants.R_REQUIRED;
+						}
+	
+						boolean showAttribute = true;
+						showAttribute = showAttribute && beginsWith(getRequiredName(node, attrDecl), matchString.trim());
+						AttrImpl attr = (AttrImpl) node.getAttributes().getNamedItem(getRequiredName(node, attrDecl));
+						ITextRegion nameRegion = attr != null ? attr.getNameRegion() : null;
+						// nameRegion.getEndOffset() + 1 is required to allow for
+						// matches against the full name of an existing Attr
+						showAttribute = showAttribute && ((attr == null) ||
+								((nameRegion != null) &&
+										(sdRegion.getStartOffset(nameRegion) <
+											contentAssistRequest.getReplacementBeginPosition()) &&
+										(sdRegion.getStartOffset(nameRegion) + nameRegion.getLength() >=
+											(contentAssistRequest.getReplacementBeginPosition() +
+											contentAssistRequest.getReplacementLength()) )));
+						if (showAttribute) {
+							//get the proposal image
+							Image attrImage = CMImageUtil.getImage(attrDecl);
+							if (attrImage == null) {
+								if (isRequired > 0) {
+									attrImage = this.getRequiredAttributeImage();
+								} else {
+									attrImage = this.getNotRequiredAttributeImage();
+								}
+							}
+	
+							String proposedText = null;
+							String proposedInfo = getAdditionalInfo(elementDecl, attrDecl);
+							CustomCompletionProposal proposal = null;
+							// attribute is at this location and already exists
+							if (attrAtLocationHasValue) {
+								// only propose the name
+								proposedText = getRequiredName(node, attrDecl);
+								proposal = new CustomCompletionProposal(
+										proposedText, contentAssistRequest.getReplacementBeginPosition(),
+										contentAssistRequest.getReplacementLength(), proposedText.length(),
+										attrImage, proposedText, null, proposedInfo,
+										XMLRelevanceConstants.R_XML_ATTRIBUTE_NAME + isRequired, true);
+							}
+							// no attribute exists or is elsewhere, generate
+							// minimally
+							else {
+								Attr existingAttrNode = (Attr) node.getAttributes().getNamedItem(getRequiredName(node, attrDecl));
+								String value = null;
+								if (existingAttrNode != null) {
+									value = existingAttrNode.getNodeValue();
+								}
+								if ((value != null) && (value.length() > 0)) {
+									proposedText = getRequiredName(node, attrDecl);
+								}
+								else {
+									proposedText = getRequiredText(node, attrDecl);
+								}
+								if (proposalNeedsSpace)
+									proposedText += " "; //$NON-NLS-1$
+								proposal = new CustomCompletionProposal(proposedText,
+										contentAssistRequest.getReplacementBeginPosition(),
+										contentAssistRequest.getReplacementLength(),
+										attrDecl.getNodeName().length() + 2, attrImage,
+								// if the value isn't empty (no empty set of quotes), show it
+								// BUG 203494, content strings may have "", but not be empty
+								// An empty string is when there's no content between double quotes
+								// and there is no single quote that may be encasing a double quote
+										((proposedText.lastIndexOf('\"') - proposedText.indexOf('\"') ==  1 &&
+												proposedText.indexOf('\'') == -1)) ? getRequiredName(node, attrDecl) : proposedText,
+										null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_NAME + isRequired);
+							}
+							contentAssistRequest.addProposal(proposal);
+						}
+					}
+				}
+			}
+		}
+		else {
+			setErrorMessage(NLS.bind(XMLUIMessages.Element__is_unknown, (new Object[]{node.getNodeName()})));
+		}
+	}
+	
+	protected void addAttributeValueProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
+
+		// Find the attribute region and name for which this position should
+		// have a value proposed
+		IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
+		ITextRegionList openRegions = open.getRegions();
+		int i = openRegions.indexOf(contentAssistRequest.getRegion());
+		if (i < 0) {
+			return;
+		}
+		ITextRegion nameRegion = null;
+		while (i >= 0) {
+			nameRegion = openRegions.get(i--);
+			if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
+				break;
+			}
+		}
+
+		// the name region is REQUIRED to do anything useful
+		if (nameRegion != null) {
+			// Retrieve the declaration
+			CMElementDeclaration elementDecl = getCMElementDeclaration(node);
+
+			// String attributeName = nameRegion.getText();
+			String attributeName = open.getText(nameRegion);
+
+			CMAttributeDeclaration attrDecl = null;
+
+			// No CMElementDeclaration means no attribute metadata, but retrieve the
+			// declaration for the attribute otherwise
+			if (elementDecl != null) {
+				CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(elementDecl.getAttributes()) {
+					private Map caseInsensitive;
+					
+					private Map getCaseInsensitiveMap() {
+						if(caseInsensitive == null)
+							caseInsensitive = new HashMap();
+						return caseInsensitive;
+					}
+
+					public CMNode getNamedItem(String name) {
+						CMNode node = super.getNamedItem(name);
+						if (node == null) {
+							node = (CMNode) getCaseInsensitiveMap().get(name.toLowerCase(Locale.US));
+						}
+						return node;
+					}
+
+					public void put(CMNode cmNode) {
+						super.put(cmNode);
+						getCaseInsensitiveMap().put(cmNode.getNodeName().toLowerCase(Locale.US), cmNode);
+					}
+				};
+				this.addModelQueryAttributeDeclarations(node, elementDecl, allAttributes);
+
+				String noprefixName = DOMNamespaceHelper.getUnprefixedName(attributeName);
+				if (allAttributes != null) {
+					attrDecl = (CMAttributeDeclaration) allAttributes.getNamedItem(attributeName);
+					if (attrDecl == null) {
+						attrDecl = (CMAttributeDeclaration) allAttributes.getNamedItem(noprefixName);
+					}
+				}
+				if (attrDecl == null) {
+					setErrorMessage(XMLUIMessages.No_known_attribute__UI_ + attributeName);
+				}
+			}
+
+			String currentValue = node.getAttributes().getNamedItem(attributeName).getNodeValue();
+			String proposedInfo = null;
+			//get proposal image
+			Image image = CMImageUtil.getImage(attrDecl);
+			if (image == null) {
+				if ((attrDecl != null) && (attrDecl.getUsage() == CMAttributeDeclaration.REQUIRED)) {
+					image = this.getRequiredAttributeImage();
+				} else {
+					image = this.getNotRequiredAttributeImage();
+				}
+			}
+
+			if ((attrDecl != null) && (attrDecl.getAttrType() != null)) {
+				// attribute is known, prompt with values from the declaration
+				proposedInfo = getAdditionalInfo(elementDecl, attrDecl);
+				List possibleValues = getPossibleDataTypeValues(node, attrDecl);
+				String defaultValue = attrDecl.getAttrType().getImpliedValue();
+				if (possibleValues.size() > 0 || defaultValue != null) {
+					// ENUMERATED VALUES
+					String matchString = contentAssistRequest.getMatchString();
+					if (matchString == null) {
+						matchString = ""; //$NON-NLS-1$
+					}
+					if ((matchString.length() > 0) && (matchString.startsWith("\"") || matchString.startsWith("'"))) { //$NON-NLS-1$ //$NON-NLS-2$
+						matchString = matchString.substring(1);
+					}
+					boolean currentValid = false;
+
+					//create suggestions for enumerated values
+					int rOffset = contentAssistRequest.getReplacementBeginPosition();
+					int rLength = contentAssistRequest.getReplacementLength();
+					for (Iterator j = possibleValues.iterator(); j.hasNext();) {
+						String possibleValue = (String) j.next();
+						if(!possibleValue.equals(defaultValue)) {
+							currentValid = currentValid || possibleValue.equals(currentValue);
+							if ((matchString.length() == 0) || possibleValue.startsWith(matchString)) {
+								String rString = "\"" + possibleValue + "\""; //$NON-NLS-1$ //$NON-NLS-2$
+								CustomCompletionProposal proposal = new CustomCompletionProposal(
+										rString, rOffset, rLength, possibleValue.length() + 1,
+										XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ENUM),
+										rString, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
+								contentAssistRequest.addProposal(proposal);
+							}
+						}
+					}
+					if(defaultValue != null && ((matchString.length() == 0) || defaultValue.startsWith(matchString))) {
+						String rString = "\"" + defaultValue + "\""; //$NON-NLS-1$ //$NON-NLS-2$
+						CustomCompletionProposal proposal = new CustomCompletionProposal(
+								rString, rOffset, rLength, defaultValue.length() + 1,
+								XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_DEFAULT),
+								rString, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
+						contentAssistRequest.addProposal(proposal);
+					}
+				}
+				else if (((attrDecl.getUsage() == CMAttributeDeclaration.FIXED) ||
+						(attrDecl.getAttrType().getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED)) &&
+						(attrDecl.getAttrType().getImpliedValue() != null)) {
+					
+					// FIXED values
+					String value = attrDecl.getAttrType().getImpliedValue();
+					if ((value != null) && (value.length() > 0)) {
+						String rValue = "\"" + value + "\"";//$NON-NLS-2$//$NON-NLS-1$
+						CustomCompletionProposal proposal = new CustomCompletionProposal(
+								rValue, contentAssistRequest.getReplacementBeginPosition(),
+								contentAssistRequest.getReplacementLength(), rValue.length() + 1,
+								image, rValue, null, proposedInfo,
+								XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
+						contentAssistRequest.addProposal(proposal);
+						if ((currentValue.length() > 0) && !value.equals(currentValue)) {
+							rValue = "\"" + currentValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
+							proposal = new CustomCompletionProposal(rValue, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), rValue.length() + 1, image, rValue, null, proposedInfo, XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
+							contentAssistRequest.addProposal(proposal);
+						}
+					}
+				}
+			}
+			else {
+				// unknown attribute, so supply nice empty values
+				proposedInfo = getAdditionalInfo(null, elementDecl);
+				CustomCompletionProposal proposal = null;
+				if ((currentValue != null) && (currentValue.length() > 0)) {
+					String rValue = "\"" + currentValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
+					proposal = new CustomCompletionProposal(rValue,
+							contentAssistRequest.getReplacementBeginPosition(),
+							contentAssistRequest.getReplacementLength(), 1, image,
+							rValue, null, proposedInfo,
+							XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
+					contentAssistRequest.addProposal(proposal);
+				}
+			}
+		}
+		else {
+			setErrorMessage(XMLUIMessages.Content_Assist_not_availab_UI_);
+		}
+	}
+	
+	protected void addCommentProposal(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		contentAssistRequest.addProposal(new CustomCompletionProposal("<!--  -->", //$NON-NLS-1$
+				contentAssistRequest.getReplacementBeginPosition(),
+				contentAssistRequest.getReplacementLength(), 5,
+				XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_COMMENT),
+				NLS.bind(XMLUIMessages.Comment__, (new Object[]{" <!--  -->"})), //$NON-NLS-1$
+				null, null, XMLRelevanceConstants.R_COMMENT));
+	}
+	
+	
+
+	/**
+	 * Add the proposals for the name in an end tag
+	 */
+	protected void addEndTagNameProposals(ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+
+		if (contentAssistRequest.getStartOffset() + contentAssistRequest.getRegion().getTextLength() < contentAssistRequest.getReplacementBeginPosition()) {
+			CustomCompletionProposal proposal = new CustomCompletionProposal(">", //$NON-NLS-1$
+						contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), 1, XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC), NLS.bind(XMLUIMessages.Close_with__, (new Object[]{" '>'"})), //$NON-NLS-1$
+						null, null, XMLRelevanceConstants.R_END_TAG_NAME);
+			contentAssistRequest.addProposal(proposal);
+		}
+		else {
+			Node aNode = contentAssistRequest.getNode();
+			String matchString = contentAssistRequest.getMatchString();
+			if (matchString.startsWith("</")) { //$NON-NLS-1$
+				matchString = matchString.substring(2);
+			}
+			while (aNode != null) {
+				if (aNode.getNodeType() == Node.ELEMENT_NODE) {
+					if (aNode.getNodeName().startsWith(matchString)) {
+						IDOMNode aXMLNode = (IDOMNode) aNode;
+						CMElementDeclaration ed = getCMElementDeclaration(aNode);
+						//declaration must be valid for this computer to make proposal
+						if ((aXMLNode.getEndStructuredDocumentRegion() == null) && (ed == null || (validModelQueryNode(ed) && ed.getContentType() != CMElementDeclaration.EMPTY))) {
+							String replacementText = aNode.getNodeName();
+							String displayText = replacementText;
+							String proposedInfo = (ed != null) ? getAdditionalInfo(null, ed) : null;
+							if(!contentAssistRequest.getDocumentRegion().isEnded()) {
+								replacementText += ">"; //$NON-NLS-1$
+							}
+							CustomCompletionProposal proposal = null;
+							// double check to see if the region acted upon is
+							// a tag name; replace it if so
+							Image image = CMImageUtil.getImage(ed);
+							if (image == null) {
+								image = this.getGenericTagImage();
+							}
+							if (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_NAME) {
+								proposal = new CustomCompletionProposal(
+										replacementText, contentAssistRequest.getStartOffset(),
+										contentAssistRequest.getRegion().getTextLength(),
+										replacementText.length(), image, displayText, null,
+										proposedInfo, XMLRelevanceConstants.R_END_TAG_NAME);
+							}
+							else {
+								proposal = new CustomCompletionProposal(
+										replacementText,
+										contentAssistRequest.getReplacementBeginPosition(),
+										contentAssistRequest.getReplacementLength(),
+										replacementText.length(), image,
+										NLS.bind(XMLUIMessages.Close_with__,
+												(new Object[]{"'" + displayText + "'"})), //$NON-NLS-1$ //$NON-NLS-2$
+										null, proposedInfo, XMLRelevanceConstants.R_END_TAG_NAME);
+							}
+							contentAssistRequest.addProposal(proposal);
+						}
+					}
+				}
+				aNode = aNode.getParentNode();
+			}
+		}
+	}
+
+	/**
+	 * Prompt for end tags to a non-empty Node that hasn't ended Handles these
+	 * cases: <br>
+	 * <tagOpen>| <br>
+	 * <tagOpen>< |<br>
+	 * <tagOpen></ |
+	 * 
+	 * @param contentAssistRequest
+	 */
+	protected void addEndTagProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		IDOMNode node = (IDOMNode) contentAssistRequest.getParent();
+
+		if (isCommentNode(node)) {
+			// loop and find non comment node parent
+			while ((node != null) && isCommentNode(node)) {
+				node = (IDOMNode) node.getParentNode();
+			}
+		}
+
+		// node is already closed
+		if (node.isClosed()) {
+			// loop and find non comment unclose node parent
+			while ((node != null) && node.isClosed()) {
+				node = (IDOMNode) node.getParentNode();
+			}
+		}
+		// there were no unclosed tags
+		if (node == null) {
+			return;
+		}
+
+		// data to create a CustomCompletionProposal
+		String replaceText = node.getNodeName() + ">"; //$NON-NLS-1$
+		int replaceBegin = contentAssistRequest.getReplacementBeginPosition();
+		int replaceLength = contentAssistRequest.getReplacementLength();
+		int cursorOffset = node.getNodeName().length() + 1;
+		String displayString = ""; //$NON-NLS-1$
+		String proposedInfo = ""; //$NON-NLS-1$
+		Image image = this.getGenericTagImage();
+
+		setErrorMessage(null);
+		boolean addProposal = false;
+
+		if (node.getNodeType() == Node.ELEMENT_NODE) {
+			// ////////////////////////////////////////////////////////////////////////////////////
+			IStructuredDocument sDoc = (IStructuredDocument) context.getDocument();
+			IStructuredDocumentRegion xmlEndTagOpen = sDoc.getRegionAtCharacterOffset(contentAssistRequest.getReplacementBeginPosition());
+			// skip backward to "<", "</", or the (unclosed) start tag, null if not found
+			String type = ""; //$NON-NLS-1$
+			while ((xmlEndTagOpen != null) &&
+					((type = xmlEndTagOpen.getType()) != DOMRegionContext.XML_END_TAG_OPEN) &&
+					(type != DOMRegionContext.XML_TAG_CLOSE) && !needsEndTag(xmlEndTagOpen, context) &&
+					(type != DOMRegionContext.XML_TAG_OPEN)) {
+				
+				xmlEndTagOpen = xmlEndTagOpen.getPrevious();
+			}
+
+			if (xmlEndTagOpen == null) {
+				return;
+			}
+
+			node = (IDOMNode) node.getModel().getIndexedRegion(xmlEndTagOpen.getStartOffset());
+			node = (IDOMNode) node.getParentNode();
+
+			if (isStartTag(xmlEndTagOpen)) {
+				// this is the case for a start tag w/out end tag
+				// eg:
+				// <p>
+				// <% String test = "test"; %>
+				// |
+				if (needsEndTag(xmlEndTagOpen, context)) {
+					String tagName = getTagName(xmlEndTagOpen);
+					xmlEndTagOpen.getTextEndOffset();
+					replaceLength = 0;
+					replaceText = "</" + tagName + ">"; //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-2$
+					cursorOffset = tagName.length() + 3;
+					displayString = NLS.bind(XMLUIMessages.End_with__, (new Object[]{tagName}));
+					addProposal = true;
+				}
+			}
+			else if (type == DOMRegionContext.XML_END_TAG_OPEN) {
+				// this is the case for: <tag> </ |
+				// possibly <tag> </ |<anotherTag>
+				// should only be replacing white space...
+				replaceLength = (replaceBegin > xmlEndTagOpen.getTextEndOffset()) ? replaceBegin - xmlEndTagOpen.getTextEndOffset() : 0;
+				replaceText = node.getNodeName() + ">"; //$NON-NLS-1$
+				cursorOffset = replaceText.length();
+				replaceBegin = xmlEndTagOpen.getTextEndOffset();
+				displayString = NLS.bind(XMLUIMessages.End_with_, (new Object[]{node.getNodeName()}));
+				addProposal = true;
+			}
+			else if (type == DOMRegionContext.XML_TAG_OPEN) {
+				// this is the case for: <tag> < |
+				replaceText = "/" + node.getNodeName() + ">"; //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-2$
+				cursorOffset = replaceText.length();
+
+				// should only be replacing white space...
+				replaceLength = (replaceBegin > xmlEndTagOpen.getTextEndOffset()) ? replaceBegin - xmlEndTagOpen.getTextEndOffset() : 0;
+				replaceBegin = xmlEndTagOpen.getTextEndOffset();
+				displayString = NLS.bind(XMLUIMessages.End_with_, (new Object[]{"/" + node.getNodeName()})); //$NON-NLS-1$
+				addProposal = true;
+			}
+		}
+		// ////////////////////////////////////////////////////////////////////////////////////
+		// sometimes the node is not null, but
+		// getNodeValue() is null, put in a null check
+		else if ((node.getNodeValue() != null) && (node.getNodeValue().indexOf("</") != -1)) { //$NON-NLS-1$
+			// the case where "</" is started, but the nodes comes in as a
+			// text node (instead of element)
+			// like this: <tag> </|
+			Node parent = node.getParentNode();
+			if ((parent != null) && (parent.getNodeType() != Node.DOCUMENT_NODE)) {
+				replaceText = parent.getNodeName() + ">"; //$NON-NLS-1$
+				cursorOffset = replaceText.length();
+				displayString = NLS.bind(XMLUIMessages.End_with__, (new Object[]{parent.getNodeName()}));
+				setErrorMessage(null);
+				addProposal = true;
+			}
+		}
+		// ////////////////////////////////////////////////////////////////////////////////////
+		else if (node.getNodeType() == Node.DOCUMENT_NODE) {
+			setErrorMessage(XMLUIMessages.Content_Assist_not_availab_UI_);
+		}
+		if (addProposal == true) {
+			CustomCompletionProposal proposal = new CustomCompletionProposal(replaceText, replaceBegin, replaceLength, cursorOffset, image, displayString, null, proposedInfo, XMLRelevanceConstants.R_END_TAG);
+			contentAssistRequest.addProposal(proposal);
+		}
+	}
+	
+	protected void addEntityProposals(
+			ContentAssistRequest contentAssistRequest,
+			ITextRegion completionRegion, IDOMNode treeNode,
+			CompletionProposalInvocationContext context) {
+		
+		ICompletionProposal[] eps = computeEntityReferenceProposals(completionRegion,
+				treeNode, context);
+		for (int i = 0; (eps != null) && (i < eps.length); i++) {
+			contentAssistRequest.addProposal(eps[i]);
+		}
+	}
+	
+	protected void addEntityProposals(Vector proposals, Properties map,
+			String key, int nodeOffset, IStructuredDocumentRegion sdRegion,
+			ITextRegion completionRegion,
+			CompletionProposalInvocationContext context) {
+		
+		if (map == null) {
+			return;
+		}
+		String entityName = ""; //$NON-NLS-1$
+		String entityValue = ""; //$NON-NLS-1$
+		Image entityIcon = this.getEntityReferenceImage();
+		String replacementText = ""; //$NON-NLS-1$
+		String displayString = ""; //$NON-NLS-1$
+		Enumeration keys = map.keys();
+
+		while ((keys != null) && keys.hasMoreElements()) {
+			entityName = (String) keys.nextElement();
+			entityValue = map.getProperty(entityName);
+			// filter based on partial entity string...
+			if (entityName.toLowerCase().startsWith(key.toLowerCase()) || key.trim().equals("")) //$NON-NLS-1$
+			{
+				// figure out selection...if text is selected, add it to
+				// selection length
+				int selectionLength = nodeOffset;
+				if (context.getViewer() != null) {
+					selectionLength += context.getViewer().getSelectedRange().y;
+				}
+				// create a new proposal for entity string...
+				replacementText = "&" + entityName + ";"; //$NON-NLS-1$ //$NON-NLS-2$ 
+				displayString = "&" + entityName + "; (" + entityValue + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+				ICompletionProposal cp = new CustomCompletionProposal(replacementText, sdRegion.getStartOffset(completionRegion), selectionLength, replacementText.length(), entityIcon, displayString, null, null, XMLRelevanceConstants.R_ENTITY);
+				if (cp != null) {
+					proposals.add(cp);
+				}
+			}
+		}
+	}
+	
+	protected void addPCDATAProposal(String nodeName,
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		CustomCompletionProposal proposal = new CustomCompletionProposal("<![CDATA[]]>", //$NON-NLS-1$
+					contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), 9, XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_CDATASECTION), "CDATA Section", //$NON-NLS-1$
+					null, null, XMLRelevanceConstants.R_CDATA);
+		contentAssistRequest.addProposal(proposal);
+
+		proposal = new CustomCompletionProposal(nodeName, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), nodeName.length(), XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TXTEXT), "#PCDATA", //$NON-NLS-1$
+					null, null, XMLRelevanceConstants.R_CDATA);
+		contentAssistRequest.addProposal(proposal);
+	}
+	
+	protected void addStartDocumentProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		//determine if XMLPI is first element
+		Node aNode = contentAssistRequest.getNode();
+		Document owningDocument = aNode.getOwnerDocument();
+		Node first = owningDocument.getFirstChild();
+		boolean xmlpiIsFirstElement = ((first != null) && (first.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE));
+		
+		// make sure xmlpi is root element don't want doctype proposal if XMLPI isn't first element...
+		if (xmlpiIsFirstElement && (owningDocument.getDoctype() == null) &&
+				isCursorAfterXMLPI(contentAssistRequest)) {
+			
+			addDocTypeProposal(contentAssistRequest, context);
+		}
+	}
+	
+	/**
+	 * Close an unclosed start tag
+	 */
+	protected void addTagCloseProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		IDOMNode node = (IDOMNode) contentAssistRequest.getParent();
+		if (node.getNodeType() == Node.ELEMENT_NODE) {
+
+			CMElementDeclaration elementDecl = getCMElementDeclaration(node);
+			String proposedInfo = (elementDecl != null) ? getAdditionalInfo(null, elementDecl) : null;
+			int contentType = (elementDecl != null) ? elementDecl.getContentType() : CMElementDeclaration.ANY;
+			// if it's XML and content doesn't HAVE to be element, add "/>" proposal.
+			boolean endWithSlashBracket = (isXMLNode(node) && (contentType != CMElementDeclaration.ELEMENT));
+
+			//get the image
+			Image image = CMImageUtil.getImage(elementDecl);
+			if (image == null) {
+				image = this.getGenericTagImage();
+			}
+
+			// is the start tag ended properly?
+			if ((contentAssistRequest.getDocumentRegion() == node.getFirstStructuredDocumentRegion()) && !(node.getFirstStructuredDocumentRegion()).isEnded()) {
+				setErrorMessage(null);
+				// Is this supposed to be an empty tag? Note that if we can't
+				// tell, we assume it's not.
+				if ((elementDecl != null) && (elementDecl.getContentType() == CMElementDeclaration.EMPTY)) {
+					// prompt with a self-closing end character if needed
+					// this is one of the few times to ignore the length -- always insert
+					// contentAssistRequest.getReplacementLength()
+					CustomCompletionProposal proposal = new CustomCompletionProposal(
+							getContentGenerator().getStartTagClose(node, elementDecl),
+							contentAssistRequest.getReplacementBeginPosition(), 0,
+							getContentGenerator().getStartTagClose(node, elementDecl).length(), image,
+							NLS.bind(XMLUIMessages.Close_with___,(new Object[]{getContentGenerator().getStartTagClose(node, elementDecl)})),
+							null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG);
+					contentAssistRequest.addProposal(proposal);
+				}
+				else {
+					// prompt with a close for the start tag
+					CustomCompletionProposal proposal = new CustomCompletionProposal(">", //$NON-NLS-1$
+								contentAssistRequest.getReplacementBeginPosition(),
+								// this is one of the few times to ignore the
+								// length -- always insert
+								// contentAssistRequest.getReplacementLength(),
+								0, 1, image, NLS.bind(XMLUIMessages.Close_with__, (new Object[]{" '>'"})), //$NON-NLS-1$
+								null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG);
+					contentAssistRequest.addProposal(proposal);
+
+					// prompt with the closer for the start tag and an end tag if one is not present
+					if (node.getEndStructuredDocumentRegion() == null) {
+						// make sure tag name is actually what it thinks it
+						// is...(eg. <%@ vs. <jsp:directive)
+						IStructuredDocumentRegion sdr = contentAssistRequest.getDocumentRegion();
+						String openingTagText = (sdr != null) ? sdr.getFullText() : ""; //$NON-NLS-1$
+						if ((openingTagText != null) && (openingTagText.indexOf(node.getNodeName()) != -1)) {
+							proposal = new CustomCompletionProposal("></" + node.getNodeName() + ">", //$NON-NLS-2$//$NON-NLS-1$
+										contentAssistRequest.getReplacementBeginPosition(),
+										// this is one of the few times to
+										// ignore the length -- always insert
+										// contentAssistRequest.getReplacementLength(),
+										0, 1, image, NLS.bind(XMLUIMessages.Close_with____, (new Object[]{node.getNodeName()})), null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG);
+							contentAssistRequest.addProposal(proposal);
+						}
+					}
+					// prompt with slash bracket "/>" incase if it's a self ending tag
+					if (endWithSlashBracket) {
+						proposal = new CustomCompletionProposal("/>", //$NON-NLS-1$
+									contentAssistRequest.getReplacementBeginPosition(),
+									// this is one of the few times to ignore
+									// the length -- always insert
+									// contentAssistRequest.getReplacementLength(),
+									0, 2, image, NLS.bind(XMLUIMessages.Close_with__, (new Object[]{" \"/>\""})), //$NON-NLS-1$
+									null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG + 1); // +1
+						// to bring to top of list
+						contentAssistRequest.addProposal(proposal);
+					}
+				}
+			}
+			else if ((contentAssistRequest.getDocumentRegion() == node.getLastStructuredDocumentRegion()) && !node.getLastStructuredDocumentRegion().isEnded()) {
+				setErrorMessage(null);
+				// prompt with a closing end character for the end tag
+				CustomCompletionProposal proposal = new CustomCompletionProposal(">", //$NON-NLS-1$
+							contentAssistRequest.getReplacementBeginPosition(),
+							// this is one of the few times to ignore the length -- always insert
+							// contentAssistRequest.getReplacementLength(),
+							0, 1, image, NLS.bind(XMLUIMessages.Close_with__, (new Object[]{" '>'"})), //$NON-NLS-1$
+							null, proposedInfo, XMLRelevanceConstants.R_CLOSE_TAG);
+				contentAssistRequest.addProposal(proposal);
+			}
+		}
+		else if (node.getNodeType() == Node.DOCUMENT_NODE) {
+			setErrorMessage(XMLUIMessages.Content_Assist_not_availab_UI_);
+		}
+	}
+	
+	protected void addTagInsertionProposals(
+			ContentAssistRequest contentAssistRequest, int childPosition,
+			CompletionProposalInvocationContext context) {
+		
+		List cmnodes = null;
+		Node parent = contentAssistRequest.getParent();
+		String error = null;
+
+		// (nsd) This is only valid at the document element level
+		// only valid if it's XML (check added 2/17/2004)
+		if ((parent != null) && (parent.getNodeType() == Node.DOCUMENT_NODE) &&
+				((IDOMDocument) parent).isXMLType() && !isCursorAfterXMLPI(contentAssistRequest)) {
+			return;
+		}
+		// only want proposals if cursor is after doctype...
+		if (!isCursorAfterDoctype(contentAssistRequest)) {
+			return;
+		}
+
+		// fix for meta-info comment nodes.. they currently "hide" other
+		// proposals because the don't
+		// have a content model (so can't propose any children..)
+		if ((parent != null) && (parent instanceof IDOMNode) && isCommentNode((IDOMNode) parent)) {
+			// loop and find non comment node?
+			while ((parent != null) && isCommentNode((IDOMNode) parent)) {
+				parent = parent.getParentNode();
+			}
+		}
+
+		if (parent.getNodeType() == Node.ELEMENT_NODE) {
+			CMElementDeclaration parentDecl = getCMElementDeclaration(parent);
+			if (parentDecl != null) {
+				// XSD-specific ability - no filtering
+				CMDataType childType = parentDecl.getDataType();
+				if (childType != null) {
+					String[] childStrings = childType.getEnumeratedValues();
+					String defaultValue = childType.getImpliedValue();
+					if (childStrings != null || defaultValue != null) {
+						// the content string is the sole valid child...so replace the rest
+						int begin = contentAssistRequest.getReplacementBeginPosition();
+						int length = contentAssistRequest.getReplacementLength();
+						if (parent instanceof IDOMNode) {
+							if (((IDOMNode) parent).getLastStructuredDocumentRegion() != ((IDOMNode) parent).getFirstStructuredDocumentRegion()) {
+								begin = ((IDOMNode) parent).getFirstStructuredDocumentRegion().getEndOffset();
+								length = ((IDOMNode) parent).getLastStructuredDocumentRegion().getStartOffset() - begin;
+							}
+						}
+						String proposedInfo = getAdditionalInfo(parentDecl, childType);
+						for (int i = 0; i < childStrings.length; i++) {
+							if(!childStrings[i].equals(defaultValue)) {
+								CustomCompletionProposal textProposal = new CustomCompletionProposal(
+										childStrings[i],begin, length, childStrings[i].length(),
+										XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ENUM),
+										childStrings[i], null, proposedInfo, XMLRelevanceConstants.R_TAG_INSERTION);
+								contentAssistRequest.addProposal(textProposal);
+							}
+						}
+						if(defaultValue != null) {
+							CustomCompletionProposal textProposal = new CustomCompletionProposal(
+									defaultValue, begin, length, defaultValue.length(),
+									XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_DEFAULT),
+									defaultValue, null, proposedInfo, XMLRelevanceConstants.R_TAG_INSERTION);
+							contentAssistRequest.addProposal(textProposal);
+						}
+					}
+				}
+			}
+			if ((parentDecl != null) && (parentDecl.getContentType() == CMElementDeclaration.PCDATA)) {
+				addPCDATAProposal(parentDecl.getNodeName(), contentAssistRequest, context);
+			}
+			else {
+				// retrieve the list of all possible children within this parent context
+				cmnodes = getAvailableChildElementDeclarations((Element) parent, childPosition,ModelQueryAction.INSERT);
+
+				// retrieve the list of the possible children within this
+				// parent context and at this index
+				List strictCMNodeSuggestions = null;
+				if (XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_STRICT.equals(XMLUIPlugin.getInstance().getPreferenceStore().getString(XMLUIPreferenceNames.SUGGESTION_STRATEGY))) {
+					strictCMNodeSuggestions = getValidChildElementDeclarations((Element) parent, childPosition, ModelQueryAction.INSERT);
+				}
+				Iterator nodeIterator = cmnodes.iterator();
+				if (!nodeIterator.hasNext()) {
+					if (getCMElementDeclaration(parent) != null) {
+						error = NLS.bind(XMLUIMessages._Has_no_available_child, (new Object[]{parent.getNodeName()}));
+					}
+					else {
+						error = NLS.bind(XMLUIMessages.Element__is_unknown, (new Object[]{parent.getNodeName()}));
+					}
+				}
+				String matchString = contentAssistRequest.getMatchString();
+				// chop off any leading <'s and whitespace from the matchstring
+				while ((matchString.length() > 0) &&
+						(Character.isWhitespace(matchString.charAt(0)) || beginsWith(matchString, "<"))) { //$NON-NLS-1$
+					
+					matchString = matchString.substring(1);
+				}
+				while (nodeIterator.hasNext()) {
+					Object o = nodeIterator.next();
+					if (o instanceof CMElementDeclaration) {
+						CMElementDeclaration elementDecl =(CMElementDeclaration) o;
+						// only add proposals for the child element's that
+						// begin with the matchstring
+						String tagname = getRequiredName(parent, elementDecl);
+						boolean isStrictCMNodeSuggestion =
+							strictCMNodeSuggestions != null ? strictCMNodeSuggestions.contains(elementDecl) : false;
+
+						//get the proposal image
+						Image image = CMImageUtil.getImage(elementDecl);
+						if (image == null) {
+							if (strictCMNodeSuggestions != null) {
+								image = isStrictCMNodeSuggestion ? this.getEmphasizedTagImage() : this.getDeemphasizedTagImage();
+							} else {
+								image = this.getGenericTagImage();
+							}
+						}
+
+						if (beginsWith(tagname, matchString)) {
+							String proposedText = getRequiredText(parent, elementDecl);
+
+							// https://bugs.eclipse.org/bugs/show_bug.cgi?id=89811
+							// place cursor in first empty quotes
+							int markupAdjustment = getCursorPositionForProposedText(proposedText);
+
+							String proposedInfo = getAdditionalInfo(parentDecl, elementDecl);
+							int relevance = isStrictCMNodeSuggestion ? XMLRelevanceConstants.R_STRICTLY_VALID_TAG_INSERTION : XMLRelevanceConstants.R_TAG_INSERTION;
+							CustomCompletionProposal proposal = new CustomCompletionProposal(
+									proposedText, contentAssistRequest.getReplacementBeginPosition(),
+									contentAssistRequest.getReplacementLength(), markupAdjustment,
+									image, tagname, null, proposedInfo, relevance);
+							contentAssistRequest.addProposal(proposal);
+						}
+					}
+				}
+				if (contentAssistRequest.getProposals().size() == 0) {
+					if (error != null) {
+						setErrorMessage(error);
+					}
+					else if ((contentAssistRequest.getMatchString() != null) &&
+							(contentAssistRequest.getMatchString().length() > 0)) {
+						
+						setErrorMessage(NLS.bind(
+								XMLUIMessages.No_known_child_tag,
+								(new Object[]{parent.getNodeName(), contentAssistRequest.getMatchString()})));
+					}
+					else {
+						setErrorMessage(NLS.bind(
+								XMLUIMessages.__Has_no_known_child,
+								(new Object[]{parent.getNodeName()})));
+					}
+				}
+			}
+		}
+		else if (parent.getNodeType() == Node.DOCUMENT_NODE) {
+			// Can only prompt with elements if the cursor position is past
+			// the XML processing
+			// instruction and DOCTYPE declaration
+			boolean xmlpiFound = false;
+			boolean doctypeFound = false;
+			int minimumOffset = -1;
+
+			for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
+
+				boolean xmlpi = ((child.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) && child.getNodeName().equals("xml")); //$NON-NLS-1$
+				boolean doctype = child.getNodeType() == Node.DOCUMENT_TYPE_NODE;
+				if (xmlpi || (doctype && (minimumOffset < 0))) {
+					minimumOffset = ((IDOMNode) child).getFirstStructuredDocumentRegion().getStartOffset() + ((IDOMNode) child).getFirstStructuredDocumentRegion().getTextLength();
+				}
+				xmlpiFound = xmlpiFound || xmlpi;
+				doctypeFound = doctypeFound || doctype;
+			}
+
+			if (contentAssistRequest.getReplacementBeginPosition() >= minimumOffset) {
+				List childDecls = getAvailableRootChildren((Document) parent, childPosition);
+				for (int i = 0; i < childDecls.size(); i++) {
+					CMElementDeclaration ed = (CMElementDeclaration) childDecls.get(i);
+					if (ed != null) {
+						Image image = CMImageUtil.getImage(ed);
+						if (image == null) {
+							image = this.getGenericTagImage();
+						}
+						String proposedText = getRequiredText(parent, ed);
+						String tagname = getRequiredName(parent, ed);
+						// account for the &lt; and &gt;
+						int markupAdjustment = getContentGenerator().getMinimalStartTagLength(parent, ed);
+						String proposedInfo = getAdditionalInfo(null, ed);
+						CustomCompletionProposal proposal = new CustomCompletionProposal(
+								proposedText, contentAssistRequest.getReplacementBeginPosition(),
+								contentAssistRequest.getReplacementLength(), markupAdjustment, image,
+								tagname, null, proposedInfo, XMLRelevanceConstants.R_TAG_INSERTION);
+						contentAssistRequest.addProposal(proposal);
+					}
+				}
+			}
+		}
+	}
+
+	protected void addTagNameProposals(
+			ContentAssistRequest contentAssistRequest, int childPosition,
+			CompletionProposalInvocationContext context) {
+		
+		List cmnodes = null;
+		Node parent = contentAssistRequest.getParent();
+		IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
+		String error = null;
+		String matchString = contentAssistRequest.getMatchString();
+		if (parent.getNodeType() == Node.ELEMENT_NODE) {
+			// retrieve the list of children
+			// validActions = getAvailableChildrenAtIndex((Element) parent,
+			// childPosition);
+			cmnodes = getAvailableChildElementDeclarations((Element) parent, childPosition, ModelQueryAction.INSERT);
+			List strictCMNodeSuggestions = null;
+			if (XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_STRICT.equals(XMLUIPlugin.getInstance().getPreferenceStore().getString(XMLUIPreferenceNames.SUGGESTION_STRATEGY))) {
+				strictCMNodeSuggestions = getValidChildElementDeclarations((Element) parent, childPosition, ModelQueryAction.INSERT);
+			}
+			
+			Iterator nodeIterator = cmnodes.iterator();
+			// chop off any leading <'s and whitespace from the matchstring
+			while ((matchString.length() > 0) &&
+					(Character.isWhitespace(matchString.charAt(0)) || beginsWith(matchString, "<"))) { //$NON-NLS-1$
+				
+				matchString = matchString.substring(1);
+			}
+			if (!nodeIterator.hasNext()) {
+				error = NLS.bind(XMLUIMessages.__Has_no_known_child, (new Object[]{parent.getNodeName()}));
+			}
+			while (nodeIterator.hasNext()) {
+				CMNode elementDecl = (CMNode) nodeIterator.next();
+				if (elementDecl != null) {
+					// only add proposals for the child element's that begin with the matchstring
+					String proposedText = null;
+					int cursorAdjustment = 0;
+					
+					//determine if strict suggestion
+					boolean isStrictCMNodeSuggestion =
+						strictCMNodeSuggestions != null ? strictCMNodeSuggestions.contains(elementDecl) : false;
+
+					// do a check to see if partial attributes of partial tag names are in list
+					if (((node != null) && (node.getAttributes() != null) &&
+							(node.getAttributes().getLength() > 0) &&
+							attributeInList(node, parent, elementDecl)) ||
+							((node.getNodeType() != Node.TEXT_NODE) &&
+									node.getFirstStructuredDocumentRegion().isEnded())) {
+
+						proposedText = getRequiredName(parent, elementDecl);
+						cursorAdjustment = proposedText.length();
+					}
+					else {
+						proposedText = getRequiredName(parent, elementDecl);
+						
+						cursorAdjustment = proposedText.length();
+						if (elementDecl instanceof CMElementDeclaration) {
+							CMElementDeclaration ed = (CMElementDeclaration) elementDecl;
+							// https://bugs.eclipse.org/bugs/show_bug.cgi?id=89811
+							StringBuffer sb = new StringBuffer();
+							getContentGenerator().generateTag(parent, ed, sb);
+							// since it's a name proposal, assume '<' is already there
+							// only return the rest of the tag
+							proposedText = sb.toString().substring(1);
+							cursorAdjustment = getCursorPositionForProposedText(proposedText);
+						}
+					}
+					if (beginsWith(proposedText, matchString)) {
+						//get the proposal image
+						Image image = CMImageUtil.getImage(elementDecl);
+						if (image == null) {
+							if (strictCMNodeSuggestions != null) {
+								image = isStrictCMNodeSuggestion ? this.getEmphasizedTagImage() : this.getDeemphasizedTagImage();
+							} else {
+								image = this.getGenericTagImage();
+							}
+						}
+						int relevance = isStrictCMNodeSuggestion ? XMLRelevanceConstants.R_STRICTLY_VALID_TAG_NAME : XMLRelevanceConstants.R_TAG_NAME;
+						String proposedInfo = getAdditionalInfo(getCMElementDeclaration(parent), elementDecl);
+						CustomCompletionProposal proposal = new CustomCompletionProposal(
+								proposedText, contentAssistRequest.getReplacementBeginPosition(),
+								contentAssistRequest.getReplacementLength(), cursorAdjustment, image,
+								getRequiredName(parent, elementDecl), null, proposedInfo,
+								relevance);
+						contentAssistRequest.addProposal(proposal);
+					}
+				}
+			}
+			if (contentAssistRequest.getProposals().size() == 0) {
+				if (error != null) {
+					setErrorMessage(error);
+				}
+				else if ((contentAssistRequest.getMatchString() != null) && (contentAssistRequest.getMatchString().length() > 0)) {
+					setErrorMessage(NLS.bind(
+							XMLUIMessages.No_known_child_tag_names,
+							(new Object[]{parent.getNodeName(), contentAssistRequest.getMatchString()})));
+				}
+				else {
+					setErrorMessage(NLS.bind(
+							XMLUIMessages.__Has_no_known_child,
+							(new Object[]{parent.getNodeName()})));
+				}
+			}
+		}
+		else if (parent.getNodeType() == Node.DOCUMENT_NODE) {
+			List childElements = getAvailableRootChildren((Document) parent, childPosition);
+			if ( childElements.size() == 0) {
+				//No doctype available , treat it as empty document
+				addEmptyDocumentProposals(contentAssistRequest, context);
+			}
+			for (int i = 0; i < childElements.size(); i++) {
+				CMNode ed = (CMNode) childElements.get(i);
+				if (ed == null) {
+					continue;
+				}
+				String proposedText = null;
+				int cursorAdjustment = 0;
+				if (ed instanceof CMElementDeclaration) {
+					// proposedText = getRequiredName(parent, ed);
+					StringBuffer sb = new StringBuffer();
+					getContentGenerator().generateTag(parent, (CMElementDeclaration) ed, sb);
+					// tag starts w/ '<', but we want to compare to name
+					proposedText = sb.toString().substring(1);
+
+					if (!beginsWith(proposedText, matchString)) {
+						continue;
+					}
+
+					cursorAdjustment = getCursorPositionForProposedText(proposedText);
+
+					String proposedInfo = getAdditionalInfo(null, ed);
+					Image image = CMImageUtil.getImage(ed);
+					if (image == null) {
+						image = this.getGenericTagImage();
+					}
+					CustomCompletionProposal proposal = new CustomCompletionProposal(
+							proposedText, contentAssistRequest.getReplacementBeginPosition(),
+							contentAssistRequest.getReplacementLength(), cursorAdjustment, image,
+							getRequiredName(parent, ed), null, proposedInfo, XMLRelevanceConstants.R_TAG_NAME);
+					contentAssistRequest.addProposal(proposal);
+				}
+			}
+		}
+	}
+	
+	protected void addEmptyDocumentProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		//by default do nothing
+	}
+	
+	/**
+	 * <p>Implementers are allowed to override</p>
+	 * 
+	 * @return the proposal image to display for generic tag proposals
+	 */
+	protected Image getGenericTagImage() {
+		return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
+	}
+	
+	/**
+	 * <p>Implementers are allowed to override</p>
+	 * 
+	 * @return the proposal image to display for emphasized tag proposals
+	 */
+	protected Image getEmphasizedTagImage() {
+		return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC_EMPHASIZED);
+	}
+	
+	/**
+	 * <p>Implementers are allowed to override</p>
+	 * 
+	 * @return the proposal image to display for de-emphasized tag proposals
+	 */
+	protected Image getDeemphasizedTagImage() {
+		return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC_DEEMPHASIZED);
+	}
+	
+	/**
+	 * <p>Implementers are allowed to override</p>
+	 * 
+	 * @return the proposal image to display for entity reference proposals
+	 */
+	protected Image getEntityReferenceImage() {
+		return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ENTITY_REFERENCE);
+	}
+	
+	/**
+	 * <p>Implementers are allowed to override</p>
+	 * 
+	 * @return the proposal image to display for not required attributes
+	 */
+	protected Image getNotRequiredAttributeImage() {
+		return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
+	}
+	
+	/**
+	 * <p>Implementers are allowed to override</p>
+	 * 
+	 * @return the proposal image to display for required attributes
+	 */
+	protected Image getRequiredAttributeImage() {
+		return XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATT_REQ_OBJ);
+	}
+	
+	/**
+	 * This method can check if the cursor is after the XMLPI
+	 * 
+	 * @param car
+	 */
+	protected boolean isCursorAfterXMLPI(ContentAssistRequest car) {
+		Node aNode = car.getNode();
+		boolean xmlpiFound = false;
+		Document parent = aNode.getOwnerDocument();
+		int xmlpiNodePosition = -1;
+		boolean isAfterXMLPI = false;
+
+		if (parent == null) {
+			return true; // blank document case
+		}
+
+		for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
+			boolean xmlpi = ((child.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) && child.getNodeName().equals("xml")); //$NON-NLS-1$
+			xmlpiFound = xmlpiFound || xmlpi;
+			if (xmlpiFound) {
+				if (child instanceof IDOMNode) {
+					xmlpiNodePosition = ((IDOMNode) child).getEndOffset();
+					isAfterXMLPI = (car.getReplacementBeginPosition() >= xmlpiNodePosition);
+				}
+				break;
+			}
+		}
+		return isAfterXMLPI;
+	}
+	
+	protected String getRequiredName(Node parentOrOwner, CMNode cmnode) {
+		if ((cmnode == null) || (parentOrOwner == null)) {
+			if (Debug.displayWarnings) {
+				new IllegalArgumentException("Null declaration!").printStackTrace(); //$NON-NLS-1$
+			}
+			return ""; //$NON-NLS-1$
+		}
+		return getContentGenerator().getRequiredName(parentOrOwner, cmnode);
+	}
+	
+	private String getRequiredText(Node parentOrOwner, CMAttributeDeclaration attrDecl) {
+		if (attrDecl == null) {
+			if (Debug.displayWarnings) {
+				new IllegalArgumentException("Null attribute declaration!").printStackTrace(); //$NON-NLS-1$
+			}
+			return ""; //$NON-NLS-1$
+		}
+		StringBuffer buff = new StringBuffer();
+		getContentGenerator().generateRequiredAttribute(parentOrOwner, attrDecl, buff);
+		return buff.toString();
+	}
+	
+	protected String getRequiredText(Node parentOrOwner, CMElementDeclaration elementDecl) {
+		if (elementDecl == null) {
+			if (Debug.displayWarnings) {
+				new IllegalArgumentException("Null attribute declaration!").printStackTrace(); //$NON-NLS-1$
+			}
+			return ""; //$NON-NLS-1$
+		}
+		StringBuffer buff = new StringBuffer();
+		getContentGenerator().generateTag(parentOrOwner, elementDecl, buff);
+		return buff.toString();
+	}
+	
+	/**
+	 * Retrieves all of the possible valid values for this attribute
+	 * declaration
+	 */
+	private List getPossibleDataTypeValues(Node node, CMAttributeDeclaration ad) {
+		List list = null;
+		if (node.getNodeType() == Node.ELEMENT_NODE) {
+			Element element = (Element) node;
+			String[] dataTypeValues = null;
+			// The ModelQuery may not be available if the corresponding
+			// adapter
+			// is absent
+			ModelQuery modelQuery = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
+			if (modelQuery != null) {
+				dataTypeValues = modelQuery.getPossibleDataTypeValues(element, ad);
+			}
+			else {
+				if (ad.getAttrType() != null) {
+					dataTypeValues = ad.getAttrType().getEnumeratedValues();
+				}
+			}
+			if (dataTypeValues != null) {
+				list = new ArrayList(dataTypeValues.length);
+				for (int i = 0; i < dataTypeValues.length; i++) {
+					list.add(dataTypeValues[i]);
+				}
+			}
+		}
+		if (list == null) {
+			list = new ArrayList(0);
+		}
+		return list;
+	}
+	
+	/**
+	 * This is to determine if a tag is a special meta-info comment tag that
+	 * shows up as an ELEMENT
+	 * 
+	 * @param node
+	 * @return
+	 */
+	private boolean isCommentNode(IDOMNode node) {
+		return ((node != null) && (node instanceof IDOMElement) && ((IDOMElement) node).isCommentTag());
+	}
+	
+	private boolean isStartTag(IStructuredDocumentRegion sdRegion) {
+		boolean result = false;
+		if (sdRegion.getRegions().size() > 0) {
+			ITextRegion r = sdRegion.getRegions().get(0);
+			result = (r.getType() == DOMRegionContext.XML_TAG_OPEN) && sdRegion.isEnded();
+		}
+		return result;
+	}
+	
+	/**
+	 * Gets the corresponding XMLNode, and checks if it's closed.
+	 * 
+	 * @param startTag
+	 * 
+	 */
+	private boolean needsEndTag(IStructuredDocumentRegion startTag,
+			CompletionProposalInvocationContext context) {
+		
+		boolean result = false;
+		IStructuredModel sModel =
+			StructuredModelManager.getModelManager().getExistingModelForRead(context.getDocument());
+		try {
+			if (sModel != null) {
+				IDOMNode xmlNode = (IDOMNode) sModel.getIndexedRegion(startTag.getStart());
+				if (!isStartTag(startTag)) {
+					result = false;
+				}
+				else if (isSelfClosed(startTag)) {
+					result = false;
+				}
+				else if (!xmlNode.isContainer()) {
+					result = false;
+				}
+				else {
+					result = xmlNode.getEndStructuredDocumentRegion() == null;
+				}
+			}
+		}
+		finally {
+			if (sModel != null) {
+				sModel.releaseFromRead();
+			}
+		}
+		return result;
+	}
+	
+	private boolean isSelfClosed(IStructuredDocumentRegion startTag) {
+		ITextRegionList regions = startTag.getRegions();
+		return regions.get(regions.size() - 1).getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE;
+	}
+	
+	private String getTagName(IStructuredDocumentRegion sdRegion) {
+		ITextRegionList regions = sdRegion.getRegions();
+		ITextRegion region = null;
+		String name = ""; //$NON-NLS-1$
+		for (int i = 0; i < regions.size(); i++) {
+			region = regions.get(i);
+			if (region.getType() == DOMRegionContext.XML_TAG_NAME) {
+				name = sdRegion.getText(region);
+				break;
+			}
+		}
+		return name;
+	}
+	
+	/**
+	 * return all possible EntityReferenceProposals (according to current
+	 * position in doc)
+	 */
+	private ICompletionProposal[] computeEntityReferenceProposals(ITextRegion completionRegion,
+			IDOMNode treeNode,CompletionProposalInvocationContext context) {
+		
+		// only handle XML content for now
+		int documentPosition = context.getInvocationOffset();
+		Vector proposals = new Vector(); // ICompletionProposals
+		IStructuredDocumentRegion sdRegion =
+			ContentAssistUtils.getStructuredDocumentRegion(context.getViewer(), context.getInvocationOffset());
+		if ((completionRegion != null) && (completionRegion.getType() == DOMRegionContext.XML_CONTENT)) {
+			int nodeOffset = documentPosition - sdRegion.getStartOffset(completionRegion);
+			String regionText = sdRegion.getFullText(completionRegion);
+
+			// if directly to the right of a &, region will be null, need to
+			// move to
+			// the previous region...there might be a better way to do this
+			if ((regionText != null) && regionText.trim().equals("") && (documentPosition > 0)) { //$NON-NLS-1$
+				IStructuredDocumentRegion prev = treeNode.getStructuredDocument().getRegionAtCharacterOffset(documentPosition - 1);
+				if ((prev != null) && prev.getText().equals("&")) { //$NON-NLS-1$
+					// https://bugs.eclipse.org/bugs/show_bug.cgi?id=206680
+					// examine previous region
+					sdRegion = prev;
+					completionRegion = prev.getLastRegion();
+					regionText = prev.getFullText();
+					nodeOffset = 1;
+				}
+			}
+
+			// string must start w/ &
+			if ((regionText != null) && regionText.startsWith("&")) { //$NON-NLS-1$						 		
+				String key = (nodeOffset > 0) ? regionText.substring(1, nodeOffset) : ""; //$NON-NLS-1$
+
+				// get entity proposals, passing in the appropriate start
+				// string
+				ModelQuery mq = ModelQueryUtil.getModelQuery(((Node) treeNode).getOwnerDocument());
+				if (mq != null) {
+					CMDocument xmlDoc = mq.getCorrespondingCMDocument(treeNode);
+					CMNamedNodeMap cmmap = null;
+					Properties entities = null;
+					if (xmlDoc != null) {
+						cmmap = xmlDoc.getEntities();
+					}
+					if (cmmap != null) {
+						entities = mapToProperties(cmmap);
+					}
+					else // 224787 in absence of content model, just use
+					// minimal 5 entities
+					{
+						entities = new Properties();
+						entities.put("quot", "\""); //$NON-NLS-1$ //$NON-NLS-2$
+						entities.put("apos", "'"); //$NON-NLS-1$ //$NON-NLS-2$
+						entities.put("amp", "&"); //$NON-NLS-1$ //$NON-NLS-2$
+						entities.put("lt", "<"); //$NON-NLS-1$ //$NON-NLS-2$
+						entities.put("gt", ">"); //$NON-NLS-1$ //$NON-NLS-2$	
+						entities.put("nbsp", " "); //$NON-NLS-1$ //$NON-NLS-2$									
+					}
+					addEntityProposals(proposals, entities, key,
+							nodeOffset, sdRegion, completionRegion, context);
+				}
+			}
+		}
+		return (ICompletionProposal[]) ((proposals.size() > 0) ? proposals.toArray(new ICompletionProposal[proposals.size()]) : null);
+	}
+	
+	/**
+	 * Similar to the call in HTMLContentAssistProcessor. Pass in a node, it
+	 * tells you if the document is XML type.
+	 * 
+	 * @param node
+	 * 
+	 */
+	private boolean isXMLNode(Node node) {
+		if (node == null) {
+			return false;
+		}
+
+		Document doc = null;
+		doc = (node.getNodeType() != Node.DOCUMENT_NODE) ? node.getOwnerDocument() : ((Document) node);
+
+		return (doc instanceof IDOMDocument) && ((IDOMDocument) doc).isXMLType();
+	}
+	
+	/**
+	 * Checks if cursor position is after doctype tag...
+	 * 
+	 * @param car
+	 * 
+	 */
+	private boolean isCursorAfterDoctype(ContentAssistRequest car) {
+		Node aNode = car.getNode();
+		Document parent = aNode.getOwnerDocument();
+		int xmldoctypeNodePosition = -1;
+		boolean isAfterDoctype = true;
+
+		if (parent == null) {
+			return true; // blank document case
+		}
+
+		for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
+			if (child instanceof IDOMNode) {
+				if (child.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
+					xmldoctypeNodePosition = ((IDOMNode) child).getEndOffset();
+					isAfterDoctype = (car.getReplacementBeginPosition() >= xmldoctypeNodePosition);
+					break;
+				}
+			}
+		}
+		return isAfterDoctype;
+	}
+	
+	/**
+	 * returns a list of CMElementDeclarations
+	 * 
+	 * @param document
+	 * @param childIndex
+	 * @return
+	 */
+	private List getAvailableRootChildren(Document document, int childIndex) {
+		List list = null;
+
+		// extract the valid 'root' node name from the DocumentType Node
+		DocumentType docType = document.getDoctype();
+		String rootName = null;
+		if (docType != null) {
+			rootName = docType.getNodeName();
+		}
+		if (rootName == null) {
+			return new ArrayList(0);
+		}
+
+		for (Node child = document.getFirstChild(); child != null; child = child.getNextSibling()) {
+			// make sure the "root" Element isn't already present
+			// is it required to be an Element?
+			if ((child.getNodeType() == Node.ELEMENT_NODE) && child.getNodeName().equalsIgnoreCase(rootName)) {
+				// if the node is missing either the start or end tag, don't
+				// count it as present
+				if ((child instanceof IDOMNode) && ((((IDOMNode) child).getStartStructuredDocumentRegion() == null) || (((IDOMNode) child).getEndStructuredDocumentRegion() == null))) {
+					continue;
+				}
+				if (Debug.displayInfo) {
+					System.out.println(rootName + " already present!"); //$NON-NLS-1$
+				}
+				setErrorMessage(NLS.bind(XMLUIMessages.The_document_element__, (new Object[]{rootName})));
+				return new ArrayList(0);
+			}
+		}
+
+		list = new ArrayList(1);
+		ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
+		if (modelQuery != null) {
+			CMDocument cmdoc = modelQuery.getCorrespondingCMDocument(document);
+			if (cmdoc != null) {
+				if (rootName != null) {
+					CMElementDeclaration rootDecl = (CMElementDeclaration) cmdoc.getElements().getNamedItem(rootName);
+					if (rootDecl != null) {
+						list.add(rootDecl);
+					}
+					else {
+						// supply the given document name anyway, even if it
+						// is an error
+						list.add(new SimpleCMElementDeclaration(rootName));
+
+						String location = "" + (docType.getPublicId() != null ? docType.getPublicId() + "/" : "") + (docType.getSystemId() != null ? docType.getSystemId() : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+						if (location.length() > 0) {
+							setErrorMessage(NLS.bind(
+									XMLUIMessages.No_definition_for_in,
+									(new Object[]{rootName, location})));
+						}
+						else {
+							setErrorMessage(NLS.bind(
+									XMLUIMessages.No_definition_for,
+									(new Object[]{rootName})));
+						}
+					}
+				}
+			}
+			else {
+				String location = "" + (docType.getPublicId() != null ? docType.getPublicId() + "/" : "") + (docType.getSystemId() != null ? docType.getSystemId() : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+				if (location.length() > 0) {
+					setErrorMessage(NLS.bind(
+							XMLUIMessages.No_content_model_for,
+							(new Object[]{location})));
+				}
+				else {
+					setErrorMessage(XMLUIMessages.No_content_model_found_UI_);
+				}
+			}
+		}
+
+		return list;
+	}
+	
+	/**
+	 * This method determines if any of the attributes in the proposed XMLNode
+	 * node, are possible values of attributes from possible Elements at this
+	 * point in the document according to the Content Model.
+	 * 
+	 * @param node
+	 *            the element with attributes that you would like to test if
+	 *            are possible for possible Elements at this point
+	 * @param cmnode
+	 *            possible element at this point in the document (depending on
+	 *            what 'node' is) true if any attributes of 'node' match any
+	 *            possible attributes from 'cmnodes' list.
+	 */
+	private boolean attributeInList(IDOMNode node, Node parent, CMNode cmnode) {
+		if ((node == null) || (parent == null) || (cmnode == null)) {
+			return false;
+		}
+		String elementMatchString = node.getNodeName();
+		String cmnodeName = getRequiredName(parent, cmnode);// cmnode.getNodeName();
+		if (node instanceof Element) {
+			NamedNodeMap map = ((Element) node).getAttributes();
+			String attrMatchString = ""; //$NON-NLS-1$
+			// iterate attribute possibilities for partially started node
+			for (int i = 0; (map != null) && (i < map.getLength()); i++) {
+				attrMatchString = map.item(i).getNodeName();
+				// filter on whatever user typed for element name already
+				if (beginsWith(cmnodeName, elementMatchString)) {
+					if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION) {
+						CMNamedNodeMapImpl attributes = new CMNamedNodeMapImpl(((CMElementDeclaration) cmnode).getAttributes());
+						this.addModelQueryAttributeDeclarations(
+								node,((CMElementDeclaration) cmnode),attributes);
+	
+						// iterate possible attributes from a cmnode in
+						// proposal list
+						for (int k = 0; (attributes != null) && (k < attributes.getLength()); k++) {
+							// check if name matches
+							if (attributes.item(k).getNodeName().equals(attrMatchString)) {
+								return true;
+							}
+						}
+					}
+				}
+			}
+		}
+		return false;
+	}
+	
+	private Properties mapToProperties(CMNamedNodeMap map) {
+		Properties p = new Properties();
+		for (int i = 0; i < map.getLength(); i++) {
+			CMEntityDeclaration decl = (CMEntityDeclaration) map.item(i);
+			p.put(decl.getName(), decl.getValue());
+		}
+		return p;
+	}
+	
+	/**
+	 * <p>Adds model query attribute declaration proposals</p>
+	 * 
+	 * @param node
+	 * @param elementDecl
+	 * @param allAttributes
+	 */
+	private void addModelQueryAttributeDeclarations(IDOMNode node,
+			CMElementDeclaration elementDecl, CMNamedNodeMapImpl allAttributes) {
+		
+		if (node.getNodeType() == Node.ELEMENT_NODE) {
+			List nodes = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent((Element) node, elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
+			nodes = filterAvailableModelQueryCMNodes(nodes);
+			for (int k = 0; k < nodes.size(); k++) {
+				CMNode cmnode = (CMNode) nodes.get(k);
+				if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
+					allAttributes.put(cmnode);
+				}
+			}
+		}
+	}
+	
+	/**
+	 * returns a list of CMNodes that are available within this parent context
+	 * Given the grammar shown below and a snippet of XML code (where the '|'
+	 * indicated the cursor position)
+	 * the list would return all of the element declarations that are
+	 * potential child elements of Foo.
+	 *
+	 * grammar : Foo -> (A, B, C)
+	 * snippet : <Foo><A>|
+	 * result : {A, B, C}
+	 * 
+	 * TODO cs... do we need to pass in the 'kindOfAction'? Seems to me we
+	 * could assume it's always an insert.
+	 *
+	 * @param parent
+	 * @param childPosition
+	 * @param kindOfAction
+	 * @return
+	 */
+	private List getAvailableChildElementDeclarations(Element parent, int childPosition, int kindOfAction) {
+		List modelQueryActions = getAvailableModelQueryActionsAtIndex(parent, childPosition, ModelQuery.VALIDITY_NONE);
+		Iterator iterator = modelQueryActions.iterator();
+		List cmnodes = new Vector();
+		while (iterator.hasNext()) {
+			ModelQueryAction action = (ModelQueryAction) iterator.next();
+			if ((childPosition < 0) || (((action.getStartIndex() <= childPosition) && (childPosition <= action.getEndIndex())) && (action.getKind() == kindOfAction))) {
+				CMNode actionCMNode = action.getCMNode();
+				if ((actionCMNode != null) && !cmnodes.contains(actionCMNode)) {
+					cmnodes.add(actionCMNode);
+				}
+			}
+		}
+		return cmnodes;
+	}
+	
+	/**
+	 * returns a list of CMNodes that can be validly inserted at this
+	 * childPosition
+	 * Given the grammar shown below and a snippet of XML code (where the '|'
+	 * indicated the cursor position)
+	 * the list would return only the element declarations can be inserted
+	 * while maintaing validity of the content.
+	 *
+	 * grammar : Foo -> (A, B, C)
+	 * snippet : <Foo><A>|
+	 * result : {B}
+	 *    
+	 * @param parent
+	 * @param childPosition
+	 * @param kindOfAction
+	 * @return
+	 */
+	private List getValidChildElementDeclarations(Element parent, int childPosition, int kindOfAction) {
+		List modelQueryActions = getAvailableModelQueryActionsAtIndex(parent, childPosition, ModelQuery.VALIDITY_STRICT);
+		Iterator iterator = modelQueryActions.iterator();
+		List cmnodes = new Vector();
+		while (iterator.hasNext()) {
+			ModelQueryAction action = (ModelQueryAction) iterator.next();
+			if ((childPosition < 0) || (((action.getStartIndex() <= childPosition) && (childPosition <= action.getEndIndex())) && (action.getKind() == kindOfAction))) {
+				CMNode actionCMNode = action.getCMNode();
+				if ((actionCMNode != null) && !cmnodes.contains(actionCMNode)) {
+					cmnodes.add(actionCMNode);
+				}
+			}
+		}
+		return cmnodes;
+	}
+	
+	/**
+	 * returns a list of ModelQueryActions
+	 * 
+	 * @param parent
+	 * @param index
+	 * @param validityChecking
+	 * @return
+	 */
+	private List getAvailableModelQueryActionsAtIndex(Element parent, int index, int validityChecking) {
+		List list = new ArrayList();
+		CMElementDeclaration parentDecl = getCMElementDeclaration(parent);
+		if (parentDecl != null) {
+			ModelQuery modelQuery = ModelQueryUtil.getModelQuery(parent.getOwnerDocument());
+			// taken from ActionManagers
+			// int editMode = modelQuery.getEditMode();
+			int editMode = ModelQuery.EDIT_MODE_UNCONSTRAINED;
+			int ic = (editMode == ModelQuery.EDIT_MODE_CONSTRAINED_STRICT) ? ModelQuery.INCLUDE_CHILD_NODES | ModelQuery.INCLUDE_SEQUENCE_GROUPS : ModelQuery.INCLUDE_CHILD_NODES;
+			modelQuery.getInsertActions(parent, parentDecl, index, ic, validityChecking, list);
+		}
+		
+		list = filterAvailableModelQueryActions(list);
+		return list;
+	}
+	
+	/**
+	 * <p>Filters out any model query actions that are not valid for this
+	 * implementation of the model query computer based on the {@link CMNode}
+	 * of the action.</p>
+	 * 
+	 * @param modelQueryActions
+	 * @return the filtered list of {@link ModelQueryAction}s
+	 */
+	private List filterAvailableModelQueryActions(List modelQueryActions) {
+		List filtered = new ArrayList(modelQueryActions.size());
+	
+		Iterator iterator = modelQueryActions.iterator();
+		while (iterator.hasNext()) {
+			ModelQueryAction action = (ModelQueryAction) iterator.next();
+			if(validModelQueryNode(action.getCMNode())) {
+				filtered.add(action);
+			}
+		}
+		
+		return filtered;
+	}
+	
+	/**
+	 * <p>Filters out any model query {@link CMNode}s that are not valid for this
+	 * implementation of the model query computer</p>
+	 * 
+	 * @param modelQueryNodes
+	 * @return the filtered list of {@link CMNode}s
+	 */
+	private List filterAvailableModelQueryCMNodes(List modelQueryNodes) {
+		List filtered = new ArrayList(modelQueryNodes.size());
+	
+		Iterator iterator = modelQueryNodes.iterator();
+		while (iterator.hasNext()) {
+			CMNode node = (CMNode) iterator.next();
+			if(validModelQueryNode(node)) {
+				filtered.add(node);
+			}
+		}
+		
+		return filtered;
+	}
+	
+	/**
+	 * <p>Adds a generic doc type proposal</p>
+	 * 
+	 * @param contentAssistRequest
+	 * @param context
+	 */
+	private void addDocTypeProposal(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		// if a DocumentElement exists, use that for the root Element name
+		String rootname = "unspecified"; //$NON-NLS-1$
+		if (contentAssistRequest.getNode().getOwnerDocument().getDocumentElement() != null) {
+			rootname = contentAssistRequest.getNode().getOwnerDocument().getDocumentElement().getNodeName();
+		}
+
+		String proposedText = "<!DOCTYPE " + rootname + " PUBLIC \"//UNKNOWN/\" \"unknown.dtd\">"; //$NON-NLS-1$ //$NON-NLS-2$
+		ICompletionProposal proposal = new CustomCompletionProposal(
+				proposedText, contentAssistRequest.getReplacementBeginPosition(),
+				contentAssistRequest.getReplacementLength(), 10,
+				XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_DOCTYPE),
+				"<!DOCTYPE ... >", //$NON-NLS-1$
+				null, null, XMLRelevanceConstants.R_DOCTYPE);
+		// TODO provide special documentation on doc type
+		contentAssistRequest.addProposal(proposal);
+	}
+	
+	public static CMElementDeclaration getCMElementDeclaration(Node node) {
+		CMElementDeclaration result = null;
+		if (node.getNodeType() == Node.ELEMENT_NODE) {
+			ModelQuery modelQuery = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
+			if (modelQuery != null) {
+				result = modelQuery.getCMElementDeclaration((Element) node);
+			}
+		}
+		return result;
+	}
+	
+	/**
+	 * Retrieves cmnode's documentation to display in the completion
+	 * proposal's additional info. If no documentation exists for cmnode, try
+	 * displaying parentOrOwner's documentation
+	 * 
+	 * String any documentation information to display for cmnode.
+	 * <code>null</code> if there is nothing to display.
+	 */
+	public static String getAdditionalInfo(CMNode parentOrOwner, CMNode cmnode) {
+		String addlInfo = null;
+
+		if (cmnode == null) {
+			if (Debug.displayWarnings) {
+				new IllegalArgumentException("Null declaration!").printStackTrace(); //$NON-NLS-1$
+			}
+			return null;
+		}
+
+		addlInfo = infoProvider.getInfo(cmnode);
+		if ((addlInfo == null) && (parentOrOwner != null)) {
+			addlInfo = infoProvider.getInfo(parentOrOwner);
+		}
+		return addlInfo;
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationPresenter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationPresenter.java
index acd660b..9871c79 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationPresenter.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationPresenter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -19,13 +19,13 @@
 import org.eclipse.jface.text.TextPresentation;
 import org.eclipse.jface.text.contentassist.IContextInformation;
 import org.eclipse.jface.text.contentassist.IContextInformationPresenter;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.StyleRange;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContextInformationValidator;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 
@@ -36,43 +36,22 @@
  * 
  * @author pavery
  */
-public class AttributeContextInformationPresenter implements IContextInformationPresenter, IContextInformationValidator {
-	private int fDocumentPosition = -1;
+public class AttributeContextInformationPresenter extends ContextInformationValidator implements IContextInformationPresenter {
 
 	private IContextInformation fInfo = null;
 	private ContextInfoModelUtil fModelUtil = null;
-	private ITextViewer fViewer = null;
 
 	public AttributeContextInformationPresenter() {
 		super();
 	}
-
+	
 	/**
-	 * @see org.eclipse.jface.text.contentassist.IContextInformationValidator#install(org.eclipse.jface.text.contentassist.IContextInformation,
-	 *      org.eclipse.jface.text.ITextViewer, int)
+	 * @see org.eclipse.wst.sse.ui.internal.contentassist.ContextInformationValidator#install(org.eclipse.jface.text.contentassist.IContextInformation, org.eclipse.jface.text.ITextViewer, int)
 	 */
 	public void install(IContextInformation info, ITextViewer viewer, int documentPosition) {
-		fInfo = info;
-		fViewer = viewer;
-		fDocumentPosition = documentPosition;
-		fModelUtil = new ContextInfoModelUtil((IStructuredDocument) fViewer.getDocument());
-	}
-
-	/**
-	 * @see org.eclipse.jface.text.contentassist.IContextInformationValidator#isContextInformationValid(int)
-	 */
-	public boolean isContextInformationValid(int documentPosition) {
-		// determine whether or not this context info should still be
-		// showing...
-		// if cursor still within the element it's valid...
-		boolean result = false;
-		if (fModelUtil != null) {
-			IStructuredDocumentRegion startRegion = fModelUtil.getXMLNode(fDocumentPosition).getStartStructuredDocumentRegion();
-			int start = startRegion.getStartOffset();
-			int end = startRegion.getEndOffset();
-			result = (documentPosition < end) && (documentPosition > start + 1);
-		}
-		return result;
+		super.install(info, viewer, documentPosition);
+		this.fInfo = info;
+		this.fModelUtil = new ContextInfoModelUtil((IStructuredDocument) viewer.getDocument());
 	}
 
 	/**
@@ -88,6 +67,9 @@
 
 		// iterate existing attributes from current node
 		IDOMNode xmlNode = fModelUtil.getXMLNode(documentPosition);
+		if (xmlNode == null)
+			return false;
+		
 		IStructuredDocumentRegion sdRegion = xmlNode.getFirstStructuredDocumentRegion();
 		ITextRegionList regions = sdRegion.getRegions();
 		ITextRegion r = null;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationProvider.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationProvider.java
index f0e9052..f18d7c8 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationProvider.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -46,7 +46,7 @@
  * 
  * @author pavery
  */
-class AttributeContextInformationProvider {
+public class AttributeContextInformationProvider {
 	private final IContextInformation[] EMPTY_CONTEXT_INFO = new IContextInformation[0];
 	private Comparator fComparator;
 
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContextInfoModelUtil.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContextInfoModelUtil.java
index a48e753..a0c1c81 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContextInfoModelUtil.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContextInfoModelUtil.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -55,7 +55,9 @@
 		IDOMNode xmlNode = null;
 		try {
 			xmlModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
-			xmlNode = (IDOMNode) xmlModel.getIndexedRegion(offset);
+			if (xmlModel != null) {
+				xmlNode = (IDOMNode) xmlModel.getIndexedRegion(offset);
+			}
 		}
 		finally {
 			if (xmlModel != null)
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/DefaultXMLCompletionProposalComputer.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/DefaultXMLCompletionProposalComputer.java
new file mode 100644
index 0000000..5b4024f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/DefaultXMLCompletionProposalComputer.java
@@ -0,0 +1,200 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal.contentassist;
+
+import java.util.Properties;
+import java.util.Vector;
+
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+
+/**
+ * <p>Default implementation of the {@link AbstractXMLCompletionProposalComputer}, defaults are to do nothing</p>
+ */
+public class DefaultXMLCompletionProposalComputer extends
+		AbstractXMLCompletionProposalComputer {
+
+	/**
+	 * Default behavior is do to nothing.
+	 * 
+	 * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionEnded()
+	 */
+	public void sessionEnded() {
+		//default behavior is to do nothing
+	}
+
+	/**
+	 * Default behavior is do to nothing.
+	 * 
+	 * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionStarted()
+	 */
+	public void sessionStarted() {
+		//default behavior is to do nothing
+	}
+	
+	/**
+	 * Default behavior is do to nothing.
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addAttributeNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeNameProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		//default behavior is to do nothing
+	}
+
+	/**
+	 * Default behavior is do to nothing.
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeValueProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		//default behavior is to do nothing
+	}
+
+	/**
+	 * Default behavior is do to nothing.
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addCommentProposal(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addCommentProposal(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		//default behavior is to do nothing
+	}
+
+	/**
+	 * Default behavior is do to nothing.
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addDocTypeProposal(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addDocTypeProposal(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		//default behavior is to do nothing
+	}
+
+	/**
+	 * Default behavior is do to nothing.
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addEmptyDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addEmptyDocumentProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		//default behavior is to do nothing
+	}
+
+	/**
+	 * Default behavior is do to nothing.
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addEndTagNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addEndTagNameProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		//default behavior is to do nothing
+	}
+
+	/**
+	 * Default behavior is do to nothing.
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addEndTagProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addEndTagProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		//default behavior is to do nothing
+	}
+
+	/**
+	 * Default behavior is do to nothing.
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addEntityProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion, org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addEntityProposals(
+			ContentAssistRequest contentAssistRequest,
+			ITextRegion completionRegion, IDOMNode treeNode,
+			CompletionProposalInvocationContext context) {
+		//default behavior is to do nothing
+	}
+
+	/**
+	 * Default behavior is do to nothing.
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addEntityProposals(java.util.Vector, java.util.Properties, java.lang.String, int, org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion, org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addEntityProposals(Vector proposals, Properties map,
+			String key, int nodeOffset, IStructuredDocumentRegion sdRegion,
+			ITextRegion completionRegion,
+			CompletionProposalInvocationContext context) {
+		//default behavior is to do nothing
+	}
+
+	/**
+	 * Default behavior is do to nothing.
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addPCDATAProposal(java.lang.String, org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addPCDATAProposal(String nodeName,
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		//default behavior is to do nothing
+	}
+
+	/**
+	 * Default behavior is do to nothing.
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addStartDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addStartDocumentProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		//default behavior is to do nothing
+	}
+
+	/**
+	 * Default behavior is do to nothing.
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addTagCloseProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addTagCloseProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		//default behavior is to do nothing
+	}
+
+	/**
+	 * Default behavior is do to nothing.
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addTagInsertionProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addTagInsertionProposals(
+			ContentAssistRequest contentAssistRequest, int childPosition,
+			CompletionProposalInvocationContext context) {
+		//default behavior is to do nothing
+	}
+
+	/**
+	 * Default behavior is do to nothing.
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addTagNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addTagNameProposals(
+			ContentAssistRequest contentAssistRequest, int childPosition,
+			CompletionProposalInvocationContext context) {
+		//default behavior is to do nothing
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NoRegionContentAssistProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NoRegionContentAssistProcessor.java
index 57744f3..c713a22 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NoRegionContentAssistProcessor.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NoRegionContentAssistProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -39,6 +39,7 @@
  * position (usually at EOF).
  * 
  * @author pavery
+ * @deprecated This class is no longer used locally and will be removed in the future
  */
 public class NoRegionContentAssistProcessor implements IContentAssistProcessor, IReleasable {
 
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
index c371494..fefb8a3 100644
--- 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@
 import org.eclipse.jface.text.templates.TemplateBuffer;
 import org.eclipse.jface.text.templates.TemplateContextType;
 import org.eclipse.jface.text.templates.TemplateException;
+import org.eclipse.jface.text.templates.TemplateVariable;
 
 /**
  * Just like DocumentTemplateContext except if an insert offset is passed in,
@@ -95,7 +96,15 @@
 				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());
+					int prefixSize = prefix.length();
+					TemplateVariable[] newTemplateVar = buffer.getVariables();
+					for (int i =0; i < newTemplateVar.length; i++ ){
+						int[] offsets = newTemplateVar[i].getOffsets();
+						for (int j=0; j<offsets.length ;j++){
+							offsets[j] += prefixSize;
+						}
+					}
+					buffer = new TemplateBuffer(prefix + buffer.getString(), newTemplateVar);
 				}
 			}
 		}
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 252c04c..20d4451 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -27,6 +27,10 @@
 import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;
 import org.eclipse.wst.xml.ui.internal.templates.TemplateContextTypeIdsXML;
 
+/**
+ * @deprecated This class is no longer used locally and will be removed in the future
+ * @see XMLStructuredContentAssistProcessor
+ */
 public class XMLContentAssistProcessor extends AbstractContentAssistProcessor implements IPropertyChangeListener {
 
 	protected IPreferenceStore fPreferenceStore = null;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLRelevanceConstants.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLRelevanceConstants.java
index 4a99070..8fc1457 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLRelevanceConstants.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLRelevanceConstants.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -46,6 +46,7 @@
 	int R_TAG_INSERTION = 500;
 	int R_STRICTLY_VALID_TAG_INSERTION = 600;
 	int R_TAG_NAME = 1200;
+	int R_STRICTLY_VALID_TAG_NAME = 1250;
 	int R_XML_ATTRIBUTE_NAME = 900;
 	int R_XML_ATTRIBUTE_VALUE = 800;
 	int R_XML_DECLARATION = 1300;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLStructuredContentAssistProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLStructuredContentAssistProcessor.java
new file mode 100644
index 0000000..03b1a38
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLStructuredContentAssistProcessor.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal.contentassist;
+
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor;
+import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
+import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;
+
+/**
+ * <p>Implementation of {@link StructuredContentAssistProcessor} for XML documents</p>
+ * 
+ * <p>This implementation will react to user preference changes for auto activation
+ * characters for XML pages</p>
+ * 
+ * @see StructuredContentAssistProcessor
+ */
+public class XMLStructuredContentAssistProcessor extends StructuredContentAssistProcessor {
+	/** the auto activation characters for this processor, set by user preference */
+	private char[] fCompletionPropoaslAutoActivationCharacters;
+	
+	/** the context information validator for this processor */
+	private IContextInformationValidator fContextInformationValidator;
+	
+	/**
+	 * <p>Constructor</p>
+	 * 
+	 * @param assistant {@link ContentAssistant} to use
+	 * @param partitionTypeID the partition type this processor is for
+	 * @param viewer {@link ITextViewer} this processor is acting in
+	 */
+	public XMLStructuredContentAssistProcessor(ContentAssistant assistant,
+			String partitionTypeID, ITextViewer viewer) {
+		
+		super(assistant, partitionTypeID, viewer, XMLUIPlugin.getDefault().getPreferenceStore());
+		getAutoActivationCharacterPreferences();
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#getContextInformationValidator()
+	 */
+	public IContextInformationValidator getContextInformationValidator() {
+		if (this.fContextInformationValidator == null) {
+			this.fContextInformationValidator = new AttributeContextInformationPresenter();
+		}
+		return this.fContextInformationValidator;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
+	 */
+	public char[] getCompletionProposalAutoActivationCharacters() {
+		return this.fCompletionPropoaslAutoActivationCharacters;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.contentassist.StructuredContentAssistProcessor#propertyChange(
+	 * 	org.eclipse.jface.util.PropertyChangeEvent)
+	 */
+	public void propertyChange(PropertyChangeEvent event) {
+		if(event.getProperty().equals(XMLUIPreferenceNames.AUTO_PROPOSE) ||
+				event.getProperty().equals(XMLUIPreferenceNames.AUTO_PROPOSE_CODE)) {
+			getAutoActivationCharacterPreferences();
+		}
+	}
+	
+
+	protected void getAutoActivationCharacterPreferences() {
+		String key = XMLUIPreferenceNames.AUTO_PROPOSE;
+		boolean doAuto = getPreferenceStore().getBoolean(key);
+		if (doAuto) {
+			key = XMLUIPreferenceNames.AUTO_PROPOSE_CODE;
+			fCompletionPropoaslAutoActivationCharacters = getPreferenceStore().getString(key).toCharArray();
+		}
+		else {
+			fCompletionPropoaslAutoActivationCharacters = null;
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTagsCompletionProposalComputer.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTagsCompletionProposalComputer.java
new file mode 100644
index 0000000..6f82956
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTagsCompletionProposalComputer.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal.contentassist;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
+
+/**
+ * <p>{@link AbstractXMLModelQueryCompletionProposalComputer} used to
+ * generate XML tag content assist proposals</p>
+ * 
+ * <p><b>NOTE:</b> Currently this computer does not filter out any of the 
+ * model query results so it will return all proposals from the model query
+ * for the current content type.  In the future this may need to change.</p>
+ */
+public class XMLTagsCompletionProposalComputer extends
+		AbstractXMLModelQueryCompletionProposalComputer {
+
+	/** the generated used to generate the proposals */
+	protected XMLContentModelGenerator fGenerator;
+	
+	/** the context information validator for this computer */
+	private IContextInformationValidator fContextInformationValidator;
+	
+	/**
+	 * TODO: IAN: Comment me
+	 */
+	public XMLTagsCompletionProposalComputer() {
+		this.fContextInformationValidator = null;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#getContentGenerator()
+	 */
+	protected XMLContentModelGenerator getContentGenerator() {
+		if (fGenerator == null) {
+			fGenerator = new XMLContentModelGenerator();
+		}
+		return fGenerator;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeContextInformation(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public List computeContextInformation(
+			CompletionProposalInvocationContext context,
+			IProgressMonitor monitor) {
+		
+		AttributeContextInformationProvider attributeInfoProvider =
+			new AttributeContextInformationProvider((IStructuredDocument)context.getDocument(),
+					(AttributeContextInformationPresenter) getContextInformationValidator());
+		return Arrays.asList(attributeInfoProvider.getAttributeInformation(context.getInvocationOffset()));
+	}
+	
+	/**
+	 * <p>Filters out any model query actions that are not specific to XML</p>
+	 * <p><b>NOTE:</b> Currently nothing is filtered so this computer returns all
+	 * results from the model query for the current content type</p>
+	 * 
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer#validModelQueryNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode)
+	 */
+	protected boolean validModelQueryNode(CMNode node) {
+		return true;
+	}
+	
+	/**
+	 * Returns a validator used to determine when displayed context
+	 * information should be dismissed. May only return <code>null</code> if
+	 * the processor is incapable of computing context information.
+	 * 
+	 * a context information validator, or <code>null</code> if the
+	 * processor is incapable of computing context information
+	 */
+	private IContextInformationValidator getContextInformationValidator() {
+		if (fContextInformationValidator == null) {
+			fContextInformationValidator = new AttributeContextInformationPresenter();
+		}
+		return fContextInformationValidator;
+	}
+}
diff --git a/bundles/org.eclipse.wst.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 29f9ad2..d0bb83c 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -38,11 +38,7 @@
 
 
 /**
- * Completion processor for XML Templates. Most of the work is already done by
- * the XML Content Assist processor, so by the time the
- * XMLTemplateCompletionProcessor is asked for content assist proposals, the
- * XML content assist processor has already set the context type for
- * templates.
+ * <p>Completion computer for XML templates</p>
  */
 class XMLTemplateCompletionProcessor extends TemplateCompletionProcessor {
 	private static final class ProposalComparator implements Comparator {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplatesCompletionProposalComputer.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplatesCompletionProposalComputer.java
new file mode 100644
index 0000000..287baaa
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplatesCompletionProposalComputer.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal.contentassist;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.xml.ui.internal.templates.TemplateContextTypeIdsXML;
+
+/**
+ * <p>Proposal computer used to computer XML template content assist
+ * proposals</p>
+ */
+public class XMLTemplatesCompletionProposalComputer extends
+		DefaultXMLCompletionProposalComputer {
+
+	/** <p>The template processor used to create the proposals</p> */
+	private XMLTemplateCompletionProcessor fTemplateProcessor = null;
+
+	/**
+	 * Create the computer
+	 */
+	public XMLTemplatesCompletionProposalComputer() {
+		super();
+		fTemplateProcessor = new XMLTemplateCompletionProcessor();
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeNameProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsXML.ATTRIBUTE, context);
+	}
+
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addAttributeValueProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsXML.ATTRIBUTE_VALUE, context);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addEmptyDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addEmptyDocumentProposals(
+			ContentAssistRequest contentAssistRequest,
+			CompletionProposalInvocationContext context) {
+		
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsXML.NEW, context);
+	}
+	
+	/**
+	 * @see org.eclipse.wst.xml.ui.internal.contentassist.DefaultXMLCompletionProposalComputer#addTagInsertionProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
+	 */
+	protected void addTagInsertionProposals(
+			ContentAssistRequest contentAssistRequest, int childPosition,
+			CompletionProposalInvocationContext context) {
+		
+		addTemplates(contentAssistRequest, TemplateContextTypeIdsXML.TAG, context);
+	}
+	
+	/**
+	 * <p>Adds templates to the list of proposals</p>
+	 * 
+	 * @param contentAssistRequest
+	 * @param templateContext
+	 * @param context
+	 */
+	private void addTemplates(ContentAssistRequest contentAssistRequest, String templateContext,
+			CompletionProposalInvocationContext context) {
+		
+		if (contentAssistRequest != null) {
+
+			boolean useProposalList = !contentAssistRequest.shouldSeparate();
+	
+			if (fTemplateProcessor != null) {
+				fTemplateProcessor.setContextType(templateContext);
+				ICompletionProposal[] proposals =
+					fTemplateProcessor.computeCompletionProposals(
+							context.getViewer(), context.getInvocationOffset());
+				for (int i = 0; i < proposals.length; ++i) {
+					if (useProposalList) {
+						contentAssistRequest.addProposal(proposals[i]);
+					}
+					else {
+						contentAssistRequest.addMacro(proposals[i]);
+					}
+				}
+			}
+		}
+	}
+
+	public List computeCompletionProposals(CompletionProposalInvocationContext context, IProgressMonitor monitor) {
+		List list = new ArrayList(super.computeCompletionProposals(context, monitor));
+
+		if (fTemplateProcessor != null) {
+			fTemplateProcessor.setContextType(TemplateContextTypeIdsXML.ALL);
+			ICompletionProposal[] proposals = fTemplateProcessor.computeCompletionProposals(context.getViewer(), context.getInvocationOffset());
+			if (proposals != null) {
+				for (int i = 0; i < proposals.length; i++) {
+					list.add(proposals[i]);
+				}
+			}
+		}
+		return list;
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapter.java
index 321c447..0ea3570 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapter.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapter.java
@@ -17,8 +17,6 @@
 import java.util.Iterator;
 
 import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.jface.viewers.StructuredViewer;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
@@ -47,7 +45,7 @@
 	}
 
 	JFaceNodeAdapterFactory fAdapterFactory;
-	private RefreshStructureJob fRefreshJob = null;
+	RefreshStructureJob fRefreshJob = null;
 
 	public JFaceNodeAdapter(JFaceNodeAdapterFactory adapterFactory) {
 		super();
@@ -97,7 +95,7 @@
 				break;
 			}
 			default : {
-				image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_ELEMENT);
+				image = createXMLImageDescriptor(XMLEditorPluginImages.IMG_OBJ_TXTEXT);
 				break;
 			}
 		}
@@ -142,17 +140,15 @@
 	public Image getLabelImage(Object node) {
 		Image image = null;
 		if (node instanceof Node) {
+			// check for an image from the content model
 			image = CMImageUtil.getImage(CMImageUtil.getDeclaration((Node) node));
-			if ((image == null) && (JFaceResources.getImageRegistry() != null)) {
-				ImageRegistry imageRegistry = JFaceResources.getImageRegistry();
-				String nodeName = getNodeName(node);
-				image = imageRegistry.get(nodeName);
-				if (image == null) {
-					image = createImage(node);
-					if (image != null) {
-						imageRegistry.put(nodeName, image);
-					}
-				}
+			if (image == null) {
+				/*
+				 * Create/get image based on Node type. Images are cached
+				 * transparently in this class, subclasses must do this for
+				 * themselves if they're going to return their own results.
+				 */
+				image = createImage(node);
 			}
 		}
 		return image;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapterFactory.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapterFactory.java
index 7977ca5..3943403 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapterFactory.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapterFactory.java
@@ -29,6 +29,7 @@
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.sse.core.internal.util.Assert;
 import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
 import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapterFactory;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
@@ -147,6 +148,9 @@
 	}
 
 	protected void initAdapter(INodeAdapter adapter, INodeNotifier node) {
+		Assert.isTrue(cmDocumentManager == null);
+		Assert.isTrue(fCMDocumentManagerListener == null);
+
 		// register for CMDocumentManager events
 		ModelQueryAdapter mqadapter = (ModelQueryAdapter) node.getAdapterFor(ModelQueryAdapter.class);
 		if (mqadapter != null) {
@@ -165,6 +169,12 @@
 			cmDocumentManager.removeListener(fCMDocumentManagerListener);
 		}
 		fListeners.clear();
+		if (singletonAdapter != null && singletonAdapter instanceof JFaceNodeAdapter) {
+			RefreshStructureJob refreshJob = ((JFaceNodeAdapter) singletonAdapter).fRefreshJob;
+			if (refreshJob != null) {
+				refreshJob.cancel();
+			}
+		}
 	}
 
 	public synchronized void removeListener(Object listener) {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeLabelProvider.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeLabelProvider.java
index 8e3b504..6168dde 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeLabelProvider.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeLabelProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,16 +12,16 @@
  *******************************************************************************/
 package org.eclipse.wst.xml.ui.internal.contentoutline;
 
-import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
 import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
 
 /**
- * A label provider backed by JFaceNodeAdapters.
+ * A (column) label provider backed by JFaceNodeAdapters.
  */
-public class JFaceNodeLabelProvider extends LabelProvider {
+public class JFaceNodeLabelProvider extends ColumnLabelProvider {
 	/**
 	 * JFaceNodeLabelProvider constructor comment.
 	 */
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/RefreshStructureJob.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/RefreshStructureJob.java
index 6960dbd..55c9390 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/RefreshStructureJob.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/RefreshStructureJob.java
@@ -13,7 +13,9 @@
 package org.eclipse.wst.xml.ui.internal.contentoutline;
 
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
@@ -42,32 +44,53 @@
 
 	/** debug flag */
 	static final boolean DEBUG;
-	private static final long UPDATE_DELAY = 250;
+	private static final long UPDATE_DELAY = 300;
 	static {
 		String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/refreshStructure"); //$NON-NLS-1$
 		DEBUG = (value != null) && value.equalsIgnoreCase("true"); //$NON-NLS-1$
 	}
 	/** List of refresh requests (Nodes) */
-	private final List fRequests;
+	private final List fRefreshes;
+	/** List of update requests (Nodes) */
+	private final List fUpdates;
+	/** List of update requests (Nodes) */
+	private final List fUpdateProperties;
 	/** the structured viewers */
-	List fViewers = new ArrayList(3);
+	Set fRefreshViewers = new HashSet(3);
+	Set fUpdateViewers = new HashSet(3);
 
 	public RefreshStructureJob() {
 		super(XMLUIMessages.refreshoutline_0);
 		setPriority(Job.LONG);
 		setSystem(true);
-		fRequests = new ArrayList(2);
+		fRefreshes = new ArrayList(5);
+		fUpdates = new ArrayList(5);
+		fUpdateProperties = new ArrayList(5);
 	}
 
-	private synchronized void addRequest(Node newNodeRequest) {
+	private synchronized void addUpdateRequest(Node newNodeRequest, String[] updateProperties) {
+		/*
+		 * If we get to here, either from existing request list being zero
+		 * length, or no exisitng requests "matched" new request, then add the
+		 * new request.
+		 */
+		fUpdates.add(newNodeRequest);
+		fUpdateProperties.add(updateProperties);
+	}
+
+	private synchronized void addUpdateViewer(StructuredViewer viewer) {
+		fUpdateViewers.add(viewer);
+	}
+
+	private synchronized void addRefreshRequest(Node newNodeRequest) {
 		/*
 		 * note: the caller must NOT pass in null node request (which, since
 		 * private method, we do not need to gaurd against here, as long as we
 		 * gaurd against it in calling method.
 		 */
-		int size = fRequests.size();
+		int size = fRefreshes.size();
 		for (int i = 0; i < size; i++) {
-			Node existingNodeRequest = (Node) fRequests.get(i);
+			Node existingNodeRequest = (Node) fRefreshes.get(i);
 			/*
 			 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=157427 If we
 			 * already have a request which equals the new request, discard
@@ -94,7 +117,7 @@
 			 * any that are contained by new request ... in future :) .
 			 */
 			if (contains(newNodeRequest, existingNodeRequest)) {
-				fRequests.set(i, newNodeRequest);
+				fRefreshes.set(i, newNodeRequest);
 				return;
 			}
 		}
@@ -103,13 +126,20 @@
 		 * length, or no exisitng requests "matched" new request, then add the
 		 * new request.
 		 */
-		fRequests.add(newNodeRequest);
+		fRefreshes.add(newNodeRequest);
 	}
 
-	private synchronized void addViewer(StructuredViewer viewer) {
-		if (!fViewers.contains(viewer)) {
-			fViewers.add(viewer);
-		}
+	private synchronized void addRefreshViewer(StructuredViewer viewer) {
+		fRefreshViewers.add(viewer);
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.runtime.jobs.Job#canceling()
+	 */
+	protected void canceling() {
+		fUpdates.clear();
+		fUpdateViewers.clear();
+		super.canceling();
 	}
 
 	/**
@@ -203,23 +233,70 @@
 	}
 
 	/**
-	 * This method also synchronized because it accesses the fRequests queue
-	 * and fViewers list
+	 * Update must be on UI thread because it's on a SWT widget.
+	 * 
+	 * @param node
+	 */
+	private void doUpdate(final StructuredViewer[] viewers, final Node node, final String[] properties) {
+		final Display display = PlatformUI.getWorkbench().getDisplay();
+		display.asyncExec(new Runnable() {
+			public void run() {
+				if (DEBUG) {
+					System.out.println("refresh on: [" + node.getNodeName() + "]"); //$NON-NLS-1$ //$NON-NLS-2$
+				}
+
+				for (int i = 0; i < viewers.length; i++) {
+					if (!viewers[i].getControl().isDisposed()) {
+						viewers[i].update(node, properties);
+					}
+					else {
+						if (DEBUG) {
+							System.out.println("   !!! skipped refreshing disposed viewer: " + viewers[i]); //$NON-NLS-1$
+						}
+					}
+				}
+			}
+		});
+	}
+
+	/**
+	 * This method also synchronized because it accesses the fRefreshes queue
+	 * and fRefreshViewers list
 	 * 
 	 * @return an array containing and array of the currently requested Nodes
 	 *         to refresh and the viewers in which to refresh them
 	 */
-	private synchronized Object[] getRequests() {
-		Node[] toRefresh = (Node[]) fRequests.toArray(new Node[fRequests.size()]);
-		fRequests.clear();
+	private synchronized Object[] getRefreshRequests() {
+		Node[] toRefresh = (Node[]) fRefreshes.toArray(new Node[fRefreshes.size()]);
+		fRefreshes.clear();
 
-		StructuredViewer[] viewers = (StructuredViewer[]) fViewers.toArray(new StructuredViewer[fViewers.size()]);
-		fViewers.clear();
+		StructuredViewer[] viewers = (StructuredViewer[]) fRefreshViewers.toArray(new StructuredViewer[fRefreshViewers.size()]);
+		fRefreshViewers.clear();
 
 		return new Object[]{toRefresh, viewers};
 	}
 
 	/**
+	 * This method also synchronized because it accesses the fUpdates queue
+	 * and fUpdateViewers list
+	 * 
+	 * @return an array containing and array of the currently requested Nodes
+	 *         to refresh and the viewers in which to refresh them
+	 */
+	private synchronized Object[] getUpdateRequests() {
+		Node[] toUpdate = (Node[]) fUpdates.toArray(new Node[fUpdates.size()]);
+		fUpdates.clear();
+
+		StructuredViewer[] viewers = (StructuredViewer[]) fUpdateViewers.toArray(new StructuredViewer[fUpdateViewers.size()]);
+		fUpdateViewers.clear();
+
+		String[][] properties = (String[][]) fUpdateProperties.toArray(new String[fUpdateProperties.size()][]);
+		fUpdateProperties.clear();
+
+		return new Object[]{toUpdate, viewers, properties};
+	}
+
+	/**
 	 * Invoke a refresh on the viewer on the given node.
 	 * 
 	 * @param node
@@ -229,25 +306,32 @@
 			return;
 		}
 
-		addViewer(viewer);
-		addRequest(node);
+		addRefreshViewer(viewer);
+		addRefreshRequest(node);
+		schedule(UPDATE_DELAY);
+	}
+
+	/**
+	 * Invoke a refresh on the viewer on the given node.
+	 * 
+	 * @param node
+	 */
+	public void update(StructuredViewer viewer, Node node, String[] properties) {
+		if (node == null) {
+			return;
+		}
+
+		addUpdateViewer(viewer);
+		addUpdateRequest(node, properties);
 		schedule(UPDATE_DELAY);
 	}
 
 	protected IStatus run(IProgressMonitor monitor) {
 		IStatus status = Status.OK_STATUS;
 		try {
-			// Retrieve BOTH viewers and Nodes on one block
-			Object[] requests = getRequests();
-			Node[] nodes = (Node[]) requests[0];
-			StructuredViewer[] viewers = (StructuredViewer[]) requests[1];
-
-			for (int i = 0; i < nodes.length; i++) {
-				if (monitor.isCanceled()) {
-					throw new OperationCanceledException();
-				}
-				doRefresh(nodes[i], viewers);
-			}
+			performUpdates();
+			
+			performRefreshes(monitor);
 		}
 		finally {
 			monitor.done();
@@ -255,4 +339,30 @@
 		return status;
 	}
 
+	private void performRefreshes(IProgressMonitor monitor) {
+		// Retrieve BOTH viewers and Nodes on one block
+		Object[] requests = getRefreshRequests();
+		Node[] nodes = (Node[]) requests[0];
+		StructuredViewer[] viewers = (StructuredViewer[]) requests[1];
+
+		for (int i = 0; i < nodes.length; i++) {
+			if (monitor.isCanceled()) {
+				throw new OperationCanceledException();
+			}
+			doRefresh(nodes[i], viewers);
+		}
+	}
+
+	private void performUpdates() {
+		// Retrieve BOTH viewers and Nodes on one block
+		Object[] requests = getUpdateRequests();
+		Node[] nodes = (Node[]) requests[0];
+		StructuredViewer[] viewers = (StructuredViewer[]) requests[1];
+		String[][] properties = (String[][]) requests[2];
+
+		for (int i = 0; i < nodes.length; i++) {
+			doUpdate(viewers, nodes[i], properties[i]);
+		}
+	}
+
 }
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/ProblemIDsXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/ProblemIDsXML.java
index 4d0008b..8bebba4 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/ProblemIDsXML.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/ProblemIDsXML.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,20 +12,5 @@
  *******************************************************************************/
 package org.eclipse.wst.xml.ui.internal.correction;
 
-public interface ProblemIDsXML {
-	int AttrsInEndTag = 3;
-	int AttrValueNotQuoted = 13;
-	int EmptyTag = 1;
-	int InvalidAttrValue = 11;
-	int MissingAttrValue = 4;
-	int MissingClosingBracket = 14;
-	int MissingEndTag = 2;
-	int MissingRequiredAttr = 12;
-	int NamespaceInPI = 8;
-	int NoAttrValue = 5;
-	int SpacesBeforePI = 7;
-	int SpacesBeforeTagName = 6;
-	int Unclassified = 0;
-	int UnknownAttr = 10;
-	int UnknownElement = 9;
+public interface ProblemIDsXML extends org.eclipse.wst.xml.core.internal.validation.ProblemIDsXML {
 }
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickAssistProcessorXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickAssistProcessorXML.java
index 328db8d..486c6c9 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickAssistProcessorXML.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickAssistProcessorXML.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -39,7 +39,7 @@
 
 /**
  * @deprecated since 2.0 RC0 Use
- *             org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
+ *             org.eclipse.jface.text.quickassist.IQuickAssistProcessor and XMLQuickAssistProcessor
  */
 public class QuickAssistProcessorXML implements IQuickAssistProcessor {
 	/*
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickFixProcessorXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickFixProcessorXML.java
index 28eaea1..600824f 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickFixProcessorXML.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickFixProcessorXML.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -21,6 +21,7 @@
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.wst.sse.ui.internal.correction.IQuickFixProcessor;
 import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
+import org.eclipse.wst.xml.core.internal.validation.ProblemIDsXML;
 import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
 import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
 import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RenameInFileQuickAssistProposal.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RenameInFileQuickAssistProposal.java
index ac95b31..d299f25 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RenameInFileQuickAssistProposal.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RenameInFileQuickAssistProposal.java
@@ -17,6 +17,7 @@
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.ITextViewerExtension;
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
 import org.eclipse.jface.text.contentassist.ICompletionProposalExtension2;
 import org.eclipse.jface.text.contentassist.IContextInformation;
@@ -29,7 +30,6 @@
 import org.eclipse.ui.texteditor.link.EditorLinkedModeUI;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
 import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
@@ -59,7 +59,6 @@
 		IDocument document = viewer.getDocument();
 		LinkedPositionGroup group = new LinkedPositionGroup();
 		try {
-			if (viewer instanceof StructuredTextViewer) {
 				IDOMNode node = (IDOMNode) ContentAssistUtils.getNodeAt(viewer, offset);
 				IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
 				ITextRegion region = (startStructuredDocumentRegion == null) ? null : startStructuredDocumentRegion.getRegionAtCharacterOffset(offset);
@@ -93,8 +92,8 @@
 				// TODO CompletionProposalPopup#insertProposal() calls
 				// IRewriteTarget.beginCompoundChange()
 				// which disables redraw in ITextViewer. Workaround for now.
-				((StructuredTextViewer) viewer).setRedraw(true);
-			}
+				if(viewer instanceof ITextViewerExtension)
+					((ITextViewerExtension) viewer).setRedraw(true);
 
 			LinkedModeModel linkedModeModel = new LinkedModeModel();
 			linkedModeModel.addGroup(group);
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditNamespaceInfoDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditNamespaceInfoDialog.java
index 6d2181f..844ac60 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditNamespaceInfoDialog.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditNamespaceInfoDialog.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,6 +15,8 @@
 import java.util.List;
 
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
@@ -202,7 +204,16 @@
 			if (file != null) {
 				String uri = null;
 				if (resourceLocation != null) {
-					uri = URIHelper.getRelativeURI(file.getLocation(), resourceLocation);
+					IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(resourceLocation);
+					if (resource != null) {
+						IPath location = resource.getLocation();
+						if (location != null) {
+							uri = URIHelper.getRelativeURI(file.getLocation(), location);
+						}
+					}
+					else {
+					  uri = URIHelper.getRelativeURI(file.getLocation(), resourceLocation);
+					}
 					grammarURI = file.getLocation().toOSString();
 				}
 				else {
@@ -218,14 +229,20 @@
 			}
 
 
-			CMDocument document = ContentModelManager.getInstance().createCMDocument(grammarURI, "xsd"); //$NON-NLS-1$
-			List namespaceInfoList = (List) document.getProperty("http://org.eclipse.wst/cm/properties/namespaceInfo"); //$NON-NLS-1$
-			NamespaceInfo info = (NamespaceInfo) namespaceInfoList.get(0);
-			if ((uriField.getText().trim().length() == 0) && (info.uri != null)) {
-				uriField.setText(info.uri);
-			}
-			if ((prefixField.getText().trim().length() == 0) && (info.prefix != null)) {
-				prefixField.setText(info.prefix);
+			CMDocument document = ContentModelManager.getInstance().createCMDocument(URIHelper.getURIForFilePath(grammarURI), "xsd"); //$NON-NLS-1$
+			if(document != null) {
+				List namespaceInfoList = (List) document.getProperty("http://org.eclipse.wst/cm/properties/namespaceInfo"); //$NON-NLS-1$
+				if(namespaceInfoList != null) {
+					NamespaceInfo info = (NamespaceInfo) namespaceInfoList.get(0);
+					if(info != null) {
+						if ((uriField.getText().trim().length() == 0) && (info.uri != null)) {
+							uriField.setText(info.uri);
+						}
+						if ((prefixField.getText().trim().length() == 0) && (info.prefix != null)) {
+							prefixField.setText(info.prefix);
+						}
+					}
+				}
 			}
 		}
 	}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdPanel.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdPanel.java
index 01a9e8b..c1d5114 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdPanel.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdPanel.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -43,7 +43,7 @@
 
 		GridLayout gridLayout = new GridLayout();
 		this.setLayout(gridLayout);
-		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+		GridData gd = new GridData(GridData.FILL_BOTH);
 		gd.heightHint = 200;
 		gd.widthHint = 700;
 		this.setLayoutData(gd);
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/DragNodeCommand.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/DragNodeCommand.java
index 3f5c66f..736fc55 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/DragNodeCommand.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/DragNodeCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -19,9 +19,13 @@
 import java.util.List;
 import java.util.Vector;
 
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.widgets.Shell;
 import org.eclipse.wst.common.ui.internal.dnd.DefaultDragAndDropCommand;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
@@ -160,6 +164,9 @@
 		boolean result = true;
 		if (target instanceof Node) {
 			Node targetNode = (Node) target;
+			if (!testOnly && fTreeViewer != null && !validateEdit(getStructuredModel(targetNode), fTreeViewer.getControl().getShell()))
+				return false;
+
 			Node parentNode = getParentForDropPosition(targetNode);
 			Node refChild = getRefChild(targetNode);
 
@@ -175,7 +182,7 @@
 			for (Iterator i = sourcesList.iterator(); i.hasNext();) {
 				Object source = i.next();
 				if (source instanceof Node) {
-					if (!((refChild == null) && (targetNode instanceof Attr))) {
+					if (!((refChild == null) && (targetNode instanceof Attr)) && (parentNode != null)) {
 						result = doModify((Node) source, parentNode, refChild, testOnly);
 					}
 					else {
@@ -196,6 +203,22 @@
 		return result;
 	}
 
+	/**
+	 * Checks that the resource backing the model is writeable utilizing <code>validateEdit</code>
+	 * on a given <tt>IWorkspace</tt>.
+	 * 
+	 * @param model the model to be checked
+	 * @param context the shell context for which <code>validateEdit</code> will be run
+	 * @return boolean result of checking <code>validateEdit</code>. If the resource is unwriteable, <code>status.isOK()</code>
+	 * will return true; otherwise, false.
+	 */
+	private boolean validateEdit(IStructuredModel model, Shell context) {
+		if (model != null && model.getBaseLocation() != null) {
+			IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(model.getBaseLocation()));
+			return !file.isAccessible() || ResourcesPlugin.getWorkspace().validateEdit(new IFile[] {file}, context).isOK();
+		}
+		return false; //$NON-NLS-1$
+	}
 
 	public int getFeedback() {
 		int result = DND.FEEDBACK_SELECT;
@@ -275,11 +298,13 @@
 		}
 
 		for (int i = list.size() - 1; i >= 0; i--) {
-			Node node = (Node) list.get(i);
-			for (Node parent = getParentOrOwner(node); parent != null; parent = getParentOrOwner(parent)) {
-				if (table.get(parent) != null) {
-					list.remove(i);
-					break;
+			Object node =  list.get(i); 
+			if (node instanceof Node){
+				for (Node parent = getParentOrOwner((Node)node); parent != null; parent = getParentOrOwner(parent)) {
+					if (table.get(parent) != null) {
+						list.remove(i);
+						break;
+					}
 				}
 			}
 		}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/doubleclick/XMLDoubleClickStrategy.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/doubleclick/XMLDoubleClickStrategy.java
index b23097e..4d35d87 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/doubleclick/XMLDoubleClickStrategy.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/doubleclick/XMLDoubleClickStrategy.java
@@ -19,7 +19,6 @@
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 import org.w3c.dom.Node;
 
@@ -34,14 +33,13 @@
 	protected IStructuredDocumentRegion fStructuredDocumentRegion = null;
 	protected String fStructuredDocumentRegionText = ""; //$NON-NLS-1$
 	protected IStructuredModel fStructuredModel = null;
-	protected StructuredTextViewer fStructuredTextViewer;
+	protected ITextViewer fTextViewer;
 	protected ITextRegion fTextRegion = null;
 
 	public void doubleClicked(ITextViewer textViewer) {
-		if (textViewer instanceof StructuredTextViewer) {
-			fStructuredTextViewer = (StructuredTextViewer) textViewer;
+			fTextViewer = textViewer;
 			try {
-				fStructuredModel = StructuredModelManager.getModelManager().getExistingModelForRead(fStructuredTextViewer.getDocument());
+				fStructuredModel = StructuredModelManager.getModelManager().getExistingModelForRead(fTextViewer.getDocument());
 
 				if (fStructuredModel != null) {
 					int caretPosition = textViewer.getSelectedRange().x;
@@ -71,7 +69,6 @@
 					fStructuredModel.releaseFromRead();
 				}
 			}
-		}
 	}
 
 	protected Point getWord(String string, int cursor) {
@@ -139,7 +136,7 @@
 		ITextRegion nextRegion = fStructuredDocumentRegion.getRegionAtCharacterOffset(nextRegionOffset);
 
 		if ((prevRegion != null) && (prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) && (nextRegion != null) && (nextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)) {
-			fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(prevRegion), nextRegion.getTextEnd() - prevRegion.getStart());
+			fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(prevRegion), nextRegion.getTextEnd() - prevRegion.getStart());
 		}
 	}
 
@@ -151,11 +148,11 @@
 			nextRegionOffset = fStructuredDocumentRegion.getEndOffset(nextRegion);
 			nextRegion = fStructuredDocumentRegion.getRegionAtCharacterOffset(nextRegionOffset);
 			if ((nextRegion != null) && (nextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)) {
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), nextRegion.getTextEnd() - fTextRegion.getStart());
+				fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), nextRegion.getTextEnd() - fTextRegion.getStart());
 			}
 			else {
 				// attribute has no value
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
+				fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
 				fDoubleClickCount = 0;
 			}
 		}
@@ -167,18 +164,18 @@
 		if (fDoubleClickCount == 1) {
 			Point word = getWord(regionText, fCaretPosition - fStructuredDocumentRegion.getStartOffset(fTextRegion));
 			if (word.x == word.y) { // no word found; select whole region
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), regionText.length());
+				fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), regionText.length());
 				fDoubleClickCount++;
 			}
 			else {
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion) + word.x, word.y - word.x);
+				fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion) + word.x, word.y - word.x);
 			}
 		}
 		else if (fDoubleClickCount == 2) {
 			if (isQuoted(regionText)) {
 				// ==> // Point word = getWord(regionText, fCaretPosition -
 				// fStructuredDocumentRegion.getStartOffset(fTextRegion));
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), regionText.length());
+				fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), regionText.length());
 			}
 			else {
 				processElementAttrValueDoubleClicked2Times();
@@ -189,12 +186,12 @@
 				processElementAttrValueDoubleClicked2Times();
 			}
 			else {
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
+				fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
 				fDoubleClickCount = 0;
 			}
 		}
 		else { // fDoubleClickCount == 4
-			fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
+			fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
 			fDoubleClickCount = 0;
 		}
 	}
@@ -207,7 +204,7 @@
 			prevRegionOffset = fStructuredDocumentRegion.getStartOffset(prevRegion) - 1;
 			prevRegion = fStructuredDocumentRegion.getRegionAtCharacterOffset(prevRegionOffset);
 			if ((prevRegion != null) && (prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)) {
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(prevRegion), fTextRegion.getTextEnd() - prevRegion.getStart());
+				fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(prevRegion), fTextRegion.getTextEnd() - prevRegion.getStart());
 			}
 		}
 	}
@@ -218,7 +215,7 @@
 		}
 		else {
 			if (fDoubleClickCount == 1) {
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart() + fTextRegion.getStart(), fTextRegion.getTextLength());
+				fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart() + fTextRegion.getStart(), fTextRegion.getTextLength());
 			}
 			else if (fDoubleClickCount == 2) {
 				if (fTextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
@@ -228,12 +225,12 @@
 					processElementAttrEqualsDoubleClicked2Times();
 				}
 				else {
-					fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
+					fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
 					fDoubleClickCount = 0;
 				}
 			}
 			else { // fDoubleClickCount == 3
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
+				fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
 				fDoubleClickCount = 0;
 			}
 		}
@@ -241,9 +238,9 @@
 
 	protected void processTextDoubleClicked() {
 		if (fDoubleClickCount == 1) {
-			super.doubleClicked(fStructuredTextViewer);
+			super.doubleClicked(fTextViewer);
 
-			Point selectedRange = fStructuredTextViewer.getSelectedRange();
+			Point selectedRange = fTextViewer.getSelectedRange();
 			if ((selectedRange.x == fStructuredDocumentRegion.getStartOffset(fTextRegion)) && (selectedRange.y == fTextRegion.getTextLength())) {
 				// only one word in region, skip one level of double click
 				// selection
@@ -252,28 +249,28 @@
 		}
 		else if (fDoubleClickCount == 2) {
 			if (fTextRegion.getType() == DOMRegionContext.UNDEFINED) {
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
+				fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
 				fDoubleClickCount = 0;
 			}
 			else {
 				if (isQuoted(fStructuredDocumentRegion.getFullText(fTextRegion))) {
-					fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion) + 1, fTextRegion.getTextLength() - 2);
+					fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion) + 1, fTextRegion.getTextLength() - 2);
 				}
 				else {
-					fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), fTextRegion.getTextLength());
+					fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), fTextRegion.getTextLength());
 				}
 			}
 		}
 		else {
 			if ((fDoubleClickCount == 3) && isQuoted(fStructuredDocumentRegion.getFullText(fTextRegion))) {
-				fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), fTextRegion.getTextLength());
+				fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion), fTextRegion.getTextLength());
 			}
 			else {
 				if ((fDoubleClickCount == 3) && isQuoted(fStructuredDocumentRegionText)) {
-					fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart() + 1, fStructuredDocumentRegion.getLength() - 2);
+					fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart() + 1, fStructuredDocumentRegion.getLength() - 2);
 				}
 				else {
-					fStructuredTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
+					fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStart(), fStructuredDocumentRegion.getLength());
 					fDoubleClickCount = 0;
 				}
 			}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/CMImageUtil.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/CMImageUtil.java
index 64320ec..7ab4ddc 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/CMImageUtil.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/CMImageUtil.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,12 +15,13 @@
 import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.net.URLConnection;
 
 import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
 import org.eclipse.swt.SWTException;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.wst.sse.core.internal.util.JarUtilities;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
 import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
 import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
@@ -59,9 +60,18 @@
 			return null;
 		}
 		Image image = null;
-		ImageDescriptor descriptor = getImageDescriptor(cmnode);
-		if (descriptor != null) {
-			image = descriptor.createImage(false);
+		// cache CM-specified images with the XML UI plugin
+		String imageURLString = (String) cmnode.getProperty(SMALL_ICON_URL);
+		if ((imageURLString != null) && (imageURLString.length() > 0)) {
+			/* First ensure that the descriptor itself is cached */
+			ImageDescriptor imageDescriptor = getImageDescriptor(imageURLString);
+			if (imageDescriptor != null) {
+				/*
+				 * Then obtain the image from the registry so that it is both
+				 * cached and properly disposed of later
+				 */
+				image = getImageRegistry().get(imageURLString);
+			}
 		}
 		return image;
 	}
@@ -74,38 +84,45 @@
 		String imageURLString = (String) cmnode.getProperty(SMALL_ICON_URL);
 		ImageDescriptor descriptor = null;
 		if ((imageURLString != null) && (imageURLString.length() > 0)) {
-			descriptor = XMLUIPlugin.getInstance().getImageRegistry().getDescriptor(imageURLString);
-			if (descriptor == null) {
+			descriptor = getImageDescriptor(imageURLString);
+		}
+		return descriptor;
+	}
+
+	private static ImageDescriptor getImageDescriptor(String imageURLString) {
+		ImageDescriptor descriptor = getImageRegistry().getDescriptor(imageURLString);
+		if (descriptor == null) {
+			try {
+				URL imageURL = new URL(imageURLString);
+				InputStream inputStream = JarUtilities.getInputStream(imageURL);
 				try {
-					URL imageURL = new URL(imageURLString);
-					URLConnection connection = imageURL.openConnection();
-					connection.setUseCaches(false);
-					InputStream inputStream = connection.getInputStream();
-					try {
-						ImageData data = new ImageData(inputStream);
-						descriptor = ImageDescriptor.createFromImageData(data);
-						XMLUIPlugin.getInstance().getImageRegistry().put(imageURLString, descriptor);
-					}
-					catch (SWTException e) {
-						/*
-						 * There was a problem loading image from stream
-						 * (corrupt, missing, etc.)
-						 */
-						if (inputStream != null)
-							inputStream.close();
-					}
+					ImageData data = new ImageData(inputStream);
+					descriptor = ImageDescriptor.createFromImageData(data);
+					getImageRegistry().put(imageURLString, descriptor);
 				}
-				catch (MalformedURLException e) {
-					descriptor = null;
+				catch (SWTException e) {
+					/*
+					 * There was a problem loading image from stream
+					 * (corrupt, missing, etc.)
+					 */
+					if (inputStream != null)
+						inputStream.close();
 				}
-				catch (IOException e) {
-					descriptor = null;
-				}
+			}
+			catch (MalformedURLException e) {
+				descriptor = null;
+			}
+			catch (IOException e) {
+				descriptor = null;
 			}
 		}
 		return descriptor;
 	}
 
+	private static final ImageRegistry getImageRegistry() {
+		return XMLUIPlugin.getInstance().getImageRegistry();
+	}
+
 	/**
 	 * 
 	 */
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/DOMSelectionConvertorFactory.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/DOMSelectionConvertorFactory.java
new file mode 100644
index 0000000..0f0988b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/DOMSelectionConvertorFactory.java
@@ -0,0 +1,86 @@
+/*******************************************************************************

+ * Copyright (c) 2008 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ * 

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+

+package org.eclipse.wst.xml.ui.internal.editor;

+

+import org.eclipse.core.runtime.IAdapterFactory;

+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;

+import org.eclipse.wst.sse.ui.internal.editor.SelectionConvertor;

+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;

+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;

+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;

+import org.w3c.dom.NamedNodeMap;

+

+/**

+ * @author nitin

+ * 

+ */

+public class DOMSelectionConvertorFactory implements IAdapterFactory {

+

+	private static final Class[] ADAPTER_LIST = new Class[]{SelectionConvertor.class};

+

+	private static class XMLSelectionConvertor extends SelectionConvertor {

+		/* (non-Javadoc)

+		 * @see org.eclipse.wst.sse.ui.internal.editor.SelectionConvertor#getElements(org.eclipse.wst.sse.core.internal.provisional.IStructuredModel, int, int)

+		 */

+		public Object[] getElements(IStructuredModel model, int start, int end) {

+			Object[] objects = super.getElements(model, start, end);

+			// narrow single selected Elements into Attrs if possible

+			if (objects.length == 1) {

+				if (objects[0] instanceof IDOMNode) {

+					IDOMNode node = (IDOMNode) objects[0];

+					NamedNodeMap attributes = node.getAttributes();

+					if (attributes != null) {

+						for (int i = 0; i < attributes.getLength(); i++) {

+							IDOMAttr attribute = (IDOMAttr) attributes.item(i);

+							if (attribute.contains(start) && attribute.contains(end)) {

+								objects[0] = attribute;

+								break;

+							}

+						}

+					}

+				}

+			}

+			return objects;

+		}

+	}

+

+	private static final Object selectionConvertor = new XMLSelectionConvertor();

+

+	/**

+	 * 

+	 */

+	public DOMSelectionConvertorFactory() {

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see

+	 * org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object,

+	 * java.lang.Class)

+	 */

+	public Object getAdapter(Object adaptableObject, Class adapterType) {

+		if (adaptableObject instanceof IDOMModel && SelectionConvertor.class.equals(adapterType))

+			return selectionConvertor;

+		return null;

+	}

+

+	/*

+	 * (non-Javadoc)

+	 * 

+	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()

+	 */

+	public Class[] getAdapterList() {

+		return ADAPTER_LIST;

+	}

+

+}

diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/IHelpContextIds.java
index d64004f..f7542e3 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/IHelpContextIds.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/IHelpContextIds.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -39,6 +39,8 @@
 	public static final String XML_PREFWEBX_STYLES_HELPID = PREFIX + "webx0062"; //$NON-NLS-1$
 	// XML Templates Preference page
 	public static final String XML_PREFWEBX_TEMPLATES_HELPID = PREFIX + "webx0063"; //$NON-NLS-1$
+    // XML Validator Preference page
+    public static final String XML_PREFWEBX_VALIDATOR_HELPID = PREFIX + "webx0064"; //$NON-NLS-1$
 
 	// XML Cleanup dialog
 	public static final String CLEANUP_XML_HELPID = PREFIX + "xmlm1200"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImageHelper.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImageHelper.java
index 429b6b7..73b6736 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImageHelper.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImageHelper.java
@@ -16,7 +16,6 @@
 
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
@@ -155,6 +154,6 @@
 	 * @return ImageRegistry - image registry for this plugin
 	 */
 	private ImageRegistry getImageRegistry() {
-		return JFaceResources.getImageRegistry();
+		return XMLUIPlugin.getDefault().getImageRegistry();
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImages.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImages.java
index 3e2a63e..52c379a 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImages.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImages.java
@@ -41,6 +41,7 @@
 	public static final String IMG_OBJ_LOCAL_VARIABLE = "icons/full/obj16/localvariable_obj.gif"; //$NON-NLS-1$
 	public static final String IMG_OBJ_NOTATION = "icons/full/obj16/notation.gif"; //$NON-NLS-1$
 	public static final String IMG_OBJ_PROCESSINGINSTRUCTION = "icons/full/obj16/proinst_obj.gif"; //$NON-NLS-1$
+	public static final String IMG_OBJ_SORT = "icons/full/obj16/sort.gif"; //$NON-NLS-1$
 	public static final String IMG_OBJ_TAG_GENERIC = "icons/full/obj16/tag-generic.gif"; //$NON-NLS-1$
 	public static final String IMG_OBJ_TAG_GENERIC_DEEMPHASIZED = "icons/full/obj16/tag_generic_deemphasized_obj.gif"; //$NON-NLS-1$    
 	public static final String IMG_OBJ_TAG_GENERIC_EMPHASIZED = "icons/full/obj16/tag_generic_emphasized_obj.gif"; //$NON-NLS-1$        
@@ -54,4 +55,6 @@
 	public static final String IMG_OVR_WARN = "icons/full/ovr16/warn_ovr.gif"; //$NON-NLS-1$
 
 	public static final String IMG_WIZBAN_GENERATEXML = "icons/full/wizban/generatexml_wiz.png"; //$NON-NLS-1$
+	
+	public static final String IMG_OBJ_DEFAULT = "icons/full/obj16/default.gif"; //$NON-NLS-1$
 }
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/CommentHandler.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/CommentHandler.java
index 6188db2..fb94ac6 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/CommentHandler.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/CommentHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
+ * Copyright (c) 2008, 2010 Standards for Technology in Automotive Retail and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -24,6 +24,8 @@
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorExtension;
+import org.eclipse.ui.texteditor.ITextEditorExtension2;
 import org.eclipse.wst.xml.ui.internal.Logger;
 
 public class CommentHandler extends AbstractHandler implements IHandler {
@@ -44,7 +46,7 @@
 			if (o != null)
 				textEditor = (ITextEditor) o;
 		}
-		if (textEditor != null) {
+		if (textEditor != null && validateEditorInput(textEditor)) {
 			IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
 			if (document != null) {
 				// get current text selection
@@ -60,6 +62,17 @@
 		return null;
 	}
 
+	protected boolean validateEditorInput(ITextEditor textEditor) {
+		if (textEditor instanceof ITextEditorExtension2)
+			return ((ITextEditorExtension2)textEditor).validateEditorInputState();
+		else if (textEditor instanceof ITextEditorExtension)
+			return ((ITextEditorExtension)textEditor).isEditorInputReadOnly();
+		else if (textEditor != null)
+			return textEditor.isEditable();
+		return true;
+		
+	}
+
 	protected ITextSelection getCurrentSelection(ITextEditor textEditor) {
 		ISelectionProvider provider = textEditor.getSelectionProvider();
 		if (provider != null) {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ToggleCommentHandler.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ToggleCommentHandler.java
index 174f680..0b75dca 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ToggleCommentHandler.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ToggleCommentHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
+ * Copyright (c) 2008, 2010 Standards for Technology in Automotive Retail and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -44,7 +44,7 @@
 			if (o != null)
 				textEditor = (ITextEditor) o;
 		}
-		if (textEditor != null) {
+		if (textEditor != null && super.validateEditorInput(textEditor)) {
 			IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
 			if (document != null) {
 				// get current text selection
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ToggleEditModeHandler.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ToggleEditModeHandler.java
index 85e4f59..c36673f 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ToggleEditModeHandler.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ToggleEditModeHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
+ * Copyright (c) 2008, 2009 Standards for Technology in Automotive Retail and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -37,7 +37,6 @@
 public class ToggleEditModeHandler extends AbstractHandler implements IElementUpdater {
 	protected ImageDescriptor onImage = SharedXMLEditorPluginImageHelper.getImageDescriptor(SharedXMLEditorPluginImageHelper.IMG_ETOOL_CONSTRAINON);
 	protected ImageDescriptor offImage = SharedXMLEditorPluginImageHelper.getImageDescriptor(SharedXMLEditorPluginImageHelper.IMG_ETOOL_CONSTRAINOFF);
-	protected ModelQuery modelQuery;
 
 	public ToggleEditModeHandler() {
 		super();
@@ -57,6 +56,7 @@
 			IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
 			IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
 			if (model != null) {
+				ModelQuery modelQuery;
 				try {
 					modelQuery = ModelQueryUtil.getModelQuery(model);
 				}
@@ -100,7 +100,7 @@
 		ITextEditor textEditor = null;
 		if (editor instanceof ITextEditor)
 			textEditor = (ITextEditor) editor;
-		else {
+		else if (editor != null) {
 			Object o = editor.getAdapter(ITextEditor.class);
 			if (o != null)
 				textEditor = (ITextEditor) o;
@@ -109,6 +109,7 @@
 			IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
 			IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
 			if (model != null) {
+			    ModelQuery modelQuery;
 				try {
 					modelQuery = ModelQueryUtil.getModelQuery(model);
 				}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/XMLFindOccurencesHandler.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/XMLFindOccurencesHandler.java
index 56c28bd..591e5f1 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/XMLFindOccurencesHandler.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/XMLFindOccurencesHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
+ * Copyright (c) 2008, 2010 Standards for Technology in Automotive Retail and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -30,6 +30,8 @@
 import org.eclipse.ui.IFileEditorInput;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
 import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
 import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
 import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
@@ -73,8 +75,13 @@
 		}
 		else {
 			String errorMessage = SSEUIMessages.FindOccurrencesActionProvider_0; //$NON-NLS-1$
-			PlatformStatusLineUtil.displayErrorMessage(errorMessage);
-			PlatformStatusLineUtil.addOneTimeClearListener();
+			if (textEditor instanceof StructuredTextEditor) {
+				PlatformStatusLineUtil.displayTemporaryErrorMessage(((StructuredTextEditor) textEditor).getTextViewer(), errorMessage);
+			}
+			else {
+				PlatformStatusLineUtil.displayErrorMessage(errorMessage);
+				PlatformStatusLineUtil.addOneTimeClearListener();
+			}
 		}
 
 		return null;
@@ -94,12 +101,26 @@
 		String partition = tr != null ? tr.getType() : ""; //$NON-NLS-1$
 
 		Iterator it = getProcessors().iterator();
-		FindOccurrencesProcessor action = null;
+		FindOccurrencesProcessor processor = null;
 		while (it.hasNext()) {
-			action = (FindOccurrencesProcessor) it.next();
+			processor = (FindOccurrencesProcessor) it.next();
 			// we just choose the first action that can handle the partition
-			if (action.enabledForParitition(partition))
-				return action;
+			if (processor.enabledForParitition(partition))
+				return processor;
+		}
+
+		List extendedFindOccurrencesProcessors = ExtendedConfigurationBuilder.getInstance().getConfigurations(FindOccurrencesProcessor.class.getName(), partition);
+		for (int i = 0; i < extendedFindOccurrencesProcessors.size(); i++) {
+			Object o = extendedFindOccurrencesProcessors.get(i);
+			if (o instanceof FindOccurrencesProcessor) {
+				/*
+				 * We just choose the first registered processor that
+				 * explicitly says it can handle the partition
+				 */
+				processor = (FindOccurrencesProcessor) o;
+				if (processor.enabledForParitition(partition))
+					return processor;
+			}
 		}
 		return null;
 	}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/CatalogEntryHyperlink.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/CatalogEntryHyperlink.java
new file mode 100644
index 0000000..7ef2986
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/CatalogEntryHyperlink.java
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal.hyperlink;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
+
+class CatalogEntryHyperlink implements IHyperlink {
+
+	private IRegion fHyperlinkRegion = null;
+	private ICatalogEntry fEntry = null;
+
+	/**
+	 * @param hyperlinkRegion
+	 * @param entry
+	 */
+	CatalogEntryHyperlink(IRegion hyperlinkRegion, ICatalogEntry entry) {
+		super();
+		fHyperlinkRegion = hyperlinkRegion;
+		fEntry = entry;
+	}
+
+	/**
+	 * @return
+	 */
+	private IHyperlink getHyperlink() {
+		if (fEntry.getURI().startsWith("file:")) { //$NON-NLS-1$
+			return new ExternalFileHyperlink(fHyperlinkRegion, new File(fEntry.getURI().substring(5)));
+		}
+		else if (fEntry.getURI().startsWith("platform:/resource/")) { //$NON-NLS-1$
+			IPath path = new Path(fEntry.getURI().substring(20));
+			if (path.segmentCount() > 1)
+				return new WorkspaceFileHyperlink(fHyperlinkRegion, ResourcesPlugin.getWorkspace().getRoot().getFile(path));
+		}
+		else {
+			/*
+			 * the URL detector will already work on the literal text, so
+			 * offer to open the contents in an editor
+			 */
+			try {
+				if (fEntry.getURI().startsWith("jar:file:"))
+					return new URLStorageHyperlink(fHyperlinkRegion, new URL(fEntry.getURI())) {
+						public String getHyperlinkText() {
+							return NLS.bind(XMLUIMessages.Open, fEntry.getKey());
+						}
+					};
+			}
+			catch (MalformedURLException e) {
+				// not valid?
+			}
+		}
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkRegion()
+	 */
+	public IRegion getHyperlinkRegion() {
+		return fHyperlinkRegion;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
+	 */
+	public String getHyperlinkText() {
+		IHyperlink link = getHyperlink();
+		if (link != null)
+			return link.getHyperlinkText();
+		return NLS.bind(XMLUIMessages.Open, fEntry.getKey());
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
+	 */
+	public String getTypeLabel() {
+		IHyperlink link = getHyperlink();
+		if (link != null)
+			return link.getTypeLabel();
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()
+	 */
+	public void open() {
+		IHyperlink link = getHyperlink();
+		if (link != null)
+			link.open();
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileHyperlink.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileHyperlink.java
index 8a9bca9..6761969 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileHyperlink.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileHyperlink.java
@@ -14,6 +14,7 @@
 
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.ui.IEditorDescriptor;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IWorkbenchPage;
@@ -21,6 +22,7 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.ide.IDE;
 import org.eclipse.wst.xml.ui.internal.Logger;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
 
 /**
  * Hyperlink for external files.
@@ -48,7 +50,11 @@
 	}
 
 	public String getHyperlinkText() {
-		return null;
+		String path = fHyperlinkFile.getPath();
+		if (path.length() > 60) {
+			path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
+		}
+		return NLS.bind(XMLUIMessages.Open, path);
 	}
 
 	public void open() {
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/URLFileHyperlink.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/URLStorageHyperlink.java
similarity index 69%
rename from bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/URLFileHyperlink.java
rename to bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/URLStorageHyperlink.java
index f4e2c2a..bc4b03f 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/URLFileHyperlink.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/URLStorageHyperlink.java
@@ -1,4 +1,4 @@
-package org.eclipse.wst.jsdt.web.ui.internal.hyperlink;
+package org.eclipse.wst.xml.ui.internal.hyperlink;
 
 import java.io.InputStream;
 import java.net.URL;
@@ -12,6 +12,8 @@
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jface.text.hyperlink.URLHyperlink;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.ui.IEditorDescriptor;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IPersistableElement;
@@ -20,117 +22,139 @@
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.jsdt.web.ui.internal.JsUIPlugin;
-import org.eclipse.wst.jsdt.web.ui.internal.Logger;
+import org.eclipse.wst.sse.core.internal.util.JarUtilities;
+import org.eclipse.wst.xml.core.internal.Logger;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
+import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
 
 /**
  * Hyperlink for URLs (opens in read-only mode)
  */
-class URLFileHyperlink implements IHyperlink {
+class URLStorageHyperlink implements IHyperlink {
 	// copies of this class exist in:
 	// org.eclipse.wst.xml.ui.internal.hyperlink
 	// org.eclipse.wst.html.ui.internal.hyperlink
-	// org.eclipse.wst.jsdt.web.ui.internal.hyperlink
+	// org.eclipse.jst.jsp.ui.internal.hyperlink
+
 	static class StorageEditorInput implements IStorageEditorInput {
 		IStorage fStorage = null;
-		
+
 		StorageEditorInput(IStorage storage) {
 			fStorage = storage;
 		}
-		
-		public boolean exists() {
-			return fStorage != null;
-		}
-		
-		public Object getAdapter(Class adapter) {
-			return null;
-		}
-		
-		public ImageDescriptor getImageDescriptor() {
-			return null;
-		}
-		
-		public String getName() {
-			return fStorage.getName();
-		}
-		
-		public IPersistableElement getPersistable() {
-			return null;
-		}
-		
+
 		public IStorage getStorage() throws CoreException {
 			return fStorage;
 		}
-		
+
+		public boolean exists() {
+			return fStorage != null;
+		}
+
+		public boolean equals(Object obj) {
+			if (obj instanceof StorageEditorInput) {
+				return fStorage.equals(((StorageEditorInput) obj).fStorage);
+			}
+			return super.equals(obj);
+		}
+
+		public ImageDescriptor getImageDescriptor() {
+			return null;
+		}
+
+		public String getName() {
+			return fStorage.getName();
+		}
+
+		public IPersistableElement getPersistable() {
+			return null;
+		}
+
 		public String getToolTipText() {
 			return fStorage.getFullPath() != null ? fStorage.getFullPath().toString() : fStorage.getName();
 		}
-	}
-	static class URLStorage implements IStorage {
-		URL fURL = null;
-		
-		URLStorage(URL url) {
-			fURL = url;
-		}
-		
+
 		public Object getAdapter(Class adapter) {
 			return null;
 		}
-		
+	}
+
+	static class URLStorage implements IStorage {
+		URL fURL = null;
+
+		URLStorage(URL url) {
+			fURL = url;
+		}
+
+		public boolean equals(Object obj) {
+			if (obj instanceof URLStorage) {
+				return fURL.equals(((URLStorage) obj).fURL);
+			}
+			return super.equals(obj);
+		}
+
 		public InputStream getContents() throws CoreException {
 			InputStream stream = null;
 			try {
-				stream = fURL.openStream();
-			} catch (Exception e) {
-				throw new CoreException(new Status(IStatus.ERROR, JsUIPlugin.getDefault().getBundle().getSymbolicName(), IStatus.ERROR, fURL.toString(), e));
+				if (fURL.toString().startsWith("jar:file"))
+					stream = JarUtilities.getInputStream(fURL);
+				else
+					stream = fURL.openStream();
+			}
+			catch (Exception e) {
+				throw new CoreException(new Status(IStatus.ERROR, XMLUIPlugin.getDefault().getBundle().getSymbolicName(), IStatus.ERROR, fURL.toString(), e));
 			}
 			return stream;
 		}
-		
+
 		public IPath getFullPath() {
 			return new Path(fURL.toString());
 		}
-		
+
 		public String getName() {
 			return new Path(fURL.getFile()).lastSegment();
 		}
-		
+
 		public boolean isReadOnly() {
 			return true;
 		}
+
+		public Object getAdapter(Class adapter) {
+			return null;
+		}
+
 	}
+
 	private IRegion fRegion;
 	private URL fURL;
-	
-	public URLFileHyperlink(IRegion region, URL url) {
+
+	public URLStorageHyperlink(IRegion region, URL url) {
 		fRegion = region;
 		fURL = url;
 	}
-	
+
 	public IRegion getHyperlinkRegion() {
 		return fRegion;
 	}
-	
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
-	 */
-	public String getHyperlinkText() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	
+
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
 	 */
 	public String getTypeLabel() {
-		// TODO Auto-generated method stub
 		return null;
 	}
-	
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
+	 */
+	public String getHyperlinkText() {
+		return NLS.bind(XMLUIMessages.Open, fURL.toString());
+	}
+
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -146,8 +170,10 @@
 					IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
 					IDE.openEditor(page, input, descriptor.getId(), true);
 				}
-			} catch (PartInitException e) {
+			}
+			catch (PartInitException e) {
 				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+				new URLHyperlink(fRegion, fURL.toString()).open();
 			}
 		}
 	}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java
index 24b5e65..0319952 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java
@@ -13,6 +13,7 @@
 import org.eclipse.core.resources.IFile;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PartInitException;
@@ -20,6 +21,7 @@
 import org.eclipse.ui.ide.IDE;
 import org.eclipse.ui.texteditor.ITextEditor;
 import org.eclipse.wst.xml.ui.internal.Logger;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
 
 /**
  * Hyperlink for files within the workspace. (As long as there is an IFile,
@@ -56,7 +58,6 @@
 	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
 	 */
 	public String getTypeLabel() {
-		// TODO Auto-generated method stub
 		return null;
 	}
 
@@ -66,8 +67,11 @@
 	 * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
 	 */
 	public String getHyperlinkText() {
-		// TODO Auto-generated method stub
-		return null;
+		String path = fFile.getFullPath().toString();
+		if (path.length() > 60) {
+			path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
+		}
+		return NLS.bind(XMLUIMessages.Open, path);
 	}
 
 	public void open() {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java
index 3b00c0c..09abdc3 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java
@@ -25,13 +25,16 @@
 import org.eclipse.jface.text.Region;
 import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;
 import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.text.hyperlink.URLHyperlink;
 import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
 import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
@@ -58,7 +61,6 @@
  * 
  */
 public class XMLHyperlinkDetector extends AbstractHyperlinkDetector {
-	private final String HTTP_PROTOCOL = "http://";//$NON-NLS-1$
 	private final String NO_NAMESPACE_SCHEMA_LOCATION = "noNamespaceSchemaLocation"; //$NON-NLS-1$
 	private final String SCHEMA_LOCATION = "schemaLocation"; //$NON-NLS-1$
 	private final String XMLNS = "xmlns"; //$NON-NLS-1$
@@ -74,8 +76,9 @@
 	private IHyperlink createHyperlink(String uriString, IRegion hyperlinkRegion, IDocument document, Node node) {
 		IHyperlink link = null;
 
-		if (isHttp(uriString)) {
-			link = new URLHyperlink(hyperlinkRegion, uriString);
+		ICatalogEntry entry = getCatalogEntry(uriString);
+		if (entry != null) {
+			link = new CatalogEntryHyperlink(hyperlinkRegion, entry);
 		}
 		else {
 			// try to locate the file in the workspace
@@ -449,23 +452,6 @@
 	}
 
 	/**
-	 * Returns true if this uriString is an http string
-	 * 
-	 * @param uriString
-	 * @return true if uriString is http string, false otherwise
-	 */
-	private boolean isHttp(String uriString) {
-		boolean isHttp = false;
-		if (uriString != null) {
-			String tempString = uriString.toLowerCase();
-			if (tempString.startsWith(HTTP_PROTOCOL)) {
-				isHttp = true;
-			}
-		}
-		return isHttp;
-	}
-
-	/**
 	 * Checks to see if the given attribute is openable. Attribute is openable
 	 * if it is a namespace declaration attribute or if the attribute value is
 	 * of type URI.
@@ -521,7 +507,7 @@
 	private boolean isValidURI(String uriString) {
 		boolean isValid = false;
 
-		if (isHttp(uriString)) {
+		if (getCatalogEntry(uriString) != null) {
 			isValid = true;
 		}
 		else {
@@ -537,6 +523,35 @@
 	}
 
 	/**
+	 * @param uriString
+	 * @return
+	 */
+	private ICatalogEntry getCatalogEntry(String uriString) {
+		ICatalog defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
+		if (defaultCatalog != null) {
+			// Process default catalog
+			ICatalogEntry[] entries = defaultCatalog.getCatalogEntries();
+			for (int entry = 0; entry < entries.length; entry++) {
+				if (uriString.equals(entries[entry].getKey())||uriString.equals(entries[entry].getURI())) {
+					return entries[entry];
+				}
+			}
+
+			// Process declared OASIS nextCatalogs catalog
+			INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs();
+			for (int nextCatalog = 0; nextCatalog < nextCatalogs.length; nextCatalog++) {
+				ICatalog catalog = nextCatalogs[nextCatalog].getReferencedCatalog();
+				ICatalogEntry[] entries2 = catalog.getCatalogEntries();
+				for (int entry = 0; entry < entries2.length; entry++) {
+					if (uriString.equals(entries2[entry].getKey())||uriString.equals(entries2[entry].getURI()))
+						return entries2[entry];
+				}
+			}
+		}
+		return null;
+	}
+
+	/**
 	 * Resolves the given URI information
 	 * 
 	 * @param baseLocation
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesControl.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesControl.java
index b3b3a55..2782c47 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesControl.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesControl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,6 +16,8 @@
 import java.util.List;
 
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.jface.window.Window;
 import org.eclipse.swt.SWT;
@@ -130,7 +132,16 @@
 				if (file != null) {
 					String uri = null;
 					if (resourceLocation != null) {
-						uri = URIHelper.getRelativeURI(file.getLocation(), resourceLocation);
+						IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(resourceLocation);
+						if (resource != null) {
+							IPath location = resource.getLocation();
+							if (location != null) {
+								uri = URIHelper.getRelativeURI(file.getLocation(), location);
+							}
+						}
+	                    else {
+	                      uri = URIHelper.getRelativeURI(file.getLocation(), resourceLocation);
+	                    }
 						// grammarURI = file.getLocation().toOSString();
 					}
 					else {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/perspective/XMLPerspectiveFactory.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/perspective/XMLPerspectiveFactory.java
new file mode 100644
index 0000000..93f579c
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/perspective/XMLPerspectiveFactory.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2010 Standards for Technology in Automotive Retail
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     David Carver - bug 213883 - initial api 
+ *     IBM Corporation - bug 271619 - Move and rename XML perspective definition
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.ui.internal.perspective;
+
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.xml.ui.internal.IProductConstants;
+import org.eclipse.wst.xml.ui.internal.ProductProperties;
+
+
+/**
+ * @author dcarver
+ * 
+ */
+public class XMLPerspectiveFactory implements IPerspectiveFactory {
+
+//	private static final String SEARCH_VIEW_ID = "org.eclipse.search.ui.views.SearchView"; //$NON-NLS-1$
+//	private static final String XPATH_VIEW_ID = "org.eclipse.wst.xml.views.XPathView"; //$NON-NLS-1$
+//	private static final String SNIPPETS_VIEW_ID = "org.eclipse.wst.common.snippets.internal.ui.SnippetsView"; //$NON-NLS-1$
+//	private static final String TEXTEDITOR_TEMPLATES_VIEW_ID = "org.eclipse.ui.texteditor.TemplatesView"; //$NON-NLS-1$
+//	private static final String ID_CONSOLE_VIEW = "org.eclipse.ui.console.ConsoleView"; //$NON-NLS-1$
+
+	private static String HIERARCHY_VIEW_ID = "org.eclipse.ui.navigator.ProjectExplorer"; //$NON-NLS-1$
+
+	public XMLPerspectiveFactory() {
+		String viewerID = ProductProperties.getProperty(IProductConstants.PERSPECTIVE_EXPLORER_VIEW);
+		if (viewerID != null) {
+			// verify that the view actually exists
+			if (PlatformUI.getWorkbench().getViewRegistry().find(viewerID) != null){
+				HIERARCHY_VIEW_ID = viewerID;
+			}
+		}
+	}
+	/**
+	 * Creates the initial layout. This is what the layout is reset to when
+	 * the Reset Perspective is selected. It takes as input a IPageLayout
+	 * object.
+	 * 
+	 * @param layout
+	 */
+	public void createInitialLayout(IPageLayout layout) {
+		// Get the Editor Area
+//		String editorArea = layout.getEditorArea();
+
+		// Turn on the Editor Area
+		layout.setEditorAreaVisible(true);
+		layout.setFixed(false);
+
+		layout.addShowViewShortcut(HIERARCHY_VIEW_ID);
+
+		IFolderLayout topLeft = layout.createFolder("topLeft", IPageLayout.LEFT, 0.23f, layout.getEditorArea());//$NON-NLS-1$
+		topLeft.addView(HIERARCHY_VIEW_ID);
+
+		// Create the areas of the layout with their initial views
+//		IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT, (float) 0.23, editorArea); //$NON-NLS-1$
+//		left.addView(IPageLayout.ID_PROJECT_EXPLORER);
+//
+//		IFolderLayout bottomLeft = layout.createFolder("bottom-left", IPageLayout.BOTTOM, (float) 0.50, "left"); //$NON-NLS-1$ //$NON-NLS-2$
+//		bottomLeft.addView(XPATH_VIEW_ID); //$NON-NLS-1$
+//
+//		IFolderLayout right = layout.createFolder("right", IPageLayout.RIGHT, (float) 0.70, editorArea); //$NON-NLS-1$
+//		right.addView(IPageLayout.ID_OUTLINE);
+//		
+//		IFolderLayout bottomRight = layout.createFolder("bottom-right", IPageLayout.BOTTOM, (float) 0.60, "right"); //$NON-NLS-1$//$NON-NLS-2$
+//		bottomRight.addView(TEXTEDITOR_TEMPLATES_VIEW_ID);
+//
+//		IFolderLayout bottom = layout.createFolder("bottom", IPageLayout.BOTTOM, (float) 0.75, editorArea); //$NON-NLS-1$
+//		bottom.addView(IPageLayout.ID_PROBLEM_VIEW);
+//		bottom.addView(IPageLayout.ID_PROP_SHEET);
+//		bottom.addView(ID_CONSOLE_VIEW);
+//		bottom.addView(SNIPPETS_VIEW_ID);
+//
+//		bottom.addPlaceholder(SEARCH_VIEW_ID);
+	}
+	
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/EncodingSettings.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/EncodingSettings.java
index e2bbd57..16fa130 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/EncodingSettings.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/EncodingSettings.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -167,6 +167,7 @@
 		data.widthHint = width;
 		text.setLayoutData(data);
 
+		text.setBackground(text.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
 		return text;
 	}
 
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLCompletionProposalCategoriesConfiguration.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLCompletionProposalCategoriesConfiguration.java
new file mode 100644
index 0000000..92a7ccc
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLCompletionProposalCategoriesConfiguration.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration;
+import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
+
+/**
+ * <p>The readable and writable completion proposal categories configuration
+ * for the XML content type</p>
+ */
+public class XMLCompletionProposalCategoriesConfiguration extends AbstractCompletionProposalCategoriesConfiguration {
+
+	/** the ID of the preference page where users can change the preferences */
+	private static final String PREFERENCES_PAGE_ID = "org.eclipse.wst.sse.ui.preferences.xml.contentassist"; //$NON-NLS-1$
+	
+	/**
+	 * <p>Creates the configuration</p>
+	 */
+	public XMLCompletionProposalCategoriesConfiguration() {
+		//nothing to do.
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getPreferenceStore()
+	 */
+	protected IPreferenceStore getPreferenceStore() {
+		return XMLUIPlugin.getDefault().getPreferenceStore();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#hasAssociatedPropertiesPage()
+	 */
+	public boolean hasAssociatedPropertiesPage() {
+		return true;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter#getPropertiesPageID()
+	 */
+	public String getPropertiesPageID() {
+		return PREFERENCES_PAGE_ID;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnDefaultPagePrefKey()
+	 */
+	protected String getShouldNotDisplayOnDefaultPagePrefKey() {
+		return XMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getShouldNotDisplayOnOwnPagePrefKey()
+	 */
+	protected String getShouldNotDisplayOnOwnPagePrefKey() {
+		return XMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getPageSortOrderPrefKey()
+	 */
+	protected String getPageSortOrderPrefKey() {
+		return XMLUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.preferences.AbstractCompletionProposalCategoriesConfiguration#getDefaultPageSortOrderPrefKey()
+	 */
+	protected String getDefaultPageSortOrderPrefKey() {
+		return XMLUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER;
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLContentAssistPreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLContentAssistPreferencePage.java
new file mode 100644
index 0000000..3e9ec27
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLContentAssistPreferencePage.java
@@ -0,0 +1,256 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal.preferences;
+
+import java.util.Vector;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.wst.sse.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.internal.contentassist.CompletionProposoalCatigoriesConfigurationRegistry;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
+import org.eclipse.wst.sse.ui.preferences.CodeAssistCyclingConfigurationBlock;
+import org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
+import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
+
+/**
+ * <p>Defines the preference page for allowing the user to change the content
+ * assist preferences</p>
+ */
+public class XMLContentAssistPreferencePage extends AbstractPreferencePage implements
+		IWorkbenchPreferencePage {
+
+	private static final String XML_CONTENT_TYPE_ID = "org.eclipse.core.runtime.xml"; //$NON-NLS-1$
+	
+	// Auto Activation
+	private Button fAutoPropose;
+	private Label fAutoProposeLabel;
+	private Text fAutoProposeText;
+	private Combo fSuggestionStrategyCombo;
+	private Vector fSuggestionStrategies = null;
+	
+	/** configuration block for changing preference having to do with the content assist categories */
+	private CodeAssistCyclingConfigurationBlock fConfigurationBlock;
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+	 */
+	protected Control createContents(Composite parent) {
+		final Composite composite = super.createComposite(parent, 1);
+		
+		createContentsForAutoActivationGroup(composite);
+		createContentsForCyclingGroup(composite);
+		
+		setSize(composite);
+		loadPreferences();
+		
+		return composite;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#performDefaults()
+	 */
+	protected void performDefaults() {
+		performDefaultsForAutoActivationGroup();
+		performDefaultsForCyclingGroup();
+
+		validateValues();
+		enableValues();
+
+		super.performDefaults();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#initializeValues()
+	 */
+	protected void initializeValues() {
+		initializeValuesForAutoActivationGroup();
+		initializeValuesForCyclingGroup();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#storeValues()
+	 */
+	protected void storeValues() {
+		storeValuesForAutoActivationGroup();
+		storeValuesForCyclingGroup();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage#enableValues()
+	 */
+	protected void enableValues() {
+		if (fAutoPropose != null) {
+			if (fAutoPropose.getSelection()) {
+				fAutoProposeLabel.setEnabled(true);
+				fAutoProposeText.setEnabled(true);
+			}
+			else {
+				fAutoProposeLabel.setEnabled(false);
+				fAutoProposeText.setEnabled(false);
+			}
+		}
+	}
+	
+	/**
+	 * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
+	 */
+	protected IPreferenceStore doGetPreferenceStore() {
+		return XMLUIPlugin.getDefault().getPreferenceStore();
+	}
+
+	/**
+	 * <p>Create contents for the auto activation preference group</p>
+	 * @param parent {@link Composite} parent of the group
+	 */
+	private void createContentsForAutoActivationGroup(Composite parent) {
+		Group contentAssistGroup = createGroup(parent, 2);
+		contentAssistGroup.setText(XMLUIMessages.XMLContentAssistPreferencePage_Auto_Activation_UI_);
+
+		fAutoPropose = createCheckBox(contentAssistGroup, XMLUIMessages.Automatically_make_suggest_UI_);
+		((GridData) fAutoPropose.getLayoutData()).horizontalSpan = 2;
+		fAutoPropose.addSelectionListener(this);
+
+		fAutoProposeLabel = createLabel(contentAssistGroup, XMLUIMessages.Prompt_when_these_characte_UI_);
+		fAutoProposeText = createTextField(contentAssistGroup);
+
+		createLabel(contentAssistGroup, XMLUIMessages.Suggestion_Strategy);
+		fSuggestionStrategyCombo = new Combo(contentAssistGroup, SWT.READ_ONLY);
+		fSuggestionStrategies = new Vector();
+		fSuggestionStrategyCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+		fSuggestionStrategyCombo.add(XMLUIMessages.Suggestion_Strategy_Lax);
+		fSuggestionStrategies.add(XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_LAX);
+		fSuggestionStrategyCombo.add(XMLUIMessages.Suggestion_Strategy_Strict);
+		fSuggestionStrategies.add(XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_STRICT);
+	}
+	
+	/**
+	 * <p>Create the contents for the content assist cycling preference group</p>
+	 * @param parent {@link Composite} parent of the group
+	 */
+	private void createContentsForCyclingGroup(Composite parent) {
+		ICompletionProposalCategoriesConfigurationWriter configurationWriter = CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getWritableConfiguration(XML_CONTENT_TYPE_ID);
+		
+		if(configurationWriter != null) {
+			fConfigurationBlock = new CodeAssistCyclingConfigurationBlock(XML_CONTENT_TYPE_ID, configurationWriter);
+			fConfigurationBlock.createContents(parent, XMLUIMessages.XMLContentAssistPreferencePage_Cycling_UI_);
+		} else {
+			Logger.log(Logger.ERROR, "There should be an ICompletionProposalCategoriesConfigurationWriter" + //$NON-NLS-1$
+					" specified for the XML content type, but can't fine it, thus can't create user" + //$NON-NLS-1$
+					" preference block for editing proposal categories preferences."); //$NON-NLS-1$
+		}
+	}
+	
+	/**
+	 * <p>Store the values for the auto activation group</p>
+	 */
+	private void storeValuesForAutoActivationGroup() {
+		getPreferenceStore().setValue(XMLUIPreferenceNames.AUTO_PROPOSE, fAutoPropose.getSelection());
+		getPreferenceStore().setValue(XMLUIPreferenceNames.AUTO_PROPOSE_CODE, fAutoProposeText.getText());
+		getPreferenceStore().setValue(XMLUIPreferenceNames.SUGGESTION_STRATEGY, getCurrentAutoActivationSuggestionStrategy());
+	}
+	
+	/**
+	 * <p>Store the values for the cycling group</p>
+	 */
+	private void storeValuesForCyclingGroup() {
+		if (fConfigurationBlock != null) {
+			fConfigurationBlock.storeValues();
+		}
+	}
+	
+	/**
+	 * <p>Initialize the values for the auto activation group</p>
+	 */
+	private void initializeValuesForAutoActivationGroup() {
+		fAutoPropose.setSelection(getPreferenceStore().getBoolean(XMLUIPreferenceNames.AUTO_PROPOSE));
+		fAutoProposeText.setText(getPreferenceStore().getString(XMLUIPreferenceNames.AUTO_PROPOSE_CODE));
+		String suggestionStrategy = getPreferenceStore().getString(XMLUIPreferenceNames.SUGGESTION_STRATEGY);
+		if (suggestionStrategy.length() > 0) {
+			setCurrentAutoActivationSuggestionStrategy(suggestionStrategy);
+		}
+		else {
+			setCurrentAutoActivationSuggestionStrategy(XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_LAX);
+		}
+	}
+	
+	/**
+	 * <p>Initialize the values for the cycling group</p>
+	 */
+	private void initializeValuesForCyclingGroup() {
+		if(fConfigurationBlock != null) {
+			fConfigurationBlock.initializeValues();
+		}
+	}
+	
+	/**
+	 * <p>Load the defaults for the auto activation group</p>
+	 */
+	private void performDefaultsForAutoActivationGroup() {
+		fAutoPropose.setSelection(getPreferenceStore().getDefaultBoolean(XMLUIPreferenceNames.AUTO_PROPOSE));
+		fAutoProposeText.setText(getPreferenceStore().getDefaultString(XMLUIPreferenceNames.AUTO_PROPOSE_CODE));
+		String suggestionStrategy = getPreferenceStore().getDefaultString(XMLUIPreferenceNames.SUGGESTION_STRATEGY);
+		if (suggestionStrategy.length() > 0) {
+			setCurrentAutoActivationSuggestionStrategy(suggestionStrategy);
+		}
+		else {
+			setCurrentAutoActivationSuggestionStrategy(XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_LAX);
+		}
+	}
+	
+	/**
+	 * <p>Load the defaults of the cycling group</p>
+	 */
+	private void performDefaultsForCyclingGroup() {
+		if(fConfigurationBlock != null) {
+			fConfigurationBlock.performDefaults();
+		}
+	}
+	
+	/**
+	 * Return the currently selected suggestion strategy preference
+	 * 
+	 * @return a suggestion strategy constant from XMLUIPreferenceNames
+	 */
+	private String getCurrentAutoActivationSuggestionStrategy() {
+		int i = fSuggestionStrategyCombo.getSelectionIndex();
+		if (i >= 0) {
+			return (String) (fSuggestionStrategies.elementAt(i));
+		}
+		return ""; //$NON-NLS-1$
+	}
+	
+	/**
+	 * Set a suggestion strategy in suggestion strategy combo box
+	 * 
+	 * @param strategy
+	 */
+	private void setCurrentAutoActivationSuggestionStrategy(String strategy) {
+		// Clear the current selection.
+		fSuggestionStrategyCombo.clearSelection();
+		fSuggestionStrategyCombo.deselectAll();
+
+		int i = fSuggestionStrategies.indexOf(strategy);
+		if (i >= 0) {
+			fSuggestionStrategyCombo.select(i);
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLFilesPreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLFilesPreferencePage.java
index 0f3cc0e..8a19fca 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLFilesPreferencePage.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLFilesPreferencePage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,8 +8,6 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
- *     David Carver - STAR - [205989] - [validation] validate XML after XInclude resolution
- *     
  *******************************************************************************/
 package org.eclipse.wst.xml.ui.internal.preferences;
 
@@ -22,11 +20,7 @@
 import org.eclipse.core.runtime.Preferences;
 import org.eclipse.core.runtime.content.IContentType;
 import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
@@ -34,7 +28,6 @@
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.utils.StringUtils;
 import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
 import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
 import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
@@ -45,31 +38,13 @@
 public class XMLFilesPreferencePage extends AbstractPreferencePage {
 	protected EncodingSettings fEncodingSettings = null;
 
-	private Combo fDefaultSuffix = null;
-	private List fValidExtensions = null;
-	private Combo fIndicateNoGrammar = null;
-	private Button fUseXinclude = null;
-
-	/**
-	 * @param parent 
-	 * @return
-	 */
-	private Combo createCombo(Composite parent, String[] items) {
-		Combo combo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
-		combo.setItems(items);
-
-		//GridData
-		GridData data = new GridData(SWT.FILL, SWT.CENTER, true, true);
-		combo.setLayoutData(data);
-
-		return combo;
-	}
+	private Combo fDefaultSuffix;
+	private List fValidExtensions;
 
 	protected Control createContents(Composite parent) {
 		Composite composite = (Composite) super.createContents(parent);
 		PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.XML_PREFWEBX_FILES_HELPID);
 		createContentsForCreatingGroup(composite);
-		createContentsForValidatingGroup(composite);
 
 		setSize(composite);
 		loadPreferences();
@@ -95,22 +70,6 @@
 		((GridData) fEncodingSettings.getLayoutData()).horizontalSpan = 2;
 	}
 
-	protected void createContentsForValidatingGroup(Composite parent) {
-		Group validatingGroup = createGroup(parent, 2);
-		((GridLayout) validatingGroup.getLayout()).makeColumnsEqualWidth = false;
-		validatingGroup.setText(XMLUIMessages.Validating_files);
-
-		if (fIndicateNoGrammar == null) {
-			createLabel(validatingGroup, XMLUIMessages.Indicate_no_grammar_specified);
-			fIndicateNoGrammar = createCombo(validatingGroup, StringUtils.unpack(XMLUIMessages.Indicate_no_grammar_specified_severities));
-		}
-		if (fUseXinclude == null) {
-			fUseXinclude = createCheckBox(validatingGroup, XMLUIMessages.Use_XInclude);
-		}
-		
-		new Label(validatingGroup, SWT.NONE).setLayoutData(new GridData());
-	}
-
 	public void dispose() {
 		fDefaultSuffix.removeModifyListener(this);
 		super.dispose();
@@ -153,7 +112,6 @@
 
 	protected void initializeValues() {
 		initializeValuesForCreatingGroup();
-		initializeValuesForValidatingGroup();
 	}
 
 	protected void initializeValuesForCreatingGroup() {
@@ -165,22 +123,8 @@
 		fEncodingSettings.setIANATag(encoding);
 	}
 
-	protected void initializeValuesForValidatingGroup() {
-		int indicateNoGrammarButtonSelected = getModelPreferences().getInt(XMLCorePreferenceNames.INDICATE_NO_GRAMMAR);
-		boolean useXIncludeButtonSelected = getModelPreferences().getBoolean(XMLCorePreferenceNames.USE_XINCLUDE);
-
-		if (fIndicateNoGrammar != null) {
-			fIndicateNoGrammar.select(2 - indicateNoGrammarButtonSelected);
-			fIndicateNoGrammar.setText(StringUtils.unpack(XMLUIMessages.Indicate_no_grammar_specified_severities)[2-indicateNoGrammarButtonSelected]);
-		}
-		if (fUseXinclude != null) {
-			fUseXinclude.setSelection(useXIncludeButtonSelected);
-		}
-	}
-
 	protected void performDefaults() {
 		performDefaultsForCreatingGroup();
-		performDefaultsForValidatingGroup();
 
 		super.performDefaults();
 	}
@@ -195,19 +139,6 @@
 		// fEncodingSettings.resetToDefaultEncoding();
 	}
 
-	protected void performDefaultsForValidatingGroup() {
-		int indicateNoGrammarButtonSelected = getModelPreferences().getDefaultInt(XMLCorePreferenceNames.INDICATE_NO_GRAMMAR);
-		boolean useXIncludeButtonSelected = getModelPreferences().getDefaultBoolean(XMLCorePreferenceNames.USE_XINCLUDE);
-		
-		if (fIndicateNoGrammar != null) {
-			fIndicateNoGrammar.setSelection(new Point(indicateNoGrammarButtonSelected, 2 - indicateNoGrammarButtonSelected));
-			fIndicateNoGrammar.setText(StringUtils.unpack(XMLUIMessages.Indicate_no_grammar_specified_severities)[indicateNoGrammarButtonSelected]);
-		}
-		if (fUseXinclude != null) {
-			fUseXinclude.setSelection(useXIncludeButtonSelected);
-		}
-	}
-
 	public boolean performOk() {
 		boolean result = super.performOk();
 
@@ -218,7 +149,6 @@
 
 	protected void storeValues() {
 		storeValuesForCreatingGroup();
-		storeValuesForValidatingGroup();
 	}
 
 	protected void storeValuesForCreatingGroup() {
@@ -228,17 +158,6 @@
 		getModelPreferences().setValue(CommonEncodingPreferenceNames.OUTPUT_CODESET, fEncodingSettings.getIANATag());
 	}
 
-	protected void storeValuesForValidatingGroup() {
-		if (fIndicateNoGrammar != null) {
-			int warnNoGrammarButtonSelected = 2 - fIndicateNoGrammar.getSelectionIndex();
-			getModelPreferences().setValue(XMLCorePreferenceNames.INDICATE_NO_GRAMMAR, warnNoGrammarButtonSelected);
-		}
-		if (fUseXinclude != null) {
-			boolean useXIncludeButtonSelected = fUseXinclude.getSelection();
-			getModelPreferences().setValue(XMLCorePreferenceNames.USE_XINCLUDE, useXIncludeButtonSelected);
-		}
-	}
-
 	protected void validateValues() {
 		boolean isValid = false;
 		Iterator i = getValidExtensions().iterator();
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSourcePreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSourcePreferencePage.java
index db51310..6545689 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSourcePreferencePage.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSourcePreferencePage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,8 +12,6 @@
  *******************************************************************************/
 package org.eclipse.wst.xml.ui.internal.preferences;
 
-import java.util.Vector;
-
 import org.eclipse.core.runtime.Preferences;
 import org.eclipse.jface.layout.GridDataFactory;
 import org.eclipse.jface.preference.IPreferenceStore;
@@ -21,8 +19,8 @@
 import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Group;
@@ -44,14 +42,6 @@
 	private final int MIN_INDENTATION_SIZE = 0;
 	private final int MAX_INDENTATION_SIZE = 16;
 
-	// Content Assist
-	protected Button fAutoPropose;
-	protected Label fAutoProposeLabel;
-	protected Text fAutoProposeText;
-	private Combo fSuggestionStrategyCombo;
-	private Vector fSuggestionStrategies = null;
-	protected Button fClearAllBlankLines;
-
 	// Formatting
 	protected Label fLineWidthLabel;
 	protected Text fLineWidthText;
@@ -61,8 +51,11 @@
 	private Spinner fIndentationSize;
 	private Button fPreservePCDATAContent;
 	private Button fAlignEndBracket;
+	private Button fFormatComments;
+	private Button fFormatCommentsJoinLines;
 	// BUG195264 - Support for removing/adding a space before empty close tags
 	private Button fSpaceBeforeEmptyCloseTag;
+	protected Button fClearAllBlankLines;
 
 	// grammar constraints
 	protected Button fUseInferredGrammar;
@@ -76,7 +69,6 @@
 		new Label(composite, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create());
 
 		createContentsForFormattingGroup(composite);
-		createContentsForContentAssistGroup(composite);
 		createContentsForGrammarConstraintsGroup(composite);
 		setSize(composite);
 		loadPreferences();
@@ -84,27 +76,6 @@
 		return composite;
 	}
 
-	protected void createContentsForContentAssistGroup(Composite parent) {
-		Group contentAssistGroup = createGroup(parent, 2);
-		contentAssistGroup.setText(XMLUIMessages.Content_assist_UI_);
-
-		fAutoPropose = createCheckBox(contentAssistGroup, XMLUIMessages.Automatically_make_suggest_UI_);
-		((GridData) fAutoPropose.getLayoutData()).horizontalSpan = 2;
-		fAutoPropose.addSelectionListener(this);
-
-		fAutoProposeLabel = createLabel(contentAssistGroup, XMLUIMessages.Prompt_when_these_characte_UI_);
-		fAutoProposeText = createTextField(contentAssistGroup);
-
-		createLabel(contentAssistGroup, XMLUIMessages.Suggestion_Strategy);
-		fSuggestionStrategyCombo = new Combo(contentAssistGroup, SWT.READ_ONLY);
-		fSuggestionStrategies = new Vector();
-		fSuggestionStrategyCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		fSuggestionStrategyCombo.add(XMLUIMessages.Suggestion_Strategy_Lax);
-		fSuggestionStrategies.add(XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_LAX);
-		fSuggestionStrategyCombo.add(XMLUIMessages.Suggestion_Strategy_Strict);
-		fSuggestionStrategies.add(XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_STRICT);
-	}
-
 	protected void createContentsForFormattingGroup(Composite parent) {
 		Group formattingGroup = createGroup(parent, 2);
 		formattingGroup.setText(XMLUIMessages.Formatting_UI_);
@@ -124,14 +95,28 @@
 		((GridData) fPreservePCDATAContent.getLayoutData()).horizontalSpan = 2;
 		fClearAllBlankLines = createCheckBox(formattingGroup, XMLUIMessages.Clear_all_blank_lines_UI_);
 		((GridData) fClearAllBlankLines.getLayoutData()).horizontalSpan = 2;
+		// formatting comments
+		fFormatComments = createCheckBox(formattingGroup, XMLUIMessages.Format_comments);
+		((GridData) fFormatComments.getLayoutData()).horizontalSpan = 2;
+		fFormatComments.addSelectionListener(this);
+		fFormatCommentsJoinLines = createCheckBox(formattingGroup, XMLUIMessages.Format_comments_join_lines);
+		((GridData) fFormatCommentsJoinLines.getLayoutData()).horizontalSpan = 2;
+		((GridData) fFormatCommentsJoinLines.getLayoutData()).horizontalIndent = 20;
+		// end formatting comments
 		fSpaceBeforeEmptyCloseTag = createCheckBox(formattingGroup, XMLUIMessages.Space_before_empty_close_tag);
 		((GridData) fSpaceBeforeEmptyCloseTag.getLayoutData()).horizontalSpan = 2;
-		
-		fIndentUsingTabs = createRadioButton(formattingGroup, XMLUIMessages.Indent_using_tabs);
-		((GridData) fIndentUsingTabs.getLayoutData()).horizontalSpan = 2;
 
-		fIndentUsingSpaces = createRadioButton(formattingGroup, XMLUIMessages.Indent_using_spaces);
-		((GridData) fIndentUsingSpaces.getLayoutData()).horizontalSpan = 2;
+		// [269224] - Place the indent controls in their own composite for proper tab ordering
+		Composite indentComposite = createComposite(formattingGroup, 1);
+		((GridData) indentComposite.getLayoutData()).horizontalSpan = 2;
+		((GridLayout) indentComposite.getLayout()).marginWidth = 0;
+		((GridLayout) indentComposite.getLayout()).marginHeight = 0;
+
+		fIndentUsingTabs = createRadioButton(indentComposite, XMLUIMessages.Indent_using_tabs);
+		((GridData) fIndentUsingTabs.getLayoutData()).horizontalSpan = 1;
+
+		fIndentUsingSpaces = createRadioButton(indentComposite, XMLUIMessages.Indent_using_spaces);
+		((GridData) fIndentUsingSpaces.getLayoutData()).horizontalSpan = 1;
 
 		createLabel(formattingGroup, XMLUIMessages.Indentation_size);
 		fIndentationSize = new Spinner(formattingGroup, SWT.READ_ONLY | SWT.BORDER);
@@ -163,15 +148,8 @@
 	}
 
 	protected void enableValues() {
-		if (fAutoPropose != null) {
-			if (fAutoPropose.getSelection()) {
-				fAutoProposeLabel.setEnabled(true);
-				fAutoProposeText.setEnabled(true);
-			}
-			else {
-				fAutoProposeLabel.setEnabled(false);
-				fAutoProposeText.setEnabled(false);
-			}
+		if (fFormatComments != null && fFormatCommentsJoinLines != null) {
+			fFormatCommentsJoinLines.setEnabled(fFormatComments.getSelection());
 		}
 	}
 
@@ -179,38 +157,11 @@
 		return XMLCorePlugin.getDefault().getPluginPreferences();
 	}
 
-	/**
-	 * Return the currently selected suggestion strategy preference
-	 * 
-	 * @return a suggestion strategy constant from XMLUIPreferenceNames
-	 */
-	private String getCurrentSuggestionStrategy() {
-		int i = fSuggestionStrategyCombo.getSelectionIndex();
-		if (i >= 0) {
-			return (String) (fSuggestionStrategies.elementAt(i));
-		}
-		return ""; //$NON-NLS-1$
-	}
-
 	protected void initializeValues() {
 		initializeValuesForFormattingGroup();
-		initializeValuesForContentAssistGroup();
 		initializeValuesForGrammarConstraintsGroup();
 	}
 
-	protected void initializeValuesForContentAssistGroup() {
-		// Content Assist
-		fAutoPropose.setSelection(getPreferenceStore().getBoolean(XMLUIPreferenceNames.AUTO_PROPOSE));
-		fAutoProposeText.setText(getPreferenceStore().getString(XMLUIPreferenceNames.AUTO_PROPOSE_CODE));
-		String suggestionStrategy = getPreferenceStore().getString(XMLUIPreferenceNames.SUGGESTION_STRATEGY);
-		if (suggestionStrategy.length() > 0) {
-			setCurrentSuggestionStrategy(suggestionStrategy);
-		}
-		else {
-			setCurrentSuggestionStrategy(XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_LAX);
-		}
-	}
-
 	protected void initializeValuesForFormattingGroup() {
 		// Formatting
 		fLineWidthText.setText(getModelPreferences().getString(XMLCorePreferenceNames.LINE_WIDTH));
@@ -219,7 +170,9 @@
 		fClearAllBlankLines.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
 		fPreservePCDATAContent.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.PRESERVE_CDATACONTENT));
 		fSpaceBeforeEmptyCloseTag.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.SPACE_BEFORE_EMPTY_CLOSE_TAG));
-		
+		fFormatComments.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.FORMAT_COMMENT_TEXT));
+		fFormatCommentsJoinLines.setSelection(getModelPreferences().getBoolean(XMLCorePreferenceNames.FORMAT_COMMENT_JOIN_LINES));
+
 		if (XMLCorePreferenceNames.TAB.equals(getModelPreferences().getString(XMLCorePreferenceNames.INDENTATION_CHAR))) {
 			fIndentUsingTabs.setSelection(true);
 			fIndentUsingSpaces.setSelection(false);
@@ -238,7 +191,6 @@
 
 	protected void performDefaults() {
 		performDefaultsForFormattingGroup();
-		performDefaultsForContentAssistGroup();
 		performDefaultsForGrammarConstraintsGroup();
 
 		validateValues();
@@ -247,19 +199,6 @@
 		super.performDefaults();
 	}
 
-	protected void performDefaultsForContentAssistGroup() {
-		// Content Assist
-		fAutoPropose.setSelection(getPreferenceStore().getDefaultBoolean(XMLUIPreferenceNames.AUTO_PROPOSE));
-		fAutoProposeText.setText(getPreferenceStore().getDefaultString(XMLUIPreferenceNames.AUTO_PROPOSE_CODE));
-		String suggestionStrategy = getPreferenceStore().getDefaultString(XMLUIPreferenceNames.SUGGESTION_STRATEGY);
-		if (suggestionStrategy.length() > 0) {
-			setCurrentSuggestionStrategy(suggestionStrategy);
-		}
-		else {
-			setCurrentSuggestionStrategy(XMLUIPreferenceNames.SUGGESTION_STRATEGY_VALUE_LAX);
-		}
-	}
-
 	protected void performDefaultsForFormattingGroup() {
 		// Formatting
 		fLineWidthText.setText(getModelPreferences().getDefaultString(XMLCorePreferenceNames.LINE_WIDTH));
@@ -269,7 +208,9 @@
 		fPreservePCDATAContent.setSelection(getModelPreferences().getDefaultBoolean(XMLCorePreferenceNames.PRESERVE_CDATACONTENT));
 		// BUG195264 - Support for removing/adding a space before empty close tags
 		fSpaceBeforeEmptyCloseTag.setSelection(getModelPreferences().getDefaultBoolean(XMLCorePreferenceNames.SPACE_BEFORE_EMPTY_CLOSE_TAG));
-		
+		fFormatComments.setSelection(getModelPreferences().getDefaultBoolean(XMLCorePreferenceNames.FORMAT_COMMENT_TEXT));
+		fFormatCommentsJoinLines.setSelection(getModelPreferences().getDefaultBoolean(XMLCorePreferenceNames.FORMAT_COMMENT_JOIN_LINES));
+
 		if (XMLCorePreferenceNames.TAB.equals(getModelPreferences().getDefaultString(XMLCorePreferenceNames.INDENTATION_CHAR))) {
 			fIndentUsingTabs.setSelection(true);
 			fIndentUsingSpaces.setSelection(false);
@@ -293,35 +234,11 @@
 		return result;
 	}
 
-	/**
-	 * Set a suggestion strategy in suggestion strategy combo box
-	 * 
-	 * @param strategy
-	 */
-	private void setCurrentSuggestionStrategy(String strategy) {
-		// Clear the current selection.
-		fSuggestionStrategyCombo.clearSelection();
-		fSuggestionStrategyCombo.deselectAll();
-
-		int i = fSuggestionStrategies.indexOf(strategy);
-		if (i >= 0) {
-			fSuggestionStrategyCombo.select(i);
-		}
-	}
-
 	protected void storeValues() {
 		storeValuesForFormattingGroup();
-		storeValuesForContentAssistGroup();
 		storeValuesForGrammarConstraintsGroup();
 	}
 
-	protected void storeValuesForContentAssistGroup() {
-		// Content Assist
-		getPreferenceStore().setValue(XMLUIPreferenceNames.AUTO_PROPOSE, fAutoPropose.getSelection());
-		getPreferenceStore().setValue(XMLUIPreferenceNames.AUTO_PROPOSE_CODE, fAutoProposeText.getText());
-		getPreferenceStore().setValue(XMLUIPreferenceNames.SUGGESTION_STRATEGY, getCurrentSuggestionStrategy());
-	}
-
 	protected void storeValuesForFormattingGroup() {
 		// Formatting
 		getModelPreferences().setValue(XMLCorePreferenceNames.LINE_WIDTH, fLineWidthText.getText());
@@ -331,7 +248,9 @@
 		getModelPreferences().setValue(XMLCorePreferenceNames.PRESERVE_CDATACONTENT, fPreservePCDATAContent.getSelection());
 		// BUG195264 - Support for removing/adding a space before empty close tags
 		getModelPreferences().setValue(XMLCorePreferenceNames.SPACE_BEFORE_EMPTY_CLOSE_TAG, fSpaceBeforeEmptyCloseTag.getSelection());
-		
+		getModelPreferences().setValue(XMLCorePreferenceNames.FORMAT_COMMENT_TEXT, fFormatComments.getSelection());
+		getModelPreferences().setValue(XMLCorePreferenceNames.FORMAT_COMMENT_JOIN_LINES, fFormatCommentsJoinLines.getSelection());
+
 		if (fIndentUsingTabs.getSelection()) {
 			getModelPreferences().setValue(XMLCorePreferenceNames.INDENTATION_CHAR, XMLCorePreferenceNames.TAB);
 		}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSyntaxColoringPage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSyntaxColoringPage.java
index 644fef2..245f0ab 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSyntaxColoringPage.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSyntaxColoringPage.java
@@ -671,6 +671,7 @@
 			styles.add(IStyleConstantsXML.TAG_BORDER);
 			styles.add(IStyleConstantsXML.TAG_NAME);
 			styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
+			styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
 			styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
 			styles.add(IStyleConstantsXML.COMMENT_BORDER);
 			styles.add(IStyleConstantsXML.COMMENT_TEXT);
@@ -772,6 +773,7 @@
 		fContextToStyleMap.put(DOMRegionContext.XML_END_TAG_OPEN, IStyleConstantsXML.TAG_BORDER);
 		fContextToStyleMap.put(DOMRegionContext.XML_TAG_NAME, IStyleConstantsXML.TAG_NAME);
 		fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
+		fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS, IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
 		fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
 		fContextToStyleMap.put(DOMRegionContext.XML_TAG_CLOSE, IStyleConstantsXML.TAG_BORDER);
 		fContextToStyleMap.put(DOMRegionContext.XML_EMPTY_TAG_CLOSE, IStyleConstantsXML.TAG_BORDER);
@@ -814,6 +816,7 @@
 		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_BORDER, XMLUIMessages.Tag_Delimiters_UI_);
 		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_NAME, XMLUIMessages.Tag_Names_UI_);
 		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, XMLUIMessages.Attribute_Names_UI_);
+		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS, XMLUIMessages.Attribute_Equals_UI_);
 		fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, XMLUIMessages.Attribute_Values_UI_);
 		fStyleToDescriptionMap.put(IStyleConstantsXML.DECL_BORDER, XMLUIMessages.Declaration_Delimiters_UI_);
 		fStyleToDescriptionMap.put(IStyleConstantsXML.XML_CONTENT, XMLUIMessages.Content_UI_);
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTemplatePreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTemplatePreferencePage.java
index 810b599..ed6dea5 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTemplatePreferencePage.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTemplatePreferencePage.java
@@ -116,7 +116,7 @@
 		SourceViewer viewer = null;
 		String contentTypeID = ContentTypeIdForXML.ContentTypeID_XML;
 		viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
-		((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+		viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
 		IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(contentTypeID);
 		IDocument document = scratchModel.getStructuredDocument();
 		viewer.configure(viewerConfiguration);
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTypingPreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTypingPreferencePage.java
index a30a7dd..8487ab2 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTypingPreferencePage.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTypingPreferencePage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -28,11 +28,16 @@
 	private Button fCloseComment;
 	private Button fCloseEndTag;
 	private Button fRemoveEndTag;
-	
+	private Button fCloseElement;
+	private Button fCloseStrings;
+	private Button fCloseBrackets;
+
 	protected Control createContents(Composite parent) {
 		Composite composite = super.createComposite(parent, 1);
 		PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.XML_PREFWEBX_FILES_HELPID);
-		
+
+		createStartTagGroup(composite);
+		createEndTagGroup(composite);
 		createAutoComplete(composite);
 		createAutoRemove(composite);
 		
@@ -42,6 +47,24 @@
 		return composite;
 	}
 	
+	private void createStartTagGroup(Composite parent) {
+		Group group = createGroup(parent, 2);
+
+		group.setText(XMLUIMessages.XMLTyping_Start_Tag);
+
+		fCloseElement = createCheckBox(group, XMLUIMessages.XMLTyping_Complete_Elements);
+		((GridData) fCloseElement.getLayoutData()).horizontalSpan = 2;
+	}
+	
+	private void createEndTagGroup(Composite parent) {
+		Group group = createGroup(parent, 2);
+
+		group.setText(XMLUIMessages.XMLTyping_End_Tag);
+
+		fCloseEndTag = createCheckBox(group, XMLUIMessages.XMLTyping_Complete_End_Tags);
+		((GridData) fCloseEndTag.getLayoutData()).horizontalSpan = 2;
+	}
+	
 	private void createAutoComplete(Composite parent) {
 		Group group = createGroup(parent, 2);
 		
@@ -49,10 +72,12 @@
 		
 		fCloseComment = createCheckBox(group, XMLUIMessages.XMLTyping_Complete_Comments);
 		((GridData) fCloseComment.getLayoutData()).horizontalSpan = 2;
-		
-		fCloseEndTag = createCheckBox(group, XMLUIMessages.XMLTyping_Complete_End_Tags);
-		((GridData) fCloseEndTag.getLayoutData()).horizontalSpan = 2;
-		
+
+		fCloseStrings = createCheckBox(group, XMLUIMessages.XMLTyping_Close_Strings);
+		((GridData) fCloseStrings.getLayoutData()).horizontalSpan = 2;
+
+		fCloseBrackets = createCheckBox(group, XMLUIMessages.XMLTyping_Close_Brackets);
+		((GridData) fCloseBrackets.getLayoutData()).horizontalSpan = 2;
 	}
 	
 	private void createAutoRemove(Composite parent) {
@@ -75,29 +100,28 @@
 	protected void initializeValues() {
 		initCheckbox(fCloseComment, XMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS);
 		initCheckbox(fCloseEndTag, XMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS);
+		initCheckbox(fCloseElement, XMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS);
 		initCheckbox(fRemoveEndTag, XMLUIPreferenceNames.TYPING_REMOVE_END_TAGS);
+		initCheckbox(fCloseStrings, XMLUIPreferenceNames.TYPING_CLOSE_STRINGS);
+		initCheckbox(fCloseBrackets, XMLUIPreferenceNames.TYPING_CLOSE_BRACKETS);
 	}
 	
 	protected void performDefaults() {
 		defaultCheckbox(fCloseComment, XMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS);
 		defaultCheckbox(fCloseEndTag, XMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS);
+		defaultCheckbox(fCloseElement, XMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS);
 		defaultCheckbox(fRemoveEndTag, XMLUIPreferenceNames.TYPING_REMOVE_END_TAGS);
-	}
-	
-	private void initCheckbox(Button box, String key) {
-		if(box != null && key != null)
-			box.setSelection(getPreferenceStore().getBoolean(key));
-	}
-	
-	private void defaultCheckbox(Button box, String key) {
-		if(box != null && key != null)
-			box.setSelection(getPreferenceStore().getDefaultBoolean(key));
+		defaultCheckbox(fCloseStrings, XMLUIPreferenceNames.TYPING_CLOSE_STRINGS);
+		defaultCheckbox(fCloseBrackets, XMLUIPreferenceNames.TYPING_CLOSE_BRACKETS);
 	}
 	
 	protected void storeValues() {
 		getPreferenceStore().setValue(XMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS, (fCloseComment != null) ? fCloseComment.getSelection() : false);
 		getPreferenceStore().setValue(XMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS, (fCloseEndTag != null) ? fCloseEndTag.getSelection() : false);
+		getPreferenceStore().setValue(XMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS, (fCloseElement != null) ? fCloseElement.getSelection() : false);
 		getPreferenceStore().setValue(XMLUIPreferenceNames.TYPING_REMOVE_END_TAGS, (fRemoveEndTag != null) ? fRemoveEndTag.getSelection() : false);
+		getPreferenceStore().setValue(XMLUIPreferenceNames.TYPING_CLOSE_STRINGS, (fCloseStrings != null) ? fCloseStrings.getSelection() : false);
+		getPreferenceStore().setValue(XMLUIPreferenceNames.TYPING_CLOSE_BRACKETS, (fCloseBrackets != null) ? fCloseBrackets.getSelection() : false);
 	}
 	
 	protected IPreferenceStore doGetPreferenceStore() {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceInitializer.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceInitializer.java
index 80ac7a4..7632e6b 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceInitializer.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceInitializer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,7 +14,8 @@
 
 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
 import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.resource.ColorRegistry;
+import org.eclipse.ui.PlatformUI;
 import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
 import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
 import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
@@ -31,6 +32,7 @@
 	 */
 	public void initializeDefaultPreferences() {
 		IPreferenceStore store = XMLUIPlugin.getDefault().getPreferenceStore();
+		ColorRegistry registry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
 
 		store.setDefault(XMLUIPreferenceNames.AUTO_PROPOSE, true);
 		store.setDefault(XMLUIPreferenceNames.AUTO_PROPOSE_CODE, "<=:"); //$NON-NLS-1$
@@ -41,92 +43,85 @@
 		// XML Style Preferences
 		String NOBACKGROUNDBOLD = " | null | false"; //$NON-NLS-1$
 		String JUSTITALIC = " | null | false | true"; //$NON-NLS-1$
-		String styleValue = ColorHelper.getColorString(127, 0, 127) + NOBACKGROUNDBOLD;
+		String styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_ATTRIBUTE_NAME, 127, 0, 127) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, styleValue);
 
-		styleValue = ColorHelper.getColorString(42, 0, 255) + JUSTITALIC;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, 42, 0, 255) + JUSTITALIC;
 		store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, styleValue);
 
 		styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
 		store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS, styleValue); // specified
-		// value
-		// is
-		// black;
-		// leaving
-		// as
-		// widget
-		// default
+		// value is black; leaving as widget default
 
-		styleValue = ColorHelper.getColorString(63, 95, 191) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.COMMENT_BORDER, 63, 95, 191) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.COMMENT_BORDER, styleValue);
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.COMMENT_TEXT, 63, 95, 191) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.COMMENT_TEXT, styleValue);
 
-		styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DECL_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.DECL_BORDER, styleValue);
 
-		styleValue = ColorHelper.getColorString(0, 0, 128) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_NAME, 0, 0, 128) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.DOCTYPE_NAME, styleValue);
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF, 0, 0, 128) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF, styleValue);
 
-		styleValue = ColorHelper.getColorString(128, 128, 128) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, 128, 128, 128) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, styleValue);
 
-		styleValue = ColorHelper.getColorString(63, 127, 95) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF, 63, 127, 95) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF, styleValue);
 
 		styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
 		store.setDefault(IStyleConstantsXML.XML_CONTENT, styleValue); // specified
-		// value
-		// is
-		// black;
-		// leaving
-		// as
-		// widget
-		// default
+		// value is black; leaving as widget default
 
-		styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.TAG_BORDER, styleValue);
 
-		styleValue = ColorHelper.getColorString(63, 127, 127) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_NAME, 63, 127, 127) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.TAG_NAME, styleValue);
 
-		styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.PI_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.PI_BORDER, styleValue);
 
 		styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
 		store.setDefault(IStyleConstantsXML.PI_CONTENT, styleValue); // specified
-		// value
-		// is
-		// black;
-		// leaving
-		// as
-		// widget
-		// default
+		// value is black; leaving as widget default
 
-		styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.CDATA_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.CDATA_BORDER, styleValue);
 
-		styleValue = ColorHelper.getColorString(0, 0, 0) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.CDATA_TEXT, 0, 0, 0) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.CDATA_TEXT, styleValue);
 
-		styleValue = ColorHelper.getColorString(42, 0, 255) + NOBACKGROUNDBOLD;
+		styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.ENTITY_REFERENCE, 42, 0, 255) + NOBACKGROUNDBOLD;
 		store.setDefault(IStyleConstantsXML.ENTITY_REFERENCE, styleValue);
 		
 		// set default new xml file template to use in new file wizard
 		/*
 		 * Need to find template name that goes with default template id (name
-		 * may change for differnt language)
+		 * may change for different language)
 		 */
-		String templateName = ""; //$NON-NLS-1$
-		Template template = XMLUIPlugin.getDefault().getTemplateStore().findTemplateById("org.eclipse.wst.xml.ui.internal.templates.xmldeclaration"); //$NON-NLS-1$
-		if (template != null)
-			templateName = template.getName();
-		store.setDefault(XMLUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
+		store.setDefault(XMLUIPreferenceNames.NEW_FILE_TEMPLATE_ID, "org.eclipse.wst.xml.ui.internal.templates.xmldeclaration"); //$NON-NLS-1$
 		
 		// Defaults for the Typing preference page
 		store.setDefault(XMLUIPreferenceNames.TYPING_COMPLETE_COMMENTS, true);
 		store.setDefault(XMLUIPreferenceNames.TYPING_COMPLETE_END_TAGS, true);
+		store.setDefault(XMLUIPreferenceNames.TYPING_COMPLETE_ELEMENTS, true);
 		store.setDefault(XMLUIPreferenceNames.TYPING_REMOVE_END_TAGS, true);
+		store.setDefault(XMLUIPreferenceNames.TYPING_CLOSE_STRINGS, true);
+		store.setDefault(XMLUIPreferenceNames.TYPING_CLOSE_BRACKETS, true);
+		
+		// Defaults for Content Assist preference page
+		store.setDefault(XMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE, "");
+		store.setDefault(XMLUIPreferenceNames.CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE, "");
+		store.setDefault(XMLUIPreferenceNames.CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER,
+				"org.eclipse.wst.xml.ui.proposalCategory.xmlTags\0" +
+				"org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates");
+		store.setDefault(XMLUIPreferenceNames.CONTENT_ASSIST_OWN_PAGE_SORT_ORDER,
+				"org.eclipse.wst.xml.ui.proposalCategory.xmlTemplates\0"+ 
+				"org.eclipse.wst.xml.ui.proposalCategory.xmlTags");
 	}
 
 }
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceNames.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceNames.java
index d71a7a3..f537341 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceNames.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceNames.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -65,6 +65,21 @@
 	 */
 	public static final String USE_INFERRED_GRAMMAR = getUseInferredGrammarKey();
 
+	public static class OUTLINE_BEHAVIOR {
+		public static final String ELEMENT_NODE = "outline-behavior.element-node"; //$NON-NLS-1$
+		public static final String ATTRIBUTE_NODE = "outline-behavior.attribute-node"; //$NON-NLS-1$
+		public static final String TEXT_NODE = "outline-behavior.text-node"; //$NON-NLS-1$
+		public static final String CDATA_SECTION_NODE = "outline-behavior.cdata-section-node"; //$NON-NLS-1$
+		public static final String ENTITY_REFERENCE_NODE = "outline-behavior.entity-reference-node"; //$NON-NLS-1$
+		public static final String ENTITY_NODE = "outline-behavior.entity-node"; //$NON-NLS-1$
+		public static final String PROCESSING_INSTRUCTION_NODE = "outline-behavior.instruction-node"; //$NON-NLS-1$
+		public static final String COMMENT_NODE = "outline-behavior.comment-node"; //$NON-NLS-1$
+		public static final String DOCUMENT_NODE = "outline-behavior.document-node"; //$NON-NLS-1$
+		public static final String DOCUMENT_TYPE_NODE = "outline-behavior.document-type-node"; //$NON-NLS-1$
+		public static final String DOCUMENT_FRAGMENT_NODE = "outline-behavior.document-fragment-node"; //$NON-NLS-1$
+		public static final String NOTATION_NODE = "outline-behavior.notation-node"; //$NON-NLS-1$
+	}
+	
 	private static String getUseInferredGrammarKey() {
 		return "useInferredGrammar"; //$NON-NLS-1$
 	}
@@ -92,7 +107,13 @@
 	 * </p>
 	 */
 	public static final String NEW_FILE_TEMPLATE_NAME = "newFileTemplateName"; //$NON-NLS-1$
-	
+
+	/**
+	 * The initial template ID to be used in the new XML file wizard. In the absence
+	 * of {@link NEW_FILE_TEMPLATE_NAME}, this ID is used to find a template name
+	 */
+	public static final String NEW_FILE_TEMPLATE_ID = "newFileTemplateId"; //$NON-NLS-1$
+
 	/**
 	 * The key to store the option for auto-completing comments while
 	 * typing.
@@ -112,6 +133,15 @@
 	public static final String TYPING_COMPLETE_END_TAGS = "completeEndTags"; //$NON-NLS-1$
 	
 	/**
+	 * The key to store the option for auto-completing the element after entering
+	 * <code>&gt;</code>
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_COMPLETE_ELEMENTS = "completeElements"; //$NON-NLS-1$
+	
+	/**
 	 * The key to store the option for removing an end-tag if the start tag is
 	 * converted to an empty-tag.
 	 * <p>
@@ -119,4 +149,58 @@
 	 * </p>
 	 */
 	public static final String TYPING_REMOVE_END_TAGS = "removeEndTags"; //$NON-NLS-1$
+
+	/**
+	 * The key to store the option for auto-completing strings (" and ') while
+	 * typing.
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_CLOSE_STRINGS = "closeStrings"; //$NON-NLS-1$
+
+	/**
+	 * The key to store the option for auto-completing brackets ([ and () while
+	 * typing.
+	 * <p>
+	 * Value is of type <code>boolean</code>.
+	 * </p>
+	 */
+	public static final String TYPING_CLOSE_BRACKETS = "closeBrackets"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key used for saving which categories should not display on the default page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>), ordered is ignored</p>
+	 */
+	public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_DEFAULT_PAGE = "xml_content_assist_display_on_default_page"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key used for saving which categories should not display on their own page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>), order is ignored</p>
+	 */
+	public static final String CONTENT_ASSIST_DO_NOT_DISPLAY_ON_OWN_PAGE = "xml_content_assist_display_on_own_page"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key for saving the sort order of the categories when displaying them on their own page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>) in the desired sort order.</p>
+	 */
+	public static final String CONTENT_ASSIST_OWN_PAGE_SORT_ORDER= "xml_content_assist_own_page_sort_order"; //$NON-NLS-1$
+	
+	/**
+	 * <p>preference key for saving the sort order of the categories when displaying them on the default page</p>
+	 * 
+	 * <p>Value is of type {@link String} consisting of
+	 * <tt>org.eclipse.wst.sse.ui.completionProposal/proposalCategory/@id</tt>s separated by the null
+	 * character (<tt>\0</tt>) in the desired sort order.</p>
+	 */
+	public static final String CONTENT_ASSIST_DEFAULT_PAGE_SORT_ORDER= "xml_content_assist_default_page_sort_order"; //$NON-NLS-1$
 }
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLValidatorPreferencePage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLValidatorPreferencePage.java
new file mode 100644
index 0000000..155bdaa
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLValidatorPreferencePage.java
@@ -0,0 +1,518 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     David Carver - STAR - [205989] - [validation] validate XML after XInclude resolution
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.ui.internal.preferences;
+
+
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jface.dialogs.ControlEnableState;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
+import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
+import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
+import org.eclipse.wst.xml.ui.internal.editor.IHelpContextIds;
+
+
+public class XMLValidatorPreferencePage extends AbstractPreferencePage {
+  private Combo fIndicateNoGrammar;
+  
+  private Button fHonourAllSchemaLocations;
+
+  private Button fUseXinclude;
+  
+  private Button fExtendedMarkupValidation;
+  
+  private Combo fEmptyElementTag;
+  
+  private Combo fEndTagWithAttributes;
+  
+  private Combo fInvalidWhitespaceBeforeTagname;
+  
+  private Combo fMissingClosingBracket;
+  
+  private Combo fMissingClosingQuote;
+  
+  private Combo fMissingEndTag;
+  
+  private Combo fMissingStartTag;
+  
+  private Combo fMissingQuotes;
+  
+  private Combo fInvalidNamespaceInPI;
+  
+  private Combo fMissingTagName;
+  
+  private Combo fInvalidWhitespaceAtStart;
+
+  private Group fMarkupValidationGroup;
+  private ControlEnableState fMarkupState;
+ 
+  private static final String[] SEVERITIES = {XMLUIMessages.Indicate_no_grammar_specified_severities_error, XMLUIMessages.Indicate_no_grammar_specified_severities_warning, XMLUIMessages.Indicate_no_grammar_specified_severities_ignore};
+  private static final String[] MARKUP_SEVERITIES = {XMLUIMessages.Severity_error, XMLUIMessages.Severity_warning, XMLUIMessages.Severity_ignore};
+
+  protected Control createContents(Composite parent) {
+    Composite composite = (Composite)super.createContents(parent);
+    PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.XML_PREFWEBX_VALIDATOR_HELPID);
+    createContentsForValidatingGroup(composite);
+    createContentsForMarkupValidationGroup(composite);
+    setSize(composite);
+    loadPreferences();
+
+    return composite;
+  }
+
+  protected void createContentsForValidatingGroup(Composite parent) {
+    Group validatingGroup = createGroup(parent, 2);
+    ((GridLayout)validatingGroup.getLayout()).makeColumnsEqualWidth = false;
+    validatingGroup.setText(XMLUIMessages.Validating_files);
+
+    if (fIndicateNoGrammar == null) {
+      createLabel(validatingGroup, XMLUIMessages.Indicate_no_grammar_specified);
+      fIndicateNoGrammar = createCombo(validatingGroup, SEVERITIES);
+    }
+    if (fUseXinclude == null) {
+      fUseXinclude = createCheckBox(validatingGroup, XMLUIMessages.Use_XInclude);
+      ((GridData)fUseXinclude.getLayoutData()).horizontalSpan = 2;
+    }
+    if (fHonourAllSchemaLocations == null) {
+      fHonourAllSchemaLocations = createCheckBox(validatingGroup, XMLUIMessages.Honour_all_schema_locations);
+      ((GridData)fHonourAllSchemaLocations.getLayoutData()).horizontalSpan = 2;
+    }
+  }
+  private void handleMarkupSeveritySelection(boolean selection){
+	  if (selection) {
+		  fMarkupState.restore();
+	  }
+	  else {
+		  fMarkupState = ControlEnableState.disable(fMarkupValidationGroup);
+	  }
+  }
+
+  protected void createContentsForMarkupValidationGroup(Composite parent) {
+	   
+	    if (fExtendedMarkupValidation == null) {
+		    fExtendedMarkupValidation = createCheckBox(parent, XMLUIMessages.MarkupValidation_files);
+		    ((GridData)fExtendedMarkupValidation.getLayoutData()).horizontalSpan = 2;
+		    fExtendedMarkupValidation.addSelectionListener(new SelectionAdapter() {
+				public void widgetSelected(SelectionEvent e) {
+					handleMarkupSeveritySelection(fExtendedMarkupValidation.getSelection());
+				}
+			});
+		}
+	    fMarkupValidationGroup = createGroup(parent, 3);
+	    ((GridLayout)fMarkupValidationGroup.getLayout()).makeColumnsEqualWidth = false;
+	    fMarkupValidationGroup.setText(XMLUIMessages.MarkupValidation_files_label);
+
+	    if (fMissingStartTag == null) {
+	        fMissingStartTag = createMarkupCombo(fMarkupValidationGroup, XMLUIMessages.Missing_start_tag, MARKUP_SEVERITIES);
+	    }
+	    if (fMissingEndTag == null) {
+	        fMissingEndTag = createMarkupCombo(fMarkupValidationGroup, XMLUIMessages.Missing_end_tag, MARKUP_SEVERITIES);
+	    }
+	    if (fMissingTagName == null) {
+	        fMissingTagName = createMarkupCombo(fMarkupValidationGroup, XMLUIMessages.Tag_name_missing, MARKUP_SEVERITIES);
+	    }
+	    if (fMissingQuotes == null) {
+	        fMissingQuotes = createMarkupCombo(fMarkupValidationGroup, XMLUIMessages.Missing_quotes, MARKUP_SEVERITIES);
+	    }
+	    if (fMissingClosingBracket == null) {
+	        fMissingClosingBracket = createMarkupCombo(fMarkupValidationGroup, XMLUIMessages.Missing_closing_bracket, MARKUP_SEVERITIES);
+	    }
+	    if (fMissingClosingQuote == null) {
+	        fMissingClosingQuote = createMarkupCombo(fMarkupValidationGroup, XMLUIMessages.Missing_closing_quote, MARKUP_SEVERITIES);
+	    }
+	    if (fEmptyElementTag == null) {
+	        fEmptyElementTag = createMarkupCombo(fMarkupValidationGroup, XMLUIMessages.Empty_element_tag, MARKUP_SEVERITIES);
+	    }
+	    if (fEndTagWithAttributes == null) {
+	        fEndTagWithAttributes = createMarkupCombo(fMarkupValidationGroup, XMLUIMessages.End_tag_with_attributes, MARKUP_SEVERITIES);
+	    }
+	    if (fInvalidWhitespaceBeforeTagname == null) {
+	        fInvalidWhitespaceBeforeTagname = createMarkupCombo(fMarkupValidationGroup, XMLUIMessages.Invalid_whitespace_before_tagname, MARKUP_SEVERITIES);
+	    }
+	    if (fInvalidNamespaceInPI == null) {
+	        fInvalidNamespaceInPI = createMarkupCombo(fMarkupValidationGroup, XMLUIMessages.Namespace_in_pi_target, MARKUP_SEVERITIES);
+	    }
+	    if (fInvalidWhitespaceAtStart == null) {
+	        fInvalidWhitespaceAtStart = createMarkupCombo(fMarkupValidationGroup, XMLUIMessages.Whitespace_at_start, MARKUP_SEVERITIES);
+	    }
+
+  }
+
+  /**
+   * @param parent 
+   * @return
+   */
+  private Combo createCombo(Composite parent, String[] items) {
+    Combo combo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
+    combo.setItems(items);
+
+    //GridData
+    GridData data = new GridData(SWT.FILL, SWT.CENTER, true, true);
+    combo.setLayoutData(data);
+
+    return combo;
+  }
+
+  private Combo createMarkupCombo(Composite parent, String text, String[] items) {
+	  Label label = new Label(parent, SWT.LEFT);
+	  GridData gd = new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1);
+		label.setFont(JFaceResources.getDialogFont());
+		label.setText(text);
+		label.setLayoutData(gd);
+
+	  Combo combo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
+	    combo.setItems(items);
+
+	    //GridData
+	   // GridData data = new GridData(SWT.FILL, SWT.CENTER, false, true);
+	    combo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
+
+	    return combo;
+  }
+ 
+  protected void initializeValues() {
+    initializeValuesForValidatingGroup();
+    initializeValuesForMarkupValidationGroup();
+  }
+
+  protected void initializeValuesForValidatingGroup() {
+    Preferences modelPreferences = getModelPreferences();
+    int indicateNoGrammarButtonSelected = modelPreferences.getInt(XMLCorePreferenceNames.INDICATE_NO_GRAMMAR);
+    boolean useXIncludeButtonSelected = modelPreferences.getBoolean(XMLCorePreferenceNames.USE_XINCLUDE);
+
+    if (fIndicateNoGrammar != null) {
+      fIndicateNoGrammar.select(2 - indicateNoGrammarButtonSelected);
+      fIndicateNoGrammar.setText(SEVERITIES[2 - indicateNoGrammarButtonSelected]);
+    }
+    if (fUseXinclude != null) {
+      fUseXinclude.setSelection(useXIncludeButtonSelected);
+    }
+
+    boolean honourAllSelected = modelPreferences.getBoolean(XMLCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS);
+    if (fHonourAllSchemaLocations != null) {
+      fHonourAllSchemaLocations.setSelection(honourAllSelected);
+    }
+  }
+  
+  protected void initializeValuesForMarkupValidationGroup() {
+	    Preferences modelPreferences = getModelPreferences();
+	    boolean useExtendedMarkupValidation = modelPreferences.getBoolean(XMLCorePreferenceNames.MARKUP_VALIDATION);
+
+	    
+	    if (fExtendedMarkupValidation != null) {
+	    	fExtendedMarkupValidation.setSelection(useExtendedMarkupValidation);
+	    }
+	    int emptyElementTag = modelPreferences.getInt(XMLCorePreferenceNames.ATTRIBUTE_HAS_NO_VALUE);
+	    
+	    if (fEmptyElementTag != null) {
+	    	fEmptyElementTag.select(2 - emptyElementTag);
+	    	fEmptyElementTag.setText(MARKUP_SEVERITIES[2 - emptyElementTag]);
+		}
+	    
+	    int endTagWithAttributes  = modelPreferences.getInt(XMLCorePreferenceNames.END_TAG_WITH_ATTRIBUTES);
+	    
+	    if (fEndTagWithAttributes != null) {
+	    	fEndTagWithAttributes.select(2 - endTagWithAttributes);
+	    	fEndTagWithAttributes.setText(MARKUP_SEVERITIES[2 - endTagWithAttributes]);
+		}
+	    
+	    int invalidWhitespaceBeforeTagname  = modelPreferences.getInt(XMLCorePreferenceNames.WHITESPACE_BEFORE_TAGNAME);
+	    
+	    if (fInvalidWhitespaceBeforeTagname != null) {
+	    	fInvalidWhitespaceBeforeTagname.select(2 - invalidWhitespaceBeforeTagname);
+	    	fInvalidWhitespaceBeforeTagname.setText(MARKUP_SEVERITIES[2 - invalidWhitespaceBeforeTagname]);
+		}
+	    
+	    int missingClosingBracket  = modelPreferences.getInt(XMLCorePreferenceNames.MISSING_CLOSING_BRACKET);
+	    
+	    if (fMissingClosingBracket != null) {
+	    	fMissingClosingBracket.select(2 - missingClosingBracket);
+	    	fMissingClosingBracket.setText(MARKUP_SEVERITIES[2 - missingClosingBracket]);
+		}
+	    
+	    int missingClosingQuote  = modelPreferences.getInt(XMLCorePreferenceNames.MISSING_CLOSING_QUOTE);
+	    
+	    if (fMissingClosingQuote != null) {
+	    	fMissingClosingQuote.select(2 - missingClosingQuote);
+	    	fMissingClosingQuote.setText(MARKUP_SEVERITIES[2 - missingClosingQuote]);
+		}
+	    
+	    int missingEndTag  = modelPreferences.getInt(XMLCorePreferenceNames.MISSING_END_TAG);
+	    
+	    if (fMissingEndTag != null) {
+	    	fMissingEndTag.select(2 - missingEndTag);
+	    	fMissingEndTag.setText(MARKUP_SEVERITIES[2 - missingEndTag]);
+		}
+	    
+	    int missingStartTag  = modelPreferences.getInt(XMLCorePreferenceNames.MISSING_START_TAG);
+	    
+	    if (fMissingStartTag != null) {
+	    	fMissingStartTag.select(2 - missingStartTag);
+	    	fMissingStartTag.setText(MARKUP_SEVERITIES[2 - missingStartTag]);
+		}
+	    
+	    int missingQuotes  = modelPreferences.getInt(XMLCorePreferenceNames.MISSING_QUOTES);
+	    
+	    if (fMissingQuotes != null) {
+	    	fMissingQuotes.select(2 - missingQuotes);
+	    	fMissingQuotes.setText(MARKUP_SEVERITIES[2 - missingQuotes]);
+		}
+	    
+	    int invalidNamespaceInPI  = modelPreferences.getInt(XMLCorePreferenceNames.NAMESPACE_IN_PI_TARGET);
+	    
+	    if (fInvalidNamespaceInPI != null) {
+	    	fInvalidNamespaceInPI.select(2 - invalidNamespaceInPI);
+	    	fInvalidNamespaceInPI.setText(MARKUP_SEVERITIES[2 - invalidNamespaceInPI]);
+		}
+	    
+	    int tagNameMissing  = modelPreferences.getInt(XMLCorePreferenceNames.MISSING_TAG_NAME);
+	    
+	    if (fMissingTagName != null) {
+	    	fMissingTagName.select(2 - tagNameMissing);
+	    	fMissingTagName.setText(MARKUP_SEVERITIES[2 - tagNameMissing]);
+		}
+	    
+	    int invalidWhitespaceAtStart  = modelPreferences.getInt(XMLCorePreferenceNames.WHITESPACE_AT_START);
+	    
+	    if (fInvalidWhitespaceAtStart != null) {
+	    	fInvalidWhitespaceAtStart.select(2 - invalidWhitespaceAtStart);
+	    	fInvalidWhitespaceAtStart.setText(MARKUP_SEVERITIES[2 - invalidWhitespaceAtStart]);
+		}
+
+	    if (!useExtendedMarkupValidation)
+	    	fMarkupState = ControlEnableState.disable(fMarkupValidationGroup);
+  }
+
+  protected void performDefaultsForValidatingGroup() {
+    Preferences modelPreferences = getModelPreferences();
+    int indicateNoGrammarButtonSelected = modelPreferences.getDefaultInt(XMLCorePreferenceNames.INDICATE_NO_GRAMMAR);
+    boolean useXIncludeButtonSelected = modelPreferences.getDefaultBoolean(XMLCorePreferenceNames.USE_XINCLUDE);
+
+    if (fIndicateNoGrammar != null) {
+      fIndicateNoGrammar.setSelection(new Point(indicateNoGrammarButtonSelected, 2 - indicateNoGrammarButtonSelected));
+      fIndicateNoGrammar.setText(SEVERITIES[indicateNoGrammarButtonSelected]);
+    }
+    if (fUseXinclude != null) {
+      fUseXinclude.setSelection(useXIncludeButtonSelected);
+    }
+
+    boolean honourAllButtonSelected = modelPreferences.getDefaultBoolean(XMLCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS);
+    if (fHonourAllSchemaLocations != null) {
+      fHonourAllSchemaLocations.setSelection(honourAllButtonSelected);
+    }
+  }
+  
+  protected void performDefaultsForMarkupValidationGroup() {
+	  Preferences modelPreferences = getModelPreferences();
+	    boolean useExtendedMarkupValidation = modelPreferences.getDefaultBoolean(XMLCorePreferenceNames.MARKUP_VALIDATION);
+
+	    
+	    if (fExtendedMarkupValidation != null) {
+	    	if (fExtendedMarkupValidation.getSelection() != useExtendedMarkupValidation) {
+	    		handleMarkupSeveritySelection(useExtendedMarkupValidation);
+	    	}
+	    	fExtendedMarkupValidation.setSelection(useExtendedMarkupValidation);
+	    	
+	    }
+	    int emptyElementTag = modelPreferences.getDefaultInt(XMLCorePreferenceNames.ATTRIBUTE_HAS_NO_VALUE);
+	    
+	    if (fEmptyElementTag != null) {
+	    	fEmptyElementTag.setSelection(new Point(emptyElementTag,2 - emptyElementTag));
+	    	fEmptyElementTag.setText(MARKUP_SEVERITIES[2 - emptyElementTag]);
+		}
+	    
+	    int endTagWithAttributes  = modelPreferences.getDefaultInt(XMLCorePreferenceNames.END_TAG_WITH_ATTRIBUTES);
+	    
+	    if (fEndTagWithAttributes != null) {
+	    	fEndTagWithAttributes.setSelection(new Point(endTagWithAttributes,2 - endTagWithAttributes));
+	    	fEndTagWithAttributes.setText(MARKUP_SEVERITIES[2 - endTagWithAttributes]);
+		}
+	    
+	    int invalidWhitespaceBeforeTagname  = modelPreferences.getDefaultInt(XMLCorePreferenceNames.WHITESPACE_BEFORE_TAGNAME);
+	    
+	    if (fInvalidWhitespaceBeforeTagname != null) {
+	    	fInvalidWhitespaceBeforeTagname.setSelection(new Point(invalidWhitespaceBeforeTagname,2 - invalidWhitespaceBeforeTagname));
+	    	fInvalidWhitespaceBeforeTagname.setText(MARKUP_SEVERITIES[2 - invalidWhitespaceBeforeTagname]);
+		}
+	    
+	    int missingClosingBracket  = modelPreferences.getDefaultInt(XMLCorePreferenceNames.MISSING_CLOSING_BRACKET);
+	    
+	    if (fMissingClosingBracket != null) {
+	    	fMissingClosingBracket.setSelection(new Point(missingClosingBracket,2 - missingClosingBracket));
+	    	fMissingClosingBracket.setText(MARKUP_SEVERITIES[2 - missingClosingBracket]);
+		}
+	    
+	    int missingClosingQuote  = modelPreferences.getDefaultInt(XMLCorePreferenceNames.MISSING_CLOSING_QUOTE);
+	    
+	    if (fMissingClosingQuote != null) {
+	    	fMissingClosingQuote.setSelection(new Point(missingClosingQuote,2 - missingClosingQuote));
+	    	fMissingClosingQuote.setText(MARKUP_SEVERITIES[2 - missingClosingQuote]);
+		}
+	    
+	    int missingEndTag  = modelPreferences.getDefaultInt(XMLCorePreferenceNames.MISSING_END_TAG);
+	    
+	    if (fMissingEndTag != null) {
+	    	fMissingEndTag.setSelection(new Point(missingEndTag,2 - missingEndTag));
+	    	fMissingEndTag.setText(MARKUP_SEVERITIES[2 - missingEndTag]);
+		}
+	    
+	    int missingStartTag  = modelPreferences.getDefaultInt(XMLCorePreferenceNames.MISSING_START_TAG);
+	    
+	    if (fMissingStartTag != null) {
+	    	fMissingStartTag.setSelection(new Point(missingStartTag,2 - missingStartTag));
+	    	fMissingStartTag.setText(MARKUP_SEVERITIES[2 - missingStartTag]);
+		}
+	    
+	    int missingQuotes  = modelPreferences.getDefaultInt(XMLCorePreferenceNames.MISSING_QUOTES);
+	    
+	    if (fMissingQuotes != null) {
+	    	fMissingQuotes.setSelection(new Point(missingQuotes,2 - missingQuotes));
+	    	fMissingQuotes.setText(MARKUP_SEVERITIES[2 - missingQuotes]);
+		}
+	    
+	    int invalidNamespaceInPI  = modelPreferences.getDefaultInt(XMLCorePreferenceNames.NAMESPACE_IN_PI_TARGET);
+	    
+	    if (fInvalidNamespaceInPI != null) {
+	    	fInvalidNamespaceInPI.setSelection(new Point(invalidNamespaceInPI,2 - invalidNamespaceInPI));
+	    	fInvalidNamespaceInPI.setText(MARKUP_SEVERITIES[2 - invalidNamespaceInPI]);
+		}
+	    
+	    int tagNameMissing  = modelPreferences.getDefaultInt(XMLCorePreferenceNames.MISSING_TAG_NAME);
+	    
+	    if (fMissingTagName != null) {
+	    	fMissingTagName.setSelection(new Point(tagNameMissing,2 - tagNameMissing));
+	    	fMissingTagName.setText(MARKUP_SEVERITIES[2 - tagNameMissing]);
+		}
+	    
+	    int invalidWhitespaceAtStart  = modelPreferences.getDefaultInt(XMLCorePreferenceNames.WHITESPACE_AT_START);
+	    
+	    if (fInvalidWhitespaceAtStart != null) {
+	    	fInvalidWhitespaceAtStart.setSelection(new Point(invalidWhitespaceAtStart,2 - invalidWhitespaceAtStart));
+	    	fInvalidWhitespaceAtStart.setText(MARKUP_SEVERITIES[2 - invalidWhitespaceAtStart]);
+		}
+	  }
+
+  protected void storeValuesForValidatingGroup()
+  {
+    Preferences modelPreferences = getModelPreferences();
+    if (fIndicateNoGrammar != null) {
+      int warnNoGrammarButtonSelected = 2 - fIndicateNoGrammar.getSelectionIndex();
+      modelPreferences.setValue(XMLCorePreferenceNames.INDICATE_NO_GRAMMAR, warnNoGrammarButtonSelected);
+    }
+    if (fUseXinclude != null) {
+      boolean useXIncludeButtonSelected = fUseXinclude.getSelection();
+      modelPreferences.setValue(XMLCorePreferenceNames.USE_XINCLUDE, useXIncludeButtonSelected);
+    }
+    if (fHonourAllSchemaLocations != null) {
+      boolean honourAllButtonSelected = fHonourAllSchemaLocations.getSelection();
+      modelPreferences.setValue(XMLCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS, honourAllButtonSelected);
+    }
+  }
+  protected void storeValuesForMarkupValidationGroup()
+  {
+    Preferences modelPreferences = getModelPreferences();
+    if (fExtendedMarkupValidation != null) {
+        boolean extendedMarkupValidation = fExtendedMarkupValidation.getSelection();
+        modelPreferences.setValue(XMLCorePreferenceNames.MARKUP_VALIDATION, extendedMarkupValidation);
+    }
+    if (fEmptyElementTag != null) {
+      int emptyElementTag = 2 - fEmptyElementTag.getSelectionIndex();
+      modelPreferences.setValue(XMLCorePreferenceNames.ATTRIBUTE_HAS_NO_VALUE, emptyElementTag);
+    }
+    if (fEndTagWithAttributes != null) {
+        int endTagWithAttributes = 2 - fEndTagWithAttributes.getSelectionIndex();
+        modelPreferences.setValue(XMLCorePreferenceNames.END_TAG_WITH_ATTRIBUTES, endTagWithAttributes);
+    }
+    if (fInvalidWhitespaceBeforeTagname != null) {
+        int invalidWhitespaceBeforeTagname = 2 - fInvalidWhitespaceBeforeTagname.getSelectionIndex();
+        modelPreferences.setValue(XMLCorePreferenceNames.WHITESPACE_BEFORE_TAGNAME, invalidWhitespaceBeforeTagname);
+    }
+    if (fMissingClosingBracket != null) {
+          int missingClosingBracket = 2 - fMissingClosingBracket.getSelectionIndex();
+          modelPreferences.setValue(XMLCorePreferenceNames.MISSING_CLOSING_BRACKET, missingClosingBracket);
+    }
+    if (fMissingClosingQuote != null) {
+        int missingClosingQuote = 2 - fMissingClosingQuote.getSelectionIndex();
+        modelPreferences.setValue(XMLCorePreferenceNames.MISSING_CLOSING_BRACKET, missingClosingQuote);
+    }
+    if (fMissingEndTag != null) {
+        int missingEndTag = 2 - fMissingEndTag.getSelectionIndex();
+        modelPreferences.setValue(XMLCorePreferenceNames.MISSING_END_TAG, missingEndTag);
+        modelPreferences.getInt(XMLCorePreferenceNames.MISSING_END_TAG);
+    }
+	if (fMissingStartTag != null) {
+        int missingStartTag = 2 - fMissingStartTag.getSelectionIndex();
+	    modelPreferences.setValue(XMLCorePreferenceNames.MISSING_START_TAG, missingStartTag);
+	}
+	if (fMissingQuotes != null) {
+        int missingQuotes = 2 - fMissingQuotes.getSelectionIndex();
+	    modelPreferences.setValue(XMLCorePreferenceNames.MISSING_QUOTES, missingQuotes);
+	}
+	if (fInvalidNamespaceInPI != null) {
+        int invalidNamespaceInPI = 2 - fInvalidNamespaceInPI.getSelectionIndex();
+	    modelPreferences.setValue(XMLCorePreferenceNames.NAMESPACE_IN_PI_TARGET, invalidNamespaceInPI);
+	}
+	if (fMissingTagName != null) {
+        int missingTagName = 2 - fMissingTagName.getSelectionIndex();
+	    modelPreferences.setValue(XMLCorePreferenceNames.MISSING_TAG_NAME, missingTagName);
+	}
+	if (fInvalidWhitespaceAtStart != null) {
+        int invalidWhitespaceAtStart = 2 - fInvalidWhitespaceAtStart.getSelectionIndex();
+	    modelPreferences.setValue(XMLCorePreferenceNames.WHITESPACE_AT_START, invalidWhitespaceAtStart);
+	}
+    
+    
+  }
+  
+  protected void storeValues() {
+    storeValuesForValidatingGroup();
+    storeValuesForMarkupValidationGroup();
+  }
+
+  protected void performDefaults() {
+    performDefaultsForValidatingGroup();
+    performDefaultsForMarkupValidationGroup();
+    super.performDefaults();
+  }
+  
+  protected Preferences getModelPreferences() {
+    return XMLCorePlugin.getDefault().getPluginPreferences();
+  }  
+  
+  protected void doSavePreferenceStore() {
+      XMLCorePlugin.getDefault().savePluginPreferences(); // model
+  }
+
+  public boolean performOk() {
+    boolean result = super.performOk();
+
+    doSavePreferenceStore();
+
+    return result;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionAnnotationModelChanges.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionAnnotationModelChanges.java
deleted file mode 100644
index 7d415f9..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionAnnotationModelChanges.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.projection;
-
-import java.util.Map;
-
-import org.eclipse.jface.text.source.Annotation;
-import org.w3c.dom.Node;
-
-/**
- * Contains a set of projection model additions/deletions/modifications
- */
-class ProjectionAnnotationModelChanges {
-	// copies of this class located in:
-	// org.eclipse.wst.xml.ui.internal.projection
-	// org.eclipse.wst.css.ui.internal.projection
-	// org.eclipse.wst.html.ui.internal.projection
-	// org.eclipse.jst.jsp.ui.internal.projection
-	private Node fNode;
-	private Annotation[] fDeletions;
-	private Map fAdditions;
-	private Annotation[] fModifications;
-
-	public ProjectionAnnotationModelChanges(Node node, Annotation[] deletions, Map additions, Annotation[] modifications) {
-		fNode = node;
-		fDeletions = deletions;
-		fAdditions = additions;
-		fModifications = modifications;
-	}
-
-	public Map getAdditions() {
-		return fAdditions;
-	}
-
-	public Annotation[] getDeletions() {
-		return fDeletions;
-	}
-
-	public Annotation[] getModifications() {
-		return fModifications;
-	}
-
-	public Node getNode() {
-		return fNode;
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionModelNodeAdapterFactoryXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionModelNodeAdapterFactoryXML.java
deleted file mode 100644
index 8202f4f..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionModelNodeAdapterFactoryXML.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.projection;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Node;
-
-public class ProjectionModelNodeAdapterFactoryXML extends AbstractAdapterFactory {
-	/**
-	 * List of projection viewers currently associated with this projection
-	 * model node adapter factory.
-	 */
-	private HashMap fProjectionViewers;
-
-	public ProjectionModelNodeAdapterFactoryXML() {
-		super(ProjectionModelNodeAdapterXML.class, true);
-	}
-
-	protected INodeAdapter createAdapter(INodeNotifier target) {
-		ProjectionModelNodeAdapterXML adapter = null;
-
-		// create adapter for every element tag
-		if ((isActive()) && (target instanceof Node) && (((Node) target).getNodeType() == Node.ELEMENT_NODE)) {
-			adapter = new ProjectionModelNodeAdapterXML(this);
-			adapter.updateAdapter((Node) target);
-		}
-
-		return adapter;
-	}
-
-	/**
-	 * Return true if this factory is currently actively managing projection
-	 * 
-	 * @return
-	 */
-	boolean isActive() {
-		return ((fProjectionViewers != null) && !fProjectionViewers.isEmpty());
-	}
-
-	/**
-	 * Updates projection annotation model if document is not in flux.
-	 * Otherwise, queues up the changes to be applied when document is ready.
-	 * 
-	 * @param node
-	 * @param deletions
-	 * @param additions
-	 * @param modifications
-	 */
-	void queueAnnotationModelChanges(Node node, Annotation[] deletions, Map additions, Annotation[] modifications) {
-		queueAnnotationModelChanges(node, deletions, additions, modifications, null);
-	}
-
-	/**
-	 * Updates projection annotation model for a specific projection viewer if
-	 * document is not in flux. Otherwise, queues up the changes to be applied
-	 * when document is ready.
-	 * 
-	 * @param node
-	 * @param deletions
-	 * @param additions
-	 * @param modifications
-	 * @param viewer
-	 */
-	void queueAnnotationModelChanges(Node node, Annotation[] deletions, Map additions, Annotation[] modifications, ProjectionViewer viewer) {
-		// create a change object for latest change and add to queue
-		ProjectionAnnotationModelChanges newChange = new ProjectionAnnotationModelChanges(node, deletions, additions, modifications);
-		if (fProjectionViewers != null) {
-			if (viewer != null) {
-				ProjectionViewerInformation info = (ProjectionViewerInformation) fProjectionViewers.get(viewer);
-				if (info != null) {
-					info.queueAnnotationModelChanges(newChange);
-				}
-			}
-			else {
-				Iterator infos = fProjectionViewers.values().iterator();
-				while (infos.hasNext()) {
-					ProjectionViewerInformation info = (ProjectionViewerInformation) infos.next();
-					info.queueAnnotationModelChanges(newChange);
-				}
-			}
-		}
-	}
-
-	public void release() {
-		// go through every projectionviewer and call
-		// removeProjectionViewer(viewer);
-		if (fProjectionViewers != null) {
-			Iterator infos = fProjectionViewers.values().iterator();
-			while (infos.hasNext()) {
-				ProjectionViewerInformation info = (ProjectionViewerInformation) infos.next();
-				info.dispose();
-				infos.remove();
-			}
-			fProjectionViewers = null;
-		}
-		super.release();
-	}
-
-	/**
-	 * Adds viewer to list of projection viewers this factory is associated
-	 * with
-	 * 
-	 * @param viewer -
-	 *            assumes viewer's document and projection annotation model
-	 *            are not null
-	 */
-	void addProjectionViewer(ProjectionViewer viewer) {
-		// remove old entry if it exists
-		removeProjectionViewer(viewer);
-
-		if (fProjectionViewers == null) {
-			fProjectionViewers = new HashMap();
-		}
-
-		// create new object containing projection viewer and its info
-		ProjectionViewerInformation info = new ProjectionViewerInformation(viewer);
-		fProjectionViewers.put(viewer, info);
-		info.initialize();
-	}
-
-	/**
-	 * Removes the given viewer from the list of projection viewers this
-	 * factor is associated with
-	 * 
-	 * @param viewer
-	 */
-	void removeProjectionViewer(ProjectionViewer viewer) {
-		if (fProjectionViewers != null) {
-			// remove entry from list of viewers
-			ProjectionViewerInformation info = (ProjectionViewerInformation) fProjectionViewers.remove(viewer);
-			if (info != null) {
-				info.dispose();
-			}
-			// if removing last projection viewer, clear out everything
-			if (fProjectionViewers.isEmpty()) {
-				fProjectionViewers = null;
-			}
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionModelNodeAdapterXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionModelNodeAdapterXML.java
deleted file mode 100644
index fde379a..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionModelNodeAdapterXML.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.projection;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.w3c.dom.Node;
-
-/**
- * Updates projection annotation model with projection annotations for this
- * adapter node's children
- */
-public class ProjectionModelNodeAdapterXML implements INodeAdapter {
-	private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.xml.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	private class TagProjectionAnnotation extends ProjectionAnnotation {
-		private boolean fIsVisible = false; /* workaround for BUG85874 */
-		private Node fNode;
-
-		public TagProjectionAnnotation(Node node, boolean isCollapsed) {
-			super(isCollapsed);
-			fNode = node;
-		}
-
-		public Node getNode() {
-			return fNode;
-		}
-
-		public void setNode(Node node) {
-			fNode = node;
-		}
-
-		/**
-		 * Does not paint hidden annotations. Annotations are hidden when they
-		 * only span one line.
-		 * 
-		 * @see ProjectionAnnotation#paint(org.eclipse.swt.graphics.GC,
-		 *      org.eclipse.swt.widgets.Canvas,
-		 *      org.eclipse.swt.graphics.Rectangle)
-		 */
-		public void paint(GC gc, Canvas canvas, Rectangle rectangle) {
-			/* workaround for BUG85874 */
-			/*
-			 * only need to check annotations that are expanded because hidden
-			 * annotations should never have been given the chance to
-			 * collapse.
-			 */
-			if (!isCollapsed()) {
-				// working with rectangle, so line height
-				FontMetrics metrics = gc.getFontMetrics();
-				if (metrics != null) {
-					// do not draw annotations that only span one line and
-					// mark them as not visible
-					if ((rectangle.height / metrics.getHeight()) <= 1) {
-						fIsVisible = false;
-						return;
-					}
-				}
-			}
-			fIsVisible = true;
-			super.paint(gc, canvas, rectangle);
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.jface.text.source.projection.ProjectionAnnotation#markCollapsed()
-		 */
-		public void markCollapsed() {
-			/* workaround for BUG85874 */
-			// do not mark collapsed if annotation is not visible
-			if (fIsVisible) {
-				super.markCollapsed();
-			}
-		}
-	}
-
-	ProjectionModelNodeAdapterFactoryXML fAdapterFactory;
-	private Map fTagAnnotations = new HashMap();
-
-	public ProjectionModelNodeAdapterXML(ProjectionModelNodeAdapterFactoryXML factory) {
-		fAdapterFactory = factory;
-	}
-
-	/**
-	 * Create a projection position from the given node. Able to get
-	 * projection position if node isNodeProjectable.
-	 * 
-	 * @param node
-	 * @return null if no projection position possible, a Position otherwise
-	 */
-	private Position createProjectionPosition(Node node) {
-		Position pos = null;
-		if (isNodeProjectable(node) && (node instanceof IndexedRegion)) {
-			// IDocument document =
-			// fAdapterFactory.getProjectionViewer().getDocument();
-			// if (document != null) {
-			IndexedRegion inode = (IndexedRegion) node;
-			int start = inode.getStartOffset();
-			int end = inode.getEndOffset();
-			if ((start >= 0) && (start < end)) {
-				// region-based
-				// extra line when collapsed, but no region increase when add
-				// newline
-				pos = new Position(start, end - start);
-				// try {
-				// // line-based
-				// // extra line when collapsed, but no region increase when
-				// add newline
-				// IRegion startLineRegion =
-				// document.getLineInformationOfOffset(start);
-				// IRegion endLineRegion =
-				// document.getLineInformationOfOffset(end);
-				// int startOffset = startLineRegion.getOffset();
-				// int endOffset = endLineRegion.getOffset() +
-				// endLineRegion.getLength();
-				// if (endOffset > startOffset) {
-				// pos = new Position(startOffset, endOffset - startOffset);
-				// }
-
-				// // line-based
-				// // no extra line when collapsed, but region increase when
-				// add newline
-				// int startLine = document.getLineOfOffset(start);
-				// int endLine = document.getLineOfOffset(end);
-				// if (endLine + 1 < document.getNumberOfLines()) {
-				// int offset = document.getLineOffset(startLine);
-				// int endOffset = document.getLineOffset(endLine + 1);
-				// pos = new Position(offset, endOffset - offset);
-				// }
-				// }
-				// catch (BadLocationException x) {
-				// Logger.log(Logger.WARNING_DEBUG, null, x);
-				// }
-			}
-			// }
-		}
-		return pos;
-	}
-
-	/**
-	 * Find TagProjectionAnnotation for node in the current list of projection
-	 * annotations for this adapter
-	 * 
-	 * @param node
-	 * @return TagProjectionAnnotation
-	 */
-	private TagProjectionAnnotation getExistingAnnotation(Node node) {
-		TagProjectionAnnotation anno = null;
-
-		if ((node != null) && (!fTagAnnotations.isEmpty())) {
-			Iterator it = fTagAnnotations.keySet().iterator();
-			while (it.hasNext() && (anno == null)) {
-				TagProjectionAnnotation a = (TagProjectionAnnotation) it.next();
-				Node n = a.getNode();
-				if (node.equals(n)) {
-					anno = a;
-				}
-			}
-		}
-		return anno;
-	}
-
-	public boolean isAdapterForType(Object type) {
-		return type == ProjectionModelNodeAdapterXML.class;
-	}
-
-	/**
-	 * Returns true if node is a node type able to fold
-	 * 
-	 * @param node
-	 * @return boolean true if node is projectable, false otherwise
-	 */
-	private boolean isNodeProjectable(Node node) {
-		if (node.getNodeType() == Node.ELEMENT_NODE) {
-			return true;
-		}
-		return false;
-	}
-
-	public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
-		// check if folding is even enabled, if not, just ignore notifyChanged
-		// events
-		if (!fAdapterFactory.isActive()) {
-			return;
-		}
-
-		if ((eventType == INodeNotifier.STRUCTURE_CHANGED) && (notifier instanceof Node)) {
-			updateAdapter((Node) notifier);
-		}
-	}
-
-	/**
-	 * Update the projection annotation of all the nodes that are children of
-	 * node
-	 * 
-	 * @param node
-	 */
-	void updateAdapter(Node node) {
-		updateAdapter(node, null);
-	}
-
-	/**
-	 * Update the projection annotation of all the nodes that are children of
-	 * node and adds all projection annotations to viewer (for newly added
-	 * viewers)
-	 * 
-	 * @param node
-	 * @param viewer
-	 */
-	void updateAdapter(Node node, ProjectionViewer viewer) {
-		long start = System.currentTimeMillis();
-
-		Map additions = new HashMap();
-		Map projectionAnnotations = new HashMap();
-
-		// go through immediate child nodes and figure out projection
-		// model annotations
-		if (node != null) {
-			Node childNode = node.getFirstChild();
-			while (childNode != null) {
-				Position newPos = createProjectionPosition(childNode);
-				if (newPos != null) {
-					TagProjectionAnnotation newAnnotation = new TagProjectionAnnotation(childNode, false);
-					TagProjectionAnnotation existing = getExistingAnnotation(childNode);
-					if (existing == null) {
-						// add to map containing all annotations for this
-						// adapter
-						projectionAnnotations.put(newAnnotation, newPos);
-						// add to map containing annotations to add
-						additions.put(newAnnotation, newPos);
-					}
-					else {
-						// add to map containing all annotations for this
-						// adapter
-						projectionAnnotations.put(existing, newPos);
-						// remove from map containing annotations to delete
-						fTagAnnotations.remove(existing);
-					}
-				}
-				childNode = childNode.getNextSibling();
-			}
-
-			// in the end, want to delete anything leftover in old list, add
-			// everything in additions, and update everything in
-			// projectionAnnotations
-			ProjectionAnnotation[] oldList = null;
-			if (!fTagAnnotations.isEmpty()) {
-				oldList = (ProjectionAnnotation[]) fTagAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
-			}
-			ProjectionAnnotation[] modifyList = null;
-			if (!projectionAnnotations.isEmpty()) {
-				modifyList = (ProjectionAnnotation[]) projectionAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
-			}
-
-			// specifically add all annotations to viewer
-			if ((viewer != null) && !projectionAnnotations.isEmpty()) {
-				fAdapterFactory.queueAnnotationModelChanges(node, null, projectionAnnotations, null, viewer);
-			}
-
-			// only update when there is something to update
-			if (((oldList != null) && (oldList.length > 0)) || (!additions.isEmpty()) || ((modifyList != null) && (modifyList.length > 0))) {
-				fAdapterFactory.queueAnnotationModelChanges(node, oldList, additions, modifyList);
-			}
-		}
-
-		// save new list of annotations
-		fTagAnnotations = projectionAnnotations;
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			String nodeName = node != null ? node.getNodeName() : "null"; //$NON-NLS-1$
-			System.out.println("ProjectionModelNodeAdapterXML.updateAdapter (" + nodeName + "):" + (end - start)); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionViewerInformation.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionViewerInformation.java
deleted file mode 100644
index 1dccff6..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionViewerInformation.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.projection;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.xml.ui.internal.Logger;
-
-/**
- * Contains information about a projection viewer and also manages updating
- * the viewer's projection annotation model
- */
-class ProjectionViewerInformation {
-	// copies of this class located in:
-	// org.eclipse.wst.xml.ui.internal.projection
-	// org.eclipse.wst.css.ui.internal.projection
-	// org.eclipse.wst.html.ui.internal.projection
-	// org.eclipse.jst.jsp.ui.internal.projection
-
-	/**
-	 * Listens to document to be aware of when to update the projection
-	 * annotation model.
-	 */
-	private class DocumentListener implements IDocumentListener {
-		private ProjectionViewerInformation fInfo;
-
-		public DocumentListener(ProjectionViewerInformation info) {
-			fInfo = info;
-		}
-
-		public void documentAboutToBeChanged(DocumentEvent event) {
-			IDocument document = event.getDocument();
-			if (fInfo.getDocument() == document) {
-				fInfo.setIsDocumentChanging(true);
-			}
-		}
-
-		public void documentChanged(DocumentEvent event) {
-			// register a post notification replace so that projection
-			// annotation model will be updated after all documentChanged
-			// listeners have been notified
-			IDocument document = event.getDocument();
-			if ((document instanceof IDocumentExtension) && (fInfo.getDocument() == document)) {
-				if (fInfo.hasChangesQueued()) {
-					((IDocumentExtension) document).registerPostNotificationReplace(this, new PostDocumentChangedListener(fInfo));
-				}
-			}
-		}
-	}
-
-	/**
-	 * Essentially a post document changed listener because it is called after
-	 * documentchanged has been fired.
-	 */
-	private class PostDocumentChangedListener implements IDocumentExtension.IReplace {
-		private ProjectionViewerInformation fInfo;
-
-		public PostDocumentChangedListener(ProjectionViewerInformation info) {
-			fInfo = info;
-		}
-
-		public void perform(IDocument document, IDocumentListener owner) {
-			fInfo.applyAnnotationModelChanges();
-			fInfo.setIsDocumentChanging(false);
-		}
-	}
-
-	/**
-	 * Projection annotation model current associated with this projection
-	 * viewer
-	 */
-	private ProjectionAnnotationModel fProjectionAnnotationModel;
-	/**
-	 * Document currently associated with this projection viewer
-	 */
-	private IDocument fDocument;
-	/**
-	 * Listener to fProjectionViewer's document
-	 */
-	private IDocumentListener fDocumentListener;
-	/**
-	 * Indicates whether or not document is in the middle of changing
-	 */
-	private boolean fIsDocumentChanging = false;
-	/**
-	 * List of projection annotation model changes that need to be applied
-	 */
-	private List fQueuedAnnotationChanges;
-
-	public ProjectionViewerInformation(ProjectionViewer viewer) {
-		fDocument = viewer.getDocument();
-		fProjectionAnnotationModel = viewer.getProjectionAnnotationModel();
-	}
-
-	IDocument getDocument() {
-		return fDocument;
-	}
-
-	private List getQueuedAnnotationChanges() {
-		if (fQueuedAnnotationChanges == null) {
-			fQueuedAnnotationChanges = new ArrayList();
-		}
-		return fQueuedAnnotationChanges;
-	}
-
-	void setIsDocumentChanging(boolean changing) {
-		fIsDocumentChanging = changing;
-	}
-
-	private boolean isDocumentChanging() {
-		return fIsDocumentChanging;
-	}
-
-	/**
-	 * Applies the pending projection annotation model changes to the
-	 * projection annotation model.
-	 */
-	void applyAnnotationModelChanges() {
-		List queuedChanges = getQueuedAnnotationChanges();
-		// go through all the pending annotation changes and apply
-		// them to
-		// the projection annotation model
-		while (!queuedChanges.isEmpty()) {
-			ProjectionAnnotationModelChanges changes = (ProjectionAnnotationModelChanges) queuedChanges.remove(0);
-			try {
-				fProjectionAnnotationModel.modifyAnnotations(changes.getDeletions(), changes.getAdditions(), changes.getModifications());
-			}
-			catch (Exception e) {
-				// if anything goes wrong, log it be continue
-				Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
-			}
-		}
-	}
-
-	/**
-	 * Returns true if there are annotation changes queued up, false otherwise
-	 * 
-	 * @return boolean
-	 */
-	boolean hasChangesQueued() {
-		return !getQueuedAnnotationChanges().isEmpty();
-	}
-
-	/**
-	 * Updates projection annotation model if document is not in flux.
-	 * Otherwise, queues up the changes to be applied when document is ready.
-	 */
-	public void queueAnnotationModelChanges(ProjectionAnnotationModelChanges newChange) {
-		/*
-		 * future_TODO: maybe improve by checking if annotation projection
-		 * model change already exists for node. if so, throw out old change.
-		 */
-		getQueuedAnnotationChanges().add(newChange);
-
-		// if document isn't changing, go ahead and apply it
-		if (!isDocumentChanging()) {
-			applyAnnotationModelChanges();
-		}
-	}
-
-	public void initialize() {
-		// add document listener
-		if (fDocumentListener == null) {
-			fDocumentListener = new DocumentListener(this);
-		}
-		getDocument().addDocumentListener(fDocumentListener);
-	}
-
-	public void dispose() {
-		// remove document listener
-		if (fDocumentListener != null) {
-			getDocument().removeDocumentListener(fDocumentListener);
-		}
-
-		// clear out list of queued changes since it may no longer
-		// be accurate
-		if (fQueuedAnnotationChanges != null) {
-			fQueuedAnnotationChanges.clear();
-			fQueuedAnnotationChanges = null;
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/StructuredTextFoldingProviderXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/StructuredTextFoldingProviderXML.java
deleted file mode 100644
index b7047bb..0000000
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/StructuredTextFoldingProviderXML.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xml.ui.internal.projection;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.jface.text.source.projection.IProjectionListener;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Updates the projection model of a structured model for XML.
- */
-public class StructuredTextFoldingProviderXML implements IStructuredTextFoldingProvider, IProjectionListener, ITextInputListener {
-	private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.xml.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	private IDocument fDocument;
-	private ProjectionViewer fViewer;
-	private boolean fProjectionNeedsToBeEnabled = false;
-	/**
-	 * Maximum number of child nodes to add adapters to (limit for performance
-	 * sake)
-	 */
-	private final int MAX_CHILDREN = 10;
-	/**
-	 * Maximum number of sibling nodes to add adapters to (limit for
-	 * performance sake)
-	 */
-	private final int MAX_SIBLINGS = 1000;
-
-	/**
-	 * Adds an adapter to node and its children
-	 * 
-	 * @param node
-	 * @param childLevel
-	 */
-	private void addAdapterToNodeAndChildren(Node node, int childLevel) {
-		// stop adding initial adapters MAX_CHILDREN levels deep for
-		// performance sake
-		if ((node instanceof INodeNotifier) && (childLevel < MAX_CHILDREN)) {
-			INodeNotifier notifier = (INodeNotifier) node;
-
-			// try and get the adapter for the current node and update the
-			// adapter with projection information
-			ProjectionModelNodeAdapterXML adapter = (ProjectionModelNodeAdapterXML) notifier.getExistingAdapter(ProjectionModelNodeAdapterXML.class);
-			if (adapter != null) {
-				adapter.updateAdapter(node, fViewer);
-			}
-			else {
-				// just call getadapter so the adapter is created and
-				// automatically initialized
-				notifier.getAdapterFor(ProjectionModelNodeAdapterXML.class);
-			}
-			int siblingLevel = 0;
-			Node nextChild = node.getFirstChild();
-			while ((nextChild != null) && (siblingLevel < MAX_SIBLINGS)) {
-				Node childNode = nextChild;
-				nextChild = childNode.getNextSibling();
-
-				addAdapterToNodeAndChildren(childNode, childLevel + 1);
-			}
-		}
-	}
-
-	/**
-	 * Goes through every node and adds an adapter onto each for tracking
-	 * purposes
-	 */
-	private void addAllAdapters() {
-		long start = System.currentTimeMillis();
-
-		if (fDocument != null) {
-			IStructuredModel sModel = null;
-			try {
-				sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-				if (sModel != null) {
-					int startOffset = 0;
-					IndexedRegion startNode = sModel.getIndexedRegion(startOffset);
-					if (startNode instanceof Node) {
-						int siblingLevel = 0;
-						Node nextSibling = (Node) startNode;
-						while ((nextSibling != null) && (siblingLevel < MAX_SIBLINGS)) {
-							Node currentNode = nextSibling;
-							nextSibling = currentNode.getNextSibling();
-
-							addAdapterToNodeAndChildren(currentNode, 0);
-							++siblingLevel;
-						}
-					}
-				}
-			}
-			finally {
-				if (sModel != null) {
-					sModel.releaseFromRead();
-				}
-			}
-		}
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderXML.addAllAdapters: " + (end - start)); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Get the ProjectionModelNodeAdapterFactoryXML to use with this provider.
-	 * 
-	 * @return ProjectionModelNodeAdapterFactoryXML
-	 */
-	private ProjectionModelNodeAdapterFactoryXML getAdapterFactory(boolean createIfNeeded) {
-		long start = System.currentTimeMillis();
-
-		ProjectionModelNodeAdapterFactoryXML factory = null;
-		if (fDocument != null) {
-			IStructuredModel sModel = null;
-			try {
-				sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-				if (sModel != null) {
-					FactoryRegistry factoryRegistry = sModel.getFactoryRegistry();
-
-					// getting the projectionmodelnodeadapter for the first
-					// time
-					// so do some initializing
-					if (!factoryRegistry.contains(ProjectionModelNodeAdapterXML.class) && createIfNeeded) {
-						ProjectionModelNodeAdapterFactoryXML newFactory = new ProjectionModelNodeAdapterFactoryXML();
-
-						// add factory to factory registry
-						factoryRegistry.addFactory(newFactory);
-
-						// add factory to propogating adapter
-						IDOMModel domModel = (IDOMModel) sModel;
-						Document document = domModel.getDocument();
-						PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class);
-						if (propagatingAdapter != null) {
-							propagatingAdapter.addAdaptOnCreateFactory(newFactory);
-						}
-					}
-
-					// try and get the factory
-					factory = (ProjectionModelNodeAdapterFactoryXML) factoryRegistry.getFactoryFor(ProjectionModelNodeAdapterXML.class);
-				}
-			}
-			finally {
-				if (sModel != null) {
-					sModel.releaseFromRead();
-				}
-			}
-		}
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderXML.getAdapterFactory: " + (end - start)); //$NON-NLS-1$
-		}
-		return factory;
-	}
-
-	/**
-	 * Initialize this provider with the correct document. Assumes projection
-	 * is enabled. (otherwise, only install would have been called)
-	 */
-	public void initialize() {
-		if (!isInstalled()) {
-			return;
-		}
-
-		long start = System.currentTimeMillis();
-		// clear out old info
-		projectionDisabled();
-
-		fDocument = fViewer.getDocument();
-
-		// set projection viewer on new document's adapter factory
-		if (fViewer.getProjectionAnnotationModel() != null) {
-			ProjectionModelNodeAdapterFactoryXML factory = getAdapterFactory(true);
-			if (factory != null) {
-				factory.addProjectionViewer(fViewer);
-			}
-			try {
-				// https://bugs.eclipse.org/bugs/show_bug.cgi?id=198304
-				// disable redraw while adding all adapters
-				fViewer.setRedraw(false);
-				addAllAdapters();
-			}
-			finally {
-				fViewer.setRedraw(true);
-			}
-		}
-		fProjectionNeedsToBeEnabled = false;
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderXML.initialize: " + (end - start)); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Associate a ProjectionViewer with this IStructuredTextFoldingProvider
-	 * 
-	 * @param viewer -
-	 *            assumes not null
-	 */
-	public void install(ProjectionViewer viewer) {
-		// uninstall before trying to install new viewer
-		if (isInstalled()) {
-			uninstall();
-		}
-		fViewer = viewer;
-		fViewer.addProjectionListener(this);
-		fViewer.addTextInputListener(this);
-	}
-
-	private boolean isInstalled() {
-		return fViewer != null;
-	}
-
-	public void projectionDisabled() {
-		ProjectionModelNodeAdapterFactoryXML factory = getAdapterFactory(false);
-		if (factory != null) {
-			factory.removeProjectionViewer(fViewer);
-		}
-
-		// clear out all annotations
-		if (fViewer.getProjectionAnnotationModel() != null) {
-			fViewer.getProjectionAnnotationModel().removeAllAnnotations();
-		}
-
-		removeAllAdapters();
-
-		fDocument = null;
-		fProjectionNeedsToBeEnabled = false;
-	}
-
-	public void projectionEnabled() {
-		initialize();
-	}
-
-	/**
-	 * Removes an adapter from node and its children
-	 * 
-	 * @param node
-	 * @param level
-	 */
-	private void removeAdapterFromNodeAndChildren(Node node, int level) {
-		if (node instanceof INodeNotifier) {
-			INodeNotifier notifier = (INodeNotifier) node;
-
-			// try and get the adapter for the current node and remove it
-			INodeAdapter adapter = notifier.getExistingAdapter(ProjectionModelNodeAdapterXML.class);
-			if (adapter != null) {
-				notifier.removeAdapter(adapter);
-			}
-
-			Node nextChild = node.getFirstChild();
-			while (nextChild != null) {
-				Node childNode = nextChild;
-				nextChild = childNode.getNextSibling();
-
-				removeAdapterFromNodeAndChildren(childNode, level + 1);
-			}
-		}
-	}
-
-	/**
-	 * Goes through every node and removes adapter from each for cleanup
-	 * purposes
-	 */
-	private void removeAllAdapters() {
-		long start = System.currentTimeMillis();
-
-		if (fDocument != null) {
-			IStructuredModel sModel = null;
-			try {
-				sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
-				if (sModel != null) {
-					int startOffset = 0;
-					IndexedRegion startNode = sModel.getIndexedRegion(startOffset);
-					if (startNode instanceof Node) {
-						Node nextSibling = (Node) startNode;
-						while (nextSibling != null) {
-							Node currentNode = nextSibling;
-							nextSibling = currentNode.getNextSibling();
-
-							removeAdapterFromNodeAndChildren(currentNode, 0);
-						}
-					}
-				}
-			}
-			finally {
-				if (sModel != null) {
-					sModel.releaseFromRead();
-				}
-			}
-		}
-
-		if (debugProjectionPerf) {
-			long end = System.currentTimeMillis();
-			System.out.println("StructuredTextFoldingProviderXML.removeAllAdapters: " + (end - start)); //$NON-NLS-1$
-		}
-	}
-
-	public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
-		// if folding is enabled and new document is going to be a totally
-		// different document, disable projection
-		if ((fDocument != null) && (fDocument != newInput)) {
-			// disable projection and disconnect everything
-			projectionDisabled();
-			fProjectionNeedsToBeEnabled = true;
-		}
-	}
-
-	public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
-		// if projection was previously enabled before input document changed
-		// and new document is different than old document
-		if (fProjectionNeedsToBeEnabled && (fDocument == null) && (newInput != null)) {
-			projectionEnabled();
-			fProjectionNeedsToBeEnabled = false;
-		}
-	}
-
-	/**
-	 * Disconnect this IStructuredTextFoldingProvider from projection viewer
-	 */
-	public void uninstall() {
-		if (isInstalled()) {
-			projectionDisabled();
-
-			fViewer.removeProjectionListener(this);
-			fViewer.removeTextInputListener(this);
-			fViewer = null;
-		}
-	}
-}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLCommentFoldingPosition.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLCommentFoldingPosition.java
new file mode 100644
index 0000000..d9740e9
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLCommentFoldingPosition.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal.projection;
+
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredCommentFoldingPosition;
+
+/**
+ *
+ */
+public class XMLCommentFoldingPosition extends AbstractStructuredCommentFoldingPosition {
+
+	/**
+	 * The region covering an XML comment
+	 */
+	private IStructuredDocumentRegion fRegion;
+	
+	/**
+	 * Create a folding position to cover a XML comment region
+	 * 
+	 * @param region
+	 */
+	public XMLCommentFoldingPosition(IStructuredDocumentRegion region) {
+		//can't use region.getLength here because doesn't work in DTD docs for some reason
+		super(region.getStartOffset(), region.getEndOffset() - region.getStartOffset());
+		this.fRegion = region;
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredCommentFoldingPosition#getEndOffset()
+	 */
+	protected int getEndOffset() {
+		return fRegion.getEndOffset();
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredCommentFoldingPosition#getStartOffset()
+	 */
+	protected int getStartOffset() {
+		return fRegion.getStartOffset();
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLElementFoldingPosition.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLElementFoldingPosition.java
new file mode 100644
index 0000000..233e301
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLElementFoldingPosition.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal.projection;
+
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingPosition;
+
+/**
+ * Folds an XML element
+ */
+public class XMLElementFoldingPosition extends AbstractStructuredFoldingPosition {
+
+	/**
+	 * The region representing the start of the folding region
+	 */
+	private IStructuredDocumentRegion fStartRegion;
+	
+	/**
+	 * The region representing the end of the folding region, or <code>null</code>
+	 * if the entire folding region is represented by <code>fStartRegion</code>
+	 */
+	private IStructuredDocumentRegion fEndRegion;
+	
+	/**
+	 * <p>Used to represent a folding position that covers a single
+	 * {@link IStructuredDocumentRegion}.</p>
+	 * 
+	 * @param region the region that covers the entire position of the folding region
+	 */
+	public XMLElementFoldingPosition(IStructuredDocumentRegion region) {
+		super(region.getStartOffset(), region.getEndOffset()-region.getStartOffset());
+		this.fStartRegion = region;
+		this.fEndRegion = null;
+	}
+	
+	/**
+	 * <p>Used to represent a folding position that covers more then one
+	 * {@link IStructuredDocumentRegion}.</p>
+	 * 
+	 * @param startRegion the first region covered by this position
+	 * @param endRegion the last region covered by this position
+	 */
+	public XMLElementFoldingPosition(IStructuredDocumentRegion startRegion, IStructuredDocumentRegion endRegion) {
+		super(startRegion.getStartOffset(), endRegion.getEndOffset()-startRegion.getStartOffset());
+		this.fStartRegion = startRegion;
+		this.fEndRegion = endRegion;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingPosition#getStartOffset()
+	 */
+	protected int getStartOffset() {
+		return fStartRegion.getStartOffset();
+	}
+	
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingPosition#getEndOffset()
+	 */
+	protected int getEndOffset() {
+		int endOffset;
+		if(fEndRegion != null) {
+			endOffset = fEndRegion.getEndOffset();
+		} else {
+			endOffset = fStartRegion.getEndOffset();
+		}
+		return endOffset;
+	}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLFoldingStrategy.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLFoldingStrategy.java
new file mode 100644
index 0000000..227f9d8
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/XMLFoldingStrategy.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal.projection;
+
+import org.eclipse.jface.text.Position;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy;
+import org.eclipse.wst.xml.core.internal.document.CommentImpl;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
+
+
+/**
+ * A folding strategy for XML type structured documents.
+ * See AbstractStructuredFoldingStrategy for more details.
+ */
+public class XMLFoldingStrategy extends AbstractStructuredFoldingStrategy {
+
+	/**
+	 * Create an instance of the folding strategy.
+	 * Be sure to set the viewer and document after creation.
+	 */
+	public XMLFoldingStrategy() {
+		super();
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.projection.AbstractFoldingStrategy#calcNewFoldPosition(org.eclipse.wst.sse.core.internal.provisional.IndexedRegion)
+	 */
+	protected Position calcNewFoldPosition(IndexedRegion indexedRegion) {
+		Position retPos = null;
+		
+		//only want to fold regions of the valid type and with a valid range
+		if(indexedRegion.getStartOffset() >= 0 && indexedRegion.getLength() >= 0) {
+			IDOMNode node = (IDOMNode)indexedRegion;
+			IStructuredDocumentRegion startRegion = node.getStartStructuredDocumentRegion();
+			IStructuredDocumentRegion endRegion = node.getEndStructuredDocumentRegion();
+			
+			//if the node has an endRegion (end tag) then folding region is
+			//	between the start and end tag
+			//else if the region is a comment
+			//else if the region is only an open tag or an open/close tag then don't fold it
+			if(startRegion != null && endRegion != null) {
+				retPos = new XMLElementFoldingPosition(startRegion, endRegion);
+			} else if(startRegion != null && indexedRegion instanceof CommentImpl) {
+				retPos = new XMLCommentFoldingPosition(startRegion);
+			}
+		}
+		
+		return retPos;
+	}
+
+	/**
+	 * @see org.eclipse.wst.sse.ui.internal.projection.AbstractFoldingStrategy#indexedRegionValidType(org.eclipse.wst.sse.core.internal.provisional.IndexedRegion)
+	 */
+	protected boolean indexedRegionValidType(IndexedRegion indexedRegion) {
+		return (indexedRegion instanceof IDOMNode) && !(indexedRegion instanceof IDOMText);
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/XMLPropertySource.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/XMLPropertySource.java
index 3f8ce7f..d9c2ed4 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/XMLPropertySource.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/XMLPropertySource.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -53,13 +53,16 @@
 public class XMLPropertySource implements IPropertySource, IPropertySourceExtension, IPropertySource2 {
 	protected final static String CATEGORY_ATTRIBUTES = XMLUIMessages.XMLPropertySourceAdapter_0;
 
+	/**
+	 * Controls whether optional attributes are marked as for "experts"
+	 */
 	private static final boolean fSetExpertFilter = false;
 
 	/**
-	 * derive categories from CMDataTypes; disabled until display strings can
-	 * be planned
+	 * Controls whether to derive categories from CMDataTypes; disabled by
+	 * default until display strings can be planned
 	 */
-	private final static boolean fShouldDeriveCategories = false;
+	private boolean fShouldDeriveCategories = false;
 
 	private final static boolean fSortEnumeratedValues = true;
 
@@ -78,30 +81,40 @@
 		super();
 		fNode = initNode(target);
 		fCaseSensitive = initCaseSensitive(fNode);
-
 	}
 
-	/** seperate method just to isolate error processing */
-	private Node initNode(INodeNotifier target) {
-		Node node = null;
+	public XMLPropertySource(Node target, boolean useCategories) {
+		super();
+		initNode(target);
+		fNode = target;
+		fCaseSensitive = initCaseSensitive(fNode);
+		fShouldDeriveCategories = useCategories;
+	}
+
+	/** Separate method just to isolate error processing */
+	private static INodeNotifier initNode(Node target) {
+		if (target instanceof INodeNotifier) {
+			return (INodeNotifier) target;
+		}
+		throw new IllegalArgumentException("XMLPropertySource is only for INodeNotifiers"); //$NON-NLS-1$
+	}
+
+	/** Separate method just to isolate error processing */
+	private static Node initNode(INodeNotifier target) {
 		if (target instanceof Node) {
-			node = (Node) target;
+			return (Node) target;
 		}
-		else {
-			throw new IllegalArgumentException("XMLPropertySource is only for Nodes"); //$NON-NLS-1$
-		}
-		return node;
+		throw new IllegalArgumentException("XMLPropertySource is only for W3C DOM Nodes"); //$NON-NLS-1$
 	}
 
 	private boolean initCaseSensitive(Node node) {
-		// almost all tags are case senstive, except that old HTML
+		// almost all tags are case sensitive, except that old HTML
 		boolean caseSensitive = true;
-		DocumentTypeAdapter adapter = null;
 		if (node instanceof IDOMNode) {
-			adapter = getDocTypeFromDOMNode(node);
-		}
-		if (adapter != null) {
-			caseSensitive = (adapter.getTagNameCase() == DocumentTypeAdapter.STRICT_CASE);
+			DocumentTypeAdapter adapter = getDocTypeFromDOMNode(node);
+			if (adapter != null) {
+				caseSensitive = (adapter.getTagNameCase() == DocumentTypeAdapter.STRICT_CASE);
+			}
 		}
 		return caseSensitive;
 	}
@@ -211,7 +224,7 @@
 		// The descriptor class used here is also used in
 		// updatePropertyDescriptors()
 		TextPropertyDescriptor descriptor = new TextPropertyDescriptor(attributeName, attributeName);
-		descriptor.setCategory(getCategory(null));
+		descriptor.setCategory(getCategory(null, null));
 		descriptor.setDescription(attributeName);
 		if (hideOnFilter && fSetExpertFilter) {
 			descriptor.setFilterFlags(new String[]{IPropertySheetEntry.FILTER_ID_EXPERT});
@@ -227,11 +240,11 @@
 	 * exists and it is a valid value, a combo box featuring the correct
 	 * values with the current one visible is returned
 	 */
-	private IPropertyDescriptor createEnumeratedPropertyDescriptor(CMAttributeDeclaration attrDecl, CMDataType valuesHelper) {
+	private IPropertyDescriptor createEnumeratedPropertyDescriptor(CMAttributeDeclaration attrDecl, CMDataType valuesHelper, Attr attr) {
 		// the displayName MUST be set
-		EnumeratedStringPropertyDescriptor descriptor = new EnumeratedStringPropertyDescriptor(attrDecl.getAttrName(), attrDecl.getAttrName(), _getValidStrings(attrDecl, valuesHelper));
-		descriptor.setCategory(getCategory(attrDecl));
 		String attrName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
+		EnumeratedStringPropertyDescriptor descriptor = new EnumeratedStringPropertyDescriptor(attrName, attrName, _getValidStrings(attrDecl, valuesHelper));
+		descriptor.setCategory(getCategory(attrDecl, attr));
 		descriptor.setDescription(attrName);
 		if ((attrDecl.getUsage() != CMAttributeDeclaration.REQUIRED) && fSetExpertFilter) {
 			descriptor.setFilterFlags(new String[]{IPropertySheetEntry.FILTER_ID_EXPERT});
@@ -247,34 +260,35 @@
 	 * is the fixed/default value, no cell editor is provided "locking" the
 	 * value in
 	 */
-	private IPropertyDescriptor createFixedPropertyDescriptor(CMAttributeDeclaration attrDecl, CMDataType helper) {
+	private IPropertyDescriptor createFixedPropertyDescriptor(CMAttributeDeclaration attrDecl, CMDataType helper, Attr attr) {
 		// the displayName MUST be set
-		EnumeratedStringPropertyDescriptor descriptor = new EnumeratedStringPropertyDescriptor(attrDecl.getNodeName(), attrDecl.getNodeName(), _getValidFixedStrings(attrDecl, helper));
-		descriptor.setCategory(getCategory(attrDecl));
+		String attrName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
+		EnumeratedStringPropertyDescriptor descriptor = new EnumeratedStringPropertyDescriptor(attrName, attrName, _getValidFixedStrings(attrDecl, helper));
+		descriptor.setCategory(getCategory(attrDecl, attr));
 		descriptor.setDescription(DOMNamespaceHelper.computeName(attrDecl, fNode, null));
 		return descriptor;
 	}
 
-	protected IPropertyDescriptor createPropertyDescriptor(CMAttributeDeclaration attrDecl) {
+	protected IPropertyDescriptor createPropertyDescriptor(CMAttributeDeclaration attrDecl, Attr attr) {
 		IPropertyDescriptor descriptor = null;
 		CMDataType attrType = attrDecl.getAttrType();
 
 		if (attrType != null) {
 			// handle declarations that provide FIXED/ENUMERATED values
 			if ((attrType.getEnumeratedValues() != null) && (attrType.getEnumeratedValues().length > 0)) {
-				descriptor = createEnumeratedPropertyDescriptor(attrDecl, attrType);
+				descriptor = createEnumeratedPropertyDescriptor(attrDecl, attrType, attr);
 			}
 			else if (((attrDecl.getUsage() == CMAttributeDeclaration.FIXED) || (attrType.getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED)) && (attrType.getImpliedValue() != null)) {
-				descriptor = createFixedPropertyDescriptor(attrDecl, attrType);
+				descriptor = createFixedPropertyDescriptor(attrDecl, attrType, attr);
 			}
 			else {
 				// plain text
-				descriptor = createTextPropertyDescriptor(attrDecl);
+				descriptor = createTextPropertyDescriptor(attrDecl, attr);
 			}
 		}
 		else {
 			// no extra information given
-			descriptor = createTextPropertyDescriptor(attrDecl);
+			descriptor = createTextPropertyDescriptor(attrDecl, attr);
 		}
 		return descriptor;
 	}
@@ -330,16 +344,20 @@
 				}
 				// be consistent: if there's metainfo, use *that* as the
 				// descriptor ID
+				descriptor = null;
 				if (attrDecl != null) {
-					descriptor = createPropertyDescriptor(attrDecl);
-					if (descriptor != null) {
-						names.add(attrDecl.getNodeName());
+					String attrName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
+					if (!names.contains(attrName)) {
+						descriptor = createPropertyDescriptor(attrDecl, attr);
+						if (descriptor != null)
+							names.add(attrName);
 					}
 				}
 				else {
-					descriptor = createDefaultPropertyDescriptor(attr.getName());
-					if (descriptor != null) {
-						names.add(attr.getName());
+					if (!names.contains(attr.getName())) {
+						descriptor = createDefaultPropertyDescriptor(attr.getName());
+						if (descriptor != null)
+							names.add(attr.getName());
 					}
 				}
 				if (descriptor != null) {
@@ -354,7 +372,7 @@
 				attrDecl = (CMAttributeDeclaration) attrMap.item(i);
 				String attrName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
 				if (!names.contains(attrName)) {
-					IPropertyDescriptor holdDescriptor = createPropertyDescriptor(attrDecl);
+					IPropertyDescriptor holdDescriptor = createPropertyDescriptor(attrDecl, null);
 					if (holdDescriptor != null) {
 						names.add(attrName);
 						descriptorList.add(holdDescriptor);
@@ -372,8 +390,9 @@
 					attrDecl = (CMAttributeDeclaration) node;
 					String attrName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
 					if (!names.contains(attrName)) {
-						IPropertyDescriptor holdDescriptor = createPropertyDescriptor(attrDecl);
+						IPropertyDescriptor holdDescriptor = createPropertyDescriptor(attrDecl, null);
 						if (holdDescriptor != null) {
+							names.add(attrName);
 							descriptorList.add(holdDescriptor);
 						}
 					}
@@ -389,10 +408,10 @@
 		return descriptors;
 	}
 
-	private IPropertyDescriptor createTextPropertyDescriptor(CMAttributeDeclaration attrDecl) {
+	private IPropertyDescriptor createTextPropertyDescriptor(CMAttributeDeclaration attrDecl, Attr attr) {
 		String attrName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
 		TextPropertyDescriptor descriptor = new TextPropertyDescriptor(attrName, attrName);
-		descriptor.setCategory(getCategory(attrDecl));
+		descriptor.setCategory(getCategory(attrDecl, attr));
 		descriptor.setDescription(attrName);
 		if ((attrDecl.getUsage() != CMAttributeDeclaration.REQUIRED) && fSetExpertFilter) {
 			descriptor.setFilterFlags(new String[]{IPropertySheetEntry.FILTER_ID_EXPERT});
@@ -400,12 +419,19 @@
 		return descriptor;
 	}
 
-	private String getCategory(CMAttributeDeclaration attrDecl) {
+	private String getCategory(CMAttributeDeclaration attrDecl, Attr attr) {
+		if (attr != null) {
+			String namespaceURI = attr.getNamespaceURI();
+			if (namespaceURI == null)
+				namespaceURI = attr.getOwnerElement().getNamespaceURI();
+			if (namespaceURI != null)
+				return namespaceURI;
+		}
 		if (attrDecl != null) {
 			if (attrDecl.supports("category")) { //$NON-NLS-1$
 				return (String) attrDecl.getProperty("category"); //$NON-NLS-1$
 			}
-			if (fShouldDeriveCategories && (attrDecl.getAttrType() != null) && (attrDecl.getAttrType().getNodeName() != null) && (attrDecl.getAttrType().getNodeName().length() > 0)) {
+			if (fShouldDeriveCategories && (attrDecl.getAttrType() != null) && (attrDecl.getAttrType().getDataTypeName() != null) && (attrDecl.getAttrType().getDataTypeName().length() > 0)) {
 				return attrDecl.getAttrType().getDataTypeName();
 			}
 		}
@@ -501,36 +527,7 @@
 	}
 
 	public boolean isPropertyResettable(Object id) {
-		boolean resettable = false;
-		String property = id.toString();
-		CMNamedNodeMap attrDecls = null;
-
-		CMElementDeclaration ed = getDeclaration();
-		if (ed != null) {
-			attrDecls = ed.getAttributes();
-			CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attrDecls);
-			List nodes = ModelQueryUtil.getModelQuery(fNode.getOwnerDocument()).getAvailableContent((Element) fNode, ed, ModelQuery.INCLUDE_ATTRIBUTES);
-			for (int k = 0; k < nodes.size(); k++) {
-				CMNode cmnode = (CMNode) nodes.get(k);
-				if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
-					allAttributes.put(cmnode);
-				}
-			}
-			attrDecls = allAttributes;
-		}
-
-		if (attrDecls != null) {
-			CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) attrDecls.getNamedItem(property);
-			if (attrDecl != null) {
-				if (attrDecl.getAttrType() != null) {
-					CMDataType helper = attrDecl.getAttrType();
-					if ((helper.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE) && (helper.getImpliedValue() != null)) {
-						resettable = true;
-					}
-				}
-			}
-		}
-		return resettable;
+		return fNode != null && fNode.getNodeType() == Node.ELEMENT_NODE;
 	}
 
 	/**
@@ -574,7 +571,6 @@
 
 	/**
 	 * Resets the specified property's value to its default value.
-	 * 
 	 */
 	public void resetPropertyValue(Object propertyObject) {
 		String property = propertyObject.toString();
@@ -610,11 +606,13 @@
 				((Attr) attrMap.getNamedItem(property)).setValue(defValue);
 			}
 			else {
-				attrMap.removeNamedItem(property);
+				// remember, this method is for reset, not remove
+				((Attr) attrMap.getNamedItem(property)).setValue(""); //$NON-NLS-1$
 			}
 		}
 		else {
-			attrMap.removeNamedItem(property);
+			// remember, this method is for reset, not remove
+			((Attr) attrMap.getNamedItem(property)).setValue(""); //$NON-NLS-1$
 		}
 	}
 
@@ -632,7 +630,7 @@
 		}
 		fValuesBeingSet.push(nameObject);
 		String name = nameObject.toString();
-		String valueString = null;
+		String valueString = ""; //$NON-NLS-1$
 		if (value != null) {
 			valueString = value.toString();
 		}
@@ -657,16 +655,14 @@
 				}
 				else {
 					// NEW(?) value
-					if (value != null) { // never create an empty attribute
-						Attr newAttr = fNode.getOwnerDocument().createAttribute(name);
-						if (newAttr instanceof IDOMNode) {
-							((IDOMNode) newAttr).setValueSource(valueString);
-						}
-						else {
-							newAttr.setValue(valueString);
-						}
-						attrMap.setNamedItem(newAttr);
+					Attr newAttr = fNode.getOwnerDocument().createAttribute(name);
+					if (newAttr instanceof IDOMNode) {
+						((IDOMNode) newAttr).setValueSource(valueString);
 					}
+					else {
+						newAttr.setValue(valueString);
+					}
+					attrMap.setNamedItem(newAttr);
 				}
 			}
 			else {
@@ -704,11 +700,14 @@
 		if (ed != null) {
 			attrMap = ed.getAttributes();
 			CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attrMap);
-			List nodes = ModelQueryUtil.getModelQuery(fNode.getOwnerDocument()).getAvailableContent((Element) fNode, ed, ModelQuery.INCLUDE_ATTRIBUTES);
-			for (int k = 0; k < nodes.size(); k++) {
-				CMNode cmnode = (CMNode) nodes.get(k);
-				if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
-					allAttributes.put(cmnode);
+			ModelQuery modelQuery = ModelQueryUtil.getModelQuery(fNode.getOwnerDocument());
+			if(modelQuery != null) {
+			List nodes = modelQuery.getAvailableContent((Element) fNode, ed, ModelQuery.INCLUDE_ATTRIBUTES);
+				for (int k = 0; k < nodes.size(); k++) {
+					CMNode cmnode = (CMNode) nodes.get(k);
+					if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
+						allAttributes.put(cmnode);
+					}
 				}
 			}
 			attrMap = allAttributes;
@@ -735,7 +734,7 @@
 						}
 						// Replace with better descriptor
 						else if ((validValues != null) && (validValues.length > 0)) {
-							fDescriptors[j] = createPropertyDescriptor(attrDecl);
+							fDescriptors[j] = createPropertyDescriptor(attrDecl, null);
 						}
 					}
 				}
@@ -776,7 +775,7 @@
 				String attrName = DOMNamespaceHelper.computeName(attrDecl, fNode, null);
 				if (fCaseSensitive) {
 					if (!descriptorNames.contains(attrName)) {
-						IPropertyDescriptor descriptor = createPropertyDescriptor(attrDecl);
+						IPropertyDescriptor descriptor = createPropertyDescriptor(attrDecl, null);
 						if (descriptor != null) {
 							descriptorNames.add(attrName);
 							descriptors.add(descriptor);
@@ -790,7 +789,7 @@
 					}
 					if (!exists) {
 						descriptorNames.add(attrName);
-						IPropertyDescriptor descriptor = createPropertyDescriptor(attrDecl);
+						IPropertyDescriptor descriptor = createPropertyDescriptor(attrDecl, null);
 						if (descriptor != null) {
 							descriptorNames.add(attrName);
 							descriptors.add(descriptor);
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/quickoutline/XMLContentSelectionProvider.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/quickoutline/XMLContentSelectionProvider.java
new file mode 100644
index 0000000..a3c9c75
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/quickoutline/XMLContentSelectionProvider.java
@@ -0,0 +1,46 @@
+package org.eclipse.wst.xml.ui.internal.quickoutline;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.wst.sse.ui.IContentSelectionProvider;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Node;
+
+public class XMLContentSelectionProvider implements IContentSelectionProvider {
+
+	public ISelection getSelection(TreeViewer viewer, ISelection selection) {
+		ISelection filteredSelection = selection;
+		if (selection instanceof IStructuredSelection) {
+			Object[] filteredNodes = getFilteredNodes(((IStructuredSelection) selection).toArray());
+			filteredSelection = new StructuredSelection(filteredNodes);
+		}
+		return filteredSelection;
+	}
+
+	private Object[] getFilteredNodes(Object[] filteredNodes) {
+		for (int i = 0; i < filteredNodes.length; i++) {
+			filteredNodes[i] = getFilteredNode(filteredNodes[i]);
+		}
+		return filteredNodes;
+	}
+
+	private Object getFilteredNode(Object object) {
+		if (object instanceof Node) {
+			Node node = (Node) object;
+			short nodeType = node.getNodeType();
+			// replace attribute node in selection with its parent
+			if (nodeType == Node.ATTRIBUTE_NODE) {
+				node = ((Attr) node).getOwnerElement();
+			}
+			// anything else not visible, replace with parent node
+			else if (nodeType == Node.TEXT_NODE) {
+				node = node.getParentNode();
+			}
+			return node;
+		}
+		return object;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/quickoutline/XMLQuickOutlineConfiguration.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/quickoutline/XMLQuickOutlineConfiguration.java
new file mode 100644
index 0000000..16d21a1
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/quickoutline/XMLQuickOutlineConfiguration.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal.quickoutline;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.wst.sse.ui.IContentSelectionProvider;
+import org.eclipse.wst.sse.ui.quickoutline.AbstractQuickOutlineConfiguration;
+import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeContentProvider;
+import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
+
+public class XMLQuickOutlineConfiguration extends AbstractQuickOutlineConfiguration {
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.sse.ui.IOutlineContentManager#getContentProvider()
+	 */
+	public ITreeContentProvider getContentProvider() {
+		return new JFaceNodeContentProvider();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.sse.ui.IOutlineContentManager#getContentSelectionProvider()
+	 */
+	public IContentSelectionProvider getContentSelectionProvider() {
+		return new XMLContentSelectionProvider();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.sse.ui.IOutlineContentManager#getLabelProvider()
+	 */
+	public ILabelProvider getLabelProvider() {
+		return new JFaceNodeLabelProvider();
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/spelling/SpellcheckDelegateAdapterFactory.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/spelling/SpellcheckDelegateAdapterFactory.java
new file mode 100644
index 0000000..6323b1a
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/spelling/SpellcheckDelegateAdapterFactory.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal.spelling;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.ui.internal.spelling.ISpellcheckDelegate;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.w3c.dom.Text;
+import org.w3c.dom.Comment;
+
+/**
+ * An <code>IAdapterFactory</code> to adapt an <code>IDOMModel</code> to a
+ * <code>ISpellcheckDelegate</code>.
+ */
+public class SpellcheckDelegateAdapterFactory implements IAdapterFactory {
+	/**
+	 * This list of classes this factory adapts to.
+	 */
+	private static final Class[] ADAPTER_LIST = new Class[]{ISpellcheckDelegate.class};
+	
+	/**
+	 * The <code>ISpellcheckDelegate</code> this factory adapts to
+	 */
+	private static final ISpellcheckDelegate DELEGATE = new XMLSpellcheckDelegate();
+	
+	/**
+	 * Implementation of <code>ISpellcheckDelegate</code> for XML type documents.
+	 */
+	private static class XMLSpellcheckDelegate implements ISpellcheckDelegate {
+		
+		/**
+		 * If the region in the given <code>model</code> at the given <code>offset</code> is a
+		 * <code>Comment</code> region then it should be spell checked, otherwise it should not.
+		 * 
+		 * @see org.eclipse.wst.sse.ui.internal.spelling.ISpellcheckDelegate#shouldSpellcheck(org.eclipse.wst.sse.core.internal.provisional.IndexedRegion)
+		 */
+		public boolean shouldSpellcheck(int offset, IStructuredModel model) {
+			boolean shouldSpellcheck = true;
+			
+			IndexedRegion region = model.getIndexedRegion(offset);
+			if(region != null) {
+				shouldSpellcheck = (region instanceof Comment || region instanceof Text);
+			}
+			
+			return shouldSpellcheck;
+		}
+		
+	}
+	
+	/** 
+	 * Adapts <code>IDOMModel</code> to <code>ISpellcheckDelegate</code>.
+	 * 
+	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
+	 */
+	public Object getAdapter(Object adaptableObject, Class adapterType) {
+		ISpellcheckDelegate decision = null;
+		
+		if (adaptableObject instanceof IDOMModel && ISpellcheckDelegate.class.equals(adapterType)) {
+			decision = DELEGATE;
+		}
+		
+		return decision;
+	}
+
+	/**
+	 *  This adapter only adapts to <code>ISpellcheckDelegate</code>
+	 *  
+	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
+	 */
+	public Class[] getAdapterList() {
+		return ADAPTER_LIST;
+	}
+
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/LineStyleProviderForXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/LineStyleProviderForXML.java
index 2584548..1241201 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/LineStyleProviderForXML.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/LineStyleProviderForXML.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -36,77 +36,77 @@
 		if (region == null) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.CDATA_TEXT);
 		}
+		
 		String type = region.getType();
-		if ((type == DOMRegionContext.XML_CONTENT) || (type == DOMRegionContext.XML_DOCTYPE_INTERNAL_SUBSET)) {
+		if ((type == DOMRegionContext.XML_CONTENT) || (type == DOMRegionContext.XML_DOCTYPE_INTERNAL_SUBSET) || (type == DOMRegionContext.UNDEFINED)) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
 		}
-		else if ((type == DOMRegionContext.XML_TAG_OPEN) || (type == DOMRegionContext.XML_END_TAG_OPEN) || (type == DOMRegionContext.XML_TAG_CLOSE) || (type == DOMRegionContext.XML_EMPTY_TAG_CLOSE)) {
+		if ((type == DOMRegionContext.XML_TAG_OPEN) || (type == DOMRegionContext.XML_END_TAG_OPEN) || (type == DOMRegionContext.XML_TAG_CLOSE) || (type == DOMRegionContext.XML_EMPTY_TAG_CLOSE)) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_BORDER);
 		}
-		else if ((type == DOMRegionContext.XML_CDATA_OPEN) || (type == DOMRegionContext.XML_CDATA_CLOSE)) {
+		if ((type == DOMRegionContext.XML_CDATA_OPEN) || (type == DOMRegionContext.XML_CDATA_CLOSE)) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.CDATA_BORDER);
 		}
-		else if (type == DOMRegionContext.XML_CDATA_TEXT) {
+		if (type == DOMRegionContext.XML_CDATA_TEXT) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.CDATA_TEXT);
 		}
-		else if (type == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
+		if (type == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
 		}
-		else if (type == DOMRegionContext.XML_DOCTYPE_DECLARATION) {
+		if (type == DOMRegionContext.XML_DOCTYPE_DECLARATION) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_NAME);
 		}
-		else if (type == DOMRegionContext.XML_TAG_NAME) {
+		if (type == DOMRegionContext.XML_TAG_NAME) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_NAME);
 		}
-		else if ((type == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)) {
+		if ((type == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
 		}
-		else if (type == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
+		if (type == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
 		}
-		else if ((type == DOMRegionContext.XML_COMMENT_OPEN) || (type == DOMRegionContext.XML_COMMENT_CLOSE)) {
+		if ((type == DOMRegionContext.XML_COMMENT_OPEN) || (type == DOMRegionContext.XML_COMMENT_CLOSE)) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.COMMENT_BORDER);
 		}
-		else if (type == DOMRegionContext.XML_COMMENT_TEXT) {
+		if (type == DOMRegionContext.XML_COMMENT_TEXT) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.COMMENT_TEXT);
 		}
-		else if (type == DOMRegionContext.XML_DOCTYPE_NAME) {
+		if (type == DOMRegionContext.XML_DOCTYPE_NAME) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.DOCTYPE_NAME);
 		}
-		else if ((type == DOMRegionContext.XML_CHAR_REFERENCE) || (type == DOMRegionContext.XML_ENTITY_REFERENCE) || (type == DOMRegionContext.XML_PE_REFERENCE)) {
+		if ((type == DOMRegionContext.XML_CHAR_REFERENCE) || (type == DOMRegionContext.XML_ENTITY_REFERENCE) || (type == DOMRegionContext.XML_PE_REFERENCE)) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.ENTITY_REFERENCE);
 		}
-		else if (type == DOMRegionContext.XML_PI_CONTENT) {
+		if (type == DOMRegionContext.XML_PI_CONTENT) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.PI_CONTENT);
 		}
-		else if ((type == DOMRegionContext.XML_PI_OPEN) || (type == DOMRegionContext.XML_PI_CLOSE)) {
+		if ((type == DOMRegionContext.XML_PI_OPEN) || (type == DOMRegionContext.XML_PI_CLOSE)) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.PI_BORDER);
 		}
-		else if ((type == DOMRegionContext.XML_DECLARATION_OPEN) || (type == DOMRegionContext.XML_DECLARATION_CLOSE)) {
+		if ((type == DOMRegionContext.XML_DECLARATION_OPEN) || (type == DOMRegionContext.XML_DECLARATION_CLOSE)) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.DECL_BORDER);
 		}
-		else if (type == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSREF) {
+		if (type == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSREF) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF);
 		}
-		else if (type == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBREF) {
+		if (type == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBREF) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF);
 		}
-		else if ((type == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBLIC) || (type == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSTEM)) {
+		if ((type == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_PUBLIC) || (type == DOMRegionContext.XML_DOCTYPE_EXTERNAL_ID_SYSTEM)) {
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
 		}
-		else if (type == DOMRegionContext.UNDEFINED) {
-			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.CDATA_TEXT);
-		}
-		else if (type == DOMRegionContext.WHITE_SPACE) {
-			// white space is normall not on its own ... but when it is, we'll
-			// treat as content
+		if (type == DOMRegionContext.WHITE_SPACE) {
+			/*
+			 * White space is normally not on its own ... but when it is,
+			 * we'll treat as content
+			 */
 			return (TextAttribute) getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
 		}
-		else {
-			// default, return null to signal "not handled"
-			// in which case, other factories should be tried
-			return null;
-		}
+		/*
+		 * default, return null to signal "not handled" in which case, other
+		 * providers should be tried
+		 */
+		return null;
 	}
 
 	protected IPreferenceStore getColorPreferences() {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/MarkupTagInfoProvider.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/MarkupTagInfoProvider.java
index 47513ef..9615ad4 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/MarkupTagInfoProvider.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/MarkupTagInfoProvider.java
@@ -75,6 +75,12 @@
 			sb.append(dataTypeName);
 			sb.append(PARAGRAPH_END);
 		}
+		String defaultValue = dataType.getImpliedValue();
+		if(defaultValue != null) {
+			sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Default_Value____6 + SPACE + BOLD_END);
+			sb.append(defaultValue);
+			sb.append(PARAGRAPH_END);
+		}
 		String[] enumeratedValue = dataType.getEnumeratedValues();
 		if ((enumeratedValue != null) && (enumeratedValue.length > 0)) {
 			sb.append(PARAGRAPH_START + BOLD_START + XMLUIMessages.Enumerated_Values____5 + SPACE + BOLD_END);
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/text/CharacterPairInserter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/text/CharacterPairInserter.java
new file mode 100644
index 0000000..2f61324
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/text/CharacterPairInserter.java
@@ -0,0 +1,106 @@
+/*******************************************************************************

+ * Copyright (c) 2009, 2010 IBM Corporation and others.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ *

+ * Contributors:

+ *     IBM Corporation - initial API and implementation

+ *******************************************************************************/

+package org.eclipse.wst.xml.ui.internal.text;

+

+import org.eclipse.jface.preference.IPreferenceStore;

+import org.eclipse.jface.text.IDocument;

+import org.eclipse.jface.text.source.ISourceViewer;

+import org.eclipse.jface.util.IPropertyChangeListener;

+import org.eclipse.jface.util.PropertyChangeEvent;

+import org.eclipse.swt.graphics.Point;

+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;

+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;

+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;

+import org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter;

+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;

+import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;

+import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;

+

+public class CharacterPairInserter extends AbstractCharacterPairInserter implements IPropertyChangeListener {

+

+	// preferences

+	private boolean fCloseStrings = true;

+	private boolean fCloseBrackets = true;

+

+	protected boolean shouldPair(ISourceViewer viewer, char c) {

+		switch (c) {

+			case '\'':

+			case '"':

+				return fCloseStrings ? checkRegion(viewer) : false;

+			default:

+				return fCloseBrackets;

+		}

+	}

+

+	/**

+	 * Checks if the region should support paired quotes

+	 * @param viewer the viewer

+	 * @return true if the region is not in an XML attribute value

+	 */

+	private boolean checkRegion(ISourceViewer viewer) {

+		IDocument doc = viewer.getDocument();

+		final Point selection= viewer.getSelectedRange();

+		final int offset= selection.x;

+

+		if (doc instanceof IStructuredDocument) {

+			IStructuredDocumentRegion[] regions = ((IStructuredDocument) doc).getStructuredDocumentRegions(offset, 0);

+			if (regions != null && regions.length > 0) {

+				ITextRegion region = regions[0].getRegionAtCharacterOffset(offset);

+				return region != null && region.getType() != DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE;

+			}

+		}

+		return true;

+	}

+

+	public boolean hasPair(char c) {

+		switch (c) {

+			case '"':

+			case '\'':

+			case '[':

+			case '(':

+				return true;

+			default:

+				return false;

+		}

+	}

+

+	protected char getPair(char c) {

+		switch (c) {

+			case '\'':

+			case '"':

+				return c;

+			case '(':

+				return ')';

+			case '[':

+				return ']';

+			default:

+				throw new IllegalArgumentException();

+		}

+	}

+

+	public void initialize() {

+		IPreferenceStore store = XMLUIPlugin.getInstance().getPreferenceStore();

+		fCloseStrings = store.getBoolean(XMLUIPreferenceNames.TYPING_CLOSE_STRINGS);

+		fCloseBrackets = store.getBoolean(XMLUIPreferenceNames.TYPING_CLOSE_BRACKETS);

+		store.addPropertyChangeListener(this);

+	}

+

+	public void dispose() {

+		XMLUIPlugin.getInstance().getPreferenceStore().removePropertyChangeListener(this);

+	}

+

+	public void propertyChange(PropertyChangeEvent event) {

+		if (XMLUIPreferenceNames.TYPING_CLOSE_BRACKETS.equals(event.getProperty()))

+			fCloseBrackets = ((Boolean) event.getNewValue()).booleanValue();

+		else if (XMLUIPreferenceNames.TYPING_CLOSE_STRINGS.equals(event.getProperty()))

+			fCloseStrings = ((Boolean) event.getNewValue()).booleanValue();

+	}

+}

diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidator.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidator.java
index 3973bab..9a2c070 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidator.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -19,12 +19,16 @@
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.ui.internal.reconcile.validator.AnnotationInfo;
+import org.eclipse.wst.sse.ui.internal.reconcile.validator.IncrementalReporter;
 import org.eclipse.wst.validation.internal.core.IMessageAccess;
 import org.eclipse.wst.validation.internal.core.ValidationException;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
@@ -39,6 +43,8 @@
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
+import org.eclipse.wst.xml.core.internal.validation.AnnotationMsg;
+import org.eclipse.wst.xml.ui.internal.Logger;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
@@ -64,6 +70,9 @@
 	protected static final String TEXT_ENTITY_REFERENCE = "TEXT_ENTITY_REFERENCE"; //$NON-NLS-1$
 	protected static final String VALUE_OF_ATTRIBUTE_WITH_GIVEN_VALUE = "VALUE_OF_ATTRIBUTE_WITH_GIVEN_VALUE"; //$NON-NLS-1$
 	protected static final String END_TAG = "END_TAG"; //$NON-NLS-1$
+	private static final String QUICKASSISTPROCESSOR = IQuickAssistProcessor.class.getName();
+	
+
 
 	/**
 	 * This constant specifies the attribute name that specifies the side of
@@ -201,7 +210,13 @@
 		if (delta.length > 0) {
 			// get the file, model and document:
 			IFile file = getFile(delta[0]);
-			IDOMModel xmlModel = getModelForResource(file);
+			IDOMModel xmlModel = null;
+			if (file != null)
+				xmlModel = getModelForResource(file);
+			// some problem occurred, abort
+			if (xmlModel == null)
+				return;
+			
 			try {
 				IDOMDocument document = xmlModel.getDocument();
 
@@ -262,20 +277,48 @@
 			try {
 				if (message.getAttribute(COLUMN_NUMBER_ATTRIBUTE) != null) {
 					int column = ((Integer) message.getAttribute(COLUMN_NUMBER_ATTRIBUTE)).intValue();
-					String selectionStrategy = (String) message.getAttribute(SQUIGGLE_SELECTION_STRATEGY_ATTRIBUTE);
-					String nameOrValue = (String) message.getAttribute(SQUIGGLE_NAME_OR_VALUE_ATTRIBUTE);
-
-					// convert the line and Column numbers to an offset:
-					int start = document.getStructuredDocument().getLineOffset(message.getLineNumber() - 1) + column - 1;
-
-					// calculate the "better" start and end offset:
-					int[] result = computeStartAndEndLocation(start, selectionStrategy, getErrorSide(message), nameOrValue, document);
-					if (result != null) {
-						message.setOffset(result[0]);
-						message.setLength(result[1] - result[0]);
-						reporter.addMessage(this, message);
+					if (message.getAttribute(AnnotationMsg.PROBMLEM_ID) != null && reporter instanceof IncrementalReporter){
+						Integer problemId = (Integer)message.getAttribute(AnnotationMsg.PROBMLEM_ID);
+						MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
+						processor.setProblemId(problemId.intValue());
+						message.setOffset(column);
+						Integer length = (Integer) message.getAttribute(AnnotationMsg.LENGTH);
+						message.setLength( length.intValue());
+						Object attrValue = message.getAttribute(AnnotationMsg.ATTRVALUETEXT);
+						if (attrValue != null)
+							processor.setAdditionalFixInfo(attrValue);
+						else{
+							Object attrValueNo = message.getAttribute(AnnotationMsg.ATTRVALUENO);
+							if (attrValueNo != null){
+								int len = ((Integer)attrValueNo).intValue();
+								Object[] objArray = new Object[len];
+								for ( int j=0; j<len; j++){
+									objArray[j] = message.getAttribute(AnnotationMsg.ATTRNO + j);
+								}
+								processor.setAdditionalFixInfo(objArray);
+							}
+							
+						}
+						message.setAttribute(QUICKASSISTPROCESSOR, processor);
+						AnnotationInfo info = new AnnotationInfo(message);
+						((IncrementalReporter) reporter).addAnnotationInfo(this, info);
 					}
-				}
+					else  {
+						String selectionStrategy = (String) message.getAttribute(SQUIGGLE_SELECTION_STRATEGY_ATTRIBUTE);
+						String nameOrValue = (String) message.getAttribute(SQUIGGLE_NAME_OR_VALUE_ATTRIBUTE);
+
+						// convert the line and Column numbers to an offset:
+						int start = document.getStructuredDocument().getLineOffset(message.getLineNumber() - 1) + column - 1;
+						int[] result = computeStartAndEndLocation(start, selectionStrategy, getErrorSide(message), nameOrValue, document);
+						if (result != null) {
+							message.setOffset(result[0]);
+							message.setLength(result[1] - result[0]);
+						
+							reporter.addMessage(this, message);
+						}
+					}
+					}
+				
 			}
 			catch (BadLocationException e) { // this exception should not
 				// occur - it is thrown if
@@ -293,9 +336,12 @@
 	 * @return the IFile
 	 */
 	public IFile getFile(String delta) {
-		IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(delta));
-		if (file != null && file.exists())
-		  return file;
+		IPath path = new Path(delta);
+		if (path.segmentCount() > 1) {
+		  IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+		  if (file != null && file.exists())
+		    return file;
+		}
 		return null;
 	}
 
@@ -303,7 +349,7 @@
 	 * 
 	 * @param file
 	 *            the file to get the model for
-	 * @return the file's XMLModel
+	 * @return the file's XMLModel or null
 	 */
 	protected IDOMModel getModelForResource(IFile file) {
 		IStructuredModel model = null;
@@ -314,10 +360,14 @@
 			// TODO.. HTML validator tries again to get a model a 2nd way
 		}
 		catch (Exception e) {
-			// e.printStackTrace();
+			Logger.log(Logger.ERROR_DEBUG, file.getFullPath().toString(), e);
 		}
 
-		return model instanceof IDOMModel ? (IDOMModel) model : null;
+		if (model instanceof IDOMModel)
+			return (IDOMModel) model;
+		if (model != null)
+			model.releaseFromRead();
+		return null;
 	}
 
 	/**
@@ -426,7 +476,9 @@
 						IDOMAttr attributeNode = (IDOMAttr) (element.getAttributeNode(nameOrValue));
 						if (attributeNode != null) {
 							startEndPositions[0] = attributeNode.getValueRegionStartOffset();
-							startEndPositions[1] = startEndPositions[0] + attributeNode.getValueRegionText().length();
+							String valueRegionText = attributeNode.getValueRegionText();
+							int valueRegionLength = valueRegionText == null ? 0 : valueRegionText.length(); 
+							startEndPositions[1] = startEndPositions[0] + valueRegionLength;
 						}
 					}
 				}
@@ -464,7 +516,7 @@
 
 						}
 						start = start + index;
-						startEndPositions[0] = start + index;
+						startEndPositions[0] = start;
 						startEndPositions[1] = start + value.trim().length();
 					}
 					else if (node.getNodeType() == Node.ELEMENT_NODE) {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupQuickAssistProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupQuickAssistProcessor.java
index c8c876c..c5bb299 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupQuickAssistProcessor.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupQuickAssistProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,8 +18,8 @@
 import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
 import org.eclipse.jface.text.source.Annotation;
 import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xml.core.internal.validation.ProblemIDsXML;
 import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.correction.ProblemIDsXML;
 import org.eclipse.wst.xml.ui.internal.correction.RemoveUnknownElementQuickFixProposal;
 import org.eclipse.wst.xml.ui.internal.correction.RenameInFileQuickAssistProposal;
 import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupValidator.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupValidator.java
index a23c8f2..d228699 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupValidator.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupValidator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,6 +12,22 @@
  *******************************************************************************/
 package org.eclipse.wst.xml.ui.internal.validation;
 
+import java.util.Locale;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceProxy;
+import org.eclipse.core.resources.IResourceProxyVisitor;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.core.runtime.content.IContentType;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IRegion;
@@ -26,11 +42,15 @@
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
 import org.eclipse.wst.sse.ui.internal.reconcile.AbstractStructuredTextReconcilingStrategy;
 import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
-import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
 import org.eclipse.wst.sse.ui.internal.reconcile.validator.AnnotationInfo;
 import org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator;
 import org.eclipse.wst.sse.ui.internal.reconcile.validator.IncrementalReporter;
+import org.eclipse.wst.validation.AbstractValidator;
+import org.eclipse.wst.validation.ValidationResult;
+import org.eclipse.wst.validation.ValidationState;
+import org.eclipse.wst.validation.internal.core.Message;
 import org.eclipse.wst.validation.internal.core.ValidationException;
+import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
 import org.eclipse.wst.validation.internal.operations.LocalizedMessage;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
 import org.eclipse.wst.validation.internal.provisional.core.IReporter;
@@ -38,52 +58,65 @@
 import org.eclipse.wst.validation.internal.provisional.core.IValidator;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.core.internal.validation.ProblemIDsXML;
 import org.eclipse.wst.xml.ui.internal.Logger;
 import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.correction.ProblemIDsXML;
 import org.w3c.dom.Node;
 
 /**
- * Basic XML syntax checking step. Only used as ISourceValidator at the
- * moment
+ * Basic XML syntax checking step.
+ * @deprecated No longer used as the source validator for XML documents. Instead {@link DelegatingSourceValidatorForXML}
+ * is the source validator, and the markup validation is done as a step in {@link XMLValidator} by {@link org.eclipse.wst.xml.core.internal.validation.MarkupValidator}.
  * 
- * @author pavery
+ *  @see org.eclipse.wst.xml.core.internal.validation.MarkupValidator
+ *  @see DelegatingSourceValidatorForXML
+ *  @see XMLValidator
  */
-public class MarkupValidator implements IValidator, ISourceValidator {
+public class MarkupValidator extends AbstractValidator implements IValidator, ISourceValidator {
 	private String DQUOTE = "\""; //$NON-NLS-1$
-
-	protected String SEVERITY_ATTR_MISSING_VALUE = TemporaryAnnotation.ANNOT_ERROR;
-	protected String SEVERITY_ATTR_NO_VALUE = TemporaryAnnotation.ANNOT_ERROR;
-	// severities for the problems discoverable by this reconciler; possibly
-	// user configurable later
-	protected String SEVERITY_GENERIC_ILLFORMED_SYNTAX = TemporaryAnnotation.ANNOT_WARNING;
-	protected String SEVERITY_STRUCTURE = TemporaryAnnotation.ANNOT_ERROR;
-	protected String SEVERITY_SYNTAX_ERROR = TemporaryAnnotation.ANNOT_ERROR;
-	// used for attribute quote checking
 	private String SQUOTE = "'"; //$NON-NLS-1$
 	private final String QUICKASSISTPROCESSOR = IQuickAssistProcessor.class.getName();
 
 	private IDocument fDocument;
 
-	private void addAttributeError(String messageText, String attributeValueText, int start, int length, int problemId, IStructuredDocumentRegion sdRegion, IReporter reporter) {
+	private IContentType fRootContentType = null;
+
+    private int SEVERITY_ATTRIBUTE_HAS_NO_VALUE = IMessage.HIGH_SEVERITY;
+	private int SEVERITY_END_TAG_WITH_ATTRIBUTES = IMessage.HIGH_SEVERITY;
+	private int SEVERITY_INVALID_WHITESPACE_BEFORE_TAGNAME = IMessage.HIGH_SEVERITY;
+	private int SEVERITY_MISSING_CLOSING_BRACKET = IMessage.HIGH_SEVERITY;
+	private int SEVERITY_MISSING_CLOSING_QUOTE = IMessage.HIGH_SEVERITY;
+	private int SEVERITY_MISSING_END_TAG = IMessage.HIGH_SEVERITY;
+	private int SEVERITY_MISSING_START_TAG = IMessage.HIGH_SEVERITY;
+	private int SEVERITY_MISSING_QUOTES = IMessage.HIGH_SEVERITY;
+	private int SEVERITY_NAMESPACE_IN_PI_TARGET = IMessage.HIGH_SEVERITY;
+	private int SEVERITY_TAG_NAME_MISSING = IMessage.HIGH_SEVERITY;
+	private int SEVERITY_WHITESPACE_AT_START = IMessage.HIGH_SEVERITY;
+        
+	private void addAttributeError(String messageText, String attributeValueText, int start, int length, int problemId, IStructuredDocumentRegion sdRegion, IReporter reporter, int messageSeverity) {
 
 		if (sdRegion.isDeleted()) {
 			return;
 		}
 
 		int lineNo = getLineNumber(start);
-		LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
+		LocalizedMessage message = new LocalizedMessage(messageSeverity, messageText);
 		message.setOffset(start);
 		message.setLength(length);
 		message.setLineNo(lineNo);
 
-		MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
-		processor.setProblemId(problemId);
-		processor.setAdditionalFixInfo(attributeValueText);
-		message.setAttribute(QUICKASSISTPROCESSOR, processor);
 
-		AnnotationInfo info = new AnnotationInfo(message);
-		((IncrementalReporter) reporter).addAnnotationInfo(this, info);
+		if (reporter instanceof IncrementalReporter) {
+			MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
+			processor.setProblemId(problemId);
+			processor.setAdditionalFixInfo(attributeValueText);
+			message.setAttribute(QUICKASSISTPROCESSOR, processor);
+			AnnotationInfo info = new AnnotationInfo(message);
+			((IncrementalReporter) reporter).addAnnotationInfo(this, info);
+		}
+		else {
+			reporter.addMessage(this, message);
+		}
 	}
 
 	private void checkAttributesInEndTag(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
@@ -110,17 +143,22 @@
 		if (errorCount > 0) {
 			// Position p = new Position(start, end - start);
 			String messageText = XMLUIMessages.End_tag_has_attributes;
-			LocalizedMessage message = new LocalizedMessage(IMessage.NORMAL_SEVERITY, messageText);
+			LocalizedMessage message = new LocalizedMessage(SEVERITY_END_TAG_WITH_ATTRIBUTES, messageText);
 			message.setOffset(start);
 			message.setLength(end - start);
 			message.setLineNo(getLineNumber(start));
 
-			MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
-			processor.setProblemId(ProblemIDsXML.AttrsInEndTag);
-			message.setAttribute(QUICKASSISTPROCESSOR, processor);
+			if (reporter instanceof IncrementalReporter) {
+				MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
+				processor.setProblemId(ProblemIDsXML.AttrsInEndTag);
+				message.setAttribute(QUICKASSISTPROCESSOR, processor);
 
-			AnnotationInfo info = new AnnotationInfo(message);
-			((IncrementalReporter) reporter).addAnnotationInfo(this, info);
+				AnnotationInfo info = new AnnotationInfo(message);
+				((IncrementalReporter) reporter).addAnnotationInfo(this, info);
+			}
+			else {
+				reporter.addMessage(this, message);
+			}
 		}
 	}
 
@@ -148,17 +186,22 @@
 			int length = structuredDocumentRegion.getText().trim().length();
 			int lineNo = getLineNumber(start);
 
-			LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
+			LocalizedMessage message = new LocalizedMessage(SEVERITY_MISSING_CLOSING_BRACKET , messageText);
 			message.setOffset(start);
 			message.setLength(length);
 			message.setLineNo(lineNo);
 
-			MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
-			processor.setProblemId(ProblemIDsXML.MissingClosingBracket);
-			message.setAttribute(QUICKASSISTPROCESSOR, processor);
+			if (reporter instanceof IncrementalReporter) {
+				MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
+				processor.setProblemId(ProblemIDsXML.MissingClosingBracket);
+				message.setAttribute(QUICKASSISTPROCESSOR, processor);
 
-			AnnotationInfo info = new AnnotationInfo(message);
-			((IncrementalReporter) reporter).addAnnotationInfo(this, info);
+				AnnotationInfo info = new AnnotationInfo(message);
+				((IncrementalReporter) reporter).addAnnotationInfo(this, info);
+			}
+			else {
+				reporter.addMessage(this, message);
+			}
 		}
 	}
 
@@ -178,17 +221,22 @@
 				int length = structuredDocumentRegion.getLength();
 				int lineNo = getLineNumber(start);
 
-				LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
+				LocalizedMessage message = new LocalizedMessage(SEVERITY_TAG_NAME_MISSING , messageText);
 				message.setOffset(start);
 				message.setLength(length);
 				message.setLineNo(lineNo);
 
-				MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
-				processor.setProblemId(ProblemIDsXML.EmptyTag);
-				message.setAttribute(QUICKASSISTPROCESSOR, processor);
+				if (reporter instanceof IncrementalReporter) {
+					MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
+					processor.setProblemId(ProblemIDsXML.EmptyTag);
+					message.setAttribute(QUICKASSISTPROCESSOR, processor);
 
-				AnnotationInfo info = new AnnotationInfo(message);
-				((IncrementalReporter) reporter).addAnnotationInfo(this, info);
+					AnnotationInfo info = new AnnotationInfo(message);
+					((IncrementalReporter) reporter).addAnnotationInfo(this, info);
+				}
+				else {
+					reporter.addMessage(this, message);
+				}
 			}
 		}
 	}
@@ -196,7 +244,7 @@
 	private int getLineNumber(int start) {
 		int lineNo = -1;
 		try {
-			lineNo = getDocument().getLineOfOffset(start);
+			lineNo = getDocument().getLineOfOffset(start) + 1;
 		}
 		catch (BadLocationException e) {
 			Logger.logException(e);
@@ -205,7 +253,6 @@
 	}
 
 	private void checkForAttributeValue(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-
 		if (structuredDocumentRegion.isDeleted()) {
 			return;
 		}
@@ -235,7 +282,7 @@
 						int lineNo = getLineNumber(start);
 						int textLength = structuredDocumentRegion.getText(nameRegion).trim().length();
 
-						LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
+						LocalizedMessage message = new LocalizedMessage(SEVERITY_ATTRIBUTE_HAS_NO_VALUE , messageText);
 						message.setOffset(start);
 						message.setLength(textLength);
 						message.setLineNo(lineNo);
@@ -245,17 +292,18 @@
 						int insertOffset = structuredDocumentRegion.getTextEndOffset(equalsRegion) - end;
 						Object[] additionalFixInfo = {structuredDocumentRegion.getText(nameRegion), new Integer(insertOffset)};
 
-						MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
-						processor.setProblemId(ProblemIDsXML.MissingAttrValue);
-						processor.setAdditionalFixInfo(additionalFixInfo);
-						message.setAttribute(QUICKASSISTPROCESSOR, processor);
+						if (reporter instanceof IncrementalReporter) {
+							MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
+							processor.setProblemId(ProblemIDsXML.MissingAttrValue);
+							processor.setAdditionalFixInfo(additionalFixInfo);
+							message.setAttribute(QUICKASSISTPROCESSOR, processor);
 
-						AnnotationInfo info = new AnnotationInfo(message);
-
-						((IncrementalReporter) reporter).addAnnotationInfo(this, info);
-
-						// annotation.setAdditionalFixInfo(additionalFixInfo);
-						// results.add(annotation);
+							AnnotationInfo info = new AnnotationInfo(message);
+							((IncrementalReporter) reporter).addAnnotationInfo(this, info);
+						}
+						else {
+							reporter.addMessage(this, message);
+						}
 						errorCount++;
 					}
 				}
@@ -270,19 +318,23 @@
 						int textLength = structuredDocumentRegion.getText(previousRegion).trim().length();
 						int lineNo = getLineNumber(start);
 
-						LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
+						LocalizedMessage message = new LocalizedMessage(SEVERITY_ATTRIBUTE_HAS_NO_VALUE, messageText);
 						message.setOffset(start);
 						message.setLength(textLength);
 						message.setLineNo(lineNo);
 
-						MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
-						processor.setProblemId(ProblemIDsXML.NoAttrValue);
-						processor.setAdditionalFixInfo(structuredDocumentRegion.getText(previousRegion));
-						message.setAttribute(QUICKASSISTPROCESSOR, processor);
+						if (reporter instanceof IncrementalReporter) {
+							MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
+							processor.setProblemId(ProblemIDsXML.NoAttrValue);
+							processor.setAdditionalFixInfo(structuredDocumentRegion.getText(previousRegion));
+							message.setAttribute(QUICKASSISTPROCESSOR, processor);
 
-						AnnotationInfo info = new AnnotationInfo(message);
-
-						((IncrementalReporter) reporter).addAnnotationInfo(this, info);
+							AnnotationInfo info = new AnnotationInfo(message);
+							((IncrementalReporter) reporter).addAnnotationInfo(this, info);
+						}
+						else {
+							reporter.addMessage(this, message);
+						}
 
 						errorCount++;
 					}
@@ -317,17 +369,22 @@
 					// find length of whitespace
 					int length = sdRegionText.trim().equals("") ? sdRegionText.length() : sdRegionText.indexOf(sdRegionText.trim()); //$NON-NLS-1$
 
-					LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
+					LocalizedMessage message = new LocalizedMessage(SEVERITY_INVALID_WHITESPACE_BEFORE_TAGNAME , messageText);
 					message.setOffset(start);
 					message.setLength(length);
 					message.setLineNo(getLineNumber(start));
 
-					MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
-					processor.setProblemId(ProblemIDsXML.SpacesBeforeTagName);
-					message.setAttribute(QUICKASSISTPROCESSOR, processor);
+					if (reporter instanceof IncrementalReporter) {
+						MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
+						processor.setProblemId(ProblemIDsXML.SpacesBeforeTagName);
+						message.setAttribute(QUICKASSISTPROCESSOR, processor);
 
-					AnnotationInfo info = new AnnotationInfo(message);
-					((IncrementalReporter) reporter).addAnnotationInfo(this, info);
+						AnnotationInfo info = new AnnotationInfo(message);
+						((IncrementalReporter) reporter).addAnnotationInfo(this, info);
+					}
+					else {
+						reporter.addMessage(this, message);
+					}
 				}
 			}
 		}
@@ -353,17 +410,22 @@
 					int start = structuredDocumentRegion.getStartOffset(r) + index;
 					int length = piText.trim().length() - index;
 
-					LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
+					LocalizedMessage message = new LocalizedMessage(SEVERITY_NAMESPACE_IN_PI_TARGET , messageText);
 					message.setOffset(start);
 					message.setLength(length);
 					message.setLineNo(getLineNumber(start));
 
-					MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
-					processor.setProblemId(ProblemIDsXML.NamespaceInPI);
-					message.setAttribute(QUICKASSISTPROCESSOR, processor);
+					if (reporter instanceof IncrementalReporter) {
+						MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
+						processor.setProblemId(ProblemIDsXML.NamespaceInPI);
+						message.setAttribute(QUICKASSISTPROCESSOR, processor);
 
-					AnnotationInfo info = new AnnotationInfo(message);
-					((IncrementalReporter) reporter).addAnnotationInfo(this, info);
+						AnnotationInfo info = new AnnotationInfo(message);
+						((IncrementalReporter) reporter).addAnnotationInfo(this, info);
+					}
+					else {
+						reporter.addMessage(this, message);
+					}
 
 					errorCount++;
 				}
@@ -414,13 +476,13 @@
 				if (one.equals(DQUOTE) || one.equals(SQUOTE)) {
 					// missing closing quote
 					String message = XMLUIMessages.ReconcileStepForMarkup_0;
-					addAttributeError(message, attrValueText, structuredDocumentRegion.getStartOffset(r), attrValueText.trim().length(), ProblemIDsXML.Unclassified, structuredDocumentRegion, reporter);
+					addAttributeError(message, attrValueText, structuredDocumentRegion.getStartOffset(r), attrValueText.trim().length(), ProblemIDsXML.Unclassified, structuredDocumentRegion, reporter, SEVERITY_MISSING_CLOSING_QUOTE);
 					errorCount++;
 				}
 				else {
 					// missing both
 					String message = XMLUIMessages.ReconcileStepForMarkup_1;
-					addAttributeError(message, attrValueText, structuredDocumentRegion.getStartOffset(r), attrValueText.trim().length(), ProblemIDsXML.AttrValueNotQuoted, structuredDocumentRegion, reporter);
+					addAttributeError(message, attrValueText, structuredDocumentRegion.getStartOffset(r), attrValueText.trim().length(), ProblemIDsXML.AttrValueNotQuoted, structuredDocumentRegion, reporter, SEVERITY_MISSING_QUOTES);
 					errorCount++;
 				}
 			}
@@ -428,7 +490,7 @@
 				if ((one.equals(SQUOTE) && !two.equals(SQUOTE)) || (one.equals(DQUOTE) && !two.equals(DQUOTE))) {
 					// missing closing quote
 					String message = XMLUIMessages.ReconcileStepForMarkup_0;
-					addAttributeError(message, attrValueText, structuredDocumentRegion.getStartOffset(r), attrValueText.trim().length(), ProblemIDsXML.Unclassified, structuredDocumentRegion, reporter);
+					addAttributeError(message, attrValueText, structuredDocumentRegion.getStartOffset(r), attrValueText.trim().length(), ProblemIDsXML.Unclassified, structuredDocumentRegion, reporter, SEVERITY_MISSING_CLOSING_QUOTE);
 					errorCount++;
 				}
 			}
@@ -451,45 +513,45 @@
 
 		boolean selfClosed = false;
 		String tagName = null;
-		int length = 0;
 
+		/**
+		 * For tags that aren't meant to be EMPTY, make sure it's empty or has an end tag
+		 */
 		if (xmlNode.isContainer()) {
 			IStructuredDocumentRegion endRegion = xmlNode.getEndStructuredDocumentRegion();
 			if (endRegion == null) {
 				IStructuredDocumentRegion startRegion = xmlNode.getStartStructuredDocumentRegion();
-				if (!startRegion.isDeleted()) {
+				if (startRegion != null && !startRegion.isDeleted() && DOMRegionContext.XML_TAG_OPEN.equals(startRegion.getFirstRegion().getType())) {
 					// analyze the tag (check self closing)
 					ITextRegionList regions = startRegion.getRegions();
 					ITextRegion r = null;
+					int start = sdRegion.getStart();
+					int length = sdRegion.getTextLength();
 					for (int i = 0; i < regions.size(); i++) {
 						r = regions.get(i);
-						if ((r.getType() == DOMRegionContext.XML_TAG_OPEN) || (r.getType() == DOMRegionContext.XML_TAG_CLOSE)) {
-							length++;
-						}
-						else if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
+						if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
 							tagName = sdRegion.getText(r);
-							length += tagName.length();
+							start = sdRegion.getStartOffset(r);
+							length = r.getTextLength();
 						}
 						else if (r.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
 							selfClosed = true;
 						}
 					}
 
+
 					if (!selfClosed && (tagName != null)) {
 						Object[] args = {tagName};
 						String messageText = NLS.bind(XMLUIMessages.Missing_end_tag_, args);
 
-						int start = sdRegion.getStart();
 						int lineNumber = getLineNumber(start);
 
-						// SEVERITY_STRUCTURE == IMessage.HIGH_SEVERITY
-						IMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
+						IMessage message = new LocalizedMessage(SEVERITY_MISSING_END_TAG , messageText);
 						message.setOffset(start);
 						message.setLength(length);
 						message.setLineNo(lineNumber);
 
 						if (reporter instanceof IncrementalReporter) {
-
 							Object[] additionalFixInfo = getStartEndFixInfo(xmlNode, tagName, r);
 
 							MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
@@ -507,7 +569,88 @@
 					}
 				}
 			}
+			else {
+				IStructuredDocumentRegion startRegion = xmlNode.getStartStructuredDocumentRegion();
+				if (startRegion == null || startRegion.isDeleted()) {
+					// analyze the tag (check self closing)
+					ITextRegionList regions = endRegion.getRegions();
+					ITextRegion r = null;
+					int start = sdRegion.getStart();
+					int length = sdRegion.getTextLength();
+					for (int i = 0; i < regions.size(); i++) {
+						r = regions.get(i);
+						if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
+							tagName = sdRegion.getText(r);
+							start = sdRegion.getStartOffset(r);
+							length = r.getTextLength();
+						}
+					}
 
+					if (tagName != null) {
+						Object[] args = {tagName};
+						String messageText = NLS.bind(XMLUIMessages.Missing_start_tag_, args);
+
+						int lineNumber = getLineNumber(start);
+
+						IMessage message = new LocalizedMessage(SEVERITY_MISSING_START_TAG, messageText);
+						message.setOffset(start);
+						message.setLength(length);
+						message.setLineNo(lineNumber);
+
+						if (reporter instanceof IncrementalReporter) {
+							Object[] additionalFixInfo = getStartEndFixInfo(xmlNode, tagName, r);
+
+							MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
+							processor.setProblemId(ProblemIDsXML.MissingStartTag);
+							processor.setAdditionalFixInfo(additionalFixInfo);
+							message.setAttribute(QUICKASSISTPROCESSOR, processor);
+
+							AnnotationInfo info = new AnnotationInfo(message);
+
+							((IncrementalReporter) reporter).addAnnotationInfo(this, info);
+						}
+						else {
+							reporter.addMessage(this, message);
+						}
+					}
+				}
+			}
+
+		}
+		/*
+		 * Check for an end tag that has no start tag
+		 */
+		else {
+			IStructuredDocumentRegion startRegion = xmlNode.getStartStructuredDocumentRegion();
+			if (startRegion == null) {
+				IStructuredDocumentRegion endRegion = xmlNode.getEndStructuredDocumentRegion();
+				if (!endRegion.isDeleted()) {
+					// get name
+					ITextRegionList regions = endRegion.getRegions();
+					ITextRegion r = null;
+					for (int i = 0; i < regions.size(); i++) {
+						r = regions.get(i);
+						if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
+							tagName = sdRegion.getText(r);
+						}
+					}
+
+					if (!selfClosed && (tagName != null)) {
+						String messageText = XMLUIMessages.Indicate_no_grammar_specified_severities_error;
+
+						int start = sdRegion.getStart();
+						int lineNumber = getLineNumber(start);
+
+						// SEVERITY_STRUCTURE == IMessage.HIGH_SEVERITY
+						IMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
+						message.setOffset(start);
+						message.setLength(sdRegion.getTextLength());
+						message.setLineNo(lineNumber);
+
+						reporter.addMessage(this, message);
+					}
+				}
+			}
 		}
 	}
 
@@ -544,18 +687,22 @@
 				int start = prev.getStartOffset();
 				int length = prev.getLength();
 
-				LocalizedMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, messageText);
+				LocalizedMessage message = new LocalizedMessage(SEVERITY_WHITESPACE_AT_START , messageText);
 				message.setOffset(start);
 				message.setLength(length);
 				message.setLineNo(getLineNumber(start));
 
-				MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
-				processor.setProblemId(ProblemIDsXML.SpacesBeforePI);
-				message.setAttribute(QUICKASSISTPROCESSOR, processor);
-
-				AnnotationInfo info = new AnnotationInfo(message);
-				((IncrementalReporter) reporter).addAnnotationInfo(this, info);
-
+				if (reporter instanceof IncrementalReporter) {
+					MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
+					processor.setProblemId(ProblemIDsXML.SpacesBeforePI);
+					message.setAttribute(QUICKASSISTPROCESSOR, processor);
+	
+					AnnotationInfo info = new AnnotationInfo(message);
+					((IncrementalReporter) reporter).addAnnotationInfo(this, info);
+				}
+				else {
+					reporter.addMessage(this, message);
+				}
 				// Position p = new Position(start, length);
 				//				
 				// ReconcileAnnotationKey key =
@@ -712,6 +859,9 @@
 			checkClosingBracket(structuredDocumentRegion, reporter);
 		}
 		else if (isEndTag(structuredDocumentRegion)) {
+			// check if ending tag was started
+			checkStartEndTagPairs(structuredDocumentRegion, reporter);
+			// check for attributes in an end tag
 			checkAttributesInEndTag(structuredDocumentRegion, reporter);
 			// check that the closing '>' is there
 			checkClosingBracket(structuredDocumentRegion, reporter);
@@ -724,15 +874,169 @@
 		else if (isXMLContent(structuredDocumentRegion)) {
 			checkForSpaceBeforeName(structuredDocumentRegion, reporter);
 		}
+		else if (isXMLDoctypeDeclaration(structuredDocumentRegion)) {
+			checkDocumentTypeReferences(structuredDocumentRegion, reporter);
+		}
+	}
+
+	/**
+	 * @param structuredDocumentRegion
+	 * @param reporter
+	 */
+	private void checkDocumentTypeReferences(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
+	}
+
+	/**
+	 * @param structuredDocumentRegion
+	 * @return
+	 */
+	private boolean isXMLDoctypeDeclaration(IStructuredDocumentRegion structuredDocumentRegion) {
+		if ((structuredDocumentRegion == null) || structuredDocumentRegion.isDeleted()) {
+			return false;
+		}
+		return structuredDocumentRegion.getFirstRegion().getType() == DOMRegionContext.XML_DECLARATION_OPEN && structuredDocumentRegion.getType().equals(DOMRegionContext.XML_DOCTYPE_DECLARATION);
 	}
 
 	public void cleanup(IReporter reporter) {
-		// TODO Auto-generated method stub
-
+		fDocument = null;
 	}
 
 	public void validate(IValidationContext helper, IReporter reporter) throws ValidationException {
-		// TODO Auto-generated method stub
+		String[] uris = helper.getURIs();
+		IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
+		if (uris.length > 0) {
+			IFile currentFile = null;
 
+			for (int i = 0; i < uris.length && !reporter.isCancelled(); i++) {
+				// might be called with just project path?
+				IPath path = new Path(uris[i]);
+				if (path.segmentCount() > 1) {
+					currentFile = wsRoot.getFile(path);
+					if (shouldValidate(currentFile, true)) {
+						validateV1File(currentFile, reporter);
+					}
+				}
+				else if (uris.length == 1) {
+					validateV1Project(helper, reporter);
+				}
+			}
+		}
+		else
+			validateV1Project(helper, reporter);
+	}
+	
+	private boolean shouldValidate(IResourceProxy proxy) {
+		if(proxy.getType() == IResource.FILE) {
+			String name = proxy.getName();
+			if(name.toLowerCase(Locale.US).endsWith(".xml")) {
+				return true;
+			}
+		}
+		return shouldValidate(proxy.requestResource(), false);
+	}
+	
+	private boolean shouldValidate(IResource file, boolean checkExtension) {
+		if (file == null || !file.exists() || file.getType() != IResource.FILE)
+			return false;
+		if (checkExtension) {
+			String extension = file.getFileExtension();
+			if (extension != null && "xml".endsWith(extension.toLowerCase(Locale.US)))
+				return true;
+		}
+
+		IContentDescription contentDescription = null;
+		try {
+			contentDescription = ((IFile) file).getContentDescription();
+			if (contentDescription != null) {
+				IContentType contentType = contentDescription.getContentType();
+				return contentDescription != null && contentType.isKindOf(getXMLContentType());
+			}
+		}
+		catch (CoreException e) {
+			Logger.logException(e);
+		}
+		return false;
+	}
+
+	/**
+	 * @param helper
+	 * @param reporter
+	 */
+	private void validateV1Project(IValidationContext helper, final IReporter reporter) {
+		// if uris[] length 0 -> validate() gets called for each project
+		if (helper instanceof IWorkbenchContext) {
+			IProject project = ((IWorkbenchContext) helper).getProject();
+			IResourceProxyVisitor visitor = new IResourceProxyVisitor() {
+				public boolean visit(IResourceProxy proxy) throws CoreException {
+					if (shouldValidate(proxy)) {
+						validateV1File((IFile) proxy.requestResource(), reporter);
+					}
+					return true;
+				}
+			};
+			try {
+				// collect all jsp files for the project
+				project.accept(visitor, IResource.DEPTH_INFINITE);
+			}
+			catch (CoreException e) {
+				Logger.logException(e);
+			}
+		}
+	}
+	
+
+	/**
+	 * @param currentFile
+	 * @param reporter
+	 */
+	private void validateV1File(IFile currentFile, IReporter reporter) {
+		Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, currentFile.getFullPath().toString().substring(1));
+		reporter.displaySubtask(MarkupValidator.this, message);
+
+		IStructuredModel model = null;
+		try {
+			model = StructuredModelManager.getModelManager().getModelForRead(currentFile);
+			IStructuredDocument document = null;
+			if (model != null) {
+				document = model.getStructuredDocument();
+				connect(document);
+				IStructuredDocumentRegion validationRegion = document.getFirstStructuredDocumentRegion();
+				while (validationRegion != null) {
+					validate(validationRegion, reporter);
+					validationRegion = validationRegion.getNext();
+				}
+				disconnect(document);
+			}
+		}
+		catch (Exception e) {
+			Logger.logException(e);
+		}
+		finally {
+			if (model != null) {
+				model.releaseFromRead();
+			}
+		}
+	}
+
+	/**
+	 * @return
+	 */
+	private IContentType getXMLContentType() {
+		if (fRootContentType == null) {
+			fRootContentType = Platform.getContentTypeManager().getContentType("org.eclipse.core.runtime.xml");
+		}
+		return fRootContentType;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.validation.AbstractValidator#validate(org.eclipse.core.resources.IResource, int, org.eclipse.wst.validation.ValidationState, org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
+		if (resource.getType() != IResource.FILE)
+			return null;
+		ValidationResult result = new ValidationResult();
+		IReporter reporter = result.getReporter(monitor);
+		validateV1File((IFile) resource, reporter);
+		return result;
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/AbstractXMLContentOutlineConfiguration.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/AbstractXMLContentOutlineConfiguration.java
new file mode 100644
index 0000000..00b2cf5
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/AbstractXMLContentOutlineConfiguration.java
@@ -0,0 +1,342 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.views.contentoutline;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.util.LocalSelectionTransfer;
+import org.eclipse.jface.util.SafeRunnable;
+import org.eclipse.jface.util.TransferDragSourceListener;
+import org.eclipse.jface.util.TransferDropTargetListener;
+import org.eclipse.jface.viewers.IContentProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DragSourceEvent;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.ui.internal.IReleasable;
+import org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration;
+import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
+import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeContentProvider;
+import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
+import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
+import org.eclipse.wst.xml.ui.internal.dnd.DragNodeCommand;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Node;
+
+/**
+ * Basic Outline Configuration for generic XML support.  Expects that the viewer's
+ * input will be the DOM Model, and provides basic label and content providers.
+ * 
+ * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
+ * @since 3.1
+ */
+public abstract class AbstractXMLContentOutlineConfiguration extends ContentOutlineConfiguration {
+	private class ActionManagerMenuListener implements IMenuListener, IReleasable {
+		private XMLNodeActionManager fActionManager;
+		private TreeViewer fTreeViewer;
+
+		public ActionManagerMenuListener(TreeViewer viewer) {
+			fTreeViewer = viewer;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.eclipse.jface.action.IMenuListener#menuAboutToShow(org.eclipse.jface.action.IMenuManager)
+		 */
+		public void menuAboutToShow(IMenuManager manager) {
+			if (fActionManager == null) {
+				fActionManager = createNodeActionManager(fTreeViewer);
+			}
+			if (fActionManager != null) {
+				fActionManager.fillContextMenu(manager, fTreeViewer.getSelection());
+			}
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.eclipse.wst.sse.ui.internal.IReleasable#release()
+		 */
+		public void release() {
+			fTreeViewer = null;
+			if (fActionManager != null) {
+				fActionManager.setModel(null);
+			}
+		}
+	}
+	
+	private static class StatusLineLabelProvider extends JFaceNodeLabelProvider {
+		public StatusLineLabelProvider() {
+			super();
+		}
+
+		public String getText(Object element) {
+			if (element == null)
+				return null;
+
+			if (!(element instanceof Node)) {
+				return super.getText(element);
+			}
+
+			StringBuffer s = new StringBuffer();
+			Node node = (Node) element;
+			while (node != null) {
+				if (node.getNodeType() != Node.DOCUMENT_NODE) {
+					s.insert(0, super.getText(node));
+				}
+				
+				if (node.getNodeType() == Node.ATTRIBUTE_NODE)
+					node = ((Attr) node).getOwnerElement();
+				else
+					node = node.getParentNode();
+			
+				if (node != null && node.getNodeType() != Node.DOCUMENT_NODE) {
+					s.insert(0, IPath.SEPARATOR);
+				}
+			}
+			return s.toString();
+		}
+	}
+
+	private IContentProvider fContentProvider = null;
+
+	private ActionManagerMenuListener fContextMenuFiller = null;
+
+	private ILabelProvider fLabelProvider = null;
+
+	boolean fShowAttributes = false;
+
+	private ILabelProvider fSimpleLabelProvider;
+	private TransferDragSourceListener[] fTransferDragSourceListeners;
+
+	private TransferDropTargetListener[] fTransferDropTargetListeners;
+
+	/**
+	 * Create new instance of XMLContentOutlineConfiguration
+	 */
+	public AbstractXMLContentOutlineConfiguration() {
+		// Must have empty constructor to createExecutableExtension
+		super();
+	}
+
+	/**
+	 * Returns the NodeActionManager to use for the given treeViewer.
+	 * <p>
+	 * Not API. May be removed in the future.
+	 * </p>
+	 * 
+	 * @param treeViewer
+	 *            the TreeViewer associated with this configuration
+	 * @return a node action manager for use with this tree viewer
+	 */
+	protected XMLNodeActionManager createNodeActionManager(TreeViewer treeViewer) {
+		return new XMLNodeActionManager((IStructuredModel) treeViewer.getInput(), treeViewer);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getContentProvider(org.eclipse.jface.viewers.TreeViewer)
+	 */
+	public IContentProvider getContentProvider(TreeViewer viewer) {
+		if (fContentProvider == null) {
+			fContentProvider = new JFaceNodeContentProvider();
+		}
+		return fContentProvider;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getLabelProvider(org.eclipse.jface.viewers.TreeViewer)
+	 */
+	public ILabelProvider getLabelProvider(TreeViewer viewer) {
+		if (fLabelProvider == null) {
+			fLabelProvider = new JFaceNodeLabelProvider();
+		}
+		return fLabelProvider;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getMenuListener(org.eclipse.jface.viewers.TreeViewer)
+	 */
+	public IMenuListener getMenuListener(TreeViewer viewer) {
+		if (fContextMenuFiller == null) {
+			fContextMenuFiller = new ActionManagerMenuListener(viewer);
+		}
+		return fContextMenuFiller;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getPreferenceStore()
+	 */
+	protected IPreferenceStore getPreferenceStore() {
+		return XMLUIPlugin.getDefault().getPreferenceStore();
+	}
+
+	public ILabelProvider getStatusLineLabelProvider(TreeViewer treeViewer) {
+		if (fSimpleLabelProvider == null) {
+			fSimpleLabelProvider = new StatusLineLabelProvider();
+		}
+		return fSimpleLabelProvider;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getTransferDragSourceListeners(org.eclipse.jface.viewers.TreeViewer)
+	 */
+	public TransferDragSourceListener[] getTransferDragSourceListeners(final TreeViewer treeViewer) {
+		if (fTransferDragSourceListeners == null) {
+			fTransferDragSourceListeners = new TransferDragSourceListener[]{new TransferDragSourceListener() {
+
+				public void dragFinished(DragSourceEvent event) {
+					LocalSelectionTransfer.getTransfer().setSelection(null);
+				}
+
+				public void dragSetData(DragSourceEvent event) {
+				}
+
+				public void dragStart(DragSourceEvent event) {
+					LocalSelectionTransfer.getTransfer().setSelection(treeViewer.getSelection());
+				}
+
+				public Transfer getTransfer() {
+					return LocalSelectionTransfer.getTransfer();
+				}
+			}};
+		}
+
+		return fTransferDragSourceListeners;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getTransferDropTargetListeners(org.eclipse.jface.viewers.TreeViewer)
+	 */
+	public TransferDropTargetListener[] getTransferDropTargetListeners(final TreeViewer treeViewer) {
+		if (fTransferDropTargetListeners == null) {
+			fTransferDropTargetListeners = new TransferDropTargetListener[]{new TransferDropTargetListener() {
+				public void dragEnter(DropTargetEvent event) {
+				}
+
+				public void dragLeave(DropTargetEvent event) {
+				}
+
+				public void dragOperationChanged(DropTargetEvent event) {
+				}
+
+				public void dragOver(DropTargetEvent event) {
+					event.feedback = DND.FEEDBACK_SELECT;
+					float feedbackFloat = getHeightInItem(event);
+					if (feedbackFloat > 0.75) {
+						event.feedback = DND.FEEDBACK_INSERT_AFTER;
+					}
+					else if (feedbackFloat < 0.25) {
+						event.feedback = DND.FEEDBACK_INSERT_BEFORE;
+					}
+					event.feedback |= DND.FEEDBACK_EXPAND | DND.FEEDBACK_SCROLL;
+				}
+
+				public void drop(DropTargetEvent event) {
+					if (event.operations != DND.DROP_NONE && LocalSelectionTransfer.getTransfer().getSelection() != null && !LocalSelectionTransfer.getTransfer().getSelection().isEmpty()) {
+						IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection();
+						if (selection != null && !selection.isEmpty() && event.item != null && event.item.getData() != null) {
+							/*
+							 * the command uses these numbers instead of the
+							 * feedback constants (even though it converts in
+							 * the other direction as well)
+							 */
+							float feedbackFloat = getHeightInItem(event);
+
+							final DragNodeCommand command = new DragNodeCommand(event.item.getData(), feedbackFloat, event.operations, event.detail, selection.toList(), treeViewer);
+							if (command != null && command.canExecute()) {
+								SafeRunnable.run(new SafeRunnable() {
+									public void run() throws Exception {
+										command.execute();
+									}
+								});
+							}
+						}
+					}
+				}
+
+				public void dropAccept(DropTargetEvent event) {
+				}
+
+				private float getHeightInItem(DropTargetEvent event) {
+					if (event.item == null)
+						return .5f;
+					if (event.item instanceof TreeItem) {
+						TreeItem treeItem = (TreeItem) event.item;
+						Control control = treeItem.getParent();
+						Point point = control.toControl(new Point(event.x, event.y));
+						Rectangle bounds = treeItem.getBounds();
+						return (float) (point.y - bounds.y) / (float) bounds.height;
+					}
+					else if (event.item instanceof TableItem) {
+						TableItem tableItem = (TableItem) event.item;
+						Control control = tableItem.getParent();
+						Point point = control.toControl(new Point(event.x, event.y));
+						Rectangle bounds = tableItem.getBounds(0);
+						return (float) (point.y - bounds.y) / (float) bounds.height;
+					}
+					else {
+						return 0.0F;
+					}
+				}
+
+				public Transfer getTransfer() {
+					return LocalSelectionTransfer.getTransfer();
+				}
+
+				public boolean isEnabled(DropTargetEvent event) {
+					return getTransfer().isSupportedType(event.currentDataType);
+				}
+			}};
+		}
+		return fTransferDropTargetListeners;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#unconfigure(org.eclipse.jface.viewers.TreeViewer)
+	 */
+	public void unconfigure(TreeViewer viewer) {
+		super.unconfigure(viewer);
+		fTransferDragSourceListeners = null;
+		fTransferDropTargetListeners = null;
+		if (fContextMenuFiller != null) {
+			fContextMenuFiller.release();
+			fContextMenuFiller = null;
+		}
+	}
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java
index 9359ae9..ec3f156 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,38 +14,19 @@
 
 import java.util.List;
 
-import org.eclipse.core.runtime.IPath;
 import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.util.LocalSelectionTransfer;
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.jface.util.TransferDragSourceListener;
-import org.eclipse.jface.util.TransferDropTargetListener;
 import org.eclipse.jface.viewers.IContentProvider;
 import org.eclipse.jface.viewers.ILabelProvider;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DragSourceEvent;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
 import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateAction;
 import org.eclipse.wst.sse.ui.internal.contentoutline.PropertyChangeUpdateActionContributionItem;
 import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImageHelper;
 import org.eclipse.wst.sse.ui.internal.editor.EditorPluginImages;
-import org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
 import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
@@ -55,68 +36,41 @@
 import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
 import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
 import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
 import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeContentProvider;
 import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
-import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
-import org.eclipse.wst.xml.ui.internal.dnd.DragNodeCommand;
+import org.eclipse.wst.xml.ui.internal.preferences.XMLUIPreferenceNames;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 
 /**
- * Outline Configuration for generic XML support, expects that the viewer's
+ * More advanced Outline Configuration for XML support.  Expects that the viewer's
  * input will be the DOM Model.
  * 
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
+ * @see AbstractXMLContentOutlineConfiguration
  * @since 1.0
  */
-public class XMLContentOutlineConfiguration extends ContentOutlineConfiguration {
-	private class ActionManagerMenuListener implements IMenuListener, IReleasable {
-		private XMLNodeActionManager fActionManager;
-		private TreeViewer fTreeViewer;
-
-		public ActionManagerMenuListener(TreeViewer viewer) {
-			fTreeViewer = viewer;
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.jface.action.IMenuListener#menuAboutToShow(org.eclipse.jface.action.IMenuManager)
-		 */
-		public void menuAboutToShow(IMenuManager manager) {
-			if (fActionManager == null) {
-				fActionManager = createNodeActionManager(fTreeViewer);
-			}
-			fActionManager.fillContextMenu(manager, fTreeViewer.getSelection());
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.wst.sse.ui.internal.IReleasable#release()
-		 */
-		public void release() {
-			fTreeViewer = null;
-			if (fActionManager != null) {
-				fActionManager.setModel(null);
-			}
-		}
-	}
+public class XMLContentOutlineConfiguration extends AbstractXMLContentOutlineConfiguration {
+	static final String ATTR_NAME = "name";
+	static final String ATTR_ID = "id";
 
 	private class AttributeShowingLabelProvider extends JFaceNodeLabelProvider {
+		public boolean isLabelProperty(Object element, String property) {
+			return true;
+		}
+
 		/*
 		 * (non-Javadoc)
 		 * 
 		 * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
 		 */
 		public String getText(Object o) {
-			StringBuffer text = new StringBuffer(super.getText(o));
+			StringBuffer text = null;
 			if (o instanceof Node) {
 				Node node = (Node) o;
 				if ((node.getNodeType() == Node.ELEMENT_NODE) && fShowAttributes) {
+					text = new StringBuffer(super.getText(o));
 					// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88444
 					if (node.hasAttributes()) {
 						Element element = (Element) node;
@@ -165,8 +119,8 @@
 										requiredAttribute = attr;
 									}
 									else {
-										hasId = hasId || attrName.equals("id"); //$NON-NLS-1$
-										hasName = hasName || attrName.equals("name"); //$NON-NLS-1$
+										hasId = hasId || attrName.equals(ATTR_ID);
+										hasName = hasName || attrName.equals(ATTR_NAME);
 									}
 								}
 								++i;
@@ -185,10 +139,10 @@
 							shownAttribute = requiredAttribute;
 						}
 						else if (hasId) {
-							shownAttribute = attributes.getNamedItem("id"); //$NON-NLS-1$
+							shownAttribute = attributes.getNamedItem(ATTR_ID);
 						}
 						else if (hasName) {
-							shownAttribute = attributes.getNamedItem("name"); //$NON-NLS-1$
+							shownAttribute = attributes.getNamedItem(ATTR_NAME);
 						}
 						if (shownAttribute == null) {
 							shownAttribute = attributes.item(0);
@@ -197,42 +151,74 @@
 						// display the attribute and value (without quotes)
 						String attributeName = shownAttribute.getNodeName();
 						if ((attributeName != null) && (attributeName.length() > 0)) {
-							text.append(" " + attributeName); //$NON-NLS-1$
+							text.append(" "); //$NON-NLS-1$
+							text.append(attributeName);
 							String attributeValue = shownAttribute.getNodeValue();
 							if ((attributeValue != null) && (attributeValue.length() > 0)) {
-								text.append("=" + StringUtils.strip(attributeValue)); //$NON-NLS-1$
+								text.append("="); //$NON-NLS-1$
+								text.append(StringUtils.strip(attributeValue));
 							}
 						}
 					}
 				}
+				else {
+					text = new StringBuffer(super.getText(o));
+				}
+			}
+			else {
+				return super.toString();
 			}
 			return text.toString();
 		}
-	}
 
-	private class StatusLineLabelProvider extends JFaceNodeLabelProvider {
-		TreeViewer treeViewer = null;
-
-		public StatusLineLabelProvider(TreeViewer viewer) {
-			treeViewer = viewer;
-		}
-
-		public String getText(Object element) {
-			if (element == null)
-				return null;
-
-			StringBuffer s = new StringBuffer();
-			Node node = (Node) element;
-			while (node != null) {
-				if (node.getNodeType() != Node.DOCUMENT_NODE) {
-					s.insert(0, super.getText(node));
-				}
-				node = node.getParentNode();
-				if (node != null && node.getNodeType() != Node.DOCUMENT_NODE) {
-					s.insert(0, IPath.SEPARATOR);
+		/* (non-Javadoc)
+		 * @see org.eclipse.jface.viewers.CellLabelProvider#getToolTipText(java.lang.Object)
+		 */
+		public String getToolTipText(Object element) {
+			if (element instanceof Node) {
+				switch (((Node) element).getNodeType()) {
+					case Node.COMMENT_NODE :
+					case Node.CDATA_SECTION_NODE :
+					case Node.PROCESSING_INSTRUCTION_NODE :
+					case Node.TEXT_NODE : {
+						String nodeValue = ((Node) element).getNodeValue().trim();
+						return prepareText(nodeValue);
+					}
+					case Node.ELEMENT_NODE : {
+						// show the preceding comment's tooltip information
+						Node previous = ((Node) element).getPreviousSibling();
+						if (previous != null && previous.getNodeType() == Node.TEXT_NODE)
+							previous = previous.getPreviousSibling();
+						if (previous != null && previous.getNodeType() == Node.COMMENT_NODE)
+							return getToolTipText(previous);
+					}
 				}
 			}
-			return s.toString();
+			return super.getToolTipText(element);
+		}
+
+		/**
+		 * Remove leading indentation from each line in the give string.
+		 * @param text
+		 * @return
+		 */
+		private String prepareText(String text) {
+			StringBuffer nodeText = new StringBuffer();
+			for (int i = 0; i < text.length(); i++) {
+				char c = text.charAt(i);
+				if (c != '\r' && c != '\n') {
+					nodeText.append(c);
+				}
+				else if (c == '\r' || c == '\n') {
+					nodeText.append('\n');
+					while (Character.isWhitespace(c) && i < text.length()) {
+						i++;
+						c = text.charAt(i);
+					}
+					nodeText.append(c);
+				}
+			}
+			return nodeText.toString();
 		}
 	}
 
@@ -270,24 +256,16 @@
 			fTreeViewer.refresh(true);
 		}
 	}
-
+	
+	private ILabelProvider fAttributeShowingLabelProvider;
 	private IContentProvider fContentProvider = null;
 
-	private ActionManagerMenuListener fContextMenuFiller = null;
-
-	private ILabelProvider fLabelProvider = null;
-
 	boolean fShowAttributes = false;
 
-	private JFaceNodeLabelProvider fSimpleLabelProvider;
-	private TransferDragSourceListener[] fTransferDragSourceListeners;
-
-	private TransferDropTargetListener[] fTransferDropTargetListeners;
-
 	/*
 	 * Preference key for Show Attributes
 	 */
-	private final String OUTLINE_SHOW_ATTRIBUTE_PREF = "outline-show-attribute-editor"; //$NON-NLS-1$
+	private final String OUTLINE_SHOW_ATTRIBUTE_PREF = "outline-show-attribute"; //$NON-NLS-1$
 
 	/**
 	 * Create new instance of XMLContentOutlineConfiguration
@@ -295,6 +273,37 @@
 	public XMLContentOutlineConfiguration() {
 		// Must have empty constructor to createExecutableExtension
 		super();
+
+		/**
+		 * Set up our preference store here. This is done so that subclasses
+		 * aren't required to set their own values, although if they have,
+		 * those will be used instead.
+		 */
+		IPreferenceStore store = getPreferenceStore();
+		if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.DOCUMENT_NODE).length() == 0)
+			store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.DOCUMENT_NODE, "1, true");
+		if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.PROCESSING_INSTRUCTION_NODE).length() == 0)
+			store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.PROCESSING_INSTRUCTION_NODE, "2, true");
+		if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.DOCUMENT_TYPE_NODE).length() == 0)
+			store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.DOCUMENT_TYPE_NODE, "3, true");
+		if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.DOCUMENT_FRAGMENT_NODE).length() == 0)
+			store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.DOCUMENT_FRAGMENT_NODE, "4, true");
+		if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.COMMENT_NODE).length() == 0)
+			store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.COMMENT_NODE, "5, true");
+		if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.ATTRIBUTE_NODE).length() == 0)
+			store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.ATTRIBUTE_NODE, "6, false");
+		if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.ELEMENT_NODE).length() == 0)
+			store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.ELEMENT_NODE, "7, true");
+		if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.ENTITY_REFERENCE_NODE).length() == 0)
+			store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.ENTITY_REFERENCE_NODE, "8, true");
+		if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.CDATA_SECTION_NODE).length() == 0)
+			store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.CDATA_SECTION_NODE, "9, true");
+		if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.ENTITY_NODE).length() == 0)
+			store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.ENTITY_NODE, "10, true");
+		if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.NOTATION_NODE).length() == 0)
+			store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.NOTATION_NODE, "11, true");
+		if (store.getDefaultString(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.TEXT_NODE).length() == 0)
+			store.setDefault(XMLUIPreferenceNames.OUTLINE_BEHAVIOR.TEXT_NODE, "12, false");
 	}
 
 	/*
@@ -306,6 +315,7 @@
 		IContributionItem[] items;
 		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88444
 		IContributionItem showAttributeItem = new PropertyChangeUpdateActionContributionItem(new ToggleShowAttributeAction(getPreferenceStore(), OUTLINE_SHOW_ATTRIBUTE_PREF, viewer));
+
 		items = super.createMenuContributions(viewer);
 		if (items == null) {
 			items = new IContributionItem[]{showAttributeItem};
@@ -320,20 +330,6 @@
 	}
 
 	/**
-	 * Returns the NodeActionManager to use for the given treeViewer.
-	 * <p>
-	 * Not API. May be removed in the future.
-	 * </p>
-	 * 
-	 * @param treeViewer
-	 *            the TreeViewer associated with this configuration
-	 * @return a node action manager for use with this tree viewer
-	 */
-	protected XMLNodeActionManager createNodeActionManager(TreeViewer treeViewer) {
-		return new XMLNodeActionManager((IStructuredModel) treeViewer.getInput(), treeViewer);
-	}
-
-	/**
 	 * Notifies this configuration that the flag that indicates whether or not
 	 * to show attribute values in the tree viewer has changed. The tree
 	 * viewer is automatically refreshed afterwards to update the labels.
@@ -349,7 +345,7 @@
 	protected void enableShowAttributes(boolean showAttributes, TreeViewer treeViewer) {
 		// nothing by default
 	}
-
+	
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -365,12 +361,13 @@
 	private Object getFilteredNode(Object object) {
 		if (object instanceof Node) {
 			Node node = (Node) object;
-
+			short nodeType = node.getNodeType();
 			// replace attribute node in selection with its parent
-			if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
+			if (nodeType == Node.ATTRIBUTE_NODE) {
 				node = ((Attr) node).getOwnerElement();
 			}
-			else if (node.getNodeType() == Node.TEXT_NODE) {
+			// anything else not visible, replace with parent node
+			else if (nodeType == Node.TEXT_NODE) {
 				node = node.getParentNode();
 			}
 			return node;
@@ -391,31 +388,10 @@
 	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getLabelProvider(org.eclipse.jface.viewers.TreeViewer)
 	 */
 	public ILabelProvider getLabelProvider(TreeViewer viewer) {
-		if (fLabelProvider == null) {
-			fLabelProvider = new AttributeShowingLabelProvider();
+		if (fAttributeShowingLabelProvider == null) {
+			fAttributeShowingLabelProvider = new AttributeShowingLabelProvider();
 		}
-		return fLabelProvider;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getMenuListener(org.eclipse.jface.viewers.TreeViewer)
-	 */
-	public IMenuListener getMenuListener(TreeViewer viewer) {
-		if (fContextMenuFiller == null) {
-			fContextMenuFiller = new ActionManagerMenuListener(viewer);
-		}
-		return fContextMenuFiller;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getPreferenceStore()
-	 */
-	protected IPreferenceStore getPreferenceStore() {
-		return XMLUIPlugin.getDefault().getPreferenceStore();
+		return fAttributeShowingLabelProvider;
 	}
 
 	/*
@@ -432,144 +408,4 @@
 		}
 		return filteredSelection;
 	}
-
-	public ILabelProvider getStatusLineLabelProvider(TreeViewer treeViewer) {
-		if (fSimpleLabelProvider == null) {
-			fSimpleLabelProvider = new StatusLineLabelProvider(treeViewer);
-		}
-		return fSimpleLabelProvider;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getTransferDragSourceListeners(org.eclipse.jface.viewers.TreeViewer)
-	 */
-	public TransferDragSourceListener[] getTransferDragSourceListeners(final TreeViewer treeViewer) {
-		if (fTransferDragSourceListeners == null) {
-			fTransferDragSourceListeners = new TransferDragSourceListener[]{new TransferDragSourceListener() {
-
-				public void dragFinished(DragSourceEvent event) {
-					LocalSelectionTransfer.getTransfer().setSelection(null);
-				}
-
-				public void dragSetData(DragSourceEvent event) {
-				}
-
-				public void dragStart(DragSourceEvent event) {
-					LocalSelectionTransfer.getTransfer().setSelection(treeViewer.getSelection());
-				}
-
-				public Transfer getTransfer() {
-					return LocalSelectionTransfer.getTransfer();
-				}
-			}};
-		}
-
-		return fTransferDragSourceListeners;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getTransferDropTargetListeners(org.eclipse.jface.viewers.TreeViewer)
-	 */
-	public TransferDropTargetListener[] getTransferDropTargetListeners(final TreeViewer treeViewer) {
-		if (fTransferDropTargetListeners == null) {
-			fTransferDropTargetListeners = new TransferDropTargetListener[]{new TransferDropTargetListener() {
-				public void dragEnter(DropTargetEvent event) {
-				}
-
-				public void dragLeave(DropTargetEvent event) {
-				}
-
-				public void dragOperationChanged(DropTargetEvent event) {
-				}
-
-				public void dragOver(DropTargetEvent event) {
-					event.feedback = DND.FEEDBACK_SELECT;
-					float feedbackFloat = getHeightInItem(event);
-					if (feedbackFloat > 0.75) {
-						event.feedback = DND.FEEDBACK_INSERT_AFTER;
-					}
-					else if (feedbackFloat < 0.25) {
-						event.feedback = DND.FEEDBACK_INSERT_BEFORE;
-					}
-					event.feedback |= DND.FEEDBACK_EXPAND | DND.FEEDBACK_SCROLL;
-				}
-
-				public void drop(DropTargetEvent event) {
-					if (event.operations != DND.DROP_NONE && LocalSelectionTransfer.getTransfer().getSelection() != null && !LocalSelectionTransfer.getTransfer().getSelection().isEmpty()) {
-						IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection();
-						if (selection != null && !selection.isEmpty() && event.item != null && event.item.getData() != null) {
-							/*
-							 * the command uses these numbers instead of the
-							 * feedback constants (even though it converts in
-							 * the other direction as well)
-							 */
-							float feedbackFloat = getHeightInItem(event);
-
-							final DragNodeCommand command = new DragNodeCommand(event.item.getData(), feedbackFloat, event.operations, event.detail, selection.toList(), treeViewer);
-							if (command != null && command.canExecute()) {
-								SafeRunnable.run(new SafeRunnable() {
-									public void run() throws Exception {
-										command.execute();
-									}
-								});
-							}
-						}
-					}
-				}
-
-				public void dropAccept(DropTargetEvent event) {
-				}
-
-				private float getHeightInItem(DropTargetEvent event) {
-					if (event.item == null)
-						return .5f;
-					if (event.item instanceof TreeItem) {
-						TreeItem treeItem = (TreeItem) event.item;
-						Control control = treeItem.getParent();
-						Point point = control.toControl(new Point(event.x, event.y));
-						Rectangle bounds = treeItem.getBounds();
-						return (float) (point.y - bounds.y) / (float) bounds.height;
-					}
-					else if (event.item instanceof TableItem) {
-						TableItem tableItem = (TableItem) event.item;
-						Control control = tableItem.getParent();
-						Point point = control.toControl(new Point(event.x, event.y));
-						Rectangle bounds = tableItem.getBounds(0);
-						return (float) (point.y - bounds.y) / (float) bounds.height;
-					}
-					else {
-						return 0.0F;
-					}
-				}
-
-				public Transfer getTransfer() {
-					return LocalSelectionTransfer.getTransfer();
-				}
-
-				public boolean isEnabled(DropTargetEvent event) {
-					return getTransfer().isSupportedType(event.currentDataType);
-				}
-			}};
-		}
-		return fTransferDropTargetListeners;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#unconfigure(org.eclipse.jface.viewers.TreeViewer)
-	 */
-	public void unconfigure(TreeViewer viewer) {
-		super.unconfigure(viewer);
-		fTransferDragSourceListeners = null;
-		fTransferDropTargetListeners = null;
-		if (fContextMenuFiller != null) {
-			fContextMenuFiller.release();
-			fContextMenuFiller = null;
-		}
-	}
 }
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/properties/XMLPropertySheetConfiguration.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/properties/XMLPropertySheetConfiguration.java
index aba549d..a4f3a4e 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/properties/XMLPropertySheetConfiguration.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/properties/XMLPropertySheetConfiguration.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -77,7 +77,7 @@
 	private class PropertiesRefreshJob extends UIJob {
 		public static final int UPDATE_DELAY = 200;
 
-		private Set propertySheetPages = null;
+		Set propertySheetPages = null;
 
 		public PropertiesRefreshJob() {
 			super(XMLUIMessages.JFaceNodeAdapter_1);
@@ -87,11 +87,19 @@
 		}
 
 		void addPropertySheetPage(IPropertySheetPage page) {
-			if (page != null) {
+			if (page != null && propertySheetPages != null) {
 				propertySheetPages.add(page);
 				schedule(UPDATE_DELAY);
 			}
 		}
+		
+		/* (non-Javadoc)
+		 * @see org.eclipse.core.runtime.jobs.Job#canceling()
+		 */
+		protected void canceling() {
+			propertySheetPages.clear();
+			super.canceling();
+		}
 
 		public IStatus runInUIThread(IProgressMonitor monitor) {
 			Object[] pages = propertySheetPages.toArray();
@@ -133,7 +141,18 @@
 				fSource = (INodeNotifier) object;
 				fPropertySource = (IPropertySource) fSource.getAdapterFor(IPropertySource.class);
 				if (fPropertySource == null) {
-					fPropertySource = new XMLPropertySource((INodeNotifier) object);
+					fPropertySource = new XMLPropertySource((INodeNotifier) object) {
+						public void setPropertyValue(Object nameObject, Object value) {
+							// https://bugs.eclipse.org/bugs/show_bug.cgi?id=218979
+							for (int i = 0; i < fSelectedNotifiers.length; i++) {
+								fSelectedNotifiers[i].removeAdapter(fRefreshAdapter);
+							}
+							super.setPropertyValue(nameObject, value);
+							for (int i = 0; i < fSelectedNotifiers.length; i++) {
+								fSelectedNotifiers[i].addAdapter(fRefreshAdapter);
+							}
+						}
+					};
 				}
 			}
 			else {
@@ -254,6 +273,10 @@
 		for (int i = 0; i < fSelectedCMDocumentManagers.length; i++) {
 			fSelectedCMDocumentManagers[i].removeListener(fCMDocumentManagerListener);
 		}
+		if(fPropertiesRefreshJob != null) {
+			fPropertiesRefreshJob.cancel();
+			fPropertiesRefreshJob.propertySheetPages = null;
+		}
 		fPropertySheetPage = null;
 	}
 }
diff --git a/bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.xml b/bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.xml
index 8f11808..b4ad498 100644
--- a/bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.xml
+++ b/bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,8 +17,8 @@
   <template name="%Templates.xmldeclaration.name" description="%Templates.xmldeclaration.desc" id="org.eclipse.wst.xml.ui.internal.templates.xmldeclaration" context="xml_new" enabled="true">&lt;?xml version="1.0" encoding="${encoding}"?&gt;</template>
   <template name="%Templates.comment.name" description="%Templates.comment.desc" id="org.eclipse.wst.xml.ui.internal.templates.comment" context="xml_tag" enabled="true">&lt;!-- ${cursor} --&gt;</template>
   <template name="%Templates.xslpi.name" description="%Templates.xslpi.desc" id="org.eclipse.wst.xml.ui.internal.templates.xslpi" context="xml_tag" enabled="true">&lt;?xml-stylesheet type="text/xsl" href="${cursor}"?&gt;</template>
-  <template name="%Templates.xsinsp.name" description="%Templates.xsinsp.desc" id="org.eclipse.wst.xml.ui.internal.templates.xsinsp" context="xml_attribute" enabled="true">xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"</template>
+  <template name="%Templates.xsinsp.name" description="%Templates.xsinsp.desc" id="org.eclipse.wst.xml.ui.internal.templates.xsinsp" context="xml_attribute" enabled="true">xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"</template>
   <template name="%Templates.schemaLoc.name" description="%Templates.schemaLoc.desc" id="org.eclipse.wst.xml.ui.internal.templates.schemaLoc" context="xml_attribute" enabled="true">xsi:schemaLocation="{namespace} {location}"</template>
-  <template name="%Templates.noschemaLoc.name" description="%Templates.noschemaLoc.desc" id="org.eclipse.wst.xml.ui.internal.templates.noschemaLoc" context="xml_attribute" enabled="true">xsi:schemaLocation="{namespace} {location}"</template>
+  <template name="%Templates.noschemaLoc.name" description="%Templates.noschemaLoc.desc" id="org.eclipse.wst.xml.ui.internal.templates.noschemaLoc" context="xml_attribute" enabled="true">xsi:noNamespaceSchemaLocation="{location}"</template>
   <template name="%Templates.defaultnsp.name" description="%Templates.defaultnsp.desc" id="org.eclipse.wst.xml.ui.internal.templates.defaultnsp" context="xml_attribute" enabled="true">xmlns="default namespace"</template>
 </templates>
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 50b92c1..cefd32f 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.1.300.qualifier
+Bundle-Version: 1.1.502.qualifier
 Bundle-Activator: org.eclipse.wst.xsd.core.internal.XSDCorePlugin
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: plugin
@@ -17,6 +17,6 @@
  org.eclipse.xsd;bundle-version="[2.2.0,3.0.0)",
  org.eclipse.wst.xml.core;bundle-version="[1.1.0,1.2.0)",
  org.eclipse.wst.validation;bundle-version="[1.2.0,1.3.0)"
-Eclipse-LazyStart: true
+Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
 
diff --git a/bundles/org.eclipse.wst.xsd.core/about.html b/bundles/org.eclipse.wst.xsd.core/about.html
index 73db36e..2199df3 100644
--- a/bundles/org.eclipse.wst.xsd.core/about.html
+++ b/bundles/org.eclipse.wst.xsd.core/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/bundles/org.eclipse.wst.xsd.core/build.properties b/bundles/org.eclipse.wst.xsd.core/build.properties
index 96e579a..984631d 100644
--- a/bundles/org.eclipse.wst.xsd.core/build.properties
+++ b/bundles/org.eclipse.wst.xsd.core/build.properties
@@ -15,7 +15,6 @@
                .,\
                about.html
 jars.compile.order = .
-src.includes = build.properties
 output.. = bin/
 source.. = src-contentmodel/,\
            src-validation/,\
diff --git a/bundles/org.eclipse.wst.xsd.core/plugin.properties b/bundles/org.eclipse.wst.xsd.core/plugin.properties
index 10f5914..42ba557 100644
--- a/bundles/org.eclipse.wst.xsd.core/plugin.properties
+++ b/bundles/org.eclipse.wst.xsd.core/plugin.properties
@@ -19,4 +19,4 @@
 _UI_XML_SCHEMA_VALIDATOR                  = XML Schema Validator
 _UI_XERCES_VALIDATOR_DELEGATE       	  = Xerces-based XML Schema Validator
 
-Bundle-Vendor.0 = Eclipse.org
+Bundle-Vendor.0 = Eclipse Web Tools Platform
diff --git a/bundles/org.eclipse.wst.xsd.core/plugin.xml b/bundles/org.eclipse.wst.xsd.core/plugin.xml
index d8c1a11..878e651 100644
--- a/bundles/org.eclipse.wst.xsd.core/plugin.xml
+++ b/bundles/org.eclipse.wst.xsd.core/plugin.xml
@@ -2,7 +2,7 @@
 <?eclipse version="3.0"?>
 <plugin>
 
-	<extension point="org.eclipse.core.runtime.contentTypes">
+	<extension point="org.eclipse.core.contenttype.contentTypes">
 		<content-type
 			priority="high"
 			name="%XSD_Content_Type"
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java
index 154fe0d..9abdc21 100644
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java
+++ b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,9 @@
  * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     David Carver - STAR - bug 157254 - referenced Attributes and Elements
+ *        were not being checked to see if they had the annotations if
+ *        none were defined locally. (Initial fix modified - see bug)
  *******************************************************************************/
 package org.eclipse.wst.xsd.contentmodel.internal;
 import java.io.IOException;
@@ -130,6 +133,7 @@
   public static final String PROPERTY_SUBSTITUTION_GROUP = "SubstitutionGroup";
   public static final String PROPERTY_SUBSTITUTION_GROUP_VALUE = "SubstitutionGroupValue";
   public static final String PROPERTY_ABSTRACT = "Abstract";
+  public static final String PROPERTY_WHITESPACE_FACET = "org.eclipse.wst.xsd.cm.properties/whitespace"; //$NON-NLS-1$
   /**
    * Definition info for element declarations.
    */
@@ -394,7 +398,12 @@
           case XSDVariety.LIST:
             {
               XSDSimpleTypeDefinition itemTypeDefinition = ((XSDSimpleTypeDefinition) type).getItemTypeDefinition();
-              getEnumeratedValuesForSimpleType(itemTypeDefinition, result);
+              String[] values = getEnumeratedValuesForType(itemTypeDefinition);
+              for (int j = 0; j < values.length; j++) {
+            	  if(result.indexOf(values[j]) == -1) {
+            		  result.add(values[j]);
+            	  }
+              }
             }
             break;
           case XSDVariety.UNION:
@@ -406,7 +415,12 @@
                 while (i.hasNext())
                 {
                   XSDSimpleTypeDefinition simpleType = (XSDSimpleTypeDefinition) i.next();
-                  getEnumeratedValuesForSimpleType(simpleType, result);
+                  String[] values = getEnumeratedValuesForType(simpleType);
+                  for (int j = 0; j < values.length; j++) {
+                	  if(result.indexOf(values[j]) == -1) {
+                		  result.add(values[j]);
+                	  }
+                  }
                 }
               }
             }
@@ -1151,14 +1165,16 @@
     				} else if("http://www.w3.org/2000/xmlns".equals(info.uri)) {
     					info.prefix = "xmlns";
     				} else {
-    					int n = 1;
-    	    			if(info.prefix == null || info.prefix.equals("")) {
-    	    				info.prefix = "p";
-    	    			}
-    	    			String prefix = info.prefix;
-    	    			while(isDataInNamespaceList(namespaceList, 1, info.prefix)) {
-    	    				info.prefix = prefix + n++;
-    	    			}
+    					if(info.uri != null && info.uri != "") {
+	    					int n = 1;
+	    	    			if(info.prefix == null || info.prefix.equals("")) {
+	    	    				info.prefix = "p";
+	    	    			}
+	    	    			String prefix = info.prefix;
+	    	    			while(isDataInNamespaceList(namespaceList, 1, info.prefix)) {
+	    	    				info.prefix = prefix + n++;
+	    	    			}
+    					}
     				}
 	    			URI relative = URI.createURI(xsdSchema.getSchemaLocation(), true);
 					URI absolute = URI.createURI(schema.getSchemaLocation(), true);
@@ -1373,7 +1389,29 @@
      */
     protected CMNodeList getDocumentation()
     {
-      XSDAnnotation annotation = xsdAttributeUse.getAttributeDeclaration().getAnnotation();
+      // Check if it is an attribute reference first
+      XSDAttributeDeclaration xsdAttributeRef = xsdAttributeUse.getContent();
+      if (xsdAttributeRef != null && xsdAttributeRef.isAttributeDeclarationReference())
+      {
+        // Determine if it has annotations
+        boolean refHasDocumentation = false;
+        XSDAnnotation refAnnotation = xsdAttributeRef.getAnnotation();
+        if (refAnnotation != null)
+        {
+          // Determine if there is documentation
+          if (!refAnnotation.getUserInformation().isEmpty())
+          {
+            refHasDocumentation = true;
+          }
+        }
+        if (refHasDocumentation)
+          return getDocumentations(refAnnotation);
+      }
+      
+      // Otherwise proceed with getting the documentation as usual
+      XSDAttributeDeclaration xsdAttributeDeclaration =  xsdAttributeUse.getAttributeDeclaration();      
+      XSDAnnotation annotation = xsdAttributeDeclaration.getAnnotation();
+      
       return getDocumentations(annotation);
     }
 
@@ -1416,27 +1454,30 @@
       }
 
       /**
-       * Returns false. This class does not support any properties.
+       * Returns true if the property is supported for this class.
        * 
        * @param propertyName -
        *          name of a property
-       * @return false.
+       * @return true if the property is supported.
        */
       public boolean supports(String propertyName)
       {
-        return false;
+    	  return (PROPERTY_WHITESPACE_FACET.equals(propertyName));
       }
 
       /**
-       * Returns null. This class does not support any properties.
+       * Returns the property value for the property name. Returns null if the
+       * property is not supported.
        * 
        * @param propertyName -
        *          name of a property
-       * @return null.
+       * @return the property value for the property name.
        */
       public Object getProperty(String propertyName)
       {
-        return null;
+    	  if(PROPERTY_WHITESPACE_FACET.equals(propertyName))
+		  	return getWhiteSpaceFacetValue();
+    	  return null;
       }
 
       /**
@@ -1448,7 +1489,7 @@
       {
         XSDSimpleTypeDefinition sc = xsdAttributeUse.getAttributeDeclaration().getTypeDefinition();
         String typeName = sc.getName();
-        return typeName != null ? typeName : "string";
+        return typeName != null ? typeName : "string";  //$NON-NLS-1$
       }
 
       /**
@@ -1517,6 +1558,18 @@
         XSDAttributeDeclaration attr = xsdAttributeUse.getAttributeDeclaration();
         return attr.getResolvedAttributeDeclaration().getTypeDefinition();
       }
+      
+      /**
+       * Obtains the whitespace facet of the XSD simple type.
+       * 
+       * @return The whitespace facet for the XSD type. If none is
+       * defined, or it is a complex type, null.
+       */
+      private String getWhiteSpaceFacetValue()
+      {
+        XSDSimpleTypeDefinition def = getXSDType().getSimpleType();
+        return (def != null && def.getEffectiveWhiteSpaceFacet() != null) ? def.getEffectiveWhiteSpaceFacet().getLexicalValue() : null ;
+      }
     }
   }
   /**
@@ -1867,7 +1920,9 @@
     		Element element = xsdElementDeclaration.getElement();
     		if(element != null)
     		{
-    			return element.getAttribute(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE);
+    			if (element.hasAttribute(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE))
+    				return element.getAttribute(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE);
+    			else return null;
     		}
     	}
       return "";
@@ -1893,7 +1948,29 @@
      */
     protected CMNodeList getDocumentation()
     {
-      XSDAnnotation annotation = getXSDElementDeclaration().getAnnotation();
+      XSDElementDeclaration xsdElementDeclaration = getXSDElementDeclaration();
+      XSDAnnotation annotation = xsdElementDeclaration.getAnnotation();
+      
+      // Need to check to see if there are any documentation elements.  Just because
+      // there is an annotation element doesn't mean that the documentation element is
+      // also there, as it could contain just appinfo elements.
+      
+      boolean hasDocumentation = false;
+      
+      if (annotation != null) {
+    	  if (!annotation.getUserInformation().isEmpty()) {
+    		  hasDocumentation = true;
+    	  }
+      }
+
+      // The element may not have annotation and if it is referenced
+      // check the referenced attribute for the annotations.
+      if (hasDocumentation == false) {
+          if (xsdElementDeclaration.isElementDeclarationReference()) {
+        	  annotation = xsdElementDeclaration.getResolvedElementDeclaration().getAnnotation();
+          }
+      }
+      
       return getDocumentations(annotation);
     }
 
@@ -2002,26 +2079,29 @@
       }
 
       /**
-       * Returns false. This class does not support any properties.
+       * Returns true if the property is supported for this class.
        * 
        * @param propertyName -
        *          name of a property
-       * @return false.
+       * @return true if the property is supported.
        */
       public boolean supports(String propertyName)
       {
-        return false;
+        return (PROPERTY_WHITESPACE_FACET.equals(propertyName));
       }
 
       /**
-       * Returns null. This class does not support any properties.
+       * Returns the property value for the property name. Returns null if the
+       * property is not supported.
        * 
        * @param propertyName -
        *          name of a property
-       * @return null.
+       * @return the property value for the property name.
        */
       public Object getProperty(String propertyName)
       {
+        if(PROPERTY_WHITESPACE_FACET.equals(propertyName))
+        	return getWhiteSpaceFacetValue();
         return null;
       }
 
@@ -2036,7 +2116,7 @@
         XSDSimpleTypeDefinition std = getXSDType().getSimpleType();
         if (std != null)
           typeName = std.getName();
-        return typeName != null ? typeName : "string";
+        return typeName != null ? typeName : "string"; //$NON-NLS-1$
       }
 
       /**
@@ -2098,6 +2178,18 @@
       {
         return (CMDocument) getAdapter(getXSDElementDeclaration().getSchema());
       }
+      
+      /**
+       * Obtains the whitespace facet of the XSD simple type.
+       * 
+       * @return The whitespace facet for the XSD type. If none is
+       * defined, or it is a complex type, null.
+       */
+      private String getWhiteSpaceFacetValue()
+      {
+        XSDSimpleTypeDefinition def = getXSDType().getSimpleType();
+        return (def != null && def.getEffectiveWhiteSpaceFacet() != null) ? def.getEffectiveWhiteSpaceFacet().getLexicalValue() : null ;
+      }
     }
   }
   /**
@@ -2501,8 +2593,12 @@
 
     public String getNamespaceURI()
     {
-      String uri = xsdWildcard.getElement().getAttribute(XSDConstants.NAMESPACE_ATTRIBUTE);
-      return (uri != null && uri.length() > 0) ? uri : "##any";
+    	if (xsdWildcard.getElement().hasAttribute(XSDConstants.NAMESPACE_ATTRIBUTE))
+    	{
+    		return xsdWildcard.getElement().getAttribute(XSDConstants.NAMESPACE_ATTRIBUTE);
+    	}
+    	else 
+    		return "##any";
     }
 
     /**
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDTypeUtil.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDTypeUtil.java
index f5867a3..1ab69ef 100644
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDTypeUtil.java
+++ b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDTypeUtil.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -29,7 +29,7 @@
     defaultValue.put("anySimpleType", null);
     defaultValue.put("anyType", null);
     defaultValue.put("anyURI", "http://tempuri.org");
-    defaultValue.put("base64Binary", "0");
+    defaultValue.put("base64Binary", "MA==");
     defaultValue.put("boolean", "true");
     defaultValue.put("byte", "0");
     defaultValue.put("date", "2001-01-01");
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDVisitor.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDVisitor.java
index 27e4a9c..59f5838 100644
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDVisitor.java
+++ b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDVisitor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
 package org.eclipse.wst.xsd.contentmodel.internal;
 
 import java.util.Iterator;
+import java.util.Stack;
 
 import org.eclipse.xsd.XSDAttributeDeclaration;
 import org.eclipse.xsd.XSDAttributeGroupDefinition;
@@ -35,6 +36,7 @@
   }
   
   protected XSDSchema schema;
+  protected Stack particleStack = new Stack();
   
   public void visitSchema(XSDSchema schema)
   {
@@ -156,7 +158,18 @@
   {
     if (particleContent instanceof XSDModelGroupDefinition)
     {
-      visitModelGroupDefinition((XSDModelGroupDefinition) particleContent);
+      XSDModelGroupDefinition modelGroupDef = (XSDModelGroupDefinition) particleContent;
+
+      if (particleStack.contains(modelGroupDef))
+      {
+        return;
+      }
+        
+      particleStack.push(modelGroupDef);
+      
+      visitModelGroupDefinition(modelGroupDef);
+      
+      particleStack.pop();
     }
     else if (particleContent instanceof XSDModelGroup)
     {
diff --git a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/Validator.java b/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/Validator.java
index 1189805..5da031b 100644
--- a/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/Validator.java
+++ b/bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/Validator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,6 +16,8 @@
 import java.util.HashMap;
 
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
+import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
 import org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator;
 import org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext;
 import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
@@ -34,7 +36,7 @@
   protected void setupValidation(NestedValidatorContext context) 
   {
 	XSDValidationConfiguration configuration = new XSDValidationConfiguration();
-	boolean honourAllSchemaLocations = XSDCorePlugin.getDefault().getPluginPreferences().getBoolean(XSDCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS);
+	boolean honourAllSchemaLocations = XMLCorePlugin.getDefault().getPluginPreferences().getBoolean(XMLCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS);
 	boolean fullSchemaConformance = XSDCorePlugin.getDefault().getPluginPreferences().getBoolean(XSDCorePreferenceNames.FULL_SCHEMA_CONFORMANCE);
 	try
 	{
diff --git a/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/preferences/XSDCorePreferenceInitializer.java b/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/preferences/XSDCorePreferenceInitializer.java
index 88db4e4..f81f24d 100644
--- a/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/preferences/XSDCorePreferenceInitializer.java
+++ b/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/preferences/XSDCorePreferenceInitializer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -28,9 +28,6 @@
 	public void initializeDefaultPreferences() {
 		IEclipsePreferences node = new DefaultScope().getNode(XSDCorePlugin.getDefault().getBundle().getSymbolicName());
 		
-		// Validation preferences.
-		node.putBoolean(XSDCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS, false);
-
 		// In order to provide the best compatibility and conformance to the XML Schema
 		// specification it is recommended that this be defaulted to true.
 		node.putBoolean(XSDCorePreferenceNames.FULL_SCHEMA_CONFORMANCE, true);
diff --git a/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/preferences/XSDCorePreferenceNames.java b/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/preferences/XSDCorePreferenceNames.java
index 4159cc1..06fc74e 100644
--- a/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/preferences/XSDCorePreferenceNames.java
+++ b/bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/preferences/XSDCorePreferenceNames.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -25,7 +25,7 @@
 	 * Value is of type <code>boolean</code>.<br />
 	 * Possible values: {TRUE, FALSE}
 	 * </p>
-	 * 
+	 * @deprecated
 	 */
 	public static final String HONOUR_ALL_SCHEMA_LOCATIONS = "honourAllSchemaLocations";//$NON-NLS-1$
 	public static final String FULL_SCHEMA_CONFORMANCE = "fullSchemaConformance";//$NON-NLS-1$
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 5494d2d..58b1452 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.2.101.qualifier
+Bundle-Version: 1.2.303.qualifier
 Bundle-Activator: org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: plugin
@@ -45,6 +45,7 @@
  org.eclipse.wst.xsd.ui.internal.preferences;x-internal:=true,
  org.eclipse.wst.xsd.ui.internal.refactor;x-internal:=true,
  org.eclipse.wst.xsd.ui.internal.refactor.actions;x-internal:=true,
+ org.eclipse.wst.xsd.ui.internal.refactor.handlers,
  org.eclipse.wst.xsd.ui.internal.refactor.rename;x-internal:=true,
  org.eclipse.wst.xsd.ui.internal.refactor.structure;x-internal:=true,
  org.eclipse.wst.xsd.ui.internal.refactor.util;x-internal:=true,
@@ -60,11 +61,11 @@
 Require-Bundle: org.eclipse.ui.views.properties.tabbed;bundle-version="[3.2.0,4.0.0)",
  org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
  org.eclipse.wst.common.uriresolver;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.1.0,1.2.0)",
+ org.eclipse.wst.sse.ui;bundle-version="[1.2.0,1.3.0)",
  org.eclipse.wst.sse.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.common.core;bundle-version="[1.1.0,1.2.0)",
+ org.eclipse.wst.common.core;bundle-version="[1.1.0,1.3.0)",
  org.eclipse.wst.xml.core;bundle-version="[1.1.300,1.2.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.0.400,1.1.0)",
+ org.eclipse.wst.xml.ui;bundle-version="[1.0.400,1.2.0)",
  org.eclipse.wst.common.ui;bundle-version="[1.1.0,1.2.0)",
  org.eclipse.jface.text;bundle-version="[3.2.0,4.0.0)",
  org.eclipse.gef;bundle-version="[3.4.0,4.0.0)",
@@ -79,7 +80,8 @@
  org.eclipse.ltk.ui.refactoring;bundle-version="[3.2.0,4.0.0)",
  org.eclipse.wst.xsd.core;bundle-version="[1.1.300,1.2.0)",
  org.eclipse.search;bundle-version="[3.2.0,4.0.0)",
- com.ibm.icu;bundle-version="[3.8.1,4.0.0)",
+ org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)",
  org.eclipse.core.filesystem;bundle-version="[1.2.0,2.0.0)"
+Import-Package: com.ibm.icu.util;version="3.8.1"
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/bundles/org.eclipse.wst.xsd.ui/about.html b/bundles/org.eclipse.wst.xsd.ui/about.html
index 73db36e..2199df3 100644
--- a/bundles/org.eclipse.wst.xsd.ui/about.html
+++ b/bundles/org.eclipse.wst.xsd.ui/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/bundles/org.eclipse.wst.xsd.ui/build.properties b/bundles/org.eclipse.wst.xsd.ui/build.properties
index aef966f..cc91274 100644
--- a/bundles/org.eclipse.wst.xsd.ui/build.properties
+++ b/bundles/org.eclipse.wst.xsd.ui/build.properties
@@ -20,8 +20,7 @@
                plugin.properties,\
                META-INF/,\
                about.html
-src.includes = build.properties,\
-               component.xml
+src.includes = component.xml
 output.. = bin/
 javacSource=1.4
 javacTarget=1.4
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/ctool16/NewXSD.gif b/bundles/org.eclipse.wst.xsd.ui/icons/ctool16/NewXSD.gif
new file mode 100644
index 0000000..b6efdd3
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/icons/ctool16/NewXSD.gif
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/plugin.properties b/bundles/org.eclipse.wst.xsd.ui/plugin.properties
index 961835e..04fbaf7 100644
--- a/bundles/org.eclipse.wst.xsd.ui/plugin.properties
+++ b/bundles/org.eclipse.wst.xsd.ui/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2007 IBM Corporation and others.
+# Copyright (c) 2001, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -27,6 +27,8 @@
 
 _UI_XML_TOOLS_PREFERENCE_PAGE  = XML
 _UI_XML_SCHEMA_PREFERENCE      = XML Schema Files
+_UI_XML_SCHEMA_EDITOR_PREFERENCE = Editor
+_UI_XML_SCHEMA_VALIDATOR_PREFERENCE = Validation
 
 _UI_WIZARD_NEW_XSD             = XML Schema
 _UI_CREATE_A_NEW_SCHEMA        = Create a new XML schema file
@@ -40,12 +42,11 @@
 _UI_LABEL_EXTENSIONS       = Extensions
 _UI_LABEL_FACETS           = Facets
 _UI_LABEL_ENUMERATIONS     = Enumerations
-_UI_LABEL_NAMESPACE        = Namespace
 _UI_LABEL_ADVANCED         = Advanced
 
 _UI_LABEL_READ_ONLY     = read-only
 _UI_LABEL_KIND          = Kind:
-_UI_LABEL_VARIETY       = Variety:
+_UI_LABEL_VARIETY       = &Variety:
 
 _UI_LABEL_APP_INFO      = App Info
 
@@ -58,9 +59,9 @@
 _UI_LABEL_LANGUAGE               = Language:
 _UI_TOOLTIP_LANGUAGE             = Represents natural language identifiers
 _UI_GROUP_NAMESPACE              = Namespace
-_UI_LABEL_SCHEMA_PREFIX          = Prefix:
+_UI_LABEL_SCHEMA_PREFIX          = &Prefix:
 _UI_TOOLTIP_SCHEMA_PREFIX        = The prefix associated with the current namespace.
-_UI_LABEL_TARGET_NAME_SPACE      = Target namespace:
+_UI_LABEL_TARGET_NAME_SPACE      = &Target namespace:
 _UI_TOOLTIP_TARGET_NAME_SPACE    = The namespace for this schema.
 _UI_BUTTON_APPLY                 = Apply
 _UI_LABEL_ATTRIBUTE_FORM_DEFAULT = Attribute form default:
@@ -129,12 +130,6 @@
 _UI_TOOLTIP_DERIVED_BY          = Derive by extension to inherit from a base type content model and add to it. Derive by restriction to restrict the content model of an existing type.
 
 !
-! Combo box items - no need to translate
-!
-_UI_COMBO_RESTRICTION           = restriction
-_UI_COMBO_EXTENSION             = extension
-
-!
 ! Element & Element Ref Window
 !
 _UI_ELEMENT_NAME                 = Name:
@@ -166,14 +161,12 @@
 _UI_FIXED                        = Fixed
 _UI_DEFAULT                      = Default
 _UI_ATTRIBUTE_NAME               = Attribute name:
-_UI_USAGE                        = Usage:
-_UI_FORM                         = Form qualification:
-_UI_VALUE                        = Value
+_UI_USAGE                        = &Usage:
+_UI_FORM                         = &Form qualification:
 
 _UI_LABEL_OTHER_ATTRIBUTES       = Other Attributes
 
 _UI_TOOLTIP_ATTRIBUTE_USE        = Indicates if the attribute is required, optional, or prohibited
-_UI_TOOLTIP_ATTRIBUTE_FORM       = Indicates if the attribute is qualifed or not in the instance document
 _UI_TOOLTIP_ATTRIBUTE_VALUE      = Provides default or fixed value for the attribute. Default value only valid if Usage value is set to optional.
 
 _UI_PROCESS_CONTENTS             = Process contents:
@@ -234,7 +227,7 @@
 !
 _UI_LABEL_TYPE_INFORMATION          = Type information
 _UI_LABEL_BASE_TYPE                 = Base type
-_UI_LABEL_BASE_TYPE_WITH_COLON      = Base type:
+_UI_LABEL_BASE_TYPE_WITH_COLON      = &Base type:
 _UI_LABEL_SET_BASE_TYPE             = Set Base Type
 _UI_ACTION_SET_BASE_TYPE            = Set Base Type...
 _UI_RADIO_NONE                      = None
@@ -283,13 +276,13 @@
 !
 ! Include & Imports
 !
-_UI_LABEL_PREFIX                = Prefix:
-_UI_LABEL_NAMESPACE             = Namespace:
+_UI_LABEL_PREFIX                = &Prefix:
+_UI_LABEL_NAMESPACE             = &Namespace:
 
 _UI_SCHEMA_INCLUDE_DESC         = Select a schema file so that the definitions in the schema file will be available in the current schema. The target namespace of the included schema must be the same as the target namespace of the current schema.
 _UI_LABEL_SCHEMA_IMPORT_DESC    = Select a schema file from a different namespace so that its definitions can be referenced by the current schema. You must associate a prefix with the new namespace for use in the current schema.
 
-_UI_LABEL_SCHEMA_LOCATION        = Schema location:
+_UI_LABEL_SCHEMA_LOCATION        = &Schema location:
 _UI_BUTTON_SELECT                = Select
 _UI_FILEDIALOG_SELECT_XML_SCHEMA = Select XML schema file
 _UI_FILEDIALOG_SELECT_XML_DESC   = Select an XML schema file from the Workbench projects
@@ -457,16 +450,16 @@
 _UI_REGEX_WIZARD_INVALID_MAX_ERROR_SUFFIX = Invalid maximum range value.  The value must be a positive integer greater than the minimum value.
 _UI_REGEX_WIZARD_INVALID_REPEAT_ERROR_SUFFIX = Invalid repeat value.  The value must be a positive integer.
 _UI_REGEX_WIZARD_INVALID_SELECTION_ERROR = Nothing is currently selected.  Either make a selection or choose a different token. 
-_UI_REGEX_WIZARD_TOKEN_LABEL = Token contents:
-_UI_REGEX_WIZARD_AUTO_ESCAPE_CHECKBOX_LABEL = Auto escape
+_UI_REGEX_WIZARD_TOKEN_LABEL = &Token contents:
+_UI_REGEX_WIZARD_AUTO_ESCAPE_CHECKBOX_LABEL = Auto &escape
 _UI_REGEX_WIZARD_OCCURENCE_LABEL = Occurrence
 ! Instructions for translators: The following label is used in a phrase to identify a range of values.
 ! For example:  5 to 10.
 ! The values are text fields that are initially blank so the user has to enter in values
 ! For example:   _______ to ________
 _UI_REGEX_WIZARD_TO_LABEL = to
-_UI_REGEX_WIZARD_ADD_BUTTON_LABEL = Add 
-_UI_REGEX_WIZARD_CURRENT_REGEX_LABEL = Current regular expression:
+_UI_REGEX_WIZARD_ADD_BUTTON_LABEL = &Add 
+_UI_REGEX_WIZARD_CURRENT_REGEX_LABEL = &Current regular expression:
 _UI_TOOLTIP_REGEX_WIZARD_TERMS = Content of new token
 _UI_TOOLTIP_REGEX_WIZARD_AUTO_ESCAPE_CHECKBOX = Insert escape characters to match metacharacter literals (e.g. converts \"*\" to \"\\*\")
 _UI_TOOLTIP_REGEX_WIZARD_ADD_BUTTON = Add this token to the regular expression
@@ -488,19 +481,19 @@
 _UI_REGEX_WIZARD_TERM_UPPER = Upper case
 _UI_REGEX_WIZARD_TERM_LOWER = Lower case
 _UI_REGEX_WIZARD_TERM_SELECTION = Current selection
-_UI_REGEX_WIZARD_QUANTIFIER_SINGLE = Just once
-_UI_REGEX_WIZARD_QUANTIFIER_STAR = Zero or more
-_UI_REGEX_WIZARD_QUANTIFIER_PLUS = One or more
-_UI_REGEX_WIZARD_QUANTIFIER_OPTIONAL = Optional
-_UI_REGEX_WIZARD_QUANTIFIER_REPEAT = Repeat
-_UI_REGEX_WIZARD_QUANTIFIER_RANGE = Range
+_UI_REGEX_WIZARD_QUANTIFIER_SINGLE = &Just once
+_UI_REGEX_WIZARD_QUANTIFIER_STAR = &Zero or more
+_UI_REGEX_WIZARD_QUANTIFIER_PLUS = &One or more
+_UI_REGEX_WIZARD_QUANTIFIER_OPTIONAL = O&ptional
+_UI_REGEX_WIZARD_QUANTIFIER_REPEAT = &Repeat
+_UI_REGEX_WIZARD_QUANTIFIER_RANGE = Ran&ge
 
 !
 ! Select Include File Wizard
 _UI_LABEL_INCLUDE_URL_FILE    = Select schema from:
-_UI_RADIO_URL                 = HTTP
-_UI_RADIO_FILE                = Workbench projects
-_UI_WIZARD_INCLUDE_FILE_TITLE = Include Another Schema
+_UI_RADIO_URL                 = &HTTP
+_UI_RADIO_FILE                = &Workbench projects
+_UI_WIZARD_INCLUDE_FILE_TITLE = Select a schema
 _UI_WIZARD_INCLUDE_FILE_DESC  = Select another schema from workbench projects or from HTTP.
 _UI_LABEL_URL                 = URL:
 _UI_URL_START_WITH            = The URL must start with http://
@@ -698,12 +691,9 @@
 
 _UI_LABEL_ITEM_TYPE_CHANGE     = Item Type Change
 
-_UI_LABEL_AVAILABLE_TYPES      = Available Types
-
 _UI_LABEL_INCLUDE_CHANGE       = Include Change
 
 _UI_LABEL_ITEM_TYPE            = Item type:
-_UI_LABEL_BASE_TYPE            = Base Type
 _UI_LABEL_TYPE                 = Type
 _UI_LABEL_MODEL_GROUP          = Model Group
 
@@ -769,7 +759,7 @@
 _UI_ANY_ELEMENT = Any Element
 _UI_SORT = Sort
 
-_UI_ACTION_EDIT_NAMESPACES = Edit Namespaces...
+_UI_ACTION_EDIT_NAMESPACES = Edit &Namespaces...
 
 
 _UI_CreateChild_text = {0}
@@ -795,16 +785,16 @@
 ! refactoring
 !
 !======================================================================================
-refactoringActionSet.label=Refactor
+refactoringActionSet.label=Refac&tor
 refactoringActionSet.description=XSD Editor refactoring actions
-refactoring.menu.label=Refactor
+refactoring.menu.label=Refac&tor
 refactoring.renameAction.label=Re&name...
 context.text.editor.xsd.name=Editing XSD context
-command.xsd.refactor.rename.element.name=Rename XSD element
+command.xsd.refactor.rename.element.name=&Rename XSD element
 command.xsd.refactor.rename.element.description=Rename XSD element
-command.xsd.refactor.makeElementGlobal.element.name=Make local element global
+command.xsd.refactor.makeElementGlobal.element.name=Make Local Element &Global
 command.xsd.refactor.makeElementGlobal.element.description=Promotes local element to global level and replaces its references
-command.xsd.refactor.makeTypeGlobal.element.name=Make anonymous type global
+command.xsd.refactor.makeTypeGlobal.element.name=Make &Anonymous Type Global
 command.xsd.refactor.makeTypeGlobal.element.description=Promotes anonymous type to global level and replaces its references
 command.xsd.refactor.renameTargetNamespace.name=Rename Target Namespace
 command.xsd.refactor.renameTargetNamespace.description=Changes the target namespace of the schema
@@ -842,13 +832,19 @@
 _INFO_RESET_ATTRIBUTE_GROUP_REFERENCE  = Reset attribute group reference
 _INFO_REMOVE_ATTRIBUTE_GROUP_REFERENCE = Remove attribute group reference
 
-Bundle-Vendor.0 = Eclipse.org
+Bundle-Vendor.0 = Eclipse Web Tools Platform
 search.declarations.label = Declarations
-search.references.label = References
+search.references.label = Re&ferences
 
 ! extension points 
 ExtensionNodeCustomizationsDescription = Extension Node Customizations
 XMLSchemaEditorModes = XML Schema Editor Modes
 ##
 XSD_Source_target_name=XML Schema Source
-XSD_hyperlink=XML Schema Content
\ No newline at end of file
+XSD_hyperlink=XML Schema Content
+
+
+XSD_DESIGN_VIEW_DESCRIPTION=XSD Editor Design View
+XSD_DESIGN_VIEW=XSD Editor Design View
+XSD_SOURCE_VIEW_DESCRIPTION=XSD Editor Source View
+XSD_SOURCE_VIEW=XSD Editor Source View
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/plugin.xml b/bundles/org.eclipse.wst.xsd.ui/plugin.xml
index 1b87ef9..94f21e3 100644
--- a/bundles/org.eclipse.wst.xsd.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.xsd.ui/plugin.xml
@@ -16,7 +16,7 @@
 
 	<extension point="org.eclipse.ui.editorActions">
         <editorContribution
-            targetID="org.eclipse.wst.xsd.core.xsdsource.source"
+            targetID="org.eclipse.wst.xsd.ui.internal.editor.InternalXSDMultiPageEditor"
             id="org.eclipse.wst.xsd.core.xsdsource.ruler.actions">
          <action
                label="%AddBookmark.label"
@@ -38,7 +38,7 @@
 			name="%_UI_WIZARD_NEW_XSD"
 			class="org.eclipse.wst.xsd.ui.internal.wizards.NewXSDWizard"
 			category="org.eclipse.wst.XMLCategory"
-			icon="icons/XSDFile.gif">
+			icon="icons/ctool16/NewXSD.gif">
 			<description>%_UI_CREATE_A_NEW_SCHEMA</description>
 			<selection class="org.eclipse.core.resources.IResource" />
 		</wizard>
@@ -51,6 +51,18 @@
 			class="org.eclipse.wst.xsd.ui.internal.preferences.XSDPreferencePage"
 			id="org.eclipse.wst.xsd.ui.internal.preferences.XSDPreferencePage">
 		</page>
+    <page
+          category="org.eclipse.wst.xsd.ui.internal.preferences.XSDPreferencePage"
+          class="org.eclipse.wst.xsd.ui.internal.preferences.XSDEditorPreferencePage"
+          id="org.eclipse.wst.xsd.ui.internal.preferences.XSDEditorPreferencePage"
+          name="%_UI_XML_SCHEMA_EDITOR_PREFERENCE">
+    </page>
+    <page
+          category="org.eclipse.wst.xsd.ui.internal.preferences.XSDPreferencePage"
+          class="org.eclipse.wst.xsd.ui.internal.preferences.XSDValidatorPreferencePage"
+          id="org.eclipse.wst.xsd.ui.internal.preferences.XSDValidatorPreferencePage"
+          name="%_UI_XML_SCHEMA_VALIDATOR_PREFERENCE">
+    </page>
 	</extension>
 	<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
 		<provisionalDefinition
@@ -137,6 +149,12 @@
 	    <input type="org.eclipse.xsd.XSDSchema">
 	    </input>
 	 </propertySection>
+	 <propertySection tab="property.tab.advanced" 
+        class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDSchemaAdvancedSection"  
+	 	id="prop.section.XSDSchemaSection">
+	    <input type="org.eclipse.xsd.XSDSchema">
+	    </input>
+	 </propertySection>
 	 <propertySection tab="property.tab.general" 
         class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.SchemaLocationSection" 
 	 	id="prop.section.SchemaLocationSection">
@@ -197,6 +215,12 @@
 	    <input type="org.eclipse.xsd.XSDSimpleTypeDefinition">
 	    </input>
 	 </propertySection>
+	 <propertySection tab="property.tab.advanced" 
+        class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDSimpleTypeAdvancedSection"  
+	 	id="prop.section.XSDSimpleTypeAdvancedSection">
+	    <input type="org.eclipse.xsd.XSDSimpleTypeDefinition">
+	    </input>
+	 </propertySection>
 	 <propertySection tab="property.tab.typeconstraints" 
         class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDFacetSection"
         filter="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDFacetSectionFilter"
@@ -228,6 +252,12 @@
 	    <input type="org.eclipse.xsd.XSDImport">
 	    </input>
 	 </propertySection>
+	 <propertySection tab="property.tab.general" 
+	 	class="org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDEnumerationFacetSection" 
+	 	id="prop.section.general">
+	    <input type="org.eclipse.xsd.XSDEnumerationFacet">
+	    </input>
+	 </propertySection>	 
   </propertySections>
 </extension>
 
@@ -355,73 +385,11 @@
             label="%search.references.label"
             class="org.eclipse.wst.xsd.ui.internal.search.actions.XSDSearchReferencesGroupActionDelegate"> 
          </action>
-         <action
-            id="org.eclipse.wst.xsd.ui.refactoring.menu.refactorGroup.object" 
-            enablesFor="1"
-            style="pulldown"
-            menubarPath="refactoring-slot"
-            label="%refactoringActionSet.label" 
-            class="org.eclipse.wst.xsd.ui.internal.refactor.actions.XSDRefactorGroupActionDelegate"> 
-         </action>   
+  
       </objectContribution>         
-      <!-- here we add the 'refactor' menu item to the source view -->
-      <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>
-		<viewerContribution
-			targetID="org.eclipse.wst.xsd.core.xsdsource.source.RulerContext"
-			id="org.eclipse.wst.xsd.ui.ruler.context.actions">
-			<action
-				label="%AddTask.label"
-				helpContextId="org.eclipse.ui.AddTask_action_context"
-				class="org.eclipse.ui.texteditor.TaskRulerAction"
-				tooltip="%AddTask.tooltip"
-				menubarPath="additions"
-				id="org.eclipse.ui.texteditor.TaskRulerAction">
-			</action>
-			<action
-				label="%AddBookmark.label"
-				helpContextId="org.eclipse.ui.bookmark_action_context"
-				class="org.eclipse.ui.texteditor.BookmarkRulerAction"
-				tooltip="%AddBookmark.tooltip"
-				menubarPath="additions"
-				id="org.eclipse.ui.texteditor.BookmarkRulerAction">
-			</action>
-		</viewerContribution>
-
+    
      </extension>
 
-	
-	<!-- 
-		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-->	
-
 	<extension point="org.eclipse.ui.commands">
 		<command
 			name="%command.xsd.refactor.rename.element.name"
@@ -464,4 +432,264 @@
 			targetId="org.eclipse.wst.xsd.core.xsdsource">
 		</hyperlinkDetector>
    </extension>
+
+ <extension point="org.eclipse.ui.menus">
+	<menuContribution locationURI="toolbar:org.eclipse.wst.xml.ui.perspective.NewFileToolBar">
+        <command
+              commandId="org.eclipse.ui.newWizard"
+              icon="icons/ctool16/NewXSD.gif"
+              id="org.eclipse.wst.xsd.ui.newXSDFile"
+              style="push"
+              tooltip="%_UI_NEW_XML_SCHEMA_TITLE">
+             <parameter name="newWizardId" value="org.eclipse.wst.xsd.ui.internal.wizards.NewXSDWizard"/>
+          <visibleWhen checkEnabled="false">
+			<with variable="activeWorkbenchWindow.activePerspective">
+				<equals value="org.eclipse.wst.xml.ui.perspective"/>
+			</with>
+           </visibleWhen>         
+        </command>        
+     </menuContribution>
+     <menuContribution locationURI="popup:refactorPopupMenuId">
+        <command
+              commandId="org.eclipse.wst.xsd.ui.refactor.rename.element"
+              label="%refactoring.renameAction.label">
+           <visibleWhen
+                 checkEnabled="false">
+               	<reference
+                   	definitionId="org.eclipse.wst.xsd.ui.editor.active.sourceView.definition">
+               	</reference>
+           </visibleWhen>
+        </command>
+    </menuContribution>
+    <menuContribution
+          locationURI="popup:org.eclipse.wst.xsd.ui.refactorMenuId">
+          <command
+                commandId="org.eclipse.wst.xsd.ui.refactor.rename.element"
+                label="%refactoring.renameAction.label">
+             <visibleWhen
+                   checkEnabled="false">
+             </visibleWhen>
+        </command>
+    </menuContribution>
+	<menuContribution
+          locationURI="menu:refactorMenuId">
+       <command
+             commandId="org.eclipse.wst.xsd.ui.refactor.rename.element"
+             label="%refactoring.renameAction.label">
+          <visibleWhen
+                checkEnabled="false">
+                <or>
+	                <reference
+	                      definitionId="org.eclipse.wst.xsd.ui.editor.active.designView.definition">
+	                </reference>
+	                <reference
+	                      definitionId="org.eclipse.wst.xsd.ui.editor.active.sourceView.definition">
+	                </reference>
+                </or>
+          </visibleWhen>
+          
+        </command>
+    </menuContribution>
+    <menuContribution locationURI="popup:refactorPopupMenuId">
+        <command
+              commandId="org.eclipse.wst.xsd.ui.refactor.makeElementGlobal"
+              label="%command.xsd.refactor.makeElementGlobal.element.name">
+           <visibleWhen
+                 checkEnabled="false">
+               <reference
+                    definitionId="org.eclipse.wst.xsd.ui.editor.active.sourceView.definition">
+               </reference>
+           </visibleWhen>
+        </command>
+    </menuContribution>
+    <menuContribution
+          locationURI="popup:org.eclipse.wst.xsd.ui.refactorMenuId">
+          <command
+                commandId="org.eclipse.wst.xsd.ui.refactor.makeElementGlobal"
+                label="%command.xsd.refactor.makeElementGlobal.element.name">
+             <visibleWhen
+                   checkEnabled="false">
+             </visibleWhen>
+        </command>
+    </menuContribution>
+	<menuContribution
+          locationURI="menu:refactorMenuId">
+       <command
+             commandId="org.eclipse.wst.xsd.ui.refactor.makeElementGlobal"
+             label="%command.xsd.refactor.makeElementGlobal.element.name">
+          <visibleWhen
+                checkEnabled="false">
+                <or>
+	                <reference
+	                      definitionId="org.eclipse.wst.xsd.ui.editor.active.designView.definition">
+	                </reference>
+	                <reference
+	                      definitionId="org.eclipse.wst.xsd.ui.editor.active.sourceView.definition">
+	                </reference>
+                </or>
+          </visibleWhen>
+          
+        </command>
+    </menuContribution>
+     <menuContribution locationURI="popup:refactorPopupMenuId">
+        <command
+              commandId="org.eclipse.wst.xsd.ui.refactor.makeTypeGlobal"
+              label="%command.xsd.refactor.makeTypeGlobal.element.name">
+           <visibleWhen
+                 checkEnabled="false">
+               <reference
+                  definitionId="org.eclipse.wst.xsd.ui.editor.active.sourceView.definition">
+               </reference>
+           </visibleWhen>
+        </command>
+    </menuContribution>
+    <menuContribution
+          locationURI="popup:org.eclipse.wst.xsd.ui.refactorMenuId">
+          <command
+                commandId="org.eclipse.wst.xsd.ui.refactor.makeTypeGlobal"
+                label="%command.xsd.refactor.makeTypeGlobal.element.name">
+             <visibleWhen
+                   checkEnabled="false">
+             </visibleWhen>
+        </command>
+    </menuContribution>
+	<menuContribution
+          locationURI="menu:refactorMenuId">
+       <command
+             commandId="org.eclipse.wst.xsd.ui.refactor.makeTypeGlobal"
+             label="%command.xsd.refactor.makeTypeGlobal.element.name">
+          <visibleWhen
+                checkEnabled="false">
+                <or>
+	                <reference
+	                      definitionId="org.eclipse.wst.xsd.ui.editor.active.designView.definition">
+	                </reference>
+	                <reference
+	                      definitionId="org.eclipse.wst.xsd.ui.editor.active.sourceView.definition">
+	                </reference>
+                </or>
+          </visibleWhen>
+          
+        </command>
+    </menuContribution>
+  </extension>
+
+ <extension point="org.eclipse.ui.navigator.navigatorContent">
+	<commonWizard type="new" wizardId="org.eclipse.wst.xsd.ui.internal.wizards.NewXSDWizard" menuGroupId="org.eclipse.wst.xml.new.menuGroup">
+		<enablement>
+			<instanceof value="org.eclipse.core.resources.IResource"/>
+			<with variable="activeWorkbenchWindow.activePerspective">
+			   <equals value="org.eclipse.wst.xml.ui.perspective"/>
+			</with>
+		</enablement>
+	</commonWizard>
+ </extension>
+ <extension
+         point="org.eclipse.ui.handlers">
+      <handler
+            class="org.eclipse.wst.xsd.ui.internal.refactor.handlers.RenameHandler"
+            commandId="org.eclipse.wst.xsd.ui.refactor.rename.element">
+         <enabledWhen>
+                <with
+	                   variable="selection">
+                 <test
+                       property="org.eclipse.wst.xsd.ui.refactor.renameEnabled">
+                 </test>
+	                
+	             </with>             
+		</enabledWhen>
+      </handler>
+     <handler
+            class="org.eclipse.wst.xsd.ui.internal.refactor.handlers.MakeLocalElementGlobalHandler"
+            commandId="org.eclipse.wst.xsd.ui.refactor.makeElementGlobal">
+         <enabledWhen>
+                <with
+	                   variable="selection">
+                 <test
+                       property="org.eclipse.wst.xsd.ui.refactor.makeLocalElementGlobalEnabled">
+                 </test>
+	                
+	             </with>             
+		</enabledWhen>
+      </handler>
+      <handler
+            class="org.eclipse.wst.xsd.ui.internal.refactor.handlers.MakeAnonymousTypeGobalHandler"
+            commandId="org.eclipse.wst.xsd.ui.refactor.makeTypeGlobal">
+         <enabledWhen>
+                <with
+	                   variable="selection">
+                 <test
+                       property="org.eclipse.wst.xsd.ui.refactor.makeAnonymousTypeGlobalEnabled">
+                 </test>
+	                
+	             </with>             
+		</enabledWhen>
+      </handler>
+   </extension>
+   <extension
+         point="org.eclipse.core.expressions.propertyTesters">
+      <propertyTester
+            class="org.eclipse.wst.xsd.ui.internal.refactor.RenameEnablementTester"
+            id="org.eclipse.wst.xsd.ui.refactor.rename.enablement"
+            namespace="org.eclipse.wst.xsd.ui.refactor"
+            properties="renameEnabled"
+            type="org.eclipse.jface.viewers.ISelection">
+      </propertyTester>
+      <propertyTester
+            class="org.eclipse.wst.xsd.ui.internal.refactor.MakeLocalElementGlobalEnablementTester"
+            id="org.eclipse.wst.xsd.ui.refactor.makeLocalElementGlobalEnabled"
+            namespace="org.eclipse.wst.xsd.ui.refactor"
+            properties="makeLocalElementGlobalEnabled"
+            type="org.eclipse.jface.viewers.ISelection">
+      </propertyTester>
+       <propertyTester
+            class="org.eclipse.wst.xsd.ui.internal.refactor.MakeAnonymousTypsGlobalEnablementTester"
+            id="org.eclipse.wst.xsd.ui.refactor.makeAnonymousTypeGlobalEnabled"
+            namespace="org.eclipse.wst.xsd.ui.refactor"
+            properties="makeAnonymousTypeGlobalEnabled"
+            type="org.eclipse.jface.viewers.ISelection">
+      </propertyTester>
+      
+   </extension>
+   <extension
+         point="org.eclipse.ui.contexts">
+      <context
+            description="%XSD_DESIGN_VIEW_DESCRIPTION"
+            id="org.eclipse.wst.xsd.ui.editor.designView"
+            name="%XSD_DESIGN_VIEW">
+      </context>
+            <context
+            description="%XSD_SOURCE_VIEW_DESCRIPTION"
+            id="org.eclipse.wst.xsd.ui.editor.sourceView"
+            name="%XSD_SOURCE_VIEW">
+      </context>
+   </extension>
+   <extension
+         point="org.eclipse.core.expressions.definitions">
+      <definition
+            id="org.eclipse.wst.xsd.ui.editor.active.designView.definition">
+         <with
+               variable="activeContexts">
+            <iterate
+                  operator="or">
+               <equals
+                     value="org.eclipse.wst.xsd.ui.editor.designView">
+               </equals>
+            </iterate>
+         </with>
+      </definition>
+      <definition
+            id="org.eclipse.wst.xsd.ui.editor.active.sourceView.definition">
+         <with
+               variable="activeContexts">
+            <iterate
+                  operator="or">
+               <equals
+                     value="org.eclipse.wst.xsd.ui.editor.sourceView">
+               </equals>
+            </iterate>
+         </with>
+      </definition>
+   </extension>  
+   
 </plugin>
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/BoxFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/BoxFigure.java
index 08dbbf9..95a904d 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/BoxFigure.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/BoxFigure.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@
 import org.eclipse.draw2d.Label;
 import org.eclipse.draw2d.ToolbarLayout;
 import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.layouts.ColumnData;
 
 public class BoxFigure extends Figure
@@ -31,7 +32,20 @@
   public BoxFigure()
   {
     super();
-    setBackgroundColor(ColorConstants.white);
+ 
+    boolean highContrast = false;
+    try
+    {
+      highContrast = Display.getDefault().getHighContrast();
+    }
+    catch (Exception e)
+    {
+    }
+    if (!highContrast)
+    {
+      setBackgroundColor(ColorConstants.white);
+    }
+    
     headingFigure = new HeadingFigure();   
     add(headingFigure);
 
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/FieldFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/FieldFigure.java
index 6141bef..c1d87cc 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/FieldFigure.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/FieldFigure.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,14 +12,18 @@
 
 import org.eclipse.core.runtime.Assert;
 import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.Graphics;
 import org.eclipse.draw2d.Label;
 import org.eclipse.draw2d.MarginBorder;
 import org.eclipse.draw2d.PositionConstants;
 import org.eclipse.draw2d.ToolbarLayout;
 import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
 import org.eclipse.gef.EditPart;
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.StructureEditPart;
 import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFieldFigure;
 import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure;
@@ -29,6 +33,12 @@
 {
   // TODO: put this color is some common class
   public static final Color cellColor = new Color(null, 224, 233, 246);
+
+// For fix to https://bugs.eclipse.org/bugs/show_bug.cgi?id=161940
+//  public static final Color leftOuterBorderColor = new Color(null, 253, 196, 88);
+//  public static final Color leftInnerBorderColor = new Color(null, 253, 226, 172);
+//  public static final Color rightOuterBorderColor = new Color(null, 150, 179, 224);
+//  public static final Color rightInnerBorderColor = new Color(null, 49, 106, 197);
   
   // Formatting constraints
   public static final int TOP_MARGIN = 2; // pixels
@@ -48,14 +58,14 @@
   protected Label typeLabel;
   protected Label typeAnnotationLabel;  // for occurrence text, or error icons
   protected Label toolTipLabel;
-
+  
+  public boolean hasFocus = false;
+  
   public FieldFigure()
   {
     super();
     setLayoutManager(new ToolbarLayout());
-//    setOpaque(true);
     rowFigure = new Figure();
-//    rowFigure.setOpaque(true);
     RowLayout rowLayout = new RowLayout();
     rowFigure.setLayoutManager(rowLayout);
 
@@ -237,17 +247,66 @@
   
   public void addSelectionFeedback()
   {
-    rowFigure.setBackgroundColor(cellColor); 
+    boolean highContrast = false;
+    try
+    {
+      highContrast = Display.getDefault().getHighContrast();
+    }
+    catch (Exception e)
+    {
+    }
+    if (highContrast)
+    {
+      rowFigure.setForegroundColor(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
+      rowFigure.setBackgroundColor(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
+    }
+    else
+    {
+      rowFigure.setBackgroundColor(cellColor);
+    }
   }
   
   public void removeSelectionFeedback()
   {
-    rowFigure.setBackgroundColor(getBackgroundColor());   
+    boolean highContrast = false;
+    try
+    {
+      highContrast = Display.getDefault().getHighContrast();
+    }
+    catch (Exception e)
+    {
+    }
+    if (highContrast)
+    {
+      rowFigure.setForegroundColor(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
+      rowFigure.setBackgroundColor(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
+    }
+    else
+    {
+      rowFigure.setBackgroundColor(getBackgroundColor());
+    }
   }
   
   public void refreshVisuals(Object model)
   {
-    // TODO Auto-generated method stub
-    
+  }
+  
+  public void paint(Graphics graphics)
+  {
+    super.paint(graphics);
+    if (hasFocus)
+    {
+      try
+      {
+        graphics.pushState();
+        Rectangle r = getBounds();
+        graphics.setXORMode(true);
+        graphics.drawFocus(r.x, r.y + 1, r.width - 1, r.height - 2);
+      }
+      finally
+      {
+        graphics.popState();
+      }
+    }
   }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java
index 9eff2e0..6a573b3 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -22,265 +22,271 @@
 import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceInfoManager;
 import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
 import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xml.ui.internal.actions.ReplacePrefixAction;
 import org.eclipse.wst.xml.ui.internal.util.XMLCommonResources;
+import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNamespaceInformationCommand;
+import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
 import org.eclipse.wst.xsd.ui.internal.nsedit.SchemaPrefixChangeHandler;
 import org.eclipse.wst.xsd.ui.internal.nsedit.TargetNamespaceChangeHandler;
 import org.eclipse.wst.xsd.ui.internal.widgets.XSDEditSchemaInfoDialog;
-import org.eclipse.xsd.XSDForm;
 import org.eclipse.xsd.XSDSchema;
 import org.eclipse.xsd.util.XSDConstants;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 
-public class XSDEditNamespacesAction extends Action {
-	private Element element;
-	private String resourceLocation;
-	private XSDSchema xsdSchema;
-    private DOMNamespaceInfoManager namespaceInfoManager = new DOMNamespaceInfoManager();
-	
-	public XSDEditNamespacesAction(String label, Element element, Node node) {
-		super();
-		setText(label);
-		
-		this.element = element;
-		///////////////////// This needs to be changed....
-		this.resourceLocation = "dummy";		
-	}
-	
-	public XSDEditNamespacesAction(String label, Element element, Node node, XSDSchema schema) {
-		this (label, element, node);
-		xsdSchema = schema;
-	}
-	
-	public void run() {
-		if (element != null)
-		{   
-		      Shell shell = XMLCommonResources.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
-		      String targetNamespace = null;
-		      if (xsdSchema != null) {
-		      	targetNamespace = xsdSchema.getTargetNamespace();
-		      }
-		      XSDEditSchemaInfoDialog dialog = new XSDEditSchemaInfoDialog(shell, new Path(resourceLocation), targetNamespace); 
+public class XSDEditNamespacesAction extends Action
+{
+  private Element element;
+  private String resourceLocation;
+  private XSDSchema xsdSchema;
+  private DOMNamespaceInfoManager namespaceInfoManager = new DOMNamespaceInfoManager();
 
-		      List namespaceInfoList = namespaceInfoManager.getNamespaceInfoList(element);
-		      List oldNamespaceInfoList = NamespaceInfo.cloneNamespaceInfoList(namespaceInfoList);
+  public XSDEditNamespacesAction(String label, Element element, Node node)
+  {
+    super();
+    setText(label);
 
-		      // here we store a copy of the old info for each NamespaceInfo
-		      // this info will be used in createPrefixMapping() to figure out how to update the document 
-		      // in response to these changes
-		      for (Iterator i = namespaceInfoList.iterator(); i.hasNext(); )
-		      {
-		        NamespaceInfo info = (NamespaceInfo)i.next();
-		        NamespaceInfo oldCopy = new NamespaceInfo(info);
-		        info.setProperty("oldCopy", oldCopy); //$NON-NLS-1$
-		      }
-          
-          String currentElementFormQualified = "";
-          String currentAttributeFormQualified = "";
-          
-          boolean hasElementForm = element.hasAttribute(XSDConstants.ELEMENTFORMDEFAULT_ATTRIBUTE);
-          if (hasElementForm) currentElementFormQualified = element.getAttribute(XSDConstants.ELEMENTFORMDEFAULT_ATTRIBUTE);
-          
-          boolean hasAttributeForm = element.hasAttribute(XSDConstants.ATTRIBUTEFORMDEFAULT_ATTRIBUTE);
-          if (hasAttributeForm) currentAttributeFormQualified = element.getAttribute(XSDConstants.ATTRIBUTEFORMDEFAULT_ATTRIBUTE);
-		                              
-		      dialog.setNamespaceInfoList(namespaceInfoList);   
-		      dialog.create();      
-		      dialog.getShell().setSize(500, 400);
-		      dialog.getShell().setText(XMLCommonResources.getInstance().getString("_UI_MENU_EDIT_SCHEMA_INFORMATION_TITLE")); //$NON-NLS-1$
-          dialog.setIsElementQualified(currentElementFormQualified);
-          dialog.setIsAttributeQualified(currentAttributeFormQualified);
-		      dialog.setBlockOnOpen(true);                                 
-		      dialog.open();
-          String xsdPrefix = "";     //$NON-NLS-1$
+    this.element = element;
+    // /////////////////// This needs to be changed....
+    this.resourceLocation = "dummy";
+  }
 
-		      if (dialog.getReturnCode() == Window.OK)
-		      {
-            Element xsdSchemaElement = xsdSchema.getElement();
-            DocumentImpl doc = (DocumentImpl) xsdSchemaElement.getOwnerDocument();
-            
-            List newInfoList = dialog.getNamespaceInfoList();
+  public XSDEditNamespacesAction(String label, Element element, Node node, XSDSchema schema)
+  {
+    this(label, element, node);
+    xsdSchema = schema;
+  }
 
-		        // see if we need to rename any prefixes
-		        Map prefixMapping = createPrefixMapping(oldNamespaceInfoList, namespaceInfoList);
-            
-            Map map2 = new Hashtable();
-            for (Iterator iter = newInfoList.iterator(); iter.hasNext(); )
+  public void run()
+  {
+    if (element != null)
+    {
+      Shell shell = XMLCommonResources.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
+      String targetNamespace = null;
+      if (xsdSchema != null)
+      {
+        targetNamespace = xsdSchema.getTargetNamespace();
+      }
+      XSDEditSchemaInfoDialog dialog = new XSDEditSchemaInfoDialog(shell, new Path(resourceLocation), targetNamespace);
+
+      List namespaceInfoList = namespaceInfoManager.getNamespaceInfoList(element);
+      List oldNamespaceInfoList = NamespaceInfo.cloneNamespaceInfoList(namespaceInfoList);
+
+      // here we store a copy of the old info for each NamespaceInfo
+      // this info will be used in createPrefixMapping() to figure out how to
+      // update the document in response to these changes
+      for (Iterator i = namespaceInfoList.iterator(); i.hasNext();)
+      {
+        NamespaceInfo info = (NamespaceInfo) i.next();
+        NamespaceInfo oldCopy = new NamespaceInfo(info);
+        info.setProperty("oldCopy", oldCopy); //$NON-NLS-1$
+      }
+
+      dialog.setNamespaceInfoList(namespaceInfoList);
+      dialog.create();
+      dialog.getShell().setSize(500, 400);
+      dialog.getShell().setText(XMLCommonResources.getInstance().getString("_UI_MENU_EDIT_SCHEMA_INFORMATION_TITLE")); //$NON-NLS-1$
+      dialog.setBlockOnOpen(true);
+      dialog.open();
+
+      String xsdPrefix = null; //$NON-NLS-1$
+      String origXSDPrefix = xsdSchema.getSchemaForSchemaQNamePrefix();
+      String newTNSPrefix = "";
+
+      if (dialog.getReturnCode() == Window.OK)
+      {
+        Element xsdSchemaElement = xsdSchema.getElement();
+        DocumentImpl doc = (DocumentImpl) xsdSchemaElement.getOwnerDocument();
+
+        List newInfoList = dialog.getNamespaceInfoList();
+
+        // see if we need to rename any prefixes
+        Map prefixMapping = createPrefixMapping(oldNamespaceInfoList, namespaceInfoList);
+
+        String origTNSPrefix = null;
+        Map origPrefixMap = xsdSchema.getQNamePrefixToNamespaceMap();
+        for (Iterator iter = origPrefixMap.keySet().iterator(); iter.hasNext();)
+        {
+          String key = (String) iter.next();
+          String ns = (String) origPrefixMap.get(key);
+          if ((targetNamespace == null && ns == null) || targetNamespace != null && targetNamespace.equals(ns))
+          {
+            origTNSPrefix = key;
+            break;
+          }
+        }
+        Map map2 = new Hashtable();
+        for (Iterator iter = newInfoList.iterator(); iter.hasNext();)
+        {
+          NamespaceInfo ni = (NamespaceInfo) iter.next();
+          String pref = ni.prefix;
+          String uri = ni.uri;
+          if (pref == null)
+            pref = ""; //$NON-NLS-1$
+          if (uri == null)
+            uri = ""; //$NON-NLS-1$
+          if (XSDConstants.isSchemaForSchemaNamespace(uri))
+          {
+            xsdPrefix = pref;
+          }
+          if (uri.equals(dialog.getTargetNamespace()))
+          {
+            newTNSPrefix = pref;
+          }
+          map2.put(pref, uri);
+        }
+
+        if (map2.size() > 0)
+        {
+          try
+          {
+
+            doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_NAMESPACE_CHANGE"));
+            boolean targetNamespaceChanged = (targetNamespace != null && !targetNamespace.equals(dialog.getTargetNamespace()) || targetNamespace == null && dialog.getTargetNamespace() != null);
+            boolean tnsPrefixChanged = !newTNSPrefix.equals(origTNSPrefix);
+            boolean xsdPrefixChanged = (!(origXSDPrefix == null && xsdPrefix.equals("")) || (origXSDPrefix != null && !origXSDPrefix.equals(xsdPrefix)));
+
+            xsdSchema.setIncrementalUpdate(false);
+
+            // First handle the prefix change for the target namespace
+            if (tnsPrefixChanged)
             {
-              NamespaceInfo ni = (NamespaceInfo)iter.next();
-              String pref = ni.prefix;
-              String uri = ni.uri;
-              if (pref == null) pref = ""; //$NON-NLS-1$
-              if (uri == null) uri = ""; //$NON-NLS-1$
-              if (XSDConstants.isSchemaForSchemaNamespace(uri))
-              {
-                xsdPrefix = pref;
-              }
-              map2.put(pref, uri);
+              prefixMapping.remove(origTNSPrefix);
+              UpdateNamespaceInformationCommand command = new UpdateNamespaceInformationCommand(Messages._UI_ACTION_NAMESPACE_INFORMATION_CHANGE, xsdSchema, newTNSPrefix, targetNamespace);
+              command.execute();
+              xsdSchema.update();
             }
-           
-		        if (map2.size() > 0)
-		        {
-		        	try {
-                
-                doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_NAMESPACE_CHANGE"));
+            // Second, handle the target namespace change
+            if (targetNamespaceChanged)
+            {
+              // set the targetNamespace attribute
+              xsdSchema.setTargetNamespace(dialog.getTargetNamespace());
 
-                if (xsdPrefix != null && xsdPrefix.length() == 0)
-                {
-                  xsdSchema.setSchemaForSchemaQNamePrefix(null);
-                }
-                else
-                {
-                  xsdSchema.setSchemaForSchemaQNamePrefix(xsdPrefix);
-                }
+              TargetNamespaceChangeHandler targetNamespaceChangeHandler = new TargetNamespaceChangeHandler(xsdSchema, targetNamespace, dialog.getTargetNamespace());
+              targetNamespaceChangeHandler.resolve();
+            }
 
-                xsdSchema.setTargetNamespace(dialog.getTargetNamespace());
-                xsdSchema.update();
-                
-                SchemaPrefixChangeHandler spch = new SchemaPrefixChangeHandler(xsdSchema, xsdPrefix);
+            
+            // Now handle the other changes. PrefixMapping size should be
+            // greater than 0 for any remaining prefix changes
+
+            if (prefixMapping.size() > 0)
+            {
+              for (Iterator iter = prefixMapping.keySet().iterator(); iter.hasNext();)
+              {
+                String oldPrefix = (String) iter.next();
+                String newPrefix = (String) prefixMapping.get(oldPrefix);
+
+                // Now update any references to this old prefix in the schema
+                // with the value of the new prefix
+                String ns = (String) origPrefixMap.get(oldPrefix);
+                SchemaPrefixChangeHandler spch = new SchemaPrefixChangeHandler(xsdSchema, newPrefix, ns != null? ns : ""); //$NON-NLS-1$
                 spch.resolve();
-                xsdSchema.update();
-                
-                xsdSchema.setIncrementalUpdate(false);
-                namespaceInfoManager.removeNamespaceInfo(element);
-                namespaceInfoManager.addNamespaceInfo(element, newInfoList, false);
-                xsdSchema.setIncrementalUpdate(true);
-
-                // don't need these any more?
-			          ReplacePrefixAction replacePrefixAction = new ReplacePrefixAction(null, element, prefixMapping);
-			          replacePrefixAction.run();
-                
-                TargetNamespaceChangeHandler targetNamespaceChangeHandler = new TargetNamespaceChangeHandler(xsdSchema, targetNamespace, dialog.getTargetNamespace());
-                targetNamespaceChangeHandler.resolve();
-				    	}
-              catch (Exception e)
-              { 
-//                e.printStackTrace();
               }
-              finally
-              {
-                xsdSchema.update();
-                doc.getModel().endRecording(this);
-			     		}
-		        }
+            }
+            namespaceInfoManager.removeNamespaceInfo(element);
+            namespaceInfoManager.addNamespaceInfo(element, newInfoList, false);
             
-            String attributeFormQualified = dialog.getAttributeFormQualified();
-            String elementFormQualified = dialog.getElementFormQualified();
-
-            boolean elementFormChanged = true;
-            boolean attributeFormChanged = true;
-            if (elementFormQualified.equals(currentElementFormQualified))
+            // Third, handle the schema for schema prefix change
+            if (xsdPrefixChanged)
             {
-              elementFormChanged = false;
-            }
-            if (attributeFormQualified.equals(currentAttributeFormQualified))
-            {
-              attributeFormChanged = false;
-            }
-            if (elementFormChanged)
-            {
-              doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_SCHEMA_ELEMENTFORMDEFAULT_CHANGE"));
-              if (elementFormQualified.equals(XSDForm.QUALIFIED_LITERAL.getName()))
+              if (xsdPrefix != null && xsdPrefix.length() == 0)
               {
-                xsdSchema.setElementFormDefault(XSDForm.QUALIFIED_LITERAL);
-              }
-              else if (elementFormQualified.equals(XSDForm.UNQUALIFIED_LITERAL.getName()))
-              {
-                xsdSchema.setElementFormDefault(XSDForm.UNQUALIFIED_LITERAL);
+                xsdSchema.setSchemaForSchemaQNamePrefix(null);
               }
               else
               {
-                // Model should allow us to remove the attribute
-                xsdSchema.getElement().removeAttribute(XSDConstants.ELEMENTFORMDEFAULT_ATTRIBUTE);
+                xsdSchema.setSchemaForSchemaQNamePrefix(xsdPrefix);
               }
-              doc.getModel().endRecording(this);
+
+              namespaceInfoManager.removeNamespaceInfo(element);
+              namespaceInfoManager.addNamespaceInfo(element, newInfoList, false);
+              xsdSchema.setIncrementalUpdate(true);
+
+              // Now change the references to any schema types/components ie. string --> xs:string
+              SchemaPrefixChangeHandler spch = new SchemaPrefixChangeHandler(xsdSchema, xsdPrefix);
+              spch.resolve();
+
+              // Change the prefix for all schema components
+              updateAllNodes(element, xsdPrefix);
+
+              prefixMapping.remove(origXSDPrefix != null? origXSDPrefix : ""); //$NON-NLS-1$
             }
-            if (attributeFormChanged)
-            {
-              doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_SCHEMA_ATTRIBUTEFORMDEFAULT_CHANGE"));
-              if (attributeFormQualified.equals(XSDForm.QUALIFIED_LITERAL.getName()))
-              {
-                xsdSchema.setAttributeFormDefault(XSDForm.QUALIFIED_LITERAL);
-              }
-              else if (attributeFormQualified.equals(XSDForm.UNQUALIFIED_LITERAL.getName()))
-              {
-                xsdSchema.setAttributeFormDefault(XSDForm.UNQUALIFIED_LITERAL);
-              }
-              else
-              {
-                // Model should allow us to remove the attribute
-                xsdSchema.getElement().removeAttribute(XSDConstants.ATTRIBUTEFORMDEFAULT_ATTRIBUTE);
-              }
-              
-              doc.getModel().endRecording(this);
-            }
-		   }      
-          
-		}
-	}
-	
-	 protected Map createPrefixMapping(List oldList, List newList)
-	  {          
-	    Map map = new Hashtable();
+            xsdSchema.setIncrementalUpdate(true);
+          }
+          catch (Exception e)
+          {
+          }
+          finally
+          {
+            xsdSchema.update();
+            doc.getModel().endRecording(this);
+          }
+        }
+      }
+    }
+  }
 
-	    Hashtable oldURIToPrefixTable = new Hashtable();
-	    for (Iterator i = oldList.iterator(); i.hasNext(); )
-	    {    
-	      NamespaceInfo oldInfo = (NamespaceInfo)i.next();                    
-	      oldURIToPrefixTable.put(oldInfo.uri, oldInfo);
-	    }
-	    
-	    for (Iterator i = newList.iterator(); i.hasNext(); )
-	    {
-	      NamespaceInfo newInfo = (NamespaceInfo)i.next();
-	      NamespaceInfo oldInfo = (NamespaceInfo)oldURIToPrefixTable.get(newInfo.uri != null ? newInfo.uri : "");  //$NON-NLS-1$
+  protected Map createPrefixMapping(List oldList, List newList)
+  {
+    Map map = new Hashtable();
 
+    Hashtable oldURIToPrefixTable = new Hashtable();
+    for (Iterator i = oldList.iterator(); i.hasNext();)
+    {
+      NamespaceInfo oldInfo = (NamespaceInfo) i.next();
+      oldURIToPrefixTable.put(oldInfo.uri, oldInfo);
+    }
 
-	      // if oldInfo is non null ... there's a matching URI in the old set
-	      // we can use its prefix to detemine out mapping
-	      //
-	      // if oldInfo is null ...  we use the 'oldCopy' we stashed away 
-	      // assuming that the user changed the URI and the prefix
-	      if (oldInfo == null)                                            
-	      {
-	        oldInfo = (NamespaceInfo)newInfo.getProperty("oldCopy");            //$NON-NLS-1$
-	      } 
+    for (Iterator i = newList.iterator(); i.hasNext();)
+    {
+      NamespaceInfo newInfo = (NamespaceInfo) i.next();
+      NamespaceInfo oldInfo = (NamespaceInfo) oldURIToPrefixTable.get(newInfo.uri != null ? newInfo.uri : ""); //$NON-NLS-1$
 
-	      if (oldInfo != null)
-	      {
-	        String newPrefix = newInfo.prefix != null ? newInfo.prefix : ""; //$NON-NLS-1$
-	        String oldPrefix = oldInfo.prefix != null ? oldInfo.prefix : ""; //$NON-NLS-1$
-	        if (!oldPrefix.equals(newPrefix))
-	        {
-	          map.put(oldPrefix, newPrefix);    
-	        }
-	      }      
-	    }        
-	    return map;
-	  }
-   
-//    private void updateAllNodes(Element element, String prefix)
-//    {
-//      element.setPrefix(prefix);
-//      NodeList list = element.getChildNodes();
-//      if (list != null)
-//      {
-//        for (int i=0; i < list.getLength(); i++)
-//        {
-//          Node child = list.item(i);
-//          if (child != null && child instanceof Element)
-//          {
-//            child.setPrefix(prefix);
-//            if (child.hasChildNodes())
-//            {
-//              updateAllNodes((Element)child, prefix);
-//            }
-//          }
-//        }
-//      }   
-//    }
+      // if oldInfo is non null ... there's a matching URI in the old set
+      // we can use its prefix to detemine out mapping
+      //
+      // if oldInfo is null ... we use the 'oldCopy' we stashed away
+      // assuming that the user changed the URI and the prefix
+      if (oldInfo == null)
+      {
+        oldInfo = (NamespaceInfo) newInfo.getProperty("oldCopy"); //$NON-NLS-1$
+      }
+
+      if (oldInfo != null)
+      {
+        String newPrefix = newInfo.prefix != null ? newInfo.prefix : ""; //$NON-NLS-1$
+        String oldPrefix = oldInfo.prefix != null ? oldInfo.prefix : ""; //$NON-NLS-1$
+        if (!oldPrefix.equals(newPrefix))
+        {
+          map.put(oldPrefix, newPrefix);
+        }
+      }
+    }
+    return map;
+  }
+
+  private void updateAllNodes(Element element, String prefix)
+  {
+    element.setPrefix(prefix);
+    NodeList list = element.getChildNodes();
+    if (list != null)
+    {
+      for (int i = 0; i < list.getLength(); i++)
+      {
+        Node child = list.item(i);
+        if (child != null && child instanceof Element)
+        {
+          child.setPrefix(prefix);
+          if (child.hasChildNodes())
+          {
+            updateAllNodes((Element) child, prefix);
+          }
+        }
+      }
+    }
+  }
 
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/CategoryAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/CategoryAdapter.java
index ebb4f42..cd995ee 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/CategoryAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/CategoryAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -38,7 +38,7 @@
   protected Image image;
   protected Object parent;
   protected int groupType;
-  Collection children, allChildren;  // children from current schema, children from current schema and includes
+  protected Collection children, allChildren;  // children from current schema, children from current schema and includes
   XSDSchema xsdSchema;
 
   public CategoryAdapter(String label, Image image, Collection children, XSDSchema xsdSchema, int groupType)
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/RedefineCategoryAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/RedefineCategoryAdapter.java
new file mode 100644
index 0000000..83e8c92
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/RedefineCategoryAdapter.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.adapters;
+
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
+import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
+import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
+import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedAttributeGroupAction;
+import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedComplexTypeAction;
+import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedModelGroupAction;
+import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedSimpleTypeAction;
+import org.eclipse.xsd.XSDRedefine;
+
+
+public class RedefineCategoryAdapter extends CategoryAdapter
+{
+  protected XSDRedefine xsdRedefine;
+  private XSDRedefineAdapter xsdRedefineAdapter;
+
+  public RedefineCategoryAdapter(String label, Image image, Collection children, XSDRedefine xsdRedefine, XSDRedefineAdapter xsdRedefineAdapter, int groupType)
+  {
+    super(label, image, children, xsdRedefine.getSchema(), groupType);
+    this.xsdRedefine = xsdRedefine;
+    this.target = xsdRedefine;
+    this.xsdRedefineAdapter = xsdRedefineAdapter;
+  }
+
+  public XSDRedefine getXSDRedefine()
+  {
+    return xsdRedefine;
+  }
+
+  public String[] getActions(Object object)
+  {
+    Collection actionIDs = new ArrayList();
+
+    switch (groupType)
+    {
+      case TYPES:
+      {
+        actionIDs.add(AddXSDRedefinedComplexTypeAction.ID);
+        actionIDs.add(AddXSDRedefinedSimpleTypeAction.ID);
+        break;
+      }
+      case GROUPS:
+      {
+        actionIDs.add(AddXSDRedefinedModelGroupAction.ID);
+        break;
+      }
+      case ATTRIBUTES:
+      case ATTRIBUTE_GROUPS:
+      {
+        actionIDs.add(AddXSDRedefinedAttributeGroupAction.ID);
+        break;
+      }
+    }
+    actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
+    actionIDs.add(ShowPropertiesViewAction.ID);
+    return (String[])actionIDs.toArray(new String [0]);
+  }
+
+  public IModel getModel()
+  {
+    return (IModel)XSDAdapterFactory.getInstance().adapt(xsdRedefine.getSchema());
+  }
+
+
+  public XSDRedefineAdapter getXsdRedefineAdapter() {
+	return xsdRedefineAdapter;
+  }
+  
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAdapterFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAdapterFactory.java
index ef9b510..a05ce01 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAdapterFactory.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAdapterFactory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -20,9 +20,11 @@
 import org.eclipse.xsd.XSDAttributeUse;
 import org.eclipse.xsd.XSDComplexTypeDefinition;
 import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDEnumerationFacet;
 import org.eclipse.xsd.XSDModelGroup;
 import org.eclipse.xsd.XSDModelGroupDefinition;
 import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDRedefine;
 import org.eclipse.xsd.XSDSchema;
 import org.eclipse.xsd.XSDSchemaDirective;
 import org.eclipse.xsd.XSDSimpleTypeDefinition;
@@ -92,7 +94,6 @@
       
       public Object caseXSDSimpleTypeDefinition(XSDSimpleTypeDefinition object)
       {
-        // TODO Auto-generated method stub
         return new XSDSimpleTypeDefinitionAdapter();
       }
       
@@ -120,7 +121,17 @@
       public Object caseXSDSchema(XSDSchema object)
       {
         return new XSDSchemaAdapter();
-      }         
+      }
+      
+      public Object caseXSDEnumerationFacet(XSDEnumerationFacet object)
+      {
+        return new XSDEnumerationFacetAdapter();
+      }
+      
+      public Object caseXSDRedefine(XSDRedefine object)
+      {
+        return new XSDRedefineAdapter();
+      }
     };
     Object o = xsdSwitch.doSwitch((EObject) target);
     Adapter result = null;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAnyTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAnyTypeDefinitionAdapter.java
index 3f1b24f..3e8dc51 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAnyTypeDefinitionAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAnyTypeDefinitionAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,7 +10,11 @@
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.adapters;
 
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.gef.commands.Command;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
+import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
+import org.eclipse.xsd.XSDConcreteComponent;
 
 public class XSDAnyTypeDefinitionAdapter extends XSDTypeDefinitionAdapter
 {
@@ -37,5 +41,16 @@
   public IADTObject getTopContainer()
   {
     return null;
+  }
+
+  public Command getDeleteCommand()
+  {
+    return null;
+  }
+
+  public IModel getModel()
+  {
+    Adapter adapter = XSDAdapterFactory.getInstance().adapt(((XSDConcreteComponent)target).getSchema());
+    return (IModel)adapter;
   } 
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeDeclarationAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeDeclarationAdapter.java
index 59fc8e1..2ed6b4f 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeDeclarationAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeDeclarationAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,13 +10,20 @@
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.adapters;
 
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
 import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
+import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction;
+import org.eclipse.wst.xsd.ui.internal.editor.Messages;
+import org.eclipse.xsd.XSDAttributeDeclaration;
 import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDTypeDefinition;
 
 public class XSDAttributeDeclarationAdapter extends XSDBaseAttributeAdapter implements IActionProvider
 {
@@ -46,6 +53,38 @@
     return (IModel)adapter;
   }
 
+  // https://bugs.eclipse.org/bugs/show_bug.cgi?id=251008
+  public String[] getActions(Object object)
+  {    
+    if(!isGlobal())
+    {    	    	
+    	List defaultActions = new ArrayList();
+    	defaultActions = Arrays.asList(super.getActions(object));
+    	
+    	ArrayList list = new ArrayList();
+    	list.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_INSERT_ATTRIBUTE);
+    	list.add(AddXSDAttributeDeclarationAction.BEFORE_SELECTED_ID);
+    	list.add(AddXSDAttributeDeclarationAction.AFTER_SELECTED_ID);
+    	list.add(BaseSelectionAction.SUBMENU_END_ID);
+    	
+    	int len = defaultActions.size();
+    	for(int i = 0; i < len; i++)
+    	{
+    		if (defaultActions.get(i).equals(AddXSDAttributeDeclarationAction.ID))
+    		{
+    		  continue;
+    		}
+    		list.add(defaultActions.get(i));
+    	}
+      return (String [])list.toArray(new String[0]);
+    }
+    else
+    {
+    	return super.getActions(object);
+    }    
+  }  
+  
+  
   public boolean isFocusAllowed()
   {
     return isGlobal();
@@ -67,7 +106,6 @@
     {
       return getGlobalXSDContainer(getXSDAttributeDeclaration());
     }
-    return null;
+    return this;
   }
-
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeGroupDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeGroupDefinitionAdapter.java
index bb4c949..6ecebef 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeGroupDefinitionAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeGroupDefinitionAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,38 +11,51 @@
 package org.eclipse.wst.xsd.ui.internal.adapters;
 
 import java.util.ArrayList;
-import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 
 import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
 import org.eclipse.gef.commands.Command;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
+import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
+import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
 import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
 import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAnyAttributeAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
 import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
 import org.eclipse.wst.xsd.ui.internal.editor.Messages;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
 import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDRedefine;
+import org.eclipse.xsd.XSDSchema;
 import org.eclipse.xsd.XSDWildcard;
 
-public class XSDAttributeGroupDefinitionAdapter extends XSDBaseAdapter implements IStructure, IActionProvider, IGraphElement
+public class XSDAttributeGroupDefinitionAdapter extends XSDBaseAdapter implements IStructure, IActionProvider, IGraphElement, IADTObjectListener
 {
   public static final Image ATTRIBUTE_GROUP_REF_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAttributeGroupRef.gif");
   public static final Image ATTRIBUTE_GROUP_REF_DISABLED_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAttributeGroupRefdis.gif");
   public static final Image ATTRIBUTE_GROUP_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAttributeGroup.gif");
   public static final Image ATTRIBUTE_GROUP_DISABLED_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAttributeGroupdis.gif");
 	  
+  protected List fields = null;
+  protected List otherThingsToListenTo = null;
+  protected boolean readOnly;
+  protected boolean changeReadOnlyField =false;
+  protected HashMap deletedTypes = new HashMap();
+
   public XSDAttributeGroupDefinitionAdapter()
   {
     super();
@@ -77,11 +90,23 @@
   {
     XSDAttributeGroupDefinition xsdAttributeGroup = (XSDAttributeGroupDefinition) target;
     List list = new ArrayList();
-    list.addAll(xsdAttributeGroup.getContents());
+    Iterator iterator = xsdAttributeGroup.getContents().iterator();    
+    while (iterator.hasNext())
+    {
+    	Object o = iterator.next();
+    	if (o instanceof XSDAttributeUse)
+    	{
+    		list.add(((XSDAttributeUse)o).getAttributeDeclaration());
+    	}
+    	else
+    	{
+    		list.add(o);
+    	}
+    }
     XSDWildcard wildcard = xsdAttributeGroup.getAttributeWildcardContent();
     if (wildcard != null)
     {
-      list.add(wildcard);
+    	list.add(wildcard);
     }
     List adapterList = new ArrayList();
     populateAdapterList(list, adapterList);
@@ -94,12 +119,14 @@
     list.add(AddXSDAttributeDeclarationAction.ID);
     list.add(AddXSDAnyAttributeAction.ID);
     list.add(BaseSelectionAction.SEPARATOR_ID);
-    list.add(DeleteXSDConcreteComponentAction.DELETE_XSD_COMPONENT_ID);
+    list.add(DeleteAction.ID);
     list.add(BaseSelectionAction.SEPARATOR_ID);
     Object schema = getEditorSchema();
-    if (getXSDAttributeGroupDefinition().getSchema() == schema)
+    XSDAttributeGroupDefinition attributeGroupDefinition = getXSDAttributeGroupDefinition();
+    if (attributeGroupDefinition.getSchema() == schema)
     {
-      if (getXSDAttributeGroupDefinition().getContainer() == schema)
+      XSDConcreteComponent container = attributeGroupDefinition.getContainer();
+      if (container == schema || container instanceof XSDRedefine)
       {
         list.add(SetInputToGraphView.ID);
       }
@@ -115,20 +142,53 @@
 
   public Command getAddNewFieldCommand(String fieldKind)
   {
-    // TODO Auto-generated method stub
     return null;
   }
 
   public Command getDeleteCommand()
   {
-    return new DeleteCommand("", getXSDAttributeGroupDefinition()); //$NON-NLS-1$
+    return new DeleteCommand(getXSDAttributeGroupDefinition());
   }
 
   public List getFields()
   {
-    // TODO (cs) ... review this    
-    ITreeElement[] chidlren = getChildren();
-    return Arrays.asList(chidlren);
+    if (fields == null)
+    {
+      fields = new ArrayList();
+      otherThingsToListenTo = new ArrayList();
+      XSDVisitorForFields visitor = new XSDVisitorForFields();
+      visitor.visitAttributeGroupDefinition(getXSDAttributeGroupDefinition());
+      populateAdapterList(visitor.concreteComponentList, fields);
+      populateAdapterList(visitor.thingsWeNeedToListenTo, otherThingsToListenTo);
+      for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext();)
+      {
+        Adapter adapter = (Adapter) i.next();
+        if (adapter instanceof IADTObject)
+        {
+          IADTObject adtObject = (IADTObject) adapter;
+          adtObject.registerListener(this);
+        }
+      }
+    }
+    return fields;
+  }
+
+  protected void clearFields()
+  {
+    if (otherThingsToListenTo != null)
+    {
+      for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext();)
+      {
+        Adapter adapter = (Adapter) i.next();
+        if (adapter instanceof IADTObject)
+        {
+          IADTObject adtObject = (IADTObject) adapter;
+          adtObject.unregisterListener(this);
+        }
+      }
+    }
+    fields = null;
+    otherThingsToListenTo = null;
   }
 
   public IModel getModel()
@@ -155,8 +215,71 @@
 
   public IADTObject getTopContainer()
   {
-    return getGlobalXSDContainer(getXSDAttributeGroupDefinition());
+    XSDAttributeGroupDefinition attrGroupDef = getXSDAttributeGroupDefinition();
+    XSDConcreteComponent container = attrGroupDef.getContainer();
+    if (container instanceof XSDSchema || container instanceof XSDRedefine)
+      return this;
+    else
+      return getGlobalXSDContainer(attrGroupDef);
+  }
+
+  public void notifyChanged(Notification msg)
+  {
+    clearFields();
+    super.notifyChanged(msg);
   }
   
+  public void propertyChanged(Object object, String property)
+  {
+    clearFields();
+    notifyListeners(this, null);
+  }
+  public boolean isReadOnly()
+  {
+	  XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinition) target;
+	  if (hasSetReadOnlyField())
+	  {
+		  deletedTypes.put(xsdAttributeGroupDefinition.getName(), new Boolean(true));
+		  changeReadOnlyField = false;
+		  return readOnly;
+	  }
+	  else
+	  {
+		  if (deletedTypes!= null )
+		  {
+			  Boolean deleted = ((Boolean)deletedTypes.get(xsdAttributeGroupDefinition.getName()));
+			  if (deleted != null && deleted.booleanValue())
+			  {
+				  return true;
+			  }
+			  else
+			  {
+				  return super.isReadOnly();
+			  }
+		  }
+		  else
+		  {
+			  return super.isReadOnly();
+		  }
+	  }
+  }
 
+	public void setReadOnly(boolean readOnly) {
+		this.readOnly = readOnly;
+	}
+
+	public boolean hasSetReadOnlyField() {
+		return changeReadOnlyField;
+	}
+
+	public void setChangeReadOnlyField(boolean setReadOnlyField) {
+		this.changeReadOnlyField = setReadOnlyField;
+	}
+
+	public void updateDeletedMap(String addComponent) {
+		if (deletedTypes.get(addComponent) != null)
+		{
+			deletedTypes.clear();
+		}
+	}
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAdapter.java
index 4f2ff61..4db258d 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -226,4 +226,13 @@
       return (IADTObject)adapter;
     return null;
   }
+
+  /**
+   * Indicates the presence of an abstract attribute
+   * @return true if the component's abstract attribute is true
+   */
+  public boolean isAbstract()
+  {
+    return false;
+  }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAttributeAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAttributeAdapter.java
index 299f839..9984076 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAttributeAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAttributeAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -49,9 +49,11 @@
   public String[] getActions(Object object)
   {
     List list = new ArrayList();
-    list.add(AddXSDAttributeDeclarationAction.ID);
-    list.add(BaseSelectionAction.SEPARATOR_ID);
-    //list.add(DeleteXSDConcreteComponentAction.DELETE_XSD_COMPONENT_ID);
+    if (!isGlobal())
+    {
+      list.add(AddXSDAttributeDeclarationAction.ID);
+      list.add(BaseSelectionAction.SEPARATOR_ID);
+    }
     list.add(DeleteAction.ID);
     list.add(BaseSelectionAction.SEPARATOR_ID);
     Object schema = getEditorSchema();
@@ -73,7 +75,7 @@
 
   public Command getDeleteCommand()
   {
-    return new DeleteCommand("", getXSDAttributeDeclaration()); //$NON-NLS-1$
+    return new DeleteCommand(getXSDAttributeDeclaration());
   }
 
   public String getKind()
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDComplexTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDComplexTypeDefinitionAdapter.java
index 346c265..4ad7e90 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDComplexTypeDefinitionAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDComplexTypeDefinitionAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
 package org.eclipse.wst.xsd.ui.internal.adapters;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 
@@ -35,7 +36,9 @@
 import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeGroupDefinitionAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction;
+import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDEnumerationFacetAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupAction;
+import org.eclipse.wst.xsd.ui.internal.common.actions.SetBaseTypeAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
 import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDElementCommand;
 import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
@@ -49,17 +52,27 @@
 import org.eclipse.xsd.XSDAttributeUse;
 import org.eclipse.xsd.XSDComplexTypeContent;
 import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDDerivationMethod;
+import org.eclipse.xsd.XSDEnumerationFacet;
 import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDModelGroupDefinition;
 import org.eclipse.xsd.XSDParticle;
 import org.eclipse.xsd.XSDParticleContent;
+import org.eclipse.xsd.XSDRedefine;
 import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
 import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.XSDWildcard;
 import org.eclipse.xsd.util.XSDConstants;
 
 public class XSDComplexTypeDefinitionAdapter extends XSDTypeDefinitionAdapter implements IComplexType, IADTObjectListener
 {
   protected List fields = null;
   protected List otherThingsToListenTo = null;
+  protected boolean readOnly;
+  protected boolean changeReadOnlyField =false;
+  protected HashMap deletedTypes = new HashMap();
 
   public XSDComplexTypeDefinition getXSDComplexTypeDefinition()
   {
@@ -165,6 +178,16 @@
       }
       super.visitModelGroup(modelGroup);
     }
+    
+    public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
+    {
+      XSDModelGroupDefinition resolvedModelGroupDef = modelGroupDef.getResolvedModelGroupDefinition();
+      if (visitedGroups.contains(resolvedModelGroupDef.getModelGroup()))
+      {
+        concreteComponentList.add(new SpaceFiller("element")); //$NON-NLS-1$
+      }
+      super.visitModelGroupDefinition(modelGroupDef);
+    }
   }
 
   public List getModelGroups()
@@ -222,7 +245,7 @@
 
   public Command getDeleteCommand()
   {
-    return new DeleteCommand("", getXSDComplexTypeDefinition()); //$NON-NLS-1$
+    return new DeleteCommand(getXSDComplexTypeDefinition());
   }
 
   protected class AddNewFieldCommand extends Command
@@ -242,24 +265,62 @@
     List list = new ArrayList();
     Object schema = getEditorSchema();
     
-    list.add(AddXSDElementAction.ID);
-    list.add(AddXSDElementAction.REF_ID);
-    list.add(AddXSDAnyElementAction.ID);
-    list.add(BaseSelectionAction.SEPARATOR_ID);
-    list.add(AddXSDAttributeDeclarationAction.ID);
-    list.add(AddXSDAttributeDeclarationAction.REF_ID);
-    list.add(AddXSDAttributeGroupDefinitionAction.REF_ID);
-    list.add(AddXSDAnyAttributeAction.ID);
-    list.add(BaseSelectionAction.SEPARATOR_ID);
-    list.add(AddXSDModelGroupAction.SEQUENCE_ID);
-    list.add(AddXSDModelGroupAction.CHOICE_ID);
-    list.add(AddXSDModelGroupAction.ALL_ID);
-    list.add(BaseSelectionAction.SEPARATOR_ID);
-    list.add(DeleteAction.ID);
-    list.add(BaseSelectionAction.SEPARATOR_ID);
-    if (getXSDComplexTypeDefinition().getSchema() == schema)
+    XSDComplexTypeDefinition complexType = getXSDComplexTypeDefinition();
+    Object contentType = getContentType();
+    XSDDerivationMethod derivation = complexType.getDerivationMethod();
+    if (contentType instanceof XSDSimpleTypeDefinition)
     {
-      if (getXSDComplexTypeDefinition().getContainer() == schema)
+      List fields = getFields();
+      boolean hasSimpleContentAttributes = false;
+      for (Iterator iterator = fields.iterator(); iterator.hasNext(); )
+      {
+        Object field = iterator.next();
+        // We have attributes, so we need to add the compartment for housing the attributes
+        if (field instanceof XSDAttributeDeclarationAdapter)
+        {
+          hasSimpleContentAttributes = true;
+          break;
+        }
+      }
+
+      if (hasSimpleContentAttributes || XSDDerivationMethod.EXTENSION_LITERAL.equals(derivation))
+      {
+        list.add(AddXSDAttributeDeclarationAction.ID);
+      }
+      else if (XSDDerivationMethod.RESTRICTION_LITERAL.equals(derivation))
+      {
+        list.add(AddXSDEnumerationFacetAction.ID);
+      }
+      list.add(BaseSelectionAction.SEPARATOR_ID);
+      list.add(SetBaseTypeAction.ID);
+      list.add(BaseSelectionAction.SEPARATOR_ID);
+      list.add(DeleteAction.ID);
+      list.add(BaseSelectionAction.SEPARATOR_ID);
+    }
+    else
+    {
+      list.add(AddXSDElementAction.ID);
+      list.add(AddXSDElementAction.REF_ID);
+      list.add(AddXSDAnyElementAction.ID);
+      list.add(BaseSelectionAction.SEPARATOR_ID);
+      list.add(AddXSDAttributeDeclarationAction.ID);
+      list.add(AddXSDAttributeDeclarationAction.REF_ID);
+      list.add(AddXSDAttributeGroupDefinitionAction.REF_ID);
+      list.add(AddXSDAnyAttributeAction.ID);
+      list.add(BaseSelectionAction.SEPARATOR_ID);
+      list.add(AddXSDModelGroupAction.SEQUENCE_ID);
+      list.add(AddXSDModelGroupAction.CHOICE_ID);
+      list.add(AddXSDModelGroupAction.ALL_ID);
+      list.add(BaseSelectionAction.SEPARATOR_ID);
+      list.add(DeleteAction.ID);
+      list.add(BaseSelectionAction.SEPARATOR_ID);
+      list.add(SetBaseTypeAction.ID);
+      list.add(BaseSelectionAction.SEPARATOR_ID);
+    }
+    if (complexType.getSchema() == schema)
+    {
+      XSDConcreteComponent container = complexType.getContainer();
+      if (container == schema || container instanceof XSDRedefine)
       {
         list.add(SetInputToGraphView.ID);
       }
@@ -312,6 +373,24 @@
         getAttributeUses((XSDAttributeGroupDefinition) obj, list);
       }
     }
+    // Add enumerations     
+    boolean canHaveEnumerations = xsdComplexTypeDefinition.getContentType() instanceof XSDSimpleTypeDefinition &&	
+    		XSDDerivationMethod.RESTRICTION_LITERAL.equals(xsdComplexTypeDefinition.getDerivationMethod());
+    if (canHaveEnumerations)
+    {
+    	Object contentType = getContentType();
+    	if (contentType != null)
+    	{
+    		for (Iterator iterator = ((XSDSimpleTypeDefinition)contentType).getEnumerationFacets().iterator(); iterator.hasNext();)
+    		{
+    			XSDEnumerationFacet enumerationFacet = (XSDEnumerationFacet)iterator.next();
+    			list.add(enumerationFacet);
+    		}
+    	}
+    }
+    XSDWildcard anyAttr = xsdComplexTypeDefinition.getAttributeWildcard();
+    if (anyAttr != null)
+      list.add(anyAttr);
     // get immediate XSD Model Group of this complex type
     if (xsdComplexTypeDefinition.getContent() != null)
     {
@@ -375,8 +454,17 @@
     XSDTypeDefinition baseTypeDefinition = xsdComplexTypeDefinition.getBaseTypeDefinition();
     if (baseTypeDefinition != null && baseTypeDefinition != xsdComplexTypeDefinition.getContent() && baseTypeDefinition.getName() != null && !XSDConstants.isURType(baseTypeDefinition))
     {
-      result.append(" : "); //$NON-NLS-1$
-      result.append(baseTypeDefinition.getQName(xsdComplexTypeDefinition));
+    	
+   	try{
+    		String qName = baseTypeDefinition.getQName(xsdComplexTypeDefinition);
+    		result.append(" : "); //$NON-NLS-1$
+    	    result.append(qName);
+    	}
+    	catch (Exception e)    	
+    	{    		
+    		return result.toString();
+    	}
+    
     }
 
     return result.toString();
@@ -415,11 +503,64 @@
   public boolean isAnonymous()
   {
     XSDComplexTypeDefinition xsdComplexTypeDefinition = (XSDComplexTypeDefinition) target;
-    return !(xsdComplexTypeDefinition.eContainer() instanceof XSDSchema);
+    return !(xsdComplexTypeDefinition.eContainer() instanceof XSDSchema ||
+             xsdComplexTypeDefinition.eContainer() instanceof XSDRedefine);
   }
 
   public IADTObject getTopContainer()
   {
     return this;
   }
+  
+  public boolean isAbstract()
+  {
+    return getXSDComplexTypeDefinition().isAbstract();
+  }
+
+  public Object getContentType()
+  {
+    return getXSDComplexTypeDefinition().getContent();
+  }
+  public boolean isReadOnly()
+  {
+	  XSDComplexTypeDefinition xsdComplexTypeDefinition = (XSDComplexTypeDefinition) target;
+	  if (hasSetReadOnlyField())
+	  {
+		  deletedTypes.put(xsdComplexTypeDefinition.getName(), new Boolean(true));
+		  changeReadOnlyField = false;
+		  return readOnly;
+	  }
+	  else
+	  {
+		  if (deletedTypes!= null )
+		  {
+			  Boolean deleted = ((Boolean)deletedTypes.get(xsdComplexTypeDefinition.getName()));
+			  if (deleted != null && deleted.booleanValue())
+				  return true;
+			  else return super.isReadOnly();
+		  }
+		  else
+			  return super.isReadOnly();
+	  }
+  }
+
+public void setReadOnly(boolean readOnly) {
+	this.readOnly = readOnly;
+}
+
+public boolean hasSetReadOnlyField() {
+	return changeReadOnlyField;
+}
+
+public void setChangeReadOnlyField(boolean setReadOnlyField) {
+	this.changeReadOnlyField = setReadOnlyField;
+}
+
+public void updateDeletedMap(String addComponent)
+{
+	if (deletedTypes.get(addComponent) != null)
+	{
+		deletedTypes.clear();
+	}
+}
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDElementDeclarationAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDElementDeclarationAdapter.java
index 643f97d..c1501d7 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDElementDeclarationAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDElementDeclarationAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -265,14 +265,20 @@
   public Command getDeleteCommand()
   {
     // TODO Auto-generated method stub
-    return new DeleteCommand("", getXSDElementDeclaration()); //$NON-NLS-1$
+    return new DeleteCommand(getXSDElementDeclaration());
   }
   
   public String[] getActions(Object object)
   {
     List list = new ArrayList();
+
     if (!isGlobal())
-      list.add(AddXSDElementAction.ID);
+    {
+      list.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_INSERT_ELEMENT);
+      list.add(AddXSDElementAction.BEFORE_SELECTED_ID);
+      list.add(AddXSDElementAction.AFTER_SELECTED_ID);
+      list.add(BaseSelectionAction.SUBMENU_END_ID);
+    }
 
     list.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_SET_TYPE);
     list.add(SetTypeAction.SET_NEW_TYPE_ID);
@@ -323,6 +329,11 @@
     {
       return getGlobalXSDContainer(getXSDElementDeclaration());
     }
-    return null;
+    return this;
+  }
+  
+  public boolean isAbstract()
+  {
+    return getXSDElementDeclaration().isAbstract();
   }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDEnumerationFacetAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDEnumerationFacetAdapter.java
new file mode 100644
index 0000000..e6dfbe9
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDEnumerationFacetAdapter.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.adapters;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
+import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
+import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
+import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
+import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
+import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
+import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
+import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDEnumerationFacetAction;
+import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
+import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
+import org.eclipse.xsd.XSDEnumerationFacet;
+
+public class XSDEnumerationFacetAdapter extends XSDBaseAdapter implements IActionProvider, IGraphElement
+{
+  public XSDEnumerationFacet getXSDEnumerationFacet()
+  {
+    return (XSDEnumerationFacet)target;
+  }
+  
+  public XSDEnumerationFacetAdapter()
+  {
+    super();
+  }
+
+  public String[] getActions(Object object)
+  {
+    List list = new ArrayList();
+    
+    list.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_INSERT_ENUMERATION);
+    list.add(AddXSDEnumerationFacetAction.BEFORE_SELECTED_ID);
+    list.add(AddXSDEnumerationFacetAction.AFTER_SELECTED_ID);
+    list.add(BaseSelectionAction.SUBMENU_END_ID);
+    list.add(BaseSelectionAction.SEPARATOR_ID);
+    list.add(DeleteAction.ID);
+    list.add(BaseSelectionAction.SEPARATOR_ID);
+    list.add(ShowPropertiesViewAction.ID);
+    return (String [])list.toArray(new String[0]);
+  }
+  
+  public Image getImage()
+  {
+    return XSDEditorPlugin.getXSDImage("icons/XSDSimpleEnum.gif"); //$NON-NLS-1$
+  }
+
+  public Command getDeleteCommand()
+  {
+    return new DeleteCommand(getXSDEnumerationFacet());
+  }
+
+  public IModel getModel()
+  {
+    Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDEnumerationFacet().getSchema());
+    return (IModel)adapter;
+  }
+
+  public IADTObject getTopContainer()
+  {
+    return getGlobalXSDContainer(getXSDEnumerationFacet());
+  }
+
+  public boolean isFocusAllowed()
+  {
+    return false;
+  }
+  
+  public String getText()
+  {
+    return getXSDEnumerationFacet().getLexicalValue();
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupAdapter.java
index fe32182..904acec 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,19 +15,23 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.gef.commands.Command;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
+import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
+import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
 import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
 import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAnyElementAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupDefinitionAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.SetMultiplicityAction;
+import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
 import org.eclipse.wst.xsd.ui.internal.design.figures.ModelGroupFigure;
 import org.eclipse.wst.xsd.ui.internal.editor.Messages;
 import org.eclipse.xsd.XSDCompositor;
@@ -214,7 +218,7 @@
      if (!(getParent(target) instanceof XSDModelGroupDefinition))
      {
        actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
-       actionIDs.add(DeleteXSDConcreteComponentAction.DELETE_XSD_COMPONENT_ID);
+       actionIDs.add(DeleteAction.ID);
      }    
      actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
      actionIDs.add(ShowPropertiesViewAction.ID);
@@ -243,4 +247,14 @@
     return false;
   }
 
+  public Command getDeleteCommand() 
+  {
+    return new DeleteCommand(getXSDModelGroup());	
+  }
+  
+  public IModel getModel()
+  {
+    Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDModelGroup().getSchema());
+    return (IModel)adapter;
+  }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupDefinitionAdapter.java
index e9baa19..6fcd193 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupDefinitionAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupDefinitionAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 
@@ -19,6 +20,7 @@
 import org.eclipse.gef.commands.Command;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
+import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
@@ -30,14 +32,17 @@
 import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
 import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
 import org.eclipse.wst.xsd.ui.internal.common.actions.SetMultiplicityAction;
 import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
+import org.eclipse.wst.xsd.ui.internal.design.editparts.model.SpaceFiller;
 import org.eclipse.wst.xsd.ui.internal.editor.Messages;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
+import org.eclipse.xsd.XSDConcreteComponent;
 import org.eclipse.xsd.XSDModelGroup;
 import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDRedefine;
+import org.eclipse.xsd.XSDSchema;
 
 public class XSDModelGroupDefinitionAdapter extends XSDParticleAdapter implements IStructure, IActionProvider, IGraphElement, IADTObjectListener
 {
@@ -48,6 +53,9 @@
 
   protected List fields = null;
   protected List otherThingsToListenTo = null;
+  protected boolean readOnly;
+  protected boolean changeReadOnlyField =false;
+  protected HashMap deletedTypes = new HashMap();
   
   public XSDModelGroupDefinitionAdapter()
   {
@@ -84,16 +92,24 @@
   public String getText()
   {
     XSDModelGroupDefinition xsdModelGroupDefinition = (XSDModelGroupDefinition) target;
+    if (xsdModelGroupDefinition.getResolvedModelGroupDefinition().getContainer() == null && xsdModelGroupDefinition.getName() ==null) return "";   // Removed
     String result = xsdModelGroupDefinition.isModelGroupDefinitionReference() ? xsdModelGroupDefinition.getQName() : xsdModelGroupDefinition.getName();
     return result == null ? Messages._UI_LABEL_ABSENT : result;
   }
 
   public ITreeElement[] getChildren()
   {
+    XSDModelGroupDefinition def = (XSDModelGroupDefinition)target;
     List list = new ArrayList();
-    XSDModelGroup xsdModelGroup = ((XSDModelGroupDefinition) target).getResolvedModelGroupDefinition().getModelGroup();
-    if (xsdModelGroup != null)
-      list.add(xsdModelGroup);
+    // Bug246036 - need to stop showing element content in a cycle.
+    // And, we should not show any element content for references otherwise there will be two
+    // entries in the tree viewer for the same item
+    if (!def.isModelGroupDefinitionReference())
+    {
+      XSDModelGroup xsdModelGroup = ((XSDModelGroupDefinition) target).getResolvedModelGroupDefinition().getModelGroup();
+      if (xsdModelGroup != null)
+        list.add(xsdModelGroup);
+    }
 
     List adapterList = new ArrayList();
     populateAdapterList(list, adapterList);
@@ -110,7 +126,9 @@
   {
     Collection list = new ArrayList();
 
-    if (!getXSDModelGroupDefinition().isModelGroupDefinitionReference())
+    XSDModelGroupDefinition modelGroupDefinition = getXSDModelGroupDefinition();
+    boolean isModelGroupReference = modelGroupDefinition.isModelGroupDefinitionReference();
+    if (!isModelGroupReference)
     {
       list.add(AddXSDElementAction.ID);
       list.add(AddXSDElementAction.REF_ID);
@@ -121,9 +139,9 @@
       list.add(BaseSelectionAction.SEPARATOR_ID);
     }
     
-    list.add(DeleteXSDConcreteComponentAction.DELETE_XSD_COMPONENT_ID);
+    list.add(DeleteAction.ID);
     
-    if (getXSDModelGroupDefinition().isModelGroupDefinitionReference())
+    if (isModelGroupReference)
     {
       list.add(BaseSelectionAction.SEPARATOR_ID);
       list.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_SET_MULTIPLICITY);
@@ -135,9 +153,10 @@
     }
     list.add(BaseSelectionAction.SEPARATOR_ID);
     Object schema = getEditorSchema();
-    if (getXSDModelGroupDefinition().getSchema() == schema)
+    if (modelGroupDefinition.getSchema() == schema)
     {
-      if (getXSDModelGroupDefinition().getContainer() == schema)
+      XSDConcreteComponent container = modelGroupDefinition.getContainer();
+      if (container == schema || container instanceof XSDRedefine)
       {
         list.add(SetInputToGraphView.ID);
       }
@@ -154,13 +173,12 @@
 
   public Command getAddNewFieldCommand(String fieldKind)
   {
-    // TODO Auto-generated method stub
     return null;
   }
 
   public Command getDeleteCommand()
   {
-    return new DeleteCommand("", getXSDModelGroupDefinition()); //$NON-NLS-1$
+    return new DeleteCommand(getXSDModelGroupDefinition());
   }
 
   // TODO Common this up with XSDComplexType's.  See also getFields 
@@ -186,7 +204,7 @@
   {
     List fields = new ArrayList();
     otherThingsToListenTo = new ArrayList();
-    XSDVisitorForFields visitor = new XSDVisitorForFields();
+    XSDVisitorForFields visitor = new XSDVisitorForGroupFieldsWithSpaceFillers();
     visitor.visitModelGroupDefinition(getXSDModelGroupDefinition());
     populateAdapterList(visitor.concreteComponentList, fields);
     
@@ -205,6 +223,34 @@
     return fields;
   }
 
+  protected class XSDVisitorForGroupFieldsWithSpaceFillers extends XSDVisitorForFields
+  {
+    public XSDVisitorForGroupFieldsWithSpaceFillers()
+    {
+      super();
+    }
+
+    public void visitModelGroup(XSDModelGroup modelGroup)
+    {
+      int numOfChildren = modelGroup.getContents().size();
+      if (numOfChildren == 0)
+      {
+        concreteComponentList.add(new SpaceFiller("element")); //$NON-NLS-1$
+      }
+      super.visitModelGroup(modelGroup);
+    }
+    
+    public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
+    {
+      XSDModelGroupDefinition resolvedModelGroupDef = modelGroupDef.getResolvedModelGroupDefinition();
+      if (visitedGroups.contains(resolvedModelGroupDef.getModelGroup()))
+      {
+        concreteComponentList.add(new SpaceFiller("element")); //$NON-NLS-1$
+      }
+      super.visitModelGroupDefinition(modelGroupDef);
+    }
+  }
+
   public IModel getModel()
   {
     Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDModelGroupDefinition().getSchema());
@@ -243,7 +289,52 @@
 
   public IADTObject getTopContainer()
   {
-    return getGlobalXSDContainer(getXSDModelGroupDefinition());
+    XSDModelGroupDefinition group = getXSDModelGroupDefinition();
+    XSDConcreteComponent container = group.getContainer();
+    if (container instanceof XSDSchema || container instanceof XSDRedefine)
+      return this;
+    else
+      return getGlobalXSDContainer(group);
+  }
+  public boolean isReadOnly()
+  {
+	  XSDModelGroupDefinition xsdModelGroupDefinition = (XSDModelGroupDefinition) target;
+	  if (hasSetReadOnlyField())
+	  {
+		  deletedTypes.put(xsdModelGroupDefinition.getName(), new Boolean(true));
+		  changeReadOnlyField = false;
+		  return readOnly;
+	  }
+	  else
+	  {
+		  if (deletedTypes!= null )
+		  {
+			  Boolean deleted = ((Boolean)deletedTypes.get(xsdModelGroupDefinition.getName()));
+			  if (deleted != null && deleted.booleanValue())
+				  return true;
+			  else return super.isReadOnly();
+		  }
+		  else
+			  return super.isReadOnly();
+	  }
+	
+	  
   }
 
+	public void setReadOnly(boolean readOnly) {
+		this.readOnly = readOnly;
+	}
+
+	public boolean hasSetReadOnlyField() {
+		return changeReadOnlyField;
+	}
+
+	public void setChangeReadOnlyField(boolean setReadOnlyField) {
+		this.changeReadOnlyField = setReadOnlyField;
+	}
+
+	public void updateDeletedMap(String addComponent) {
+		if (deletedTypes.get(addComponent) != null)
+			deletedTypes.clear();
+	}
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDRedefineAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDRedefineAdapter.java
new file mode 100644
index 0000000..66bc64f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDRedefineAdapter.java
@@ -0,0 +1,295 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.adapters;
+
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.NotificationImpl;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
+import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
+import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
+import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
+import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
+import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
+import org.eclipse.wst.xsd.ui.internal.editor.Messages;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDPackage;
+import org.eclipse.xsd.XSDRedefine;
+import org.eclipse.xsd.XSDRedefineContent;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+
+
+public class XSDRedefineAdapter extends XSDSchemaDirectiveAdapter
+{
+
+  public XSDRedefineAdapter()
+  {
+    super();
+  }
+
+  public ITreeElement[] getChildren()
+  {
+    XSDRedefine xsdRedefine = (XSDRedefine)getTarget();
+
+    children = new ArrayList();
+
+    if (attributesCategory != null)
+    {
+      List attributes = getCategoryChildren(CategoryAdapter.ATTRIBUTES);
+      List groups = getCategoryChildren(CategoryAdapter.GROUPS);
+      List types = getCategoryChildren(CategoryAdapter.TYPES);
+
+      attributesCategory.setChildren(attributes);
+      attributesCategory.setAllChildren(attributes);
+      typesCategory.setChildren(types);
+      typesCategory.setAllChildren(types);
+      groupsCategory.setChildren(groups);
+      groupsCategory.setAllChildren(groups);
+    }
+    else
+    {
+      createCategoryAdapters(xsdRedefine);
+    }
+
+    children.add(attributesCategory);
+    children.add(typesCategory);
+    children.add(groupsCategory);
+
+    return (ITreeElement[])children.toArray(new ITreeElement [0]);
+  }
+
+  public IADTObject getTopContainer()
+  {
+    return this;
+  }
+
+  public boolean isFocusAllowed()
+  {
+    return true;
+  }
+
+  protected List types = null;
+
+  protected List children, allChildren;
+
+  protected CategoryAdapter attributesCategory;
+
+  protected CategoryAdapter typesCategory;
+
+  protected CategoryAdapter groupsCategory;
+
+  /**
+   * Create all the category adapters
+   * 
+   * @param xsdRedefine the parent redefine component
+   */
+  private void createCategoryAdapters(XSDRedefine xsdRedefine)
+  {
+    List attributes = getCategoryChildren(CategoryAdapter.ATTRIBUTES);
+    List groups = getCategoryChildren(CategoryAdapter.GROUPS);
+    List types = getCategoryChildren(CategoryAdapter.TYPES);
+
+    XSDEditorPlugin xsdEditorPlugin = XSDEditorPlugin.getDefault();
+    attributesCategory = new RedefineCategoryAdapter(
+      Messages._UI_GRAPH_REDEFINE_ATTRIBUTE_GROUPS,
+      xsdEditorPlugin.getIconImage("obj16/attributesheader"), attributes, xsdRedefine, this, CategoryAdapter.ATTRIBUTES); //$NON-NLS-1$
+    attributesCategory.setAllChildren(attributes);
+    registerListener(attributesCategory);
+
+    typesCategory = new RedefineCategoryAdapter(
+      Messages._UI_GRAPH_REDEFINE_TYPES,
+      xsdEditorPlugin.getIconImage("obj16/typesheader"), types, xsdRedefine, this, CategoryAdapter.TYPES); //$NON-NLS-1$
+    typesCategory.setAllChildren(types);
+    registerListener(typesCategory);
+
+    groupsCategory = new RedefineCategoryAdapter(
+      Messages._UI_GRAPH_REDEFINE_GROUPS,
+      xsdEditorPlugin.getIconImage("obj16/groupsheader"), groups, xsdRedefine, this, CategoryAdapter.GROUPS); //$NON-NLS-1$
+    groupsCategory.setAllChildren(groups);
+    registerListener(groupsCategory);
+  }
+
+  public void notifyChanged(final Notification msg)
+  {
+    class CategoryNotification extends NotificationImpl
+    {
+      protected Object category;
+
+      public CategoryNotification(Object category)
+      {
+        super(msg.getEventType(), msg.getOldValue(), msg.getNewValue(), msg.getPosition());
+        this.category = category;
+      }
+
+      public Object getNotifier()
+      {
+        return category;
+      }
+
+      public Object getFeature()
+      {
+        return msg.getFeature();
+      }
+    }
+
+    if (children == null)
+    {
+      getChildren();
+    }
+
+    Object newValue = msg.getNewValue();
+    Object oldValue = msg.getOldValue();
+
+    if (XSDPackage.eINSTANCE.getXSDRedefine_Contents() == msg.getFeature())
+    {
+      if ((newValue instanceof XSDAttributeGroupDefinition) || oldValue instanceof XSDAttributeGroupDefinition)
+      {
+        CategoryAdapter adapter = getCategory(CategoryAdapter.ATTRIBUTES);
+        Assert.isTrue(adapter != null);
+        List list = getCategoryChildren(CategoryAdapter.ATTRIBUTES);
+        adapter.setChildren(list);
+        adapter.setAllChildren(list);
+       
+        if (adapter.getModel() instanceof XSDSchemaAdapter)
+        {
+        	XSDSchemaAdapter schemaAdapter = (XSDSchemaAdapter)adapter.getModel();
+        	schemaAdapter.notifyChanged(msg);
+        }
+       
+        notifyListeners(new CategoryNotification(adapter), adapter.getText());
+        return;
+      }
+      else if ((newValue instanceof XSDComplexTypeDefinition || newValue instanceof XSDSimpleTypeDefinition) || (oldValue instanceof XSDComplexTypeDefinition || oldValue instanceof XSDSimpleTypeDefinition))
+      {
+        CategoryAdapter adapter = getCategory(CategoryAdapter.TYPES);
+        Assert.isTrue(adapter != null);
+        List types = getCategoryChildren(CategoryAdapter.TYPES);
+        adapter.setChildren(types);
+        adapter.setAllChildren(types);
+        if (adapter.getModel() instanceof XSDSchemaAdapter)
+        {
+        	XSDSchemaAdapter schemaAdapter = (XSDSchemaAdapter)adapter.getModel();
+        	schemaAdapter.notifyChanged(msg);
+        }
+        notifyListeners(new CategoryNotification(adapter), adapter.getText());
+        return;
+      }
+      else if (newValue instanceof XSDModelGroupDefinition || oldValue instanceof XSDModelGroupDefinition)
+      {
+        CategoryAdapter adapter = getCategory(CategoryAdapter.GROUPS);
+        Assert.isTrue(adapter != null);
+        List list = getCategoryChildren(CategoryAdapter.GROUPS);
+        adapter.setChildren(list);
+        adapter.setAllChildren(list); 
+        if (adapter.getModel() instanceof XSDSchemaAdapter)
+        {
+        	XSDSchemaAdapter schemaAdapter = (XSDSchemaAdapter)adapter.getModel();
+        	schemaAdapter.notifyChanged(msg);
+        }
+        notifyListeners(new CategoryNotification(adapter), adapter.getText());       
+        return;
+      }
+      else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_Annotations())
+      {
+        return;
+      }
+    }
+    super.notifyChanged(msg);
+  }
+
+  private void updateCategories()
+  {
+    getChildren();
+  }
+
+  public CategoryAdapter getCategory(int category)
+  {
+    if (children == null)
+    {
+      updateCategories();
+    }
+    int length = children.size();
+    CategoryAdapter adapter = null;
+    for (int index = 0; index < length; index++)
+    {
+      adapter = (CategoryAdapter)children.get(index);
+      if (adapter.getGroupType() == category)
+      {
+        break;
+      }
+    }
+    return adapter;
+  }
+
+  public String[] getActions(Object object)
+  {
+    Collection actionIDs = new ArrayList();
+
+    actionIDs.add(DeleteAction.ID);
+    actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
+    actionIDs.add(SetInputToGraphView.ID);
+    actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
+    actionIDs.add(ShowPropertiesViewAction.ID);
+
+    return (String[])actionIDs.toArray(new String [0]);
+  }
+
+  public void propertyChanged(Object object, String property)
+  {
+    notifyListeners(object, property);
+  }
+
+  public Image getImage()
+  {
+    return XSDEditorPlugin.getXSDImage("icons/XSDRedefine.gif"); //$NON-NLS-1$
+  }
+
+  private List getCategoryChildren(int category)
+  {
+    List list = new ArrayList();
+    XSDRedefine redefine = (XSDRedefine)target;
+    Iterator iterator = redefine.getContents().iterator();
+    while (iterator.hasNext())
+    {
+      XSDRedefineContent redefineContent = (XSDRedefineContent)iterator.next();
+
+      if (redefineContent instanceof XSDAttributeGroupDefinition && category == CategoryAdapter.ATTRIBUTES)
+      {
+        list.add(redefineContent);
+      }
+      else if (redefineContent instanceof XSDModelGroupDefinition && category == CategoryAdapter.GROUPS)
+      {
+        list.add(redefineContent);
+      }
+      else if (redefineContent instanceof XSDComplexTypeDefinition && category == CategoryAdapter.TYPES)
+      {
+        list.add(redefineContent);
+      }
+      else if (redefineContent instanceof XSDSimpleTypeDefinition && category == CategoryAdapter.TYPES)
+      {
+        list.add(redefineContent);
+      }
+    }
+    List adapterList = new ArrayList();
+    populateAdapterList(list, adapterList);
+    return adapterList;
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaAdapter.java
index 3c78f88..fe30e58 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Tada Takatoshi / Fujitsu - bug 245480 - provided initial patch
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.adapters;
 
@@ -37,6 +38,7 @@
 import org.eclipse.xsd.XSDImport;
 import org.eclipse.xsd.XSDInclude;
 import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNamedComponent;
 import org.eclipse.xsd.XSDPackage;
 import org.eclipse.xsd.XSDRedefine;
 import org.eclipse.xsd.XSDSchema;
@@ -79,7 +81,7 @@
     registerListener(fElementsCategory);
 
     fAttributesCategory = new CategoryAdapter(Messages._UI_GRAPH_ATTRIBUTES, XSDEditorPlugin.getDefault().getIconImage("obj16/attributesheader"), attributesList, xsdSchema, CategoryAdapter.ATTRIBUTES);   //$NON-NLS-1$
-    fAttributesCategory.setAllChildren(attributesList);
+    fAttributesCategory.setAllChildren(getAttributeList(xsdSchema,true));
     registerListener(fAttributesCategory);
 
     fTypesCategory = new CategoryAdapter(Messages._UI_GRAPH_TYPES, XSDEditorPlugin.getDefault().getIconImage("obj16/typesheader"), types, xsdSchema, CategoryAdapter.TYPES);  //$NON-NLS-1$
@@ -87,7 +89,7 @@
     registerListener(fTypesCategory);
 
     fGroupsCategory = new CategoryAdapter(Messages._UI_GRAPH_GROUPS, XSDEditorPlugin.getDefault().getIconImage("obj16/groupsheader"), groups, xsdSchema, CategoryAdapter.GROUPS); //$NON-NLS-1$
-    fGroupsCategory.setAllChildren(groups);
+    fGroupsCategory.setAllChildren(getGroups(xsdSchema,true));
     registerListener(fGroupsCategory);
   }
 
@@ -199,8 +201,34 @@
     }
     
     Object newValue = msg.getNewValue();
+    
+    Object oldValue = msg.getOldValue();
+    // Bug 245480 - Deletion of Include, Import and Redefine is not reflected in the Outline view
+    // We only want to refresh the Directives folder for any changes to XSDDirectives.  The first case covers
+    // changes to one directive, whereas the missing case as reported in bug 245480 covers changes to a list
+    // of directives.
+    boolean updateDirectivesCategory = false;
+    if (oldValue instanceof XSDSchemaDirective)
+    {
+      updateDirectivesCategory = true;
+    }
+    else if (oldValue instanceof Collection)
+    {
+      Iterator iterator = ((Collection) oldValue).iterator();
+      while (iterator.hasNext())
+      {
+        Object obj = iterator.next();
+        if (obj instanceof XSDSchemaDirective)
+        {
+          // if we find at least one directive, then we should refresh the folder
+          updateDirectivesCategory = true;
+          break;
+        }
+      }
+    }
+    
     if (newValue instanceof XSDInclude || newValue instanceof XSDImport || newValue instanceof XSDRedefine ||
-        (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_Contents() && msg.getOldValue() instanceof XSDSchemaDirective) || // handle the case for delete directive
+        (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_Contents() && updateDirectivesCategory) || // handle the case for delete directive
          msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_IncorporatedVersions()) // updates to the imports/includes
     {
       CategoryAdapter adapter = getCategory(CategoryAdapter.DIRECTIVES);
@@ -316,7 +344,7 @@
     for (Iterator i = elements.iterator(); i.hasNext();)
     {
       XSDElementDeclaration elem = (XSDElementDeclaration) i.next();
-      if (isSameNamespace(elem.getTargetNamespace(),schema.getTargetNamespace()) && (elem.getRootContainer() == schema || showFromIncludes))
+      if (shouldShowComponent(elem, schema, showFromIncludes))
       {
         list.add(elem);
       }
@@ -345,7 +373,7 @@
       if (td instanceof XSDComplexTypeDefinition)
       {
         XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition) td;
-        if (isSameNamespace(ct.getTargetNamespace(),schema.getTargetNamespace()) && (ct.getRootContainer() == schema || showFromIncludes))
+        if (shouldShowComponent(ct, schema, showFromIncludes))
         {
           list.add(ct);
         }
@@ -374,7 +402,7 @@
     for (Iterator i = xsdSchema.getAttributeGroupDefinitions().iterator(); i.hasNext();)
     {
       XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) i.next();
-      if (isSameNamespace(attrGroup.getTargetNamespace(), xsdSchema.getTargetNamespace()) && (attrGroup.getRootContainer() == xsdSchema || showFromIncludes))
+      if (shouldShowComponent(attrGroup, xsdSchema, showFromIncludes))
       {
         attributeGroupList.add(attrGroup);
       }
@@ -404,7 +432,7 @@
           {
             if (!(attr.getTargetNamespace().equals(XSDConstants.SCHEMA_INSTANCE_URI_2001)))
             {
-              if (isSameNamespace(attr.getTargetNamespace(), xsdSchema.getTargetNamespace()) && (attr.getRootContainer() == xsdSchema || showFromIncludes))
+              if (shouldShowComponent(attr, xsdSchema,showFromIncludes))
               {
                 attributesList.add(attr);
               }
@@ -412,7 +440,7 @@
           }
           else
           {
-            if (isSameNamespace(attr.getTargetNamespace(), xsdSchema.getTargetNamespace()) && (attr.getRootContainer() == xsdSchema || showFromIncludes))
+            if (shouldShowComponent(attr, xsdSchema,showFromIncludes))
             {
               attributesList.add(attr);
             }
@@ -443,7 +471,7 @@
       if (td instanceof XSDSimpleTypeDefinition)
       {
         XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) td;
-        if (isSameNamespace(st.getTargetNamespace(),schema.getTargetNamespace()) && (st.getRootContainer() == schema || showFromIncludes))
+        if (shouldShowComponent(st, schema, showFromIncludes))
         {
           list.add(st);
         }
@@ -466,7 +494,7 @@
     for (Iterator i = groups.iterator(); i.hasNext();)
     {
       XSDModelGroupDefinition group = (XSDModelGroupDefinition) i.next();
-      if (isSameNamespace(group.getTargetNamespace(),schema.getTargetNamespace()) && (group.getRootContainer() == schema || showFromIncludes))
+      if (shouldShowComponent(group, schema, showFromIncludes))
       {
         list.add(group);
       }
@@ -501,4 +529,9 @@
   {
     return XSDEditorPlugin.getXSDImage("icons/XSDFile.gif"); //$NON-NLS-1$
   }
+
+  protected boolean shouldShowComponent(XSDNamedComponent component, XSDSchema schema, boolean showFromIncludes) 
+  {
+	  return isSameNamespace(component.getTargetNamespace(), schema.getTargetNamespace()) && (component.getRootContainer() == schema || showFromIncludes);
+  }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaDirectiveAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaDirectiveAdapter.java
index 626ceb4..d7e89eb 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaDirectiveAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaDirectiveAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,30 +11,30 @@
 package org.eclipse.wst.xsd.ui.internal.adapters;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.gef.commands.Command;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
+import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
+import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
+import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
+import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
 import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
+import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
 import org.eclipse.wst.xsd.ui.internal.editor.Messages;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
 import org.eclipse.xsd.XSDImport;
 import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDRedefinableComponent;
 import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDRedefineContent;
+import org.eclipse.xsd.XSDSchema;
 import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
 
-public class XSDSchemaDirectiveAdapter extends XSDBaseAdapter implements IActionProvider
+public class XSDSchemaDirectiveAdapter extends XSDBaseAdapter implements IActionProvider, IGraphElement
 {
   public Image getImage()
   {
@@ -86,39 +86,7 @@
   public ITreeElement[] getChildren()
   {
     List list = new ArrayList();
-    if (target instanceof XSDRedefine)
-    {
-      XSDRedefine redefine = (XSDRedefine) target;
-      for (Iterator i = redefine.getContents().iterator(); i.hasNext();)
-      {
-        XSDRedefineContent redefineContent = (XSDRedefineContent) i.next();
-        if (redefineContent instanceof XSDAttributeGroupDefinition ||
-        	redefineContent instanceof XSDModelGroupDefinition)
-        {
-          list.add(redefineContent);
-        }
-        else if (redefineContent instanceof XSDRedefinableComponent)
-        {
-          XSDRedefinableComponent comp = (XSDRedefinableComponent) redefineContent;
-          if (comp instanceof XSDAttributeGroupDefinition ||
-              comp instanceof XSDModelGroupDefinition ||
-              comp instanceof XSDComplexTypeDefinition ||
-              comp instanceof XSDSimpleTypeDefinition)
-          {
-            list.add(comp);
-          }
-        }
-        else if (redefineContent instanceof XSDComplexTypeDefinition)
-        {
-          list.add(redefineContent);
-        }
-        else if (redefineContent instanceof XSDSimpleTypeDefinition)
-        {
-          list.add(redefineContent);
-        }
-      }
 
-    }
     List adapterList = new ArrayList();
     populateAdapterList(list, adapterList);
     return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
@@ -128,11 +96,36 @@
   {
     List list = new ArrayList();
     list.add(OpenInNewEditor.ID);
-    list.add(DeleteXSDConcreteComponentAction.DELETE_XSD_COMPONENT_ID);
+    list.add(DeleteAction.ID);
     list.add(BaseSelectionAction.SEPARATOR_ID);
     list.add(ShowPropertiesViewAction.ID);
     
     return (String [])list.toArray(new String[0]);
   }
 
+  public Command getDeleteCommand()
+  {
+    XSDSchemaDirective object = (XSDSchemaDirective) target;
+    return new DeleteCommand(object);
+  }
+
+  public IModel getModel()
+  {
+    XSDSchema object = ((XSDSchemaDirective) target).getSchema();
+    Adapter adapter = XSDAdapterFactory.getInstance().adapt(object);
+    return (IModel)adapter;
+  }
+
+  public IADTObject getTopContainer()
+  {
+    // There is currently no drill-down details view of directives
+    // The top level container is the schema
+    return getModel();
+  }
+
+  public boolean isFocusAllowed()
+  {
+    return false;
+  }
+
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleContentAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleContentAdapter.java
new file mode 100644
index 0000000..a66f6a9
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleContentAdapter.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.adapters;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
+import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
+import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
+import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
+import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+
+public class XSDSimpleContentAdapter extends XSDBaseAdapter implements IActionProvider, IGraphElement
+{
+
+  public XSDSimpleContentAdapter()
+  {
+  }
+  
+  public XSDSimpleTypeDefinition getXSDSimpleTypeContent()
+  {
+    return (XSDSimpleTypeDefinition)target;
+  }
+
+  public String[] getActions(Object object)
+  {
+    List list = new ArrayList();
+    return (String [])list.toArray(new String[0]);
+  }
+
+  public Command getDeleteCommand()
+  {
+    return new DeleteCommand(getXSDSimpleTypeContent());
+  }
+
+  public IModel getModel()
+  {
+    Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDSimpleTypeContent().getSchema());
+    return (IModel)adapter;
+  }
+
+  public IADTObject getTopContainer()
+  {
+    XSDConcreteComponent c = getXSDSimpleTypeContent().getContainer();
+    if (c instanceof XSDComplexTypeDefinition)
+    {
+      XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition) c;
+      Adapter adapter = XSDAdapterFactory.getInstance().adapt(ct);
+      if (adapter instanceof IADTObject)
+        return (IADTObject)adapter;
+    }
+ 
+    return null; 
+  }
+
+  public boolean isFocusAllowed()
+  {
+    return false;
+  }
+  
+  public Image getImage()
+  {
+    if (isReadOnly())
+    {
+      return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDSimpleContent.gif"); //$NON-NLS-1$
+    }
+    return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDSimpleContent.gif"); //$NON-NLS-1$
+  }
+  
+  public String getText()
+  {
+    return "";
+  }
+
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleTypeDefinitionAdapter.java
index 8252dc9..105c362 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleTypeDefinitionAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleTypeDefinitionAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,25 +11,40 @@
 package org.eclipse.wst.xsd.ui.internal.adapters;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.commands.Command;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
+import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction;
+import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
+import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
+import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDEnumerationFacetAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
+import org.eclipse.wst.xsd.ui.internal.common.actions.SetBaseTypeAction;
+import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
 import org.eclipse.wst.xsd.ui.internal.editor.Messages;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDRedefine;
 import org.eclipse.xsd.XSDSchema;
 import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
 import org.eclipse.xsd.XSDVariety;
 import org.eclipse.xsd.util.XSDConstants;
 
 public class XSDSimpleTypeDefinitionAdapter extends XSDTypeDefinitionAdapter
 {
+	protected boolean readOnly;
+	protected boolean changeReadOnlyField =false;
+	protected HashMap deletedTypes = new HashMap();
   public Image getImage()
   {
     if (isReadOnly())
@@ -64,8 +79,14 @@
       {
         if (baseTypeDefinition.getName() != null && !xsdSimpleTypeDefinition.getContents().contains(baseTypeDefinition) && !XSDConstants.isAnySimpleType(baseTypeDefinition))
         {
-          result.append(" : "); //$NON-NLS-1$
-          result.append(baseTypeDefinition.getQName(xsdSimpleTypeDefinition));
+        	try {
+        		String qName = baseTypeDefinition.getQName(xsdSimpleTypeDefinition);
+        		result.append(" : "); //$NON-NLS-1$
+                result.append(qName);
+        	}
+        	catch (Exception e)
+        	{
+        	}
         }
       }
       else
@@ -120,7 +141,7 @@
 
   public boolean hasChildren()
   {
-    return false;
+    return true;
   }
   
   public boolean isComplexType()
@@ -145,12 +166,18 @@
   public String[] getActions(Object object)
   {
     List list = new ArrayList();
-    list.add(DeleteXSDConcreteComponentAction.DELETE_XSD_COMPONENT_ID);
+    list.add(AddXSDEnumerationFacetAction.ID);
+    list.add(BaseSelectionAction.SEPARATOR_ID);
+    list.add(SetBaseTypeAction.ID);
+    list.add(BaseSelectionAction.SEPARATOR_ID);
+    list.add(DeleteAction.ID);
     list.add(BaseSelectionAction.SEPARATOR_ID);
     Object schema = getEditorSchema();
-    if (getXSDTypeDefinition().getSchema() == schema)
+    XSDTypeDefinition typeDefinition = getXSDTypeDefinition();
+    if (typeDefinition.getSchema() == schema)
     {
-      if (getXSDTypeDefinition().getContainer() == schema)
+      XSDConcreteComponent container = typeDefinition.getContainer();
+      if (container == schema || container instanceof XSDRedefine)
       {
         list.add(SetInputToGraphView.ID);
       }
@@ -168,11 +195,74 @@
   public boolean isAnonymous()
   {
     XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) target;
-    return !(xsdSimpleTypeDefinition.eContainer() instanceof XSDSchema);
+    EObject eContainer = xsdSimpleTypeDefinition.eContainer();
+    return !(eContainer instanceof XSDSchema ||
+             eContainer instanceof XSDRedefine);
   }
 
   public IADTObject getTopContainer()
   {
     return this;
   }
+
+  public Command getDeleteCommand() 
+  {
+    return new DeleteCommand(getXSDTypeDefinition());	
+  }
+  
+  public IModel getModel()
+  {
+    Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDTypeDefinition().getSchema());
+    return (IModel)adapter;
+  }
+
+  public ITreeElement[] getChildren()
+  {
+    List adapterList = new ArrayList();
+    XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) target;
+    List list = xsdSimpleTypeDefinition.getEnumerationFacets();
+    populateAdapterList(list, adapterList);
+    return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
+  }
+  public boolean isReadOnly()
+  {
+	  XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) target;
+	  if (hasSetReadOnlyField())
+	  {
+		  deletedTypes.put(xsdSimpleTypeDefinition.getName(), new Boolean(true));
+		  changeReadOnlyField = false;
+		  return readOnly;
+	  }
+	  else
+	  {
+		  if (deletedTypes!= null )
+		  {
+			  Boolean deleted = ((Boolean)deletedTypes.get(xsdSimpleTypeDefinition.getName()));
+			  if (deleted != null && deleted.booleanValue())
+				  return true;
+			  else return super.isReadOnly();
+		  }
+		  else
+			  return super.isReadOnly();
+	  }
+	
+	  
+  }
+
+	public void setReadOnly(boolean readOnly) {
+		this.readOnly = readOnly;
+	}
+
+	public boolean hasSetReadOnlyField() {
+		return changeReadOnlyField;
+	}
+
+	public void setChangeReadOnlyField(boolean setReadOnlyField) {
+		this.changeReadOnlyField = setReadOnlyField;
+	}
+
+	public void updateDeletedMap(String addComponent) {
+		if (deletedTypes.get(addComponent) != null)
+			deletedTypes.clear();
+	}
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDTypeDefinitionAdapter.java
index 1ea41b8..7ecd548 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDTypeDefinitionAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDTypeDefinitionAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
 import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDRedefine;
 import org.eclipse.xsd.XSDSchema;
 import org.eclipse.xsd.XSDTypeDefinition;
 
@@ -28,16 +29,16 @@
 
   public String getName()
   {
-    if (getXSDTypeDefinition().eContainer() instanceof XSDSchema)
+    EObject eContainer = getXSDTypeDefinition().eContainer();
+    if (eContainer instanceof XSDSchema || eContainer instanceof XSDRedefine)
     {  
       return getXSDTypeDefinition().getName();
     }
     else 
     {
-      EObject o = getXSDTypeDefinition().eContainer();
-      if (o instanceof XSDNamedComponent)
+      if (eContainer instanceof XSDNamedComponent)
       {
-         XSDNamedComponent ed = (XSDNamedComponent)o;
+         XSDNamedComponent ed = (XSDNamedComponent)eContainer;
          return "(" + ed.getName() + "Type)";                //$NON-NLS-1$ //$NON-NLS-2$
       }
     }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitor.java
index 82541fe..5e2b5c1 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitor.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
 package org.eclipse.wst.xsd.ui.internal.adapters;
 
 import java.util.Iterator;
+import java.util.Stack;
 
 import org.eclipse.xsd.XSDAttributeDeclaration;
 import org.eclipse.xsd.XSDAttributeGroupDefinition;
@@ -24,6 +25,7 @@
 import org.eclipse.xsd.XSDNotationDeclaration;
 import org.eclipse.xsd.XSDParticle;
 import org.eclipse.xsd.XSDParticleContent;
+import org.eclipse.xsd.XSDRedefine;
 import org.eclipse.xsd.XSDSchema;
 import org.eclipse.xsd.XSDSimpleTypeDefinition;
 import org.eclipse.xsd.XSDTypeDefinition;
@@ -33,9 +35,13 @@
 {
   public XSDVisitor()
   {
+    circularDefinitionFound = false;
+    visitedGroups = new Stack();
   }
   
+  public boolean circularDefinitionFound = false;
   protected XSDSchema schema;
+  protected Stack visitedGroups = new Stack();
   
   public void visitSchema(XSDSchema schema)
   {
@@ -116,16 +122,33 @@
     {
       if (modelGroupDef.getModelGroup() != null)
       {
+        if ((visitedGroups.contains(modelGroupDef.getResolvedModelGroupDefinition().getModelGroup())))
+        {
+          circularDefinitionFound = true;
+          return;
+        }
+        visitedGroups.push(modelGroupDef.getModelGroup());
         visitModelGroup(modelGroupDef.getModelGroup());
+        visitedGroups.pop();
       }
     }
     else
     {
-      XSDModelGroup modelGroup = modelGroupDef.getResolvedModelGroupDefinition().getModelGroup();
+      XSDModelGroupDefinition resolvedGroupDef = modelGroupDef.getResolvedModelGroupDefinition();
+      XSDModelGroup modelGroup = resolvedGroupDef.getModelGroup();
+
+      if ((visitedGroups.contains(modelGroup)))
+      {
+        circularDefinitionFound = true;
+        return;
+      }
+
+      visitedGroups.push(modelGroup);
       if (modelGroup != null)
       {
         visitModelGroup(modelGroup);
       }
+      visitedGroups.pop();
     }
   }
 
@@ -147,6 +170,11 @@
     }
   }
   
+  public void visitRedefine(XSDRedefine redefine)
+  {
+	  
+  }
+  
   public void visitNotationDeclaration(XSDNotationDeclaration notation)
   {
   }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitorForFields.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitorForFields.java
index 081788d..48a0f34 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitorForFields.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitorForFields.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -33,6 +33,7 @@
 {
   public XSDVisitorForFields()
   {
+    super();
   }
 
   public List concreteComponentList = new ArrayList();
@@ -91,15 +92,17 @@
   
   public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
   {
+    // listen to definition in case it changes
+    XSDModelGroupDefinition resolvedModelGroupDef = modelGroupDef.getResolvedModelGroupDefinition();
+    if (visitedGroups.contains(resolvedModelGroupDef.getModelGroup())) return;
+   
     if (modelGroupDef.isModelGroupDefinitionReference())
     {
       // if it's a reference we need to listen to the reference incase it changes
-      thingsWeNeedToListenTo.add(modelGroupDef);      
-    }    
-    // listen to definition incase it changes
-    XSDModelGroupDefinition resolvedModelGroupDef = modelGroupDef.getResolvedModelGroupDefinition();
-    thingsWeNeedToListenTo.add(resolvedModelGroupDef);
-    super.visitModelGroupDefinition(modelGroupDef);      
+      if (!thingsWeNeedToListenTo.contains(modelGroupDef))
+        thingsWeNeedToListenTo.add(modelGroupDef);      
+    }
+    super.visitModelGroupDefinition(modelGroupDef);
   }
   
   public void visitModelGroup(XSDModelGroup modelGroup)
@@ -130,6 +133,14 @@
         }
       }
     }
+    
+    XSDWildcard anyAttribute = attributeGroup.getAttributeWildcardContent();
+    if (anyAttribute != null)
+    {
+      concreteComponentList.add(anyAttribute);
+      thingsWeNeedToListenTo.add(anyAttribute);
+    }
+    
   }
   
   public void visitParticle(XSDParticle particle)
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDWildcardAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDWildcardAdapter.java
index c8c8bfe..1d9c140 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDWildcardAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDWildcardAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@
 import org.eclipse.gef.commands.Command;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
+import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
@@ -23,7 +24,7 @@
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-import org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction;
+import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
 import org.eclipse.xsd.XSDParticle;
 import org.eclipse.xsd.XSDWildcard;
@@ -137,8 +138,7 @@
 
   public Command getDeleteCommand()
   {
-    // TODO Auto-generated method stub
-    return null;
+	  return new DeleteCommand((XSDWildcard) target);	
   }
 
   public String getKind()
@@ -219,7 +219,7 @@
   public String[] getActions(Object object)
   {
     Collection actionIDs = new ArrayList();
-    actionIDs.add(DeleteXSDConcreteComponentAction.DELETE_XSD_COMPONENT_ID);
+    actionIDs.add(DeleteAction.ID);
     actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
     actionIDs.add(ShowPropertiesViewAction.ID);
     return (String [])actionIDs.toArray(new String[0]);
@@ -234,5 +234,4 @@
   {
     return false;
   }
-  
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/BaseDragAndDropCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/BaseDragAndDropCommand.java
index a0baa3e..2edf44e 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/BaseDragAndDropCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/BaseDragAndDropCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -19,6 +19,7 @@
 import org.eclipse.draw2d.Graphics;
 import org.eclipse.draw2d.IFigure;
 import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PositionConstants;
 import org.eclipse.draw2d.RoundedRectangle;
 import org.eclipse.draw2d.geometry.Point;
 import org.eclipse.draw2d.geometry.PointList;
@@ -36,6 +37,7 @@
 import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDBaseFieldEditPart;
 import org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure;
 import org.eclipse.xsd.XSDConcreteComponent;
+import org.w3c.dom.Element;
 
 public abstract class BaseDragAndDropCommand extends BaseCommand
 {
@@ -69,6 +71,13 @@
   
   protected abstract void setup();
  
+  /**
+   * Provides the DOM element associated with the parent XSD component. 
+   * This element is used in the the undo/redo mechanism.   
+   * @return the DOM element associated with the parent XSD component.
+   */
+  protected abstract Element getElement();
+  
   public PointList getConnectionPoints(Rectangle draggedFigureBounds)
   {
     PointList pointList = null;
@@ -142,7 +151,10 @@
   {
     if (canExecute)
     {
-      action.run();
+    	// Wrap the drag and drop operation for easy undo and redo.
+    	beginRecording(this.getElement());
+		action.run();
+		endRecording();
     }
   }
   
@@ -413,4 +425,17 @@
     return new Rectangle(x, y, width, height);
   }
 
+  protected void handleKeyboardDragAndDrop(XSDBaseFieldEditPart leftField, XSDBaseFieldEditPart rightField, int direction)
+  {
+    target = leftField;
+    if (direction == PositionConstants.SOUTH)
+    {
+      if (itemToDrag == target)
+        return;
+      target = rightField;
+    }
+    this.location = null;
+    if (target != null)
+      this.location = target.getFigure().getBounds().getCenter();
+  }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/XSDAttributeDragAndDropCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/XSDAttributeDragAndDropCommand.java
index bd4a191..7c09eb0 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/XSDAttributeDragAndDropCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/XSDAttributeDragAndDropCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,6 +14,7 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.eclipse.draw2d.PositionConstants;
 import org.eclipse.draw2d.geometry.Point;
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.EditPartViewer;
@@ -21,6 +22,7 @@
 import org.eclipse.gef.requests.ChangeBoundsRequest;
 import org.eclipse.wst.xsd.ui.internal.actions.MoveXSDAttributeAction;
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeDeclarationAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDWildcardAdapter;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CompartmentEditPart;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.ComplexTypeEditPart;
@@ -29,20 +31,54 @@
 import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDAttributesForAnnotationEditPart;
 import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDBaseFieldEditPart;
 import org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure;
+import org.eclipse.wst.xsd.ui.internal.editor.Messages;
 import org.eclipse.xsd.XSDAttributeDeclaration;
 import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDWildcard;
+import org.w3c.dom.Element;
 
 public class XSDAttributeDragAndDropCommand extends BaseDragAndDropCommand
 {
   public XSDAttributeDragAndDropCommand(EditPartViewer viewer, ChangeBoundsRequest request, GraphicalEditPart target, XSDBaseFieldEditPart itemToDrag, Point location)
   {
     super(viewer, request);
+    setLabel(Messages._UI_ACTION_DRAG_DROP_ATTRIBUTE);
     this.target = target;
     this.itemToDrag = itemToDrag;
     this.location = location;
     setup();
   }
 
+  public XSDAttributeDragAndDropCommand(XSDBaseFieldEditPart itemToDrag, XSDBaseFieldEditPart leftField, XSDBaseFieldEditPart rightField, int direction)
+  {
+    super(itemToDrag.getViewer(), null); 
+    setLabel(Messages._UI_ACTION_DRAG_DROP_ATTRIBUTE); 
+    this.itemToDrag = itemToDrag;
+    canExecute = false;
+    handleKeyboardDragAndDrop(leftField, rightField, direction);
+  }
+  
+  protected void handleKeyboardDragAndDrop(XSDBaseFieldEditPart leftField, XSDBaseFieldEditPart rightField, int direction)
+  {
+    super.handleKeyboardDragAndDrop(leftField, rightField, direction);
+    if (direction == PositionConstants.NORTH)
+    {
+      if (target == null)
+      {
+        target = rightField;
+        this.location = target.getFigure().getBounds().getTop();
+      }
+      else if (!(leftField.getModel() instanceof XSDAttributeDeclarationAdapter)
+                 || leftField.getModel() instanceof XSDWildcardAdapter)
+      {
+        target = rightField;
+        this.location = target.getFigure().getBounds().getTop();
+      }
+    }
+    if (location == null) return;
+    setup();
+  }
+  
   protected void setup()
   {
     canExecute = false;
@@ -68,24 +104,37 @@
       // Get 'left' and 'right' siblings
       doDrop(targetEditPartSiblings, itemToDrag);
     }
+  }  
+  
+  /*
+   * (non-Javadoc)
+   * @see org.eclipse.wst.xsd.ui.internal.commands.BaseDragAndDropCommand#getElement()
+   */
+  protected Element getElement()
+  {
+	  XSDAttributeDeclarationAdapter adapter = (XSDAttributeDeclarationAdapter) itemToDrag.getModel();
+	  XSDAttributeDeclaration target = (XSDAttributeDeclaration)adapter.getTarget();
+	  XSDConcreteComponent parent = (XSDConcreteComponent)target.eContainer();
+	  return parent.getElement();
   }
 
   protected void doDrop(List siblings, GraphicalEditPart movingEditPart)
   {
     commonSetup(siblings, movingEditPart);
 
-    if (previousRefComponent instanceof XSDAttributeDeclaration && nextRefComponent instanceof XSDAttributeDeclaration)
+    if ((previousRefComponent instanceof XSDAttributeDeclaration || previousRefComponent instanceof XSDWildcard) 
+        && (nextRefComponent instanceof XSDAttributeDeclaration || nextRefComponent instanceof XSDWildcard))
     {
-      XSDConcreteComponent parent = ((XSDAttributeDeclaration) previousRefComponent).getContainer().getContainer();
+      XSDConcreteComponent parent = previousRefComponent.getContainer().getContainer();
       if (closerSibling == BELOW_IS_CLOSER)
       {
-        parent = ((XSDAttributeDeclaration) nextRefComponent).getContainer().getContainer();
+        parent = nextRefComponent.getContainer().getContainer();
       }
       action = new MoveXSDAttributeAction(parent, xsdComponentToDrag, previousRefComponent, nextRefComponent);
     }
-    else if (previousRefComponent == null && nextRefComponent instanceof XSDAttributeDeclaration)
+    else if (previousRefComponent == null && (nextRefComponent instanceof XSDAttributeDeclaration || nextRefComponent instanceof XSDWildcard))
     {
-      XSDConcreteComponent parent = ((XSDAttributeDeclaration) nextRefComponent).getContainer().getContainer();
+      XSDConcreteComponent parent = nextRefComponent.getContainer().getContainer();
       if (closerSibling == ABOVE_IS_CLOSER)
       {
         if (leftSiblingEditPart == null)
@@ -104,7 +153,7 @@
     }
     else if (previousRefComponent instanceof XSDAttributeDeclaration && nextRefComponent == null)
     {
-      XSDConcreteComponent parent = ((XSDAttributeDeclaration) previousRefComponent).getContainer().getContainer();
+      XSDConcreteComponent parent = previousRefComponent.getContainer().getContainer();
       if (closerSibling == ABOVE_IS_CLOSER)
       {
         action = new MoveXSDAttributeAction(parent, xsdComponentToDrag, previousRefComponent, nextRefComponent);
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/XSDElementDragAndDropCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/XSDElementDragAndDropCommand.java
index 3bb6b7c..95f45b3 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/XSDElementDragAndDropCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/XSDElementDragAndDropCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,6 +14,7 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.eclipse.draw2d.PositionConstants;
 import org.eclipse.draw2d.geometry.Point;
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.EditPartViewer;
@@ -21,6 +22,7 @@
 import org.eclipse.gef.requests.ChangeBoundsRequest;
 import org.eclipse.wst.xsd.ui.internal.actions.MoveXSDElementAction;
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDElementDeclarationAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDWildcardAdapter;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CompartmentEditPart;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.ComplexTypeEditPart;
@@ -31,9 +33,12 @@
 import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDBaseFieldEditPart;
 import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDGroupsForAnnotationEditPart;
 import org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure;
+import org.eclipse.wst.xsd.ui.internal.editor.Messages;
 import org.eclipse.xsd.XSDConcreteComponent;
 import org.eclipse.xsd.XSDElementDeclaration;
 import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDWildcard;
+import org.w3c.dom.Element;
 
 
 public class XSDElementDragAndDropCommand extends BaseDragAndDropCommand
@@ -43,11 +48,42 @@
   public XSDElementDragAndDropCommand(EditPartViewer viewer, ChangeBoundsRequest request, GraphicalEditPart target, XSDBaseFieldEditPart itemToDrag, Point location)
   {
     super(viewer, request);
+    setLabel(Messages._UI_ACTION_DRAG_DROP_ELEMENT);
     this.target = target;
     this.itemToDrag = itemToDrag;
     this.location = location;
     setup();
   }
+  
+  public XSDElementDragAndDropCommand(XSDBaseFieldEditPart itemToDrag, XSDBaseFieldEditPart leftField, XSDBaseFieldEditPart rightField, int direction)
+  {
+    super(itemToDrag.getViewer(), null); 
+    setLabel(Messages._UI_ACTION_DRAG_DROP_ELEMENT); 
+    this.itemToDrag = itemToDrag;
+    canExecute = false;
+    handleKeyboardDragAndDrop(leftField, rightField, direction);
+  }
+  
+  protected void handleKeyboardDragAndDrop(XSDBaseFieldEditPart leftField, XSDBaseFieldEditPart rightField, int direction)
+  {
+    super.handleKeyboardDragAndDrop(leftField, rightField, direction);
+    if (direction == PositionConstants.NORTH)
+    {
+      if (target == null)
+      {
+        target = rightField;
+        this.location = target.getFigure().getBounds().getTop();
+      }
+      else if (!(leftField.getModel() instanceof XSDElementDeclarationAdapter)
+                 || leftField.getModel() instanceof XSDWildcardAdapter)
+      {
+        target = rightField;
+        this.location = target.getFigure().getBounds().getTop();
+      }
+    }
+    if (location == null) return;
+    setup();
+  }
 
   protected void setup()
   {
@@ -74,20 +110,33 @@
       doDrop(targetEditPartSiblings, itemToDrag);
     }
   }
-
+  
+  /*
+   * (non-Javadoc)
+   * @see org.eclipse.wst.xsd.ui.internal.commands.BaseDragAndDropCommand#getElement()
+   */
+  protected Element getElement()
+  {
+	  XSDElementDeclarationAdapter adapter = (XSDElementDeclarationAdapter) itemToDrag.getModel();
+	  XSDElementDeclaration target = (XSDElementDeclaration)adapter.getTarget();
+	  XSDConcreteComponent parent = (XSDConcreteComponent)target.eContainer();	  
+	  return parent.getElement();
+  }
+  
   protected void doDrop(List siblings, GraphicalEditPart movingEditPart)
   {
     commonSetup(siblings, movingEditPart);
 
     // Can common this code up with XSDAttributeDragAndDropCommand... 
-    if (previousRefComponent instanceof XSDElementDeclaration && nextRefComponent instanceof XSDElementDeclaration)
+    if ((previousRefComponent instanceof XSDElementDeclaration || previousRefComponent instanceof XSDWildcard)
+        && (nextRefComponent instanceof XSDElementDeclaration || nextRefComponent instanceof XSDWildcard)) 
     {
-      XSDModelGroup modelGroup = (XSDModelGroup) ((XSDElementDeclaration) previousRefComponent).getContainer().getContainer();
+      XSDModelGroup modelGroup = (XSDModelGroup) previousRefComponent.getContainer().getContainer();
       if (parentEditPart != null)
         modelGroup = ((ModelGroupEditPart) parentEditPart).getXSDModelGroup();
       action = new MoveXSDElementAction(modelGroup, xsdComponentToDrag, previousRefComponent, nextRefComponent);
     }
-    else if (previousRefComponent == null && nextRefComponent instanceof XSDElementDeclaration)
+    else if (previousRefComponent == null && (nextRefComponent instanceof XSDElementDeclaration || nextRefComponent instanceof XSDWildcard))
     {
       if (closerSibling == ABOVE_IS_CLOSER)
       {
@@ -102,13 +151,14 @@
       }
       else
       {
-        XSDModelGroup modelGroup = (XSDModelGroup) ((XSDElementDeclaration) nextRefComponent).getContainer().getContainer();
+        XSDModelGroup modelGroup = (XSDModelGroup) nextRefComponent.getContainer().getContainer();
         action = new MoveXSDElementAction(modelGroup, xsdComponentToDrag, previousRefComponent, nextRefComponent);
       }
     }
-    else if (previousRefComponent instanceof XSDElementDeclaration && nextRefComponent == null)
+    else if ((previousRefComponent instanceof XSDElementDeclaration || previousRefComponent instanceof XSDWildcard)  
+        && nextRefComponent == null)
     {
-      XSDModelGroup modelGroup = (XSDModelGroup) ((XSDElementDeclaration) previousRefComponent).getContainer().getContainer();
+      XSDModelGroup modelGroup = (XSDModelGroup)previousRefComponent.getContainer().getContainer();
       if (parentEditPart != null)
         modelGroup = ((ModelGroupEditPart) parentEditPart).getXSDModelGroup();
       if (closerSibling == ABOVE_IS_CLOSER)
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/AttributeGroupDefinitionEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/AttributeGroupDefinitionEditPart.java
index 93c4fee..f5bbd30 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/AttributeGroupDefinitionEditPart.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/AttributeGroupDefinitionEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@
 import java.util.List;
 
 import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeGroupDefinitionAdapter;
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
@@ -22,12 +23,15 @@
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CenteredConnectionAnchor;
 import org.eclipse.wst.xsd.ui.internal.design.editparts.model.TargetConnectionSpaceFiller;
 import org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
 import org.eclipse.xsd.XSDAttributeGroupContent;
 import org.eclipse.xsd.XSDAttributeGroupDefinition;
 import org.eclipse.xsd.XSDAttributeUse;
 
 public class AttributeGroupDefinitionEditPart extends ConnectableEditPart
 {
+	ReferenceConnection figure;
+	GenericGroupFigure groupFigure; 
   public AttributeGroupDefinitionEditPart()
   {
     super();
@@ -50,10 +54,13 @@
 
   protected IFigure createFigure()
   {
-    GenericGroupFigure figure = new GenericGroupFigure();
+	groupFigure = new GenericGroupFigure();
     XSDAttributeGroupDefinitionAdapter adapter = (XSDAttributeGroupDefinitionAdapter) getModel();
-    figure.getIconFigure().image = adapter.getImage();
-    return figure;
+    groupFigure.getIconFigure().image = adapter.getImage();
+    Label toolTipsLabel = new Label();
+    toolTipsLabel.setText(XSDEditorPlugin.getXSDString("_UI_PAGE_HEADING_ATTRIBUTEGROUP_REF"));
+    groupFigure.setToolTip(toolTipsLabel);
+    return groupFigure;
   }
 
   protected List getModelChildren()
@@ -108,7 +115,14 @@
     }
 
     connectionFigure.setHighlight(false);
+    figure = connectionFigure;
     return connectionFigure;
   }
+  
+  public String getReaderText()
+  {
+	String text = ((Label) groupFigure.getToolTip()).getText();
+	return text;
+  }
 
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/CategoryEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/CategoryEditPart.java
index 88f312c..bc8008e 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/CategoryEditPart.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/CategoryEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -41,7 +41,7 @@
 public class CategoryEditPart extends BaseEditPart
 {
   protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy;
-  Figure outerPane;
+  protected Figure outerPane;
   HeadingFigure headingFigure;
   protected ScrollPane scrollpane;
   protected int minimumHeight = 400;
@@ -56,10 +56,7 @@
     outerPane = new Figure();
     outerPane.setBorder(new RoundedLineBorder(1, 6));
 
-    headingFigure = new HeadingFigure();
-    outerPane.add(headingFigure);
-    headingFigure.getLabel().setText(((CategoryAdapter) getModel()).getText());
-    headingFigure.getLabel().setIcon(((CategoryAdapter) getModel()).getImage());
+    createHeadingFigure();
 
     int minHeight = SWT.DEFAULT;
     switch (getType())
@@ -145,6 +142,14 @@
     return outerPane;
   }
 
+  protected void createHeadingFigure()
+  {
+	  headingFigure = new HeadingFigure();
+	  outerPane.add(headingFigure);
+	  headingFigure.getLabel().setText(((CategoryAdapter) getModel()).getText());
+	  headingFigure.getLabel().setIcon(((CategoryAdapter) getModel()).getImage());
+  }
+
   public void refreshVisuals()
   {
     super.refreshVisuals();
@@ -234,4 +239,10 @@
   {
     this.minimumHeight = minimumHeight;
   }
+  
+  public String getReaderText()
+  {
+	  return getNameLabel().getText();
+  }
+
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupDefinitionReferenceEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupDefinitionReferenceEditPart.java
index 248e6e6..8a1ff8b 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupDefinitionReferenceEditPart.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupDefinitionReferenceEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,10 +14,12 @@
 import java.util.List;
 
 import org.eclipse.draw2d.IFigure;
+import org.eclipse.gef.EditPart;
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDModelGroupDefinitionAdapter;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CenteredConnectionAnchor;
+import org.eclipse.wst.xsd.ui.internal.design.editparts.model.TargetConnectionSpaceFiller;
 import org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure;
 import org.eclipse.xsd.XSDModelGroup;
 import org.eclipse.xsd.XSDModelGroupDefinition;
@@ -95,9 +97,33 @@
     List list = new ArrayList();
 
     XSDModelGroupDefinitionAdapter adapter = (XSDModelGroupDefinitionAdapter)getModel();
-    XSDModelGroup xsdModelGroup = ((XSDModelGroupDefinition) adapter.getTarget()).getResolvedModelGroupDefinition().getModelGroup();
-    if (xsdModelGroup != null)
+    XSDModelGroupDefinition groupDef = ((XSDModelGroupDefinition) adapter.getTarget());
+    XSDModelGroupDefinition resolvedGroupDef = groupDef.getResolvedModelGroupDefinition();
+    XSDModelGroup xsdModelGroup = resolvedGroupDef.getModelGroup();
+    
+    ArrayList listOfVisibleGroupRefs = new ArrayList();
+    for (EditPart ep = getParent(); ep != null; )
+    {
+      Object object = ep.getModel();
+      if (object instanceof XSDModelGroupDefinitionAdapter)
+      {
+        Object model = ((XSDModelGroupDefinitionAdapter)object).getTarget();
+        if (model instanceof XSDModelGroupDefinition)
+        {
+          listOfVisibleGroupRefs.add(((XSDModelGroupDefinition)model).getResolvedModelGroupDefinition());          
+        }
+      }
+      ep = ep.getParent();
+    }
+    
+    boolean isCyclic = (listOfVisibleGroupRefs.contains(resolvedGroupDef));
+    
+    if (xsdModelGroup != null && !isCyclic)
       list.add(XSDAdapterFactory.getInstance().adapt(xsdModelGroup));
+    
+    if (isCyclic)
+      list.add(new TargetConnectionSpaceFiller(null));
+
     return list;
   }
 
@@ -106,12 +132,17 @@
     ReferenceConnection connectionFigure = new ReferenceConnection();
 
     connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(((GenericGroupFigure)getFigure()).getIconFigure(), CenteredConnectionAnchor.RIGHT, 0, 0));
-
     if (child instanceof ModelGroupEditPart)
     {
       connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(((ModelGroupEditPart) child).getTargetFigure(), CenteredConnectionAnchor.LEFT, 0, 0));
     }
+    else // for the cyclic group references
+    {
+      connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(((GenericGroupFigure) getFigure()).getIconFigure(), CenteredConnectionAnchor.RIGHT, 0, 0));
+    }
+    
     connectionFigure.setHighlight(false);
+
     return connectionFigure;
   }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupEditPart.java
index 1a03f37..9359394 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupEditPart.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -221,4 +221,10 @@
     connectionFigure.setHighlight(false);
     return connectionFigure;
   }
+  
+  public String getReaderText()
+  {
+	  XSDModelGroup xsdModelGroup = getXSDModelGroup();
+	  return  xsdModelGroup.getCompositor().getName();
+  }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ReferenceConnection.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ReferenceConnection.java
index 4ecafc5..fd63dbe 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ReferenceConnection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ReferenceConnection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,7 +13,9 @@
 import org.eclipse.draw2d.ColorConstants;
 import org.eclipse.draw2d.ConnectionRouter;
 import org.eclipse.draw2d.PolylineConnection;
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Display;
 
 public class ReferenceConnection extends PolylineConnection
 {
@@ -42,7 +44,23 @@
   public void setHighlight(boolean highlight)
   {
     this.highlight = highlight;
-    setForegroundColor(highlight ? activeConnection : inactiveConnection);
+    
+    boolean highContrast = false;
+    try
+    {
+      highContrast = Display.getDefault().getHighContrast();
+    }
+    catch (Exception e)
+    {
+    }
+    if (highContrast)
+    {
+      setForegroundColor(highlight ? Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND) : ColorConstants.lightGray);
+    }
+    else
+    {
+      setForegroundColor(highlight ? activeConnection : inactiveConnection);
+    }
     setOpaque(highlight);
   }
 
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/TopLevelComponentEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/TopLevelComponentEditPart.java
index 13f918f..44042f3 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/TopLevelComponentEditPart.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/TopLevelComponentEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,12 +15,14 @@
 
 import org.eclipse.draw2d.ColorConstants;
 import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.Graphics;
 import org.eclipse.draw2d.IFigure;
 import org.eclipse.draw2d.Label;
 import org.eclipse.draw2d.MarginBorder;
 import org.eclipse.draw2d.ToolbarLayout;
 import org.eclipse.draw2d.geometry.Point;
 import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.DragTracker;
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.EditPolicy;
 import org.eclipse.gef.Request;
@@ -32,7 +34,9 @@
 import org.eclipse.gef.ui.actions.ActionRegistry;
 import org.eclipse.gef.ui.parts.AbstractEditPartViewer;
 import org.eclipse.jface.action.IAction;
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IEditorPart;
@@ -40,6 +44,7 @@
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaDirectiveAdapter;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
+import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.IAutoDirectEdit;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.INamedEditPart;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IFeedbackHandler;
@@ -51,6 +56,7 @@
 import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
 import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNameCommand;
 import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
+import org.eclipse.wst.xsd.ui.internal.design.editpolicies.GraphNodeDragTracker;
 import org.eclipse.wst.xsd.ui.internal.design.editpolicies.SelectionHandlesEditPolicyImpl;
 import org.eclipse.wst.xsd.ui.internal.design.editpolicies.TopLevelComponentLabelCellEditorLocator;
 import org.eclipse.wst.xsd.ui.internal.design.editpolicies.TopLevelNameDirectEditManager;
@@ -63,7 +69,7 @@
 import org.eclipse.xsd.XSDSchemaDirective;
 import org.eclipse.xsd.impl.XSDImportImpl;
 
-public class TopLevelComponentEditPart extends BaseEditPart implements IFeedbackHandler, INamedEditPart
+public class TopLevelComponentEditPart extends BaseEditPart implements IFeedbackHandler, INamedEditPart, IAutoDirectEdit
 {
   protected Label label;
   // protected Label arrowLabel;
@@ -73,10 +79,32 @@
   protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
   protected boolean isReadOnly;
   protected boolean isSelected;
+  private Font italicFont;
 
   protected IFigure createFigure()
   {
-    Figure typeGroup = new Figure();
+    Figure typeGroup = new Figure()
+    {
+      public void paint(Graphics graphics)
+      {
+        super.paint(graphics);
+        if (hasFocus)
+        {
+          try
+          {
+            graphics.pushState();
+            Rectangle r = getBounds();
+            graphics.setXORMode(true);
+            graphics.drawFocus(r.x, r.y + 1, r.width - 1, r.height - 2);
+          }
+          finally
+          {
+            graphics.popState();
+          }
+        }
+        
+      }
+    };
     typeGroup.setLayoutManager(new ToolbarLayout());
 
     labelHolder = new Figure();
@@ -86,8 +114,9 @@
 
     label = new HyperLinkLabel();
     label.setOpaque(true);
-    label.setBorder(new MarginBorder(0, 2, 2, 1));
-    label.setForegroundColor(ColorConstants.black);
+    label.setBorder(new MarginBorder(1, 2, 2, 5));
+    if (!isHighContrast)
+      label.setForegroundColor(ColorConstants.black);
     labelHolder.add(label);
 
     return typeGroup;
@@ -95,6 +124,11 @@
 
   public void deactivate()
   {
+    if (italicFont != null)
+    {
+      italicFont.dispose();
+      italicFont = null;
+    }
     super.deactivate();
   }
 
@@ -113,6 +147,23 @@
       }
       // arrowLabel.setVisible(Boolean.TRUE.equals(adapter.getProperty(getModel(),
       // "drillDown")));
+      
+      if (adapter.isAbstract())
+      {
+        if (italicFont == null)
+        {
+          Font font = label.getFont();
+          italicFont = getItalicFont(font);
+        }
+        if (italicFont != null)
+        {
+          label.setFont(italicFont);
+        }
+      }
+      else
+      {
+        label.setFont(label.getParent().getFont());
+      }
     }
     else
     {
@@ -127,11 +178,6 @@
     }
   }
 
-  // public XSDNamedComponent getXSDNamedComponent()
-  // {
-  // return (XSDNamedComponent) getModel();
-  // }
-
   public List getModelChildren()
   {
     return Collections.EMPTY_LIST;
@@ -182,9 +228,28 @@
   public Color computeLabelColor()
   {
     Color color = ColorConstants.black;
+    if (isHighContrast)
+    { 
+      color = Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND);
+    }
+
     if (isSelected)
     {
-      color = ColorConstants.black;
+      if (isHighContrast)
+      {
+        color = ColorConstants.listBackground;
+      }
+      else
+      {
+    	  if (isReadOnly)
+    	  {
+    		  color = ColorConstants.gray;
+    	  }
+    	  else
+    	  {
+    		  color = ColorConstants.black;
+    	  }
+      }
     }
     else if (isReadOnly)
     {
@@ -197,7 +262,14 @@
   {
     isSelected = true;
 
-    labelHolder.setBackgroundColor(FieldFigure.cellColor);
+    if (isHighContrast)
+    {
+      labelHolder.setBackgroundColor(ColorConstants.listForeground);
+    }
+    else
+    {
+      labelHolder.setBackgroundColor(FieldFigure.cellColor);
+    }
     label.setForegroundColor(computeLabelColor());
     // labelHolder.setFill(true);
 
@@ -380,4 +452,22 @@
       setScroll(true);
     super.setSelected(value);
   }
+
+  public void setFocus(boolean b)
+  {
+    super.setFocus(b);
+    hasFocus = b;
+    getFigure().repaint();
+  }
+  
+  public DragTracker getDragTracker(Request request)
+  {
+    return new GraphNodeDragTracker(this);
+  }
+
+  public String getReaderText()
+  {
+	  return getNameLabelFigure().getText();
+  }
+
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDBaseFieldEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDBaseFieldEditPart.java
index 8c461b5..6edac9c 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDBaseFieldEditPart.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDBaseFieldEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,7 +13,9 @@
 import org.eclipse.draw2d.ColorConstants;
 import org.eclipse.gef.EditPolicy;
 import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeDeclarationAdapter;
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDElementDeclarationAdapter;
@@ -26,6 +28,7 @@
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart;
 import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFieldFigure;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
+import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.FieldFigure;
 import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
 import org.eclipse.wst.xsd.ui.internal.design.editpolicies.DragAndDropEditPolicy;
 import org.eclipse.wst.xsd.ui.internal.design.editpolicies.SelectionHandlesEditPolicyImpl;
@@ -53,9 +56,19 @@
     figure.getTypeLabel().setText(field.getTypeName());
     figure.refreshVisuals(getModel());
     if (field.isReadOnly())
+    {
       figure.setForegroundColor(ColorConstants.darkGray);
+    }
     else
-      figure.setForegroundColor(ColorConstants.black);
+    {
+      if (isHighContrast)
+      {
+        figure.setForegroundColor(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
+        figure.setBackgroundColor(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
+      }
+      else
+        figure.setForegroundColor(ColorConstants.black);     
+    }
 
     String occurrenceDescription = ""; //$NON-NLS-1$
     if (field instanceof IAnnotationProvider)
@@ -140,4 +153,12 @@
       }
     }
   }
+  
+  public void setFocus(boolean focus)
+  {
+    super.setFocus(focus);
+    hasFocus = focus;
+    ((FieldFigure)getFigure()).hasFocus = hasFocus;
+    getFigure().repaint();
+  }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSchemaEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSchemaEditPart.java
index bc0ad7a..b2698be 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSchemaEditPart.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSchemaEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -244,6 +244,12 @@
     super.createEditPolicies();
     installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SelectionHandlesEditPolicyImpl());    
   }
+  
+  public String getReaderText()
+  {
+	  return headingFigure.getLabel().getSubStringText();
+  }
+
 
   protected class Holder
   {
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSimpleTypeEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSimpleTypeEditPart.java
index c752add..db5b877 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSimpleTypeEditPart.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSimpleTypeEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -229,4 +229,11 @@
     } 
     return false;
   }
+  
+  public String getReaderText()
+  {
+	  HeadingFigure headingFigure = figure.getHeadingFigure();
+	  return headingFigure.getLabel().getText();
+  }
+
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/SpaceFiller.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/SpaceFiller.java
index ae847ef..30ab79a 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/SpaceFiller.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/SpaceFiller.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -158,6 +158,12 @@
     // TODO Auto-generated method stub
     return false;
   }
+
+  public boolean isAbstract()
+  {
+    // TODO Auto-generated method stub
+    return false;
+  }
 }
 
 
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/GraphNodeDragTracker.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/GraphNodeDragTracker.java
index 3a8b318..26b229b 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/GraphNodeDragTracker.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/GraphNodeDragTracker.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,10 +9,14 @@
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.design.editpolicies;
+import java.util.List;
+
 import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartViewer;
 import org.eclipse.gef.Request;
 import org.eclipse.gef.commands.Command;
 import org.eclipse.gef.tools.DragEditPartsTracker;
+import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
 
                                    
 public class GraphNodeDragTracker extends DragEditPartsTracker 
@@ -27,7 +31,59 @@
                                               
   protected Command getCommand() 
   { 
-	Request request = getTargetRequest();
+	  Request request = getTargetRequest();
     return editPart.getCommand(request); 
   }
+  
+  protected void performSelection()
+  {
+    performAdditionalSelection();
+    super.performSelection();
+  }
+  
+  protected void performAdditionalSelection()
+  {
+    EditPartViewer viewer = getCurrentViewer();
+    // This code selects the fields in-between the last selected field and the newly
+    // selected field, if the shift key is held down.  Note that the selection logic
+    // can be improved so that already selected but, a) incompatible edit part figures, or b)
+    // like-edit part figures from other parents, should be unselected.
+    if (getCurrentInput().isShiftKeyDown())
+    {
+      // This list contains the fields
+      List list = editPart.getParent().getChildren();
+      // Get the index of the current selection
+      int currentIndex = list.indexOf(editPart);
+      // List of all the currently selected edit parts
+      List currentSelected = viewer.getSelectedEditParts();
+      int size = currentSelected.size();
+      if (size > 0)
+      {
+        Object lastSelected = currentSelected.get(size - 1);
+        if (lastSelected instanceof BaseEditPart)
+        {
+          // Here, we determine the upper and lower limit of the indices
+          int lowerIndex = -1, upperIndex = -1;
+          int lastSelectedIndex = list.indexOf(lastSelected);
+          if (lastSelectedIndex >= 0 && lastSelectedIndex < currentIndex)
+          {
+            lowerIndex = lastSelectedIndex;
+            upperIndex = currentIndex;
+          } 
+          else if (lastSelectedIndex >= 0 && lastSelectedIndex > currentIndex)
+          {
+            lowerIndex = currentIndex;
+            upperIndex = lastSelectedIndex;
+          }
+          if (lowerIndex >= 0 && upperIndex >= 0)
+          {          
+            for (int i = lowerIndex; i < upperIndex; i++)
+            {
+              viewer.appendSelection((EditPart) list.get(i));
+            }
+          }
+        }
+      }
+    }
+  }
 } 
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/TopLevelNameDirectEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/TopLevelNameDirectEditManager.java
index e5b21c1..fd92420 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/TopLevelNameDirectEditManager.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/TopLevelNameDirectEditManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -33,6 +33,7 @@
 import org.eclipse.ui.actions.ActionFactory;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.part.CellEditorActionHandler;
+import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.INamedEditPart;
 import org.eclipse.wst.xsd.ui.internal.design.editparts.TopLevelComponentEditPart;
 import org.eclipse.xsd.XSDNamedComponent;
@@ -148,7 +149,15 @@
   {
     actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copy);
     actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), paste);
-    actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), delete);
+    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=252509
+    // Delete action (key) doesn't always work.  The saved action could be the 
+    // CellEditorActionHandler's DeleteActionHandler...due to timing issues.
+    // We'll only restore the delete action if it is indeed the one for the Design view.
+    // We should update the other actions too, but currently, none are applicable.
+    if (delete instanceof BaseSelectionAction)
+    {
+      actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), delete);
+    }
     actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), selectAll);
     actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cut);
     actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), find);
@@ -160,7 +169,16 @@
   {
     copy = actionBars.getGlobalActionHandler(ActionFactory.COPY.getId());
     paste = actionBars.getGlobalActionHandler(ActionFactory.PASTE.getId());
-    delete = actionBars.getGlobalActionHandler(ActionFactory.DELETE.getId());
+    IAction currentDeleteAction = actionBars.getGlobalActionHandler(ActionFactory.DELETE.getId());
+    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=252509
+    // Delete action (key) doesn't always work.  The saved action could be the 
+    // CellEditorActionHandler's DeleteActionHandler...due to timing issues.
+    // We'll only restore the delete action if it is indeed the one for the Design view.
+    // We should update the other actions too, but currently, none are applicable.
+    if (currentDeleteAction instanceof BaseSelectionAction)
+    {
+      delete = currentDeleteAction;
+    }
     selectAll = actionBars.getGlobalActionHandler(ActionFactory.SELECT_ALL.getId());
     cut = actionBars.getGlobalActionHandler(ActionFactory.CUT.getId());
     find = actionBars.getGlobalActionHandler(ActionFactory.FIND.getId());
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CenteredIconFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CenteredIconFigure.java
index b75b2c9..2177289 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CenteredIconFigure.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CenteredIconFigure.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,7 +16,9 @@
 import org.eclipse.draw2d.RoundedRectangle;
 import org.eclipse.draw2d.geometry.Dimension;
 import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.wst.xsd.ui.internal.design.editparts.ReferenceConnection;
 
 public class CenteredIconFigure extends RoundedRectangle
@@ -58,7 +60,22 @@
       }
       else if (mode == SELECTED)
       {
-        graphics.setForegroundColor(ColorConstants.black);
+        boolean highContrast = false;
+        try
+        {
+          highContrast = Display.getDefault().getHighContrast();
+        }
+        catch (Exception e)
+        {
+        }
+        if (highContrast)
+        {
+          graphics.setForegroundColor(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
+        }
+        else
+        {
+          graphics.setForegroundColor(ColorConstants.black);
+        }
       }
       super.outlineShape(graphics);
     }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewTypeDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewTypeDialog.java
index 202e215..45fec61 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewTypeDialog.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewTypeDialog.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -167,7 +167,10 @@
       anonymousTypeCheckBox.addSelectionListener(listener);    
   }
 
-  // TODO: Can we remove this?
+  /**
+   * This method will be removed in the next WTP release.
+   * @deprecated
+   */
   protected String getNormalizedLocation(String location)
   {
     try
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/XSDEditSchemaNS.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/XSDEditSchemaNS.java
new file mode 100644
index 0000000..43e520d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/XSDEditSchemaNS.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.dialogs;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
+import org.eclipse.wst.xml.ui.internal.dialogs.EditSchemaInfoDialog;
+import org.eclipse.wst.xml.ui.internal.nsedit.CommonEditNamespacesDialog;
+
+public class XSDEditSchemaNS extends EditSchemaInfoDialog
+{
+  CommonEditNamespacesDialog editNamespacesControl;
+
+  public XSDEditSchemaNS(Shell parentShell, IPath resourceLocation)
+  {
+    super(parentShell, resourceLocation);
+  }
+
+  protected Control createDialogArea(Composite parent)
+  {
+    Composite composite = new Composite(parent, SWT.NONE);
+    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+    editNamespacesControl = new CommonEditNamespacesDialog(composite, resourceLocation, XMLUIMessages._UI_NAMESPACE_DECLARATIONS);
+
+    editNamespacesControl.setNamespaceInfoList(namespaceInfoList);
+    editNamespacesControl.updateErrorMessage(namespaceInfoList);
+
+    return composite;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/XSDGraphViewerDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/XSDGraphViewerDialog.java
index de93dfa..33adbde 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/XSDGraphViewerDialog.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/XSDGraphViewerDialog.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -30,7 +30,9 @@
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
@@ -66,16 +68,25 @@
   
   private static String X_ORIGIN = "DIALOG_X_ORIGIN"; //$NON-NLS-1$
   private static String Y_ORIGIN = "DIALOG_Y_ORIGIN"; //$NON-NLS-1$
+  private boolean isHighContrast = false;
 
   public XSDGraphViewerDialog(Shell parentShell, String titleText, String infoText, Object model, String ID)
   {
-    super(parentShell, HOVER_SHELLSTYLE, true, true, true, false, titleText, infoText);
+    // INFOPOPUP_SHELLSTYLE works properly on both Windows and Linux.
+    super(parentShell, INFOPOPUP_SHELLSTYLE, true, true, true, true, false, titleText, infoText);
     setModel(model);
     linkListener = new OpenEditorLinkListener();
     this.infoText = infoText;
     this.uniqueID = ID;
     Assert.isTrue(ID != null && ID.length() > 0);    
     moveListener = new PreviewControlListener();
+    try 
+    {
+      isHighContrast = Display.getDefault().getHighContrast();
+    }
+    catch (Exception e) {
+      // ignore 
+    }
     create();
   }
 
@@ -88,21 +99,43 @@
   {
     super.fillDialogMenu(dialogMenu);
     dialogMenu.add(new Separator());
+    dialogMenu.add(new ClosePopup());
+    dialogMenu.add(new Separator());
     dialogMenu.add(new SetOpenInEditor());
   }
 
   protected Control createDialogArea(Composite parent)
   {
     viewer = new ScrollingGraphicalViewer();
-    Composite c = new Composite(parent, SWT.NONE);
-    c.setBackground(ColorConstants.white);
+    Composite c = (Composite)super.createDialogArea(parent);
+
+    if (isHighContrast)
+    {
+      c.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
+    }
+    else
+    {
+      c.setBackground(ColorConstants.white);
+    }
     c.setLayout(new FillLayout());
 
     RootEditPart root = new RootEditPart();
     viewer.setRootEditPart(root);
 
     viewer.createControl(c);
-    viewer.getControl().setBackground(ColorConstants.white);
+
+    // The graphical viewer tool tip processing creates an extra shell which
+    // interferes with the PopupDialog's deactivation logic. 
+    removeMouseListeners(viewer.getControl());    
+
+    if (isHighContrast)
+    {
+      viewer.getControl().setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
+    }
+    else
+    {
+      viewer.getControl().setBackground(ColorConstants.white);
+    }
     EditPartFactory editPartFactory = new XSDEditPartFactory(new TypeVizFigureFactory());
     viewer.setEditPartFactory(editPartFactory);
 
@@ -113,6 +146,30 @@
     getShell().addControlListener(moveListener);
     return c;
   }
+
+  private void removeMouseListeners(Control control)
+  {
+    Listener[] listeners = control.getListeners(SWT.MouseEnter);
+    control.removeListener(SWT.MouseEnter, listeners[0]);
+    
+    listeners = control.getListeners(SWT.MouseExit);
+    control.removeListener(SWT.MouseExit, listeners[0]);    
+
+    listeners = control.getListeners(SWT.MouseHover);
+    control.removeListener(SWT.MouseHover, listeners[0]);    
+
+    listeners = control.getListeners(SWT.MouseMove);
+    control.removeListener(SWT.MouseMove, listeners[0]);    
+
+    listeners = control.getListeners(SWT.MouseDown);
+    control.removeListener(SWT.MouseDown, listeners[0]);    
+
+    listeners = control.getListeners(SWT.MouseUp);
+    control.removeListener(SWT.MouseUp, listeners[0]);    
+    
+    listeners = control.getListeners(SWT.MouseDoubleClick);
+    control.removeListener(SWT.MouseDoubleClick, listeners[0]);
+  }
   
   protected Control createInfoTextArea(Composite parent)
   {
@@ -140,7 +197,9 @@
     nsInfoLabel.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW));
 
     link = new Hyperlink(infoComposite, SWT.RIGHT);
-    link.setText(Messages._UI_ACTION_OPEN_IN_NEW_EDITOR);
+    // Remove mnemonic ampersand. It would be better to have a separate string in the future.
+    String label = Messages._UI_ACTION_OPEN_IN_NEW_EDITOR.replaceAll("&", "");
+    link.setText(label);
     link.setFont(infoFont);
     link.addHyperlinkListener(linkListener);
     return infoComposite;
@@ -175,6 +234,18 @@
     }
   }
   
+  private class ClosePopup extends Action {
+    public ClosePopup()
+    {
+      super(Messages._UI_ACTION_CLOSE_SCHEMA_PREVIEW_POPUP);
+    }
+
+    public void run()
+    {
+      close();
+    }
+  }
+  
   protected IDialogSettings getDialogSettings()
   {
     IDialogSettings settings= XSDEditorPlugin.getDefault().getDialogSettings().getSection(uniqueID);
@@ -235,6 +306,11 @@
   
   public boolean close()
   {
+    if (getShell() == null || getShell().isDisposed()) 
+    {
+      return true;
+    }
+    
     getShell().removeControlListener(moveListener);
     if (link != null)
       link.removeHyperlinkListener(linkListener);
@@ -332,4 +408,9 @@
     }
     return null;
   }
+  
+  protected Control getFocusControl()
+  {
+    return link;
+  }  
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/InternalXSDMultiPageEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/InternalXSDMultiPageEditor.java
index 9b7a648..3343e55 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/InternalXSDMultiPageEditor.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/InternalXSDMultiPageEditor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@
 import java.util.List;
 
 import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.emf.common.notify.Adapter;
 import org.eclipse.emf.common.notify.Notifier;
 import org.eclipse.emf.ecore.EObject;
@@ -47,6 +48,7 @@
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IFileEditorInput;
 import org.eclipse.ui.INavigationLocation;
 import org.eclipse.ui.INavigationLocationProvider;
@@ -63,18 +65,23 @@
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.RedefineCategoryAdapter;
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDRedefineAdapter;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.AddFieldAction;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseDirectEditAction;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
+import org.eclipse.wst.xsd.ui.internal.adt.actions.DesignSelectAll;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
 import org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewGraphicalViewer;
+import org.eclipse.wst.xsd.ui.internal.adt.design.IKeyboardDrag;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart;
 import org.eclipse.wst.xsd.ui.internal.adt.editor.ADTMultiPageEditor;
 import org.eclipse.wst.xsd.ui.internal.adt.editor.EditorMode;
@@ -91,15 +98,22 @@
 import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeGroupDefinitionAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDComplexTypeDefinitionAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction;
+import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDEnumerationFacetAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupDefinitionAction;
+import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedAttributeGroupAction;
+import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedComplexTypeAction;
+import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedModelGroupAction;
+import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefinedSimpleTypeAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDSchemaDirectiveAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDSimpleTypeDefinitionAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction;
+import org.eclipse.wst.xsd.ui.internal.common.actions.SetBaseTypeAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
 import org.eclipse.wst.xsd.ui.internal.common.actions.SetMultiplicityAction;
 import org.eclipse.wst.xsd.ui.internal.common.actions.SetTypeAction;
 import org.eclipse.wst.xsd.ui.internal.common.properties.sections.IDocumentChangedNotifier;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
 import org.eclipse.wst.xsd.ui.internal.navigation.DesignViewNavigationLocation;
 import org.eclipse.wst.xsd.ui.internal.navigation.MultiPageEditorTextSelectionNavigationLocation;
 import org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter;
@@ -151,6 +165,43 @@
       }
     }
   }
+  
+  protected void setInputToGraphicalViewer(IDocument newDocument)
+  {
+    IStructuredModel structuredModel = null;
+    try
+    {
+      // only set input if structured model already exists
+      // (meaning source editor is already managing the model)
+      structuredModel = StructuredModelManager.getModelManager().getExistingModelForRead(newDocument);
+      if ((structuredModel != null) && (structuredModel instanceof IDOMModel))
+      {
+        Document doc = ((IDOMModel) structuredModel).getDocument();
+        if (doc != null)
+        {
+          XSDModelAdapter modelAdapter = XSDModelAdapter.lookupOrCreateModelAdapter(doc);
+          if (modelAdapter != null) // Assert should not be null
+          {
+            modelAdapter.setSchema(xsdSchema);
+            xsdSchema = modelAdapter.resetSchema(doc);
+            model = (IModel) XSDAdapterFactory.getInstance().adapt(xsdSchema);
+          }
+        }
+      }
+    }
+    catch (Exception e)
+    {
+    }
+    finally
+    {
+      if (structuredModel != null)
+      {
+        structuredModel.releaseFromRead();
+      }
+    }
+  }
+  
+ 
   public IModel buildModel()
   {
     try
@@ -170,13 +221,23 @@
       if (doc instanceof IStructuredDocument)
       {
         IStructuredModel model = null;
+        try
+        {
         // TODO: for StorageEditorInputs, should be forRead
-        model = StructuredModelManager.getModelManager().getExistingModelForEdit(doc);
-        if (model == null) {
-          model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) doc);
+          model = StructuredModelManager.getModelManager().getExistingModelForEdit(doc);
+          if (model == null)
+          {
+            model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) doc);
+          }
+          document = ((IDOMModel) model).getDocument();
         }
-        structuredModel = model;
-        document = ((IDOMModel)model).getDocument();
+        finally
+        {
+          if (model != null)
+          {
+            model.releaseFromEdit();
+          }
+        }
       }
       Assert.isNotNull(document);
 
@@ -255,18 +316,43 @@
 
   public void dispose()
   {
-    if (structuredModel != null)
+    IStructuredModel structuredModel = null;
+    XSDModelAdapter modelAdapter = null;
+    IDOMDocument doc = null;
+    IDocument idoc = structuredTextEditor.getDocumentProvider().getDocument(getEditorInput());
+    if (idoc != null)
     {
-      structuredModel.releaseFromEdit();
-      structuredModel = null;
+      structuredModel = StructuredModelManager.getModelManager().getExistingModelForRead(idoc);
+      if ((structuredModel != null) && (structuredModel instanceof IDOMModel))
+      {
+        try
+        {
+          if ((structuredModel != null) && (structuredModel instanceof IDOMModel))
+          {
+            doc = ((IDOMModel) structuredModel).getDocument();
+            if (doc != null)
+            {
+              modelAdapter = (XSDModelAdapter) doc.getExistingAdapter(XSDModelAdapter.class);
+              if (modelAdapter != null)
+              {
+                doc.getModel().removeModelStateListener(modelAdapter.getModelReconcileAdapter());
+                doc.removeAdapter(modelAdapter.getModelReconcileAdapter());
+                doc.removeAdapter(modelAdapter);
+                modelAdapter.clear();
+                modelAdapter = null;
+              }
+            }
+          }
+        }
+        finally
+        {
+          structuredModel.releaseFromRead();
+        }
+      }
     }
-    
-    if (schemaNodeAdapter != null)
-    {
-      schemaNodeAdapter.clear();
-      schemaNodeAdapter = null;
-    }
-    
+   
+
+
     if (fOutlinePage != null)
     {
 //      if (fOutlinePage instanceof ConfigurableContentOutlinePage && fOutlineListener != null)
@@ -318,6 +404,10 @@
     {
       return xsdSchema;
     }
+    else if (type == IKeyboardDrag.class)
+    {
+      return new KeyboardDragImpl();
+    }
     else if (type == IContentOutlinePage.class)
     {
       Object adapter = super.getAdapter(type);
@@ -500,9 +590,6 @@
     fXSDSelectionListener = new XSDSelectionManagerSelectionListener();
     getSelectionManager().addSelectionChangedListener(fXSDSelectionListener);
     
-    // Select the schema to show the properties
-    getSelectionManager().setSelection(new StructuredSelection(getModel()));
-    
     xsdPreferenceStoreListener = new XSDPreferenceStoreListener();
     XSDEditorPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(xsdPreferenceStoreListener);
   }
@@ -541,12 +628,50 @@
     action = new DeleteAction(this);
     action.setSelectionProvider(getSelectionManager());
     registry.registerAction(action);
-
+    
+    action = new DesignSelectAll(this);
+    action.setSelectionProvider(getSelectionManager());
+    registry.registerAction(action);
+    
+    action = new AddXSDRedefinedComplexTypeAction(this);
+    action.setSelectionProvider(getSelectionManager());
+    action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, Messages._UI_IMAGE_COMPLEX_TYPE));
+    registry.registerAction(action);
+    
+    action = new AddXSDRedefinedSimpleTypeAction(this);
+    action.setSelectionProvider(getSelectionManager());
+    action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, Messages._UI_IMAGE_SIMPLE_TYPE));
+    registry.registerAction(action);
+    
+    action = new AddXSDRedefinedAttributeGroupAction(this);
+    action.setSelectionProvider(getSelectionManager());
+    action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, Messages._UI_IMAGE_ATTRIBUTE_GROUP));
+    registry.registerAction(action);
+    
+    action = new AddXSDRedefinedModelGroupAction(this);
+    action.setSelectionProvider(getSelectionManager());
+    action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, Messages._UI_IMAGE_MODEL_GROUP));
+    registry.registerAction(action);
+    
+    action = new SetBaseTypeAction(this);
+    action.setSelectionProvider(getSelectionManager());
+    registry.registerAction(action);
+    
     action = new AddXSDElementAction(this, AddXSDElementAction.ID, Messages._UI_ACTION_ADD_ELEMENT, false);
     action.setSelectionProvider(getSelectionManager());
     action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDElement.gif"));
     registry.registerAction(action);
 
+    action = new AddXSDElementAction(this, AddXSDElementAction.BEFORE_SELECTED_ID, Messages._UI_ACTION_BEFORE, false);
+    action.setSelectionProvider(getSelectionManager());
+    action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDElement.gif"));
+    registry.registerAction(action);       
+    
+    action = new AddXSDElementAction(this, AddXSDElementAction.AFTER_SELECTED_ID, Messages._UI_ACTION_AFTER, false);
+    action.setSelectionProvider(getSelectionManager());
+    action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDElement.gif"));
+    registry.registerAction(action);      
+    
     action = new AddXSDElementAction(this, AddXSDElementAction.REF_ID, Messages._UI_ACTION_ADD_ELEMENT_REF, true);
     action.setSelectionProvider(getSelectionManager());
     action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDElementRef.gif"));
@@ -594,6 +719,16 @@
     action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAttribute.gif"));
     registry.registerAction(action);
 
+    action = new AddXSDAttributeDeclarationAction(this, AddXSDAttributeDeclarationAction.BEFORE_SELECTED_ID, Messages._UI_ACTION_BEFORE, false);
+    action.setSelectionProvider(getSelectionManager());
+    action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAttribute.gif"));
+    registry.registerAction(action);
+    
+    action = new AddXSDAttributeDeclarationAction(this, AddXSDAttributeDeclarationAction.AFTER_SELECTED_ID, Messages._UI_ACTION_AFTER, false);
+    action.setSelectionProvider(getSelectionManager());
+    action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAttribute.gif"));
+    registry.registerAction(action);
+    
     action = new AddXSDAttributeDeclarationAction(this, AddXSDAttributeDeclarationAction.REF_ID, Messages._UI_ACTION_ADD_ATTRIBUTE_REF, true);
     action.setSelectionProvider(getSelectionManager());
     action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDAttributeRef.gif"));
@@ -635,6 +770,21 @@
     action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDInclude.gif"));
     registry.registerAction(action);
 
+    action = new AddXSDEnumerationFacetAction(this);
+    action.setSelectionProvider(getSelectionManager());
+    action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDSimpleEnum.gif"));
+    registry.registerAction(action);
+    
+    action = new AddXSDEnumerationFacetAction(this, AddXSDEnumerationFacetAction.BEFORE_SELECTED_ID, Messages._UI_ACTION_BEFORE);
+    action.setSelectionProvider(getSelectionManager());
+    action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDSimpleEnum.gif"));
+    registry.registerAction(action);       
+
+    action = new AddXSDEnumerationFacetAction(this, AddXSDEnumerationFacetAction.AFTER_SELECTED_ID, Messages._UI_ACTION_AFTER);
+    action.setSelectionProvider(getSelectionManager());
+    action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDSimpleEnum.gif"));
+    registry.registerAction(action);       
+
     action = new AddXSDSchemaDirectiveAction(this, AddXSDSchemaDirectiveAction.IMPORT_ID, Messages._UI_ACTION_ADD_IMPORT);
     action.setSelectionProvider(getSelectionManager());
     action.setImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/XSDImport.gif"));
@@ -749,6 +899,10 @@
       {
         node = ((XSDComponent) object).getElement();
       }
+      else if (object instanceof RedefineCategoryAdapter)
+      {
+        node = ((RedefineCategoryAdapter) object).getXSDRedefine().getElement();
+      }
       else if (object instanceof CategoryAdapter)
       {
         node = ((CategoryAdapter) object).getXSDSchema().getElement();
@@ -884,6 +1038,8 @@
             {
               xsdSelections.add(xsdNode);
             }
+            if (xsdNode instanceof XSDRedefineAdapter)
+            	return;
           }
           if (!xsdSelections.isEmpty())
           {
@@ -917,6 +1073,11 @@
       {
         node = ((XSDComponent) object).getElement();
       }
+      else if (object instanceof RedefineCategoryAdapter)
+      {
+        RedefineCategoryAdapter category = (RedefineCategoryAdapter)object;
+        node = category.getXSDRedefine().getElement();
+      }
       else if (object instanceof CategoryAdapter)
       {
         node = ((CategoryAdapter) object).getXSDSchema().getElement();
@@ -1033,6 +1194,60 @@
       fXSDSelectionListener.doSetSelection();
 
   }
+  
+  public void propertyChanged(Object source, int propId)
+  {
+    switch (propId)
+    {
+      // when refactor rename while file is open in editor, need to reset
+      // editor contents to reflect new document
+      case IEditorPart.PROP_INPUT:
+      {
+        if (source == structuredTextEditor && xsdSchema != null)
+        {
+          IStructuredModel structuredModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
+          try
+          {
+            if (structuredModel instanceof IDOMModel)
+            {
+              Document schemaDocument = xsdSchema.getDocument();
+              Document domModelDocument = ((IDOMModel)structuredModel).getDocument();
+              // if dom documents are not the same, they need to be reset
+              if (schemaDocument != domModelDocument)
+              {
+                XSDModelAdapter modelAdapter = null;
+                if (schemaDocument instanceof IDOMDocument)
+                {
+                  // save this model adapter for cleanup later
+                  modelAdapter = (XSDModelAdapter) ((IDOMDocument)schemaDocument).getExistingAdapter(XSDModelAdapter.class);
+                }
+                
+                // update multipage editor with new editor input
+                IEditorInput editorInput = structuredTextEditor.getEditorInput();
+                setInput(editorInput);
+                setPartName(editorInput.getName());
+                getCommandStack().markSaveLocation();
+                
+                // Now do the clean up model adapter
+                if (modelAdapter != null)
+                {
+                  modelAdapter.clear();
+                  modelAdapter = null;
+                }
+              }
+            }
+          }
+          finally
+          {
+            if (structuredModel != null)
+              structuredModel.releaseFromRead();
+          }
+        }
+        break;
+      }
+    }
+    super.propertyChanged(source, propId);
+  }
 
   public INavigationLocation createEmptyNavigationLocation()
   {
@@ -1173,5 +1388,81 @@
   {
     XSDEditorPlugin.getPlugin().getPreferenceStore().setValue(DEFAULT_EDITOR_MODE_ID, id);
   }
+  
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
+   */
+  public void doSave(IProgressMonitor monitor)
+  {
+    XSDDirectivesManager.removeUnusedXSDImports(((XSDSchema)getAdapter(XSDSchema.class)));
+    super.doSave(monitor);
+  }
 
+  /* (non-Javadoc)
+   * @see org.eclipse.ui.part.EditorPart#doSaveAs()
+   */
+  public void doSaveAs()
+  {
+    // When performing a save as, the document changes.   Our model state listeners should listen
+    // to the new document.
+    
+    // First get the current document
+    IDocument currentDocument = getDocument();
+    XSDModelAdapter modelAdapter = null;
+    IDOMDocument doc = null;
+    if (currentDocument != null)
+    {
+      IStructuredModel structuredModel = StructuredModelManager.getModelManager().getExistingModelForRead(currentDocument);
+      if (structuredModel != null)
+      {
+        try
+        {
+          if ((structuredModel != null) && (structuredModel instanceof IDOMModel))
+          {
+            // Get the associated IDOMDocument model
+            doc = ((IDOMModel) structuredModel).getDocument();
+            // and now get our adapter that listens to DOM changes
+            if (doc != null)
+            {
+              modelAdapter = (XSDModelAdapter) doc.getExistingAdapter(XSDModelAdapter.class);
+            }
+          }
+        }
+        finally
+        {
+          structuredModel.releaseFromRead();
+        }
+      }
+    }
+    
+    IEditorInput editorInput = structuredTextEditor.getEditorInput();
+    // perform save as
+    structuredTextEditor.doSaveAs();
+    // if saveAs cancelled then don't setInput because the input hasn't change
+    // See AbstractDecoratedTextEditor's performSaveAs
+    if (editorInput != structuredTextEditor.getEditorInput())
+    {
+      setInput(structuredTextEditor.getEditorInput());
+      setPartName(structuredTextEditor.getEditorInput().getName());
+    
+      getCommandStack().markSaveLocation();
+   
+      // Now do the clean up on the old document
+      if (modelAdapter != null)
+      {
+        // clear out model adapter
+        modelAdapter.clear();
+        modelAdapter = null;
+      }
+    }
+  }
+  
+  protected void doPostEditorOpenTasks() 
+  {
+		// Bug 204868: do the selection after the editor part is created, so that 
+		// AbstractTextEditor.markInNavigationHistory() won't cause the creation 
+        // of its own editor part.
+		// Select the schema to show the properties
+		getSelectionManager().setSelection(new StructuredSelection(getModel()));
+  }
 }  
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/KeyboardDragImpl.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/KeyboardDragImpl.java
index d8fb847..c0fc8e3 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/KeyboardDragImpl.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/KeyboardDragImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,12 +10,71 @@
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.editor;
 
+import org.eclipse.gef.EditPart;
 import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeDeclarationAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDElementDeclarationAdapter;
 import org.eclipse.wst.xsd.ui.internal.adt.design.IKeyboardDrag;
+import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.KeyBoardAccessibilityEditPolicy;
+import org.eclipse.wst.xsd.ui.internal.commands.BaseDragAndDropCommand;
+import org.eclipse.wst.xsd.ui.internal.commands.XSDAttributeDragAndDropCommand;
+import org.eclipse.wst.xsd.ui.internal.commands.XSDElementDragAndDropCommand;
+import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDBaseFieldEditPart;
+import org.eclipse.xsd.XSDWildcard;
 
-public class KeyboardDragImpl implements IKeyboardDrag {
+public class KeyboardDragImpl implements IKeyboardDrag
+{
+  public void performKeyboardDrag(GraphicalEditPart movingElement, int direction)
+  {
+    KeyBoardAccessibilityEditPolicy policy = (KeyBoardAccessibilityEditPolicy) movingElement.getEditPolicy(KeyBoardAccessibilityEditPolicy.KEY);
 
-	public void performKeyboardDrag(GraphicalEditPart movingElement, int direction) {
+    EditPart rightElement = policy.getRelativeEditPart(movingElement, direction);
+    policy = (KeyBoardAccessibilityEditPolicy) rightElement.getEditPolicy(KeyBoardAccessibilityEditPolicy.KEY);
+    EditPart leftElement = (policy != null) ? policy.getRelativeEditPart(rightElement, direction) : null;
 
-	}
+    // TODO: add support for extenders
+    if (!(movingElement instanceof XSDBaseFieldEditPart)) return;
+    
+    XSDBaseFieldEditPart movingField = (XSDBaseFieldEditPart) movingElement;
+    XSDBaseFieldEditPart leftField = (XSDBaseFieldEditPart) leftElement;
+    XSDBaseFieldEditPart rightField = (XSDBaseFieldEditPart) rightElement;
+    
+    Object movingObject = movingField.getModel();
+    
+    BaseDragAndDropCommand command = null;
+    if (movingObject instanceof XSDElementDeclarationAdapter || movingObject instanceof XSDWildcard)
+    {
+      command = new XSDElementDragAndDropCommand(movingField, leftField, rightField, direction);
+    }
+    else if (movingObject instanceof XSDAttributeDeclarationAdapter)
+    {
+      command = new XSDAttributeDragAndDropCommand(movingField, leftField, rightField, direction);
+    }
+    
+    if (command != null && command.canExecute())
+    {
+      command.execute();
+      // This is to reselect the moved item
+      try
+      {
+        IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+        if (editor != null && editor.getAdapter(ISelectionProvider.class) != null)
+        {
+          ISelectionProvider provider = (ISelectionProvider) editor.getAdapter(ISelectionProvider.class);
+          if (provider != null)
+          {
+            provider.setSelection(new StructuredSelection(movingElement.getModel()));
+          }
+        }
+      }
+      catch (Exception e)
+      {
+
+      }
+    }
+  }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Messages.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Messages.java
index 0afd42b..c013f74 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Messages.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Messages.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -43,14 +43,17 @@
   public static String UI_LABEL_COMPONENTS;
 
   public static String _UI_GRAPH_TYPES;
+  public static String _UI_GRAPH_REDEFINE_TYPES;
   public static String _UI_GRAPH_ELEMENTS;
   public static String _UI_GRAPH_ATTRIBUTES;
   public static String _UI_GRAPH_ATTRIBUTE_GROUPS;
+  public static String _UI_GRAPH_REDEFINE_ATTRIBUTE_GROUPS;
   public static String _UI_GRAPH_NOTATIONS;
   public static String _UI_GRAPH_IDENTITY_CONSTRAINTS;
   public static String _UI_GRAPH_ANNOTATIONS;
   public static String _UI_GRAPH_DIRECTIVES;
   public static String _UI_GRAPH_GROUPS;
+  public static String _UI_GRAPH_REDEFINE_GROUPS;
   
   public static String _UI_LABEL_NO_LOCATION_SPECIFIED;
   public static String _UI_NO_TYPE_DEFINED;
@@ -79,7 +82,10 @@
   public static String _UI_LABEL_NEW_ATTRIBUTE;
   public static String _UI_MENU_XSD_EDITOR;
   public static String _UI_LABEL_SOURCE;
+  public static String _UI_ACTION_BEFORE;
+  public static String _UI_ACTION_AFTER;
   public static String _UI_ACTION_ADD_ELEMENT;
+  public static String _UI_ACTION_INSERT_ELEMENT;
   public static String _UI_ACTION_ADD_ELEMENT_REF;
   public static String _UI_ACTION_NEW;
   public static String _UI_ACTION_BROWSE;
@@ -92,8 +98,11 @@
   public static String _UI_LABEL_NAME_SEARCH_FILTER_TEXT;
   public static String _UI_LABEL_ELEMENTS_COLON;
   public static String _UI_LABEL_ATTRIBUTES_COLON;
+  public static String _UI_LABEL_ATTRIBUTES_PROCESSCONTENTS;
+  public static String _UI_LABEL_ATTRIBUTES_NAMESPACE;
   public static String _UI_LABEL_SET_ELEMENT_REFERENCE;
   public static String _UI_LABEL_SET_ATTRIBUTE_REFERENCE;
+  public static String _UI_LABEL_REDEFINE_COMPONENT;
   public static String _UI_LABEL_TYPES_COLON;
   public static String _UI_LABEL_SET_TYPE;
 
@@ -112,10 +121,35 @@
   public static String _UI_ACTION_ADD_IMPORT;
   public static String _UI_ACTION_ADD_REDEFINE;
   public static String _UI_ACTION_ADD_ATTRIBUTE;
+  public static String _UI_ACTION_INSERT_ATTRIBUTE;
   public static String _UI_ACTION_ADD_ATTRIBUTE_REF;
+  public static String _UI_ACTION_DRAG_DROP_ELEMENT;
+  public static String _UI_ACTION_DRAG_DROP_ATTRIBUTE;
+  public static String _UI_ACTION_REDEFINE_COMPLEX_TYPE;
+  public static String _UI_ACTION_REDEFINE_SIMPLE_TYPE;
+  public static String _UI_ACTION_REDEFINE_ATTRIBUTE_GROUP;
+  public static String _UI_ACTION_REDEFINE_MODEL_GROUP;
+  public static String _UI_ACTION_RENAME;  
+  
+  public static String _UI_IMAGE_COMPLEX_TYPE;
+  public static String _UI_IMAGE_SIMPLE_TYPE;
+  public static String _UI_IMAGE_MODEL_GROUP;
+  public static String _UI_IMAGE_ATTRIBUTE_GROUP;
 
+  // TODO: TO REMOVE
   public static String _UI_LABEL_ELEMENTFORMDEFAULT;
+  // TODO: TO REMOVE
   public static String _UI_LABEL_ATTRIBUTEFORMDEFAULT;
   public static String _UI_LABEL_CREATE_ANON_TYPE;  
-  public static String _UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK;
+  public static String _UI_XML_TEXT_EDITOR_PREFS_LINK;
+  public static String _UI_XML_VALIDATOR_PREFS_LINK;
+  
+  public static String _UI_TEXT_ENABLE_AUTO_IMPORT_CLEANUP;
+  public static String _UI_TEXT_ENABLE_AUTO_OPEN_SCHEMA_DIALOG;
+  public static String _UI_GRAPH_REDEFINE_SCHEMA;
+
+  public static String _UI_COMBO_NEW;
+  public static String _UI_COMBO_BROWSE;
+
+  public static String _UI_ERROR_INVALID_NAME;  
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDAttributeReferenceEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDAttributeReferenceEditManager.java
index 0940414..df4cab6 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDAttributeReferenceEditManager.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDAttributeReferenceEditManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -19,6 +19,7 @@
 import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDAttributeDeclarationCommand;
 import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateAttributeReferenceAndManagerDirectivesCommand;
 import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateAttributeReferenceCommand;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
 import org.eclipse.wst.xsd.ui.internal.dialogs.NewAttributeDialog;
 import org.eclipse.wst.xsd.ui.internal.editor.search.XSDSearchListDialogDelegate;
 import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
@@ -81,7 +82,8 @@
           {
             Command command = new UpdateAttributeReferenceCommand(Messages._UI_ACTION_UPDATE_ATTRIBUTE_REFERENCE, concreteComponent, attributeDec);
             command.execute();
-          }  
+          }
+          XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
         }  
         else
         {
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDComplexTypeBaseTypeEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDComplexTypeBaseTypeEditManager.java
index 515d6f7..002aa76 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDComplexTypeBaseTypeEditManager.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDComplexTypeBaseTypeEditManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -20,6 +20,7 @@
 import org.eclipse.wst.xsd.ui.internal.common.commands.SetBaseTypeAndManagerDirectivesCommand;
 import org.eclipse.wst.xsd.ui.internal.common.commands.SetBaseTypeCommand;
 import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
 import org.eclipse.wst.xsd.ui.internal.editor.search.XSDSearchListDialogDelegate;
 import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
 import org.eclipse.xsd.XSDComplexTypeDefinition;
@@ -86,14 +87,15 @@
         {
           Command command = new SetBaseTypeCommand(concreteComponent, td);
           command.execute();
-        }  
+        }
+        XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
       }  
       else
       {  
         Command command = new SetBaseTypeAndManagerDirectivesCommand(concreteComponent, component.getName(), component.getQualifier(), component.getFile());
         command.setLabel(Messages._UI_ACTION_SET_BASE_TYPE);
         command.execute();
-      }  
+      }
     }
     else if (concreteComponent instanceof XSDSimpleTypeDefinition)
     {
@@ -111,13 +113,14 @@
         {
           Command command = new SetBaseTypeCommand(concreteComponent, td);
           command.execute();
-        }  
+        }
+        XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
       }  
       else
       {  
         Command command = new SetBaseTypeAndManagerDirectivesCommand(concreteComponent, component.getName(), component.getQualifier(), component.getFile());
         command.execute();
-      }  
+      }
     }
 
   }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorCSHelpIds.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorCSHelpIds.java
index 390db12..332e199 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorCSHelpIds.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorCSHelpIds.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -67,6 +67,7 @@
   public static final String XMLSCHEMAFILES_PREFERENCES__XML_SCHEMA_LANGUAGE_CONSTRUCTS_PREFIX = PLUGIN_NAME + ".xsduf0020";
   public static final String XMLSCHEMAFILES_PREFERENCES__DEFAULT_TARGETNAMESPACE = PLUGIN_NAME + ".xsduf0030";
   public static final String XMLSCHEMAFILES_PREFERENCES__HONOUR_ALL_SCHEMA_LOCATIONS = PLUGIN_NAME + ".xsduf0040";
+  public static final String XMLSCHEMAFILES_PREFERENCES__IMPORT_CLEANUP = PLUGIN_NAME + ".xsduf0050";
   
   public static final String DOCUMENTATION_TAB__NO_LABEL = PLUGIN_NAME + ".xsdup0010";
   
@@ -86,6 +87,11 @@
   public static final String GENERAL_TAB__SCHEMA__TARGETNAMESPACE = PLUGIN_NAME + ".xsdup0210";
   public static final String GENERAL_TAB__SCHEMA__ADVANCED = PLUGIN_NAME + ".xsdup0220";
   
+  public static final String ADVANCE_TAB__SCHEMA_ELEMENT_FORM_DEFAULT = PLUGIN_NAME + ".xsdup0450";
+  public static final String ADVANCE_TAB__SCHEMA_ATTRIBUTE_FORM_DEFAULT = PLUGIN_NAME + ".xsdup0460";
+  public static final String ADVANCE_TAB__SCHEMA_BLOCK_DEFAULT = PLUGIN_NAME + ".xsdup0470";
+  public static final String ADVANCE_TAB__SCHEMA_FINAL_DEFAULT = PLUGIN_NAME + ".xsdup0480";
+  
   public static final String GENERAL_TAB__ELEMENT__NAME = PLUGIN_NAME + ".xsdup0230";
   public static final String GENERAL_TAB__ELEMENT__TYPE = PLUGIN_NAME + ".xsdup0240";
   public static final String GENERAL_TAB__ELEMENT__REFERENCE = PLUGIN_NAME + ".xsdup0250";
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorContextIds.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorContextIds.java
index 088f706..2f1bc75 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorContextIds.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorContextIds.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -457,4 +457,8 @@
   
   /* CONTEXT_ID xsdp0010 for XML Schema Preferences Page */
   public static final String XSDP_PREFERENCE_PAGE = PLUGIN_NAME + ".xsdp0010";
+  /* CONTEXT_ID xsdp0020 for XML Schema Editor Preferences Page */
+  public static final String XSDP_EDITOR_PREFERENCE_PAGE = PLUGIN_NAME + ".xsdp0020";
+  /* CONTEXT_ID xsdp0030 for XML Schema Validator Preferences Page */
+  public static final String XSDP_VALIDATOR_PREFERENCE_PAGE = PLUGIN_NAME + ".xsdp0030";
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorPlugin.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorPlugin.java
index a866a64..010b419 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorPlugin.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorPlugin.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -48,6 +48,7 @@
   private ExtensionsSchemasRegistry registry;  
   private NodeCustomizationRegistry nodeCustomizationRegistry;
   private XSDEditorConfiguration xsdEditorConfiguration = null;
+  private static Bundle bundle;
   
   public static final String CONST_USE_SIMPLE_EDIT_MODE = PLUGIN_ID + ".useSimpleEditMode"; //$NON-NLS-1$
   public static final String CONST_SHOW_INHERITED_CONTENT = PLUGIN_ID + ".showInheritedContent"; //$NON-NLS-1$
@@ -55,6 +56,8 @@
   public static final String CONST_XSD_LANGUAGE_QUALIFY = "org.eclipse.wst.xmlschema.xsdQualify"; //$NON-NLS-1$
   public static final String CONST_DEFAULT_TARGET_NAMESPACE = "org.eclipse.wst.xmlschema.defaultTargetnamespaceText"; //$NON-NLS-1$
   public static final String CONST_SHOW_EXTERNALS = PLUGIN_ID + ".showExternals"; //$NON-NLS-1$
+  public static final String CONST_XSD_IMPORT_CLEANUP = PLUGIN_ID + ".autoImportCleanup"; //$NON-NLS-1$
+  public static final String CONST_XSD_AUTO_OPEN_SCHEMA_LOCATION_DIALOG = PLUGIN_ID + ".autoOpenSchemaLocationDialog"; //$NON-NLS-1$
   
   public static String DEFAULT_PAGE = "org.eclipse.wst.xsd.ui.internal.defaultPage";
   public static String DESIGN_PAGE = "org.eclipse.wst.xsd.ui.internal.designPage";
@@ -73,6 +76,7 @@
 	 */
 	public void start(BundleContext context) throws Exception {
 		super.start(context);
+		bundle = context.getBundle();
 	}
 
 	/**
@@ -210,7 +214,7 @@
 	}
 	
 	public URL getBaseURL() {
-		return getDescriptor().getInstallURL();
+		return bundle.getEntry("/"); //$NON-NLS-1$
 	}
 
 	public Image getIconImage(String object) {
@@ -236,6 +240,8 @@
     store.setDefault(DEFAULT_PAGE, DESIGN_PAGE);
     store.setDefault(CONST_DEFAULT_TARGET_NAMESPACE, DEFAULT_TARGET_NAMESPACE);
     store.setDefault(CONST_SHOW_EXTERNALS, false);
+    store.setDefault(CONST_XSD_IMPORT_CLEANUP, false);
+    store.setDefault(CONST_XSD_AUTO_OPEN_SCHEMA_LOCATION_DIALOG, true);
     
     //Even the last item in the list must contain a trailing List separator
     store.setDefault(CONST_PREFERED_BUILT_IN_TYPES,     		
@@ -288,7 +294,17 @@
   {
     getPreferenceStore().setValue(CONST_SHOW_EXTERNALS, doShow);
   }
+  
+  public boolean getRemoveImportSetting()
+  {
+    return getPreferenceStore().getBoolean(CONST_XSD_IMPORT_CLEANUP);
+  }
 
+  public boolean getAutomaticallyOpenSchemaLocationDialogSetting()
+  {
+    return getPreferenceStore().getBoolean(CONST_XSD_AUTO_OPEN_SCHEMA_LOCATION_DIALOG);
+  }
+  
   /**
    * Get the xml schema default target namespace
    */
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDElementReferenceEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDElementReferenceEditManager.java
index beac151..6d03aec 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDElementReferenceEditManager.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDElementReferenceEditManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,6 +23,7 @@
 import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDElementCommand;
 import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateElementReferenceAndManageDirectivesCommand;
 import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateElementReferenceCommand;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
 import org.eclipse.wst.xsd.ui.internal.dialogs.NewElementDialog;
 import org.eclipse.wst.xsd.ui.internal.editor.search.XSDSearchListDialogDelegate;
 import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
@@ -128,7 +129,8 @@
           {
             Command command = new UpdateElementReferenceCommand(Messages._UI_ACTION_UPDATE_ELEMENT_REFERENCE, concreteComponent, elementDec);
             command.execute();
-          }  
+          }
+          XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
         }  
         else
         {
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java
index db9b913..5bb7f4c 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,16 +8,21 @@
  * Contributors:
  *     IBM Corporation - Initial API and implementation
  *     Jens Lukowski/Innoopract - initial renaming/restructuring
+ *     Jesper Steen Moller - added support for lookups out of workspace
  *******************************************************************************/
 
 package org.eclipse.wst.xsd.ui.internal.editor;
 
+import java.net.URI;
+
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchWindow;
@@ -25,6 +30,9 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.ide.IDE;
 import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
+import org.eclipse.wst.xml.ui.internal.Logger;
+import org.eclipse.wst.xsd.ui.internal.adt.editor.ADTReadOnlyFileEditorInput;
+import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
 import org.eclipse.xsd.XSDConcreteComponent;
 import org.eclipse.xsd.XSDSchema;
 
@@ -56,7 +64,7 @@
 
   public String getHyperlinkText()
   {
-    return null;
+    return NLS.bind(Messages._UI_HYPERLINK_TEXT, fComponent.getElement().getLocalName());
   }
 
   public void open()
@@ -69,16 +77,26 @@
     }
 
     String schemaLocation = schema.getSchemaLocation();
-    schemaLocation = URIHelper.removePlatformResourceProtocol(schemaLocation);
-    IPath schemaPath = new Path(schemaLocation);
-    IFile schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
 
-    boolean fileExists = schemaFile != null && schemaFile.exists();
-
-    if (!fileExists)
-    {
-      return;
+	IFile schemaFile = null;
+    URI schemaUri = null;
+    
+	if (URIHelper.isPlatformResourceProtocol(schemaLocation))
+	{
+      IPath schemaPath = new Path(URIHelper.removePlatformResourceProtocol(schemaLocation));
+      schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
+      if (! schemaFile.exists())
+      {
+    	return;
+      }
     }
+	else
+	{
+		try {
+			schemaUri = new URI(schemaLocation);
+		} catch (Exception exception) {}
+	}
+	
     IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
     if (workbenchWindow != null)
     {
@@ -89,7 +107,19 @@
       
       try
       {
-        editorPart = IDE.openEditor(workbenchPage, schemaFile, true);
+      	if (schemaFile != null)
+    	{
+    		editorPart = IDE.openEditor(workbenchPage, schemaFile, true);
+    	}
+    	else if (schemaUri != null && "file".equals(schemaUri.getScheme())) //$NON-NLS-1$
+    	{
+    		editorPart = IDE.openEditor(workbenchPage, schemaUri, XSDEditorPlugin.EDITOR_ID, true);	
+    	}
+    	else
+    	{
+    	    IEditorInput input = new ADTReadOnlyFileEditorInput(schemaLocation);
+    	    editorPart = IDE.openEditor(workbenchPage, input, XSDEditorPlugin.EDITOR_ID, true);
+		}
         if (editorPart instanceof InternalXSDMultiPageEditor)
         {
           ((InternalXSDMultiPageEditor) editorPart).openOnGlobalReference(fComponent);
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDMultiPageEditorContributor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDMultiPageEditorContributor.java
index cf47812..5d62af8 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDMultiPageEditorContributor.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDMultiPageEditorContributor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -139,6 +139,7 @@
           actionBars.setGlobalActionHandler(GEFActionConstants.ZOOM_IN, registry.getAction(GEFActionConstants.ZOOM_IN));
           actionBars.setGlobalActionHandler(GEFActionConstants.ZOOM_OUT, registry.getAction(GEFActionConstants.ZOOM_OUT));
           actionBars.setGlobalActionHandler(ActionFactory.PRINT.getId(), registry.getAction(ActionFactory.PRINT.getId()));
+          actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), registry.getAction(ActionFactory.SELECT_ALL.getId()));
           zoomInRetargetAction.setEnabled(true);
           zoomOutRetargetAction.setEnabled(true);
           captureScreenAction.setEnabled(true);
@@ -155,6 +156,9 @@
     {
       zoomComboContributionItem.setVisible(!isSource);
       zoomComboContributionItem.update();
+      // Bug 254772 - parent contribution manager should not be null.  We added this item already.
+      // Force the ToolBarManager to update/redraw the items
+      zoomComboContributionItem.getParent().update(true);
     }
   }
   
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSubstitutionGroupEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSubstitutionGroupEditManager.java
index 1019a0d..8bf2506 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSubstitutionGroupEditManager.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSubstitutionGroupEditManager.java
@@ -16,6 +16,7 @@
 import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
 import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDElementCommand;
 import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateAttributeValueCommand;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
 import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
 import org.eclipse.xsd.XSDConcreteComponent;
 import org.eclipse.xsd.XSDElementDeclaration;
@@ -67,7 +68,8 @@
         {
           Command command = new UpdateAttributeValueCommand(concreteComponent.getElement(), XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE, ((XSDElementDeclaration)component.getObject()).getQName(concreteComponent.getSchema()), org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_SUBSTITUTION_GROUP);
           command.execute();
-        }  
+        }
+        XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
       }
   }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTypeReferenceEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTypeReferenceEditManager.java
index 8748901..9e1e13b 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTypeReferenceEditManager.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTypeReferenceEditManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -28,6 +28,7 @@
 import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDSimpleTypeDefinitionCommand;
 import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateTypeReferenceAndManageDirectivesCommand;
 import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateTypeReferenceCommand;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
 import org.eclipse.wst.xsd.ui.internal.dialogs.NewTypeDialog;
 import org.eclipse.wst.xsd.ui.internal.editor.search.XSDSearchListDialogDelegate;
 import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
@@ -182,16 +183,16 @@
           if (component.getMetaName() == IXSDSearchConstants.COMPLEX_TYPE_META_NAME)
           {
             XSDComplexTypeDefinition complexType = factory.createXSDComplexTypeDefinition();            
-	  	    elementDeclaration.setAnonymousTypeDefinition(complexType);
+	  	      elementDeclaration.setAnonymousTypeDefinition(complexType);
           }
           else
           {
-        	XSDSimpleTypeDefinition simpleType = factory.createXSDSimpleTypeDefinition();
-        	simpleType.setBaseTypeDefinition(
-        			elementDeclaration.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "string") ); //$NON-NLS-1$
+        	  XSDSimpleTypeDefinition simpleType = factory.createXSDSimpleTypeDefinition();
+        	  simpleType.setBaseTypeDefinition(
+        	    elementDeclaration.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "string") ); //$NON-NLS-1$
   	  	    elementDeclaration.setAnonymousTypeDefinition(simpleType);
           }
-		  elementDeclaration.getElement().removeAttribute("type"); //TODO use external literal string
+		      elementDeclaration.getElement().removeAttribute("type"); //TODO use external literal string
         }
         else if (component.getMetaName() == IXSDSearchConstants.COMPLEX_TYPE_META_NAME)
         {  
@@ -212,7 +213,8 @@
           Command command = new UpdateTypeReferenceCommand(concreteComponent, td);
           command.setLabel(Messages._UI_ACTION_SET_TYPE);
           command.execute();
-        }  
+        }
+        XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
       }  
       else
       {  
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/messages.properties b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/messages.properties
index 09c001d..bb90770 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/messages.properties
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/messages.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2007 IBM Corporation and others.
+# Copyright (c) 2001, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -12,21 +12,21 @@
 UI_LABEL_BASE_TYPE = Base Type:
 UI_LABEL_DERIVED_BY = Derived By:
 
-UI_LABEL_INHERIT_FROM = Inherit From:
-UI_LABEL_INHERIT_BY = Inherit By:
+UI_LABEL_INHERIT_FROM = Inherit &From:
+UI_LABEL_INHERIT_BY = Inherit &By:
 
 UI_LABEL_DOCUMENTATION = Documentation
 UI_LABEL_APP_INFO = App Info
 
 UI_LABEL_SET_TYPE = Set Type
-UI_LABEL_TYPE = Type:
+UI_LABEL_TYPE = &Type:
 
-UI_LABEL_NAME = Name:
+UI_LABEL_NAME = &Name:
 
 UI_LABEL_KIND = Kind:
 
-UI_LABEL_MINOCCURS = Minimum Occurrence:
-UI_LABEL_MAXOCCURS = Maximum Occurrence:
+UI_LABEL_MINOCCURS = &Minimum Occurrence:
+UI_LABEL_MAXOCCURS = Ma&ximum Occurrence:
 
 UI_PAGE_HEADING_REFERENCE = Reference
 UI_LABEL_READ_ONLY = read-only
@@ -45,9 +45,13 @@
 _UI_GRAPH_ANNOTATIONS          = Annotations
 _UI_GRAPH_DIRECTIVES           = Directives
 _UI_GRAPH_GROUPS               = Groups
+_UI_GRAPH_REDEFINE_SCHEMA      = Redefine Schema
+_UI_GRAPH_REDEFINE_TYPES       = Types
+_UI_GRAPH_REDEFINE_ATTRIBUTE_GROUPS  = Attribute Groups
+_UI_GRAPH_REDEFINE_GROUPS      = Groups
 
 _UI_LABEL_NO_LOCATION_SPECIFIED  = No Location Specified
-_UI_ACTION_SET_MULTIPLICITY		 = Set Multiplicity
+_UI_ACTION_SET_MULTIPLICITY		 = Set &Multiplicity
 _UI_LABEL_ABSENT               = absent
 _UI_GRAPH_UNKNOWN_OBJECT       = Unknown object
 _UI_GRAPH_XSDSCHEMA_NO_NAMESPACE = (no target namespace specified)
@@ -60,14 +64,17 @@
 !
 _UI_TEXT_INDENT_LABEL                 = Indentation
 _UI_TEXT_INDENT_SPACES_LABEL          = &Number of spaces: 
-_UI_TEXT_XSD_NAMESPACE_PREFIX         = XML schema language
-_UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK = Note that some preferences may be set on the <a>{0}</a> preference page.
+_UI_TEXT_XSD_NAMESPACE_PREFIX         = Creating files
+_UI_XML_TEXT_EDITOR_PREFS_LINK		  = XML Schema editing preferences. Note that some preferences may be set on the XML <a>{0}</a> preference page.
+_UI_XML_VALIDATOR_PREFS_LINK		  = Note that some preferences may be set on the XML <a>{0}</a> preference page.
 _UI_TEXT_XSD_DEFAULT_PREFIX           = XML schema language constructs &prefix:
 _UI_QUALIFY_XSD                       = &Qualify XML schema language constructs
-_UI_TEXT_XSD_DEFAULT_TARGET_NAMESPACE = Default Target Namespace:
+_UI_TEXT_XSD_DEFAULT_TARGET_NAMESPACE = Default &target namespace:
 _UI_VALIDATING_FILES                  = Validating files
 _UI_TEXT_HONOUR_ALL_SCHEMA_LOCATIONS  = Honour all schema locations
-_UI_FULL_CONFORMANCE                  = Check full XML Schema conformance 
+_UI_FULL_CONFORMANCE                  = &Check full XML Schema conformance
+_UI_TEXT_ENABLE_AUTO_IMPORT_CLEANUP   = &Automatically remove unused XSD imports and XML Namespace entries
+_UI_TEXT_ENABLE_AUTO_OPEN_SCHEMA_DIALOG = &Prompt for schema location when adding a directive
 
 _ERROR_LABEL_INVALID_PREFIX     = IWAX1004E Invalid prefix. A prefix must not be empty or contain any space.
 
@@ -76,18 +83,29 @@
 _UI_ACTION_UPDATE_ELEMENT_REFERENCE=Update Element reference
 _UI_ACTION_UPDATE_ATTRIBUTE_REFERENCE=Update Attribute reference
 _UI_ACTION_ADD_FIELD=Add Field
-_UI_ACTION_ADD_ELEMENT=Add Element
-_UI_ACTION_ADD_INCLUDE=Add Include
-_UI_ACTION_ADD_IMPORT=Add Import
-_UI_ACTION_ADD_REDEFINE=Add Redefine
-_UI_ACTION_ADD_ELEMENT_REF=Add Element Ref
-_UI_ACTION_ADD_COMPLEX_TYPE=Add Complex Type
-_UI_ACTION_ADD_SIMPLE_TYPE=Add Simple Type
-_UI_ACTION_SET_TYPE=Set Type
-_UI_ACTION_ADD_ATTRIBUTE=Add Attribute
-_UI_ACTION_ADD_ATTRIBUTE_REF=Add Attribute Ref
-_UI_ACTION_NEW=New...
-_UI_ACTION_BROWSE=Browse...
+_UI_ACTION_ADD_ELEMENT=Add &Element
+_UI_ACTION_INSERT_ELEMENT=I&nsert Element
+_UI_ACTION_BEFORE=&Before
+_UI_ACTION_AFTER=&After
+_UI_ACTION_ADD_INCLUDE=Add In&clude
+_UI_ACTION_ADD_IMPORT=Add I&mport
+_UI_ACTION_ADD_REDEFINE=Add &Redefine
+_UI_ACTION_ADD_ELEMENT_REF=Add E&lement Ref
+_UI_ACTION_ADD_COMPLEX_TYPE=Add &Complex Type
+_UI_ACTION_ADD_SIMPLE_TYPE=Add &Simple Type
+_UI_ACTION_SET_TYPE=Set &Type
+_UI_ACTION_ADD_ATTRIBUTE=Add &Attribute
+_UI_ACTION_INSERT_ATTRIBUTE=I&nsert Attribute
+_UI_ACTION_ADD_ATTRIBUTE_REF=Add Attribute &Ref
+_UI_ACTION_NEW=&New...
+_UI_ACTION_BROWSE=&Browse...
+_UI_ACTION_DRAG_DROP_ELEMENT=Reorder Elements
+_UI_ACTION_DRAG_DROP_ATTRIBUTE=Reorder Attributes
+_UI_ACTION_REDEFINE_COMPLEX_TYPE=Redefine &Complex Type
+_UI_ACTION_REDEFINE_SIMPLE_TYPE=Redefine &Simple Type
+_UI_ACTION_REDEFINE_ATTRIBUTE_GROUP=Redefine &Attribute Group
+_UI_ACTION_REDEFINE_MODEL_GROUP=Redefine &Model Group
+_UI_ACTION_RENAME=Rename
 
 _UI_LABEL_OPTIONAL=Optional
 _UI_LABEL_ZERO_OR_MORE=Zero or more
@@ -101,21 +119,35 @@
 _UI_LABEL_NAME_SEARCH_FILTER_TEXT=Name (? = any character, * = any string):
 _UI_LABEL_SET_ELEMENT_REFERENCE=Set element reference
 _UI_LABEL_SET_ATTRIBUTE_REFERENCE=Set attribute reference
+_UI_LABEL_REDEFINE_COMPONENT=Redefine component
 
 _UI_LABEL_NEW_TYPE=New Type
 _UI_VALUE_NEW_TYPE={0}Type
 _UI_LABEL_NEW_ELEMENT=New Element
 _UI_LABEL_NEW_ATTRIBUTE=New Attribute
-_UI_LABEL_COMPLEX_TYPE=Complex Type
+_UI_LABEL_COMPLEX_TYPE=&Complex Type
 _UI_LABEL_TARGET_NAMESPACE=Target Namespace: 
 _UI_LABEL_NO_NAMESPACE=No Namespace
 _UI_LABEL_ELEMENTS_COLON=Elements:
 _UI_LABEL_ATTRIBUTES_COLON=Attributes:
-_UI_LABEL_SIMPLE_TYPE=Simple Type
+_UI_LABEL_SIMPLE_TYPE=&Simple Type
 _UI_LABEL_TYPES_COLON=Types:
 
 _UI_LABEL_SOURCE=Source
 
 _UI_LABEL_ELEMENTFORMDEFAULT=Prefix qualification of local elements:
 _UI_LABEL_ATTRIBUTEFORMDEFAULT=Prefix qualification of attributes:
-_UI_LABEL_CREATE_ANON_TYPE=Create as local anonymous type
+_UI_LABEL_CREATE_ANON_TYPE=Create as local &anonymous type
+
+_UI_LABEL_ATTRIBUTES_PROCESSCONTENTS=Process Contents:
+_UI_LABEL_ATTRIBUTES_NAMESPACE=Namespace:
+
+_UI_IMAGE_COMPLEX_TYPE=icons/XSDComplexType.gif
+_UI_IMAGE_SIMPLE_TYPE=icons/XSDSimpleType.gif
+_UI_IMAGE_MODEL_GROUP=icons/XSDGroup.gif
+_UI_IMAGE_ATTRIBUTE_GROUP=icons/XSDAttributeGroup.gif
+
+_UI_COMBO_NEW=New...
+_UI_COMBO_BROWSE=Browse...
+
+_UI_ERROR_INVALID_NAME=Invalid name
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListProvider.java
index 7afe5a8..6f53f91 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListProvider.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,14 +13,19 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.progress.UIJob;
 import org.eclipse.wst.common.core.search.SearchEngine;
 import org.eclipse.wst.common.core.search.SearchMatch;
 import org.eclipse.wst.common.core.search.SearchParticipant;
@@ -32,6 +37,7 @@
 import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList;
 import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentSearchListProvider;
 import org.eclipse.wst.xml.core.internal.search.XMLComponentDeclarationPattern;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
 import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
 import org.eclipse.xsd.XSDAttributeDeclaration;
 import org.eclipse.xsd.XSDElementDeclaration;
@@ -88,7 +94,7 @@
       this.searchKind = searchKind;
     }
 
-    public void visitSchema(XSDSchema schema, boolean visitImportedSchema)
+    public void visitSchema(final XSDSchema schema, boolean visitImportedSchema)
     {
       visitedSchemas.add(schema);
       for (Iterator contents = schema.getContents().iterator(); contents.hasNext();)
@@ -96,8 +102,39 @@
         XSDSchemaContent content = (XSDSchemaContent) contents.next();
         if (content instanceof XSDSchemaDirective)
         {
-          XSDSchemaDirective schemaDirective = (XSDSchemaDirective) content;
+          final XSDSchemaDirective schemaDirective = (XSDSchemaDirective) content;
           XSDSchema extSchema = schemaDirective.getResolvedSchema();
+          if (extSchema == null && schemaDirective instanceof XSDImport && visitImportedSchema) 
+          {
+            // Force the import declaration to resolve. The work must be done in the UI thread
+            // because there are UI components listening to changes in the schema content.
+            
+            UIJob loadImportJob = new UIJob(XSDEditorPlugin.getResourceString("_UI_LABEL_LOADING_XML_SCHEMA")) //$NON-NLS-1$ 
+            {
+              public IStatus runInUIThread(IProgressMonitor monitor) 
+              {
+                // The schema model will load the import when trying to resolve any component 
+                // in the imported schema's namespace.
+
+                XSDImport xsdImport = (XSDImport)schemaDirective;
+                String importNamespace = xsdImport.getNamespace();
+                schema.resolveAttributeDeclaration(importNamespace, ""); //$NON-NLS-1$
+                return Status.OK_STATUS;
+              }
+            };
+            loadImportJob.setSystem(true);
+            loadImportJob.schedule();
+            try 
+            {
+              loadImportJob.join();
+            }
+            catch (InterruptedException e) 
+            {
+              // Nothing to do about it.
+            }
+            extSchema = schemaDirective.getResolvedSchema();
+          }
+          
           if (extSchema != null && !visitedSchemas.contains(extSchema))
           {
             if (schemaDirective instanceof XSDImport && visitImportedSchema)
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/navigation/DesignViewNavigationLocation.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/navigation/DesignViewNavigationLocation.java
index c7f8ee3..6f256a1 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/navigation/DesignViewNavigationLocation.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/navigation/DesignViewNavigationLocation.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -24,8 +24,11 @@
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDVisitor;
 import org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewGraphicalViewer;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
 import org.eclipse.xsd.XSDConcreteComponent;
 import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDRedefine;
 import org.eclipse.xsd.XSDSchema;
 import org.eclipse.xsd.XSDTypeDefinition;
 import com.ibm.icu.util.StringTokenizer;
@@ -39,6 +42,8 @@
 {
   protected Path path;
 
+  private static final String PATH_TAG = "path"; //$NON-NLS-1$
+  
   public DesignViewNavigationLocation(IEditorPart part)
   {
     super(part);
@@ -94,13 +99,13 @@
 
   public void restoreState(IMemento memento)
   {
-    String string = memento.getString("path");
+    String string = memento.getString(PATH_TAG);
     path = Path.createPath(string);
   }
 
   public void saveState(IMemento memento)
   {
-    memento.putString("path", path.toString());
+    memento.putString(PATH_TAG, path.toString());
   }
 
   public void update()
@@ -111,6 +116,9 @@
   {
     final static int ELEMENT = 1;
     final static int TYPE = 2;
+    final static int MODEL_GROUP = 3;
+    final static int ATTRIBUTE_GROUP = 4;
+    final static int REDEFINE = 5;
     int kind;
     String name;
 
@@ -126,6 +134,12 @@
   }
   protected static class Path
   {
+    private static final String REDEFINE_TOKEN = "redefine"; //$NON-NLS-1$
+    private static final String MODEL_GROUP_TOKEN = "modelGroup"; //$NON-NLS-1$
+    private static final String ATTRIBUTE_GROUP_TOKEN = "attributeGroup"; //$NON-NLS-1$
+    private static final String TYPE_TOKEN = "type"; //$NON-NLS-1$
+    private static final String ELEMENT_TOKEN = "element"; //$NON-NLS-1$
+
     List segments = new ArrayList();
 
     public static XSDConcreteComponent computeComponent(XSDSchema schema, Path path)
@@ -139,22 +153,34 @@
       return null;
     }
 
-    static Path createPath(String string)
+    static Path createPath(String pathString)
     {
       Path path = new Path();
       PathSegment segment = null;
-      for (StringTokenizer st = new StringTokenizer(string, "/"); st.hasMoreTokens();)
+      for (StringTokenizer st = new StringTokenizer(pathString, "/"); st.hasMoreTokens();)
       {
         String token = st.nextToken();
         int kind = -1;
-        if (token.startsWith("element"))
+        if (token.startsWith(ELEMENT_TOKEN))
         {
           kind = PathSegment.ELEMENT;
         }
-        else if (token.startsWith("type"))
+        else if (token.startsWith(TYPE_TOKEN))
         {
           kind = PathSegment.TYPE;
         }
+        else if (token.startsWith(ATTRIBUTE_GROUP_TOKEN))
+        {
+        	kind = PathSegment.ATTRIBUTE_GROUP;
+        }
+        else if (token.startsWith(MODEL_GROUP_TOKEN))
+        {
+        	kind = PathSegment.MODEL_GROUP;
+        }
+        else if (token.startsWith(REDEFINE_TOKEN))
+        {
+        	kind = PathSegment.REDEFINE;
+        }
         if (kind != -1)
         {
           segment = new PathSegment();
@@ -193,19 +219,35 @@
       return path;
     }
 
-    static PathSegment computePathSegment(XSDConcreteComponent c)
+    static PathSegment computePathSegment(XSDConcreteComponent component)
     {
-      if (c instanceof XSDElementDeclaration)
-      {
-        XSDElementDeclaration ed = (XSDElementDeclaration) c;
-        return new PathSegment(PathSegment.ELEMENT, ed.getResolvedElementDeclaration().getName());
-      }
-      else if (c instanceof XSDTypeDefinition)
-      {
-        XSDTypeDefinition td = (XSDTypeDefinition) c;
-        return new PathSegment(PathSegment.TYPE, td.getName());
-      }
-      return null;
+    	PathSegment pathSegment = null;
+    	if (component instanceof XSDElementDeclaration)
+    	{
+    		XSDElementDeclaration elementDeclaration = (XSDElementDeclaration) component;
+    		pathSegment = new PathSegment(PathSegment.ELEMENT, elementDeclaration.getResolvedElementDeclaration().getName());
+    	}
+    	else if (component instanceof XSDTypeDefinition)
+    	{
+    		XSDTypeDefinition typeDefinition = (XSDTypeDefinition) component;
+    		pathSegment = new PathSegment(PathSegment.TYPE, typeDefinition.getName());
+    	}
+    	else if (component instanceof XSDModelGroupDefinition)
+    	{
+    		XSDModelGroupDefinition modelGroupDefinition = (XSDModelGroupDefinition) component;
+    		pathSegment = new PathSegment(PathSegment.MODEL_GROUP, modelGroupDefinition.getName());
+    	}
+    	else if (component instanceof XSDAttributeGroupDefinition)
+    	{
+    		XSDAttributeGroupDefinition attributeGroupDefinition = (XSDAttributeGroupDefinition) component;
+    		pathSegment = new PathSegment(PathSegment.ATTRIBUTE_GROUP, attributeGroupDefinition.getResolvedAttributeGroupDefinition().getName());
+    	}
+    	else if (component instanceof XSDRedefine)
+    	{
+    		XSDRedefine redefine = (XSDRedefine) component;
+    		pathSegment = new PathSegment(PathSegment.REDEFINE, redefine.getSchemaLocation());
+    	}
+    	return pathSegment;
     }
 
     public String toString()
@@ -217,11 +259,23 @@
         String kind = "";
         if (segment.kind == PathSegment.ELEMENT)
         {
-          kind = "element";
+          kind = ELEMENT_TOKEN;
         }
         else if (segment.kind == PathSegment.TYPE)
         {
-          kind = "type";
+          kind = TYPE_TOKEN;
+        }
+        else if (segment.kind == PathSegment.MODEL_GROUP)
+        {
+        	kind = MODEL_GROUP_TOKEN;
+        }
+        else if (segment.kind == PathSegment.ATTRIBUTE_GROUP)
+        {
+        	kind = ATTRIBUTE_GROUP_TOKEN;
+        }
+        else if (segment.kind == PathSegment.REDEFINE)
+        {
+        	kind = REDEFINE_TOKEN;
         }
         b.append(kind);
         if (segment.name != null)
@@ -275,20 +329,49 @@
       {
         if (segment.kind == PathSegment.ELEMENT)
         {
-          XSDElementDeclaration ed = schema.resolveElementDeclaration(segment.name);
-          if (ed != null)
+          XSDElementDeclaration elementDeclaration = schema.resolveElementDeclaration(segment.name);
+          if (elementDeclaration != null)
           {
-            visitElementDeclaration(ed);
+            visitElementDeclaration(elementDeclaration);
           }
         }
         else if (segment.kind == PathSegment.TYPE)
         {
-          XSDTypeDefinition td = schema.resolveTypeDefinition(segment.name);
-          if (td != null)
+          XSDTypeDefinition typeDefinition = schema.resolveTypeDefinition(segment.name);
+          if (typeDefinition != null)
           {
-            visitTypeDefinition(td);
+            visitTypeDefinition(typeDefinition);
           }
         }
+        else if (segment.kind == PathSegment.MODEL_GROUP)
+        {
+        	XSDModelGroupDefinition modelGroupDefinition = schema.resolveModelGroupDefinition(segment.name);
+        	if (modelGroupDefinition != null)
+        	{
+        		visitModelGroupDefinition(modelGroupDefinition);
+        	}
+        }
+        else if (segment.kind == PathSegment.ATTRIBUTE_GROUP)
+        {
+        	XSDAttributeGroupDefinition attributeGroupDefinition = schema.resolveAttributeGroupDefinition(segment.name);
+        	if (attributeGroupDefinition != null)
+        	{
+        		visitAttributeGroupDefinition(attributeGroupDefinition);
+        	}
+        }
+        else if (segment.kind == PathSegment.REDEFINE)
+        {
+        	Iterator iterator = schema.getContents().iterator();
+        	while (iterator.hasNext())
+        	{
+        		Object object = iterator.next();
+        		if (object instanceof XSDRedefine)
+        		{        			
+        			XSDRedefine redefine = (XSDRedefine)object;
+        			visitRedefine(redefine);
+        		}
+        	}
+        }
       }
     }
 
@@ -325,7 +408,58 @@
         }
       }
     }
+    
+    public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroup)
+    {
+    	if (segment != null)
+    	{
+    		String name = modelGroup.getName();
+    		if (segment.kind == PathSegment.MODEL_GROUP && isMatch(segment.name, name))
+    		{
+    			result = modelGroup;
+    			incrementSegment();
+    			if (!isDone())
+    			{
+    				super.visitModelGroupDefinition(modelGroup);
+    			}
+    		}
+    	}
+    }
 
+    public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
+    {
+    	if (segment != null)
+    	{
+    		String name = attributeGroup.getName();
+    		if (segment.kind == PathSegment.ATTRIBUTE_GROUP && isMatch(segment.name, name))
+    		{
+    			result = attributeGroup;
+    			incrementSegment();
+    			if (!isDone())
+    			{
+    				super.visitAttributeGroupDefinition(attributeGroup);
+    			}
+    		}
+    	}
+    }
+    
+    public void visitRedefine(XSDRedefine redefine)
+    {
+    	if (segment != null)
+    	{
+    		String name = redefine.getSchemaLocation();
+    		if (segment.kind == PathSegment.REDEFINE && isMatch(segment.name, name))
+    		{
+    			result = redefine;
+    			incrementSegment();
+    			if (!isDone())
+    			{
+    				visitSchema(redefine.getSchema());
+    			}
+    		}
+    	}
+    	
+    }
     protected boolean isMatch(String name1, String name2)
     {
       return name1 != null ? name1.equals(name2) : name1 == name2;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/SchemaPrefixChangeHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/SchemaPrefixChangeHandler.java
index f0a5349..3ce74a8 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/SchemaPrefixChangeHandler.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/SchemaPrefixChangeHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -29,11 +29,20 @@
 {
   String newPrefix;
   XSDSchema xsdSchema;
+  String namespace;
 
   public SchemaPrefixChangeHandler(XSDSchema xsdSchema, String newPrefix)
   {
     this.xsdSchema = xsdSchema;
     this.newPrefix= newPrefix;
+    namespace = XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001; 
+  }
+
+  public SchemaPrefixChangeHandler(XSDSchema xsdSchema, String newPrefix, String namespace)
+  {
+    this.xsdSchema = xsdSchema;
+    this.newPrefix= newPrefix;
+    this.namespace = namespace;
   }
   
   public void resolve()
@@ -81,8 +90,7 @@
       {
         String ns = type.getTargetNamespace();
         if (ns == null) ns = "";
-//        if (ns.equals(xsdSchema.getSchemaForSchemaNamespace()))
-        if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))        
+        if (ns.equals(namespace))        
         {
           Element domElement = element.getElement();
           if (domElement != null && domElement instanceof IDOMNode)
@@ -106,8 +114,7 @@
       {
         String ns = baseType.getTargetNamespace();
         if (ns == null) ns = "";
-//        if (ns.equals(xsdSchema.getSchemaForSchemaNamespace()))
-        if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
+        if (ns.equals(namespace))
         {
           XSDDOMHelper domHelper = new XSDDOMHelper();
           Element derivedBy = domHelper.getDerivedByElement(simpleType.getElement());
@@ -127,7 +134,7 @@
       {
         String ns = itemType.getTargetNamespace();
         if (ns == null) ns = "";
-        if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
+        if (ns.equals(namespace))
         {
           XSDDOMHelper domHelper = new XSDDOMHelper();
           Node listNode = domHelper.getChildNode(simpleType.getElement(), XSDConstants.LIST_ELEMENT_TAG);
@@ -162,7 +169,7 @@
               XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)i.next();
               String ns = st.getTargetNamespace();
               if (ns == null) ns = "";
-              if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
+              if (ns.equals(namespace))
               {
                 sb.append(getNewQName(st, st.getName(), newPrefix));                
               }
@@ -189,8 +196,7 @@
       {
         String ns = type.getTargetNamespace();
         if (ns == null) ns = "";
-//        if (ns.equals(xsdSchema.getSchemaForSchemaNamespace()))
-        if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
+        if (ns.equals(namespace))
         {
           Element domElement = attr.getElement();
           if (domElement != null && domElement instanceof IDOMNode)
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/XSDVisitor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/XSDVisitor.java
index cea2e24..115511a 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/XSDVisitor.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/XSDVisitor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -142,9 +142,9 @@
   
   public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
   {
-    if (type.getContentType() != null)
+    XSDComplexTypeContent complexContent = type.getContent();
+    if (complexContent != null)
     {
-      XSDComplexTypeContent complexContent = type.getContentType();
       if (complexContent instanceof XSDSimpleTypeDefinition)
       {
         visitSimpleTypeDefinition((XSDSimpleTypeDefinition)complexContent);
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDEditorPreferencePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDEditorPreferencePage.java
new file mode 100644
index 0000000..e56ffe8
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDEditorPreferencePage.java
@@ -0,0 +1,147 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.preferences;
+
+
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferenceLinkArea;
+import org.eclipse.ui.help.IWorkbenchHelpSystem;
+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
+import org.eclipse.wst.xsd.ui.internal.editor.Messages;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorContextIds;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
+
+
+public class XSDEditorPreferencePage extends AbstractPreferencePage
+{
+  private static final String XML_EDITOR_PREFERENCE_PAGE_ID = "org.eclipse.wst.sse.ui.preferences.xml.source"; //$NON-NLS-1$
+
+  private Button removeUnusedImports;
+
+  private Button automaticallyOpenSchemaLocationDialog;
+
+  protected Control createContents(Composite parent)
+  {
+    final Composite composite = super.createComposite(parent, 1);
+    IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
+    helpSystem.setHelp(parent, XSDEditorContextIds.XSDP_EDITOR_PREFERENCE_PAGE);
+
+    new PreferenceLinkArea(composite, SWT.WRAP | SWT.MULTI, XML_EDITOR_PREFERENCE_PAGE_ID, Messages._UI_XML_TEXT_EDITOR_PREFS_LINK,
+      (IWorkbenchPreferenceContainer)getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).create());
+    new Label(composite, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create());
+
+    createContentsForImportCleanup(composite);
+
+    setSize(composite);
+    loadPreferences();
+
+    return composite;
+  }
+
+  private boolean getRemoveImportSetting()
+  {
+    return removeUnusedImports.getSelection();
+  }
+
+  private boolean getAutomaticallyOpenSchemaLocationDialogSetting()
+  {
+    return automaticallyOpenSchemaLocationDialog.getSelection();
+  }
+
+  protected void initializeValues()
+  {
+    IPreferenceStore store = getPreferenceStore();
+    removeUnusedImports.setSelection(store.getBoolean(XSDEditorPlugin.CONST_XSD_IMPORT_CLEANUP));
+    automaticallyOpenSchemaLocationDialog.setSelection(store.getBoolean(XSDEditorPlugin.CONST_XSD_AUTO_OPEN_SCHEMA_LOCATION_DIALOG));
+  }
+
+  protected void performDefaults()
+  {
+    IPreferenceStore preferenceStore = getPreferenceStore();
+    removeUnusedImports.setSelection(preferenceStore.getDefaultBoolean(XSDEditorPlugin.CONST_XSD_IMPORT_CLEANUP));
+    automaticallyOpenSchemaLocationDialog.setSelection(preferenceStore.getDefaultBoolean(XSDEditorPlugin.CONST_XSD_AUTO_OPEN_SCHEMA_LOCATION_DIALOG));
+    super.performDefaults();
+  }
+
+  protected void storeValues()
+  {
+    saveValuesForImportsCleanup();
+  }
+
+  /**
+   * Stores the values of the controls back to the preference store.
+   */
+  private void saveValuesForImportsCleanup()
+  {
+    IPreferenceStore store = getPreferenceStore();
+
+    store.setValue(XSDEditorPlugin.CONST_XSD_IMPORT_CLEANUP, getRemoveImportSetting());
+    store.setValue(XSDEditorPlugin.CONST_XSD_AUTO_OPEN_SCHEMA_LOCATION_DIALOG, getAutomaticallyOpenSchemaLocationDialogSetting());
+  }
+
+  /** 
+   * The indent is stored in the preference store associated with the XML Schema Model
+   */
+  public IPreferenceStore getPreferenceStore()
+  {
+    return XSDEditorPlugin.getPlugin().getPreferenceStore();
+  }
+
+  private void createContentsForImportCleanup(Composite parent)
+  {
+    Group unusedImportGroup = createGroup(parent, 1);
+    unusedImportGroup.setText(Messages._UI_GRAPH_DIRECTIVES);
+
+    //GridData
+    GridData data = new GridData(SWT.FILL);
+    data.verticalAlignment = SWT.CENTER;
+    data.horizontalAlignment = SWT.FILL;
+
+    if (removeUnusedImports == null)
+    {
+      removeUnusedImports = new Button(unusedImportGroup, SWT.CHECK | SWT.LEFT);
+      removeUnusedImports.setText(Messages._UI_TEXT_ENABLE_AUTO_IMPORT_CLEANUP);
+      removeUnusedImports.setLayoutData(data);
+
+      PlatformUI.getWorkbench().getHelpSystem().setHelp(removeUnusedImports, XSDEditorCSHelpIds.XMLSCHEMAFILES_PREFERENCES__IMPORT_CLEANUP);
+
+      automaticallyOpenSchemaLocationDialog = new Button(unusedImportGroup, SWT.CHECK | SWT.LEFT);
+      automaticallyOpenSchemaLocationDialog.setText(Messages._UI_TEXT_ENABLE_AUTO_OPEN_SCHEMA_DIALOG);
+      automaticallyOpenSchemaLocationDialog.setLayoutData(GridDataFactory.copyData(data));
+    }
+  }
+
+  protected void doSavePreferenceStore()
+  {
+    XSDEditorPlugin.getDefault().savePluginPreferences(); // model
+  }
+
+  public boolean performOk()
+  {
+    boolean result = super.performOk();
+
+    doSavePreferenceStore();
+
+    return result;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDPreferencePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDPreferencePage.java
index cd2c5cc..b378410 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDPreferencePage.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDPreferencePage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,7 +11,6 @@
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.preferences;
 
-import org.eclipse.jface.layout.GridDataFactory;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.swt.SWT;
@@ -30,11 +29,7 @@
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PreferenceLinkArea;
 import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
-import org.eclipse.wst.xsd.core.internal.XSDCorePlugin;
-import org.eclipse.wst.xsd.core.internal.preferences.XSDCorePreferenceNames;
 import org.eclipse.wst.xsd.ui.internal.editor.Messages;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorContextIds;
@@ -48,8 +43,6 @@
   Text schemaNsPrefixField;
   Text defaultTargetNamespaceText;
   Button qualifyXSDLanguage;
-  private Button honourAllSchemaLocations = null;
-  private Button fullSchemaConformance = null;
 
   /**
    * Creates preference page controls on demand.
@@ -59,10 +52,6 @@
   {
     WorkbenchHelp.setHelp(parent, XSDEditorContextIds.XSDP_PREFERENCE_PAGE);
 
-	new PreferenceLinkArea(parent, SWT.WRAP | SWT.MULTI, "org.eclipse.wst.sse.ui.preferences.editor", Messages._UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK,//$NON-NLS-1$
-				(IWorkbenchPreferenceContainer) getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).create());
-	new Label(parent, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create());
-
     Group group = createGroup(parent, 2);   
     group.setText(Messages._UI_TEXT_XSD_NAMESPACE_PREFIX);
 
@@ -89,8 +78,6 @@
     		XSDEditorCSHelpIds.XMLSCHEMAFILES_PREFERENCES__DEFAULT_TARGETNAMESPACE); 
     
     
-    createContentsForValidatingGroup(parent);
-
     initializeValues();
 
     applyDialogFont(parent);
@@ -140,35 +127,6 @@
     return label;
   }
   
-  protected void createContentsForValidatingGroup(Composite parent) 
-  {
-	Group validatingGroup = createGroup(parent, 1);
-	validatingGroup.setText(Messages._UI_VALIDATING_FILES);
-
-	//GridData
-	GridData data = new GridData(SWT.FILL);
-	data.verticalAlignment = SWT.CENTER;
-	data.horizontalAlignment = SWT.FILL;
-
-	if (honourAllSchemaLocations == null) 
-	{
-		honourAllSchemaLocations = new Button(validatingGroup, SWT.CHECK | SWT.LEFT);
-		honourAllSchemaLocations.setText(Messages._UI_TEXT_HONOUR_ALL_SCHEMA_LOCATIONS);
-		honourAllSchemaLocations.setLayoutData(data);
-		
-	    PlatformUI.getWorkbench().getHelpSystem().setHelp(honourAllSchemaLocations,
-	    		XSDEditorCSHelpIds.XMLSCHEMAFILES_PREFERENCES__HONOUR_ALL_SCHEMA_LOCATIONS); 
-
-	}
-	if (fullSchemaConformance == null) 
-	{
-		fullSchemaConformance = new Button(validatingGroup, SWT.CHECK | SWT.LEFT);
-		fullSchemaConformance.setLayoutData(GridDataFactory.copyData(data));
-		fullSchemaConformance.setText(Messages._UI_FULL_CONFORMANCE);
-	}
-
-  }
-  
   /**
    * Does anything necessary because the default button has been pressed.
    */
@@ -233,8 +191,6 @@
     schemaNsPrefixField.setText(getPreferenceStore().getDefaultString(XSDEditorPlugin.CONST_XSD_DEFAULT_PREFIX_TEXT));
     qualifyXSDLanguage.setSelection(getPreferenceStore().getDefaultBoolean(XSDEditorPlugin.CONST_XSD_LANGUAGE_QUALIFY));
     defaultTargetNamespaceText.setText(getPreferenceStore().getString(XSDEditorPlugin.CONST_DEFAULT_TARGET_NAMESPACE));
-    honourAllSchemaLocations.setSelection(XSDCorePlugin.getDefault().getPluginPreferences().getDefaultBoolean(XSDCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS));
-    fullSchemaConformance.setSelection(XSDCorePlugin.getDefault().getPluginPreferences().getDefaultBoolean(XSDCorePreferenceNames.FULL_SCHEMA_CONFORMANCE));
   }
 
   /**
@@ -246,8 +202,6 @@
     schemaNsPrefixField.setText(store.getString(XSDEditorPlugin.CONST_XSD_DEFAULT_PREFIX_TEXT));
     qualifyXSDLanguage.setSelection(store.getBoolean(XSDEditorPlugin.CONST_XSD_LANGUAGE_QUALIFY));
     defaultTargetNamespaceText.setText(store.getString(XSDEditorPlugin.CONST_DEFAULT_TARGET_NAMESPACE));
-    honourAllSchemaLocations.setSelection(XSDCorePlugin.getDefault().getPluginPreferences().getBoolean(XSDCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS));
-    fullSchemaConformance.setSelection(XSDCorePlugin.getDefault().getPluginPreferences().getBoolean(XSDCorePreferenceNames.FULL_SCHEMA_CONFORMANCE));
   }
 
   /**
@@ -260,13 +214,8 @@
     store.setValue(XSDEditorPlugin.CONST_XSD_DEFAULT_PREFIX_TEXT, getXMLSchemaPrefix());
     store.setValue(XSDEditorPlugin.CONST_XSD_LANGUAGE_QUALIFY, getQualify());
     store.setValue(XSDEditorPlugin.CONST_DEFAULT_TARGET_NAMESPACE, getXMLSchemaTargetNamespace());
-
+      
     XSDEditorPlugin.getPlugin().savePluginPreferences();
-    
-    XSDCorePlugin.getDefault().getPluginPreferences().setValue(XSDCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS, honourAllSchemaLocations.getSelection());
-    XSDCorePlugin.getDefault().getPluginPreferences().setValue(XSDCorePreferenceNames.FULL_SCHEMA_CONFORMANCE, fullSchemaConformance.getSelection());
-    
-    XSDCorePlugin.getDefault().savePluginPreferences();
   }
 
   public String getXMLSchemaPrefix()
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDValidatorPreferencePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDValidatorPreferencePage.java
new file mode 100644
index 0000000..957ae11
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDValidatorPreferencePage.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.preferences;
+
+
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferenceLinkArea;
+import org.eclipse.ui.help.IWorkbenchHelpSystem;
+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
+import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
+import org.eclipse.wst.xsd.core.internal.XSDCorePlugin;
+import org.eclipse.wst.xsd.core.internal.preferences.XSDCorePreferenceNames;
+import org.eclipse.wst.xsd.ui.internal.editor.Messages;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorContextIds;
+
+
+public class XSDValidatorPreferencePage extends AbstractPreferencePage
+{
+  private static final String XML_VALIDATOR_PREFERENCE_PAGE_ID = "org.eclipse.wst.sse.ui.preferences.xml.validation"; //$NON-NLS-1$
+
+  private Button fullSchemaConformance = null;
+
+  protected Control createContents(Composite parent)
+  {
+    final Composite composite = super.createComposite(parent, 1);
+    IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
+
+    helpSystem.setHelp(parent, XSDEditorContextIds.XSDP_VALIDATOR_PREFERENCE_PAGE);
+
+    new PreferenceLinkArea(composite, SWT.WRAP | SWT.MULTI, XML_VALIDATOR_PREFERENCE_PAGE_ID, Messages._UI_XML_VALIDATOR_PREFS_LINK,
+      (IWorkbenchPreferenceContainer)getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).create());
+    new Label(composite, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create());
+
+    createContentsForValidatingGroup(composite);
+
+    setSize(composite);
+    loadPreferences();
+
+    return composite;
+  }
+
+  private void createContentsForValidatingGroup(Composite parent)
+  {
+    Group validatingGroup = createGroup(parent, 1);
+    validatingGroup.setText(Messages._UI_VALIDATING_FILES);
+
+    GridData data = new GridData(SWT.FILL);
+    data.verticalAlignment = SWT.CENTER;
+    data.horizontalAlignment = SWT.FILL;
+
+    if (fullSchemaConformance == null)
+    {
+      fullSchemaConformance = new Button(validatingGroup, SWT.CHECK | SWT.LEFT);
+      fullSchemaConformance.setLayoutData(GridDataFactory.copyData(data));
+      fullSchemaConformance.setText(Messages._UI_FULL_CONFORMANCE);
+    }
+  }
+
+  protected void performDefaults()
+  {
+    fullSchemaConformance.setSelection(getModelPreferences().getDefaultBoolean(XSDCorePreferenceNames.FULL_SCHEMA_CONFORMANCE));
+    super.performDefaults();
+  }
+
+  protected void initializeValues()
+  {
+    initializeValuesForValidatingGroup();
+    super.initializeValues();
+  }
+
+  protected void initializeValuesForValidatingGroup()
+  {
+    fullSchemaConformance.setSelection(getModelPreferences().getBoolean(XSDCorePreferenceNames.FULL_SCHEMA_CONFORMANCE));
+  }
+
+  protected Preferences getModelPreferences()
+  {
+    return XSDCorePlugin.getDefault().getPluginPreferences();
+  }
+
+  protected void storeValuesForValidatingGroup()
+  {
+    if (fullSchemaConformance != null)
+    {
+      boolean fullSchemaConformanceSelected = fullSchemaConformance.getSelection();
+      getModelPreferences().setValue(XSDCorePreferenceNames.FULL_SCHEMA_CONFORMANCE, fullSchemaConformanceSelected);
+    }
+  }
+
+  protected void storeValues()
+  {
+    storeValuesForValidatingGroup();
+  }
+
+  protected void doSavePreferenceStore()
+  {
+    XSDCorePlugin.getDefault().savePluginPreferences(); // model
+  }
+
+  public boolean performOk()
+  {
+    boolean result = super.performOk();
+
+    doSavePreferenceStore();
+
+    return result;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java
index 5979978..3b250a2 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  * 
  * Contributors:
  *     IBM Corporation - Initial API and implementation
+ *     Jesper Steen Moller - broader recognition of URIs
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.text;
 
@@ -22,6 +23,7 @@
 import org.eclipse.ui.progress.IProgressService;
 import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
 import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.eclipse.wst.xsd.ui.internal.util.ModelReconcileAdapter;
 import org.eclipse.wst.xsd.ui.internal.util.XSDSchemaLocationResolverAdapterFactory;
@@ -50,7 +52,16 @@
   
   public void clear()
   {
-    schema = null;
+	if (schema != null) {
+		Document doc = schema.getDocument();
+		if (doc instanceof IDOMDocument) {
+			IDOMDocument domDocument = (IDOMDocument)doc;
+			domDocument.getModel().removeModelStateListener(getModelReconcileAdapter());
+			domDocument.removeAdapter(getModelReconcileAdapter());
+			domDocument.removeAdapter(this);		
+		}
+	    schema = null;
+	}
     resourceSet = null;
   }
 
@@ -83,19 +94,8 @@
 
       // TODO... gotta pester SSE folks to provide 'useful' baseLocations
       // 
-      URI uri = null;
-      if (baseLocation.startsWith("/"))
-      {
-        uri = URI.createPlatformResourceURI(baseLocation);
-      }
-      else if (baseLocation.startsWith("http"))
-      {
-        uri = URI.createURI(baseLocation);
-      }
-      else
-      {
-        uri = URI.createFileURI(baseLocation);
-      }  
+      URI uri = getURI(baseLocation);
+
       Resource resource = new XSDResourceImpl();
       resource.setURI(uri);
       schema = XSDFactory.eINSTANCE.createXSDSchema(); 
@@ -162,7 +162,31 @@
   {     
     return createSchema(element.getOwnerDocument());
   }
-  
+
+  public XSDSchema resetSchema(Document document)
+  {
+    // The document has changed so the schema should be updated as well.
+    try
+    {
+      IDOMNode domNode = (IDOMNode)document;
+      schema.setDocument(document);
+      schema.setElement(document.getDocumentElement());
+
+      resourceSet = schema.eResource().getResourceSet();
+      
+      String baseLocation = domNode.getModel().getBaseLocation();           
+      URI uri = getURI(baseLocation);
+      schema.eResource().setURI(uri);
+
+      modelReconcileAdapter = new XSDModelReconcileAdapter(document, schema);
+      domNode.getModel().addModelStateListener(modelReconcileAdapter);
+    }
+    catch (Exception ex)
+    {
+    }
+    return schema;
+  }  
+
   public static XSDModelAdapter lookupOrCreateModelAdapter(Document document)
   {
     XSDModelAdapter adapter = null;
@@ -173,13 +197,12 @@
       if (adapter == null)
       {
         adapter = new XSDModelAdapter();
-        notifier.addAdapter(adapter);        
+        notifier.addAdapter(adapter);
       } 
     }   
     return adapter;
   }
   
-  
   public static XSDSchema lookupOrCreateSchema(final Document document)
   {    
     XSDSchema result = null;    
@@ -191,7 +214,27 @@
     }   
     result = adapter.getSchema();    
     return result;    
-  }  
+  }
+  
+  private URI getURI(String baseLocation)
+  {
+    URI uri = null;
+    if (baseLocation.startsWith("/")) //$NON-NLS-1$
+    {
+      uri = URI.createPlatformResourceURI(baseLocation);
+    }
+    else if (baseLocation.indexOf(':') > 1)
+    {
+      // Looks like an URL
+      uri = URI.createURI(baseLocation);
+    }
+    else
+    {
+      // Supposedly a file, then
+      uri = URI.createFileURI(baseLocation);
+    }
+    return uri;
+  }
 }
 
 
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelDelayedReconciler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelDelayedReconciler.java
new file mode 100644
index 0000000..02b7b6d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelDelayedReconciler.java
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.text;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.progress.UIJob;
+import org.eclipse.wst.xsd.ui.internal.editor.InternalXSDMultiPageEditor;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.w3c.dom.Element;
+
+
+/**
+ * Provides  delayed reconciliation between the SSE DOM and the XSD EMF model. 
+ * Changes in the DOM are queued and processed by a UI job. When a new request 
+ * comes in, the current run is cancelled, the new request is added to the queue, 
+ * then the job is re-scheduled.
+ */
+public class XSDModelDelayedReconciler
+{
+  /**
+   * The model reconciler job.
+   */
+  private ReconcilerJob reconcilerJob;
+
+  /**
+   * The time in milliseconds to delay updating the EMF model.
+   */
+  private static final int DELAY = 300;
+
+  /**
+   * The elements to reconcile.
+   */
+  private List elementsToReconcile = new ArrayList();
+
+  /**
+   * Determines if the delayed reconciler should kick in.
+   */
+  public boolean shouldDelay(XSDSchema schema)
+  {
+    boolean shouldDelay = false;
+
+    // The delayed reconciler should not be used when the editor is in graphical editing mode.
+
+    IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+    IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
+    IEditorPart editorPart = workbenchPage != null ? workbenchPage.getActiveEditor() : null;
+    if (editorPart != null && editorPart instanceof InternalXSDMultiPageEditor)
+    {
+      InternalXSDMultiPageEditor xsdEditor = (InternalXSDMultiPageEditor)editorPart;
+      shouldDelay = xsdEditor.isSourcePageActive();
+    }
+
+    return shouldDelay;
+  }
+
+  /**
+   * Updates the XSD EMF component corresponding to the DOM element.
+   * 
+   * @param element the changed element.
+   * @param schema the containing schema.
+   */
+  public void elementChanged(Element element, XSDSchema schema)
+  {
+    synchronized (elementsToReconcile)
+    {
+      // The number of elements should be small so a linear search should be fine.
+
+      if (!elementsToReconcile.contains(element))
+      {
+        elementsToReconcile.add(element);
+      }
+
+      if (reconcilerJob == null)
+      {
+        reconcilerJob = new ReconcilerJob(schema);
+      }
+      
+      reconcilerJob.schedule(DELAY);
+    }
+  }
+
+  /**
+   * A UI job used to reconcile the XSD EMF model with the associated SSE DOM.
+   */
+  class ReconcilerJob extends UIJob
+  {
+    /**
+     * The target schema.
+     */
+    private XSDSchema schema;
+
+    /**
+     * The number of times allowed to wake up and do nothing.
+     */
+    private static final int MAX_INACTIVE_COUNT = 10;
+
+    /**
+     * The job will terminate once this counter reaches MAX_INACTIVE_COUNT. 
+     */
+    private int timesAwakeAndIdle = 0;
+
+    /**
+     * Constructs the reconciler job and configures some of its properties.
+     */
+    public ReconcilerJob(XSDSchema schema)
+    {
+      super("Reconciling the XSD EMF model"); //$NON-NLS-1$
+      setSystem(true);
+      setPriority(Job.LONG);
+      this.schema = schema;
+    }
+
+    public IStatus runInUIThread(IProgressMonitor monitor)
+    {
+      if (monitor.isCanceled())
+      {
+        return Status.CANCEL_STATUS;
+      }
+
+      Element[] elements = null;
+      
+      synchronized (elementsToReconcile)
+      {
+        if (!elementsToReconcile.isEmpty())
+        {
+          elements = new Element[elementsToReconcile.size()];
+          elementsToReconcile.toArray(elements);
+          elementsToReconcile.clear();
+        }
+        else
+        {
+          if (shouldTerminate())
+          {
+            reconcilerJob = null;
+            return Status.CANCEL_STATUS;
+          }
+        }
+      }
+
+      reconcile(elements);
+
+      schedule(DELAY);
+
+      return Status.OK_STATUS;
+    }
+
+    private void reconcile(Element[] modifiedElements)
+    {
+      if (modifiedElements != null)
+      {
+        for (int index = 0; index < modifiedElements.length; index++)
+        {
+          Element modifiedElement = modifiedElements[index];
+
+          reconcile(modifiedElement);
+        }
+      }
+    }
+
+    private void reconcile(Element modifiedElement)
+    {
+      if (modifiedElement != null)
+      {
+        XSDConcreteComponent concreteComponent = schema.getCorrespondingComponent(modifiedElement);
+        concreteComponent.elementChanged(modifiedElement);
+      }
+    }
+    
+    private boolean shouldTerminate()
+    {
+      return timesAwakeAndIdle++ == MAX_INACTIVE_COUNT;
+    }
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java
index 5c114d7..c111aad 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -46,32 +46,9 @@
         list.addAll(getTypesHelper(e).getUserComplexTypeNamesList());
       }
     }
-    else if (checkName(name, "blockDefault") || checkName(name, "finalDefault"))
-    {
-      list.add("#all");
-      list.add("substitution");
-      list.add("extension");
-      list.add("restriction");
-    }
-    else if (checkName(name, "namespace"))
-    {
-      if (checkName(currentElementName, "any") || checkName(currentElementName, "anyAttribute"))
-      {
-        list.add("##any");
-        list.add("##other");
-        list.add("##targetNamespace");
-        list.add("##local");
-      }
-    }
-    else if (checkName(name, "maxOccurs"))
-    {
-      list.add("1");
-      list.add("unbounded");
-    }
     else if (checkName(name, "minOccurs"))
     {
       list.add("0");
-      list.add("1");
     }
     else if (checkName(name, "itemType"))
     {
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelReconcileAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelReconcileAdapter.java
index 80a6db5..44b0626 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelReconcileAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelReconcileAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -24,11 +24,13 @@
 public class XSDModelReconcileAdapter extends ModelReconcileAdapter
 {
   protected XSDSchema schema;
+  protected XSDModelDelayedReconciler delayedReconciler;
   
   public XSDModelReconcileAdapter(Document document, XSDSchema schema)
   {
     super(document);
     this.schema = schema;
+    this.delayedReconciler = new XSDModelDelayedReconciler();
   }
   
   protected void handleNodeChanged(Node node)
@@ -50,9 +52,17 @@
 
     if (node instanceof Element)
     {  
-      XSDConcreteComponent concreteComponent = schema.getCorrespondingComponent(node);    
-      concreteComponent.elementChanged((Element)node);
-    }
+		Element element = (Element) node;
+		if (delayedReconciler.shouldDelay(schema))
+		{
+			delayedReconciler.elementChanged(element, schema);
+		}
+		else
+		{
+	        XSDConcreteComponent concreteComponent = schema.getCorrespondingComponent(node);
+			concreteComponent.elementChanged(element);
+		}
+	}
     else if (node instanceof Document)
     {
       // The document changed so we may need to fix up the 
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java
index 41bf0cb..cb8c84c 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -170,6 +170,27 @@
     }
     return null;
   }
+  
+  
+  public Element getDerivedByElementFromSimpleType(Element element)
+  {
+    Node atomic = getChildNode(element, "restriction");
+    Node list = getChildNode(element, "list");
+    Node union = getChildNode(element, "union");
+    if (atomic instanceof Element)
+	  {
+	    return (Element)atomic;
+	  }
+    if (list instanceof Element)
+	  {
+	    return (Element)list;
+	  }
+    if (union instanceof Element)
+	  {
+	    return (Element)union;
+	  }
+    return null;
+  }
 
   /**
    * Get the derived by node given the ComplexType node
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/XSDEditSchemaInfoDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/XSDEditSchemaInfoDialog.java
index a886ba7..abd0167 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/XSDEditSchemaInfoDialog.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/XSDEditSchemaInfoDialog.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -21,48 +21,26 @@
 import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
 import org.eclipse.wst.xml.ui.internal.dialogs.EditSchemaInfoDialog;
 import org.eclipse.wst.xml.ui.internal.nsedit.CommonEditNamespacesTargetFieldDialog;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ProductCustomizationProvider;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.xsd.XSDForm;
 
 public class XSDEditSchemaInfoDialog extends EditSchemaInfoDialog implements SelectionListener {
 	String targetNamespace;
 	CommonEditNamespacesTargetFieldDialog editNamespacesControl;
+  /**
+   * @deprecated - These have been moved to the Advanced Properties Tab 
+   */
   Combo elementFormCombo, attributeFormCombo;
+  /**
+   * @deprecated 
+   */
   String elementFormQualified = "", attributeFormQualified = ""; //$NON-NLS-1$ //$NON-NLS-2$
   
-  private String [] formQualification = { "", XSDForm.QUALIFIED_LITERAL.getLiteral(), XSDForm.UNQUALIFIED_LITERAL.getLiteral() };  //$NON-NLS-1$
-	
 	public XSDEditSchemaInfoDialog(Shell parentShell, IPath resourceLocation, String targetNamespace) {
 		super(parentShell, resourceLocation);
 		this.targetNamespace = targetNamespace;
 	}
-/*
-	// in super
-	protected CommonEditNamespacesDialog createCommonEditNamespacesDialog(Composite dialogArea)
-	{
-	  return new CommonEditNamespacesDialog(dialogArea, resourceLocation, XMLUIPlugin.getResourceString("%_UI_NAMESPACE_DECLARATIONS"), false, true); //$NON-NLS-1$				
-	}
-	
-	// in super
-	protected Control createDialogArea(Composite parent) {
-		Composite dialogArea = (Composite) super.createDialogArea(parent);
-		CommonEditNamespacesDialog editNamespacesControl = createCommonEditNamespacesDialog(dialogArea); 
-		editNamespacesControl.setNamespaceInfoList(namespaceInfoList);
-		editNamespacesControl.updateErrorMessage(namespaceInfoList);
-		return dialogArea;
-	}
-	
-	// in this
-	protected CommonEditNamespacesDialog createCommonEditNamespacesDialog(Composite dialogArea)
-	{
-	  return new CommonEditNamespacesTargetFieldDialog(dialogArea, resourceLocation); //$NON-NLS-1$				
-	}	*/
 	
 	// this is copy of ....
     protected Control __internalCreateDialogArea(Composite parent) {
@@ -87,46 +65,7 @@
 		}
 		editNamespacesControl.setNamespaceInfoList(namespaceInfoList);
 		editNamespacesControl.updateErrorMessage(namespaceInfoList);
-    
-    Label separator = new Label(dialogArea, SWT.SEPARATOR | SWT.HORIZONTAL);
-    GridData gd = new GridData(GridData.FILL_BOTH);
-    separator.setLayoutData(gd);
-    
-    Composite otherAttributesComposite = new Composite(dialogArea, SWT.NONE);
-    GridLayout layout = new GridLayout(2, false);
-    otherAttributesComposite.setLayout(layout);
-    GridData data = new GridData();
-    data.grabExcessHorizontalSpace = true;
-    data.horizontalAlignment = SWT.FILL;
-    otherAttributesComposite.setLayoutData(data);
-    
-    Label elementFormLabel = new Label(otherAttributesComposite, SWT.LEFT);
-    elementFormLabel.setText(Messages._UI_LABEL_ELEMENTFORMDEFAULT);
-    
-    Object object = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getAdapter(ProductCustomizationProvider.class);
-    if (object instanceof ProductCustomizationProvider)
-    {
-      ProductCustomizationProvider productCustomizationProvider = (ProductCustomizationProvider)object;
-      String newString = productCustomizationProvider.getProductString("LABEL_ELEMENT_FORM_DEFAULT");
-      if (newString != null)
-      {
-        elementFormLabel.setText(newString);
-      }
-    }
 
-    
-    elementFormCombo = new Combo(otherAttributesComposite, SWT.NONE);
-    elementFormCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-    elementFormCombo.setItems(formQualification);
-    elementFormCombo.addSelectionListener(this);
-    
-    Label attributeFormLabel = new Label(otherAttributesComposite, SWT.LEFT);
-    attributeFormLabel.setText(Messages._UI_LABEL_ATTRIBUTEFORMDEFAULT);
-    
-    attributeFormCombo = new Combo(otherAttributesComposite, SWT.NONE);
-    attributeFormCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-    attributeFormCombo.setItems(formQualification);
-    attributeFormCombo.addSelectionListener(this);
     applyDialogFont(parent);
 		return dialogArea;
 	}	
@@ -135,33 +74,51 @@
 		return editNamespacesControl.getTargetNamespace();
 	}
   
+  /**
+   * @deprecated 
+   */
   public void setIsElementQualified(String state)
   {
     elementFormCombo.setText(state);
     elementFormQualified = state;
   }
   
+  /**
+   * @deprecated 
+   */
   public void setIsAttributeQualified(String state)
   {
     attributeFormCombo.setText(state);
     attributeFormQualified = state;
   }
   
+  /**
+   * @deprecated 
+   */
   public String getElementFormQualified()
   {
     return elementFormQualified;
   }
   
+  /**
+   * @deprecated 
+   */
   public String getAttributeFormQualified()
   {
     return attributeFormQualified;
   }
   
+  /**
+   * @deprecated 
+   */
   public void widgetDefaultSelected(SelectionEvent e)
   {
    
   }
   
+  /**
+   * @deprecated 
+   */
   public void widgetSelected(SelectionEvent e)
   {
     if (e.widget == attributeFormCombo)
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexTestingPage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexTestingPage.java
index 0e74698..488c6ea 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexTestingPage.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexTestingPage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,6 +14,7 @@
 import java.util.regex.Pattern;
 
 import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.osgi.util.TextProcessor;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.StyledText;
 import org.eclipse.swt.graphics.FontData;
@@ -116,13 +117,9 @@
   {
     super.setVisible(visible);
 
-    String pattern = getPatternValue();
     getFlags();
-
-    value.setText(pattern);
-    
+    value.setText(TextProcessor.process(getPatternValue()));
     updateMatchStatus();
-
     testString.setFocus();
   }
 
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/BaseSelectionAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/BaseSelectionAction.java
index 28f6f71..e52ea3a 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/BaseSelectionAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/BaseSelectionAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -22,6 +22,7 @@
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
 
@@ -75,6 +76,10 @@
       {
         return !((IField)o).isReadOnly();
       }
+      else if (o instanceof IGraphElement)
+      {
+    	return !((IGraphElement)o).isReadOnly();
+      }
     }
     return true;
   }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/CaptureScreenAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/CaptureScreenAction.java
index 264c2a7..c0d0430 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/CaptureScreenAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/CaptureScreenAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,15 +11,19 @@
 package org.eclipse.wst.xsd.ui.internal.adt.actions;
 
 import java.io.File;
+import java.util.Iterator;
+import java.util.List;
 
 import org.eclipse.core.runtime.Assert;
 import org.eclipse.draw2d.Graphics;
 import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.LayoutManager;
 import org.eclipse.draw2d.SWTGraphics;
 import org.eclipse.draw2d.geometry.Point;
 import org.eclipse.draw2d.geometry.Rectangle;
 import org.eclipse.gef.GraphicalViewer;
 import org.eclipse.gef.LayerConstants;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
 import org.eclipse.gef.editparts.LayerManager;
 import org.eclipse.gef.editparts.ScalableRootEditPart;
 import org.eclipse.jface.action.Action;
@@ -34,6 +38,7 @@
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
+import org.eclipse.wst.xsd.ui.internal.design.layouts.FillLayout;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
 
 public class CaptureScreenAction extends Action
@@ -60,16 +65,16 @@
 
   public class ImageExporter
   {
-    private static final String FILE_FORMATS = "*.jpg;*.jpeg;*.bmp;*.tif";
-	private static final String FILE_SEPARATOR = "file.separator";
+    private static final String FILE_FORMATS = "*.jpeg;*.jfif;*.jpg;*.jpe;*.png;*.bmp;*.ico"; //$NON-NLS-1$
+  	private static final String FILE_SEPARATOR = "file.separator"; //$NON-NLS-1$
 
-	public boolean save(IEditorPart editorPart, GraphicalViewer viewer, String saveFilePath, int format)
+	  public boolean save(IEditorPart editorPart, GraphicalViewer viewer, String saveFilePath, int format)
     {
       Assert.isNotNull(editorPart, "null editorPart passed to ImageExporter.save"); //$NON-NLS-1$
       Assert.isNotNull(viewer, "null viewer passed to ImageExporter.save"); //$NON-NLS-1$
       Assert.isNotNull(saveFilePath, "null saveFilePath passed to ImageExporter.save"); //$NON-NLS-1$
 
-      if (format != SWT.IMAGE_BMP && format != SWT.IMAGE_JPEG && format != SWT.IMAGE_ICO)
+      if (format != SWT.IMAGE_BMP && format != SWT.IMAGE_JPEG && format != SWT.IMAGE_ICO && format != SWT.IMAGE_PNG)
         throw new IllegalArgumentException(Messages._UI_ACTION_CAPTURE_SCREEN_FORMAT_NOT_SUPPORTED);
 
       try
@@ -103,19 +108,24 @@
         }
       }
 
-      int format = SWT.IMAGE_JPEG;
-      if (saveFilePath.endsWith(".bmp")) //$NON-NLS-1$
+      int format = -1;
+      String saveFilePathLowerCase = saveFilePath.toLowerCase(); 
+      if (saveFilePathLowerCase.endsWith(".jpeg") || saveFilePathLowerCase.endsWith(".jpg") || saveFilePathLowerCase.endsWith(".jpe") || saveFilePathLowerCase.endsWith(".jfif")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+    	format = SWT.IMAGE_JPEG;
+      else if (saveFilePathLowerCase.endsWith(".bmp")) //$NON-NLS-1$
         format = SWT.IMAGE_BMP;
-      else if (saveFilePath.endsWith(".ico")) //$NON-NLS-1$
+      else if (saveFilePathLowerCase.endsWith(".ico")) //$NON-NLS-1$
         format = SWT.IMAGE_ICO;
-      else if (saveFilePath.endsWith(".png")) //$NON-NLS-1$
+      else if (saveFilePathLowerCase.endsWith(".png")) //$NON-NLS-1$
         format = SWT.IMAGE_PNG;
-      else if (saveFilePath.endsWith(".gif")) //$NON-NLS-1$
+      else if (saveFilePathLowerCase.endsWith(".gif")) //$NON-NLS-1$
         format = SWT.IMAGE_GIF;
-      else if (saveFilePath.endsWith(".tiff")) //$NON-NLS-1$
-        format = SWT.IMAGE_TIFF;
 
-      return save(editorPart, viewer, saveFilePath, format);
+      if(format != -1) {
+    	  return save(editorPart, viewer, saveFilePath, format);
+      } else {
+    	  return false;
+      }
 
     }
 
@@ -145,7 +155,7 @@
 	      else
 	      {
 		      LAST_SCREEN_CAPTURE_FILE_NAME = fileName;
-		      LAST_SCREEN_CAPTURE_FILE_EXTENSION = "";
+		      LAST_SCREEN_CAPTURE_FILE_EXTENSION = ""; //$NON-NLS-1$
 	      }
       }
       return filePath;
@@ -165,7 +175,26 @@
        */
       ScalableRootEditPart rootEditPart = (ScalableRootEditPart) viewer.getEditPartRegistry().get(LayerManager.ID);
       IFigure rootFigure = ((LayerManager) rootEditPart).getLayer(LayerConstants.PRINTABLE_LAYERS);// rootEditPart.getFigure();
+    
       Rectangle rootFigureBounds = new Rectangle(new Point(0,0),rootFigure.getPreferredSize());
+      List rootEditPartChildren = rootEditPart.getChildren();
+      Iterator rootEditPartChildrenIterator = rootEditPartChildren.iterator();
+      while(rootEditPartChildrenIterator.hasNext()) {
+    	  Object object = rootEditPartChildrenIterator.next();
+    	  if(object instanceof AbstractGraphicalEditPart) {
+    		  AbstractGraphicalEditPart childAbstractGraphicalEditPart = (AbstractGraphicalEditPart)object;
+    		  List grandChildren = childAbstractGraphicalEditPart.getChildren();
+    		  Iterator grandChildrenIterator = grandChildren.iterator();
+    		  while(grandChildrenIterator.hasNext()) {
+    			  AbstractGraphicalEditPart grandChildAbstractGraphicalEditPart = (AbstractGraphicalEditPart)grandChildrenIterator.next();
+    			  IFigure figure = grandChildAbstractGraphicalEditPart.getFigure();
+    			  LayoutManager layoutManager = figure.getLayoutManager();
+    			  if(layoutManager instanceof FillLayout) {
+    				  rootFigureBounds = rootFigure.getBounds();
+    			  }
+    		  }
+    	  }
+      }
 
       /*
        * 2. Now we want to get the GC associated with the control on which all
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DeleteAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DeleteAction.java
index ef7c8c3..9a634c1 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DeleteAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DeleteAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -21,12 +21,12 @@
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
 import org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewGraphicalViewer;
+import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
 import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
+import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
 
 public class DeleteAction extends BaseSelectionAction
@@ -46,32 +46,37 @@
     {
       Object selection = i.next();
       Command command = null;
-      boolean doReselect = false;
+      boolean doSetInput = false;
+      boolean doSetModelAsInput = false;
+      IADTObject topLevelContainer = null;
       IModel model = null;
-      if (selection instanceof IComplexType)
+      
+      if (selection instanceof IGraphElement)
       {
-        command = ((IComplexType)selection).getDeleteCommand();
-        model = ((IComplexType)selection).getModel();
-        doReselect = !((IComplexType)selection).isAnonymous();
-      }
-      else if (selection instanceof IField)
-      {
-        model = ((IField)selection).getModel();
-        if ( ((IField)selection).isGlobal())
+        IGraphElement xsdObj = (IGraphElement)selection;
+ 
+        if (xsdObj instanceof XSDBaseAdapter)
         {
-          doReselect = true;
+          XSDBaseAdapter baseAdapter = (XSDBaseAdapter)xsdObj;
+          
+          // Do not delete selected item if it is read-only, or if the item selected
+          // is null and the read only check cannot be completed
+          if (baseAdapter == null || baseAdapter.isReadOnly())
+          {
+            continue;
+          }
+          
+          topLevelContainer = xsdObj.getTopContainer();
+          if (topLevelContainer == selection)
+          {
+            doSetInput = true;
+            doSetModelAsInput = true;
+          }
+          command = xsdObj.getDeleteCommand();
+          model = xsdObj.getModel();         
         }
-        command = ((IField)selection).getDeleteCommand();
-      }  
-      else if (selection instanceof IStructure)
-      {
-        // Fallback for model groups and attribute groups.
-        IStructure structure = (IStructure)selection; 
-        model = structure.getModel();
-        command = structure.getDeleteCommand();
-        doReselect = true;
-      }  
-
+      }
+      
       if (command != null)
       {
         IWorkbench workbench = PlatformUI.getWorkbench();
@@ -91,15 +96,20 @@
                 {
                   // Bug 86218 : Don't switch to top level view if the object we're deleting
                   // is not the input to the viewer
-                  doReselect = false;
+                  doSetInput = false;
                 }
               }
             }
           }
         }
         command.execute();
-        if (model != null && doReselect)
-          provider.setSelection(new StructuredSelection(model));
+        if (doSetInput)
+        {
+          if (model != null && doSetModelAsInput)
+            provider.setSelection(new StructuredSelection(model));   
+          else if (topLevelContainer != null && !doSetModelAsInput)
+            provider.setSelection(new StructuredSelection(topLevelContainer));
+        }
       }  
     }
     
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DesignSelectAll.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DesignSelectAll.java
new file mode 100644
index 0000000..61da6b4
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DesignSelectAll.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.adt.actions;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.wst.xsd.ui.internal.adt.editor.CommonMultiPageEditor;
+import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
+import org.eclipse.wst.xsd.ui.internal.design.editparts.CategoryEditPart;
+import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDSchemaEditPart;
+
+public class DesignSelectAll extends BaseSelectionAction
+{
+  private GraphicalViewer graphicalViewer;
+  private List selected;
+
+  public DesignSelectAll(IWorkbenchPart part)
+  {
+    super(part);
+    setId(ActionFactory.SELECT_ALL.getId());
+    setText(Messages._UI_ACTION_SELECT_ALL);
+  }
+
+  public void run()
+  {
+    super.run();
+
+    IWorkbenchPart part = getWorkbenchPart();
+    selected = new ArrayList();
+    if (part instanceof CommonMultiPageEditor)
+    {
+      graphicalViewer = (GraphicalViewer) ((CommonMultiPageEditor) part).getAdapter(GraphicalViewer.class);
+      if (graphicalViewer != null)
+      {
+        EditPart editPart = graphicalViewer.getContents();
+        doSelectChildren(editPart);
+
+        graphicalViewer.setSelection(new StructuredSelection(selected));
+      }
+    }
+  }
+
+  private void doSelectChildren(EditPart editPart)
+  {
+    List list = editPart.getChildren();
+    for (Iterator i = list.iterator(); i.hasNext();)
+    {
+      Object o = i.next();
+      if (o instanceof GraphicalEditPart)
+      {
+        if (!(o instanceof XSDSchemaEditPart) && !(o instanceof CategoryEditPart))
+        {
+          selected.add(o);
+        }
+        doSelectChildren((GraphicalEditPart) o);
+      }
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/ADTFloatingToolbar.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/ADTFloatingToolbar.java
index 190bc05..b827ca5 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/ADTFloatingToolbar.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/ADTFloatingToolbar.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
 package org.eclipse.wst.xsd.ui.internal.adt.design;
 
 import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.gef.EditPart;
 import org.eclipse.gef.ui.parts.GraphicalViewerImpl;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Canvas;
@@ -53,8 +54,13 @@
   public void refresh(boolean isDrilledDown)
   {
     this.isDrilledDown = isDrilledDown;
-    editPart.setIsDrilledDown(isDrilledDown);
-    getContents().refresh();
+    if (editPart != null) {
+    	editPart.setIsDrilledDown(isDrilledDown);
+    }
+    EditPart contents = getContents();
+    if (contents != null) {
+    	contents.refresh();
+    }
   }
   
   public class ADTFloatingToolbarModel
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewContextMenuProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewContextMenuProvider.java
index 75b0432..a13e440 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewContextMenuProvider.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewContextMenuProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -29,6 +29,8 @@
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
 import org.eclipse.wst.xsd.ui.internal.adt.editor.ContextMenuParticipant;
 import org.eclipse.wst.xsd.ui.internal.adt.editor.EditorModeManager;
+import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
+import org.eclipse.wst.xsd.ui.internal.refactor.IXSDRefactorConstants;
 
 
 public class DesignViewContextMenuProvider extends ContextMenuProvider
@@ -111,18 +113,16 @@
           }
         }
         menu.add(new Separator());       
-        menu.add(new Separator("refactoring-slot"));  //$NON-NLS-1$
+        IMenuManager subMenu = new MenuManager(Messages._UI_REFACTOR_CONTEXT_MENU, IXSDRefactorConstants.REFACTOR_CONTEXT_MENU_ID); //$NON-NLS-1$
+        menu.add(subMenu);
         menu.add(new Separator());       
         menu.add(new Separator("search-slot"));        //$NON-NLS-1$
         menu.add(new Separator());
+        menu.add(new Separator("endDesignMenu-slot"));  // $NON-NLS-1$
+        menu.add(new Separator());
       }
     }    
     menu.add(new Separator());
-    //menu.add(registry.getAction("org.eclipse.wst.xsd.DeleteAction"));
-    //menu.add(new Separator());
-    //ShowPropertiesViewAction showPropertiesAction = (ShowPropertiesViewAction) registry.getAction(ShowPropertiesViewAction.ACTION_ID);
-    //showPropertiesAction.setPage(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage());
-    //menu.add(showPropertiesAction);
   }
 
   protected IMenuManager getParentMenu(IMenuManager root, IMenuManager child) {
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewGraphicalViewer.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewGraphicalViewer.java
index 399f8f5..381415c 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewGraphicalViewer.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewGraphicalViewer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
 import org.eclipse.jface.viewers.ISelection;
@@ -22,7 +23,13 @@
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.INavigationHistory;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.xsd.ui.internal.adapters.RedefineCategoryAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDRedefineAdapter;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.IHolderEditPart;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.StructureEditPart;
@@ -61,8 +68,12 @@
   // (e.g. a selection occured from another view)
   public void selectionChanged(SelectionChangedEvent event)
   {
-    Object selectedObject = ((StructuredSelection) event.getSelection()).getFirstElement();
-    
+    Object selectedObject = null;
+    ISelection eventSelection = event.getSelection();
+    if (eventSelection instanceof StructuredSelection)
+    {
+    	selectedObject = ((StructuredSelection) eventSelection).getFirstElement(); 
+    }    
     // TODO (cs) It seems like there's way more selection going on than there
     // should
     // be!! There's at least 2 selections getting fired when something is
@@ -70,6 +81,8 @@
     // outline view. Are we listening to too many things?
     //
     // if (event.getSource() instanceof ADTContentOutlinePage)
+    if (selectedObject != null)
+    {
     if (event.getSource() != internalSelectionProvider)
     {
       if (selectedObject instanceof IStructure)
@@ -79,11 +92,7 @@
         {
           if ((selectedObject instanceof IGraphElement) && ((IGraphElement)selectedObject).isFocusAllowed()) 
           {
-            if (event.getSource() instanceof org.eclipse.jface.viewers.IPostSelectionProvider)
-            {
-              setInput((IStructure)selectedObject);
-            }
-            else
+            if (!(event.getSource() instanceof org.eclipse.jface.viewers.IPostSelectionProvider))            
             {
               setInputAndMarkLocation((IStructure)selectedObject);
             }
@@ -96,11 +105,6 @@
         {
           setInputAndMarkLocation((IADTObject)selectedObject);              
         }
-        else if (((IGraphElement)selectedObject).isFocusAllowed() 
-            && (event.getSource() instanceof org.eclipse.jface.viewers.IPostSelectionProvider && !(getInput() instanceof IModel)))
-        {
-          setInput((IADTObject)selectedObject);
-        }
         else if (!((IGraphElement)selectedObject).isFocusAllowed())
         {
           // We encountered an object that is not a valid input to the graph viewer
@@ -110,7 +114,7 @@
           {
             // In this case, if the selection is originated from the outline, we should 
             // change the inputs
-            if (obj != null)
+            if (obj != null && getInput() != obj)  // Don't change inputs if the obj is already the input
               setInputAndMarkLocation(obj);
           }
           else if (event.getSource() instanceof CommonSelectionManager)
@@ -168,8 +172,14 @@
       }
       else if (selectedObject instanceof IModelProxy)
       {
-        IModelProxy adapter = (IModelProxy)selectedObject;
-        if (getInput() != adapter.getModel())
+        IModelProxy adapter = (IModelProxy)selectedObject;        
+        if (selectedObject instanceof RedefineCategoryAdapter)
+        {
+        	RedefineCategoryAdapter selectionAdapter = (RedefineCategoryAdapter)selectedObject;
+        	XSDRedefineAdapter selectionParentAdapter = selectionAdapter.getXsdRedefineAdapter(); 
+        	setInputAndMarkLocation(selectionParentAdapter);
+        }
+        else if (getInput() != adapter.getModel())
            setInput(adapter.getModel());
       }
       else if (selectedObject instanceof IModel)
@@ -180,7 +190,11 @@
       
       EditPart editPart = getEditPart(getRootEditPart(), selectedObject);
       if (editPart != null)
+      {
         setSelection(new StructuredSelection(editPart));
+        setFocus(editPart);
+      }
+    }
     }
   }
   
@@ -332,16 +346,27 @@
   
   public void setInputAndMarkLocation(IADTObject object)
   {
-    IADTObject oldInput = getInput();    
-    if (editorPart != null && oldInput != object)
-    {          
-      PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getNavigationHistory().markLocation(editorPart);
-    }  
+    IADTObject oldInput = getInput();
+    INavigationHistory navigationHistory = null;
+    IWorkbench workbench = PlatformUI.getWorkbench();
+    if(workbench != null)
+    {
+    	IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow();
+    	if(activeWorkbenchWindow != null)
+    	{
+    		IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
+    		if(activePage != null)
+    		{
+    			navigationHistory = activePage.getNavigationHistory();
+    		}
+    	}
+    }
+
     setInput(object);
 
     if (editorPart != null && oldInput != object)
     {
-      PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getNavigationHistory().markLocation(editorPart);
+      navigationHistory.markLocation(editorPart);
     }
   }
   
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ADTComboBoxCellEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ADTComboBoxCellEditor.java
index ec6683f..717c7ae 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ADTComboBoxCellEditor.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ADTComboBoxCellEditor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -28,7 +28,7 @@
 import org.eclipse.swt.widgets.TypedListener;
 import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
 import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
+import org.eclipse.wst.xsd.ui.internal.editor.Messages;
 
 /*
  * This wraps the ComboBoxCellEditor.
@@ -139,12 +139,12 @@
           String[] items = getItems();
           String stringSelection = items[selection];
 
-          if (stringSelection.equals(Messages._UI_ACTION_BROWSE))
+          if (stringSelection.equals(Messages._UI_COMBO_BROWSE))
           {
             continueApply = true;
             newValue = invokeDialog(componentReferenceEditManager.getBrowseDialog());
           }
-          else if (stringSelection.equals(Messages._UI_ACTION_NEW))
+          else if (stringSelection.equals(Messages._UI_COMBO_NEW))
           {
             continueApply = true;
             newValue = invokeDialog(componentReferenceEditManager.getNewDialog());
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelEditManager.java
index 317a5ba..884341a 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelEditManager.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelEditManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -28,6 +28,7 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.actions.ActionFactory;
 import org.eclipse.ui.part.CellEditorActionHandler;
+import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.INamedEditPart;
 
 public class LabelEditManager extends DirectEditManager {
@@ -111,7 +112,15 @@
 	private void restoreSavedActions(IActionBars actionBars){
 		actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copy);
 		actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), paste);
-		actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), delete);
+		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=252509
+		// Delete action (key) doesn't always work.  The saved action could be the 
+		// CellEditorActionHandler's DeleteActionHandler...due to timing issues.
+		// We'll only restore the delete action if it is indeed the one for the Design view.
+		// We should update the other actions too, but currently, none are applicable.
+		if (delete instanceof BaseSelectionAction)
+		{
+      actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), delete);
+		}
 		actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), selectAll);
 		actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cut);
 		actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), find);
@@ -122,7 +131,16 @@
 	private void saveCurrentActions(IActionBars actionBars) {
 		copy = actionBars.getGlobalActionHandler(ActionFactory.COPY.getId());
 		paste = actionBars.getGlobalActionHandler(ActionFactory.PASTE.getId());
-		delete = actionBars.getGlobalActionHandler(ActionFactory.DELETE.getId());
+    IAction currentDeleteAction = actionBars.getGlobalActionHandler(ActionFactory.DELETE.getId());
+    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=252509
+    // Delete action (key) doesn't always work.  The saved action could be the 
+    // CellEditorActionHandler's DeleteActionHandler...due to timing issues.
+    // We'll only restore the delete action if it is indeed the one for the Design view.
+    // We should update the other actions too, but currently, none are applicable.
+    if (currentDeleteAction instanceof BaseSelectionAction)
+    {
+      delete = currentDeleteAction;
+    }
 		selectAll = actionBars.getGlobalActionHandler(ActionFactory.SELECT_ALL.getId());
 		cut = actionBars.getGlobalActionHandler(ActionFactory.CUT.getId());
 		find = actionBars.getGlobalActionHandler(ActionFactory.FIND.getId());
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ReferenceDirectEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ReferenceDirectEditManager.java
index c98cbc2..7ced90d 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ReferenceDirectEditManager.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ReferenceDirectEditManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -24,7 +24,7 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
 import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
+import org.eclipse.wst.xsd.ui.internal.editor.Messages;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
 
 public abstract class ReferenceDirectEditManager extends ComboBoxCellEditorManager
@@ -50,8 +50,8 @@
     ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
     if (editManager != null)
     {
-       list.add(Messages._UI_ACTION_BROWSE);
-       list.add(Messages._UI_ACTION_NEW);
+       list.add(Messages._UI_COMBO_BROWSE);
+       list.add(Messages._UI_COMBO_NEW);
        ComponentSpecification[] quickPicks = editManager.getQuickPicks();
        if (quickPicks != null)
        {
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ADTFloatingToolbarEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ADTFloatingToolbarEditPart.java
index adbdab2..46b8be9 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ADTFloatingToolbarEditPart.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ADTFloatingToolbarEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,15 +10,21 @@
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.adt.design.editparts;
 
+import java.awt.event.KeyEvent;
+
 import org.eclipse.draw2d.ColorConstants;
 import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.FocusEvent;
+import org.eclipse.draw2d.FocusListener;
 import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.KeyListener;
 import org.eclipse.draw2d.MouseEvent;
 import org.eclipse.draw2d.MouseListener;
 import org.eclipse.draw2d.MouseMotionListener;
 import org.eclipse.draw2d.ToolbarLayout;
 import org.eclipse.draw2d.geometry.Dimension;
 import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbench;
@@ -52,11 +58,10 @@
     backToSchema = new ADTToolbarButton(XSDEditorPlugin.getPlugin().getIcon("elcl16/schemaview_co.gif"));
     backToSchema.setToolTipText(Messages._UI_HOVER_BACK_TO_SCHEMA);
     backToSchema.setBackgroundColor(ColorConstants.white);
-//    backToSchema.setBounds(new Rectangle(0, 0, 24, 24));
+    backToSchema.setFocusTraversable(true);    
     figure.add(backToSchema);
-    figure.setBounds(new Rectangle(0,0,24,24));
-    
-    addToToolbar(figure);   
+    figure.setBounds(new Rectangle(0,0,24,24));    
+    addToToolbar(figure);
     return figure;
   }
   
@@ -87,9 +92,7 @@
   
   protected void doAction(MouseEvent me)
   {
-    IWorkbench workbench = PlatformUI.getWorkbench();
-    IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-    IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
+    IEditorPart editorPart = getActionEditorPart();
  
     if (backToSchema.getBounds().contains(me.getLocation()))
     {
@@ -98,9 +101,27 @@
     }
   }
   
+  protected void doAction(org.eclipse.draw2d.KeyEvent ke)
+  {
+	  IEditorPart editorPart = getActionEditorPart(); 
+	  SetInputToGraphView action = new SetInputToGraphView(editorPart, model);
+	  action.run();    
+  }
+  
+  private IEditorPart getActionEditorPart()
+  {
+	  IWorkbench workbench = PlatformUI.getWorkbench();
+	  IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+	  IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
+	  return editorPart;
+  }
+  
+  
   protected class ADTToolbarButton extends CenteredIconFigure
   {
     protected MouseListener mouseListener;
+    protected org.eclipse.draw2d.KeyListener keyListener;    
+    protected FocusListener focusListener;
     public boolean isEnabled;
     
     public ADTToolbarButton(Image img)
@@ -114,7 +135,7 @@
         {
           if (isEnabled)
           {
-            addFeedback();
+        	  addFeedback();
           }
         }
 
@@ -135,6 +156,46 @@
           removeFeedback();
         }
       });
+      
+      keyListener = new KeyListener.Stub()
+      {
+    	  public void keyPressed(org.eclipse.draw2d.KeyEvent ke)
+    	  {
+    		  boolean isValidKey = (ke.keycode == KeyEvent.VK_SPACE);
+    		  isValidKey = isValidKey || (ke.character == SWT.CR || ke.character == SWT.LF);
+    		  if (isEnabled && isValidKey)
+    		  {
+    			  addFeedback();
+    		  }
+    	  }
+
+    	  public void keyReleased(org.eclipse.draw2d.KeyEvent ke)
+    	  {
+    		  boolean isValidKey = (ke.keycode == KeyEvent.VK_SPACE);
+    		  isValidKey = isValidKey || (ke.character == SWT.CR || ke.character == SWT.LF);
+    		  if (isEnabled && isValidKey)
+    		  {
+    			  removeFeedback();
+    			  doAction(ke);
+    		  }            
+    	  }
+      };
+      addKeyListener(keyListener);    
+      
+      focusListener = new FocusListener(){
+
+		public void focusGained(FocusEvent fe) {
+			setMode(CenteredIconFigure.HOVER);
+			refresh();
+		}
+
+		public void focusLost(FocusEvent fe) {
+			setMode(CenteredIconFigure.NORMAL);
+			refresh();
+		}
+	};
+	
+	addFocusListener(focusListener);
     }
 
     public void addFeedback()
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseEditPart.java
index 0a1ca1d..357e634 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseEditPart.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,18 +10,24 @@
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.adt.design.editparts;
 
-import java.util.Iterator;
 import java.util.List;
 
 import org.eclipse.core.runtime.Assert;
 import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.AccessibleEditPart;
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.EditPartFactory;
+import org.eclipse.gef.GraphicalViewer;
 import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
 import org.eclipse.gef.editparts.ScalableRootEditPart;
 import org.eclipse.gef.editparts.ZoomListener;
 import org.eclipse.gef.editparts.ZoomManager;
 import org.eclipse.jface.action.IAction;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IFileEditorInput;
@@ -34,6 +40,7 @@
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IFeedbackHandler;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.KeyBoardAccessibilityEditPolicy;
 import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFigureFactory;
+import org.eclipse.wst.xsd.ui.internal.adt.editor.CommonMultiPageEditor;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
 
@@ -41,6 +48,9 @@
 {
   protected static final String[] EMPTY_ACTION_ARRAY = {};
   protected boolean isSelected = false;
+  protected boolean hasFocus = false;
+  protected static boolean isHighContrast = Display.getDefault().getHighContrast();
+  protected AccessibleEditPart accessiblePart;
   
   public IFigureFactory getFigureFactory()
   {
@@ -108,20 +118,11 @@
   }
   
   public void refresh() {
-    super.refresh();
-
-    for(Iterator i = getChildren().iterator(); i.hasNext(); )
+    
+    boolean doUpdateDesign = doUpdateDesign();
+    if (doUpdateDesign)
     {
-      Object obj = i.next();
-      if (obj instanceof BaseEditPart)
-      {
-        ((BaseEditPart)obj).refresh();
-      }
-      else if (obj instanceof AbstractGraphicalEditPart)
-      {
-        ((AbstractGraphicalEditPart)obj).refresh();
-      }
-      
+      super.refresh();
     }
   }
 
@@ -227,4 +228,73 @@
     }
     return false;
   }
+  
+  // For https://bugs.eclipse.org/bugs/show_bug.cgi?id=218281
+  // Don't want to refresh the design when changes are made in the source view.
+  protected boolean doUpdateDesign()
+  {
+    IWorkbench workbench = PlatformUI.getWorkbench();
+    if (workbench != null)
+    {
+      IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+      if (workbenchWindow != null)
+      {
+        IWorkbenchPage page = workbenchWindow.getActivePage();
+        if (page != null)
+        {
+          IEditorPart editorPart = page.getActiveEditor();
+          if (editorPart instanceof CommonMultiPageEditor)
+          {
+            CommonMultiPageEditor editor = (CommonMultiPageEditor) editorPart;
+            GraphicalViewer viewer = (GraphicalViewer)editor.getAdapter(GraphicalViewer.class);
+            // Need to ensure this is the same editor we are working with since the active editor may not be 
+            // the current, eg. at startup, there can be another XSD Editor open on the source page, so we could end
+            // up not populating the design view initally
+            if (getViewer() == viewer)
+            {
+              // If source page is active, don't update the design
+              return !editor.isSourcePageActive();
+            }
+          }
+        }
+      }
+    }
+    return true;
+  }
+  
+  /**
+   * Try to get the italic font for the current font
+   * @param font
+   * @return
+   */
+  protected Font getItalicFont(Font font)
+  {
+    if (font != null && !font.isDisposed())
+    {
+      FontData[] fd = font.getFontData();
+      if (fd.length > 0)
+      {
+        fd[0].setStyle(fd[0].getStyle() | SWT.ITALIC);
+        return new Font(font.getDevice(), fd);
+      }
+    }
+    return font;
+  }
+  protected AccessibleEditPart getAccessibleEditPart() {
+		
+	  if (accessiblePart ==null)
+	  {
+		  accessiblePart = new AccessibleGraphicalEditPart(){
+		
+			public void getName(AccessibleEvent e) {		 
+				e.result = getReaderText();
+			}
+		};
+	  }
+	  return accessiblePart;
+	}
+public String getReaderText()
+{
+	  return "";
+}
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseFieldEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseFieldEditPart.java
index 944b6b7..e409780 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseFieldEditPart.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseFieldEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
 
 import java.util.Iterator;
 import java.util.List;
+
 import org.eclipse.draw2d.ColorConstants;
 import org.eclipse.draw2d.IFigure;
 import org.eclipse.draw2d.Label;
@@ -51,7 +52,7 @@
 import org.eclipse.wst.xsd.ui.internal.design.editpolicies.GraphNodeDragTracker;
 import org.eclipse.xsd.XSDNamedComponent;
 
-public class BaseFieldEditPart extends BaseTypeConnectingEditPart implements INamedEditPart
+public class BaseFieldEditPart extends BaseTypeConnectingEditPart implements INamedEditPart, IAutoDirectEdit
 {
   protected TypeReferenceConnection connectionFigure;
   protected ADTDirectEditPolicy adtDirectEditPolicy = new ADTDirectEditPolicy();
@@ -491,7 +492,7 @@
   public void addFeedback()
   {
     // Put back connection figure so it won't get overlayed by other non highlighted connections
-    if (connectionFigure != null)
+    if (connectionFigure != null && !isSelected)
     {
       connectionFeedbackFigure = new TypeReferenceConnection();
       connectionFeedbackFigure.setSourceAnchor(connectionFigure.getSourceAnchor());
@@ -514,5 +515,21 @@
     super.removeFeedback();
     getFieldFigure().removeSelectionFeedback();
   }
+  public String getReaderText()
+  {
+	  IFieldFigure fieldFigure = getFieldFigure();
+	  
+	  String name="";
+	  if (fieldFigure.getNameLabel() !=null&& fieldFigure.getNameLabel().getText().trim().length() > 0)
+		  name +=fieldFigure.getNameLabel().getText();
+	  if (fieldFigure.getNameAnnotationLabel() !=null && fieldFigure.getNameAnnotationLabel().getText().trim().length() > 0)
+		  name += " "+fieldFigure.getNameAnnotationLabel().getText();
+	  if (fieldFigure.getTypeLabel() !=null && fieldFigure.getTypeLabel().getText().trim().length() > 0)
+		  name += " type "+fieldFigure.getTypeLabel().getText();
+	  if (fieldFigure.getTypeAnnotationLabel() !=null && fieldFigure.getTypeAnnotationLabel().getText().trim().length() >0)
+		  name += " "+fieldFigure.getTypeAnnotationLabel().getText();
+	  return name;
+
+  }
 }
 
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseTypeConnectingEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseTypeConnectingEditPart.java
index e03ce47..eebb8e6 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseTypeConnectingEditPart.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseTypeConnectingEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -94,6 +94,7 @@
     {
       connectionFigure.setHighlight(true);
     }
+    super.addFeedback();
   }
   
   public void removeFeedback()
@@ -102,6 +103,7 @@
     {
       connectionFigure.setHighlight(false);
     }
+    super.removeFeedback();
   }
   
   protected class NameUpdateCommandWrapper extends Command implements IADTUpdateCommand
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ComplexTypeEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ComplexTypeEditPart.java
index 0ff12cf..0eceb08 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ComplexTypeEditPart.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ComplexTypeEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,15 +12,19 @@
 
 import java.util.Iterator;
 
+import org.eclipse.draw2d.Label;
 import org.eclipse.draw2d.ManhattanConnectionRouter;
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.swt.graphics.Font;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.FocusTypeColumn;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
 
 public class ComplexTypeEditPart extends StructureEditPart
-{   
+{
+  private Font italicFont;
+
   protected boolean shouldDrawConnection()
   {
     if (getParent().getModel() instanceof FocusTypeColumn)
@@ -80,5 +84,38 @@
       }
     }    
     return connectionFigure;
-  }  
+  }
+
+  protected void refreshVisuals()
+  {
+    super.refreshVisuals();
+    Label label = getNameLabelFigure();
+    IComplexType complexType = (IComplexType)getModel();
+    if (complexType.isAbstract())
+    {
+      if (italicFont == null)
+      {
+        Font font = label.getFont();
+        italicFont = getItalicFont(font);
+      }
+      if (italicFont != null)
+      {
+        label.setFont(italicFont);
+      }
+    }
+    else
+    {
+      label.setFont(label.getParent().getFont());
+    }
+  }
+  
+  public void deactivate()
+  {
+    if (italicFont != null)
+    {
+      italicFont.dispose();
+      italicFont = null;
+    }
+    super.deactivate();
+  }
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IAutoDirectEdit.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IAutoDirectEdit.java
new file mode 100644
index 0000000..bcd3186
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IAutoDirectEdit.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.adt.design.editparts;
+
+/**
+ * Edit parts that can be direct editable
+ *  
+ */
+public interface IAutoDirectEdit
+{
+  public void doEditName(boolean addFromDesign);
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootContentEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootContentEditPart.java
index 8fa0340..d2677d4 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootContentEditPart.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootContentEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,14 +11,13 @@
 package org.eclipse.wst.xsd.ui.internal.adt.design.editparts;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
+
 import org.eclipse.draw2d.Figure;
 import org.eclipse.draw2d.IFigure;
 import org.eclipse.draw2d.MarginBorder;
 import org.eclipse.draw2d.Panel;
 import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.RootHolder;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
@@ -113,6 +112,15 @@
           }
         }
       }
+      else if (obj instanceof IGraphElement)
+      {
+        if (((IGraphElement)obj).isFocusAllowed())
+        {
+          focusObject = (IADTObject)obj;
+          collections.add(focusObject);
+          return collections;
+        }
+      }
       if (focusObject != null)
       {
         RootHolder holder = new RootHolder(focusObject);
@@ -141,30 +149,17 @@
     return getModel();
   }
   
-  public void refresh()
+  // https://bugs.eclipse.org/bugs/show_bug.cgi?id=252589
+  public void activate()
   {
-    super.refresh();
-    /*
-    // once we're done refreshing we can assume all of the child editparts
-    // now we iteratre thru the list again and tell the children to update
-    // their connections
-    for (Iterator i = getChildren().iterator(); i.hasNext(); )
+    super.activate();
+    Object model = getModel();
+    // The schema adapter doesn't have to notify the RootContentEditPart of it changes
+    if (model instanceof IADTObject)
     {
-      Object obj = i.next();
-      if (obj instanceof IConnectionContainer)
-      {
-        ((IConnectionContainer)obj).refreshConnections();
-      }
-    }*/
-    
-    for(Iterator i = getChildren().iterator(); i.hasNext(); )
-    {
-      Object obj = i.next();
-      if (obj instanceof AbstractGraphicalEditPart)
-      {
-        ((AbstractGraphicalEditPart)obj).refresh();
-      }
+      IADTObject object = (IADTObject)model;
+      object.unregisterListener(this);
     }
-
   }
+
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/StructureEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/StructureEditPart.java
index d3f079f..167bfcf 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/StructureEditPart.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/StructureEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -241,4 +241,9 @@
   {
     return null;
   }
+  public String getReaderText()
+  {
+  	 // return getStructureFigure().getNameLabel().getText();
+  	return getNameLabelFigure().getText();
+  }
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TopLevelFieldEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TopLevelFieldEditPart.java
index 9a28e75..1ad0195 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TopLevelFieldEditPart.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TopLevelFieldEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@
 import org.eclipse.gef.Request;
 import org.eclipse.gef.RequestConstants;
 import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.swt.graphics.Font;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTDirectEditPolicy;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
@@ -25,6 +26,7 @@
 public class TopLevelFieldEditPart extends BoxEditPart implements INamedEditPart
 {
   protected ADTDirectEditPolicy adtDirectEditPolicy = new ADTDirectEditPolicy();
+  private Font italicFont;
   
   protected boolean shouldDrawConnection()
   {
@@ -64,10 +66,37 @@
   {
     IField field = (IField)getModel();
     BoxFigure boxFigure = (BoxFigure)getFigure();
-    boxFigure.getNameLabel().setText(field.getName());
+    Label label = boxFigure.getNameLabel();
+    label.setText(field.getName());
+    if (field.isAbstract())
+    {
+      if (italicFont == null)
+      {
+        Font font = label.getFont();
+        italicFont = getItalicFont(font);
+      }
+      if (italicFont != null)
+      {
+        label.setFont(italicFont);
+      }
+    }
+    else
+    {
+      label.setFont(label.getParent().getFont());
+    }
     super.refreshVisuals();
   }
   
+  public void deactivate()
+  {
+    if (italicFont != null)
+    {
+      italicFont.dispose();
+      italicFont = null;
+    }
+    super.deactivate();
+  }
+  
   public Label getNameLabelFigure()
   {
     BoxFigure boxFigure = (BoxFigure)getFigure();
@@ -78,7 +107,11 @@
   {
    
   }
-  
+  public String getReaderText()
+  {
+	  return  getNameLabelFigure().getText();
+  }
+
   public void performRequest(Request request)
   {  
     if (request.getType() == RequestConstants.REQ_DIRECT_EDIT||
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TypeReferenceConnection.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TypeReferenceConnection.java
index 4a72280..0d7da4a 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TypeReferenceConnection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TypeReferenceConnection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,7 +16,9 @@
 import org.eclipse.draw2d.ManhattanConnectionRouter;
 import org.eclipse.draw2d.PolygonDecoration;
 import org.eclipse.draw2d.PolylineConnection;
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Display;
 
 public class TypeReferenceConnection extends PolylineConnection
 {
@@ -82,7 +84,22 @@
   {
     this.highlight = highlight;
     // Update our connection to use the correct colouring
-    setForegroundColor(highlight ? activeConnection : inactiveConnection);
+    boolean highContrast = false;
+    try
+    {
+      highContrast = Display.getDefault().getHighContrast();
+    }
+    catch (Exception e)
+    {
+    }
+    if (highContrast)
+    {
+      setForegroundColor(highlight ? Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND) : ColorConstants.lightGray);
+    }
+    else
+    {
+      setForegroundColor(highlight ? activeConnection : inactiveConnection);
+    }
     setOpaque(highlight);
   }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IGraphElement.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IGraphElement.java
index 991d911..9b2f5cb 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IGraphElement.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IGraphElement.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,9 +11,14 @@
 package org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model;
 
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
+import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
+import org.eclipse.gef.commands.Command;
 
 public interface IGraphElement
 {
   boolean isFocusAllowed();
   IADTObject getTopContainer();
+  Command getDeleteCommand();
+  IModel getModel();
+  boolean isReadOnly();
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTSelectionFeedbackEditPolicy.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTSelectionFeedbackEditPolicy.java
index 4787127..0747165 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTSelectionFeedbackEditPolicy.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTSelectionFeedbackEditPolicy.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -36,5 +36,17 @@
       ((IFeedbackHandler) getHost()).addFeedback();
     }
   }
+  
+  protected void showFocus()
+  {
+    super.showFocus();
+    getHost().setFocus(true);
+  }
+  
+  protected void hideFocus()
+  {
+    super.hideFocus();
+    getHost().setFocus(false);
+  }
 
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTExternalResourceVariant.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTExternalResourceVariant.java
index 19f5aaf..96bf76a 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTExternalResourceVariant.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTExternalResourceVariant.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,11 +7,11 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Jesper Steen Moller - added resolver lookups
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.adt.editor;
 
 import java.io.ByteArrayInputStream;
-import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.SocketTimeoutException;
@@ -24,13 +24,13 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.PlatformObject;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.content.IContentDescription;
 import org.eclipse.core.runtime.content.IContentTypeManager;
 import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
 
 public class ADTExternalResourceVariant extends PlatformObject
@@ -75,16 +75,12 @@
   class XSDResourceVariantStorage implements IEncodedStorage
   {
 
-    protected File getFile()
-    {
-      return new File(urlString);
-    }
-
     public InputStream getContents() throws CoreException
     {
       try
       {
-          URL url = new URL(urlString);
+    	  String physicalUrlString = URIResolverPlugin.createResolver().resolvePhysicalLocation(null, null, urlString);
+          URL url = new URL(physicalUrlString);
           URLConnection urlConnection = url.openConnection();
           return urlConnection.getInputStream();
       }
@@ -101,12 +97,13 @@
 
     public IPath getFullPath()
     {
-      return new Path(urlString);
+      // Since this is loaded from an URL, this should never be interpreted as a path
+      return null;
     }
 
     public String getName()
     {
-      return getFullPath().toFile().getName();
+      return urlString;
     }
 
     public boolean isReadOnly()
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTMultiPageEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTMultiPageEditor.java
index 3f46c13..dbd3b7c 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTMultiPageEditor.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTMultiPageEditor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,25 +10,32 @@
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.adt.editor;
 
+import java.util.List;
+
 import org.eclipse.draw2d.ColorConstants;
 import org.eclipse.draw2d.IFigure;
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.EditPartFactory;
 import org.eclipse.gef.GraphicalEditPart;
 import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.gef.SelectionManager;
 import org.eclipse.gef.editparts.ZoomManager;
 import org.eclipse.gef.ui.actions.ActionRegistry;
 import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
+import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.StackLayout;
 import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.contexts.IContextActivation;
+import org.eclipse.ui.contexts.IContextService;
 import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
@@ -47,6 +54,9 @@
   private int currentPage = -1;
   protected Button tableOfContentsButton;
   protected ADTFloatingToolbar floatingToolbar;
+  private IContextActivation contextActivation;
+  public final static String DESIGN_VIEW_CONTEXT = "org.eclipse.wst.xsd.ui.editor.designView"; //$NON-NLS-1$
+  public final static String SOURCE_VIEW_CONTEXT = "org.eclipse.wst.xsd.ui.editor.sourceView"; //$NON-NLS-1$
   
   /**
    * Creates a multi-page editor example.
@@ -177,11 +187,67 @@
 
     return pageIndex;
   }
+  
+  /**
+   * @see org.eclipse.ui.IWorkbenchPart#setFocus()
+   */
+  public void setFocus()
+  {
+    super.setFocus();
+    if (getActivePage() == DESIGN_PAGE_INDEX)
+    {
+      if (graphicalViewer != null && graphicalViewer.getControl() != null)
+      {
+        List selected = graphicalViewer.getSelectedEditParts();
+        if (selected.size() > 0)
+        {
+          graphicalViewer.setFocus((EditPart)selected.get(0));
+        }
+        graphicalViewer.getControl().setFocus();
+        
+      }
+    }
+    else
+    {
+      graphicalViewer.setFocus(null);
+    }
+  }
 
   protected void pageChange(int newPageIndex)
   {
+	deactivateContext(contextActivation);
     currentPage = newPageIndex;
     super.pageChange(newPageIndex);
+    
+    String context = getContext(currentPage);
+    contextActivation = activateContext(context);
+    
+    if (newPageIndex == DESIGN_PAGE_INDEX)
+    {
+      ISelection selection = graphicalViewer.getSelectionManager().getSelection();
+      Object model = null;
+      if (selection instanceof StructuredSelection)
+      {
+        StructuredSelection structuredSelection = (StructuredSelection)selection;
+        // While in the source view, selection could have changed.
+        // Will try to select the first item when switching back to the design view.
+        // We currently do not multi-select figures if multiple elements are selected in the source view.
+        // For example, if multiple global elements are selected, the graph view will be in the details view
+        // of the first one.
+        Object elem = structuredSelection.getFirstElement();
+        if (elem instanceof EditPart)
+          model = ((EditPart)elem).getModel();
+      }
+      // Refresh the design page upon page change
+      graphicalViewer.getContents().refresh();
+      // Need to use the adapter, since after refresh, the old edit part will have been replaced
+      // Maintain previous selection:
+      if (model != null)
+      {
+        getSelectionManager().setSelection(new StructuredSelection(model));
+      }
+    }
+    setFocus();
   }
   
   private boolean isTableOfContentsApplicable(Object graphViewInput)
@@ -200,8 +266,23 @@
         floatingToolbar.refresh(isTableOfContentsApplicable(input.getFirstElement()));
       }      
     });
+    // Workaround bug 227687 An edit part's focus state is not updated properly
+    // Once this is bug is fixed, we can remove custom selection manager
+    viewer.setSelectionManager(new CustomSelectionManager());
     return viewer;
   }
+
+  // Workaround bug 227687 An edit part's focus state is not updated properly
+  // Once this is bug is fixed, we can remove this class
+  private class CustomSelectionManager extends SelectionManager
+  {
+    public void appendSelection(EditPart editpart)
+    {
+      if (editpart != getFocus())
+        getViewer().setFocus(editpart);
+      super.appendSelection(editpart);
+    }
+  }
   
   abstract public IModel buildModel();  // (IFileEditorInput editorInput);
   
@@ -260,6 +341,33 @@
       XSDEditorPlugin.getPlugin().setDesignPageAsDefault();
     }
     floatingToolbar = null;
+	deactivateContext(contextActivation);
     super.dispose();
   }
+  protected String getContext(int pageIndex) {
+	  if (pageIndex == DESIGN_PAGE_INDEX) {
+		  return DESIGN_VIEW_CONTEXT;
+	  } else if (pageIndex == SOURCE_PAGE_INDEX) {
+		  return SOURCE_VIEW_CONTEXT;
+	  }
+	  
+	  return null;
+  }
+  private IContextActivation activateContext(String context) {
+	  IContextService contextService = (IContextService) getSite().getService(IContextService.class);
+
+	  if (contextService != null && context != null) {
+		  return contextActivation = contextService.activateContext(context);
+	  }
+	  return null;
+  }
+  
+  private void deactivateContext(IContextActivation contextActivation) {
+	  IContextService contextService = (IContextService) getSite().getService(IContextService.class);
+
+	  if (contextService != null && contextActivation != null) {
+		  contextService.deactivateContext(contextActivation);
+	  }
+  }
+
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/CommonMultiPageEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/CommonMultiPageEditor.java
index 0da0905..148cc02 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/CommonMultiPageEditor.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/CommonMultiPageEditor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -43,6 +43,7 @@
 import org.eclipse.gef.ui.parts.SelectionSynchronizer;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.text.IDocument;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.MouseAdapter;
 import org.eclipse.swt.events.MouseEvent;
@@ -176,7 +177,6 @@
     setInput(structuredTextEditor.getEditorInput());
     setPartName(editor.getTitle());
     getCommandStack().markSaveLocation();
-    
   }
 
   /* (non-Javadoc)
@@ -285,6 +285,31 @@
       }
     }
   }
+  
+  // Should override to set the input to the design viewer for a new document change
+  // ie. when doing a saveAs
+  protected void setInputToGraphicalViewer(IDocument newInput)
+  {
+  }
+
+  protected void setInput(IEditorInput input)
+  {
+    super.setInput(input);
+    if (graphicalViewer != null)
+    {
+      setInputToGraphicalViewer(getDocument());
+    }
+  }
+
+  protected IDocument getDocument()
+  {
+    IDocument document = null;
+    if (structuredTextEditor != null)
+    {
+      document = structuredTextEditor.getDocumentProvider().getDocument(structuredTextEditor.getEditorInput());
+    }
+    return document;
+  }
 
   /**
    * @return
@@ -385,8 +410,6 @@
    */
   public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException
   {
-//    if (!(editorInput instanceof IFileEditorInput))
-//      throw new PartInitException("Invalid Input: Must be IFileEditorInput"); //$NON-NLS-1$
     super.init(site, editorInput);
     
     getCommandStack().addCommandStackListener(this);
@@ -622,7 +645,7 @@
     if (showToolBar)
     {
       toolbar = new Composite(parent, SWT.FLAT | SWT.DRAW_TRANSPARENT);
-      toolbar.setBackground(ColorConstants.white);
+      toolbar.setBackground(ColorConstants.listBackground);
       toolbar.addPaintListener(new PaintListener() {
 
         public void paintControl(PaintEvent e)
@@ -637,7 +660,7 @@
       toolbar.setLayout(gridLayout);
 
       Label label = new Label(toolbar, SWT.FLAT | SWT.HORIZONTAL);
-      label.setBackground(ColorConstants.white);
+      label.setBackground(ColorConstants.listBackground);
       label.setText(Messages._UI_LABEL_VIEW);
       label.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_CENTER));
 
@@ -823,7 +846,10 @@
      */
     public void partOpened(IWorkbenchPart part)
     {
-      // do nothing
+    	if (CommonMultiPageEditor.this.equals(part))
+    	{
+    		doPostEditorOpenTasks();
+    	}
     }
 
     /**
@@ -900,5 +926,17 @@
       // do nothing
     }
   }
-
+  
+  public boolean isSourcePageActive()
+  {
+    return getActivePage() == SOURCE_PAGE_INDEX;
+  }
+  
+  /**
+   * Invoked during IPartListener#partOpened. Derived classes can override
+   * to provide specialized behaviour.  
+   */
+  protected void doPostEditorOpenTasks() {
+	  // Nothing to do in the base class.
+  }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/Messages.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/Messages.java
index 6b49d32..cb7de70 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/Messages.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/Messages.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -34,6 +34,7 @@
   public static String _UI_ACTION_UPDATE_NAME;
   public static String _UI_ACTION_UPDATE_TYPE;
   public static String _UI_ACTION_UPDATE_ELEMENT_REFERENCE;
+  public static String _UI_ACTION_SELECT_ALL;
   public static String _UI_LABEL_DESIGN;
   public static String _UI_LABEL_SOURCE;
   public static String _UI_LABEL_VIEW;
@@ -48,4 +49,6 @@
   public static String _UI_ACTION_CAPTURE_SCREEN_DEFAULT_FILE_NAME;
   public static String _UI_ACTION_CAPTURE_SCREEN_FILE_SAVE_DIALOG_TITLE;
   public static String _UI_HOVER_BACK_TO_SCHEMA;
+  public static String _UI_REFACTOR_CONTEXT_MENU;
+  public static String _UI_HYPERLINK_TEXT;  
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/messages.properties b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/messages.properties
index 210ec21..c110e4d 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/messages.properties
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/messages.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2007 IBM Corporation and others.
+# Copyright (c) 2001, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -9,16 +9,16 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 
-_UI_ACTION_SHOW_PROPERTIES=Show properties
-_UI_ACTION_SET_AS_FOCUS=Set As Focus
+_UI_ACTION_SHOW_PROPERTIES=Sho&w properties
+_UI_ACTION_SET_AS_FOCUS=&Set As Focus
 _UI_ACTION_UPDATE_NAME=Update Name
 _UI_ACTION_UPDATE_TYPE=Update type
 _UI_ACTION_UPDATE_ELEMENT_REFERENCE=Update element reference
-_UI_ACTION_DELETE=Delete
-_UI_ACTION_BROWSE=Browse...
+_UI_ACTION_DELETE=&Delete
+_UI_ACTION_BROWSE=&Browse...
 _UI_LABEL_DESIGN=Design
 _UI_LABEL_SOURCE=Source
-_UI_ACTION_NEW=New...
+_UI_ACTION_NEW=&New...
 _UI_ACTION_ADD_FIELD=Add Field
 _UI_LABEL_VIEW=View:
 _UI_HOVER_VIEW_MODE_DESCRIPTION=Change the view mode of the editor
@@ -32,3 +32,6 @@
 _UI_ACTION_CAPTURE_SCREEN_DEFAULT_FILE_NAME = Diagram
 _UI_ACTION_CAPTURE_SCREEN_FILE_SAVE_DIALOG_TITLE=Export Diagram as Image
 _UI_HOVER_BACK_TO_SCHEMA=Show schema index view
+_UI_ACTION_SELECT_ALL=Select &All
+_UI_REFACTOR_CONTEXT_MENU=Refac&tor
+_UI_HYPERLINK_TEXT = Open {0} with the XML Schema editor
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IComplexType.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IComplexType.java
index 38387ac..c97adc4 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IComplexType.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IComplexType.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,4 +14,6 @@
 
 public interface IComplexType extends IType, IStructure
 {
+  boolean isAbstract();
+  Object getContentType();
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IField.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IField.java
index 59a6280..7e31d32 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IField.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IField.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -25,6 +25,7 @@
   int getMaxOccurs();
   boolean isGlobal();
   boolean isReference();
+  boolean isAbstract();
   
   Command getUpdateMinOccursCommand(int minOccurs);
   Command getUpdateMaxOccursCommand(int maxOccurs);
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlinePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlinePage.java
index 322c931..48fb01e 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlinePage.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlinePage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,6 +10,11 @@
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.adt.outline;
 
+import java.util.List;
+import java.util.Stack;
+
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
 import org.eclipse.jface.action.IStatusLineManager;
 import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.viewers.ILabelProvider;
@@ -27,6 +32,17 @@
 import org.eclipse.swt.widgets.Menu;
 import org.eclipse.ui.part.MultiPageSelectionProvider;
 import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
+import org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.RedefineCategoryAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeDeclarationAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeGroupDefinitionAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDComplexTypeDefinitionAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDElementDeclarationAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDModelGroupDefinitionAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDRedefineAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaDirectiveAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDSimpleTypeDefinitionAdapter;
 import org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewContextMenuProvider;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IModelProxy;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
@@ -66,10 +82,6 @@
     // getSite().registerContextMenu("org.eclipse.wst.xsdeditor.ui.popup.outline",
     // menuManager, xsdEditor.getSelectionManager());
 
-    // cs... why are we doing this from the outline view?
-    //
-    // xsdTextEditor.getXSDEditor().getSelectionManager().setSelection(new
-    // StructuredSelection(xsdTextEditor.getXSDSchema()));
     // drill down from outline view
     getTreeViewer().getControl().addMouseListener(new MouseAdapter()
     {
@@ -123,19 +135,16 @@
   // }
   public void setSelectionManager(MultiPageSelectionProvider newSelectionManager)
   {
-//    TreeViewer treeViewer = getTreeViewer();
     // disconnect from old one
     if (selectionManager != null)
     {
       selectionManager.removeSelectionChangedListener(selectionManagerSelectionChangeListener);
-//      treeViewer.removeSelectionChangedListener(treeSelectionChangeListener);
     }
     selectionManager = newSelectionManager;
     // connect to new one
     if (selectionManager != null)
     {
       selectionManager.addSelectionChangedListener(selectionManagerSelectionChangeListener);
-//      treeViewer.addSelectionChangedListener(treeSelectionChangeListener);
     }
   }
 
@@ -149,44 +158,134 @@
         StructuredSelection selection = (StructuredSelection)event.getSelection();
         StructuredSelection currentSelection = (StructuredSelection) getTreeViewer().getSelection();
         
+        Object selectionFirstElement = selection.getFirstElement();
+        Object currentFirstElement = currentSelection.getFirstElement();
+       
         // TODO: Hack to prevent losing a selection when the schema is selected in the
         // source.  Fix is to prevent the source from firing off selection changes when
         // the selection source is not the source view.
-        if (selection.getFirstElement() instanceof IModel)
-        {
-          if (!(currentSelection.getFirstElement() instanceof IModelProxy))
+        
+        if (selectionFirstElement instanceof IModel)
+        {          
+          if (!(currentFirstElement instanceof IModelProxy) || currentFirstElement instanceof RedefineCategoryAdapter)
           {
             getTreeViewer().setSelection(event.getSelection(), true);
           }
         }
+        else if (selectionFirstElement instanceof XSDSchemaDirectiveAdapter)
+        {
+        	if (!(currentFirstElement instanceof RedefineCategoryAdapter))
+        	{
+        		getTreeViewer().setSelection(event.getSelection(), true);
+        	}
+        }
         else
         {
-          getTreeViewer().setSelection(event.getSelection(), true);
+          IStructuredSelection structuredSelection = (IStructuredSelection) event.getSelection();
+          List list = structuredSelection.toList();
+          int selectionLength = list.size();
+          if (selectionLength > 0)
+          {
+            for (int i = 0; i < selectionLength; i++)
+            {
+              Object item = list.get(i);
+
+              if (item instanceof AdapterImpl)
+              {
+                Notifier target = ((AdapterImpl) item).getTarget();
+
+                if (!(target instanceof XSDConcreteComponent))
+                  continue;
+
+                XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent) target;
+
+                // need to expand parent before child, thus a stack is required
+                Stack componentStack = new Stack();
+                while (xsdConcreteComponent != null)
+                {
+                  componentStack.push(xsdConcreteComponent);
+                  xsdConcreteComponent = xsdConcreteComponent.getContainer();
+                }
+
+                // At this point the stack must have the XSDSchemaAdapter and
+                // at least one component
+                if (componentStack.size() < 2)
+                  continue;
+
+                // Pop off the top node, since it is the XSDSchemaAdapter, which
+                // isn't
+                // used as part of finding the outline view hierarchy
+                componentStack.pop();
+
+                if (((XSDConcreteComponent) componentStack.peek()).eAdapters().size() <= 0)
+                  continue;
+
+                Object object = ((XSDConcreteComponent) componentStack.peek()).eAdapters().get(0);
+
+                // Find out which category the selected item is contained in
+                int categoryIndex = -1;
+                if (object instanceof XSDSchemaDirectiveAdapter)
+                {
+                  categoryIndex = CategoryAdapter.DIRECTIVES;
+                }
+                else if (object instanceof XSDElementDeclarationAdapter)
+                {
+                  categoryIndex = CategoryAdapter.ELEMENTS;
+                }
+                else if (object instanceof XSDAttributeDeclarationAdapter)
+                {
+                  categoryIndex = CategoryAdapter.ATTRIBUTES;
+                }
+                else if (object instanceof XSDAttributeGroupDefinitionAdapter)
+                {
+                  categoryIndex = CategoryAdapter.ATTRIBUTES;
+                }
+                else if (object instanceof XSDComplexTypeDefinitionAdapter || object instanceof XSDSimpleTypeDefinitionAdapter)
+                {
+                  categoryIndex = CategoryAdapter.TYPES;
+                }
+                else if (object instanceof XSDModelGroupDefinitionAdapter)
+                {
+                  categoryIndex = CategoryAdapter.GROUPS;
+                }
+
+                // Expand the category
+                if (categoryIndex == -1)
+                  continue;
+                CategoryAdapter category = ((XSDSchemaAdapter) model).getCategory(categoryIndex);
+                treeViewer.setExpandedState(category, true);
+
+                // Do not expand current node of interest, just its parents
+                while (componentStack.size() > 1)
+                {
+                  object = componentStack.pop();
+                  if (object instanceof XSDConcreteComponent)
+                  {
+                    XSDConcreteComponent component = (XSDConcreteComponent) object;
+                    if (component.eAdapters().size() > 0)
+                    {
+                      // expand
+                      getTreeViewer().setExpandedState(component.eAdapters().get(0), true);
+                    }
+                  }
+                }
+              }
+            }
+          }
+          // Bug 251474 - We will restrict selection to only one item
+          if (selectionLength == 1)
+          {
+            getTreeViewer().setSelection(event.getSelection(), true);
+          }
+          else
+          {
+        	  if(structuredSelection.getFirstElement() !=null)
+        		  getTreeViewer().setSelection(new StructuredSelection(structuredSelection.getFirstElement()), true);
+          }
         }
       }
     }
   }
-
-//  class TreeSelectionChangeListener implements ISelectionChangedListener
-//  {
-//    public void selectionChanged(SelectionChangedEvent event)
-//    {
-//      if (selectionManager != null)
-//      {
-//        ISelection selection = event.getSelection();
-//        if (selection instanceof IStructuredSelection)
-//        {
-//          IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-//          Object o = structuredSelection.getFirstElement();
-//          if (o != null)
-//          {
-//            selectionManager.setSelection(structuredSelection);
-//          }
-//        }
-//      }
-//    }
-//  }
-  
   
   protected void updateStatusLine(IStatusLineManager mgr, ISelection selection)
   {
@@ -196,6 +295,8 @@
     if (statusLineLabelProvider != null && selection instanceof IStructuredSelection && !selection.isEmpty())
     {
       Object firstElement = ((IStructuredSelection) selection).getFirstElement();
+      if (firstElement instanceof XSDRedefineAdapter)
+    	  return;
       text = statusLineLabelProvider.getText(firstElement);
       image = statusLineLabelProvider.getImage(firstElement);
     }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineProvider.java
index a063250..ac6e76f 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineProvider.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineProvider.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,7 +11,6 @@
 package org.eclipse.wst.xsd.ui.internal.adt.outline;
 
 import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
@@ -20,6 +19,7 @@
 {
   protected Viewer viewer = null;
   protected Object oldInput, newInput;
+  protected ADTContentOutlineRefreshJob refreshJob;
 
   public ADTContentOutlineProvider()
   {
@@ -89,6 +89,11 @@
     {
       removeListener((IADTObject) input);
     }
+    if (refreshJob != null)
+    {
+      refreshJob.cancel();
+      refreshJob = null;
+    }
   }
 
   /* (non-Javadoc)
@@ -99,6 +104,11 @@
     this.viewer = viewer;
     this.oldInput = oldInput;
     this.newInput = newInput;
+    if (refreshJob != null)
+    {
+      refreshJob.cancel();
+    }
+    refreshJob = new ADTContentOutlineRefreshJob(viewer);
   }
 
   /* (non-Javadoc)
@@ -106,15 +116,7 @@
    */
   public void propertyChanged(Object object, String property)
   {
-    if (viewer instanceof TreeViewer)
-    {
-      TreeViewer treeViewer = (TreeViewer) viewer;
-      if (treeViewer.getTree() != null && !treeViewer.getTree().isDisposed())
-      {
-        treeViewer.refresh(object);
-        treeViewer.reveal(object);
-      }
-    }
+    refreshJob.refresh((IADTObject)object);
   }
 
   /**
@@ -123,14 +125,20 @@
   private void removeListener(IADTObject model)
   {
     model.unregisterListener(this);
-    Object[] children = getChildren(model);
+    Object[] children = null;
+    
+    if (model instanceof ITreeElement)
+    {
+      children = ((ITreeElement) model).getChildren();
+    }
+    
     if (children != null)
     {
       int length = children.length;
       for (int i = 0; i < length; i++)
       {
         Object child = children[i];
-        if (child instanceof IADTObject)
+        if (child instanceof IADTObject && model != child)
         {
           removeListener((IADTObject) child);
         }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineRefreshJob.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineRefreshJob.java
new file mode 100644
index 0000000..bf04cf4
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineRefreshJob.java
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.adt.outline;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter;
+import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
+
+
+/**
+ * This job holds a queue of updates (affected nodes) for the XSD editor's
+ * outline view. When a new request comes in, the current run is cancelled, 
+ * the new request is added to the queue, then the job is re-scheduled.
+ * This class is loosely based on RefreshStructureJob.
+ */
+class ADTContentOutlineRefreshJob extends Job
+{
+  /**
+   * The delay time in milliseconds.
+   */
+  private static final long UPDATE_DELAY = 300;
+
+  private final List nodesToRefresh = new ArrayList(5);
+
+  private final TreeViewer viewer;
+
+  public ADTContentOutlineRefreshJob(Viewer viewer)
+  {
+    super("Refreshing XSD outline"); //$NON-NLS-1$
+    setPriority(Job.LONG);
+    setSystem(true);
+    this.viewer = (TreeViewer)viewer;
+  }
+
+  private synchronized void addRefreshRequest(IADTObject adtObject)
+  {
+    if (nodesToRefresh.contains(adtObject))
+    {
+      return;
+    }
+
+    nodesToRefresh.add(adtObject);
+  }
+
+  protected void canceling()
+  {
+    nodesToRefresh.clear();
+    super.canceling();
+  }
+
+  private void doRefresh(final IADTObject adtObject)
+  {
+    final Display display = PlatformUI.getWorkbench().getDisplay();
+    display.asyncExec(new Runnable()
+      {
+        public void run()
+        {
+          boolean isValidViewer = viewer != null && !viewer.getControl().isDisposed();
+          if (isValidViewer)
+          {
+            viewer.refresh(adtObject);
+
+            // Needlessly revealing the category nodes causes a lot of UI flicker.
+            
+            if (!(adtObject instanceof CategoryAdapter))
+            {
+              viewer.reveal(adtObject);
+            }
+          }
+        }
+      });
+  }
+
+  private synchronized IADTObject[] getNodesToRefresh()
+  {
+    IADTObject[] toRefresh = new IADTObject [nodesToRefresh.size()];
+    nodesToRefresh.toArray(toRefresh);
+    nodesToRefresh.clear();
+
+    return toRefresh;
+  }
+
+  public void refresh(IADTObject adtObject)
+  {
+    if (adtObject == null)
+    {
+      return;
+    }
+
+    addRefreshRequest(adtObject);
+
+    schedule(UPDATE_DELAY);
+  }
+
+  protected IStatus run(IProgressMonitor monitor)
+  {
+    IStatus status = Status.OK_STATUS;
+    try
+    {
+      performRefreshes(monitor);
+    }
+    finally
+    {
+      monitor.done();
+    }
+    return status;
+  }
+
+  private void performRefreshes(IProgressMonitor monitor)
+  {
+    IADTObject[] nodes = getNodesToRefresh();
+
+    for (int index = 0; index < nodes.length; index++)
+    {
+      if (monitor.isCanceled())
+      {
+        throw new OperationCanceledException();
+      }
+      IADTObject node = nodes[index];
+      doRefresh(node);
+    }
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ExtensibleContentOutlinePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ExtensibleContentOutlinePage.java
index 1c668a4..4e19a56 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ExtensibleContentOutlinePage.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ExtensibleContentOutlinePage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -44,7 +44,7 @@
 
   public void createControl(Composite parent)
   {
-    treeViewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+    treeViewer = new TreeViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL);
     treeViewer.addSelectionChangedListener(this);
   }
 
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAttributeDeclarationAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAttributeDeclarationAction.java
index c55b4b5..7c113fe 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAttributeDeclarationAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAttributeDeclarationAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -26,7 +26,9 @@
 
 public class AddXSDAttributeDeclarationAction extends XSDBaseAction
 {
-  public static String ID = "AddXSDAttributeAction"; //$NON-NLS-1$
+  public static String ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction.AddXSDAttributeAction"; //$NON-NLS-1$
+  public static String BEFORE_SELECTED_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction.BEFORE_SELECTED_ID"; //$NON-NLS-1$  
+  public static String AFTER_SELECTED_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction.AFTER_SELECTED_ID"; //$NON-NLS-1$  
   public static String REF_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeReferenceAction"; //$NON-NLS-1$
   boolean isReference = false;
   
@@ -71,6 +73,7 @@
       XSDAttributeUse xsdAttributeUse = (XSDAttributeUse) selection;
       XSDConcreteComponent parent = null;
       XSDComplexTypeDefinition ct = null;
+      XSDAttributeGroupDefinition group = null;
       for (parent = xsdAttributeUse.getContainer(); parent != null;)
       {
         if (parent instanceof XSDComplexTypeDefinition)
@@ -78,11 +81,26 @@
           ct = (XSDComplexTypeDefinition) parent;
           break;
         }
+        else if (parent instanceof XSDAttributeGroupDefinition)
+        {
+          group = (XSDAttributeGroupDefinition)parent;
+          break;
+        }
         parent = parent.getContainer();
       }
       if (ct != null)
       {
-        command = new AddXSDAttributeDeclarationCommand(Messages._UI_ACTION_ADD_ATTRIBUTE, ct);
+        XSDAttributeUse sel = (XSDAttributeUse) selection;
+        int index = ct.getAttributeContents().indexOf(sel);
+        command = new AddXSDAttributeDeclarationCommand(Messages._UI_ACTION_ADD_ATTRIBUTE, ct, getId(), index);
+        command.setReference(isReference);
+        getCommandStack().execute(command);
+      }
+      else if (group != null)
+      {
+        XSDAttributeUse sel = (XSDAttributeUse) selection;
+        int index = group.eContents().indexOf(sel);
+        command = new AddXSDAttributeDeclarationCommand(Messages._UI_ACTION_ADD_ATTRIBUTE, group, getId(), index);
         command.setReference(isReference);
         getCommandStack().execute(command);
       }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDElementAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDElementAction.java
index edc35b0..68bd64a 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDElementAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDElementAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,12 +23,15 @@
 import org.eclipse.xsd.XSDModelGroup;
 import org.eclipse.xsd.XSDModelGroupDefinition;
 import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.impl.XSDModelGroupImpl;
 
 //revisit this and see if we can reuse AddFieldAction??
 
 public class AddXSDElementAction extends XSDBaseAction
 {
   public static String ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction"; //$NON-NLS-1$
+  public static String BEFORE_SELECTED_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction.BEFORE_SELECTED_ID"; //$NON-NLS-1$
+  public static String AFTER_SELECTED_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction.AFTER_SELECTED_ID"; //$NON-NLS-1$
   public static String REF_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementReferenceAction"; //$NON-NLS-1$
   boolean isReference;
   
@@ -99,6 +102,8 @@
       XSDConcreteComponent parent = null;
       XSDComplexTypeDefinition ct = null;
       XSDModelGroupDefinition group = null;
+      XSDModelGroupImpl ctGroup = null;
+
       for (parent = xsdConcreteComponent.getContainer(); parent != null; )
       {
         if (parent instanceof XSDComplexTypeDefinition)
@@ -111,6 +116,11 @@
           group = (XSDModelGroupDefinition)parent;
           break;
         }
+        else if (parent instanceof XSDModelGroupImpl)
+        {
+          ctGroup = (XSDModelGroupImpl) parent;
+          break;
+        }
         parent = parent.getContainer();
       }
       if (ct != null)
@@ -119,7 +129,15 @@
         command.setReference(isReference);
         getCommandStack().execute(command);
       }
-      if (group != null)
+      else if (ctGroup != null)
+      {
+        XSDElementDeclaration sel = (XSDElementDeclaration) selection;
+        int index = ctGroup.getContents().indexOf(sel.eContainer());
+        command = new AddXSDElementCommand(getText(), ctGroup, getId(), index);
+        command.setReference(isReference);
+        getCommandStack().execute(command);
+      }
+      else if (group != null)
       {
         command = new AddXSDElementCommand(getText(), group);
         command.setReference(isReference);
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDEnumerationFacetAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDEnumerationFacetAction.java
new file mode 100644
index 0000000..fe4c11f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDEnumerationFacetAction.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.common.actions;
+
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDComplexTypeDefinitionAdapter;
+import org.eclipse.wst.xsd.ui.internal.common.commands.AddEnumerationsCommand;
+import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDEnumerationFacet;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+public class AddXSDEnumerationFacetAction extends XSDBaseAction
+{
+  public static String ID = "org.eclipse.wst.xsd.ui.AddXSDEnumerationFacetAction"; //$NON-NLS-1$
+  public static String BEFORE_SELECTED_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDEnumerationFacetAction.BEFORE_SELECTED_ID"; //$NON-NLS-1$
+  public static String AFTER_SELECTED_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDEnumerationFacetAction.AFTER_SELECTED_ID"; //$NON-NLS-1$
+  
+  public AddXSDEnumerationFacetAction(IWorkbenchPart part, String id, String label)
+  {
+    super(part);
+    setText(label);
+    setId(id);
+  }
+  
+  public AddXSDEnumerationFacetAction(IWorkbenchPart part)
+  {
+    super(part);
+    setText(Messages._UI_ACTION_ADD_ENUMERATION);
+    setId(ID);
+  }
+
+  public void run()
+  {
+    Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
+
+    if (selection instanceof XSDBaseAdapter)
+    {
+      selection = ((XSDBaseAdapter) selection).getTarget();
+      int index = -1;
+      AddEnumerationsCommand command = null;
+      XSDSimpleTypeDefinition st = null;
+      if (selection instanceof XSDSimpleTypeDefinition)
+      {
+        st = (XSDSimpleTypeDefinition)selection;
+        command = new AddEnumerationsCommand(getText(), st);
+      }
+      else if (selection instanceof XSDEnumerationFacet)
+      {
+        st = ((XSDEnumerationFacet)selection).getSimpleTypeDefinition();
+        index = st.getFacetContents().indexOf(selection);
+        doDirectEdit = true;
+        command = new AddEnumerationsCommand(getText(), st, getId(), index);
+      }
+      else if (selection instanceof XSDComplexTypeDefinition)  // Support for Complex Type's simple Content with enumerations
+      {
+    	st = (XSDSimpleTypeDefinition) ((XSDComplexTypeDefinition)selection).getContent();
+        command = new AddEnumerationsCommand(getText(), st);
+      }
+      else // null
+      {
+        return;
+      }
+      
+      List enumList = st.getEnumerationFacets();
+      
+      String newName = XSDCommonUIUtils.createUniqueEnumerationValue("value", enumList); //$NON-NLS-1$
+
+      command.setValue(newName);
+      getCommandStack().execute(command);
+      addedComponent = command.getAddedComponent();
+      Adapter adapter = XSDAdapterFactory.getInstance().adapt(addedComponent);
+      selectAddedComponent(adapter);
+    }
+  }
+  
+  protected boolean calculateEnabled() {
+		
+		boolean parentResult = super.calculateEnabled();
+		boolean endResult = true;
+		Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
+		if (selection instanceof XSDComplexTypeDefinitionAdapter)
+		{
+			XSDComplexTypeDefinition definition = ((XSDComplexTypeDefinitionAdapter) selection).getXSDComplexTypeDefinition();
+			XSDTypeDefinition baseType = definition.getBaseType();
+			if (baseType instanceof XSDSimpleTypeDefinition)
+				endResult = false;
+		}
+		endResult = endResult & parentResult;
+		return endResult;
+	}
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinableContentAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinableContentAction.java
new file mode 100644
index 0000000..8b8c19c
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinableContentAction.java
@@ -0,0 +1,229 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.common.actions;
+
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.core.search.scope.SearchScope;
+import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSearchListDialog;
+import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSearchListDialogConfiguration;
+import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
+import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentDescriptionProvider;
+import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList;
+import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentSearchListProvider;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
+import org.eclipse.wst.xsd.ui.internal.common.commands.AddRedefinedComponentCommand;
+import org.eclipse.wst.xsd.ui.internal.editor.Messages;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDRedefinableComponent;
+import org.eclipse.xsd.XSDRedefine;
+
+
+public abstract class AddXSDRedefinableContentAction extends XSDBaseAction
+{
+  protected AddXSDRedefinableContentAction(IWorkbenchPart part, String ID, String text)
+  {
+    super(part);
+    setText(text);
+    setId(ID);
+  }
+
+  public void run()
+  {
+    Object selection = ((IStructuredSelection)getSelection()).getFirstElement();
+
+    if (selection instanceof XSDBaseAdapter)
+    {
+      selection = ((XSDBaseAdapter)selection).getTarget();
+    }
+
+    if (selection instanceof XSDRedefine)
+    {
+      ComponentSearchListDialogConfiguration configuration = new ComponentSearchListDialogConfiguration();
+      configuration.setDescriptionProvider(new RedefineDescriptor());
+      configuration.setSearchListProvider(new RedefineSearchListProvider((XSDRedefine)selection, this));
+      ComponentSearchListDialog dialog = new ComponentSearchListDialog(Display.getDefault().getActiveShell(), Messages._UI_LABEL_REDEFINE_COMPONENT, configuration)
+      {
+        protected Control createDialogArea(Composite parent)
+        {
+          // Adjust the dialog's initial size.
+          
+          Composite mainComposite = (Composite)super.createDialogArea(parent);
+          GridData gridData = (GridData)mainComposite.getLayoutData();
+          gridData.heightHint = 500;
+          gridData.widthHint = 350;
+          return mainComposite;
+        }
+      };
+      dialog.create();
+      dialog.setBlockOnOpen(true);
+      int result = dialog.open();
+
+      if (result == Window.OK)
+      {
+        ComponentSpecification selectedComponent = dialog.getSelectedComponent();
+        buildRedefine((XSDRedefine)selection, selectedComponent);
+      }
+    }
+  }
+
+  protected abstract AddRedefinedComponentCommand getCommand(XSDRedefine redefine, XSDRedefinableComponent redefinableComponent);
+  
+  protected abstract void buildComponentsList(XSDRedefine xsdRedefine, Set redefinedComponentsNames, IComponentList componentList);
+  
+  protected void buildRedefine(XSDRedefine redefine, ComponentSpecification selectedComponent)
+  {
+    XSDRedefinableComponent redefinableComponent = (XSDRedefinableComponent)selectedComponent.getObject();
+    AddRedefinedComponentCommand command = getCommand(redefine, redefinableComponent);
+    getCommandStack().execute(command);
+    addedComponent = command.getAddedComponent();
+  }
+
+  class RedefineSearchListProvider implements IComponentSearchListProvider
+  {
+    XSDRedefine xsdRedefine;
+    AddXSDRedefinableContentAction action;    
+    
+    public RedefineSearchListProvider(XSDRedefine xsdRedefine, AddXSDRedefinableContentAction action)
+    {
+      this.xsdRedefine = xsdRedefine;
+      this.action = action;
+    }
+
+    // Should refactor this to have a separate subclass for each type of redefine.
+    public void populateComponentList(IComponentList list, SearchScope scope, IProgressMonitor pm)
+    {      
+      List currentRedefines = xsdRedefine.getContents();
+      Set redefinedComponentsNames = new HashSet(currentRedefines.size());
+      Iterator redefinesIterator = currentRedefines.iterator();
+      while (redefinesIterator.hasNext())
+      {
+        XSDRedefinableComponent component = (XSDRedefinableComponent)redefinesIterator.next();
+        String redefinedComponentName = component.getName();
+        redefinedComponentsNames.add(redefinedComponentName);
+      }
+      action.buildComponentsList(xsdRedefine, redefinedComponentsNames, list);      
+    }
+  }
+
+  class RedefineDescriptor implements IComponentDescriptionProvider
+  {
+    public IFile getFile(Object component)
+    {
+      if (component instanceof XSDNamedComponent)
+      {
+    	if (((XSDNamedComponent)component).getSchema() == null)
+    	{
+    	  return null;
+    	}
+        String location = ((XSDNamedComponent)component).getSchema().getSchemaLocation();
+        String platformResource = "platform:/resource"; //$NON-NLS-1$
+        if (location != null && location.startsWith(platformResource))
+        {
+          Path path = new Path(location.substring(platformResource.length()));
+          return ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+        }
+      }
+      return null;
+    }
+
+    public Image getFileIcon(Object component)
+    {
+      return XSDEditorPlugin.getXSDImage("icons/XSDFile.gif"); //$NON-NLS-1$
+    }
+
+    public ILabelProvider getLabelProvider()
+    {
+      return new XSDRedefineComponentsLabelProvider();
+    }
+
+    public String getName(Object component)
+    {
+      if (component instanceof XSDNamedComponent)
+      {
+        return ((XSDNamedComponent)component).getName();
+      }
+      return "";
+    }
+
+    public String getQualifier(Object component)
+    {
+      if (component instanceof XSDNamedComponent)
+      {
+        return ((XSDNamedComponent)component).getTargetNamespace();
+      }
+      return "";
+    }
+
+    public boolean isApplicable(Object component)
+    {
+      return true;
+    }
+
+  }
+
+  protected abstract Image getRedefinedComponentImage();
+  
+  class XSDRedefineComponentsLabelProvider implements ILabelProvider
+  {
+
+    public Image getImage(Object element)
+    {
+      Image image = getRedefinedComponentImage();
+      return image;
+    }
+
+    public String getText(Object element)
+    {
+      if (element instanceof XSDNamedComponent)
+      {
+        return ((XSDNamedComponent)element).getName();
+      }
+      return "";
+    }
+
+    public void addListener(ILabelProviderListener listener)
+    {
+    }
+
+    public void dispose()
+    {
+    }
+
+    public boolean isLabelProperty(Object element, String property)
+    {
+      return false;
+    }
+
+    public void removeListener(ILabelProviderListener listener)
+    {
+    }
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedAttributeGroupAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedAttributeGroupAction.java
new file mode 100644
index 0000000..5f5b0e4
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedAttributeGroupAction.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.common.actions;
+
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList;
+import org.eclipse.wst.xsd.ui.internal.common.commands.AddRedefinedComponentCommand;
+import org.eclipse.wst.xsd.ui.internal.common.commands.RedefineAttributeGroupCommand;
+import org.eclipse.wst.xsd.ui.internal.editor.Messages;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDRedefinableComponent;
+import org.eclipse.xsd.XSDRedefine;
+
+
+public class AddXSDRedefinedAttributeGroupAction extends AddXSDRedefinableContentAction
+{
+  public static final String ID = "org.eclipse.wst.xsd.ui.actions.RedefineAttributeGroup"; //$NON-NLS-1$
+
+  public AddXSDRedefinedAttributeGroupAction(IWorkbenchPart part)
+  {
+    super(part, ID, Messages._UI_ACTION_REDEFINE_ATTRIBUTE_GROUP);
+  }
+
+  protected AddRedefinedComponentCommand getCommand(XSDRedefine redefine, XSDRedefinableComponent redefinableComponent)
+  {
+    AddRedefinedComponentCommand command = new RedefineAttributeGroupCommand(
+      Messages._UI_ACTION_REDEFINE_ATTRIBUTE_GROUP,
+      redefine,
+      redefinableComponent);
+    return command;
+  }
+
+  protected void buildComponentsList(XSDRedefine xsdRedefine, Set redefinedComponentsNames, IComponentList componentList)
+  {
+    List attributeGroups = xsdRedefine.getIncorporatedSchema().getAttributeGroupDefinitions();
+    Iterator iterator = attributeGroups.iterator();
+    while (iterator.hasNext())
+    {
+      XSDAttributeGroupDefinition attributeGroupDefinition = (XSDAttributeGroupDefinition)iterator.next();
+      String attributeGroupDefinitionName = attributeGroupDefinition.getName();
+      if (!redefinedComponentsNames.contains(attributeGroupDefinitionName))
+      {
+        componentList.add(attributeGroupDefinition);
+      }
+    }
+  }
+  
+  protected Image getRedefinedComponentImage()
+  {
+    return XSDEditorPlugin.getXSDImage(Messages._UI_IMAGE_ATTRIBUTE_GROUP);
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedComplexTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedComplexTypeAction.java
new file mode 100644
index 0000000..901d5a6
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedComplexTypeAction.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.common.actions;
+
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList;
+import org.eclipse.wst.xsd.ui.internal.common.commands.AddRedefinedComponentCommand;
+import org.eclipse.wst.xsd.ui.internal.common.commands.RedefineComplexTypeCommand;
+import org.eclipse.wst.xsd.ui.internal.editor.Messages;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDRedefinableComponent;
+import org.eclipse.xsd.XSDRedefine;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+
+public class AddXSDRedefinedComplexTypeAction extends AddXSDRedefinableContentAction
+{
+  public static final String ID = "org.eclipse.wst.xsd.ui.actions.RedefineComplexType"; //$NON-NLS-1$
+
+  public AddXSDRedefinedComplexTypeAction(IWorkbenchPart part)
+  {
+    super(part, ID, Messages._UI_ACTION_REDEFINE_COMPLEX_TYPE);
+  }
+
+  protected AddRedefinedComponentCommand getCommand(XSDRedefine redefine, XSDRedefinableComponent redefinableComponent)
+  {
+    AddRedefinedComponentCommand command = new RedefineComplexTypeCommand(
+      Messages._UI_ACTION_REDEFINE_COMPLEX_TYPE,
+      redefine,
+      redefinableComponent);
+    return command;
+  }
+
+  protected void buildComponentsList(XSDRedefine xsdRedefine, Set redefinedComponentsNames, IComponentList componentList)
+  {
+    List typeDefinitions = xsdRedefine.getIncorporatedSchema().getTypeDefinitions();
+    Iterator iterator = typeDefinitions.iterator();
+    while (iterator.hasNext())
+    {
+      XSDTypeDefinition typeDefinition = (XSDTypeDefinition)iterator.next();
+      String typeDefinitionName = typeDefinition.getName();
+      if (typeDefinition instanceof XSDComplexTypeDefinition && !redefinedComponentsNames.contains(typeDefinitionName))
+      {
+        componentList.add(typeDefinition);
+      }
+    }
+  }
+  
+  protected Image getRedefinedComponentImage()
+  {
+    return XSDEditorPlugin.getXSDImage(Messages._UI_IMAGE_COMPLEX_TYPE);
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedModelGroupAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedModelGroupAction.java
new file mode 100644
index 0000000..d3839a9
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedModelGroupAction.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.common.actions;
+
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList;
+import org.eclipse.wst.xsd.ui.internal.common.commands.AddRedefinedComponentCommand;
+import org.eclipse.wst.xsd.ui.internal.common.commands.RedefineModelGroupCommand;
+import org.eclipse.wst.xsd.ui.internal.editor.Messages;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDRedefinableComponent;
+import org.eclipse.xsd.XSDRedefine;
+
+
+public class AddXSDRedefinedModelGroupAction extends AddXSDRedefinableContentAction
+{
+  public static final String ID = "org.eclipse.wst.xsd.ui.actions.RedefineModelGroup"; //$NON-NLS-1$
+
+  public AddXSDRedefinedModelGroupAction(IWorkbenchPart part)
+  {
+    super(part, ID, Messages._UI_ACTION_REDEFINE_MODEL_GROUP);
+  }
+
+  protected AddRedefinedComponentCommand getCommand(XSDRedefine redefine, XSDRedefinableComponent redefinableComponent)
+  {
+    AddRedefinedComponentCommand command = new RedefineModelGroupCommand(
+      Messages._UI_ACTION_REDEFINE_MODEL_GROUP,
+      redefine,
+      redefinableComponent);
+    return command;
+  }
+
+  protected void buildComponentsList(XSDRedefine xsdRedefine, Set redefinedComponentsNames, IComponentList componentList)
+  {
+    List modelGroupList = xsdRedefine.getIncorporatedSchema().getModelGroupDefinitions();
+    Iterator iterator = modelGroupList.iterator();
+    while (iterator.hasNext())
+    {
+      XSDModelGroupDefinition modelGroupDefinition = (XSDModelGroupDefinition)iterator.next();
+      String modelGroupDefinitionName = modelGroupDefinition.getName();
+      if (!redefinedComponentsNames.contains(modelGroupDefinitionName))
+      {
+        componentList.add(modelGroupDefinition);
+      }
+    }
+  }
+  
+  protected Image getRedefinedComponentImage()
+  {
+    return XSDEditorPlugin.getXSDImage(Messages._UI_IMAGE_MODEL_GROUP);
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedSimpleTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedSimpleTypeAction.java
new file mode 100644
index 0000000..dd86050
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDRedefinedSimpleTypeAction.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.common.actions;
+
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList;
+import org.eclipse.wst.xsd.ui.internal.common.commands.AddRedefinedComponentCommand;
+import org.eclipse.wst.xsd.ui.internal.common.commands.RedefineSimpleTypeCommand;
+import org.eclipse.wst.xsd.ui.internal.editor.Messages;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
+import org.eclipse.xsd.XSDRedefinableComponent;
+import org.eclipse.xsd.XSDRedefine;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+
+
+public class AddXSDRedefinedSimpleTypeAction extends AddXSDRedefinableContentAction
+{
+  public static final String ID = "org.eclipse.wst.xsd.ui.actions.RedefineSimpleType"; //$NON-NLS-1$
+
+  public AddXSDRedefinedSimpleTypeAction(IWorkbenchPart part)
+  {
+    super(part, ID, Messages._UI_ACTION_REDEFINE_SIMPLE_TYPE);
+  }
+
+  public AddRedefinedComponentCommand getCommand(XSDRedefine redefine, XSDRedefinableComponent redefinableComponent)
+  {
+    AddRedefinedComponentCommand command = new RedefineSimpleTypeCommand(
+      Messages._UI_ACTION_REDEFINE_SIMPLE_TYPE,
+      redefine,
+      redefinableComponent);
+    return command;
+  }
+
+  protected void buildComponentsList(XSDRedefine xsdRedefine, Set redefinedComponentsNames, IComponentList componentList)
+  {
+    List typeDefinitions = xsdRedefine.getIncorporatedSchema().getTypeDefinitions();
+    Iterator iterator = typeDefinitions.iterator();
+    while (iterator.hasNext())
+    {
+      XSDTypeDefinition typeDefinition = (XSDTypeDefinition)iterator.next();
+      String typeDefinitionName = typeDefinition.getName();
+      if (typeDefinition instanceof XSDSimpleTypeDefinition && !redefinedComponentsNames.contains(typeDefinitionName))
+      {
+        componentList.add(typeDefinition);
+      }
+    }
+
+  }
+  
+  protected Image getRedefinedComponentImage()
+  {
+    return XSDEditorPlugin.getXSDImage(Messages._UI_IMAGE_SIMPLE_TYPE);
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDSchemaDirectiveAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDSchemaDirectiveAction.java
index a9d833a..0324f1c 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDSchemaDirectiveAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDSchemaDirectiveAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,10 +16,13 @@
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaDirectiveAdapter;
 import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDImportCommand;
 import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDIncludeCommand;
 import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDRedefineCommand;
 import org.eclipse.wst.xsd.ui.internal.common.commands.BaseCommand;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesSchemaLocationUpdater;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
 import org.eclipse.xsd.XSDSchema;
 
 public class AddXSDSchemaDirectiveAction extends XSDBaseAction
@@ -68,8 +71,22 @@
     {
       Adapter adapter = XSDAdapterFactory.getInstance().adapt(command.getAddedComponent());
       if (adapter != null)
+      {
+    	  provider.setSelection(new StructuredSelection(adapter));
+        // Automatically open the schema location dialog if the preference is enabled
+        if(XSDEditorPlugin.getDefault().getAutomaticallyOpenSchemaLocationDialogSetting())
+        {
+          XSDSchemaDirectiveAdapter xsdSchemaDirectiveAdapter = null;
+          if(adapter instanceof XSDSchemaDirectiveAdapter)
+          {
+            xsdSchemaDirectiveAdapter = (XSDSchemaDirectiveAdapter)adapter;
+          }    	  
+          XSDDirectivesSchemaLocationUpdater.updateSchemaLocation((XSDSchema) selection, xsdSchemaDirectiveAdapter.getTarget(), 
+            		(command instanceof AddXSDIncludeCommand || command instanceof AddXSDRedefineCommand));
+        }
+        // The graphical view may deselect, so select again
         provider.setSelection(new StructuredSelection(adapter));
+      }
     }
-
   }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/DeleteXSDConcreteComponentAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/DeleteXSDConcreteComponentAction.java
index d95791b..abfe49d 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/DeleteXSDConcreteComponentAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/DeleteXSDConcreteComponentAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -24,6 +24,10 @@
 import org.eclipse.xsd.XSDConcreteComponent;
 import org.eclipse.xsd.XSDSchema;
 
+/**
+ * @deprecated Use org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction
+ *
+ */
 public class DeleteXSDConcreteComponentAction extends XSDBaseAction
 {
   public static final String DELETE_XSD_COMPONENT_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction";   //$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/OpenInNewEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/OpenInNewEditor.java
index e27c20b..1efade0 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/OpenInNewEditor.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/OpenInNewEditor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -42,6 +42,7 @@
 import org.eclipse.wst.xsd.ui.internal.editor.XSDFileEditorInput;
 import org.eclipse.xsd.XSDConcreteComponent;
 import org.eclipse.xsd.XSDFeature;
+import org.eclipse.xsd.XSDRedefine;
 import org.eclipse.xsd.XSDSchema;
 import org.eclipse.xsd.XSDSchemaDirective;
 import org.eclipse.xsd.impl.XSDImportImpl;
@@ -114,7 +115,8 @@
           fComponent = dir.getResolvedSchema();
         }
       } // Handle any other external components
-      else if (fComponent.getSchema() != null && fComponent.eContainer() instanceof XSDSchema || isReference)
+      else if (fComponent.getSchema() != null && fComponent.eContainer() instanceof XSDSchema ||
+          fComponent.eContainer() instanceof XSDRedefine || isReference)
       {
         schemaLocation = URIHelper.removePlatformResourceProtocol(fComponent.getSchema().getSchemaLocation());
         schemaPath = new Path(schemaLocation);
@@ -281,7 +283,18 @@
     {
       if (schemaLocation != null && !schemaLocation.startsWith("http"))
       {
-        String fileLocation = URIHelper.removeProtocol(schemaLocation);
+        String fileLocation = null;
+        // This is to workaround the difference in URI resolution. On linux, the resolved location is
+        // platform:/resource/   On Windows, it's file://
+        // 
+       	if (java.io.File.separatorChar == '/')
+      	{
+          fileLocation = "/" + URIHelper.removePlatformResourceProtocol(schemaLocation);
+      	}
+    	  else // Windows
+      	{
+          fileLocation = URIHelper.removeProtocol(schemaLocation);
+      	}
         IPath schemaPath = new Path(fileLocation);
         IFileStore fileStore = EFS.getLocalFileSystem().getStore(schemaPath);
         if (!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists())
@@ -426,9 +439,12 @@
 
   public static void openExternalFiles(IWorkbenchPage page, String schemaLocation, XSDConcreteComponent fComponent)
   {
-    IPath schemaPath = new Path(schemaLocation);  // URIHelper.removeProtocol(schemaLocation));
-    String device = schemaPath.getDevice();
-    if (!device.startsWith("http"))
+    if (schemaLocation == null) return;  // Assert not null
+  
+    IPath schemaPath = new Path(schemaLocation);
+//  Initially tried to use schemaPath.getDevice() to determine if it is an http reference.  However, on Linux, it is null.
+//  So as a result of bug 221421, we will just use the schemaLocation.
+    if (!schemaLocation.startsWith("http"))
     {
       schemaPath = new Path(URIHelper.removeProtocol(schemaLocation));
     }
@@ -474,7 +490,7 @@
     {
       try
       {
-        if (device.startsWith("http"))
+        if (schemaLocation.startsWith("http"))
         {
           try
           {
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetBaseTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetBaseTypeAction.java
new file mode 100644
index 0000000..dbc3a45
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetBaseTypeAction.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.common.actions;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
+import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
+import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
+import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDComplexTypeBaseTypeEditManager;
+import org.eclipse.wst.xsd.ui.internal.editor.search.XSDSearchListDialogDelegate;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+
+public class SetBaseTypeAction extends XSDBaseAction
+{
+  public static String ID = "org.eclipse.wst.xsd.ui.internal.common.actions.setBaseType"; //$NON-NLS-1$
+
+  public SetBaseTypeAction(IWorkbenchPart part)
+  {
+    super(part);
+    setText(Messages._UI_ACTION_SET_BASE_TYPE + "..."); //$NON-NLS-1$
+    setId(ID);
+  }
+  
+  public void run()
+  {
+    Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
+
+    if (selection instanceof XSDBaseAdapter)
+    {
+      selection = ((XSDBaseAdapter) selection).getTarget();
+      
+      boolean complexType = selection instanceof XSDComplexTypeDefinition;
+      boolean simpleType = selection instanceof XSDSimpleTypeDefinition;
+      
+      if (complexType || simpleType)
+      {
+        
+        if (getWorkbenchPart() instanceof IEditorPart)
+        {
+          IEditorPart editor = (IEditorPart)getWorkbenchPart();
+
+          ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDComplexTypeBaseTypeEditManager.class);
+          ComponentSpecification newValue;
+          IComponentDialog dialog = null;
+          dialog = manager.getBrowseDialog();
+          if (dialog != null)
+          {
+        	if(simpleType)
+        	{
+        		((XSDSearchListDialogDelegate) dialog).showComplexTypes(false);
+        	}
+            if (dialog.createAndOpen() == Window.OK)
+            {
+              newValue = dialog.getSelectedComponent();
+              manager.modifyComponentReference(selection, newValue);
+            }
+          }
+        }
+      }
+    }
+  }
+
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetTypeAction.java
index 6b879ad..2083e4f 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetTypeAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetTypeAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,6 +14,7 @@
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
 import org.eclipse.wst.xsd.ui.internal.common.commands.SetTypeCommand;
+import org.eclipse.wst.xsd.ui.internal.editor.Messages;
 import org.eclipse.xsd.XSDConcreteComponent;
 
 public class SetTypeAction extends XSDBaseAction
@@ -40,7 +41,7 @@
 
       if (target instanceof XSDConcreteComponent)
       {
-        command = new SetTypeCommand(getText(), getId(), (XSDConcreteComponent) target);
+        command = new SetTypeCommand(Messages._UI_ACTION_SET_TYPE, getId(), (XSDConcreteComponent) target);
         command.setAdapter((XSDBaseAdapter) selection);
         getCommandStack().execute(command);
       }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/XSDBaseAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/XSDBaseAction.java
index 3edf43f..472d960 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/XSDBaseAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/XSDBaseAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,6 +17,7 @@
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
 import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart;
+import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.IAutoDirectEdit;
 import org.eclipse.wst.xsd.ui.internal.design.editparts.TopLevelComponentEditPart;
 import org.eclipse.xsd.XSDConcreteComponent;
 import org.eclipse.xsd.XSDSchema;
@@ -72,5 +73,9 @@
       BaseFieldEditPart editPart = (BaseFieldEditPart)obj;
       editPart.doEditName(!(part instanceof ContentOutline));
     }
+    else if (obj instanceof IAutoDirectEdit)
+    {
+      ((IAutoDirectEdit)obj).doEditName(!(part instanceof ContentOutline));
+    }
   }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddEnumerationsCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddEnumerationsCommand.java
index f8c2a51..6cb8fa7 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddEnumerationsCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddEnumerationsCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,6 +10,9 @@
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.common.commands;
 
+import java.util.List;
+
+import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDEnumerationFacetAction;
 import org.eclipse.xsd.XSDEnumerationFacet;
 import org.eclipse.xsd.XSDFactory;
 import org.eclipse.xsd.XSDSimpleTypeDefinition;
@@ -19,13 +22,26 @@
 {
   XSDSimpleTypeDefinition simpleType;
   String value;
+  // The index of the currently selected item.  If no item is selected, index will be less than 0
+  private int index = -1;  
+  // Determines where the element should be inserted based on the currently selected element.  If no
+  // element is selected, use the default behaviour of appending the element to the end
+  private String addEnumerationLocation;
   
   public AddEnumerationsCommand(String label, XSDSimpleTypeDefinition simpleType)
   {
     super(label);
     this.simpleType = simpleType;
   }
-  
+
+  public AddEnumerationsCommand(String label, XSDSimpleTypeDefinition simpleType, String ID, int index)
+  {
+    super(label);
+    this.simpleType = simpleType;
+    this.index = index;
+    this.addEnumerationLocation = ID;
+  }
+
   public void setValue(String value)
   {
     this.value = value; 
@@ -39,12 +55,44 @@
       XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
       XSDEnumerationFacet enumerationFacet = factory.createXSDEnumerationFacet();
       enumerationFacet.setLexicalValue(value);
-      simpleType.getFacetContents().add(enumerationFacet);
+      
+      index = getInsertionIndex();
+      List facets = simpleType.getFacetContents();
+      if (index >=0 && index < facets.size())
+      {
+        facets.add(index, enumerationFacet);
+      }
+      else
+      {
+        facets.add(enumerationFacet);
+      }
       formatChild(simpleType.getElement());
+      addedXSDConcreteComponent = enumerationFacet;
     }
     finally
     {
       endRecording();
     }
   }
+  
+  protected int getInsertionIndex()
+  {
+    if (index < 0)
+      return -1;
+
+    if (addEnumerationLocation.equals(AddXSDEnumerationFacetAction.BEFORE_SELECTED_ID))
+    {
+      return index;
+    }
+    else if (addEnumerationLocation.equals(AddXSDEnumerationFacetAction.AFTER_SELECTED_ID))
+    {
+      index++;
+      return index;
+    }
+    else
+    {
+      return -1;
+    }
+  }
+
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionAttributeCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionAttributeCommand.java
index 2e6616b..8ee0c52 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionAttributeCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionAttributeCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -45,8 +45,8 @@
       namespacePrefix = handleNamespacePrefices();
 
       attributeQName = namespacePrefix + ":" + attribute.getName(); //$NON-NLS-1$
-      String value = component.getElement().getAttribute(attributeQName);
-      if (value == null)
+     
+      if (!(component.getElement().hasAttribute(attributeQName)))
       {
         appInfoAttributeAdded = true;
         component.getElement().setAttribute(attributeQName, ""); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionElementCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionElementCommand.java
index 561a218..2446901 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionElementCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionElementCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -139,7 +139,7 @@
       String xmlnsColon = "xmlns:"; //$NON-NLS-1$
       String attributeName = xmlnsColon + prefix;
       int count = 0;
-      while (schemaElement.getAttribute(attributeName) != null)
+      while (schemaElement.hasAttribute(attributeName))
       {
         count++;
         prefix = basePrefix + count;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddRedefinedComponentCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddRedefinedComponentCommand.java
new file mode 100644
index 0000000..05ecede
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddRedefinedComponentCommand.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.common.commands;
+
+
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeGroupDefinitionAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDComplexTypeDefinitionAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDModelGroupDefinitionAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDSimpleTypeDefinitionAdapter;
+import org.eclipse.xsd.XSDRedefinableComponent;
+import org.eclipse.xsd.XSDRedefine;
+import org.w3c.dom.Element;
+
+
+/**
+ * Base class for commands that add redefined components to a schema redefine. 
+ */
+public abstract class AddRedefinedComponentCommand extends BaseCommand
+{
+  protected XSDRedefine redefine;
+
+  protected XSDRedefinableComponent redefinableComponent;
+
+  public AddRedefinedComponentCommand(String label, XSDRedefine redefine, XSDRedefinableComponent redefinableComponent)
+  {
+    super(label);
+    this.redefine = redefine;
+    this.redefinableComponent = redefinableComponent;
+  }
+
+  protected abstract void doExecute();
+
+  public void execute()
+  {
+    Element element = redefine.getElement();
+
+    try
+    {
+      beginRecording(element);
+      doExecute();
+	  Object adapter =  redefinableComponent.eAdapters().get(0);
+	  if (adapter instanceof XSDComplexTypeDefinitionAdapter)
+	  {    		 
+		  ((XSDComplexTypeDefinitionAdapter)adapter).updateDeletedMap(redefinableComponent.getName());
+      }
+	  else if (adapter instanceof XSDSimpleTypeDefinitionAdapter)
+	  {    		 
+		  ((XSDSimpleTypeDefinitionAdapter)adapter).updateDeletedMap(redefinableComponent.getName());
+      }
+	  else if (adapter instanceof XSDAttributeGroupDefinitionAdapter)
+	  {    		 
+		  ((XSDAttributeGroupDefinitionAdapter)adapter).updateDeletedMap(redefinableComponent.getName());
+      }
+      else if (adapter instanceof XSDModelGroupDefinitionAdapter)
+	  {    		 
+		  ((XSDModelGroupDefinitionAdapter)adapter).updateDeletedMap(redefinableComponent.getName());
+      }
+      redefine.getContents().add(addedXSDConcreteComponent);
+      formatChild(addedXSDConcreteComponent.getElement());
+    }
+    finally
+    {
+      endRecording();
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAttributeDeclarationCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAttributeDeclarationCommand.java
index cf6a7c6..00df7e0 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAttributeDeclarationCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAttributeDeclarationCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -33,7 +33,12 @@
   XSDConcreteComponent parent;
   boolean isReference;
   private String nameToAdd;
-
+  // The index of the currently selected item.  If no item is selected, index will be less than 0
+  private int index = -1;
+  // Determines where the attribute should be inserted based on the currently selected attribute.  If no
+  // attribute is selected, use the default behaviour of appending the attribute to the end
+  private String addAttributeLocation;  
+  
   public AddXSDAttributeDeclarationCommand(String label, XSDComplexTypeDefinition xsdComplexTypeDefinition)
   {
     super(label);
@@ -45,7 +50,42 @@
     super(label);
     this.parent = parent;
   }
+  
+  public AddXSDAttributeDeclarationCommand(String label, XSDConcreteComponent parent, String addAttributeLocation, int index)
+  {
+    super(label);
+    if (parent instanceof XSDComplexTypeDefinition)
+    {
+      this.xsdComplexTypeDefinition = (XSDComplexTypeDefinition) parent;
+    }
+    else
+    {
+      this.parent = parent;
+    }
+    this.addAttributeLocation = addAttributeLocation;
+    this.index = index;
+  }
+  
+  protected int getInsertionIndex()
+  {
+    if (index < 0)
+      return -1;
 
+    if (addAttributeLocation.equals(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction.BEFORE_SELECTED_ID))
+    {
+      return index;
+    }
+    else if (addAttributeLocation.equals(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction.AFTER_SELECTED_ID))
+    {
+      index++;
+      return index;
+    }
+    else
+    {
+      return -1;
+    }
+  }
+  
   public void execute()
   {
     XSDAttributeDeclaration attribute = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
@@ -69,7 +109,15 @@
 
         if (xsdComplexTypeDefinition.getAttributeContents() != null)
         {
-          xsdComplexTypeDefinition.getAttributeContents().add(attributeUse);
+          index = getInsertionIndex();
+          if (index >= 0 && index < xsdComplexTypeDefinition.getAttributeContents().size())
+          {
+            xsdComplexTypeDefinition.getAttributeContents().add(index, attributeUse);
+          }
+          else
+          {
+            xsdComplexTypeDefinition.getAttributeContents().add(attributeUse);
+          }
           formatChild(xsdComplexTypeDefinition.getElement());
         }
       }
@@ -105,7 +153,15 @@
           attributeUse.setAttributeDeclaration(attribute);
           attributeUse.setContent(attribute);
 
-          ((XSDAttributeGroupDefinition) parent).getResolvedAttributeGroupDefinition().getContents().add(attributeUse);
+          index = getInsertionIndex();
+          if (index >= 0 && index < (((XSDAttributeGroupDefinition) parent).getResolvedAttributeGroupDefinition().getContents().size()))
+          {
+            ((XSDAttributeGroupDefinition) parent).getResolvedAttributeGroupDefinition().getContents().add(index, attributeUse);
+          }
+          else
+          {
+            ((XSDAttributeGroupDefinition) parent).getResolvedAttributeGroupDefinition().getContents().add(attributeUse);
+          }
           formatChild(parent.getElement());
         }
       }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDElementCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDElementCommand.java
index 448f738..a1bdff6 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDElementCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDElementCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -36,7 +36,12 @@
   XSDSchema xsdSchema;
   boolean isReference;
   private String nameToAdd;
-
+  // The index of the currently selected item.  If no item is selected, index will be less than 0
+  private int index = -1;  
+  // Determines where the element should be inserted based on the currently selected element.  If no
+  // element is selected, use the default behaviour of appending the element to the end
+  private String addElementLocation; 
+  
   public AddXSDElementCommand()
   {
     super();
@@ -68,6 +73,14 @@
     super(label);
     this.xsdModelGroup = xsdModelGroup;
   }
+  
+  public AddXSDElementCommand(String label, XSDModelGroup xsdModelGroup, String ID, int index)
+  {
+    super(label);
+    this.xsdModelGroup = xsdModelGroup;
+    this.index = index;
+    this.addElementLocation = ID;
+  }
 
   public AddXSDElementCommand(String label, XSDSchema xsdSchema)
   {
@@ -80,8 +93,34 @@
     this.isReference = isReference;
   }
   
-  public void setNameToAdd(String name){
-	  nameToAdd = name;
+  public void setNameToAdd(String name)
+  {
+    nameToAdd = name;
+  }
+  
+  public void setAddElementLocation(String LocationType)
+  {
+    addElementLocation = LocationType;
+  }
+  
+  protected int getInsertionIndex()
+  {
+    if (index < 0)
+      return -1;
+
+    if (addElementLocation.equals(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction.BEFORE_SELECTED_ID))
+    {
+      return index;
+    }
+    else if (addElementLocation.equals(org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction.AFTER_SELECTED_ID))
+    {
+      index++;
+      return index;
+    }
+    else
+    {
+      return -1;
+    }
   }
   
   /*
@@ -131,7 +170,15 @@
         beginRecording(xsdSchema.getElement());
         if (!isReference)
         {
-          xsdModelGroup.getContents().add(createXSDElementDeclaration());
+        	index = getInsertionIndex();
+        	if(index >= 0 && index < xsdModelGroup.getContents().size())
+        	{        		
+        		xsdModelGroup.getContents().add(index,createXSDElementDeclaration());
+        	}
+        	else
+        	{
+        		xsdModelGroup.getContents().add(createXSDElementDeclaration());
+        	}
         }
         else
         {
@@ -177,6 +224,7 @@
 
     XSDConcreteComponent comp = xsdModelGroup.getContainer();
     ArrayList usedAttributeNames = new ArrayList();
+    XSDCommonUIUtils.resetVisitedGroupsStack();
     usedAttributeNames.addAll(XSDCommonUIUtils.getChildElements(xsdModelGroup));    
     while (comp != null)
     {
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/BaseCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/BaseCommand.java
index 7a2334e..dbbca4c 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/BaseCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/BaseCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -46,7 +46,11 @@
 
   public BaseCommand(String label)
   {
-    super(label);
+    // Commands inherit their name from the associated action.
+    // This label shows up in the undo menu and it would look ugly with the mnemonic in it.
+    // Ideally, we'd have separate strings.
+
+    super(label.replaceFirst("&", ""));
   }
   
   public XSDConcreteComponent getAddedComponent()
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/DeleteCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/DeleteCommand.java
index c86acec..09cc838 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/DeleteCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/DeleteCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,8 +10,15 @@
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.common.commands;
 
+import org.eclipse.emf.common.util.EList;
 import org.eclipse.emf.ecore.EObject;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeGroupDefinitionAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDComplexTypeDefinitionAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDModelGroupDefinitionAdapter;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDSimpleTypeDefinitionAdapter;
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDVisitor;
+import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
 import org.eclipse.xsd.XSDAttributeDeclaration;
 import org.eclipse.xsd.XSDAttributeGroupDefinition;
 import org.eclipse.xsd.XSDAttributeUse;
@@ -22,8 +29,10 @@
 import org.eclipse.xsd.XSDModelGroup;
 import org.eclipse.xsd.XSDModelGroupDefinition;
 import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDRedefine;
 import org.eclipse.xsd.XSDSchema;
 import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
 import org.eclipse.xsd.XSDWildcard;
 import org.eclipse.xsd.util.XSDConstants;
 
@@ -36,6 +45,12 @@
     super(label);
     this.target = target;
   }
+  
+  public DeleteCommand(XSDConcreteComponent target)
+  {
+    super(Messages._UI_ACTION_DELETE);
+    this.target = target;
+  }
 
   public void execute()
   {
@@ -53,13 +68,15 @@
     };
 
     XSDConcreteComponent parent = target.getContainer();
+    XSDSchema schema = target.getSchema();
 
     try
     {
       beginRecording(parent.getElement());
-
+      boolean doCleanup = false;
       if (target instanceof XSDModelGroup || target instanceof XSDElementDeclaration || target instanceof XSDModelGroupDefinition)
       {
+        doCleanup = true;
         if (parent instanceof XSDParticle)
         {
           if (parent.getContainer() instanceof XSDModelGroup)
@@ -79,10 +96,20 @@
           visitor.visitSchema(target.getSchema());
           ((XSDSchema) parent).getContents().remove(target);
         }
-
+        else if (parent instanceof XSDRedefine)
+        {
+        	Object adapter = target.eAdapters().get(0);
+        	if (adapter instanceof XSDModelGroupDefinitionAdapter)
+            {
+          	 ((XSDModelGroupDefinitionAdapter) adapter).setReadOnly(true);
+          	 ((XSDModelGroupDefinitionAdapter) adapter).setChangeReadOnlyField(true);
+            }
+          ((XSDRedefine) parent).getContents().remove(target);
+        }      
       }
       else if (target instanceof XSDAttributeDeclaration)
       {
+        doCleanup = true;
         if (parent instanceof XSDAttributeUse)
         {
           EObject obj = parent.eContainer();
@@ -116,6 +143,7 @@
       }
       else if (target instanceof XSDAttributeGroupDefinition && parent instanceof XSDComplexTypeDefinition)
       {
+        doCleanup = true;
         ((XSDComplexTypeDefinition) parent).getAttributeContents().remove(target);
       }
       else if (target instanceof XSDEnumerationFacet)
@@ -142,19 +170,48 @@
           ((XSDAttributeGroupDefinition) parent).setAttributeWildcardContent(null);
         }
       }
-      else if (target instanceof XSDComplexTypeDefinition && parent instanceof XSDElementDeclaration)
+      else if (target instanceof XSDTypeDefinition && parent instanceof XSDElementDeclaration)
       {
+        doCleanup = true;
         ((XSDElementDeclaration) parent).setTypeDefinition(target.resolveSimpleTypeDefinition(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "string"));
       }
       else
       {
         if (parent instanceof XSDSchema)
         {
+          doCleanup = true;
           visitor.visitSchema(target.getSchema());
           ((XSDSchema) parent).getContents().remove(target);
         }
+        else if(parent instanceof XSDRedefine)
+        {
+          doCleanup = false;
+          EList contents = ((XSDRedefine)parent).getContents();    
+          Object adapter = target.eAdapters().get(0);
+          if (adapter instanceof XSDComplexTypeDefinitionAdapter)
+          {
+        	  
+        	 ((XSDComplexTypeDefinitionAdapter) adapter).setReadOnly(true);
+        	 ((XSDComplexTypeDefinitionAdapter) adapter).setChangeReadOnlyField(true);
+          }
+          else if (adapter instanceof XSDSimpleTypeDefinitionAdapter)
+          {
+        	  
+        	 ((XSDSimpleTypeDefinitionAdapter) adapter).setReadOnly(true);
+        	 ((XSDSimpleTypeDefinitionAdapter) adapter).setChangeReadOnlyField(true);
+          }
+          else if (adapter instanceof XSDAttributeGroupDefinitionAdapter)
+          {
+        	  
+        	 ((XSDAttributeGroupDefinitionAdapter) adapter).setReadOnly(true);
+        	 ((XSDAttributeGroupDefinitionAdapter) adapter).setChangeReadOnlyField(true);
+          }
+          contents.remove(target);
+        }
       }
 
+      if (doCleanup)
+        XSDDirectivesManager.removeUnusedXSDImports(schema);
     }
     finally
     {
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/ExtensibleAddExtensionCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/ExtensibleAddExtensionCommand.java
index 9e37158..6ce4c73 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/ExtensibleAddExtensionCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/ExtensibleAddExtensionCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -159,7 +159,7 @@
       String xmlnsColon = "xmlns:"; //$NON-NLS-1$
       String attributeName = xmlnsColon + prefix;
       int count = 0;
-      while (schemaElement.getAttribute(attributeName) != null)
+      while (schemaElement.hasAttribute(attributeName))
       {
         count++;
         prefix = basePrefix + count;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineAttributeGroupCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineAttributeGroupCommand.java
new file mode 100644
index 0000000..3d473b4
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineAttributeGroupCommand.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.common.commands;
+
+
+import org.eclipse.xsd.XSDAttributeGroupDefinition;
+import org.eclipse.xsd.XSDFactory;
+import org.eclipse.xsd.XSDRedefinableComponent;
+import org.eclipse.xsd.XSDRedefine;
+
+
+/**
+ * Creates a redefined attribute group based on the input attribute group and adds it to the parent redefine.
+ */
+public class RedefineAttributeGroupCommand extends AddRedefinedComponentCommand
+{
+  public RedefineAttributeGroupCommand(String label, XSDRedefine redefine, XSDRedefinableComponent redefinableComponent)
+  {
+    super(label, redefine, redefinableComponent);
+  }
+
+  protected void doExecute()
+  {
+    XSDAttributeGroupDefinition redefinedAttributeGroupDefinition = XSDFactory.eINSTANCE.createXSDAttributeGroupDefinition();
+    redefinedAttributeGroupDefinition.setName(redefinableComponent.getName());
+    addedXSDConcreteComponent = redefinedAttributeGroupDefinition;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineComplexTypeCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineComplexTypeCommand.java
new file mode 100644
index 0000000..34dad50
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineComplexTypeCommand.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.common.commands;
+
+
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDDerivationMethod;
+import org.eclipse.xsd.XSDFactory;
+import org.eclipse.xsd.XSDRedefinableComponent;
+import org.eclipse.xsd.XSDRedefine;
+
+
+/**
+ * Creates a redefined complex type based on the input complex type and adds it to the parent redefine.
+ */
+public class RedefineComplexTypeCommand extends AddRedefinedComponentCommand
+{
+  public RedefineComplexTypeCommand(String label, XSDRedefine redefine, XSDRedefinableComponent redefinableComponent)
+  {
+    super(label, redefine, redefinableComponent);
+  }
+
+  protected void doExecute()
+  {
+    XSDComplexTypeDefinition redefinedComplexTypeDefinition = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
+    redefinedComplexTypeDefinition.setName(redefinableComponent.getName());
+    redefinedComplexTypeDefinition.setContent(XSDFactory.eINSTANCE.createXSDComplexTypeDefinition().getContent());
+    redefinedComplexTypeDefinition.setDerivationMethod(XSDDerivationMethod.EXTENSION_LITERAL);
+    redefinedComplexTypeDefinition.setBaseTypeDefinition((XSDComplexTypeDefinition)redefinableComponent);
+    addedXSDConcreteComponent = redefinedComplexTypeDefinition;
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineModelGroupCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineModelGroupCommand.java
new file mode 100644
index 0000000..7366eeb
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineModelGroupCommand.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.common.commands;
+
+
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDRedefinableComponent;
+import org.eclipse.xsd.XSDRedefine;
+
+
+/**
+ * Creates a redefined model group based on the input model group and adds it to the parent redefine.
+ */
+public class RedefineModelGroupCommand extends AddRedefinedComponentCommand
+{
+
+  public RedefineModelGroupCommand(String label, XSDRedefine redefine, XSDRedefinableComponent redefinableComponent)
+  {
+    super(label, redefine, redefinableComponent);
+  }
+
+  protected void doExecute()
+  {
+    XSDModelGroupDefinition modelGroup = (XSDModelGroupDefinition) redefinableComponent;
+    XSDModelGroupDefinition redefinedModelGroupDefinition = (XSDModelGroupDefinition)modelGroup.cloneConcreteComponent(true, false);
+    addedXSDConcreteComponent = redefinedModelGroupDefinition;
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineSimpleTypeCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineSimpleTypeCommand.java
new file mode 100644
index 0000000..00765ae
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RedefineSimpleTypeCommand.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.common.commands;
+
+
+import org.eclipse.xsd.XSDFactory;
+import org.eclipse.xsd.XSDRedefinableComponent;
+import org.eclipse.xsd.XSDRedefine;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+
+
+/**
+ * Creates a redefined simple type based on the input simple type and adds it to the parent redefine.
+ */
+public class RedefineSimpleTypeCommand extends AddRedefinedComponentCommand
+{
+  public RedefineSimpleTypeCommand(String label, XSDRedefine redefine, XSDRedefinableComponent redefinableComponent)
+  {
+    super(label, redefine, redefinableComponent);
+  }
+
+  protected void doExecute()
+  {
+    XSDSimpleTypeDefinition redefinedSimpleTypeDefinition = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
+    redefinedSimpleTypeDefinition.setName(redefinableComponent.getName());
+    redefinedSimpleTypeDefinition.setBaseTypeDefinition((XSDSimpleTypeDefinition)redefinableComponent);
+    addedXSDConcreteComponent = redefinedSimpleTypeDefinition;
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetBaseTypeAndManagerDirectivesCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetBaseTypeAndManagerDirectivesCommand.java
index ebb7967..1ec47ce 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetBaseTypeAndManagerDirectivesCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetBaseTypeAndManagerDirectivesCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
 package org.eclipse.wst.xsd.ui.internal.common.commands;
 
 import org.eclipse.core.resources.IFile;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
 import org.eclipse.xsd.XSDComponent;
 import org.eclipse.xsd.XSDConcreteComponent;
 import org.eclipse.xsd.XSDTypeDefinition;
@@ -33,6 +34,7 @@
       {
         SetBaseTypeCommand command = new SetBaseTypeCommand(concreteComponent, (XSDTypeDefinition) td);
         command.execute();
+        XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
       }
     }
     catch (Exception e)
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetBaseTypeCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetBaseTypeCommand.java
index e1106e5..7b74ec9 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetBaseTypeCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetBaseTypeCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
 
 import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
 import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
+import org.eclipse.xsd.XSDComplexTypeContent;
 import org.eclipse.xsd.XSDComplexTypeDefinition;
 import org.eclipse.xsd.XSDConcreteComponent;
 import org.eclipse.xsd.XSDDerivationMethod;
@@ -41,9 +42,11 @@
       beginRecording(concreteComponent.getElement());
       if (concreteComponent instanceof XSDComplexTypeDefinition)
       {
-        XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition) concreteComponent;
-
-        if (baseType instanceof XSDSimpleTypeDefinition)
+        XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition) concreteComponent;        
+        XSDComplexTypeContent contentType = (baseType instanceof XSDComplexTypeDefinition) ? ((XSDComplexTypeDefinition)baseType).getContentType() : null;
+        
+        // Complex type simple content
+        if (baseType instanceof XSDSimpleTypeDefinition || (contentType != null &&  contentType instanceof XSDSimpleTypeDefinition))
         {
           if (!(complexType.getContent() instanceof XSDSimpleTypeDefinition))
           {
@@ -51,9 +54,19 @@
             complexType.setContent(simpleContent);
           }
         }
-
-        complexType.setBaseTypeDefinition(baseType);
+        // Complex type complex content
+        else if(baseType instanceof XSDComplexTypeDefinition)
+        {
+        	if(!(complexType.getContent() instanceof XSDComplexTypeDefinition))
+        	{
+        		XSDComplexTypeDefinition complexContent = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
+        		complexType.setContent(complexContent.getContent());
+        	}
+        }        
         complexType.setDerivationMethod(XSDDerivationMethod.EXTENSION_LITERAL);
+        complexType.setBaseTypeDefinition(baseType);
+        // vb This call should not be needed. The XSD Infoset model should reconcile itself properly.
+        complexType.updateElement(true);
         formatChild(complexType.getElement());
       }
       else if (concreteComponent instanceof XSDSimpleTypeDefinition)
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetXSDFacetValueCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetXSDFacetValueCommand.java
index 3d71717..45c6884 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetXSDFacetValueCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetXSDFacetValueCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,6 +23,13 @@
     this.facet = facet;
   }
   
+  public SetXSDFacetValueCommand(String label, XSDFacet facet, String value)
+  {
+    super(label);
+    this.facet = facet;
+    this.value = value;
+  }
+  
   public void setValue(String value)
   {
     this.value = value; 
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeReferenceAndManagerDirectivesCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeReferenceAndManagerDirectivesCommand.java
index f042a6b..7d38b4c 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeReferenceAndManagerDirectivesCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeReferenceAndManagerDirectivesCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
 package org.eclipse.wst.xsd.ui.internal.common.commands;
 
 import org.eclipse.core.resources.IFile;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
 import org.eclipse.xsd.XSDAttributeDeclaration;
 import org.eclipse.xsd.XSDComponent;
 import org.eclipse.xsd.XSDConcreteComponent;
@@ -45,6 +46,7 @@
         UpdateAttributeReferenceCommand command = new UpdateAttributeReferenceCommand(org.eclipse.wst.xsd.ui.internal.editor.Messages._UI_ACTION_UPDATE_ATTRIBUTE_REFERENCE, (XSDAttributeDeclaration) concreteComponent,
             (XSDAttributeDeclaration) componentDef);
         command.execute();
+        XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
       }
     }
     catch (Exception e)
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeValueCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeValueCommand.java
index cc443d3..b76f241 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeValueCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeValueCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -42,7 +42,12 @@
   public UpdateAttributeValueCommand(Element element, String attributeName, String attributeValue, String label)
   {
     this(element, attributeName, attributeValue, false);
-    setLabel(NLS.bind(Messages._UI_ACTION_CHANGE, label));
+
+    // The command label is shared with the actual UI label, which contains 
+    // mnemonics and colon characters. Since we don't want these to show up in 
+    // the undo menu we do a little bit of regular expression magic here to remove them.
+    
+    setLabel(NLS.bind(Messages._UI_ACTION_CHANGE, label.replaceAll("[&:]", "")));
   }
   
   public UpdateAttributeValueCommand(Element element, String attributeName, String attributeValue)
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateComplexTypeDerivationBy.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateComplexTypeDerivationBy.java
index 6c0bbab..facae6a 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateComplexTypeDerivationBy.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateComplexTypeDerivationBy.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
 import org.eclipse.xsd.XSDComplexTypeDefinition;
 import org.eclipse.xsd.XSDDerivationMethod;
+import org.eclipse.xsd.XSDTypeDefinition;
 import org.eclipse.xsd.util.XSDConstants;
 
 public class UpdateComplexTypeDerivationBy extends BaseCommand
@@ -34,6 +35,7 @@
     try
     {
       beginRecording(complexType.getElement());
+      XSDTypeDefinition originalBaseType = complexType.getBaseType();
       if (derivation.equals(XSDConstants.EXTENSION_ELEMENT_TAG))
       {
         complexType.setDerivationMethod(XSDDerivationMethod.EXTENSION_LITERAL);
@@ -42,6 +44,7 @@
       {
         complexType.setDerivationMethod(XSDDerivationMethod.RESTRICTION_LITERAL);
       }
+      complexType.setBaseTypeDefinition(originalBaseType);
     }
     finally
     {
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateElementReferenceAndManageDirectivesCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateElementReferenceAndManageDirectivesCommand.java
index d280181..b8aeb47 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateElementReferenceAndManageDirectivesCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateElementReferenceAndManageDirectivesCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
 package org.eclipse.wst.xsd.ui.internal.common.commands;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
 import org.eclipse.xsd.XSDComponent;
 import org.eclipse.xsd.XSDConcreteComponent;
 import org.eclipse.xsd.XSDElementDeclaration;
@@ -44,6 +45,7 @@
         UpdateElementReferenceCommand command = new UpdateElementReferenceCommand(Messages._UI_ACTION_UPDATE_ELEMENT_REFERENCE, (XSDElementDeclaration) concreteComponent,
             (XSDElementDeclaration) elementDef);
         command.execute();
+        XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
       }
     }
     catch (Exception e)
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateMaxOccursCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateMaxOccursCommand.java
index c49051f..d159eb1 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateMaxOccursCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateMaxOccursCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -35,8 +35,7 @@
     {
       Element element = particle.getElement();
       beginRecording(element);
-      String currentMax = element.getAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-      removeMaxOccursAttribute = (currentMax == null)? true: false;
+      removeMaxOccursAttribute = (!(element.hasAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE)))? true: false;
 		  oldMaxOccurs = particle.getMaxOccurs();
 		  particle.setMaxOccurs(newMaxOccurs);
     }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateMinOccursCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateMinOccursCommand.java
index 364523f..5e31766 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateMinOccursCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateMinOccursCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -38,8 +38,7 @@
     try
     {
       beginRecording(element);
-      String currentMin = element.getAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
-      removeMinOccursAttribute = (currentMin == null) ? true : false;
+      removeMinOccursAttribute = (!(element.hasAttribute(XSDConstants.MINOCCURS_ATTRIBUTE))) ? true : false;
 
       if (component instanceof XSDParticle)
       {
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateNamespaceInformationCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateNamespaceInformationCommand.java
index f0791b6..35efdd6 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateNamespaceInformationCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateNamespaceInformationCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -101,7 +101,7 @@
           updateAllNodes(element, xsdForXSDPrefix);
 
           // remove the old xmlns attribute for the schema for schema
-          if (element.getAttribute("xmlns") != null && //$NON-NLS-1$
+          if (element.hasAttribute("xmlns")  && //$NON-NLS-1$
               element.getAttribute("xmlns").equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) //$NON-NLS-1$
           {
             element.removeAttribute("xmlns"); //$NON-NLS-1$
@@ -123,7 +123,7 @@
         else
         // if no prefix
         {
-          if (element.getAttribute("xmlns") != null) //$NON-NLS-1$
+          if (element.hasAttribute("xmlns")) //$NON-NLS-1$
           {
             if (!element.getAttribute("xmlns").equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) //$NON-NLS-1$
             {
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateTypeReferenceAndManageDirectivesCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateTypeReferenceAndManageDirectivesCommand.java
index fa34bbe..0ed77b3 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateTypeReferenceAndManageDirectivesCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateTypeReferenceAndManageDirectivesCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
 package org.eclipse.wst.xsd.ui.internal.common.commands;
 
 import org.eclipse.core.resources.IFile;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
 import org.eclipse.xsd.XSDComponent;
 import org.eclipse.xsd.XSDConcreteComponent;
 import org.eclipse.xsd.XSDSchema;
@@ -47,6 +48,7 @@
       {
         UpdateTypeReferenceCommand command = new UpdateTypeReferenceCommand(concreteComponent, (XSDTypeDefinition) td);
         command.execute();
+        XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
       }
     }
     catch (Exception e)
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractExtensionsSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractExtensionsSection.java
index 8a80a25..c0705c6 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractExtensionsSection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractExtensionsSection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -324,7 +324,7 @@
     PlatformUI.getWorkbench().getHelpSystem().setHelp(addButton,
     		XSDEditorCSHelpIds.EXTENSIONS_TAB__ADD);     
     
-    removeButton = getWidgetFactory().createButton(buttonComposite, Messages._UI_ACTION_DELETE, SWT.FLAT);
+    removeButton = getWidgetFactory().createButton(buttonComposite, Messages._UI_DELETE_BUTTON, SWT.FLAT);
     removeButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
     removeButton.addSelectionListener(this);
     removeButton.setToolTipText(Messages._UI_ACTION_DELETE_EXTENSION_COMPONENT);
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSection.java
index 128f9c0..1d07b36 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -42,6 +42,7 @@
 import org.eclipse.ui.ide.FileStoreEditorInput;
 import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
 import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+import org.eclipse.wst.xsd.ui.internal.editor.Messages;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
 import org.eclipse.xsd.XSDComponent;
 import org.eclipse.xsd.XSDConcreteComponent;
@@ -59,6 +60,7 @@
   protected CustomListener customListener = new CustomListener();
   protected IEditorPart owningEditor;
   private IStatusLineManager statusLine;
+  protected boolean isTraversing = false;
   
   public static final Image ICON_ERROR = XSDEditorPlugin.getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
   
@@ -362,5 +364,33 @@
         }
       }
     }
+    
+    protected boolean shouldPerformComboSelection(int eventType, Object selectedItem)
+    {
+      // if traversing through combobox, don't automatically pop up
+      // the browse and new dialog boxes
+      boolean wasTraversing = isTraversing;
+      if (isTraversing)
+        isTraversing = false;
 
+      // we only care about default selecting (hitting enter in combobox)
+      // for browse.. and new.. otherwise, selection event will be fired
+      if (eventType == SWT.DefaultSelection)
+      {
+        if (selectedItem instanceof String && ((Messages._UI_COMBO_BROWSE.equals(selectedItem) || Messages._UI_COMBO_NEW.equals(selectedItem))))
+          return true;
+        return false;
+      }
+
+      // if was traversing and got selection event, do nothing if it's 
+      // browse.. or new..
+      if (wasTraversing && selectedItem instanceof String)
+      {
+        if (Messages._UI_COMBO_BROWSE.equals(selectedItem) || Messages._UI_COMBO_NEW.equals(selectedItem))
+        {
+          return false;
+        }
+      }
+      return true;
+    }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AnnotationSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AnnotationSection.java
index 2215338..8de7f40 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AnnotationSection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AnnotationSection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -116,6 +116,10 @@
             simpleText.setText(doSerialize(docElement));
           }
         }
+        else
+        {
+            simpleText.setText("");
+        }
       }
       catch (Exception e)
       {
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/EnumerationsSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/EnumerationsSection.java
index e33e4a1..e8e2add 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/EnumerationsSection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/EnumerationsSection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -46,6 +46,7 @@
 import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
 import org.eclipse.wst.xsd.ui.internal.common.commands.SetXSDFacetValueCommand;
 import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
 import org.eclipse.wst.xsd.ui.internal.widgets.EnumerationsDialog;
 import org.eclipse.xsd.XSDEnumerationFacet;
@@ -74,24 +75,10 @@
     if (e.widget == addButton)
     {
       List enumList = st.getEnumerationFacets();
-      StringBuffer newName = new StringBuffer("value1"); //$NON-NLS-1$
-      int suffix = 1;
-      for (Iterator i = enumList.iterator(); i.hasNext();)
-      {
-        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) i.next();
-        String value = enumFacet.getLexicalValue();
-        if (value != null)
-        {
-          if (value.equals(newName.toString()))
-          {
-            suffix++;
-            newName = new StringBuffer("value" + String.valueOf(suffix)); //$NON-NLS-1$
-          }
-        }
-      }
+      String newName = XSDCommonUIUtils.createUniqueEnumerationValue("value", enumList); //$NON-NLS-1$
 
       AddEnumerationsCommand command = new AddEnumerationsCommand(Messages._UI_ACTION_ADD_ENUMERATION, (XSDSimpleTypeDefinition) input);
-      command.setValue(newName.toString());
+      command.setValue(newName);
       getCommandStack().execute(command);
 
       enumerationsTable.refresh();
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/MultiplicitySection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/MultiplicitySection.java
index 94593d4..556acfa 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/MultiplicitySection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/MultiplicitySection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -178,14 +178,14 @@
           Element element = particle.getElement();
           if (element != null)
           {
-            String min = element.getAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
-            String max = element.getAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-            if (min != null && refreshMinText)
+            if (element.hasAttribute(XSDConstants.MINOCCURS_ATTRIBUTE) && refreshMinText)
             {
+              String min = element.getAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
               minCombo.setText(min);
             }
-            if (max != null && refreshMaxText)
+            if (element.hasAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE) && refreshMaxText)
             {
+              String max = element.getAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
               maxCombo.setText(max);
             }
           }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/RefactoringSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/RefactoringSection.java
index 1a915a3..b9efd04 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/RefactoringSection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/RefactoringSection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
 package org.eclipse.wst.xsd.ui.internal.common.properties.sections;
 
 import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.IEditorPart;
@@ -22,7 +23,7 @@
 import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
 import org.eclipse.wst.xsd.ui.internal.editor.ISelectionMapper;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.actions.RenameComponentAction;
+import org.eclipse.wst.xsd.ui.internal.refactor.handlers.RenameHandler;
 import org.eclipse.xsd.XSDSchema;
 
 public abstract class RefactoringSection extends AbstractSection implements IHyperlinkListener
@@ -31,6 +32,8 @@
    * Clicking on it invokes the refactor->rename action.
    */
   private ImageHyperlink renameHyperlink;
+  
+  protected boolean hideHyperLink;
 
   /**
    * Invokes the refactor->rename action on the current selection.
@@ -39,14 +42,18 @@
   {
     IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
     XSDSchema schema = (XSDSchema) editor.getAdapter(XSDSchema.class);
-    ISelection selection = editor.getSite().getSelectionProvider().getSelection();
+    ISelection selection = new StructuredSelection(input);
     ISelectionMapper mapper = (ISelectionMapper) editor.getAdapter(ISelectionMapper.class);
     selection = mapper != null ? mapper.mapSelection(selection) : selection;
-    RenameComponentAction action = new RenameComponentAction(selection, schema);
-    action.update(selection);
-    action.run();
+    RenameHandler renameHandler = new RenameHandler();
+    renameHandler.execute(selection, schema);
   }
 
+  protected void showLink(boolean isVisible)
+  {
+	  renameHyperlink.setVisible(isVisible);
+  }
+  
   /**
    * Creates the refactor/rename hyperlink shown beside a component name.
    * Clicking on the hyperlink invokes the refactor/rename action.
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SchemaLocationSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SchemaLocationSection.java
index 52058b5..e8798bb 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SchemaLocationSection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SchemaLocationSection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,11 +10,6 @@
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.common.properties.sections;
 
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.CLabel;
 import org.eclipse.swt.custom.StyledText;
@@ -22,20 +17,13 @@
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.ui.internal.viewers.ResourceFilter;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesSchemaLocationUpdater;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.wizards.XSDSelectIncludeFileWizard;
 import org.eclipse.xsd.XSDInclude;
 import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
 import org.eclipse.xsd.impl.XSDIncludeImpl;
 import org.eclipse.xsd.impl.XSDRedefineImpl;
 import org.w3c.dom.Element;
@@ -109,63 +97,14 @@
 
 		}
 		
-		public void doWidgetSelected(SelectionEvent event)
+    public void doWidgetSelected(SelectionEvent event)
     {
-			if (event.widget == wizardButton)
+      if (event.widget == wizardButton)
       {
-				Shell shell = Display.getCurrent().getActiveShell();
-
-				IFile currentIFile = null;
-        IEditorInput editorInput = getActiveEditor().getEditorInput();
-        ViewerFilter filter;
-        if (editorInput instanceof IFileEditorInput)
-        {
-          currentIFile = ((IFileEditorInput)editorInput).getFile();
-          filter = new ResourceFilter(new String[] { ".xsd" }, //$NON-NLS-1$ 
-              new IFile[] { currentIFile }, null);
-        }
-        else
-        {
-          filter = new ResourceFilter(new String[] { ".xsd" }, //$NON-NLS-1$ 
-              null, null);
-        }
-			      
-			  XSDSelectIncludeFileWizard fileSelectWizard = 
-			      new XSDSelectIncludeFileWizard(xsdSchema, true,
-			          XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_SCHEMA"), //$NON-NLS-1$
-			          XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_DESC"), //$NON-NLS-1$
-			          filter,
-			          (IStructuredSelection) getSelection());
-
-			  WizardDialog wizardDialog = new WizardDialog(shell, fileSelectWizard);
-			  wizardDialog.create();
-			  wizardDialog.setBlockOnOpen(true);
-			  int result = wizardDialog.open();
-				  
-	      String value = schemaLocationText.getText();
-	      if (result == Window.OK)
-	      {
-          errorText.setText(""); //$NON-NLS-1$
-	        IFile selectedIFile = fileSelectWizard.getResultFile();
-	        String schemaFileString = value;
-	        if (selectedIFile != null && currentIFile != null)
-	        {
-	          schemaFileString = URIHelper.getRelativeURI(selectedIFile.getLocation(), currentIFile.getLocation());
-	        }
-	        else if (selectedIFile != null && currentIFile == null)
-	        {
-	          schemaFileString = selectedIFile.getLocationURI().toString();
-	        }
-	        else
-	        {
-	          schemaFileString = fileSelectWizard.getURL();
-	        }
-
-          handleSchemaLocationChange(schemaFileString, fileSelectWizard.getNamespace(), null);
-	        refresh();
-			  } 
+        XSDDirectivesSchemaLocationUpdater.updateSchemaLocation(xsdSchema,input,true);
+        refresh();
       }
-		}
+    }
 
 		/*
 		 * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
@@ -205,18 +144,4 @@
 	  {
 	    return true;
 	  }
-    
-    protected void handleSchemaLocationChange(String schemaFileString, String namespace, XSDSchema externalSchema)
-    {
-      if (input instanceof XSDInclude)
-      {
-        Element element = ((XSDIncludeImpl) input).getElement();
-        element.setAttribute("schemaLocation", schemaFileString); //$NON-NLS-1$
-      }
-      else if (input instanceof XSDRedefine)
-      {
-        Element element = ((XSDRedefineImpl) input).getElement();
-        element.setAttribute("schemaLocation", schemaFileString); //$NON-NLS-1$
-      }
-    }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SpecificConstraintsWidget.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SpecificConstraintsWidget.java
index 4d9baa0..c13b65d 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SpecificConstraintsWidget.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SpecificConstraintsWidget.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -63,8 +63,6 @@
 import org.eclipse.xsd.XSDFeature;
 import org.eclipse.xsd.XSDPatternFacet;
 import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
 
 public class SpecificConstraintsWidget implements SelectionListener, Listener
 {
@@ -86,13 +84,28 @@
   CommandStack commandStack;
   XSDFacetSection facetSection;
 
+  /**
+   * @deprecated
+   * @param composite
+   * @param factory
+   * @param feature
+   * @param input
+   * @param facetSection
+   */
   public SpecificConstraintsWidget(Composite composite, TabbedPropertySheetWidgetFactory factory, XSDFeature feature, XSDSimpleTypeDefinition input, XSDFacetSection facetSection)
   {
+    this(composite, factory, feature, input, facetSection, ENUMERATION);
+  }
+
+  public SpecificConstraintsWidget(Composite composite, TabbedPropertySheetWidgetFactory factory, XSDFeature feature, XSDSimpleTypeDefinition input, XSDFacetSection facetSection, int kind)
+  {
     this.factory = factory;
     this.input = input;
     this.composite = composite;
     this.feature = feature;
     this.facetSection = facetSection;
+    this.kind = kind;
+    
     createControl(composite);
   }
 
@@ -182,7 +195,6 @@
     data.grabExcessHorizontalSpace = true;
     data.horizontalAlignment = GridData.FILL;
     editButton.setLayoutData(data);
-    editButton.setEnabled(false);
     editButton.addSelectionListener(this);
     
     
@@ -192,10 +204,9 @@
     data.grabExcessHorizontalSpace = true;
     data.horizontalAlignment = GridData.FILL;
     deleteButton.setLayoutData(data);
-    deleteButton.setEnabled(false);
     deleteButton.addSelectionListener(this);
 
-
+    setButtonStates(kind);
     return composite;
   }
 
@@ -223,29 +234,70 @@
 //    constraintsTableViewer.refresh();
   }
 
+  public int getConstraintKind()
+  {
+	  return this.kind;
+  }
+  
+  protected void setButtonStates(int kind)
+  {
+    boolean add, addUsing, delete, edit;
+
+    boolean listHasItems = false;
+    StructuredSelection selection = (StructuredSelection) constraintsTableViewer.getSelection();
+    if (selection != null)
+    {
+      if (selection.toList().size() > 0)
+      {
+        listHasItems = true;
+      }
+    }
+
+    if (kind == ENUMERATION)
+    {
+      add = true;
+      addUsing = true;
+      edit = false;
+    }
+    else if (kind == PATTERN)
+    {
+      add = false;
+      addUsing = true;
+      edit = listHasItems;
+    }
+    else
+    {
+      add = true;
+      addUsing = true;
+      edit = true;
+    }
+    delete = listHasItems;
+
+    if (!addButton.isDisposed())
+    {
+      addButton.setEnabled(add);
+    }
+    if (!addUsingDialogButton.isDisposed())
+    {
+      addUsingDialogButton.setEnabled(addUsing);
+    }
+    if (!deleteButton.isDisposed())
+    {
+      deleteButton.setEnabled(delete);
+    }
+    if (!editButton.isDisposed())
+    {
+      editButton.setEnabled(edit);
+    }
+  }  
+  
   public void widgetSelected(SelectionEvent e)
   {
     XSDSimpleTypeDefinition st = input;
-    Element element = st.getElement();
-
     if (e.widget == addButton)
     {
       List enumList = st.getEnumerationFacets();
-      StringBuffer newName = new StringBuffer("value1"); //$NON-NLS-1$
-      int suffix = 1;
-      for (Iterator i = enumList.iterator(); i.hasNext();)
-      {
-        XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) i.next();
-        String value = enumFacet.getLexicalValue();
-        if (value != null)
-        {
-          if (value.equals(newName.toString()))
-          {
-            suffix++;
-            newName = new StringBuffer("value" + String.valueOf(suffix)); //$NON-NLS-1$
-          }
-        }
-      }
+      String newName = XSDCommonUIUtils.createUniqueEnumerationValue("value", enumList); //$NON-NLS-1$
 
       if (kind == ENUMERATION)
       {
@@ -272,7 +324,7 @@
         }
 
         AddEnumerationsCommand command = new AddEnumerationsCommand(Messages._UI_ACTION_ADD_ENUMERATION, targetSimpleType);
-        command.setValue(newName.toString());
+        command.setValue(newName);
         compoundCommand.add(command);
         commandStack.execute(compoundCommand);
         setInput(input);
@@ -421,12 +473,6 @@
         }
         commandStack.execute(compoundCommand);
         constraintsTableViewer.refresh();
-
-        if (constraintsTableViewer.getTable().getItemCount() == 0)
-        {
-          editButton.setEnabled(false);
-          deleteButton.setEnabled(false);
-        }
       }
     }
     else if (e.widget == editButton)
@@ -457,27 +503,14 @@
           if (result == Window.OK)
           {
             String newPattern = wizard.getPattern();
-            element.setAttribute(XSDConstants.VALUE_ATTRIBUTE, newPattern);
             pattern.setLexicalValue(newPattern);
             constraintsTableViewer.refresh();
           }
         }
       }
     }
-    else if (e.widget == constraintsTableViewer.getTable())
-    {
-      StructuredSelection selection = (StructuredSelection) constraintsTableViewer.getSelection();
-      if (selection.getFirstElement() != null)
-      {
-        editButton.setEnabled(true);
-        deleteButton.setEnabled(true);
-      }
-      else
-      {
-        editButton.setEnabled(false);
-        deleteButton.setEnabled(false);
-      }
-    }
+    
+    setButtonStates(this.kind);
   }
   
   public void widgetDefaultSelected(SelectionEvent e)
@@ -489,12 +522,14 @@
   public void setConstraintKind(int kind)
   {
     this.kind = kind;
+    setButtonStates(kind);
     constraintsTableViewer.setInput(input);
     constraintsTableViewer.refresh();
   }
   
   public void doModify(Object element, String property, Object value)
   {
+    setButtonStates(this.kind);
     if (element instanceof TableItem && (value != null))
     {
       TableItem item = (TableItem) element;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAnyElementContentsSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAnyElementContentsSection.java
index 63e4898..a17ab48 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAnyElementContentsSection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAnyElementContentsSection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -26,7 +26,6 @@
 import org.eclipse.xsd.XSDParticle;
 import org.eclipse.xsd.XSDProcessContents;
 import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDConstants;
 
 public class XSDAnyElementContentsSection extends MultiplicitySection
 {
@@ -63,7 +62,7 @@
     data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
     data.grabExcessHorizontalSpace = false;
 
-    CLabel namespaceLabel = getWidgetFactory().createCLabel(composite, XSDConstants.NAMESPACE_ATTRIBUTE);
+    CLabel namespaceLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_ATTRIBUTES_NAMESPACE);
     namespaceLabel.setLayoutData(data);
 
     namespaceCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
@@ -77,7 +76,7 @@
     PlatformUI.getWorkbench().getHelpSystem().setHelp(namespaceCombo,
     		XSDEditorCSHelpIds.GENERAL_TAB__ANYELEMENT__NAMESPACE);
 
-    CLabel processContentsLabel = getWidgetFactory().createCLabel(composite, XSDConstants.PROCESSCONTENTS_ATTRIBUTE);
+    CLabel processContentsLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_ATTRIBUTES_PROCESSCONTENTS);
     data = new GridData();
     data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
     data.grabExcessHorizontalSpace = false;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAttributeDeclarationSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAttributeDeclarationSection.java
index 97987cd..1ab3e25 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAttributeDeclarationSection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAttributeDeclarationSection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -97,8 +97,16 @@
     // ------------------------------------------------------------------
     // Refactor/rename hyperlink
     // ------------------------------------------------------------------
-    createRenameHyperlink(composite);
-    setRenameHyperlinkEnabled(!isAttributeReference);
+    if (!hideHyperLink) 
+    {
+    	createRenameHyperlink(composite);
+		  setRenameHyperlinkEnabled(!isAttributeReference);
+    }
+    else
+    {
+   	  getWidgetFactory().createCLabel(composite, "");
+    }
+    
 
     // ------------------------------------------------------------------
     // Ref Label
@@ -121,11 +129,13 @@
 
       componentNameCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
       componentNameCombo.addSelectionListener(this);
+      componentNameCombo.addListener(SWT.Traverse, this);
       componentNameCombo.setLayoutData(data);
       
       PlatformUI.getWorkbench().getHelpSystem().setHelp(componentNameCombo,
           XSDEditorCSHelpIds.GENERAL_TAB__ATTRIBUTE__NAME);
 
+      // dummy
       getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
     }
     
@@ -143,6 +153,7 @@
     typeCombo = getWidgetFactory().createCCombo(composite);
     typeCombo.setLayoutData(data);
     typeCombo.addSelectionListener(this);
+    typeCombo.addListener(SWT.Traverse, this);
     
     PlatformUI.getWorkbench().getHelpSystem().setHelp(typeCombo,
     		XSDEditorCSHelpIds.GENERAL_TAB__ATTRIBUTE__TYPE);
@@ -257,8 +268,8 @@
       ComponentSpecification[] items = manager.getQuickPicks();
 
       typeCombo.removeAll();
-      typeCombo.add(Messages._UI_ACTION_BROWSE);
-      typeCombo.add(Messages._UI_ACTION_NEW);
+      typeCombo.add(Messages._UI_COMBO_BROWSE);
+      typeCombo.add(Messages._UI_COMBO_NEW);
       for (int i = 0; i < items.length; i++)
       {
         typeCombo.add(items[i].getName());
@@ -287,7 +298,7 @@
         for (int i=0; i < quickPicks.length; i++)
         {
           ComponentSpecification componentSpecification = quickPicks[i];
-          if (value.equals(componentSpecification.getName()))
+          if (value !=null && componentSpecification!=null && value.equals(componentSpecification.getName()))
           {
             return componentSpecification;
           }                
@@ -429,23 +440,59 @@
     return false;
   }
   
+  public void doWidgetDefaultSelected(SelectionEvent e)
+  {
+    if (e.widget == typeCombo)
+    {
+      String selection = typeCombo.getText();
+      if (shouldPerformComboSelection(SWT.DefaultSelection, selection))
+        handleWidgetSelection(e);
+    } else if (e.widget == componentNameCombo)
+    {
+      String selection = componentNameCombo.getText();
+      if (shouldPerformComboSelection(SWT.DefaultSelection, selection))
+        handleWidgetSelection(e);
+    } else
+    {
+      handleWidgetSelection(e);
+    }
+  }
+
   public void doWidgetSelected(SelectionEvent e)
   {
     if (e.widget == typeCombo)
     {
+      String selection = typeCombo.getText();
+      if (shouldPerformComboSelection(SWT.Selection, selection))
+        handleWidgetSelection(e);
+    } else if (e.widget == componentNameCombo)
+    {
+      String selection = componentNameCombo.getText();
+      if (shouldPerformComboSelection(SWT.Selection, selection))
+        handleWidgetSelection(e);
+    } else
+    {
+      handleWidgetSelection(e);
+    }
+  }
+  
+  private void handleWidgetSelection(SelectionEvent e)
+  {
+    if (e.widget == typeCombo)
+    {
       IEditorPart editor = getActiveEditor();
       if (editor == null) return;
-      ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDTypeReferenceEditManager.class);    
+      ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDTypeReferenceEditManager.class);
 
       String selection = typeCombo.getText();
       ComponentSpecification newValue;
       IComponentDialog dialog= null;
-      if ( selection.equals(Messages._UI_ACTION_BROWSE))
+      if ( selection.equals(Messages._UI_COMBO_BROWSE))
       {
         dialog = manager.getBrowseDialog();
         ((XSDSearchListDialogDelegate) dialog).showComplexTypes(false);
       }
-      else if ( selection.equals(Messages._UI_ACTION_NEW))
+      else if ( selection.equals(Messages._UI_COMBO_NEW))
       {
         dialog = manager.getNewDialog();
         ((NewTypeDialog) dialog).allowComplexType(false);
@@ -474,16 +521,16 @@
     {
       IEditorPart editor = getActiveEditor();
       if (editor == null) return;
-      ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDAttributeReferenceEditManager.class);    
+      ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDAttributeReferenceEditManager.class);
 
       String selection = componentNameCombo.getText();
       ComponentSpecification newValue;
       IComponentDialog dialog= null;
-      if ( selection.equals(Messages._UI_ACTION_BROWSE))
+      if ( selection.equals(Messages._UI_COMBO_BROWSE))
       {
         dialog = manager.getBrowseDialog();
       }
-      else if ( selection.equals(Messages._UI_ACTION_NEW))
+      else if ( selection.equals(Messages._UI_COMBO_NEW))
       {
         dialog = manager.getNewDialog();
       }
@@ -506,17 +553,16 @@
         if (newValue != null)
           manager.modifyComponentReference(input, newValue);
       }
-
     }
     else 
     {
-    	XSDAttributeDeclaration xsdAttribute = (XSDAttributeDeclaration) input;
-    	Element element = xsdAttribute.getElement();
+      XSDAttributeDeclaration xsdAttribute = (XSDAttributeDeclaration) input;
+      Element element = xsdAttribute.getElement();
       if (e.widget == usageCombo)
-	    {	      
-	      final String newValue = usageCombo.getText();
-	      if (element != null)
-	      {
+      {	      
+        final String newValue = usageCombo.getText();
+        if (element != null)
+        {
           PropertiesChangeCommand command = new PropertiesChangeCommand(element, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_USAGE)
           {
             protected void doExecuteSteps()
@@ -528,13 +574,13 @@
             }
           };
           getCommandStack().execute(command);
-	      }
-	    }
-	    else if (e.widget == formCombo)
-	    {
-	      final String newValue = formCombo.getText();
-	      if (element != null)
-	      {
+        }
+      }
+      else if (e.widget == formCombo)
+      {
+        final String newValue = formCombo.getText();
+        if (element != null)
+        {
           PropertiesChangeCommand command = new PropertiesChangeCommand(element, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_FORM)
           {
             protected void doExecuteSteps()
@@ -546,19 +592,19 @@
             }
           };
           getCommandStack().execute(command);
-	      }
-	    }
-	    else if (e.widget == defaultButton)
-	    {
-	    	boolean newValue = defaultButton.getSelection();
-	    	if (element != null)
-	    	{
-	    		if (newValue)
-	    		{
-	    			if (element.hasAttribute(XSDConstants.FIXED_ATTRIBUTE))
-	    			{
-	            final String value = element.getAttribute(XSDConstants.FIXED_ATTRIBUTE);
-              
+        }
+      }
+      else if (e.widget == defaultButton)
+      {
+        boolean newValue = defaultButton.getSelection();
+        if (element != null)
+        {
+          if (newValue)
+          {
+            if (element.hasAttribute(XSDConstants.FIXED_ATTRIBUTE))
+            {
+              final String value = element.getAttribute(XSDConstants.FIXED_ATTRIBUTE);
+
               PropertiesChangeCommand command = new PropertiesChangeCommand(element, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_DEFAULT)
               {
                 protected void doExecuteSteps()
@@ -568,20 +614,20 @@
                 }
               };
               getCommandStack().execute(command);
-	    			}
-	    		}
-	    	}
-	    }
-	    else if (e.widget == fixedButton)
-	    {
-	    	boolean newValue = fixedButton.getSelection();
-	    	if (element != null)
-	    	{
-	    		if (newValue)
-	    		{
-	    			if (element.hasAttribute(XSDConstants.DEFAULT_ATTRIBUTE))
-	    			{
-	            final String value = element.getAttribute(XSDConstants.DEFAULT_ATTRIBUTE);
+            }
+          }
+        }
+      }
+      else if (e.widget == fixedButton)
+      {
+        boolean newValue = fixedButton.getSelection();
+        if (element != null)
+        {
+          if (newValue)
+          {
+            if (element.hasAttribute(XSDConstants.DEFAULT_ATTRIBUTE))
+            {
+              final String value = element.getAttribute(XSDConstants.DEFAULT_ATTRIBUTE);
               PropertiesChangeCommand command = new PropertiesChangeCommand(element, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_FIXED)
               {
                 protected void doExecuteSteps()
@@ -591,16 +637,22 @@
                 }
               };
               getCommandStack().execute(command);
-	    			}
-	    		}
-	    	}
-	    }
+            }
+          }
+        }
+      }
     }
     super.doWidgetSelected(e);
   }
 
   protected void doHandleEvent(Event event)
   {
+    if (event.type == SWT.Traverse) {
+      if (event.detail == SWT.TRAVERSE_ARROW_NEXT || event.detail == SWT.TRAVERSE_ARROW_PREVIOUS) {
+        isTraversing = true;
+        return;
+      }
+    }
     super.doHandleEvent(event);
     if (event.widget == nameText)
     {
@@ -717,11 +769,17 @@
   public void dispose()
   {
     if (componentNameCombo != null && !componentNameCombo.isDisposed())
+    {
       componentNameCombo.removeSelectionListener(this);
+      componentNameCombo.removeListener(SWT.Traverse, this);
+    }
     if (nameText != null && !nameText.isDisposed())
       removeListeners(nameText);
     if (typeCombo != null && !typeCombo.isDisposed())
+    {
       typeCombo.removeSelectionListener(this);
+      typeCombo.removeListener(SWT.Traverse, this);
+    }
     super.dispose();
   }
 
@@ -741,6 +799,7 @@
     {
       XSDAttributeDeclaration xsdAttribute = (XSDAttributeDeclaration) input;
       isAttributeReference = xsdAttribute.isAttributeDeclarationReference();
+      hideHyperLink = !xsdAttribute.isGlobal() || isAttributeReference;
     }
   }
 
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAttributeGroupDefinitionSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAttributeGroupDefinitionSection.java
index 7a077ff..8a409f0 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAttributeGroupDefinitionSection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAttributeGroupDefinitionSection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -30,6 +30,7 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNameCommand;
 import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
 import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
 import org.eclipse.xsd.XSDAttributeGroupDefinition;
@@ -108,8 +109,16 @@
 
       // ------------------------------------------------------------------
       // Refactor/rename hyperlink 
-      // ------------------------------------------------------------------
-      createRenameHyperlink(composite);
+      // ------------------------------------------------------------------      
+      if (!hideHyperLink)
+      {
+        createRenameHyperlink(composite);
+        setRenameHyperlinkEnabled(!isReference);
+      }
+      else
+      {
+        getWidgetFactory().createCLabel(composite, "");
+      }
     }
   }
 
@@ -202,6 +211,7 @@
     {
       XSDAttributeGroupDefinition group = (XSDAttributeGroupDefinition) input;
       isReference = group.isAttributeGroupDefinitionReference();
+      hideHyperLink = isReference;
     }
   }
   
@@ -267,6 +277,7 @@
         if (namedComponent instanceof XSDAttributeGroupDefinition)
         {
           element.setAttribute(XSDConstants.REF_ATTRIBUTE, newValue);
+          XSDDirectivesManager.removeUnusedXSDImports(namedComponent.getSchema());
         }
       }
     }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDComplexTypeAdvancedSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDComplexTypeAdvancedSection.java
index c17a72f..4c4f99d 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDComplexTypeAdvancedSection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDComplexTypeAdvancedSection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -57,7 +57,7 @@
     data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
     data.grabExcessHorizontalSpace = false;
 
-    CLabel abstractLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_ABSTRACT + ":");
+    CLabel abstractLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_ABSTRACT);
     abstractLabel.setLayoutData(data);
 
     // ------------------------------------------------------------------
@@ -80,7 +80,7 @@
     data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
     data.grabExcessHorizontalSpace = false;
 
-    CLabel blockLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_BLOCK + ":");
+    CLabel blockLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_BLOCK);
     blockLabel.setLayoutData(data);
 
     // ------------------------------------------------------------------
@@ -103,7 +103,7 @@
     data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
     data.grabExcessHorizontalSpace = false;
 
-    CLabel finalLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_FINAL + ":");
+    CLabel finalLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_FINAL);
     finalLabel.setLayoutData(data);
 
     // ------------------------------------------------------------------
@@ -126,7 +126,7 @@
     data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
     data.grabExcessHorizontalSpace = false;
 
-    CLabel mixedLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_MIXED + ":");
+    CLabel mixedLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_MIXED);
     mixedLabel.setLayoutData(data);
 
     // ------------------------------------------------------------------
@@ -198,9 +198,9 @@
           enabled = false;
         }
         
-        String blockAttValue = complexType.getElement().getAttribute(XSDConstants.BLOCK_ATTRIBUTE);
-        if (blockAttValue != null)
+        if (complexType.getElement().hasAttribute(XSDConstants.BLOCK_ATTRIBUTE))
         {
+          String blockAttValue = complexType.getElement().getAttribute(XSDConstants.BLOCK_ATTRIBUTE);
           blockCombo.setText(blockAttValue);
         }
         else
@@ -209,10 +209,10 @@
         }
         blockCombo.setEnabled(enabled);
 
-        String finalAttValue = complexType.getElement().getAttribute(XSDConstants.FINAL_ATTRIBUTE);
-        if (finalAttValue != null)
+        if (complexType.getElement().hasAttribute(XSDConstants.FINAL_ATTRIBUTE))
         {
-          finalCombo.setText(finalAttValue);
+        	String finalAttValue = complexType.getElement().getAttribute(XSDConstants.FINAL_ATTRIBUTE);
+            finalCombo.setText(finalAttValue);
         }
         else
         {
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDComplexTypeSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDComplexTypeSection.java
index 0da2f51..ce8fecb 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDComplexTypeSection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDComplexTypeSection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
 
 import org.apache.xerces.util.XMLChar;
 import org.eclipse.gef.commands.Command;
+import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.window.Window;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.CCombo;
@@ -25,6 +26,7 @@
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
 import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
@@ -34,9 +36,11 @@
 import org.eclipse.wst.xsd.ui.internal.editor.Messages;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDComplexTypeBaseTypeEditManager;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
+import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
 import org.eclipse.xsd.XSDComplexTypeDefinition;
 import org.eclipse.xsd.XSDDerivationMethod;
 import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDSchema;
 import org.eclipse.xsd.XSDTypeDefinition;
 import org.eclipse.xsd.util.XSDConstants;
 
@@ -109,6 +113,7 @@
     baseTypeCombo.setEditable(false);
     baseTypeCombo.setLayoutData(data);
     baseTypeCombo.addSelectionListener(this);
+    baseTypeCombo.addListener(SWT.Traverse, this);
     PlatformUI.getWorkbench().getHelpSystem().setHelp(baseTypeCombo,
     		XSDEditorCSHelpIds.GENERAL_TAB__COMPLEX_TYPE__INHERIT_FROM);
 
@@ -159,6 +164,7 @@
       return;
 
     setListenerEnabled(false);
+    showLink(!hideHyperLink);
 
     try
     {
@@ -203,13 +209,16 @@
 
         derivedByCombo.setText(""); //$NON-NLS-1$
         int derivationMethod = complexType.getDerivationMethod().getValue();
-        if (derivationMethod == XSDDerivationMethod.EXTENSION)
-        {
-          derivedByCombo.setText(XSDConstants.EXTENSION_ELEMENT_TAG);
-        }
-        else if (derivationMethod == XSDDerivationMethod.RESTRICTION)
-        {
-          derivedByCombo.setText(XSDConstants.RESTRICTION_ELEMENT_TAG);
+        XSDDOMHelper domHelper = new XSDDOMHelper();
+        if(domHelper.getDerivedByElementFromComplexType(complexType.getElement()) != null) {
+	        if (derivationMethod == XSDDerivationMethod.EXTENSION)
+	        {
+	          derivedByCombo.setText(XSDConstants.EXTENSION_ELEMENT_TAG);
+	        }
+	        else if (derivationMethod == XSDDerivationMethod.RESTRICTION)
+	        {
+	          derivedByCombo.setText(XSDConstants.RESTRICTION_ELEMENT_TAG);
+	        }
         }
       }
 
@@ -220,25 +229,48 @@
     }
   }
 
-  /**
-   * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
-   */
+  public void doWidgetDefaultSelected(SelectionEvent e)
+  {
+    if (e.widget == baseTypeCombo)
+    {
+      String selection = baseTypeCombo.getText();
+      if (shouldPerformComboSelection(SWT.DefaultSelection, selection))
+        handleWidgetSelection(e);
+    } else
+    {
+      handleWidgetSelection(e);
+    }
+  }
+
   public void doWidgetSelected(SelectionEvent e)
   {
     if (e.widget == baseTypeCombo)
     {
+      String selection = baseTypeCombo.getText();
+      if (shouldPerformComboSelection(SWT.Selection, selection))
+        handleWidgetSelection(e);
+    } else
+    {
+      handleWidgetSelection(e);
+    }
+  }
+  
+  private void handleWidgetSelection(SelectionEvent e)
+  {
+    if (e.widget == baseTypeCombo)
+    {
       IEditorPart editor = getActiveEditor();
       if (editor == null) return;
-      ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDComplexTypeBaseTypeEditManager.class);    
+      ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDComplexTypeBaseTypeEditManager.class);
 
       String selection = baseTypeCombo.getText();
       ComponentSpecification newValue;
       IComponentDialog dialog= null;
-      if ( selection.equals(Messages._UI_ACTION_BROWSE))
+      if ( selection.equals(Messages._UI_COMBO_BROWSE))
       {
         dialog = manager.getBrowseDialog();
       }
-      else if ( selection.equals(Messages._UI_ACTION_NEW))
+      else if ( selection.equals(Messages._UI_COMBO_NEW))
       {
         dialog = manager.getNewDialog();
       }
@@ -261,7 +293,7 @@
       XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition) input;
       String value = derivedByCombo.getText();
       Command command = new UpdateComplexTypeDerivationBy(complexType, value);
-      
+
       if (getCommandStack() != null)
       {
         getCommandStack().execute(command);
@@ -283,10 +315,18 @@
   public void dispose()
   {
     super.dispose();
+    if (baseTypeCombo != null && !baseTypeCombo.isDisposed())
+      baseTypeCombo.removeListener(SWT.Traverse, this);
   }
 
   public void doHandleEvent(Event event)
   {
+    if (event.type == SWT.Traverse) {
+      if (event.detail == SWT.TRAVERSE_ARROW_NEXT || event.detail == SWT.TRAVERSE_ARROW_PREVIOUS) {
+        isTraversing = true;
+        return;
+      }
+    }
     super.doHandleEvent(event);
     if (event.widget == nameText)
     {
@@ -337,12 +377,26 @@
 
     return true;
   }
-
+  
+  public void setInput(IWorkbenchPart part, ISelection selection)
+  {
+    super.setInput(part, selection);
+    setListenerEnabled(false);
+    if (input instanceof XSDComplexTypeDefinition)
+    {
+    	XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition) input;
+      hideHyperLink = !(complexType.getContainer() instanceof XSDSchema);
+      
+    }    
+    
+    setListenerEnabled(true);
+  }
+  
   private void fillTypesCombo()
   {
     baseTypeCombo.removeAll();
-    baseTypeCombo.add(Messages._UI_ACTION_BROWSE);
-    baseTypeCombo.add(Messages._UI_ACTION_NEW);
+    baseTypeCombo.add(Messages._UI_COMBO_BROWSE);
+    baseTypeCombo.add(Messages._UI_COMBO_NEW);
     // Add the current Type of this attribute if needed
     XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition) input;
     XSDTypeDefinition baseType = complexType.getBaseType();
@@ -353,5 +407,4 @@
         baseTypeCombo.add(currentTypeName);
     }
   }
-
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDElementDeclarationAdvancedSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDElementDeclarationAdvancedSection.java
index 915db92..56c6aa9 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDElementDeclarationAdvancedSection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDElementDeclarationAdvancedSection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@
 package org.eclipse.wst.xsd.ui.internal.common.properties.sections;
 
 import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.CCombo;
 import org.eclipse.swt.custom.CLabel;
 import org.eclipse.swt.events.SelectionEvent;
@@ -67,7 +68,7 @@
     data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
     data.grabExcessHorizontalSpace = false;
 
-    CLabel abstractLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_ABSTRACT + ":");
+    CLabel abstractLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_ABSTRACT);
     abstractLabel.setLayoutData(data);
 
     // ------------------------------------------------------------------
@@ -90,7 +91,7 @@
     data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
     data.grabExcessHorizontalSpace = false;
 
-    CLabel blockLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_BLOCK + ":");
+    CLabel blockLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_BLOCK);
     blockLabel.setLayoutData(data);
 
     // ------------------------------------------------------------------
@@ -113,7 +114,7 @@
     data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
     data.grabExcessHorizontalSpace = false;
 
-    CLabel finalLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_FINAL + ":");
+    CLabel finalLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_FINAL);
     finalLabel.setLayoutData(data);
 
     // ------------------------------------------------------------------
@@ -136,7 +137,7 @@
     data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
     data.grabExcessHorizontalSpace = false;
 
-    CLabel subGroupLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_SUBSTITUTION_GROUP + ":");
+    CLabel subGroupLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_SUBSTITUTION_GROUP);
     subGroupLabel.setLayoutData(data);
 
     // ------------------------------------------------------------------
@@ -149,6 +150,7 @@
     substGroupCombo.setLayoutData(data);
     substGroupCombo.setEditable(true);
     substGroupCombo.addSelectionListener(this);
+    substGroupCombo.addListener(SWT.Traverse, this);
     applyAllListeners(substGroupCombo);
     
     // ------------------------------------------------------------------
@@ -158,7 +160,7 @@
     data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
     data.grabExcessHorizontalSpace = false;
 
-    CLabel nillableLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_NILLABLE + ":");
+    CLabel nillableLabel = getWidgetFactory().createCLabel(composite, org.eclipse.wst.xsd.ui.internal.common.util.Messages._UI_LABEL_NILLABLE);
     nillableLabel.setLayoutData(data);
 
     // ------------------------------------------------------------------
@@ -180,6 +182,14 @@
   {
     if (e.widget == substGroupCombo)
     {
+      if (e.type == SWT.Traverse) {
+        if (e.detail == SWT.TRAVERSE_ARROW_NEXT || e.detail == SWT.TRAVERSE_ARROW_PREVIOUS)
+        {
+          isTraversing = true;
+          return;
+        }
+      }
+		
       XSDElementDeclaration eleDec = (XSDElementDeclaration) input;
       String value = substGroupCombo.getText();
       String oldValue = eleDec.getElement().getAttribute(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE);
@@ -194,8 +204,34 @@
     }
   }
 
+  public void doWidgetDefaultSelected(SelectionEvent e)
+  {
+    if (e.widget == substGroupCombo)
+    {
+      String selection = substGroupCombo.getText();
+      if (shouldPerformComboSelection(SWT.DefaultSelection, selection))
+        handleWidgetSelection(e);
+    } else
+    {
+      handleWidgetSelection(e);
+    }
+  }
+
   public void doWidgetSelected(SelectionEvent e)
   {
+    if (e.widget == substGroupCombo)
+    {
+      String selection = substGroupCombo.getText();
+      if (shouldPerformComboSelection(SWT.Selection, selection))
+        handleWidgetSelection(e);
+    } else
+    {
+      handleWidgetSelection(e);
+    }
+  }
+
+  private void handleWidgetSelection(SelectionEvent e)
+  {
     if (e.widget == blockCombo)
     {
       XSDElementDeclaration eleDec = (XSDElementDeclaration) input;
@@ -226,16 +262,16 @@
     {
       IEditorPart editor = getActiveEditor();
       if (editor == null) return;
-      ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDSubstitutionGroupEditManager.class);    
+      ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDSubstitutionGroupEditManager.class);
 
       String selection = substGroupCombo.getText();
       ComponentSpecification newValue;
       IComponentDialog dialog= null;
-      if ( selection.equals(Messages._UI_ACTION_BROWSE))
+      if ( selection.equals(Messages._UI_COMBO_BROWSE))
       {
         dialog = manager.getBrowseDialog();
       }
-      else if ( selection.equals(Messages._UI_ACTION_NEW))
+      else if ( selection.equals(Messages._UI_COMBO_NEW))
       {
         dialog = manager.getNewDialog();
       }
@@ -268,7 +304,6 @@
         command.setDeleteIfEmpty(true);
         getCommandStack().execute(command);
     }
-
   }
 
   public void refresh()
@@ -302,9 +337,10 @@
         }
 
         Element element = eleDec.getElement();
-        String blockAttValue = element.getAttribute(XSDConstants.BLOCK_ATTRIBUTE);
-        if (blockAttValue != null)
+        
+        if (element.hasAttribute(XSDConstants.BLOCK_ATTRIBUTE))
         {
+          String blockAttValue = element.getAttribute(XSDConstants.BLOCK_ATTRIBUTE);
           blockCombo.setText(blockAttValue);
         }
         else
@@ -323,12 +359,11 @@
         {
           nillableCombo.setText(EMPTY);
         }
-
-
-        String finalAttValue = element.getAttribute(XSDConstants.FINAL_ATTRIBUTE);
-        if (finalAttValue != null)
+  
+        if (element.hasAttribute(XSDConstants.FINAL_ATTRIBUTE))
         {
-          finalCombo.setText(finalAttValue);
+        	String finalAttValue = element.getAttribute(XSDConstants.FINAL_ATTRIBUTE);
+            finalCombo.setText(finalAttValue);
         }
         else
         {
@@ -367,8 +402,8 @@
       ComponentSpecification[] items = manager.getQuickPicks();
 
       substGroupCombo.removeAll();
-      substGroupCombo.add(Messages._UI_ACTION_BROWSE);
-      substGroupCombo.add(Messages._UI_ACTION_NEW);
+      substGroupCombo.add(Messages._UI_COMBO_BROWSE);
+      substGroupCombo.add(Messages._UI_COMBO_NEW);
       for (int i = 0; i < items.length; i++)
       {
         substGroupCombo.add(items[i].getName());
@@ -405,5 +440,14 @@
     }
     return null;
   }
+  
+  public void dispose()
+  {
+  	if (substGroupCombo != null && !substGroupCombo.isDisposed())
+  	{
+		substGroupCombo.removeListener(SWT.Traverse, this);
+	}
+	super.dispose();
+  }
 
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDElementDeclarationSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDElementDeclarationSection.java
index aabfd39..41223f0 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDElementDeclarationSection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDElementDeclarationSection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -101,8 +101,15 @@
       // ------------------------------------------------------------------
       // Refactor/rename hyperlink 
       // ------------------------------------------------------------------
-      createRenameHyperlink(composite);
-      setRenameHyperlinkEnabled(!isElementReference);
+      if (!hideHyperLink)
+      {
+        createRenameHyperlink(composite);
+        setRenameHyperlinkEnabled(!isElementReference);
+      }
+      else
+      {
+        getWidgetFactory().createCLabel(composite, "");
+      }
 
     // ------------------------------------------------------------------
     // Ref Label
@@ -125,11 +132,13 @@
 
       componentNameCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
       componentNameCombo.addSelectionListener(this);
+      componentNameCombo.addListener(SWT.Traverse, this);
       componentNameCombo.setLayoutData(data);
       
       PlatformUI.getWorkbench().getHelpSystem().setHelp(componentNameCombo,
       		XSDEditorCSHelpIds.GENERAL_TAB__ELEMENT__REFERENCE);
 
+      // dummy
       getWidgetFactory().createCLabel(composite, ""); //$NON-NLS-1$
     }
 
@@ -149,6 +158,7 @@
     typeCombo.setEditable(false);
     typeCombo.setLayoutData(data);
     typeCombo.addSelectionListener(this);
+    typeCombo.addListener(SWT.Traverse, this);
     PlatformUI.getWorkbench().getHelpSystem().setHelp(typeCombo,
     		XSDEditorCSHelpIds.GENERAL_TAB__ELEMENT__TYPE);
     
@@ -224,6 +234,7 @@
       XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration) input;
       isElementReference = xsdElementDeclaration.isElementDeclarationReference();
 
+      hideHyperLink = !xsdElementDeclaration.isGlobal() || isElementReference;
       typeDefinition = xsdElementDeclaration.getResolvedElementDeclaration().getTypeDefinition();
     }
   }
@@ -237,8 +248,8 @@
       ComponentSpecification[] items = manager.getQuickPicks();
 
       typeCombo.removeAll();
-      typeCombo.add(Messages._UI_ACTION_BROWSE);
-      typeCombo.add(Messages._UI_ACTION_NEW);
+      typeCombo.add(Messages._UI_COMBO_BROWSE);
+      typeCombo.add(Messages._UI_COMBO_NEW);
       for (int i = 0; i < items.length; i++)
       {
         typeCombo.add(items[i].getName());
@@ -357,23 +368,58 @@
     return false;
   }
 
+  public void doWidgetDefaultSelected(SelectionEvent e)
+  {
+    if (e.widget == typeCombo)
+    {
+      String selection = typeCombo.getText();
+      if (shouldPerformComboSelection(SWT.DefaultSelection, selection))
+        handleWidgetSelection(e);
+    } else if (e.widget == componentNameCombo)
+    {
+      String selection = componentNameCombo.getText();
+      if (shouldPerformComboSelection(SWT.DefaultSelection, selection))
+        handleWidgetSelection(e);
+    } else
+    {
+      handleWidgetSelection(e);
+    }
+  }
+
   public void doWidgetSelected(SelectionEvent e)
   {
     if (e.widget == typeCombo)
     {
+      String selection = typeCombo.getText();
+      if (shouldPerformComboSelection(SWT.Selection, selection))
+        handleWidgetSelection(e);
+    } else if (e.widget == componentNameCombo)
+    {
+      String selection = componentNameCombo.getText();
+      if (shouldPerformComboSelection(SWT.Selection, selection))
+        handleWidgetSelection(e);
+    } else
+    {
+      handleWidgetSelection(e);
+    }
+  }
+
+  private void handleWidgetSelection(SelectionEvent e)
+  {
+    if (e.widget == typeCombo)
+    {
       IEditorPart editor = getActiveEditor();
       if (editor == null) return;
-      ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDTypeReferenceEditManager.class);    
-
+      ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDTypeReferenceEditManager.class);
       String selection = typeCombo.getText();
       ComponentSpecification newValue;
       IComponentDialog dialog= null;
-      if ( selection.equals(Messages._UI_ACTION_BROWSE))
+      if ( selection.equals(Messages._UI_COMBO_BROWSE))
       {
         dialog = manager.getBrowseDialog();
         ((XSDSearchListDialogDelegate) dialog).showComplexTypes(true);
       }
-      else if ( selection.equals(Messages._UI_ACTION_NEW))
+      else if ( selection.equals(Messages._UI_COMBO_NEW))
       {
         dialog = manager.getNewDialog();
         ((NewTypeDialog) dialog).allowComplexType(true);
@@ -403,16 +449,16 @@
     {
       IEditorPart editor = getActiveEditor();
       if (editor == null) return;
-      ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDElementReferenceEditManager.class);    
+      ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDElementReferenceEditManager.class);
 
       String selection = componentNameCombo.getText();
       ComponentSpecification newValue;
       IComponentDialog dialog= null;
-      if ( selection.equals(Messages._UI_ACTION_BROWSE))
+      if ( selection.equals(Messages._UI_COMBO_BROWSE))
       {
         dialog = manager.getBrowseDialog();
       }
-      else if ( selection.equals(Messages._UI_ACTION_NEW))
+      else if ( selection.equals(Messages._UI_COMBO_NEW))
       {
         dialog = manager.getNewDialog();
       }
@@ -435,7 +481,6 @@
         if (newValue != null)
           manager.modifyComponentReference(input, newValue);
       }
-
     }
     else if (e.widget == maxCombo)
     {
@@ -472,6 +517,12 @@
 
   public void doHandleEvent(Event event)
   {
+    if (event.type == SWT.Traverse) {
+      if (event.detail == SWT.TRAVERSE_ARROW_NEXT || event.detail == SWT.TRAVERSE_ARROW_PREVIOUS) {
+        isTraversing = true;
+        return;
+      }
+    }
     super.doHandleEvent(event);
     if (event.widget == nameText)
     {
@@ -523,13 +574,19 @@
   public void dispose()
   {
     if (componentNameCombo != null && !componentNameCombo.isDisposed())
+    {
       componentNameCombo.removeSelectionListener(this);
+      componentNameCombo.removeListener(SWT.Traverse, this);
+    }
     if (minCombo != null && !minCombo.isDisposed())
       minCombo.removeSelectionListener(this);
     if (maxCombo != null && !maxCombo.isDisposed())
       maxCombo.removeSelectionListener(this);
     if (typeCombo != null && !typeCombo.isDisposed())
+    {
       typeCombo.removeSelectionListener(this);
+      typeCombo.removeListener(SWT.Traverse, this);
+    }
     if (nameText != null && !nameText.isDisposed())
       removeListeners(nameText);
     super.dispose();
@@ -548,8 +605,8 @@
     if (manager != null)
     {
       componentNameCombo.removeAll();
-      componentNameCombo.add(Messages._UI_ACTION_BROWSE);
-      componentNameCombo.add(Messages._UI_ACTION_NEW);
+      componentNameCombo.add(Messages._UI_COMBO_BROWSE);
+      componentNameCombo.add(Messages._UI_COMBO_NEW);
       ComponentSpecification[] quickPicks = manager.getQuickPicks();
       if (quickPicks != null)
       {
@@ -587,5 +644,4 @@
       componentNameCombo.setText(attrValue);
     }
   }
-
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDEnumerationFacetSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDEnumerationFacetSection.java
new file mode 100644
index 0000000..ab1b006
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDEnumerationFacetSection.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.common.properties.sections;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xsd.ui.internal.common.commands.SetXSDFacetValueCommand;
+import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
+import org.eclipse.xsd.XSDEnumerationFacet;
+
+public class XSDEnumerationFacetSection extends AbstractSection
+{
+  CCombo finalCombo;
+  Text valueText;
+  
+  public XSDEnumerationFacetSection()
+  {
+    super();
+  }
+
+  protected void createContents(Composite parent)
+  {
+    TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
+    composite = factory.createFlatFormComposite(parent);
+
+    GridData data = new GridData();
+
+    GridLayout gridLayout = new GridLayout();
+    gridLayout.marginTop = 0;
+    gridLayout.marginBottom = 0;
+    gridLayout.numColumns = 3;
+    composite.setLayout(gridLayout);
+
+    // ------------------------------------------------------------------
+    // ValueLabel
+    // ------------------------------------------------------------------
+    data = new GridData();
+    data = new GridData();
+    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+    data.grabExcessHorizontalSpace = false;
+
+    CLabel valueLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_VALUE);
+    valueLabel.setLayoutData(data);
+
+    // ------------------------------------------------------------------
+    // ValueText
+    // ------------------------------------------------------------------
+    data = new GridData();
+    data.grabExcessHorizontalSpace = true;
+    data.horizontalAlignment = GridData.FILL;
+    valueText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
+    valueText.setLayoutData(data);
+    applyAllListeners(valueText);
+    
+    PlatformUI.getWorkbench().getHelpSystem().setHelp(valueText,
+    		XSDEditorCSHelpIds.GENERAL_TAB__SIMPLE_TYPE__NAME);    
+    
+  }
+  
+  public void setInput(IWorkbenchPart part, ISelection selection)
+  {
+    super.setInput(part, selection);
+  }
+
+  public void refresh()
+  {
+    super.refresh();
+
+    setListenerEnabled(false);
+
+    valueText.setText(""); //$NON-NLS-1$
+    
+    if (input instanceof XSDEnumerationFacet)
+    {
+      XSDEnumerationFacet xsdEnumeration = (XSDEnumerationFacet)input;
+      
+      if(xsdEnumeration != null)
+      {
+        valueText.setText(xsdEnumeration.getLexicalValue());
+      }
+    }
+    setListenerEnabled(true);
+  }
+  
+  public void doHandleEvent(Event event) 
+  {
+    if (event.widget == valueText)
+    {
+      if (!valueText.getEditable())
+        return;
+
+      String value = valueText.getText();
+      
+      if (input instanceof XSDEnumerationFacet)
+      {
+    	XSDEnumerationFacet xsdEnumeration = (XSDEnumerationFacet)input;
+    	  
+    	Command command = null;
+    	command = new SetXSDFacetValueCommand(Messages._UI_ACTION_CHANGE_ENUMERATION_VALUE,
+          xsdEnumeration, value);
+
+        if (command != null && getCommandStack() != null)
+        {
+          getCommandStack().execute(command);
+          valueText.setText(value);          
+        }
+      }
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDFacetSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDFacetSection.java
index 572054b..e0d0df4 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDFacetSection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDFacetSection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -89,6 +89,8 @@
 
   SpecificConstraintsWidget constraintsWidget;
 
+  private int constraintKind = SpecificConstraintsWidget.ENUMERATION;
+  
   public XSDFacetSection()
   {
     super();
@@ -158,6 +160,7 @@
       {
       	minLengthText.addListener(SWT.Modify, customListener);
       	minLengthText.addListener(SWT.KeyDown, customListener);
+      	minLengthText.addListener(SWT.FocusOut, customListener);
       }
       else
         applyAllListeners(minLengthText);
@@ -177,6 +180,7 @@
       {
     	  maxLengthText.addListener(SWT.Modify, customListener);
     	  maxLengthText.addListener(SWT.KeyDown, customListener);
+    	  maxLengthText.addListener(SWT.FocusOut, customListener);
       }
       else
         applyAllListeners(maxLengthText);
@@ -244,7 +248,7 @@
     PlatformUI.getWorkbench().getHelpSystem().setHelp(usePatternsButton,
       		XSDEditorCSHelpIds.CONSTRAINTS_TAB__PATTERNS);    
     
-    constraintsWidget = new SpecificConstraintsWidget(specificValueConstraintsGroup, factory, (input instanceof XSDFeature) ? (XSDFeature)input : null, xsdSimpleTypeDefinition, this);
+    constraintsWidget = new SpecificConstraintsWidget(specificValueConstraintsGroup, factory, (input instanceof XSDFeature) ? (XSDFeature)input : null, xsdSimpleTypeDefinition, this, constraintKind);
     data = new GridData();
     data.grabExcessHorizontalSpace = true;
     data.grabExcessVerticalSpace = true;
@@ -430,14 +434,18 @@
         refreshValueLengths();
     }
 
-    if (xsdSimpleTypeDefinition.getEnumerationFacets().size() > 0) 
+    if ((xsdSimpleTypeDefinition.getEnumerationFacets().size() > 0 
+    		&& constraintsWidget.getConstraintKind() == SpecificConstraintsWidget.ENUMERATION)
+    		|| xsdSimpleTypeDefinition.getPatternFacets().size() == 0) 
     {
       usePatternsButton.setSelection(false);
       useEnumerationsButton.setSelection(true);
       constraintsWidget.setConstraintKind(SpecificConstraintsWidget.ENUMERATION);
       constraintsWidget.addButton.setEnabled(true);
     }
-    else if (xsdSimpleTypeDefinition.getPatternFacets().size() > 0)
+    else if ((xsdSimpleTypeDefinition.getPatternFacets().size() > 0
+    		&& constraintsWidget.getConstraintKind() == SpecificConstraintsWidget.PATTERN)
+    		|| xsdSimpleTypeDefinition.getEnumerationFacets().size() == 0)
     {
       usePatternsButton.setSelection(true);
       useEnumerationsButton.setSelection(false);
@@ -451,6 +459,7 @@
       constraintsWidget.setConstraintKind(SpecificConstraintsWidget.ENUMERATION);
       constraintsWidget.addButton.setEnabled(true);
     }
+    constraintKind = constraintsWidget.getConstraintKind();
     constraintsWidget.setInput(xsdSimpleTypeDefinition);
 
     setWidgetsEnabled(isSimpleTypeRestriction && !isReadOnly);
@@ -473,7 +482,14 @@
       maximumInclusiveCheckbox.setEnabled(isEnabled);
     if (constraintsWidget != null && !constraintsWidget.getControl().isDisposed())
     {
-      constraintsWidget.addButton.setEnabled(isEnabled);
+      if(constraintsWidget.getConstraintKind() == SpecificConstraintsWidget.PATTERN)
+      {
+        constraintsWidget.addButton.setEnabled(false);  
+      }
+      else 
+      {
+        constraintsWidget.addButton.setEnabled(isEnabled);
+      }      
       constraintsWidget.addUsingDialogButton.setEnabled(isEnabled);
     }
   }
@@ -650,7 +666,6 @@
       currentMaxExclusive = maxExclusiveFacet.getLexicalValue();
     }
     
-    
     String currentLength = null, currentMin = null, currentMax = null;
     if (lengthFacet != null)
     {
@@ -690,9 +705,9 @@
           }
           else
           {
-            if (xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("double").equals(xsdSimpleTypeDefinition) || //$NON-NLS-1$
-                xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("float").equals(xsdSimpleTypeDefinition) || //$NON-NLS-1$
-                xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("decimal").equals(xsdSimpleTypeDefinition)) //$NON-NLS-1$
+            if (xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("double").equals(xsdSimpleTypeDefinition.getBaseType()) || //$NON-NLS-1$
+                xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("float").equals(xsdSimpleTypeDefinition.getBaseType()) || //$NON-NLS-1$
+                xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("decimal").equals(xsdSimpleTypeDefinition.getBaseType())) //$NON-NLS-1$
             {
               BigDecimal bigDecimal = new BigDecimal(minValue);
               bigDecimal.toString();
@@ -764,9 +779,9 @@
           }
           else
           {
-            if (xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("double").equals(xsdSimpleTypeDefinition) || //$NON-NLS-1$
-                xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("float").equals(xsdSimpleTypeDefinition) || //$NON-NLS-1$
-                xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("decimal").equals(xsdSimpleTypeDefinition)) //$NON-NLS-1$
+            if (xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("double").equals(xsdSimpleTypeDefinition.getBaseType()) || //$NON-NLS-1$
+                xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("float").equals(xsdSimpleTypeDefinition.getBaseType()) || //$NON-NLS-1$
+                xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("decimal").equals(xsdSimpleTypeDefinition.getBaseType())) //$NON-NLS-1$
             {
               BigDecimal bigDecimal = new BigDecimal(maxValue);
               bigDecimal.toString();
@@ -982,13 +997,19 @@
     {
       constraintsWidget.addButton.setEnabled(true);
       if (isListenerEnabled())
+      {
         constraintsWidget.setConstraintKind(SpecificConstraintsWidget.ENUMERATION);
+        constraintKind = constraintsWidget.getConstraintKind();
+      }
     }
     else if (e.widget == usePatternsButton)
     {
       constraintsWidget.addButton.setEnabled(false);
       if (isListenerEnabled())
+      {
         constraintsWidget.setConstraintKind(SpecificConstraintsWidget.PATTERN);
+        constraintKind = constraintsWidget.getConstraintKind();
+      }
     }
   }
   
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDImportSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDImportSection.java
index 922be91..98263e1 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDImportSection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDImportSection.java
@@ -13,11 +13,6 @@
 import java.util.Map;
 
 import org.apache.xerces.util.XMLChar;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.CLabel;
 import org.eclipse.swt.custom.StyledText;
@@ -25,22 +20,14 @@
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
 import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.ui.internal.viewers.ResourceFilter;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesSchemaLocationUpdater;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
 import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.wizards.XSDSelectIncludeFileWizard;
 import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.impl.XSDImportImpl;
 import org.eclipse.xsd.util.XSDConstants;
 import org.w3c.dom.Element;
 
@@ -208,169 +195,14 @@
     if (event.widget == wizardButton)
     {
       setListenerEnabled(false);
-      Shell shell = Display.getCurrent().getActiveShell();
-
-      IFile currentIFile = null;
-      IEditorInput editorInput = getActiveEditor().getEditorInput();
-      ViewerFilter filter;
-      if (editorInput instanceof IFileEditorInput)
-      {
-        currentIFile = ((IFileEditorInput)editorInput).getFile();
-        filter = new ResourceFilter(new String[] { ".xsd" }, //$NON-NLS-1$ 
-            new IFile[] { currentIFile }, null);
-      }
-      else
-      {
-        filter = new ResourceFilter(new String[] { ".xsd" }, //$NON-NLS-1$ 
-            null, null);
-      }
-
-      XSDSelectIncludeFileWizard fileSelectWizard = new XSDSelectIncludeFileWizard(xsdSchema, false, XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_SCHEMA"), //$NON-NLS-1$
-          XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_DESC"), //$NON-NLS-1$
-          filter, (IStructuredSelection) getSelection());
-
-      WizardDialog wizardDialog = new WizardDialog(shell, fileSelectWizard);
-      wizardDialog.create();
-      wizardDialog.setBlockOnOpen(true);
-      int result = wizardDialog.open();
-
-      String value = schemaLocationText.getText();
-      prefixText.removeListener(SWT.Modify, this);
-      if (result == Window.OK)
-      {
-        errorText.setText("");
-        IFile selectedIFile = fileSelectWizard.getResultFile();
-        String schemaFileString = value;
-        if (selectedIFile != null && currentIFile != null)
-        {
-          schemaFileString = URIHelper.getRelativeURI(selectedIFile.getLocation(), currentIFile.getLocation());
-        }
-        else if (selectedIFile != null && currentIFile == null)
-        {
-          schemaFileString = selectedIFile.getLocationURI().toString();
-        }
-        else
-        {
-          schemaFileString = fileSelectWizard.getURL();
-        }
-
-        String namespace = fileSelectWizard.getNamespace();
-        if (namespace == null)
-          namespace = "";
-
-        XSDSchema externalSchema = fileSelectWizard.getExternalSchema();
-        handleSchemaLocationChange(schemaFileString, namespace, externalSchema);
-      }
+      
+      XSDDirectivesSchemaLocationUpdater.updateSchemaLocation(xsdSchema,input,false);
+      refresh();
       setListenerEnabled(true);
       prefixText.addListener(SWT.Modify, this);
-//      }
-//      else
-//      {
-//        BrowseInWorkspaceAction browseInWorkspace = new BrowseInWorkspaceAction(shell);
-//        browseInWorkspace.run();
-//        IFile selectedIFile = browseInWorkspace.getSelectedFile();
-//        String value = schemaLocationText.getText();
-//        String schemaFileString = value;
-//        if (selectedIFile != null) 
-//        {
-//          //schemaFileString = URIHelper.getRelativeURI(selectedIFile.getLocation(), currentIFile.getLocation());
-//          schemaFileString = selectedIFile.getLocationURI().toString();
-//          handleSchemaLocationChange(schemaFileString, "", null);
-//          refresh();
-//        }
-//
-//      }
     }
   }
 
-  protected void handleSchemaLocationChange(String schemaFileString, String namespace, XSDSchema externalSchema)
-  {
-    if (input instanceof XSDImport)
-    {
-      XSDImport xsdImport = (XSDImport) input;
-
-      xsdImport.setNamespace(namespace);
-      xsdImport.setSchemaLocation(schemaFileString);
-      xsdImport.setResolvedSchema(externalSchema);
-
-      java.util.Map map = xsdSchema.getQNamePrefixToNamespaceMap();
-
-      // Referential integrity on old import
-      // How can we be sure that if the newlocation is the same as the
-      // oldlocation
-      // the file hasn't changed
-
-//      XSDSchema referencedSchema = xsdImport.getResolvedSchema();
-//      if (referencedSchema != null)
-//      {
-//        XSDExternalFileCleanup cleanHelper = new
-//        XSDExternalFileCleanup(referencedSchema);
-//        cleanHelper.visitSchema(xsdSchema);
-//      }
-
-      Element schemaElement = xsdSchema.getElement();
-
-      // update the xmlns in the schema element first, and then update the
-      // import element next
-      // so that the last change will be in the import element. This keeps the
-      // selection
-      // on the import element
-      TypesHelper helper = new TypesHelper(externalSchema);
-      String prefix = helper.getPrefix(namespace, false);
-
-      if (map.containsKey(prefix))
-      {
-        prefix = null;
-      }
-
-      if (prefix == null || (prefix != null && prefix.length() == 0))
-      {
-        StringBuffer newPrefix = new StringBuffer("pref"); //$NON-NLS-1$
-        int prefixExtension = 1;
-        while (map.containsKey(newPrefix.toString()) && prefixExtension < 100)
-        {
-          newPrefix = new StringBuffer("pref" + String.valueOf(prefixExtension));
-          prefixExtension++;
-        }
-        prefix = newPrefix.toString();
-      }
-
-      if (namespace.length() > 0)
-      {
-        // if ns already in map, use its corresponding prefix
-        if (map.containsValue(namespace))
-        {
-          TypesHelper typesHelper = new TypesHelper(xsdSchema);
-          prefix = typesHelper.getPrefix(namespace, false);
-        }
-        else
-        // otherwise add to the map
-        {
-          schemaElement.setAttribute("xmlns:" + prefix, namespace);
-        }
-        prefixText.setText(prefix);
-      }
-      else
-      {
-        prefixText.setText("");
-        namespaceText.setText("");
-      }
-      
-      // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=155885
-      // Need to import otherwise the external schema is never
-      // resolved.  One problem is that the schema location is still null,
-      // so the set types dialog will show types that belong to that schema
-      // with a null schema location.  This should load resource 
-      // into the resource set
-      if (input instanceof XSDImportImpl)  // redundant
-      {
-        XSDImportImpl xsdImportImpl = (XSDImportImpl) input;
-        xsdImportImpl.importSchema();
-      }
-    }
-    refresh();
-  }
-
   public void doHandleEvent(Event event)
   {
     setErrorMessage(null);
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDModelGroupDefinitionSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDModelGroupDefinitionSection.java
index 0a67eff..fec1b37 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDModelGroupDefinitionSection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDModelGroupDefinitionSection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -30,6 +30,7 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNameCommand;
 import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDDirectivesManager;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
 import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
 import org.eclipse.xsd.XSDConcreteComponent;
@@ -155,7 +156,15 @@
       // ------------------------------------------------------------------
       // Refactor/rename hyperlink 
       // ------------------------------------------------------------------
-      createRenameHyperlink(composite);
+      if (!hideHyperLink)
+      {
+        createRenameHyperlink(composite);
+        setRenameHyperlinkEnabled(!isReference);
+      }
+      else
+      {
+        getWidgetFactory().createCLabel(composite, "");
+      }
     }
   }
 
@@ -246,6 +255,7 @@
     {
       XSDModelGroupDefinition group = (XSDModelGroupDefinition) input;
       isReference = group.isModelGroupDefinitionReference();
+      hideHyperLink = isReference;
     }
   }
 
@@ -334,6 +344,7 @@
         if (namedComponent instanceof XSDModelGroupDefinition)
         {
           element.setAttribute(XSDConstants.REF_ATTRIBUTE, newValue);
+          XSDDirectivesManager.removeUnusedXSDImports(namedComponent.getSchema());
         }
       }
     }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSchemaAdvancedSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSchemaAdvancedSection.java
new file mode 100644
index 0000000..8902925
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSchemaAdvancedSection.java
@@ -0,0 +1,208 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.common.properties.sections;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateAttributeValueCommand;
+import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
+import org.eclipse.xsd.XSDForm;
+import org.eclipse.xsd.util.XSDConstants;
+
+public class XSDSchemaAdvancedSection extends AbstractSection
+{
+  IWorkbenchPart part;
+  protected CLabel elementFormLabel, attributeFormLabel, blockDefaultLabel, finalDefaultLabel;
+  protected CCombo elementFormCombo, attributeFormCombo, blockDefaultCombo, finalDefaultCombo;  
+  
+  protected static final String emptyOption = ""; //$NON-NLS-1$
+  
+  protected static final String [] formQualification = { emptyOption, XSDForm.QUALIFIED_LITERAL.getLiteral(), 
+      XSDForm.UNQUALIFIED_LITERAL.getLiteral() };  //$NON-NLS-1$
+
+    
+  protected static final String derivedByChoicesComboValues[] = { "", XSDConstants.RESTRICTION_ELEMENT_TAG, //$NON-NLS-1$ 
+      XSDConstants.EXTENSION_ELEMENT_TAG }; 
+  
+  protected static final String blockDefaultValues[] = { emptyOption, "#" + XSDConstants.ALL_ELEMENT_TAG, //$NON-NLS-1$
+      XSDConstants.EXTENSION_ELEMENT_TAG, XSDConstants.RESTRICTION_ELEMENT_TAG,
+      "substitution"};
+  
+  protected static final String finalDefaultValues[] = { emptyOption, "#" + XSDConstants.ALL_ELEMENT_TAG, //$NON-NLS-1$
+      XSDConstants.EXTENSION_ELEMENT_TAG, XSDConstants.RESTRICTION_ELEMENT_TAG, 
+      XSDConstants.LIST_ELEMENT_TAG, XSDConstants.UNION_ELEMENT_TAG};      
+
+  public XSDSchemaAdvancedSection()
+  {
+    super();
+  }
+
+  /**
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
+   *      org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
+   */
+  public void createContents(Composite parent)
+  {
+    composite = getWidgetFactory().createFlatFormComposite(parent);
+
+    GridLayout gridLayout = new GridLayout();
+    gridLayout.marginTop = 0;
+    gridLayout.marginBottom = 0;
+    gridLayout.numColumns = 2;
+    composite.setLayout(gridLayout);
+
+    // Create elementFormDefault label and combo       
+    elementFormLabel = XSDCommonUIUtils.getNewPropertiesLabel(composite,getWidgetFactory(),
+        Messages._UI_LABEL_ELEMENTFORMDEFAULT);
+    elementFormCombo = XSDCommonUIUtils.getNewPropertiesCombo(composite,getWidgetFactory(),this,
+        formQualification,XSDEditorCSHelpIds.ADVANCE_TAB__SCHEMA_ELEMENT_FORM_DEFAULT);
+
+    // Create attributeFormDefault label and combo
+    attributeFormLabel = XSDCommonUIUtils.getNewPropertiesLabel(composite,getWidgetFactory(),
+        Messages._UI_LABEL_ATTRIBUTEFORMDEFAULT);
+    attributeFormCombo = XSDCommonUIUtils.getNewPropertiesCombo(composite,getWidgetFactory(),this,
+        formQualification,XSDEditorCSHelpIds.ADVANCE_TAB__SCHEMA_ATTRIBUTE_FORM_DEFAULT);    
+    
+    // Create blockDefault label and combo
+    blockDefaultLabel = XSDCommonUIUtils.getNewPropertiesLabel(composite,getWidgetFactory(),
+        Messages._UI_LABEL_BLOCKDEFAULT);
+    blockDefaultCombo = XSDCommonUIUtils.getNewPropertiesCombo(composite,getWidgetFactory(),this,
+        blockDefaultValues,XSDEditorCSHelpIds.ADVANCE_TAB__SCHEMA_BLOCK_DEFAULT);
+    
+    // Create finalDefault label and combo
+    finalDefaultLabel = XSDCommonUIUtils.getNewPropertiesLabel(composite,getWidgetFactory(),
+        Messages._UI_LABEL_FINALDEFAULT);
+    finalDefaultCombo = XSDCommonUIUtils.getNewPropertiesCombo(composite,getWidgetFactory(),this,
+        finalDefaultValues,XSDEditorCSHelpIds.ADVANCE_TAB__SCHEMA_FINAL_DEFAULT);    
+    
+    Dialog.applyDialogFont(parent);
+  }
+
+  /*
+   * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
+   */
+  public void refresh()
+  {
+    super.refresh();
+    setListenerEnabled(false);
+    
+    if (xsdSchema != null)
+    {
+      if (elementFormCombo != null)
+      {
+        String text;
+        if (xsdSchema.getElement().hasAttribute(XSDConstants.ELEMENTFORMDEFAULT_ATTRIBUTE))
+        {
+          text = xsdSchema.getElementFormDefault().getName();  
+        }
+        else 
+        {
+          text = emptyOption;  
+        } 
+        elementFormCombo.setText(text);
+      }
+      
+      if (attributeFormCombo != null)
+      {
+        String text;
+        if (xsdSchema.getElement().hasAttribute(XSDConstants.ATTRIBUTEFORMDEFAULT_ATTRIBUTE))
+        {
+          text = xsdSchema.getAttributeFormDefault().getName();
+        }
+        else 
+        {
+          text = emptyOption;
+        }
+        attributeFormCombo.setText(text);
+      }
+      
+      if (blockDefaultCombo != null)
+      {
+        String text;
+        if (xsdSchema.getElement().hasAttribute(XSDConstants.BLOCKDEFAULT_ATTRIBUTE))
+        {
+          text = xsdSchema.getElement().getAttribute(XSDConstants.BLOCKDEFAULT_ATTRIBUTE);
+        }
+        else 
+        {
+          text = emptyOption;
+        }
+        blockDefaultCombo.setText(text);
+      }
+      
+      if (finalDefaultCombo != null)
+      {
+        String text;
+        if (xsdSchema.getElement().hasAttribute(XSDConstants.FINALDEFAULT_ATTRIBUTE))
+        {
+          text = xsdSchema.getElement().getAttribute(XSDConstants.FINALDEFAULT_ATTRIBUTE);
+        }
+        else 
+        {
+          text = emptyOption;
+        }
+        finalDefaultCombo.setText(text);
+      }      
+    }    
+    setListenerEnabled(true);
+  }
+  
+  public void doWidgetSelected(SelectionEvent e)
+  {
+    if (xsdSchema != null)
+    {          
+      if (e.widget == elementFormCombo && elementFormCombo != null)
+      {
+        String valueElementForm = elementFormCombo.getText();
+        UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(xsdSchema.getElement(), 
+            XSDConstants.ELEMENTFORMDEFAULT_ATTRIBUTE, valueElementForm, 
+            Messages._UI_LABEL_ELEMENTFORMDEFAULT);
+        command.setDeleteIfEmpty(true);
+        getCommandStack().execute(command);
+      }
+            
+      if (e.widget == attributeFormCombo && attributeFormCombo != null)
+      {     
+        String valueAttributeForm = attributeFormCombo.getText();
+        UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(xsdSchema.getElement(), 
+            XSDConstants.ATTRIBUTEFORMDEFAULT_ATTRIBUTE, valueAttributeForm, 
+            Messages._UI_LABEL_ATTRIBUTEFORMDEFAULT);
+        command.setDeleteIfEmpty(true);
+        getCommandStack().execute(command);        
+      }
+      
+      if (e.widget == blockDefaultCombo && blockDefaultCombo != null)
+      {
+        String valueBlockDefault = blockDefaultCombo.getText();        
+        UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(xsdSchema.getElement(), 
+            XSDConstants.BLOCKDEFAULT_ATTRIBUTE, valueBlockDefault, Messages._UI_LABEL_BLOCKDEFAULT);
+        command.setDeleteIfEmpty(true);
+        getCommandStack().execute(command);
+      }
+      
+      if(e.widget == finalDefaultCombo && finalDefaultCombo != null)
+      {
+        String finalBlockDefault = finalDefaultCombo.getText();        
+        UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(xsdSchema.getElement(), 
+            XSDConstants.FINALDEFAULT_ATTRIBUTE, finalBlockDefault, Messages._UI_LABEL_FINALDEFAULT);
+        command.setDeleteIfEmpty(true);
+        getCommandStack().execute(command);
+      }
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSchemaSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSchemaSection.java
index b7cdcfc..dab2646 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSchemaSection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSchemaSection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -110,7 +110,7 @@
       		XSDEditorCSHelpIds.GENERAL_TAB__SCHEMA__TARGETNAMESPACE);
 
     // Advanced Button
-    editButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_SECTION_ADVANCED_ATTRIBUTES") + "...", SWT.PUSH); //$NON-NLS-1$ //$NON-NLS-2$
+    editButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_ACTION_EDIT_NAMESPACES"), SWT.PUSH); //$NON-NLS-1$
     data = new GridData(SWT.END, SWT.CENTER, true, false);
     data.horizontalSpan = 2;
     editButton.setLayoutData(data);
@@ -157,9 +157,10 @@
       }
 
       // Handle TargetNamespaceText
-      String tns = element.getAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE);
-      if (tns != null && tns.length() > 0)
+     
+      if (element.hasAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE))
       {
+        String tns = element.getAttribute(XSDConstants.TARGETNAMESPACE_ATTRIBUTE);
         String processedString = TextProcessor.process(tns);
         targetNamespaceText.setText(processedString);
       }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSimpleTypeAdvancedSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSimpleTypeAdvancedSection.java
new file mode 100644
index 0000000..0e2bb21
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSimpleTypeAdvancedSection.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.common.properties.sections;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
+import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateAttributeValueCommand;
+import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.util.XSDConstants;
+
+public class XSDSimpleTypeAdvancedSection extends AbstractSection
+{
+  private static final String EMPTY = ""; //$NON-NLS-1$		
+  private String finalValues[] = { EMPTY, "#" + XSDConstants.ALL_ELEMENT_TAG,  //$NON-NLS-1$
+	      XSDConstants.LIST_ELEMENT_TAG, XSDConstants.RESTRICTION_ELEMENT_TAG, 
+	      XSDConstants.UNION_ELEMENT_TAG};
+  
+  CCombo finalCombo;
+  
+  public XSDSimpleTypeAdvancedSection()
+  {
+    super();
+  }
+
+  protected void createContents(Composite parent)
+  {
+    TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
+    composite = factory.createFlatFormComposite(parent);
+
+    GridData data = new GridData();
+
+    GridLayout gridLayout = new GridLayout();
+    gridLayout.marginTop = 0;
+    gridLayout.marginBottom = 0;
+    gridLayout.numColumns = 3;
+    composite.setLayout(gridLayout);
+
+    // ------------------------------------------------------------------
+    // FinalLabel
+    // ------------------------------------------------------------------
+    data = new GridData();
+    data = new GridData();
+    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+    data.grabExcessHorizontalSpace = false;
+
+    CLabel finalLabel = getWidgetFactory().createCLabel(composite, Messages._UI_LABEL_FINAL);
+    finalLabel.setLayoutData(data);
+
+    // ------------------------------------------------------------------
+    // FinalCombo
+    // ------------------------------------------------------------------
+    data = new GridData();
+    data.grabExcessHorizontalSpace = true;
+    data.horizontalAlignment = GridData.FILL;
+    finalCombo = getWidgetFactory().createCCombo(composite);
+    finalCombo.setLayoutData(data);
+    finalCombo.setEditable(false);
+
+    finalCombo.setItems(finalValues);
+    finalCombo.addSelectionListener(this);    
+  }
+  
+  public void setInput(IWorkbenchPart part, ISelection selection)
+  {
+    super.setInput(part, selection);
+  }
+
+  public void refresh()
+  {
+    super.refresh();
+
+    setListenerEnabled(false);
+
+    finalCombo.setText(""); //$NON-NLS-1$); 
+    
+    if (input instanceof XSDSimpleTypeDefinition)
+    {
+      XSDSimpleTypeDefinition simpleType = (XSDSimpleTypeDefinition) input;
+
+      
+      if (simpleType.getElement().hasAttribute(XSDConstants.FINAL_ATTRIBUTE))
+      {
+        String finalAttValue = simpleType.getElement().getAttribute(XSDConstants.FINAL_ATTRIBUTE);
+        finalCombo.setText(finalAttValue);
+      }
+      else
+      {
+        finalCombo.setText(EMPTY);
+      }
+    }
+    setListenerEnabled(true);
+  }
+
+  public void doWidgetSelected(SelectionEvent e)
+  {
+    if (e.widget == finalCombo && input != null && input instanceof XSDSimpleTypeDefinition)
+    {
+      XSDSimpleTypeDefinition simpleType = (XSDSimpleTypeDefinition) input;
+      String value = finalCombo.getText();
+      UpdateAttributeValueCommand command = new UpdateAttributeValueCommand(simpleType.getElement(), XSDConstants.FINAL_ATTRIBUTE, value, Messages._UI_LABEL_FINAL);
+      command.setDeleteIfEmpty(true);
+      getCommandStack().execute(command);
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSimpleTypeSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSimpleTypeSection.java
index 8eef6a8..e3275a3 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSimpleTypeSection.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSimpleTypeSection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -39,7 +39,7 @@
 import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
 import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
 import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNameCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
+import org.eclipse.wst.xsd.ui.internal.editor.Messages;
 import org.eclipse.wst.xsd.ui.internal.dialogs.NewTypeDialog;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDComplexTypeBaseTypeEditManager;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorCSHelpIds;
@@ -48,6 +48,7 @@
 import org.eclipse.wst.xsd.ui.internal.editor.search.XSDSearchListDialogDelegate;
 import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
 import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDSchema;
 import org.eclipse.xsd.XSDSimpleTypeDefinition;
 import org.eclipse.xsd.XSDTypeDefinition;
 import org.eclipse.xsd.XSDVariety;
@@ -91,7 +92,7 @@
 
     data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
     data.grabExcessHorizontalSpace = false;
-    CLabel nameLabel = factory.createCLabel(composite, Messages._UI_LABEL_NAME);
+    CLabel nameLabel = factory.createCLabel(composite, Messages.UI_LABEL_NAME);
     nameLabel.setLayoutData(data);
 
     // ------------------------------------------------------------------
@@ -156,6 +157,7 @@
     typesCombo.setEditable(false);
     typesCombo.setLayoutData(data);
     typesCombo.addSelectionListener(this);
+    typesCombo.addListener(SWT.Traverse, this);
 
     
     data = new GridData();
@@ -167,12 +169,6 @@
     		XSDEditorCSHelpIds.GENERAL_TAB__SIMPLE_TYPE__BASE_TYPE);
 
   }
-  
-  public void setInput(IWorkbenchPart part, ISelection selection)
-  {
-    super.setInput(part, selection);
-    relayout();
-  }
 
   protected void relayout()
   {
@@ -202,6 +198,7 @@
     super.refresh();
 
     setListenerEnabled(false);
+    showLink(!hideHyperLink);
 
     nameText.setText(""); //$NON-NLS-1$
     varietyCombo.setText(""); //$NON-NLS-1$
@@ -226,65 +223,93 @@
       
       String variety = st.getVariety().getName();
       int intVariety = st.getVariety().getValue();
-
-      if (variety != null)
-      {
-        varietyCombo.setText(variety);
-        if (intVariety == XSDVariety.ATOMIC)
-        {
-          baseTypeDefinition = st.getBaseTypeDefinition();
-          String name = ""; //$NON-NLS-1$
-          if (baseTypeDefinition != null)
-          {
-            name = baseTypeDefinition.getName();
-            if (name == null) name = "";
-          }
-          typesCombo.setText(name);
-          typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE_WITH_COLON")); //$NON-NLS-1$
-        }
-        else if (intVariety == XSDVariety.LIST)
-        {
-          itemTypeDefinition = st.getItemTypeDefinition();
-          String name = ""; //$NON-NLS-1$
-          if (itemTypeDefinition != null)
-          {
-            name = itemTypeDefinition.getName();
-            if (name == null) name = "";
-          }
-          typesCombo.setText(name);
-          typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_ITEM_TYPE")); //$NON-NLS-1$
-        }
-        else if (intVariety == XSDVariety.UNION)
-        {
-          List memberTypesList = st.getMemberTypeDefinitions();
-          StringBuffer sb = new StringBuffer();
-          for (Iterator i = memberTypesList.iterator(); i.hasNext();)
-          {
-            XSDSimpleTypeDefinition typeObject = (XSDSimpleTypeDefinition) i.next();
-            String name = typeObject.getQName();
-            if (name != null)
-            {
-              sb.append(name);
-              if (i.hasNext())
-              {
-                sb.append(" "); //$NON-NLS-1$
-              }
-            }
-          }
-          String memberTypes = sb.toString();
-          typesCombo.setText(memberTypes);
-          typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES")); //$NON-NLS-1$
-        }
-      }
+      XSDDOMHelper domHelper = new XSDDOMHelper();
+      if(domHelper.getDerivedByElementFromSimpleType(st.getElement()) != null) {
+	      if (variety != null)
+	      {
+	        varietyCombo.setText(variety);
+	        if (intVariety == XSDVariety.ATOMIC)
+	        {
+	          baseTypeDefinition = st.getBaseTypeDefinition();
+	          String name = ""; //$NON-NLS-1$
+	          if (baseTypeDefinition != null)
+	          {
+	            name = baseTypeDefinition.getName();
+	            if (name == null) name = "";
+	          }
+	          typesCombo.setText(name);
+	          typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE_WITH_COLON")); //$NON-NLS-1$
+	        }
+	        else if (intVariety == XSDVariety.LIST)
+	        {
+	          itemTypeDefinition = st.getItemTypeDefinition();
+	          String name = ""; //$NON-NLS-1$
+	          if (itemTypeDefinition != null)
+	          {
+	            name = itemTypeDefinition.getName();
+	            if (name == null) name = "";
+	          }
+	          typesCombo.setText(name);
+	          typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_ITEM_TYPE")); //$NON-NLS-1$
+	        }
+	        else if (intVariety == XSDVariety.UNION)
+	        {
+	          List memberTypesList = st.getMemberTypeDefinitions();
+	          StringBuffer sb = new StringBuffer();
+	          for (Iterator i = memberTypesList.iterator(); i.hasNext();)
+	          {
+	            XSDSimpleTypeDefinition typeObject = (XSDSimpleTypeDefinition) i.next();
+	            String name = typeObject.getQName();
+	            if (name != null)
+	            {
+	              sb.append(name);
+	              if (i.hasNext())
+	              {
+	                sb.append(" "); //$NON-NLS-1$
+	              }
+	            }
+	          }
+	          String memberTypes = sb.toString();
+	          typesCombo.setText(memberTypes);
+	          typesLabel.setText(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES")); //$NON-NLS-1$
+	        }
+	      }
+	    }
     }
     setListenerEnabled(true);
 
   }
 
+  public void doWidgetDefaultSelected(SelectionEvent e)
+  {
+    if (e.widget == typesCombo)
+    {
+      String selection = typesCombo.getText();
+      if (shouldPerformComboSelection(SWT.DefaultSelection, selection))
+        handleWidgetSelection(e);
+    } else
+    {
+      handleWidgetSelection(e);
+    }
+  }
+
   public void doWidgetSelected(SelectionEvent e)
   {
     if (e.widget == typesCombo)
     {
+      String selection = typesCombo.getText();
+      if (shouldPerformComboSelection(SWT.Selection, selection))
+        handleWidgetSelection(e);
+    } else
+    {
+      handleWidgetSelection(e);
+    }
+  }
+
+  private void handleWidgetSelection(SelectionEvent e)
+  {
+    if (e.widget == typesCombo)
+    {
       IEditorPart editor = getActiveEditor();
       if (editor == null) return;
       ComponentReferenceEditManager manager = (ComponentReferenceEditManager)editor.getAdapter(XSDComplexTypeBaseTypeEditManager.class);    
@@ -292,12 +317,12 @@
       String selection = typesCombo.getText();
       ComponentSpecification newValue;
       IComponentDialog dialog= null;
-      if ( selection.equals(org.eclipse.wst.xsd.ui.internal.editor.Messages._UI_ACTION_BROWSE))
+      if ( selection.equals(Messages._UI_COMBO_BROWSE))
       {
         dialog = manager.getBrowseDialog();
         ((XSDSearchListDialogDelegate) dialog).showComplexTypes(false);
       }
-      else if ( selection.equals(org.eclipse.wst.xsd.ui.internal.editor.Messages._UI_ACTION_NEW))
+      else if ( selection.equals(Messages._UI_COMBO_NEW))
       {
         dialog = manager.getNewDialog();
         ((NewTypeDialog) dialog).allowComplexType(false);
@@ -349,114 +374,6 @@
         }
       }
     }
-//    else if (e.widget == button)
-//    {
-//      Shell shell = Display.getCurrent().getActiveShell();
-//      Element element = ((XSDConcreteComponent) input).getElement();
-//      Dialog dialog = null;
-//      String property = "";
-//      Element secondaryElement = null;
-
-//      IFile currentIFile = ((IFileEditorInput) getActiveEditor().getEditorInput()).getFile();
-      
-      // issue (cs) need to move to common.ui's selection dialog
-/*
-      XSDComponentSelectionProvider provider = new XSDComponentSelectionProvider(currentIFile, xsdSchema);
-      dialog = new XSDComponentSelectionDialog(shell, XSDEditorPlugin.getXSDString("_UI_LABEL_SET_TYPE"), provider);
-      provider.setDialog((XSDComponentSelectionDialog) dialog);
-*/
-//      if (input instanceof XSDSimpleTypeDefinition)
-//      {
-//        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) input;
-//        Element simpleTypeElement = st.getElement();
-//        if (st.getVariety() == XSDVariety.LIST_LITERAL)
-//        {
-//          Element listElement = (Element) itemTypeDefinition.getElement();
-//          // dialog = new TypesDialog(shell, listElement,
-//          // XSDConstants.ITEMTYPE_ATTRIBUTE, xsdSchema);
-//          // dialog.showComplexTypes = false;
-//          provider.showComplexTypes(false);
-//
-//          secondaryElement = listElement;
-//          property = XSDConstants.ITEMTYPE_ATTRIBUTE;
-//        }
-//        else if (st.getVariety() == XSDVariety.ATOMIC_LITERAL)
-//        {
-//          Element derivedByElement = (Element) baseTypeDefinition.getElement();
-//          if (derivedByElement != null)
-//          {
-//            // dialog = new TypesDialog(shell, derivedByElement,
-//            // XSDConstants.BASE_ATTRIBUTE, xsdSchema);
-//            // dialog.showComplexTypes = false;
-//            provider.showComplexTypes(false);
-//
-//            secondaryElement = derivedByElement;
-//            property = XSDConstants.BASE_ATTRIBUTE;
-//          }
-//          else
-//          {
-//            return;
-//          }
-//        }
-//        if (st.getVariety() == XSDVariety.UNION_LITERAL)
-//        {
-//          SimpleContentUnionMemberTypesDialog unionDialog = new SimpleContentUnionMemberTypesDialog(shell, st);
-//          unionDialog.setBlockOnOpen(true);
-//          unionDialog.create();
-//
-//          int result = unionDialog.open();
-//          if (result == Window.OK)
-//          {
-//            String newValue = unionDialog.getResult();
-//            // beginRecording(XSDEditorPlugin.getXSDString("_UI_LABEL_MEMBERTYPES_CHANGE"),
-//            // element); //$NON-NLS-1$
-//            Element unionElement = memberTypeDefinition.getElement();
-//            unionElement.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, newValue);
-//
-//            if (newValue.length() > 0)
-//            {
-//              unionElement.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, newValue);
-//            }
-//            else
-//            {
-//              unionElement.removeAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
-//            }
-//            // endRecording(unionElement);
-//            refresh();
-//          }
-//          return;
-//        }
-//        else
-//        {
-//          property = "type";
-//        }
-//      }
-//      else
-//      {
-//        property = "type";
-//      }
-      // beginRecording(XSDEditorPlugin.getXSDString("_UI_TYPE_CHANGE"),
-      // element); //$NON-NLS-1$
-//      dialog.setBlockOnOpen(true);
-//      dialog.create();
-//      int result = dialog.open();
-//
-//      if (result == Window.OK)
-//      {
-//        if (secondaryElement == null)
-//        {
-//          secondaryElement = element;
-//        }
-//        XSDSetTypeHelper helper = new XSDSetTypeHelper(currentIFile, xsdSchema);
-//        helper.setType(secondaryElement, property, ((XSDComponentSelectionDialog) dialog).getSelection());
-
-//        XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) input;
-//        st.setElement(element);
-//        updateSimpleTypeFacets();*/
-//      }
-      // endRecording(element);
-//    }  
-//    refresh();
   }
 
   public boolean shouldUseExtraSpace()
@@ -479,16 +396,18 @@
       Element listNode = getFirstChildNodeIfExists(parent, XSDConstants.LIST_ELEMENT_TAG, false);
       if (listNode != null)
       {
-        reuseType = listNode.getAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE);
+        if (listNode.hasAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE))
+        	reuseType = listNode.getAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE);
         XSDDOMHelper.removeNodeAndWhitespace(listNode);
       }
 
       Element unionNode = getFirstChildNodeIfExists(parent, XSDConstants.UNION_ELEMENT_TAG, false);
       if (unionNode != null)
       {
-        String memberAttr = unionNode.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
-        if (memberAttr != null)
+        
+        if (unionNode.hasAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE))
         {
+          String memberAttr = unionNode.getAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE);
           StringTokenizer stringTokenizer = new StringTokenizer(memberAttr);
           reuseType = stringTokenizer.nextToken();
         }
@@ -601,59 +520,15 @@
     return stringName;
   }
 
-//  private void updateSimpleTypeFacets()
-//  {
-//    XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) input;
-//    Element simpleTypeElement = st.getElement();
-//    Element derivedByElement = baseTypeDefinition.getElement();
-//    if (derivedByElement != null)
-//    {
-//      List nodesToRemove = new ArrayList();
-//      NodeList childList = derivedByElement.getChildNodes();
-//      int length = childList.getLength();
-//      for (int i = 0; i < length; i++)
-//      {
-//        Node child = childList.item(i);
-//        if (child instanceof Element)
-//        {
-//          Element elementChild = (Element) child;
-//          if (!(elementChild.getLocalName().equals("pattern") || elementChild.getLocalName().equals("enumeration") || //$NON-NLS-1$ //$NON-NLS-2$
-//              XSDDOMHelper.inputEquals(elementChild, XSDConstants.SIMPLETYPE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals(elementChild, XSDConstants.ANNOTATION_ELEMENT_TAG, false)
-//              || XSDDOMHelper.inputEquals(elementChild, XSDConstants.ATTRIBUTE_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals(elementChild, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true)
-//              || XSDDOMHelper.inputEquals(elementChild, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, false) || XSDDOMHelper.inputEquals(elementChild, XSDConstants.ATTRIBUTEGROUP_ELEMENT_TAG, true) || XSDDOMHelper.inputEquals(elementChild,
-//              XSDConstants.ANYATTRIBUTE_ELEMENT_TAG, false)))
-//          {
-//            nodesToRemove.add(child);
-//          }
-//        }
-//      }
-//      Iterator iter = nodesToRemove.iterator();
-//      while (iter.hasNext())
-//      {
-//        Element facetToRemove = (Element) iter.next();
-//        String facetName = facetToRemove.getLocalName();
-//        Iterator it = st.getValidFacets().iterator();
-//        boolean doRemove = true;
-//        while (it.hasNext())
-//        {
-//          String aValidFacet = (String) it.next();
-//          if (aValidFacet.equals(facetName))
-//          {
-//            doRemove = false;
-//            break;
-//          }
-//        }
-//        if (doRemove)
-//        {
-//          XSDDOMHelper.removeNodeAndWhitespace(facetToRemove);
-//        }
-//      }
-//    }
-//  }
-
   // TODO: Common this up with element declaration
   public void doHandleEvent(Event event) 
   {
+    if (event.type == SWT.Traverse) {
+      if (event.detail == SWT.TRAVERSE_ARROW_NEXT || event.detail == SWT.TRAVERSE_ARROW_PREVIOUS) {
+        isTraversing = true;
+        return;
+      }
+    }
     if (event.widget == nameText)
     {
       if (!nameText.getEditable())
@@ -703,6 +578,19 @@
     return true;
   }
   
+  public void setInput(IWorkbenchPart part, ISelection selection)
+  {
+    super.setInput(part, selection);
+    setListenerEnabled(false);
+    if (input instanceof XSDSimpleTypeDefinition)
+    {
+    	XSDSimpleTypeDefinition simpleType = (XSDSimpleTypeDefinition) input;
+      hideHyperLink = !(simpleType.getContainer() instanceof XSDSchema);
+      
+    }    
+    // Don't have to call relayout() here
+    setListenerEnabled(true);
+  }
   
   private void fillTypesCombo()
   {
@@ -714,8 +602,8 @@
     {
       ComponentSpecification[] items = manager.getQuickPicks();
 
-      typesCombo.add(org.eclipse.wst.xsd.ui.internal.adt.editor.Messages._UI_ACTION_BROWSE);
-      typesCombo.add(org.eclipse.wst.xsd.ui.internal.editor.Messages._UI_ACTION_NEW);
+      typesCombo.add(Messages._UI_COMBO_BROWSE);
+      typesCombo.add(Messages._UI_COMBO_NEW);
 
       for (int i = 0; i < items.length; i++)
       {
@@ -757,6 +645,11 @@
     }
     return null;
   }
-
-
+  
+  public void dispose()
+  {
+    if (typesCombo != null && !typesCombo.isDisposed())
+      typesCombo.removeListener(SWT.Traverse, this);
+    super.dispose();
+  }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/AddNewCategoryDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/AddNewCategoryDialog.java
index 8c5d3aa..5356877 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/AddNewCategoryDialog.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/AddNewCategoryDialog.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,7 +14,6 @@
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
@@ -25,15 +24,13 @@
 import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.swt.widgets.ToolBar;
@@ -46,11 +43,12 @@
 
 public class AddNewCategoryDialog extends Dialog
 {
-
   private static final String SCHEMA_LABEL = Messages._UI_LABEL_SCHEMA;
-  private static final String NAME_LABEL = Messages._UI_LABEL_NAME;
+  private static final String NAME_LABEL = Messages._UI_LABEL_NAME;  
+  private static final String SELECT_FROM_WORKSPACE = Messages._UI_LABEL_WORKSPACE; 
+  private static final String SELECT_FROM_CATALOG = Messages._UI_LABEL_CATALOG;  
   private String dialogTitle = Messages._UI_LABEL_ADD_CATEGORY;
-  
+    
   protected MenuManager browseMenu;
   protected Label name;
   protected Text nameText;
@@ -58,6 +56,9 @@
   protected CLabel schemaDisplayer;
   protected ToolBar browseToolBar;
   protected ToolItem browseItem;
+  protected Button searchCatalog;
+  protected Button searchWorkspace;  
+  protected Composite sourcesComposite;
 
   protected List invalidNames;
   
@@ -147,7 +148,7 @@
     return result;
   }
 
-  // redudant method to improve speed (according to the compiler)
+  // redundant method to improve speed (according to the compiler)
   protected Button getButton(int id) {
     return super.getButton(id);
   }
@@ -157,7 +158,7 @@
     getShell().setText(dialogTitle);
 
     Composite mainComposite = (Composite) super.createDialogArea(parent);
-    GridLayout layout = new GridLayout(3, false);
+    GridLayout layout = new GridLayout(2, false);
     layout.marginTop = 10;
     mainComposite.setLayout(layout);
     mainComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
@@ -171,14 +172,13 @@
     name.setText(NAME_LABEL);
 
     nameText = new Text(mainComposite, SWT.BORDER | SWT.SINGLE);
-    nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+    nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));    
     if (categoryName != null)
     	nameText.setText(categoryName);
     PlatformUI.getWorkbench().getHelpSystem().setHelp(nameText,
     		XSDEditorCSHelpIds.ADD_CATEGORY__NAME);     
 
-    Button hidden = new Button(mainComposite, SWT.NONE);
-    hidden.setVisible(false);
+    
 
     // Line 2, schema
     schema = new Label(mainComposite, SWT.NONE);
@@ -202,33 +202,101 @@
     
     if (categoryName != null && source != null)
     	canOK = true;
+    
+    // Line 3, schema selection buttons            
+    Button hidden = new Button(mainComposite, SWT.NONE);
+    hidden.setVisible(false);    
+           
+    sourcesComposite = new Composite(mainComposite, SWT.NONE);
+    RowLayout sourcesLayout = new RowLayout();
+  
+    sourcesComposite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
+    sourcesComposite.setLayout(sourcesLayout);
+    
+    searchWorkspace = new Button(sourcesComposite, SWT.NONE);
+    searchWorkspace.setText(SELECT_FROM_WORKSPACE);
+        
+    searchCatalog = new Button(sourcesComposite, SWT.NONE);
+    searchCatalog.setText(SELECT_FROM_CATALOG);
+    
+    searchWorkspace.addSelectionListener(new SelectionAdapter()
+    {
+    	public void widgetSelected(SelectionEvent e)
+    	{
+    		final String XSD_FILE_EXTENSION = ".xsd"; //$NON-NLS-1$   	    
+    	    
+    	      SelectSingleFileDialog dialog = new SelectSingleFileDialog(getShell(), null, true);
+    	      dialog.addFilterExtensions(new String[] { XSD_FILE_EXTENSION });
+    	      dialog.create();
+    	      dialog.setTitle(Messages._UI_LABEL_SELECT_XSD_FILE);
+    	      dialog.setMessage(Messages._UI_DESCRIPTION_CHOOSE_XSD_FILE);
 
-    browseToolBar = new ToolBar(mainComposite, SWT.FLAT);
-    browseItem = new ToolItem(browseToolBar, SWT.NONE);
+    	      if (dialog.open() == Window.OK)
+    	      {
+    	        IFile appInfoSchemaFile = dialog.getFile();
+    	        if (appInfoSchemaFile != null)
+    	        {
+    	          // remove leading slash from the value to avoid the
+    	          // whole leading slash ambiguity problem
+    	          String uri = appInfoSchemaFile.getFullPath().toString();
+    	          while (uri.startsWith("/") || uri.startsWith("\\")) { //$NON-NLS-1$ //$NON-NLS-2$
+    	            uri = uri.substring(1);
+    	          }
+    	          appInfoSchemaLocation = uri.toString();
+    	          source = uri;
+    	          fromCatalog = false;
+
+    	          appInfoSchemaLocation = "file://" + Platform.getLocation().toString() + "/" + appInfoSchemaLocation; //$NON-NLS-1$ //$NON-NLS-2$
+    	          // TODO... be careful how we construct the location
+    	          // UNIX related issues here
+
+    	          schemaDisplayer.setImage(XSDEditorPlugin.getXSDImage("icons/XSDFile.gif")); //$NON-NLS-1$
+    	          schemaDisplayer.setText(uri);
+
+    	          // Enable the OK button if we should..
+    	          if (isCategoryNameValid)
+    	          {
+    	            getButton(IDialogConstants.OK_ID).setEnabled(true);
+    	            errDisplayer.setText(""); //$NON-NLS-1$
+    	            errDisplayer.setImage(null);
+    	          }
+    	        }
+    	      }
+    	    }
+    	}
+    
+    );
+    
+    searchCatalog.addSelectionListener(new SelectionAdapter()
+    {
+    	public void widgetSelected(SelectionEvent e)
+    	{
+    	      SelectFromCatalogDialog dialog = new SelectFromCatalogDialog(getShell());
+    	      // dialog.open();
+    	      if (dialog.open() == Window.OK)
+    	      {
+    	        appInfoSchemaLocation = dialog.getCurrentSelectionLocation();
+    	        source = dialog.getCurrentSelectionNamespace();
+    	        fromCatalog = true;
+
+    	        schemaDisplayer.setImage(XSDEditorPlugin.getXSDImage("icons/xmlcatalog_obj.gif")); //$NON-NLS-1$
+    	        schemaDisplayer.setText(dialog.getCurrentSelectionNamespace());
+
+    	        // Enable the OK button if we should..
+    	        if (isCategoryNameValid && !appInfoSchemaLocation.equals("")) //$NON-NLS-1$
+    	        {
+    	          getButton(IDialogConstants.OK_ID).setEnabled(true);
+    	          errDisplayer.setText(""); //$NON-NLS-1$
+    	          errDisplayer.setImage(null);    	        
+    	      }
+    	    }
+    	}
+    });
+    
+
     // TODO: Should be able to get the image from the XML plugin. Don't need
     // to copy to XSDEditor icons folder like this.
-    browseItem.setImage(XSDEditorPlugin.getXSDImage("icons/appinfo_browse.gif")); //$NON-NLS-1$
 
-    browseMenu = new MenuManager();
-
-    BrowseInWorkspaceAction browseInWorkspace = new BrowseInWorkspaceAction();
-    browseMenu.add(browseInWorkspace);
-
-    BrowseCatalogAction browseCatalog = new BrowseCatalogAction();
-    browseMenu.add(browseCatalog);
-
-    browseItem.addSelectionListener(new SelectionAdapter()
-    {
-      public void widgetSelected(SelectionEvent e)
-      {
-        Menu menu = browseMenu.createContextMenu(getShell());
-        Rectangle bounds = browseItem.getBounds();
-        Point topLeft = new Point(bounds.x, bounds.y + bounds.height);
-        topLeft = browseToolBar.toDisplay(topLeft);
-        menu.setLocation(topLeft.x, topLeft.y);
-        menu.setVisible(true);
-      }
-    });
 
     // Composite errComp = new Composite(mainComposite, SWT.NONE);
     // errComp.setBackground(org.eclipse.draw2d.ColorConstants.white);
@@ -299,87 +367,4 @@
   {
     super.okPressed();
   }
-
-  protected class BrowseInWorkspaceAction extends Action
-  {
-    private static final String XSD_FILE_EXTENSION = ".xsd"; //$NON-NLS-1$
-
-    public BrowseInWorkspaceAction()
-    {
-      super(Messages._UI_ACTION_BROWSE_WORKSPACE);
-    }
-
-    public void run()
-    {
-      SelectSingleFileDialog dialog = new SelectSingleFileDialog(getShell(), null, true);
-      dialog.addFilterExtensions(new String[] { XSD_FILE_EXTENSION });
-      dialog.create();
-      dialog.setTitle(Messages._UI_LABEL_SELECT_XSD_FILE);
-      dialog.setMessage(Messages._UI_DESCRIPTION_CHOOSE_XSD_FILE);
-
-      if (dialog.open() == Window.OK)
-      {
-        IFile appInfoSchemaFile = dialog.getFile();
-        if (appInfoSchemaFile != null)
-        {
-          // remove leading slash from the value to avoid the
-          // whole leading slash ambiguity problem
-          String uri = appInfoSchemaFile.getFullPath().toString();
-          while (uri.startsWith("/") || uri.startsWith("\\")) { //$NON-NLS-1$ //$NON-NLS-2$
-            uri = uri.substring(1);
-          }
-          appInfoSchemaLocation = uri.toString();
-          source = uri;
-          fromCatalog = false;
-
-          appInfoSchemaLocation = "file://" + Platform.getLocation().toString() + "/" + appInfoSchemaLocation; //$NON-NLS-1$ //$NON-NLS-2$
-          // TODO... be careful how we construct the location
-          // UNIX related issues here
-
-          schemaDisplayer.setImage(XSDEditorPlugin.getXSDImage("icons/XSDFile.gif")); //$NON-NLS-1$
-          schemaDisplayer.setText(uri);
-
-          // Enable the OK button if we should..
-          if (isCategoryNameValid)
-          {
-            getButton(IDialogConstants.OK_ID).setEnabled(true);
-            errDisplayer.setText(""); //$NON-NLS-1$
-            errDisplayer.setImage(null);
-          }
-        }
-      }
-    }
-  }
-
-  protected class BrowseCatalogAction extends Action
-  {
-    public BrowseCatalogAction()
-    {
-      super(Messages._UI_ACTION_BROWSE_CATALOG);
-    }
-
-    public void run()
-    {
-      SelectFromCatalogDialog dialog = new SelectFromCatalogDialog(getShell());
-      // dialog.open();
-      if (dialog.open() == Window.OK)
-      {
-        appInfoSchemaLocation = dialog.getCurrentSelectionLocation();
-        source = dialog.getCurrentSelectionNamespace();
-        fromCatalog = true;
-
-        schemaDisplayer.setImage(XSDEditorPlugin.getXSDImage("icons/xmlcatalog_obj.gif")); //$NON-NLS-1$
-        schemaDisplayer.setText(dialog.getCurrentSelectionNamespace());
-
-        // Enable the OK button if we should..
-        if (isCategoryNameValid && !appInfoSchemaLocation.equals("")) //$NON-NLS-1$
-        {
-          getButton(IDialogConstants.OK_ID).setEnabled(true);
-          errDisplayer.setText(""); //$NON-NLS-1$
-          errDisplayer.setImage(null);
-        }
-      }
-    }
-  }
-
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionDetailsViewer.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionDetailsViewer.java
index c3641c5..8a62a5a 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionDetailsViewer.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionDetailsViewer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  * 
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Jesse Valianes - Seneca College https://bugs.eclipse.org/bugs/show_bug.cgi?id=235381
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo;
 
@@ -264,7 +265,8 @@
       if (item instanceof DialogNodeEditorConfiguration)
       {
         DialogNodeEditorConfiguration dialogNodeEditorConfiguration = (DialogNodeEditorConfiguration)item;        
-        dialogNodeEditorConfiguration.invokeDialog();               
+        dialogNodeEditorConfiguration.invokeDialog();
+        refresh();
       }
       else if (item instanceof ExtensionItem)
       {
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/SelectFromCatalogDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/SelectFromCatalogDialog.java
index 1f2737a..9b5daf0 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/SelectFromCatalogDialog.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/SelectFromCatalogDialog.java
@@ -139,11 +139,6 @@
       this.extensions = extensions1;
     }
 
-    public boolean isFilterProperty(Object element, Object property)
-    {
-      return false;
-    }
-
     public boolean select(Viewer viewer, Object parent, Object element)
     {
       boolean result = false;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeCustomizationRegistry.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeCustomizationRegistry.java
index a71b2f1..e4df63d 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeCustomizationRegistry.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeCustomizationRegistry.java
@@ -11,6 +11,7 @@
 package org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom;
 
 import java.util.HashMap;
+
 import org.eclipse.core.runtime.IConfigurationElement;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.viewers.ILabelProvider;
@@ -38,7 +39,6 @@
     NodeFilter nodeFilter;    
     boolean nodeEditorProviderFailedToLoad = false;
     boolean labelProviderFailedToLoad = false;
-    boolean nodeFilterFailedToLoad = false;    
     
     Descriptor(IConfigurationElement element)
     {
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/Messages.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/Messages.java
index 208c4fe..e5180f0 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/Messages.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/Messages.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -41,6 +41,7 @@
   public static String _UI_ACTION_EDIT_WITH_DOTS;
   public static String _UI_ACTION_CHANGE_PATTERN;
   public static String _UI_ACTION_ADD_ENUMERATION;
+  public static String _UI_ACTION_INSERT_ENUMERATION;
   public static String _UI_ACTION_ADD_PATTERN;
   public static String _UI_ACTION_ADD_ENUMERATIONS;
   public static String _UI_ACTION_DELETE_CONSTRAINTS;
@@ -57,6 +58,7 @@
   public static String _UI_ACTION_DELETE_APPINFO_ATTRIBUTE;
   public static String _UI_ACTION_CHANGE_CONTENT_MODEL;
   public static String _UI_ACTION_RENAME;
+  public static String _UI_ACTION_CHANGE_ENUMERATION_VALUE;
   public static String _UI_ERROR_INVALID_NAME;
   public static String _UI_LABEL_NAME;
   public static String _UI_LABEL_REFERENCE;
@@ -77,6 +79,8 @@
   public static String _UI_LABEL_MAXIMUM_VALUE;
   public static String _UI_LABEL_CONTRAINTS_ON;
   public static String _UI_LABEL_TYPE;
+  public static String _UI_LABEL_BLOCKDEFAULT;
+  public static String _UI_LABEL_FINALDEFAULT;
   public static String _UI_ACTION_CONSTRAIN_LENGTH;
   public static String _UI_ACTION_UPDATE_BOUNDS;
   public static String _UI_ACTION_COLLAPSE_WHITESPACE;
@@ -118,6 +122,7 @@
   public static String _UI_FORM;
   public static String _UI_USAGE;
   public static String _UI_ACTION_CHANGE;
+  public static String _UI_ACTION_CLOSE_SCHEMA_PREVIEW_POPUP;
   public static String _UI_ACTION_NAMESPACE_INFORMATION_CHANGE;
   public static String _UI_LABEL_ABSTRACT;
   public static String _UI_LABEL_BLOCK;
@@ -127,4 +132,9 @@
   public static String _UI_LABEL_VALUE;
   public static String _UI_LABEL_FORM;
   public static String _UI_LABEL_NILLABLE;
+  public static String _UI_LABEL_ELEMENTFORMDEFAULT;
+  public static String _UI_LABEL_ATTRIBUTEFORMDEFAULT;
+  public static String _UI_LABEL_WORKSPACE;
+  public static String _UI_LABEL_CATALOG;
+  public static String _UI_DELETE_BUTTON;
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDCommonUIUtils.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDCommonUIUtils.java
index 5b9195c..9510888 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDCommonUIUtils.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDCommonUIUtils.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,24 +7,34 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     Naoki Akiyama, Fujitsu - Bug 244901 - Cannot set xsd:annotation to 
+ *                              xsd:redefine by Properties view.
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.common.util;
 
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Stack;
 
 import org.eclipse.emf.common.util.EList;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.viewers.DecorationOverlayIcon;
 import org.eclipse.jface.viewers.IDecoration;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.CLabel;
 import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
 import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
 import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
 import org.eclipse.wst.xsd.ui.internal.adt.design.ImageOverlayDescriptor;
+import org.eclipse.wst.xsd.ui.internal.common.properties.sections.AbstractSection;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
 import org.eclipse.xsd.XSDAnnotation;
 import org.eclipse.xsd.XSDAttributeDeclaration;
@@ -34,6 +44,7 @@
 import org.eclipse.xsd.XSDComplexTypeDefinition;
 import org.eclipse.xsd.XSDConcreteComponent;
 import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDEnumerationFacet;
 import org.eclipse.xsd.XSDFacet;
 import org.eclipse.xsd.XSDFactory;
 import org.eclipse.xsd.XSDFeature;
@@ -245,18 +256,21 @@
     else if (input instanceof XSDRedefine)
     {
       XSDRedefine xsdComp = (XSDRedefine) input;
-      List list = xsdComp.getAnnotations();
-      if (list.size() > 0)
-      {
-        xsdAnnotation = (XSDAnnotation) list.get(0);
-      }
-      else
-      {
-        if (createIfNotExist && xsdAnnotation == null)
+      List contents = xsdComp.getContents(); 
+      for (int i = 0; i < contents.size(); i++)
+      { 
+        Object content = contents.get(i);
+        if (content instanceof XSDAnnotation)
         {
-          // ?
+          xsdAnnotation = (XSDAnnotation) content;
+          break;
         }
       }
+      if (createIfNotExist && xsdAnnotation == null)
+      {
+        xsdAnnotation = factory.createXSDAnnotation();
+        contents.add(0, xsdAnnotation);
+      }
       return xsdAnnotation;
     }
     else if (input instanceof XSDAnnotation)
@@ -315,6 +329,23 @@
     }
     return testName;
   }
+  
+  public static String createUniqueEnumerationValue(String prefix, List elements)
+  {
+    ArrayList usedNames = new ArrayList();
+    for (Iterator i = elements.iterator(); i.hasNext();)
+    {
+      usedNames.add(((XSDEnumerationFacet) i.next()).getLexicalValue());
+    }
+
+    int i = 1;
+    String testName = prefix;
+    while (usedNames.contains(testName))
+    {
+      testName = prefix + i++;
+    }
+    return testName;
+  }
 
   public static String getDisplayName(XSDNamedComponent component)
   {
@@ -415,22 +446,35 @@
     return anonymousSimpleType;
   }
 
+  // bug246036 - check for cyclic groups.  We should refactor out this static class.
+  private static Stack visitedGroups = new Stack();
+  
+  public static void resetVisitedGroupsStack()
+  {
+    visitedGroups.clear();
+  }
+
   public static List getChildElements(XSDModelGroup group)
   {
     List children = new ArrayList();
+    visitedGroups.push(group);
     if (group == null) return children;
+    
     for (Iterator i = group.getContents().iterator(); i.hasNext();)
     {
       XSDParticle next = (XSDParticle) i.next();
       if (next.getContent() instanceof XSDFeature)
       {
+        if (children.contains(next.getContent())) break;
         children.add(next.getContent());
       }
       else if (next.getTerm() instanceof XSDModelGroup)
       {
+        if (!visitedGroups.contains(group))
         children.addAll(getChildElements((XSDModelGroup) next.getTerm()));
       }
     }
+    visitedGroups.pop();
     return children;
   }
 
@@ -550,4 +594,29 @@
     }
   }
 
+  public static CCombo getNewPropertiesCombo(Composite composite, TabbedPropertySheetWidgetFactory widgetFactory,
+      AbstractSection listener, String[] items, String helpID)
+  {
+    CCombo combo = widgetFactory.createCCombo(composite);
+    combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+    combo.setEditable(false);
+    combo.setItems(items);
+    combo.addSelectionListener(listener);    
+    PlatformUI.getWorkbench().getHelpSystem().setHelp(combo, helpID);
+    return combo;
+  }
+  
+  public static CLabel getNewPropertiesLabel(Composite composite, TabbedPropertySheetWidgetFactory widgetFactory,
+      String labelText)
+  {
+    // Create label
+    CLabel label;    
+    label = widgetFactory.createCLabel(composite, labelText);
+    GridData data = new GridData();
+    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+    data.grabExcessHorizontalSpace = false;
+    label.setLayoutData(data);
+    
+    return label;
+  }
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDDirectivesManager.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDDirectivesManager.java
new file mode 100644
index 0000000..39a1d8b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDDirectivesManager.java
@@ -0,0 +1,815 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.common.util;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDImport;
+import org.eclipse.xsd.XSDInclude;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDRedefine;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSchemaDirective;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.impl.XSDSchemaImpl;
+import org.eclipse.xsd.util.XSDConstants;
+import org.eclipse.xsd.util.XSDUtil;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * This class performs cleanup/removal of unused XSD imports and includes from XML Schemas
+ * and xmlns entries in the namespace table
+ */
+public class XSDDirectivesManager
+{
+  protected static final String XMLNS = "xmlns"; //$NON-NLS-1$
+  // List of all the unused directives.  These will be removed
+  protected List unusedDirectives = new ArrayList();
+  // List of all the included XSDSchema's
+  protected List usedIncludeSchemas = new ArrayList();
+  // List of all the XSDInclude's that are indirectly used
+  protected List usedIndirectIncludes = new ArrayList();
+  // List of the XSDInclude's that are directly used
+  protected List usedDirectIncludes = new ArrayList();
+  // Used to track the included schemas that were analyzed to avoid circular loop
+  protected List analyzedIncludeSchemas = new ArrayList();
+  // List of all the imported used schemas
+  protected List usedSchemas = new ArrayList();
+  // List of all the indirectly used includes  
+  protected Map usedIndirectIncludesMap = new HashMap();
+  // Keep track of all the unused prefixes
+  protected Set unusedPrefixes;
+  // Keep track of all the used prefixes
+  protected Set usedPrefixes;
+  // Map of each schema's unused prefixes
+  protected Map schemaToPrefixMap;
+
+  public static void removeUnusedXSDImports(XSDSchema schema)
+  {
+    // Only do the removal if the preference is turned on
+    if (XSDEditorPlugin.getDefault().getRemoveImportSetting())
+    {
+      XSDDirectivesManager mgr = new XSDDirectivesManager();
+      mgr.performRemoval(schema);
+      mgr.cleanup();
+    }
+  }
+  
+  /**
+   * Main method to do the cleanup
+   * @param schema
+   */
+  public void performRemoval(XSDSchema schema)
+  {
+    // Compute unused imports and unused prefixes
+    computeUnusedImports(schema);
+    // Remove the imports
+    removeUnusedImports();
+    // Remove the prefixes
+    removeUnusedPrefixes();
+  }
+  
+  /**
+   * Clients can manually clean the lists
+   */
+  public void cleanup()
+  {
+    clearMaps();
+  }
+
+  /**
+   * After performing the cleanup, return the list of unused XSD directives
+   *  
+   * @return list of unused XSD directives
+   */
+  public List getUnusedXSDDirectives()
+  {
+    return unusedDirectives;
+  }
+  
+  /**
+   * After performing the cleanup, return the map of each schemas unused prefixes
+   * 
+   * @return map of each schemas unused prefixes
+   */
+  public Map getSchemaToPrefixMap()
+  {
+    return schemaToPrefixMap;
+  }
+
+  /**
+   * Returns the set of unused prefixes from the XML namespace table
+   * 
+   * @return set of unused prefixes
+   */
+  public Set getUnusedPrefixes()
+  {
+    return unusedPrefixes;
+  }
+
+  /**
+   * Returns the set of used prefixes from the XML namespace table
+   * 
+   * @return set of used prefixes
+   */
+  public Set getUsedPrefixes()
+  {
+    return usedPrefixes;
+  }
+
+  /**
+   * Perform any cleanup after computing and removing the unused imports.
+   */
+  protected void clearMaps()
+  {
+    if (schemaToPrefixMap != null)
+    {
+      schemaToPrefixMap.clear();
+    }
+  }
+
+  /**
+   * Remove the list of all unused imports.  Imports is used in the generic term here.
+   */
+  protected void removeUnusedImports()
+  {
+    Iterator iter = unusedDirectives.iterator();
+    while (iter.hasNext())
+    {
+      XSDSchemaDirective xsdDirective = (XSDSchemaDirective) iter.next();
+      removeXSDDirective(xsdDirective);
+    }
+  }
+
+  /**
+   * Removes the directive from the model
+   * @param xsdImport
+   */
+  protected void removeXSDDirective(XSDSchemaDirective xsdImport)
+  {
+    XSDSchema schema = xsdImport.getSchema();
+    
+    Element element = xsdImport.getElement();
+    
+    Document doc = element.getOwnerDocument();
+
+    if (doc instanceof IDOMNode)
+      ((IDOMNode)doc).getModel().aboutToChangeModel();
+    
+    try
+    {
+      if (!removeTextNodesBetweenNextElement(element))
+      {
+        removeTextNodeBetweenPreviousElement(element);
+      }
+      element.getParentNode().removeChild(element);
+    }
+    finally
+    {
+      if (doc instanceof IDOMNode)
+      {
+        ((IDOMNode)doc).getModel().changedModel();
+      }
+      schema.update(true);
+    }
+
+  }
+
+  /**
+   * This computes the list of unused imports for a schema
+   * @param schema
+   */
+  protected void computeUnusedImports(XSDSchema schema)
+  {
+    unusedDirectives = new ArrayList();
+    usedSchemas = new ArrayList();
+    usedPrefixes = new HashSet();
+    schemaToPrefixMap = new HashMap();
+    
+    try
+    {
+      // Step One.  Find unused imports using cross referencer
+      Map xsdNamedComponentUsage = TopLevelComponentCrossReferencer.find(schema);
+      
+      doCrossReferencer(schema, usedSchemas, xsdNamedComponentUsage);
+
+      // Step Two.  Update the unusedImport list given the list of used schemas obtained from cross referencing
+      addToUnusedImports(schema, usedSchemas);
+      
+      // Step Three.  Compute unused prefixes to be removed
+      computeUnusedPrefixes(schema);
+    }
+    catch (Exception e)
+    {
+      unusedDirectives.clear();
+      schemaToPrefixMap.clear();
+    }
+  }
+  
+  /**
+   * Computes the list of unused prefixes from the XML namespace table given a schema
+   * @param schema
+   */
+  protected void computeUnusedPrefixes(XSDSchema schema)
+  {
+    Map prefixMap = schema.getQNamePrefixToNamespaceMap();
+    Set definedPrefixes = prefixMap.keySet();
+    Set actualSet = new HashSet();
+    NamedNodeMap attributes = schema.getElement().getAttributes();
+    Iterator iter = definedPrefixes.iterator();
+    while (iter.hasNext())
+    {
+      String pref = (String)iter.next();
+      if (pref == null)
+      {
+        if (attributes.getNamedItem(XMLNS) != null)
+           actualSet.add(null);
+      }
+      else
+      {
+        if (attributes.getNamedItem(XMLNS + ":" + pref) != null) //$NON-NLS-1$
+          actualSet.add(pref);
+      }
+    }
+
+    unusedPrefixes = new HashSet(actualSet);
+    
+    usedPrefixes.add(schema.getSchemaForSchemaQNamePrefix());
+    
+    Element element = schema.getElement();
+    
+    NodeList childElements = element.getChildNodes();
+    int length = childElements.getLength();
+    for (int i = 0; i < length; i++)
+    {
+      Node node = childElements.item(i);
+      if (node instanceof Element)
+      {
+        traverseDOMElement((Element)node, schema);
+      }
+    }
+    
+    // compute the used prefixes
+    computeUsedXSDPrefixes(schema);
+    
+    // remove the used prefixes from the unused to get the list of unused prefixes
+    unusedPrefixes.removeAll(usedPrefixes);
+    
+    // perform additional process from extenders
+    doAdditionalProcessing(schema);
+    
+    schemaToPrefixMap.put(schema, unusedPrefixes);
+  }
+  
+  /**
+   * Remove unused prefixes from the XML namespace table
+   */
+  protected void removeUnusedPrefixes()
+  {
+    Set schemaSet = schemaToPrefixMap.keySet();
+    Iterator iter = schemaSet.iterator();
+    while (iter.hasNext())
+    {
+      XSDSchema schema = (XSDSchema)iter.next();
+      Map prefixMap = schema.getQNamePrefixToNamespaceMap();
+      Set prefixesToRemove = (Set)schemaToPrefixMap.get(schema);
+      Iterator iter2 = prefixesToRemove.iterator();
+      while (iter2.hasNext())
+      {
+        String string = (String)iter2.next();
+        if (prefixMap.containsKey(string))
+          prefixMap.remove(string);
+      }
+    }
+  }
+  
+  /**
+   * Extenders can customize
+   * @param schema
+   */
+  protected void doAdditionalProcessing(XSDSchema schema)
+  {
+    // Do nothing for XSD
+  }
+  
+  /**
+   * 
+   * @param schema
+   */
+  private void computeUsedXSDPrefixes(XSDSchema schema)
+  {
+    Map prefixMap = schema.getQNamePrefixToNamespaceMap();
+    Set definedPrefixes = prefixMap.keySet();
+    
+    boolean foundEntryForTargetNamespace = false;
+    String targetNamespace = schema.getTargetNamespace();
+    for (Iterator iter = usedPrefixes.iterator(); iter.hasNext(); )
+    {
+      String key = (String) iter.next();
+      String value = (String) prefixMap.get(key);
+      if (targetNamespace == null && value == null)
+      {
+        foundEntryForTargetNamespace = true;
+        break;
+      }
+      else if (targetNamespace != null && value != null)
+      {
+        if (targetNamespace.equals(value))
+        {
+          foundEntryForTargetNamespace = true;
+          break;
+        }
+      }
+    }
+    
+    if (!foundEntryForTargetNamespace)
+    {
+      for (Iterator iter = definedPrefixes.iterator(); iter.hasNext();)
+      {
+        String key = (String) iter.next();
+        String value = (String) prefixMap.get(key);
+        if (targetNamespace == null && value == null)
+        {
+          usedPrefixes.add(null);
+          break;
+        }
+        else if (targetNamespace != null && value != null)
+        {
+          if (targetNamespace.equals(value))
+          {
+            usedPrefixes.add(key);
+            break;
+          }
+        }
+      }
+    }
+  }
+  
+  /**
+   * Find prefixes that are in the document.
+   * @param element
+   * @param schema
+   */
+  private void traverseDOMElement(Element element, XSDSchema schema)
+  {
+    String prefix = element.getPrefix();
+    usedPrefixes.add(prefix);
+    
+    NamedNodeMap attrs = element.getAttributes();
+    int numOfAttrs = attrs.getLength();
+    for (int i = 0; i < numOfAttrs; i++)
+    {
+      Node node = attrs.item(i);
+      String attrPrefix = node.getPrefix();
+      if (attrPrefix != null)
+      {
+        usedPrefixes.add(attrPrefix);
+      }
+      
+      String attr = node.getLocalName();
+      if (attr != null)
+      {
+        String value = node.getNodeValue();
+        if (value == null) continue;
+        if (attr.equals(XSDConstants.REF_ATTRIBUTE) ||
+            attr.equals(XSDConstants.REFER_ATTRIBUTE) ||
+            attr.equals(XSDConstants.TYPE_ATTRIBUTE) ||
+            attr.equals(XSDConstants.BASE_ATTRIBUTE) ||
+            attr.equals(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE) ||
+            attr.equals(XSDConstants.ITEMTYPE_ATTRIBUTE))
+        {
+          try
+          {
+            usedPrefixes.add(extractPrefix(value));
+          }
+          catch (IndexOutOfBoundsException e)
+          {
+          }
+        }
+        else if (attr.equals(XSDConstants.MEMBERTYPES_ATTRIBUTE))
+        {
+          StringTokenizer tokenizer = new StringTokenizer(value);
+          while (tokenizer.hasMoreTokens())
+          {
+            try
+            {
+              String token = tokenizer.nextToken();
+              usedPrefixes.add(extractPrefix(token));
+            }
+            catch (IndexOutOfBoundsException e)
+            {
+            }
+          }
+        }
+      }
+    }
+    
+    NodeList childElements = element.getChildNodes();
+    int length = childElements.getLength();
+    for (int i = 0; i < length; i++)
+    {
+      Node node = childElements.item(i);
+      if (node instanceof Element)
+      {
+        traverseDOMElement((Element)node, schema);
+      }
+    }
+  }
+  
+  /**
+   * Extract the prefix from the given string.  For example, pref:attr returns pref.
+   * @param value
+   * @return the prefix
+   */
+  protected String extractPrefix(String value)
+  {
+    int index = value.indexOf(':');
+    if (index < 0) 
+      return null;
+    else
+      return value.substring(0, index);
+  }
+
+  /**
+   * This determines the list of referenced components and hence the used schemas from which
+   * we can determine what are the unused directives
+   * 
+   * @param schema
+   * @param unusedImportList
+   * @param usedSchemas
+   */
+  protected void doCrossReferencer(XSDSchema schema, List usedSchemas, Map xsdNamedComponentUsage)
+  {
+    // Calculate additional unused imports that may have the same
+    // namespace that did not get added in the initial pass
+    Iterator iterator = xsdNamedComponentUsage.keySet().iterator();
+    // First determine the used schemas from the cross referencer
+    while (iterator.hasNext())
+    {
+      XSDNamedComponent namedComponent = (XSDNamedComponent) iterator.next();
+      XSDSchema namedComponentSchema = namedComponent.getSchema();
+      // If the named component belongs to the same schema, then continue...we
+      // want to check the external references
+      if (namedComponentSchema == schema)
+      {
+        continue;
+      }
+      Collection collection = (Collection) xsdNamedComponentUsage.get(namedComponent);
+      Iterator iterator2 = collection.iterator();
+      while (iterator2.hasNext())
+      {
+        Setting setting = (Setting) iterator2.next();
+        Object obj = setting.getEObject();
+        if (isComponentUsed(obj, schema, namedComponentSchema))
+        {
+          if (!usedSchemas.contains(namedComponentSchema))
+            usedSchemas.add(namedComponentSchema);
+        }
+      }
+    }
+  }
+  
+  /**
+   * Determines if the object to be analyzed is referenced by the schema 
+   * @param obj
+   * @param schema
+   * @param targetSchema
+   * @return true if the component is referenced by the schema, false if not referenced
+   */
+  protected boolean isComponentUsed(Object obj, XSDSchema schema, XSDSchema targetSchema)
+  {
+    if (obj instanceof XSDConcreteComponent)
+    {
+      XSDConcreteComponent component = (XSDConcreteComponent) obj;
+      if (component == schema || component instanceof XSDSchema)
+      {
+        return false;
+      }
+      if (!usedIncludeSchemas.contains(targetSchema))
+        usedIncludeSchemas.add(targetSchema);
+      return true;
+    }
+    return false;
+  }
+  
+  /**
+   * From a list of used schemas, update the unusedImports list for the given schema
+   * 
+   * @param schema
+   * @param unusedImports
+   * @param usedSchemas
+   */
+  protected void addToUnusedImports(XSDSchema schema, List usedSchemas)
+  {
+    // now that we have the list of usedSchemas, get the list of unused
+    // schemas by comparing this list to what is actually in the schema
+    Iterator iter = schema.getContents().iterator();
+    while(iter.hasNext())
+    {
+      Object o = iter.next();
+      if (o instanceof XSDSchemaDirective)
+      {
+        XSDSchemaDirective directive = (XSDSchemaDirective) o;
+        boolean isUsed = false;
+        Iterator iter2 = usedSchemas.iterator();
+        while (iter2.hasNext())
+        {
+          XSDSchema usedSchema = (XSDSchema) iter2.next();
+          if (directive instanceof XSDImport && directive.getResolvedSchema() == usedSchema)
+          {
+            isUsed = true;
+            break;
+          }
+          if (directive instanceof XSDInclude && ((XSDInclude)directive).getIncorporatedSchema() == usedSchema)
+          {
+            isUsed = true;
+            usedDirectIncludes.add(usedSchema);
+            break;
+          }
+          // blindly accept redefines as used
+          if (directive instanceof XSDRedefine)
+          {
+            isUsed = true;
+            break;
+          }
+        }
+        
+        // If it is an include, we need to check if it is used indirectly
+        if (directive instanceof XSDInclude && !isUsed)
+        {
+          XSDInclude inc = (XSDInclude)directive;
+          XSDSchema incSchema = inc.getIncorporatedSchema();
+          if (incSchema != null)
+          {
+            XSDSchema usedSchema = getUsedIncludeSchema(incSchema, inc);
+            if (usedSchema != null)
+            {
+              usedIndirectIncludes.add(directive);
+              usedIndirectIncludesMap.put(directive, usedSchema);
+              isUsed = true;
+            }
+            else
+            {
+              isUsed = false;
+            }
+          }
+        }
+        
+        // If resolved directives are determined unused
+        // If resolved directives are not already in the unused list
+        // Also any redefines should be considered used
+        if (!isUsed && !unusedDirectives.contains(directive) && !(directive instanceof XSDRedefine))
+        {
+          unusedDirectives.add(directive);
+        }
+      }
+    }
+    Iterator iter3 = usedIndirectIncludes.iterator();
+    while (iter3.hasNext())
+    {
+      Object o = iter3.next();
+      if (o instanceof XSDInclude)
+      {
+        XSDInclude inc = (XSDInclude)o;
+        XSDSchema targetSchema = (XSDSchema)usedIndirectIncludesMap.get(inc);
+        if (usedIncludeSchemas.contains(targetSchema) && usedDirectIncludes.contains(targetSchema))
+        {
+          unusedDirectives.add(inc);
+        }
+        else
+        {
+          usedDirectIncludes.add(targetSchema);
+        }
+      }
+    }
+  }
+
+  /**
+   * Includes can be used indirectly.   If the schema includes A which includes B, but the schema
+   * references something in B, then A is indirectly used, and hence A cannot be removed.
+   * 
+   * @param schema
+   * @param xsdInclude
+   * @return the referenced schema if used, null if not used
+   */
+  private XSDSchema getUsedIncludeSchema(XSDSchema schema, XSDInclude xsdInclude)
+  {
+    XSDSchema refSchema = null;
+    boolean isUsed = false;
+    Iterator iter = schema.getContents().iterator();
+    while (iter.hasNext())
+    {
+      Object o = iter.next();
+      if (o instanceof XSDInclude)
+      {
+        XSDInclude inc = (XSDInclude)o;
+        XSDSchema incSchema = inc.getIncorporatedSchema();
+        if (incSchema != null)
+        {
+          Iterator iter2 = usedIncludeSchemas.iterator();
+          while (iter2.hasNext())
+          {
+            XSDSchema xsdSch = (XSDSchema)iter2.next();
+            if (incSchema == xsdSch)
+            {
+              isUsed = true;
+              refSchema = incSchema;
+              break;
+            }
+          }
+          
+          if (!isUsed)
+          {
+            if (!analyzedIncludeSchemas.contains(incSchema)) // To prevent infinite cycle
+            {
+              analyzedIncludeSchemas.add(incSchema);
+              refSchema = getUsedIncludeSchema(incSchema, inc);
+            }
+          }
+          if (isUsed || refSchema != null)
+          {
+            return refSchema;
+          }
+        }
+      }
+      else
+      {
+        break;
+      }
+    }
+    return refSchema;
+  }
+  
+  /**
+   * See cross reference for more details. 
+   */
+  protected static class TopLevelComponentCrossReferencer extends XSDUtil.XSDNamedComponentCrossReferencer
+  {
+    private static final long serialVersionUID = 1L;
+    
+    XSDSchema schemaForSchema = XSDUtil.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
+    XSDSchema schemaForXSI = XSDSchemaImpl.getSchemaInstance(XSDConstants.SCHEMA_INSTANCE_URI_2001);
+
+    protected TopLevelComponentCrossReferencer(EObject arg0)
+    {
+      super(arg0);
+    }
+
+    /**
+     * Returns a map of all XSDNamedComponent cross references in the content
+     * tree.
+     */
+    public static Map find(EObject eObject)
+    {
+      TopLevelComponentCrossReferencer result = new TopLevelComponentCrossReferencer(eObject);
+      result.crossReference();
+      result.done();
+      return result;
+    }
+
+    protected boolean crossReference(EObject eObject, EReference eReference, EObject crossReferencedEObject)
+    {
+      if (crossReferencedEObject instanceof XSDNamedComponent)
+      {
+        XSDNamedComponent namedComponent = (XSDNamedComponent) crossReferencedEObject;
+
+        if (namedComponent.getContainer() == schemaForSchema || 
+            namedComponent.getContainer() == schemaForXSI || 
+            crossReferencedEObject.eContainer() == eObject || 
+            namedComponent.getName() == null)
+        {
+          return false;
+        }
+
+        if (namedComponent instanceof XSDTypeDefinition)
+        {
+          XSDTypeDefinition typeDefinition = (XSDTypeDefinition) namedComponent;
+          if (!(typeDefinition.getContainer() instanceof XSDSchema))
+          {
+            return false;
+          }
+          if (typeDefinition.getName() == null)
+          {
+            return false;
+          }
+        }
+        return true;
+      }
+      return false;
+    }
+  }
+
+  /**
+   * Helper method to remove Text nodes
+   * @param element
+   * @return
+   */
+  protected boolean removeTextNodesBetweenNextElement(Element element)
+  {
+    List nodesToRemove = new ArrayList();
+    for (Node node = element.getNextSibling(); node != null; node = node.getNextSibling())
+    {
+      if (node.getNodeType() == Node.TEXT_NODE)
+      {
+        nodesToRemove.add(node);
+      }
+      else if (node.getNodeType() == Node.ELEMENT_NODE)
+      {
+        for (Iterator j = nodesToRemove.iterator(); j.hasNext();)
+        {
+          Node nodeToRemove = (Node) j.next();
+          nodeToRemove.getParentNode().removeChild(nodeToRemove);
+        }
+        return true;
+      }
+    }
+    return false;
+  }
+
+  /**
+   * Helper method to remove Text nodes.
+   * @param element
+   * @return
+   */
+  protected boolean removeTextNodeBetweenPreviousElement(Element element)
+  {
+    List nodesToRemove = new ArrayList();
+    for (Node node = element.getPreviousSibling(); node != null; node = node.getPreviousSibling())
+    {
+      if (node.getNodeType() == Node.TEXT_NODE)
+      {
+        nodesToRemove.add(node);
+      }
+      else if (node.getNodeType() == Node.ELEMENT_NODE)
+      {
+        for (Iterator j = nodesToRemove.iterator(); j.hasNext();)
+        {
+          Node nodeToRemove = (Node) j.next();
+          nodeToRemove.getParentNode().removeChild(nodeToRemove);
+        }
+        return true;
+      }
+    }
+    return false;
+  }
+  
+  /**
+   * 
+   * @param iFile
+   * @param checkPreference - if false, ignore checking the preference setting 
+   * @throws CoreException
+   * @throws IOException
+   */
+  
+  public static void removeUnusedXSDImports(IFile iFile, boolean checkPreference) throws CoreException, IOException
+  {
+    if (!checkPreference || XSDEditorPlugin.getDefault().getRemoveImportSetting())
+    {
+      IDOMModel model = (IDOMModel) StructuredModelManager.getModelManager().getModelForEdit(iFile);
+      if (model != null)
+      {
+        Document document = model.getDocument();
+        if (document != null)
+        {
+          XSDSchema schema = XSDModelAdapter.lookupOrCreateSchema(document);
+          XSDDirectivesManager mgr = new XSDDirectivesManager();
+          mgr.performRemoval(schema);
+          mgr.cleanup();
+          model.save();
+        }
+      }
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDDirectivesSchemaLocationUpdater.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDDirectivesSchemaLocationUpdater.java
new file mode 100644
index 0000000..1f8c19d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDDirectivesSchemaLocationUpdater.java
@@ -0,0 +1,169 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.common.util;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.common.ui.internal.viewers.ResourceFilter;
+import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
+import org.eclipse.wst.xsd.ui.internal.wizards.XSDSelectIncludeFileWizard;
+import org.eclipse.xsd.XSDImport;
+import org.eclipse.xsd.XSDInclude;
+import org.eclipse.xsd.XSDRedefine;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.impl.XSDImportImpl;
+import org.w3c.dom.Element;
+
+public class XSDDirectivesSchemaLocationUpdater
+{
+  /**
+   * Modifies the schema location by opening the schema location dialog and
+   * processing the results. This method refactors the code in
+   * XSDImportSection$widgetSelected and SchemaLocationSection$widgetSelected
+   * and the processing in handleSchemaLocationChange()
+   */
+  public static void updateSchemaLocation(XSDSchema xsdSchema, Object selection, boolean isInclude)
+  {
+    Shell shell = Display.getCurrent().getActiveShell();
+    IFile currentIFile = null;
+    IEditorInput editorInput = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorInput();
+    ViewerFilter filter;
+
+    if (editorInput instanceof IFileEditorInput)
+    {
+      currentIFile = ((IFileEditorInput) editorInput).getFile();
+      filter = new ResourceFilter(new String[] { ".xsd" }, //$NON-NLS-1$ 
+          new IFile[] { currentIFile }, null);
+    }
+    else
+    {
+      filter = new ResourceFilter(new String[] { ".xsd" }, //$NON-NLS-1$ 
+          null, null);
+    }
+
+    XSDSelectIncludeFileWizard fileSelectWizard = new XSDSelectIncludeFileWizard(xsdSchema, isInclude, XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_SCHEMA"), //$NON-NLS-1$
+        XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_DESC"), //$NON-NLS-1$
+        filter, new StructuredSelection(selection));
+
+    WizardDialog wizardDialog = new WizardDialog(shell, fileSelectWizard);
+    wizardDialog.create();
+    wizardDialog.setBlockOnOpen(true);
+    int result = wizardDialog.open();
+
+    if (result == Window.OK)
+    {
+      IFile selectedIFile = fileSelectWizard.getResultFile();
+      String schemaFileString;
+      if (selectedIFile != null && currentIFile != null)
+      {
+        schemaFileString = URIHelper.getRelativeURI(selectedIFile.getLocation(), currentIFile.getLocation());
+      }
+      else if (selectedIFile != null && currentIFile == null)
+      {
+        schemaFileString = selectedIFile.getLocationURI().toString();
+      }
+      else
+      {
+        schemaFileString = fileSelectWizard.getURL();
+      }
+
+      String attributeSchemaLocation = "schemaLocation"; //$NON-NLS-1$
+      if (selection instanceof XSDImport)
+      {
+        XSDImport xsdImport = (XSDImport) selection;
+        xsdImport.getElement().setAttribute(attributeSchemaLocation, schemaFileString); //$NON-NLS-1$
+
+        String namespace = fileSelectWizard.getNamespace();
+        if (namespace == null)
+          namespace = ""; //$NON-NLS-1$
+
+        XSDSchema externalSchema = fileSelectWizard.getExternalSchema();
+        java.util.Map map = xsdSchema.getQNamePrefixToNamespaceMap();
+        Element schemaElement = xsdSchema.getElement();
+
+        // update the xmlns in the schema element first, and then update the
+        // import element next so that the last change will be in the import element. This keeps the
+        // selection on the import element
+        TypesHelper helper = new TypesHelper(externalSchema);
+        String prefix = helper.getPrefix(namespace, false);
+
+        if (map.containsKey(prefix))
+        {
+          prefix = null;
+        }
+
+        if (prefix == null || (prefix != null && prefix.length() == 0))
+        {
+          StringBuffer newPrefix = new StringBuffer("pref"); //$NON-NLS-1$
+          int prefixExtension = 1;
+          while (map.containsKey(newPrefix.toString()) && prefixExtension < 100)
+          {
+            newPrefix = new StringBuffer("pref" + String.valueOf(prefixExtension)); //$NON-NLS-1$
+            prefixExtension++;
+          }
+          prefix = newPrefix.toString();
+        }
+
+        String attributeNamespace = "namespace"; //$NON-NLS-1$
+        if (namespace.length() > 0)
+        {
+          // if ns already in map, use its corresponding prefix
+          if (map.containsValue(namespace))
+          {
+            TypesHelper typesHelper = new TypesHelper(xsdSchema);
+            prefix = typesHelper.getPrefix(namespace, false);
+          }
+          else
+          // otherwise add to the map
+          {
+            schemaElement.setAttribute("xmlns:" + prefix, namespace); //$NON-NLS-1$
+          }
+          // prefixText.setText(prefix);
+          xsdImport.getElement().setAttribute(attributeNamespace, namespace);
+        }
+
+        // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=155885
+        // Need to import otherwise the external schema is never
+        // resolved. One problem is that the schema location is still null,
+        // so the set types dialog will show types that belong to that schema
+        // with a null schema location. This should load resource
+        // into the resource set
+        if (selection instanceof XSDImportImpl) // redundant
+        {
+          XSDImportImpl xsdImportImpl = (XSDImportImpl) selection;
+          xsdImportImpl.importSchema();
+        }
+
+      }
+      else if (selection instanceof XSDInclude)
+      {
+        XSDInclude xsdInclude = (XSDInclude) selection;
+        xsdInclude.getElement().setAttribute(attributeSchemaLocation, schemaFileString);
+      }
+      else if (selection instanceof XSDRedefine)
+      {
+        XSDRedefine xsdRedefine = (XSDRedefine) selection;
+        xsdRedefine.getElement().setAttribute(attributeSchemaLocation, schemaFileString);
+      }
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/messages.properties b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/messages.properties
index 6f3f636..a5bdc10 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/messages.properties
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/messages.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2008 IBM Corporation and others.
+# Copyright (c) 2001, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -8,71 +8,78 @@
 # Contributors:
 #     IBM Corporation - initial API and implementation
 ###############################################################################
-_UI_ACTION_OPEN_IN_NEW_EDITOR=Open In New Editor
+_UI_ACTION_OPEN_IN_NEW_EDITOR=&Open In New Editor
 _UI_ACTION_DELETE_CONSTRAINTS=Delete Constraints
 _UI_ACTION_DELETE_ENUMERATION=Delete Enumeration
 _UI_ACTION_DELETE_APPINFO_ELEMENT=Delete AppInfo Element
 _UI_ACTION_DELETE_APPINFO_ATTRIBUTE=Delete AppInfo Attribute
 _UI_ACTION_DELETE_EXTENSION_COMPONENT=Delete Extension Component
-_UI_ACTION_ADD_ATTRIBUTE_GROUP=Add Attribute Group
+_UI_ACTION_ADD_ATTRIBUTE_GROUP=Add Attribute &Group
 _UI_ACTION_ADD_APPINFO_ELEMENT=Add AppInfo Element
-_UI_ACTION_ADD_ATTRIBUTE=Add Attribute
-_UI_ACTION_ADD_GROUP_REF=Add Group Ref
+_UI_ACTION_ADD_ATTRIBUTE=Add &Attribute
+_UI_ACTION_ADD_GROUP_REF=Add &Group Ref
 _UI_ACTION_ADD_ANY_ELEMENT=Add An&y
-_UI_ACTION_ADD_ANY_ATTRIBUTE=Add Any Attribute
-_UI_ACTION_ADD_WITH_DOTS=Add...
+_UI_ACTION_ADD_ANY_ATTRIBUTE=Add A&ny Attribute
+_UI_ACTION_ADD_WITH_DOTS=&Add...
 _UI_ACTION_UPDATE_BOUNDS=Update bounds
-_UI_ACTION_ADD_COMPLEX_TYPE=Add Complex Type
+_UI_ACTION_ADD_COMPLEX_TYPE=Add &Complex Type
 _UI_ACTION_ADD_ENUMERATIONS=Add Enumerations
 _UI_ACTION_ADD_DOCUMENTATION=Add Documentation
 _UI_ACTION_CONSTRAIN_LENGTH=Constrain length
 _UI_ACTION_BROWSE_WORKSPACE=Workspace
+_UI_DELETE_BUTTON=&Delete
 _UI_LABEL_NO_ITEMS_SELECTED=No items selected
+_UI_LABEL_ELEMENTFORMDEFAULT=Prefix for &Elements:
+_UI_LABEL_ATTRIBUTEFORMDEFAULT=Prefix for &Attributes:
+_UI_LABEL_BLOCKDEFAULT=&Block default:
 _UI_LABEL_EXTENSION_DETAILS=Extension Details
-_UI_LABEL_EXTENSION_CATEGORIES=Extension Categories:
-_UI_LABEL_COLLAPSE_WHITESPACE=Collapse whitespace
-_UI_LABEL_RESTRICT_VALUES_BY=Restrict values by:
-_UI_LABEL_MINIMUM_LENGTH=Minimum length:
-_UI_LABEL_MAXIMUM_LENGTH=Maximum length:
+_UI_LABEL_EXTENSION_CATEGORIES=Extension &Categories:
+_UI_LABEL_FINALDEFAULT=&Final default:
+_UI_LABEL_COLLAPSE_WHITESPACE=Collapse &whitespace
+_UI_LABEL_RESTRICT_VALUES_BY=&Restrict values by:
+_UI_LABEL_MINIMUM_LENGTH=Mi&nimum length:
+_UI_LABEL_MAXIMUM_LENGTH=Ma&ximum length:
 _UI_LABEL_SELECT_XSD_FILE=Select XSD file
 _UI_LABEL_CONSTRAINTS_ON_VALUE_OF=Constraints on value of 
-_UI_ACTION_ADD_SIMPLE_TYPE=Add Simple Type
-_UI_ACTION_EDIT_WITH_DOTS=Edit...
+_UI_ACTION_ADD_SIMPLE_TYPE=Add &Simple Type
+_UI_ACTION_EDIT_WITH_DOTS=&Edit...
 _UI_ACTION_CHANGE_PATTERN=Change pattern
-_UI_ACTION_ADD_ENUMERATION=Add Enumeration
+_UI_ACTION_ADD_ENUMERATION=Add &Enumeration
+_UI_ACTION_INSERT_ENUMERATION=&Insert Enumeration
+_UI_ACTION_CHANGE_ENUMERATION_VALUE=Change Enumeration value
 _UI_ACTION_DELETE_PATTERN=Delete Pattern
 _UI_ACTION_BROWSE_CATALOG=Catalog
-_UI_ACTION_ADD_GROUP=Add Group
+_UI_ACTION_ADD_GROUP=Add &Group
 _UI_ACTION_ADD_PATTERN=Add pattern
-_UI_ACTION_SET_BASE_TYPE=Set Base Type
+_UI_ACTION_SET_BASE_TYPE=Set &Base Type
 _UI_ERROR_INVALID_NAME=Invalid name
 _UI_ERROR_INVALID_FILE=Invalid file
 _UI_ERROR_INVALID_CATEGORY=Invalid Category
-_UI_ACTION_DELETE=Delete
-_UI_ACTION_ADD=Add
+_UI_ACTION_DELETE=&Delete
+_UI_ACTION_ADD=A&dd
 _UI_ACTION_RENAME=Rename
 _UI_LABEL_PATTERN=Pattern
-_UI_LABEL_PATTERNS=Patterns
-_UI_LABEL_NAME=Name:
-_UI_LABEL_TYPE=Type: 
-_UI_LABEL_BASE=Base
+_UI_LABEL_PATTERNS=&Patterns
+_UI_LABEL_NAME=&Name:
+_UI_LABEL_TYPE=&Type: 
+_UI_LABEL_BASE=&Base:
 _UI_LABEL_UP=Up
 _UI_LABEL_DOWN=Down
-_UI_LABEL_DELETE=Delete
-_UI_LABEL_SCHEMA=Schema:
-_UI_LABEL_EDIT=Edit
+_UI_LABEL_DELETE=&Delete
+_UI_LABEL_SCHEMA=&Schema:
+_UI_LABEL_EDIT=&Edit...
 _UI_LABEL_REFERENCE=Reference:
 _UI_LABEL_READONLY=ReadOnly
 _UI_LABEL_INCLUSIVE=Inclusive
-_UI_LABEL_ENUMERATIONS=Enumerations
+_UI_LABEL_ENUMERATIONS=&Enumerations
 _UI_LABEL_EXTENSIONS=Extensions
-_UI_LABEL_MINIMUM_VALUE=Minimum value:
-_UI_LABEL_MAXIMUM_VALUE=Maximum value:
+_UI_LABEL_MINIMUM_VALUE=&Minimum value:
+_UI_LABEL_MAXIMUM_VALUE=Ma&ximum value:
 _UI_LABEL_CONTRAINTS_ON=Constraints on 
-_UI_LABEL_ADD_WITH_DOTS=Add...
+_UI_LABEL_ADD_WITH_DOTS=&Add...
 _UI_LABEL_ADD_CATEGORY=Add Category
 _UI_LABEL_EDIT_CATEGORY=Edit Category
-_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF=Add Attribute Group Ref
+_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF=Add Attribute &Group Ref
 _UI_ACTION_ADD_EXTENSION_COMPONENT=Add Extension Component
 _UI_ACTION_ADD_EXTENSION_COMPONENTS=Add Extension Components
 _UI_LABEL_CONSTRAINTS_ON_LENGTH_OF=Constraints on length of 
@@ -84,7 +91,7 @@
 _UI_ACTION_CHANGE_MAXIMUM_OCCURRENCE=Maximum Occurrence Change 
 _UI_ACTION_CHANGE_MINIMUM_OCCURRENCE=Minimum Occurrence Change
 _UI_LABEL_SPECIFIC_CONSTRAINT_VALUES=Specific constraint values
-_UI_LABEL_AVAILABLE_COMPONENTS_TO_ADD=Available components to Add:
+_UI_LABEL_AVAILABLE_COMPONENTS_TO_ADD=Available com&ponents to Add:
 _UI_ACTION_CHANGE_CONTENT_MODEL=Change Content Model
 _UI_ERROR_FILE_CANNOT_BE_PARSED=The xsd file of the selected category cannot be parsed.
 _UI_DESCRIPTION_CHOOSE_XSD_FILE=Choose an XSD file containing schema for your extensible components
@@ -100,16 +107,17 @@
 _UI_FIXED=Fixed
 _UI_DEFAULT=Default
 _UI_FORM=Form qualification:
-# The following string will be used for the undo action.  An
-# example label is: Undo Abstract Change
+_UI_LABEL_CATALOG=&XML Catalog...
+_UI_LABEL_WORKSPACE=&Workspace...
 _UI_ACTION_CHANGE={0} Change
+_UI_ACTION_CLOSE_SCHEMA_PREVIEW_POPUP=&Close
 _UI_ACTION_NAMESPACE_INFORMATION_CHANGE=Namespace Information Change
-_UI_LABEL_ABSTRACT=Abstract
-_UI_LABEL_BLOCK=Block
-_UI_LABEL_FINAL=Final
-_UI_LABEL_SUBSTITUTION_GROUP=Substitution Group
-_UI_LABEL_MIXED=Mixed
-_UI_LABEL_VALUE=Value
+_UI_LABEL_ABSTRACT=&Abstract:
+_UI_LABEL_BLOCK=&Block:
+_UI_LABEL_FINAL=&Final:
+_UI_LABEL_SUBSTITUTION_GROUP=&Substitution Group:
+_UI_LABEL_MIXED=&Mixed:
+_UI_LABEL_VALUE=&Value
 _UI_USAGE=Usage
 _UI_LABEL_FORM=Form
-_UI_LABEL_NILLABLE=Nillable
+_UI_LABEL_NILLABLE=&Nillable:
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Checks.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Checks.java
index bb0280b..243aa72 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Checks.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Checks.java
@@ -19,7 +19,7 @@
 	public static RefactoringStatus checkName(String name) {
 		RefactoringStatus result= new RefactoringStatus();
 		if ("".equals(name)) //$NON-NLS-1$
-			return RefactoringStatus.createFatalErrorStatus("RefactoringMessages.Checks_Choose_name");  //$NON-NLS-1$
+			return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getString("Checks_Choose_name"));  //$NON-NLS-1$
 		return result;
 	}
 	
@@ -29,8 +29,8 @@
 	
 	public static RefactoringStatus checkComponentName(String name) {
 		RefactoringStatus result= new RefactoringStatus();
-		if (!NameValidator.isValid(name)) //$NON-NLS-1$
-			return RefactoringStatus.createFatalErrorStatus("RefactoringMessages.Checks_Choose_name");  //$NON-NLS-1$
+		if (!NameValidator.isValid(name))
+			return RefactoringStatus.createFatalErrorStatus(RefactoringMessages.getString("Checks_Choose_name"));  //$NON-NLS-1$
 
 		return result;
 	}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IXSDRefactorConstants.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IXSDRefactorConstants.java
new file mode 100644
index 0000000..79dfec1
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IXSDRefactorConstants.java
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor;
+
+public interface IXSDRefactorConstants {
+	String REFACTOR_CONTEXT_MENU_ID = "org.eclipse.wst.xsd.ui.refactorMenuId"; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/MakeAnonymousTypsGlobalEnablementTester.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/MakeAnonymousTypsGlobalEnablementTester.java
new file mode 100644
index 0000000..a257bb7
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/MakeAnonymousTypsGlobalEnablementTester.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor;
+
+
+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;
+
+
+public class MakeAnonymousTypsGlobalEnablementTester extends RefactorEnablementTester
+{
+
+  protected boolean canEnable(XSDConcreteComponent selectedObject, XSDSchema schema)
+  {
+    if (selectedObject == null)
+    {
+      return false;
+    }
+
+    XSDSchema selectedComponentSchema = null;
+    boolean enable = false;
+    selectedComponentSchema = selectedObject.getSchema();
+
+    if (selectedComponentSchema != null && selectedComponentSchema == schema)
+    {
+      enable = true;
+    }
+
+    if (enable && selectedObject instanceof XSDComplexTypeDefinition)
+    {
+      XSDComplexTypeDefinition typeDef = (XSDComplexTypeDefinition)selectedObject;
+      XSDConcreteComponent parent = typeDef.getContainer();
+      if (parent instanceof XSDElementDeclaration)
+      {
+        return true;
+      }
+    }
+    else if (enable && selectedObject instanceof XSDSimpleTypeDefinition)
+    {
+      XSDSimpleTypeDefinition typeDef = (XSDSimpleTypeDefinition)selectedObject;
+      XSDConcreteComponent parent = typeDef.getContainer();
+      if (parent instanceof XSDElementDeclaration)
+      {
+        return true;
+      }
+      else if (parent instanceof XSDAttributeDeclaration)
+      {
+        return true;
+      }
+    }
+    return false;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/MakeLocalElementGlobalEnablementTester.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/MakeLocalElementGlobalEnablementTester.java
new file mode 100644
index 0000000..e4f4696
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/MakeLocalElementGlobalEnablementTester.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor;
+
+
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDSchema;
+
+
+public class MakeLocalElementGlobalEnablementTester extends RefactorEnablementTester
+{
+  protected boolean canEnable(XSDConcreteComponent selectedObject, XSDSchema schema)
+  {
+    if (selectedObject == null)
+    {
+      return false;
+    }
+    
+    boolean enable = false;
+    XSDSchema selectedComponentSchema = null;
+    selectedComponentSchema = selectedObject.getSchema();
+    if (selectedComponentSchema != null && selectedComponentSchema == schema)
+    {
+      enable = true;
+    }
+
+    if (enable && selectedObject instanceof XSDElementDeclaration)
+    {
+      XSDElementDeclaration element = (XSDElementDeclaration)selectedObject;
+      if (!element.isElementDeclarationReference() && !element.isGlobal())
+      {
+        return true;
+      }
+    }
+
+    return false;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactorEnablementTester.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactorEnablementTester.java
new file mode 100644
index 0000000..b912ca0
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactorEnablementTester.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor;
+
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.w3c.dom.Node;
+
+
+public abstract class RefactorEnablementTester extends PropertyTester
+{
+
+  public boolean test(Object receiver, String property, Object[] args, Object expectedValue)
+  {
+    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+    if (window == null)
+    {
+      return false;
+    }
+
+    IWorkbenchPage activePage = window.getActivePage();
+    if (activePage == null)
+    {
+      return false;
+    }
+
+    IEditorPart editor = activePage.getActiveEditor();
+    if (editor == null)
+    {
+      return false;
+    }
+
+    XSDSchema schema = (XSDSchema)editor.getAdapter(XSDSchema.class);
+
+    if (receiver instanceof IStructuredSelection)
+    {
+      IStructuredSelection fStructuredSelection = (IStructuredSelection)receiver;
+      receiver = fStructuredSelection.getFirstElement();
+
+      if (receiver instanceof XSDBaseAdapter)
+      {
+        receiver = ((XSDBaseAdapter)receiver).getTarget();
+      }
+
+      if (receiver instanceof XSDConcreteComponent)
+      {
+        return canEnable((XSDConcreteComponent)receiver, schema);
+      }
+      else if (receiver instanceof Node)
+      {
+        Node node = (Node)receiver;
+        if (schema != null)
+        {
+          XSDConcreteComponent concreteComponent = schema.getCorrespondingComponent(node);
+          return canEnable(concreteComponent, schema);
+        }
+      }
+
+      return true;
+    }
+    return false;
+  }
+
+  protected abstract boolean canEnable(XSDConcreteComponent selectedObject, XSDSchema schema);
+
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RenameEnablementTester.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RenameEnablementTester.java
new file mode 100644
index 0000000..33308e4
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RenameEnablementTester.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor;
+
+
+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;
+
+
+public class RenameEnablementTester extends RefactorEnablementTester
+{
+  protected boolean canEnable(XSDConcreteComponent selectedObject, XSDSchema schema)
+  {
+    if (selectedObject == null)
+    {
+      return false;
+    }
+
+    XSDNamedComponent selectedComponent = null;
+    boolean enable = false;
+
+    XSDSchema selectedComponentSchema = null;
+    selectedComponentSchema = selectedObject.getSchema();
+    if (selectedComponentSchema != null && selectedComponentSchema == schema)
+    {
+      enable = true;
+    }
+
+    if (enable && selectedObject instanceof XSDNamedComponent)
+    {
+      selectedComponent = (XSDNamedComponent)selectedObject;
+
+      if (selectedComponent instanceof XSDElementDeclaration)
+      {
+        XSDElementDeclaration element = (XSDElementDeclaration)selectedComponent;
+        if (element.isElementDeclarationReference())
+        {
+          return false;
+        }
+      }
+      if (selectedComponent instanceof XSDTypeDefinition)
+      {
+        XSDTypeDefinition type = (XSDTypeDefinition)selectedComponent;
+        XSDConcreteComponent parent = type.getContainer();
+        if (parent instanceof XSDElementDeclaration)
+        {
+          XSDElementDeclaration element = (XSDElementDeclaration)parent;
+          if (element.getAnonymousTypeDefinition().equals(type))
+          {
+            return false;
+          }
+        }
+        else if (parent instanceof XSDAttributeDeclaration)
+        {
+          XSDAttributeDeclaration element = (XSDAttributeDeclaration)parent;
+          if (element.getAnonymousTypeDefinition().equals(type))
+          {
+            return false;
+          }
+        }
+      }
+      return true;
+    }
+    return false;
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java
index cb3f3bf..8914764 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -17,6 +17,7 @@
 import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
 import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.refactor.handlers.MakeAnonymousTypeGobalHandler;
 import org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeAnonymousTypeGlobalCommand;
 import org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeTypeGlobalProcessor;
 import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
@@ -30,6 +31,9 @@
 import org.eclipse.xsd.XSDTypeDefinition;
 import org.w3c.dom.Node;
 
+/**
+ * @deprecated Use {@link MakeAnonymousTypeGobalHandler}
+ */
 public class MakeAnonymousTypeGlobalAction extends XSDSelectionDispatchAction {
 
 	private String fParentName;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java
index 847b127..49d877c 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java
@@ -14,12 +14,16 @@
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
 import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringMessages;
+import org.eclipse.wst.xsd.ui.internal.refactor.handlers.MakeLocalElementGlobalHandler;
 import org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeLocalElementGlobalCommand;
 import org.eclipse.xsd.XSDConcreteComponent;
 import org.eclipse.xsd.XSDElementDeclaration;
 import org.eclipse.xsd.XSDSchema;
 import org.w3c.dom.Node;
 
+/**
+ * @deprecated Use {@link MakeLocalElementGlobalHandler}
+ */
 public class MakeLocalElementGlobalAction extends XSDSelectionDispatchAction {
 
 	XSDElementDeclaration fSelectedComponent;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java
index 8fca361..e0447ef 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java
@@ -23,6 +23,7 @@
 import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
 import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringComponent;
 import org.eclipse.wst.xsd.ui.internal.refactor.XMLRefactoringComponent;
+import org.eclipse.wst.xsd.ui.internal.refactor.handlers.RenameHandler;
 import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameComponentProcessor;
 import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
 import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard;
@@ -33,6 +34,9 @@
 import org.eclipse.xsd.XSDTypeDefinition;
 import org.w3c.dom.Node;
 
+/**
+ * @deprecated Use {@link RenameHandler} 
+ */
 public class RenameComponentAction extends XSDSelectionDispatchAction {
 
 	private XSDNamedComponent selectedComponent;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/MakeAnonymousTypeGobalHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/MakeAnonymousTypeGobalHandler.java
new file mode 100644
index 0000000..efd8087
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/MakeAnonymousTypeGobalHandler.java
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.handlers;
+
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
+import org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeAnonymousTypeGlobalCommand;
+import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
+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 MakeAnonymousTypeGobalHandler extends RefactoringHandler
+{
+  private String parentName;
+  private boolean isComplexType = true;
+
+  public Object doExecute(ISelection selection, XSDSchema schema)
+  {
+    if (selection != null)
+    {
+      Object selectedObject = ((StructuredSelection)selection).getFirstElement();
+      
+      if (selectedObject instanceof XSDBaseAdapter)
+      {
+        selectedObject = ((XSDBaseAdapter)selectedObject).getTarget();
+      }
+      
+      XSDConcreteComponent concreteComp = null;
+
+      if (selectedObject instanceof Node)
+      {
+        Node node = (Node)selectedObject;
+        concreteComp = schema.getCorrespondingComponent(node);
+      }
+      else if (selectedObject instanceof XSDConcreteComponent)
+      {
+        concreteComp = ((XSDConcreteComponent)selectedObject);
+      }
+
+      if (concreteComp != null)
+      {
+        if (concreteComp instanceof XSDComplexTypeDefinition)
+        {
+
+          isComplexType = true;
+          XSDComplexTypeDefinition typeDef = (XSDComplexTypeDefinition)concreteComp;
+          XSDConcreteComponent parent = typeDef.getContainer();
+          if (parent instanceof XSDElementDeclaration)
+          {
+            parentName = ((XSDElementDeclaration)parent).getName();
+            run(selection, schema, typeDef);
+          }
+          else if (concreteComp instanceof XSDSimpleTypeDefinition)
+          {
+            isComplexType = false;
+            XSDSimpleTypeDefinition simpleTypeDef = (XSDSimpleTypeDefinition)concreteComp;
+            XSDConcreteComponent parentComp = simpleTypeDef.getContainer();
+            if (parentComp instanceof XSDElementDeclaration)
+            {
+              parentName = ((XSDElementDeclaration)parent).getName();
+
+            }
+            else if (parent instanceof XSDAttributeDeclaration)
+            {
+              parentName = ((XSDAttributeDeclaration)parent).getName();
+
+            }
+            run(selection, schema, simpleTypeDef);
+          }
+        }
+      }
+    }
+
+    return null;
+  }
+
+  private String getNewDefaultName()
+  {
+    if (parentName != null && !"".equals(parentName)) { //$NON-NLS-1$
+      if (isComplexType)
+      {
+        return parentName + "ComplexType"; //$NON-NLS-1$
+      }
+      else
+      {
+        return parentName + "SimpleType"; //$NON-NLS-1$
+      }
+    }
+    else
+    {
+      if (isComplexType)
+      {
+        return "NewComplexType"; //$NON-NLS-1$
+      }
+      else
+      {
+        return "NewSimpleType"; //$NON-NLS-1$
+      }
+    }
+
+  }
+
+  public void run(ISelection selection, XSDSchema schema, XSDTypeDefinition selectedComponent)
+  {
+    if (selectedComponent == null)
+    {
+      return;
+    }
+
+    if (selectedComponent.getSchema() == null)
+    {
+      schema.updateElement(true);
+    }
+    DocumentImpl doc = (DocumentImpl)selectedComponent.getElement().getOwnerDocument();
+    doc.getModel().beginRecording(this, RefactoringWizardMessages.MakeAnonymousTypeGlobalAction_text);
+    MakeAnonymousTypeGlobalCommand command = new MakeAnonymousTypeGlobalCommand(selectedComponent, getNewDefaultName());
+    command.run();
+    doc.getModel().endRecording(this);
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/MakeLocalElementGlobalHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/MakeLocalElementGlobalHandler.java
new file mode 100644
index 0000000..8578d88
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/MakeLocalElementGlobalHandler.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.handlers;
+
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
+import org.eclipse.wst.xsd.ui.internal.refactor.structure.MakeLocalElementGlobalCommand;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDSchema;
+import org.w3c.dom.Node;
+
+
+public class MakeLocalElementGlobalHandler extends RefactoringHandler
+{
+
+  public Object doExecute(ISelection selection, XSDSchema schema)
+  {
+    if (selection != null)
+    {
+      Object selectedObject = ((StructuredSelection)selection).getFirstElement();
+      if (selectedObject instanceof XSDBaseAdapter)
+      {
+        selectedObject = ((XSDBaseAdapter)selectedObject).getTarget();
+      }
+      if (selectedObject instanceof XSDElementDeclaration)
+      {
+        run(selection, (XSDElementDeclaration)selectedObject);
+      }
+      else if (selectedObject instanceof Node)
+      {
+        Node node = (Node)selectedObject;
+        XSDConcreteComponent concreteComponent = schema.getCorrespondingComponent(node);
+        if (concreteComponent instanceof XSDElementDeclaration)
+          run(selection, (XSDElementDeclaration)concreteComponent);
+      }
+
+    }
+    return null;
+  }
+
+  public void run(ISelection selection, XSDElementDeclaration selectedComponent)
+  {
+    DocumentImpl doc = (DocumentImpl)selectedComponent.getElement().getOwnerDocument();
+    doc.getModel().beginRecording(this, "MakeLocalElementGlobalHandler.text");
+    MakeLocalElementGlobalCommand command = new MakeLocalElementGlobalCommand(selectedComponent);
+    command.run();
+    doc.getModel().endRecording(this);
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/RefactoringHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/RefactoringHandler.java
new file mode 100644
index 0000000..bbe02fc
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/RefactoringHandler.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.wst.xsd.ui.internal.refactor.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.xsd.XSDSchema;
+
+public abstract class RefactoringHandler extends AbstractHandler
+{
+  public Object execute(ExecutionEvent event) throws ExecutionException {
+    
+    IWorkbenchWindow workbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);
+    if (workbenchWindow == null) return null;
+
+    IWorkbenchPage activePage = workbenchWindow.getActivePage();
+    if (activePage == null) return null;
+
+    IEditorPart editor = activePage.getActiveEditor();
+    if (editor == null) return null;
+    XSDSchema schema = (XSDSchema)editor.getAdapter(XSDSchema.class);
+     
+    ISelection selection = activePage.getSelection();
+    
+    return doExecute(selection, schema);
+  }
+
+  protected abstract Object doExecute(ISelection selection, XSDSchema schema);
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/RenameHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/RenameHandler.java
new file mode 100644
index 0000000..c06bd43
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/handlers/RenameHandler.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xsd.ui.internal.refactor.handlers;
+
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+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.common.ui.internal.dialogs.SaveDirtyFilesDialog;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
+import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
+import org.eclipse.wst.xsd.ui.internal.refactor.RefactoringComponent;
+import org.eclipse.wst.xsd.ui.internal.refactor.XMLRefactoringComponent;
+import org.eclipse.wst.xsd.ui.internal.refactor.rename.RenameComponentProcessor;
+import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactoringWizardMessages;
+import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RenameRefactoringWizard;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDSchema;
+import org.w3c.dom.Node;
+
+
+public class RenameHandler extends RefactoringHandler
+{
+
+  protected Object doExecute(ISelection selection, XSDSchema schema)
+  {
+    return execute(selection, schema);
+  }
+
+  public Object execute(ISelection selection, XSDSchema schema)
+  {
+    if (selection != null)
+    {
+
+      Object selectedObject = ((StructuredSelection)selection).getFirstElement();
+      if (selectedObject instanceof XSDBaseAdapter)
+      {
+        selectedObject = ((XSDBaseAdapter)selectedObject).getTarget();
+      }
+
+      if (selectedObject instanceof XSDNamedComponent)
+      {
+        run(selection, schema, (XSDNamedComponent)selectedObject);
+      }
+      else if (selectedObject instanceof Node)
+      {
+        Node node = (Node)selectedObject;
+        if (schema != null)
+        {
+          XSDConcreteComponent concreteComponent = schema.getCorrespondingComponent(node);
+          if (concreteComponent instanceof XSDNamedComponent)
+          {
+            run(selection, schema, (XSDNamedComponent)concreteComponent);
+          }
+        }
+      }
+    }
+    return null;
+
+  }
+
+  public void run(ISelection selection, XSDSchema schema, XSDNamedComponent selectedComponent)
+  {
+    if (selectedComponent.getName() == null)
+    {
+      selectedComponent.setName(new String());
+    }
+    if (selectedComponent.getSchema() == null)
+    {
+      if (schema != null)
+      {
+        schema.updateElement(true);
+      }
+
+    }
+
+    boolean rc = SaveDirtyFilesDialog.saveDirtyFiles();
+    if (!rc)
+    {
+      return;
+    }
+    RefactoringComponent component = new XMLRefactoringComponent(
+      selectedComponent,
+      (IDOMElement)selectedComponent.getElement(),
+      selectedComponent.getName(),
+      selectedComponent.getTargetNamespace());
+
+    RenameComponentProcessor processor = new RenameComponentProcessor(component, selectedComponent.getName());
+    RenameRefactoring refactoring = new RenameRefactoring(processor);
+    try
+    {
+      RefactoringWizard wizard = new RenameRefactoringWizard(
+        refactoring,
+        RefactoringWizardMessages.RenameComponentWizard_defaultPageTitle,
+        RefactoringWizardMessages.RenameComponentWizard_inputPage_description,
+        null);
+      RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
+      op.run(XSDEditorPlugin.getShell(), wizard.getDefaultPageTitle());
+
+    }
+    catch (InterruptedException e)
+    {
+      // do nothing. User action got canceled
+    }
+  }
+}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties
index e864739..9c8b012 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2006 IBM Corporation and others.
+# Copyright (c) 2001, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -40,7 +40,7 @@
 RenameResourceRefactoring.alread_exists=Resource already exist
 RenameResourceRefactoring.invalidName=Invalid resource name
 RenameResourceProcessor.name=Resource renaming
-MakeLocalElementGlobalAction.text=Make Local Element Global
+MakeLocalElementGlobalAction.text=Make &Local Element Global
 XSDComponentRenameParticipant.Component_Refactoring_updates=XML Schema refactoring changes
 WSDLComponentRenameParticipant.Component_Refactoring_updates=WSDL refactoring changes
 RenameComponentProcessor.Component_Refactoring_updates=Component name refactoring changes
@@ -49,3 +49,7 @@
 XSDComponentRenameParticipant.xsd_component_rename_participant=XSD component rename participant
 WSDLComponentRenameParticipant.wsdl_component_rename_participant=WSDL component rename participant
 ResourceRenameParticipant.File_Rename_update_reference=File rename refactoring changes
+RenameComponentRefactoring_checking=Checking...
+RenameComponentRefactoring_searching=Searching...
+Checks_Choose_name=Invalid name
+RenameComponentRefactoring_another_name=Name already used
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java
index 9d8336a..b49d4fb 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,7 +14,6 @@
 //import com.ibm.icu.text.Collator;
 import java.util.ArrayList;
 import java.util.Arrays;
-//import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -30,11 +29,11 @@
 import org.eclipse.core.runtime.OperationCanceledException;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.text.Position;
 import org.eclipse.ltk.core.refactoring.Change;
 import org.eclipse.ltk.core.refactoring.CompositeChange;
 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
 import org.eclipse.ltk.core.refactoring.TextChange;
-//import org.eclipse.ltk.core.refactoring.TextFileChange;
 import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
 import org.eclipse.ltk.core.refactoring.participants.ParticipantManager;
 import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
@@ -51,6 +50,7 @@
 import org.eclipse.wst.common.core.search.scope.SelectionSearchScope;
 import org.eclipse.wst.common.core.search.scope.WorkspaceSearchScope;
 import org.eclipse.wst.common.core.search.util.CollectingSearchRequestor;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
 import org.eclipse.wst.xml.core.internal.search.XMLComponentDeclarationPattern;
 import org.eclipse.wst.xml.core.internal.search.XMLComponentReferencePattern;
 import org.eclipse.wst.xsd.ui.internal.refactor.Checks;
@@ -134,16 +134,34 @@
         }  
 		searchEngine.search(pattern, requestor, scope, map, new NullProgressMonitor());
 		List results = requestor.getResults();
+		
+		// more than one declaration found, so use offset as additional check
+		Position offsetPosition = null;
+		if (results.size() > 1) {
+		    IDOMElement selectedElement = selectedComponent.getElement();
+		    if (selectedElement != null) {
+		    	int startOffset = selectedElement.getStartOffset();
+		    	offsetPosition = new Position(startOffset, (selectedElement.getEndOffset() - startOffset));
+		    }
+		}
+		
 		for (Iterator iter = results.iterator(); iter.hasNext();) {
 			SearchMatch match = (SearchMatch) iter.next();
 			if (match != null) {
-				TextChange textChange = manager.get(match.getFile());
-				String newName = getNewElementName();
-				newName = quoteString(newName);
-
-				ReplaceEdit replaceEdit = new ReplaceEdit(match.getOffset(), match.getLength(), newName);
-				String editName = RefactoringMessages.getString("RenameComponentProcessor.Component_Refactoring_update_declatation");
-				TextChangeCompatibility.addTextEdit(textChange, editName, replaceEdit);
+				boolean addTextChange = true;
+				// additional check to verify correct declaration is changed
+				if (offsetPosition != null) {
+					addTextChange = offsetPosition.overlapsWith(match.getOffset(), match.getLength());  
+				}
+				if (addTextChange) {
+					TextChange textChange = manager.get(match.getFile());
+					String newName = getNewElementName();
+					newName = quoteString(newName);
+	
+					ReplaceEdit replaceEdit = new ReplaceEdit(match.getOffset(), match.getLength(), newName);
+					String editName = RefactoringMessages.getString("RenameComponentProcessor.Component_Refactoring_update_declatation");
+					TextChangeCompatibility.addTextEdit(textChange, editName, replaceEdit);
+				}
 			}
 		}
 	}
@@ -227,10 +245,10 @@
 		final RefactoringStatus status = new RefactoringStatus();
 		try {
 			monitor.beginTask("", 2); //$NON-NLS-1$
-			monitor.setTaskName("RefactoringMessages.RenameComponentRefactoring_checking");
+			monitor.setTaskName(RefactoringMessages.getString("RenameComponentRefactoring_checking")); //$NON-NLS-1$
 			status.merge(checkNewElementName(getNewElementName()));
 			monitor.worked(1);
-			monitor.setTaskName("RefactoringMessages.RenameComponentRefactoring_searching");
+			monitor.setTaskName(RefactoringMessages.getString("RenameComponentRefactoring_searching")); //$NON-NLS-1$
 			status.merge(createRenameChanges(new SubProgressMonitor(monitor, 1)));
 		}
 		finally {
@@ -262,7 +280,7 @@
 		final RefactoringStatus result = Checks.checkName(name);
 		result.merge(Checks.checkComponentName(name));
 		if (Checks.isAlreadyNamed(selectedComponent, name))
-			result.addFatalError("RefactoringMessages.RenameComponentRefactoring_another_name");
+			result.addFatalError(RefactoringMessages.getString("RenameComponentRefactoring_another_name")); //$NON-NLS-1$
 		return result;
 	}
 
@@ -304,7 +322,7 @@
 		Assert.isNotNull(monitor);
 		final RefactoringStatus status = new RefactoringStatus();
 		try {
-			monitor.beginTask("RefactoringMessages.RenameComponentRefactoring_searching", 1);
+			monitor.beginTask(RefactoringMessages.getString("RenameComponentRefactoring_searching"), 1); //$NON-NLS-1$
 			updateChangeManager(new SubProgressMonitor(monitor, 1), status);
 		}
 		finally {
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java
index c796b8b..e213e2a 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java
@@ -61,8 +61,6 @@
 	 */
 	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);
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeLocalElementGlobalCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeLocalElementGlobalCommand.java
index 6352ad1..d7eb8a7 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeLocalElementGlobalCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeLocalElementGlobalCommand.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,89 +10,72 @@
  *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.refactor.structure;
 
-import org.eclipse.xsd.XSDComplexTypeContent;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
 import org.eclipse.xsd.XSDConcreteComponent;
 import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDFactory;
 import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.XSDSchema;
+
 
 public final class MakeLocalElementGlobalCommand extends AbstractCommand
 {
-	
-  public MakeLocalElementGlobalCommand
-    (XSDConcreteComponent element)
+  public MakeLocalElementGlobalCommand(XSDConcreteComponent element)
   {
     super(element.getContainer());
     setModelObject(element);
   }
-  
+
   public void run()
   {
-    
-   if(getModelObject() instanceof XSDElementDeclaration){
-   
-	   XSDElementDeclaration element = (XSDElementDeclaration)getModelObject();
- 	XSDConcreteComponent parent = getParent();
- 	XSDConcreteComponent container = parent.getContainer();
- 	
- 	// clone element with it's content and set it global
-	XSDConcreteComponent  elementDecl = ((XSDElementDeclaration)getModelObject()).cloneConcreteComponent(true, true);
- 	container.getSchema().getContents().add(elementDecl);
- 	
- 	// create local element and set it's reference to the global one
- 	XSDElementDeclaration elementRef = 
-	      XSDFactory.eINSTANCE.createXSDElementDeclaration();
-	elementRef.setValue(element.getValue());
-    elementRef.setResolvedElementDeclaration((XSDElementDeclaration)elementDecl); 
-    
-    // now set content models
- 	if(parent instanceof XSDComplexTypeContent){
- 		if(container instanceof XSDModelGroup){
- 			XSDModelGroup modelGroup = (XSDModelGroup)container;
- 			// disconnect parent from its container
- 			int index = modelGroup.getContents().indexOf(parent);
- 			 XSDParticle particle = 
- 			      XSDFactory.eINSTANCE.createXSDParticle();
- 		    particle.setContent(elementRef);
- 		    modelGroup.getContents().add(index, particle); 
-            // Copy over the max/minOccurs from the old local to the element ref
-            if (parent instanceof XSDParticle) {
-              XSDParticle parentParticle = (XSDParticle)parent;
-              
-              if (parentParticle.isSetMinOccurs()) {
-                particle.setMinOccurs(parentParticle.getMinOccurs());
-                parentParticle.unsetMinOccurs();
-              }
-              
-              if (parentParticle.isSetMaxOccurs()) {
-                particle.setMaxOccurs(parentParticle.getMaxOccurs());
-                parentParticle.unsetMaxOccurs();
-              }
-            }          
-            element.unsetForm();
- 		   
- 			modelGroup.getContents().remove(parent);
- 		    modelGroup.updateElement(true);
-  		    formatChild(modelGroup.getElement());
- 		}
- 	}
- 	else if(parent instanceof XSDTypeDefinition){
-		 		
- 	}
- 	
- 	container.getSchema().updateElement(true);
-    formatChild(elementDecl.getElement());
-  
-   }
+    if (getModelObject() instanceof XSDElementDeclaration)
+    {
 
+      XSDElementDeclaration localElementDeclaration = (XSDElementDeclaration)getModelObject();
+      XSDConcreteComponent parent = getParent();
+      XSDConcreteComponent container = parent.getContainer();
+
+      // Clone the local element with its content and set it global
+
+      XSDElementDeclaration globalElementDeclaration = (XSDElementDeclaration)localElementDeclaration.cloneConcreteComponent(true, false);
+
+      // The schema may already have a global element declaration with this name. In that case, ensure the name of the newly created
+      // element does not collide with an existing one.
+
+      XSDSchema schema = container.getSchema();
+      String localElementName = localElementDeclaration.getName();
+      XSDElementDeclaration existingGlobalElement = schema.resolveElementDeclaration(localElementName);
+      boolean elementExists = existingGlobalElement != null && existingGlobalElement.getSchema() != null;
+      if (elementExists)
+      {
+        String newElementName = XSDCommonUIUtils.createUniqueElementName(localElementName, schema.getElementDeclarations());
+        globalElementDeclaration.setName(newElementName);
+      }
+
+      EList schemaContents = schema.getContents();
+      schemaContents.add(globalElementDeclaration);
+
+      // Modify the local element to become a reference to the global element.
+
+      localElementDeclaration.setName(null);
+      localElementDeclaration.setTypeDefinition(null);
+      localElementDeclaration.setAnonymousTypeDefinition(null);
+      localElementDeclaration.setResolvedElementDeclaration(globalElementDeclaration);
+      XSDModelGroup modelGroup = (XSDModelGroup)container;
+
+      // Format the markup. 
+
+      formatChild(modelGroup.getElement());
+      formatChild(globalElementDeclaration.getElement());
+    }
   }
-	/* (non-Javadoc)
-	 * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#adopt(org.eclipse.xsd.XSDConcreteComponent)
-	 */
-	protected boolean adopt(XSDConcreteComponent model) {
-		// TODO Auto-generated method stub
-		return true;
-	}
-}
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.xsd.ui.internal.commands.AbstractCommand#adopt(org.eclipse.xsd.XSDConcreteComponent)
+   */
+  protected boolean adopt(XSDConcreteComponent model)
+  {
+    return true;
+  }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/messages.properties b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/messages.properties
index 246f29f..f10fccc 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/messages.properties
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/messages.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2006 IBM Corporation and others.
+# Copyright (c) 2001, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -41,8 +41,8 @@
 RenameResourceRefactoring_alread_exists=Resource already exist
 RenameResourceRefactoring_invalidName=Invalid resource name
 RenameResourceProcessor_name=Resource renaming
-MakeAnonymousTypeGlobalAction_text=Make Anonymous Type Global 
-MakeLocalElementGlobalAction_text=Make Local Element Global
+MakeAnonymousTypeGlobalAction_text=Make &Anonymous Type Global 
+MakeLocalElementGlobalAction_text=Make &Local Element Global
 XSDComponentRenameParticipant_Component_Refactoring_updates=XML Schema refactoring changes
 WSDLComponentRenameParticipant_Component_Refactoring_updates=WSDL Schema refactoring changes
 RenameComponentProcessor_Component_Refactoring_updates=Component name refactoring changes
diff --git a/development/org.eclipse.wst.sse.unittests/.classpath b/bundles/org.eclipse.wtp.javascript.capabilities/.classpath
similarity index 68%
rename from development/org.eclipse.wst.sse.unittests/.classpath
rename to bundles/org.eclipse.wtp.javascript.capabilities/.classpath
index bfb3353..fd545ef 100644
--- a/development/org.eclipse.wst.sse.unittests/.classpath
+++ b/bundles/org.eclipse.wtp.javascript.capabilities/.classpath
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
-	<classpathentry path="org.eclipse.pde.core.requiredPlugins" kind="con"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/development/org.eclipse.wst.sse.unittests/.project b/bundles/org.eclipse.wtp.javascript.capabilities/.project
similarity index 68%
copy from development/org.eclipse.wst.sse.unittests/.project
copy to bundles/org.eclipse.wtp.javascript.capabilities/.project
index e6f5109..970984c 100644
--- a/development/org.eclipse.wst.sse.unittests/.project
+++ b/bundles/org.eclipse.wtp.javascript.capabilities/.project
@@ -1,16 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-	<name>org.eclipse.wst.sse.unittests</name>
+	<name>org.eclipse.wtp.javascript.capabilities</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>
@@ -23,6 +18,5 @@
 	</buildSpec>
 	<natures>
 		<nature>org.eclipse.pde.PluginNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
 	</natures>
 </projectDescription>
diff --git a/bundles/org.eclipse.wtp.javascript.capabilities/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wtp.javascript.capabilities/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..9504e18
--- /dev/null
+++ b/bundles/org.eclipse.wtp.javascript.capabilities/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Tue May 19 03:12:16 EDT 2009
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.compliance=1.4
diff --git a/bundles/org.eclipse.wtp.javascript.capabilities/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.wtp.javascript.capabilities/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 0000000..cb17609
--- /dev/null
+++ b/bundles/org.eclipse.wtp.javascript.capabilities/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,4 @@
+#Tue May 19 03:12:17 EDT 2009
+eclipse.preferences.version=1
+resolve.requirebundle=false
+pluginProject.extensions=false
diff --git a/bundles/org.eclipse.wtp.javascript.capabilities/META-INF/MANIFEST.MF b/bundles/org.eclipse.wtp.javascript.capabilities/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..a0b2924
--- /dev/null
+++ b/bundles/org.eclipse.wtp.javascript.capabilities/META-INF/MANIFEST.MF
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.wtp.javascript.capabilities;singleton:=true
+Bundle-Version: 1.0.100.qualifier
+Bundle-Vendor: %Bundle-Vendor.0
+Require-Bundle: org.eclipse.ui.workbench,
+ org.eclipse.help.ui
diff --git a/bundles/org.eclipse.wtp.javascript.capabilities/META-INF/eclipse.inf b/bundles/org.eclipse.wtp.javascript.capabilities/META-INF/eclipse.inf
new file mode 100644
index 0000000..778e2f3
--- /dev/null
+++ b/bundles/org.eclipse.wtp.javascript.capabilities/META-INF/eclipse.inf
@@ -0,0 +1,2 @@
+# We do not want capability jars pack200'd (they are tiny, no java, and fetched easier as jars)
+jarprocessor.exclude.pack=true
\ No newline at end of file
diff --git a/bundles/org.eclipse.wtp.javascript.capabilities/OSGI-INF/l10n/bundle.properties b/bundles/org.eclipse.wtp.javascript.capabilities/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 0000000..1186a6a
--- /dev/null
+++ b/bundles/org.eclipse.wtp.javascript.capabilities/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,5 @@
+#Properties file for org.eclipse.wtp.javascript.capabilities
+Bundle-Name.0 = JavaScript Capabilities
+Bundle-Vendor.0 = Eclipse Web Tools Platform
+activity.javascript             = JavaScript Development
+activity.javascript.desc        = Develop JavaScript applications. 
diff --git a/bundles/org.eclipse.wtp.javascript.capabilities/about.html b/bundles/org.eclipse.wtp.javascript.capabilities/about.html
new file mode 100644
index 0000000..31cec0d
--- /dev/null
+++ b/bundles/org.eclipse.wtp.javascript.capabilities/about.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<HTML>
+
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+
+<BODY lang="EN-US">
+
+<H3>About This Content</H3>
+
+<P>June, 2009</P>
+
+<H3>License</H3>
+
+<P>The Eclipse Foundation makes available all content in this plug-in 
+("Content"). Unless otherwise indicated below, the Content is provided to you 
+under the terms and conditions of the Eclipse Public License Version 1.0 
+("EPL"). A copy of the EPL is available at
+<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>. 
+For purposes of the EPL, "Program" 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 ("Redistributor") and different 
+terms and conditions may apply to your use of any object code in the Content. 
+Check the RedistributorÂ’s license that was provided with the Content. If no such 
+license exists, contact the Redistributor. Unless otherwise indicated below, the 
+terms and conditions of the EPL still apply to any source code in the Content 
+and such source code may be obtained at
+<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
+
+</BODY>
+</HTML>
diff --git a/bundles/org.eclipse.wtp.javascript.capabilities/build.properties b/bundles/org.eclipse.wtp.javascript.capabilities/build.properties
new file mode 100644
index 0000000..41197a4
--- /dev/null
+++ b/bundles/org.eclipse.wtp.javascript.capabilities/build.properties
@@ -0,0 +1,6 @@
+bin.includes = META-INF/,\
+               .,\
+               OSGI-INF/,\
+               plugin.xml,\
+               OSGI-INF/l10n/,\
+               about.html
diff --git a/bundles/org.eclipse.wtp.javascript.capabilities/plugin.xml b/bundles/org.eclipse.wtp.javascript.capabilities/plugin.xml
new file mode 100644
index 0000000..659ce32
--- /dev/null
+++ b/bundles/org.eclipse.wtp.javascript.capabilities/plugin.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+    <extension
+        point="org.eclipse.ui.activities">
+        <activity
+            name="%activity.javascript"
+            description="%activity.javascript.desc"
+            id="org.eclipse.wtp.javascript.capabilities">
+        </activity>
+        <activityPatternBinding
+            activityId="org.eclipse.wtp.javascript.capabilities"
+            pattern="org\.eclipse\.wst\.jsdt\.[\.\w/]*">
+        </activityPatternBinding>
+
+    </extension>
+</plugin>
\ No newline at end of file
diff --git a/development/org.eclipse.wst.sse.unittests/.project b/bundles/org.eclipse.wtp.web.capabilities/.project
similarity index 68%
copy from development/org.eclipse.wst.sse.unittests/.project
copy to bundles/org.eclipse.wtp.web.capabilities/.project
index e6f5109..d08ea9c 100644
--- a/development/org.eclipse.wst.sse.unittests/.project
+++ b/bundles/org.eclipse.wtp.web.capabilities/.project
@@ -1,16 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-	<name>org.eclipse.wst.sse.unittests</name>
+	<name>org.eclipse.wtp.web.capabilities</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>
@@ -23,6 +18,5 @@
 	</buildSpec>
 	<natures>
 		<nature>org.eclipse.pde.PluginNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
 	</natures>
 </projectDescription>
diff --git a/bundles/org.eclipse.wtp.web.capabilities/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.wtp.web.capabilities/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 0000000..d4f00a1
--- /dev/null
+++ b/bundles/org.eclipse.wtp.web.capabilities/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,4 @@
+#Tue May 19 10:29:20 EDT 2009
+eclipse.preferences.version=1
+resolve.requirebundle=false
+pluginProject.extensions=false
diff --git a/bundles/org.eclipse.wtp.web.capabilities/META-INF/MANIFEST.MF b/bundles/org.eclipse.wtp.web.capabilities/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..5efdcd19
--- /dev/null
+++ b/bundles/org.eclipse.wtp.web.capabilities/META-INF/MANIFEST.MF
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.wtp.web.capabilities;singleton:=true
+Bundle-Version: 1.0.100.qualifier
+Bundle-Vendor: %Bundle-Vendor.0
+Require-Bundle: org.eclipse.ui.workbench,
+ org.eclipse.help.ui
diff --git a/bundles/org.eclipse.wtp.web.capabilities/META-INF/eclipse.inf b/bundles/org.eclipse.wtp.web.capabilities/META-INF/eclipse.inf
new file mode 100644
index 0000000..778e2f3
--- /dev/null
+++ b/bundles/org.eclipse.wtp.web.capabilities/META-INF/eclipse.inf
@@ -0,0 +1,2 @@
+# We do not want capability jars pack200'd (they are tiny, no java, and fetched easier as jars)
+jarprocessor.exclude.pack=true
\ No newline at end of file
diff --git a/bundles/org.eclipse.wtp.web.capabilities/OSGI-INF/l10n/bundle.properties b/bundles/org.eclipse.wtp.web.capabilities/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 0000000..615c554
--- /dev/null
+++ b/bundles/org.eclipse.wtp.web.capabilities/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,5 @@
+#Properties file for org.eclipse.wtp.web.capabilities
+Bundle-Name.0 = Web Capabilities
+Bundle-Vendor.0 = Eclipse Web Tools Platform
+activity.web             = Web Development
+activity.web.desc        = Develop Web applications.
diff --git a/bundles/org.eclipse.wtp.web.capabilities/about.html b/bundles/org.eclipse.wtp.web.capabilities/about.html
new file mode 100644
index 0000000..31cec0d
--- /dev/null
+++ b/bundles/org.eclipse.wtp.web.capabilities/about.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<HTML>
+
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+
+<BODY lang="EN-US">
+
+<H3>About This Content</H3>
+
+<P>June, 2009</P>
+
+<H3>License</H3>
+
+<P>The Eclipse Foundation makes available all content in this plug-in 
+("Content"). Unless otherwise indicated below, the Content is provided to you 
+under the terms and conditions of the Eclipse Public License Version 1.0 
+("EPL"). A copy of the EPL is available at
+<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>. 
+For purposes of the EPL, "Program" 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 ("Redistributor") and different 
+terms and conditions may apply to your use of any object code in the Content. 
+Check the RedistributorÂ’s license that was provided with the Content. If no such 
+license exists, contact the Redistributor. Unless otherwise indicated below, the 
+terms and conditions of the EPL still apply to any source code in the Content 
+and such source code may be obtained at
+<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
+
+</BODY>
+</HTML>
diff --git a/bundles/org.eclipse.wtp.web.capabilities/build.properties b/bundles/org.eclipse.wtp.web.capabilities/build.properties
new file mode 100644
index 0000000..cef084d
--- /dev/null
+++ b/bundles/org.eclipse.wtp.web.capabilities/build.properties
@@ -0,0 +1,5 @@
+bin.includes = META-INF/,\
+               OSGI-INF/,\
+               plugin.xml,\
+               OSGI-INF/l10n/,\
+               about.html
diff --git a/bundles/org.eclipse.wtp.web.capabilities/plugin.xml b/bundles/org.eclipse.wtp.web.capabilities/plugin.xml
new file mode 100644
index 0000000..e95ad7d
--- /dev/null
+++ b/bundles/org.eclipse.wtp.web.capabilities/plugin.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+  
+
+   <!-- Web Capability Definition-->
+   <!-- The Web capability requires the XML capability.
+      	The XML capability is currently serving as the
+      	default WTP capability. (See the comments on the
+      	XML capability.)
+    -->
+   <extension point="org.eclipse.ui.activities">
+      	
+  	<activity
+            name="%activity.web"
+            description="%activity.web.desc"
+            id="org.eclipse.wtp.web.capabilities">
+     	</activity>
+     	
+      	<activityPatternBinding
+            activityId="org.eclipse.wtp.web.capabilities"
+            pattern="org\.eclipse\.wst\.css\.[\.\w/]*">
+      	</activityPatternBinding>
+      	
+      	<activityPatternBinding
+            activityId="org.eclipse.wtp.web.capabilities"
+            pattern="org\.eclipse\.wst\.html\.[\.\w/]*">
+      	</activityPatternBinding>
+      	
+      	<activityPatternBinding
+            activityId="org.eclipse.wtp.web.capabilities"
+            pattern="org\.eclipse\.wst\.javascript\.[\.\w/]*">
+      	</activityPatternBinding>
+      	
+      	<activityPatternBinding
+            activityId="org.eclipse.wtp.web.capabilities"
+            pattern="org\.eclipse\.wst\.server\.[\.\w/]*">
+      	</activityPatternBinding>
+      	
+      	<activityPatternBinding
+            activityId="org.eclipse.wtp.web.capabilities"
+            pattern="org\.eclipse\.wst\.internet\.monitor\.[\.\w/]*">
+      	</activityPatternBinding>
+      	
+      	<activityPatternBinding
+            activityId="org.eclipse.wtp.web.capabilities"
+            pattern="org\.eclipse\.wst\.web\.[\.\w/]*">
+      	</activityPatternBinding>
+      	
+   </extension>
+   
+</plugin>
diff --git a/development/org.eclipse.wst.sse.unittests/.project b/bundles/org.eclipse.wtp.xml.capabilities/.project
similarity index 68%
rename from development/org.eclipse.wst.sse.unittests/.project
rename to bundles/org.eclipse.wtp.xml.capabilities/.project
index e6f5109..bd1e416 100644
--- a/development/org.eclipse.wst.sse.unittests/.project
+++ b/bundles/org.eclipse.wtp.xml.capabilities/.project
@@ -1,16 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-	<name>org.eclipse.wst.sse.unittests</name>
+	<name>org.eclipse.wtp.xml.capabilities</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>
@@ -23,6 +18,5 @@
 	</buildSpec>
 	<natures>
 		<nature>org.eclipse.pde.PluginNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
 	</natures>
 </projectDescription>
diff --git a/bundles/org.eclipse.wtp.xml.capabilities/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.wtp.xml.capabilities/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 0000000..eb760e2
--- /dev/null
+++ b/bundles/org.eclipse.wtp.xml.capabilities/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,4 @@
+#Tue May 19 09:49:45 EDT 2009
+eclipse.preferences.version=1
+resolve.requirebundle=false
+pluginProject.extensions=false
diff --git a/bundles/org.eclipse.wtp.xml.capabilities/META-INF/MANIFEST.MF b/bundles/org.eclipse.wtp.xml.capabilities/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..7464693
--- /dev/null
+++ b/bundles/org.eclipse.wtp.xml.capabilities/META-INF/MANIFEST.MF
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.wtp.xml.capabilities;singleton:=true
+Bundle-Version: 1.0.100.qualifier
+Bundle-Vendor: %Bundle-Vendor.0
+Require-Bundle: org.eclipse.ui.workbench,
+ org.eclipse.help.ui
diff --git a/bundles/org.eclipse.wtp.xml.capabilities/META-INF/eclipse.inf b/bundles/org.eclipse.wtp.xml.capabilities/META-INF/eclipse.inf
new file mode 100644
index 0000000..778e2f3
--- /dev/null
+++ b/bundles/org.eclipse.wtp.xml.capabilities/META-INF/eclipse.inf
@@ -0,0 +1,2 @@
+# We do not want capability jars pack200'd (they are tiny, no java, and fetched easier as jars)
+jarprocessor.exclude.pack=true
\ No newline at end of file
diff --git a/bundles/org.eclipse.wtp.xml.capabilities/OSGI-INF/l10n/bundle.properties b/bundles/org.eclipse.wtp.xml.capabilities/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 0000000..74b8872
--- /dev/null
+++ b/bundles/org.eclipse.wtp.xml.capabilities/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,5 @@
+#Properties file for org.eclipse.wtp.xml.capabilities
+Bundle-Name.0 = XML Capabilities
+Bundle-Vendor.0 = Eclipse Web Tools Platform
+activity.xml             = XML Development
+activity.xml.desc        = Develop XML applications.
diff --git a/bundles/org.eclipse.wtp.xml.capabilities/about.html b/bundles/org.eclipse.wtp.xml.capabilities/about.html
new file mode 100644
index 0000000..31cec0d
--- /dev/null
+++ b/bundles/org.eclipse.wtp.xml.capabilities/about.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<HTML>
+
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+
+<BODY lang="EN-US">
+
+<H3>About This Content</H3>
+
+<P>June, 2009</P>
+
+<H3>License</H3>
+
+<P>The Eclipse Foundation makes available all content in this plug-in 
+("Content"). Unless otherwise indicated below, the Content is provided to you 
+under the terms and conditions of the Eclipse Public License Version 1.0 
+("EPL"). A copy of the EPL is available at
+<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>. 
+For purposes of the EPL, "Program" 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 ("Redistributor") and different 
+terms and conditions may apply to your use of any object code in the Content. 
+Check the RedistributorÂ’s license that was provided with the Content. If no such 
+license exists, contact the Redistributor. Unless otherwise indicated below, the 
+terms and conditions of the EPL still apply to any source code in the Content 
+and such source code may be obtained at
+<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
+
+</BODY>
+</HTML>
diff --git a/bundles/org.eclipse.wtp.xml.capabilities/build.properties b/bundles/org.eclipse.wtp.xml.capabilities/build.properties
new file mode 100644
index 0000000..cef084d
--- /dev/null
+++ b/bundles/org.eclipse.wtp.xml.capabilities/build.properties
@@ -0,0 +1,5 @@
+bin.includes = META-INF/,\
+               OSGI-INF/,\
+               plugin.xml,\
+               OSGI-INF/l10n/,\
+               about.html
diff --git a/bundles/org.eclipse.wtp.xml.capabilities/plugin.xml b/bundles/org.eclipse.wtp.xml.capabilities/plugin.xml
new file mode 100644
index 0000000..33eed27
--- /dev/null
+++ b/bundles/org.eclipse.wtp.xml.capabilities/plugin.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+    <!--
+        XML Capability Definition The following components are
+        associated with the XML activity as they are required by XML and
+        other components and XML is currently serving as the base WTP
+        component. common sse validation
+    -->
+    <extension
+        point="org.eclipse.ui.activities">
+        <activity
+            name="%activity.xml"
+            description="%activity.xml.desc"
+            id="org.eclipse.wtp.xml.capabilities">
+        </activity>
+        <activityPatternBinding
+            activityId="org.eclipse.wtp.xml.capabilities"
+            pattern="org\.eclipse\.wst\.xml\.[\.\w/]*">
+        </activityPatternBinding>
+        <activityPatternBinding
+            activityId="org.eclipse.wtp.xml.capabilities"
+            pattern="org\.eclipse\.wst\.xsd\.[\.\w/]*">
+        </activityPatternBinding>
+        <activityPatternBinding
+            activityId="org.eclipse.wtp.xml.capabilities"
+            pattern="org\.eclipse\.wst\.dtd\.[\.\w/]*">
+        </activityPatternBinding>
+        <activityPatternBinding
+            activityId="org.eclipse.wtp.xml.capabilities"
+            pattern="org\.apache\.xerces\.[\.\w/]*">
+        </activityPatternBinding>
+        <activityPatternBinding
+            activityId="org.eclipse.wtp.xml.capabilities"
+            pattern="org\.eclipse\.wst\.common\.[\.\w/]*">
+        </activityPatternBinding>
+        <activityPatternBinding
+            activityId="org.eclipse.wtp.xml.capabilities"
+            pattern="org\.eclipse\.wst\.sse\.[\.\w/]*">
+        </activityPatternBinding>
+        <activityPatternBinding
+            activityId="org.eclipse.wtp.xml.capabilities"
+            pattern="org\.eclipse\.wst\.validation\.[\.\w/]*">
+        </activityPatternBinding>
+        <activityPatternBinding
+            activityId="org.eclipse.wtp.xml.capabilities"
+            pattern="org\.eclipse\.wst\.internet\.cache\.[\.\w/]*">
+        </activityPatternBinding>
+        <activityPatternBinding
+            activityId="org.eclipse.wtp.xml.capabilities"
+            pattern="org\.eclipse\.wst\.internet\.proxy\.[\.\w/]*">
+        </activityPatternBinding>
+       
+    </extension>
+</plugin>
\ No newline at end of file
diff --git a/development/org.eclipse.wst.sse.unittests/.cvsignore b/development/org.eclipse.wst.sse.unittests/.cvsignore
deleted file mode 100644
index 9fc9cb0..0000000
--- a/development/org.eclipse.wst.sse.unittests/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-bin
-build.xml
-ssejunit.jar
-temp.folder
diff --git a/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.core.resources.prefs b/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91..0000000
--- a/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.jdt.core.prefs b/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 2dd8b5c..0000000
--- a/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,80 +0,0 @@
-#Sun Apr 16 14:37:21 EDT 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=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.jdt.ui.prefs b/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index ef2ac65..0000000
--- a/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:39 EDT 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
diff --git a/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.ltk.core.refactoring.prefs b/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c..0000000
--- a/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.ltk.core.refactoring.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
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 f724958..0000000
--- a/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,15 +0,0 @@
-#Sun Apr 16 14:05:29 EDT 2006
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/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 1f0baaf..0000000
--- a/development/org.eclipse.wst.sse.unittests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,42 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wst.sse.unittests; singleton:=true
-Bundle-Version: 0.7.0
-Bundle-ClassPath: .
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.sse.unittests,
- org.eclipse.wst.sse.unittests.minortools
-Require-Bundle: org.junit;bundle-version="[3.8.0,4.0.0)",
- org.eclipse.core.runtime,
- org.eclipse.wst.css.tests.encoding;resolution:=optional,
- org.eclipse.wst.css.core.tests;resolution:=optional,
- org.eclipse.wst.css.ui.tests;resolution:=optional,
- org.eclipse.wst.css.ui.tests.performance;resolution:=optional,
- org.eclipse.wst.dtd.core.tests;resolution:=optional,
- org.eclipse.wst.dtd.ui.tests;resolution:=optional,
- org.eclipse.wst.html.core.tests;resolution:=optional,
- org.eclipse.wst.html.tests.encoding;resolution:=optional,
- org.eclipse.wst.html.ui.tests;resolution:=optional,
- org.eclipse.wst.html.ui.tests.performance;resolution:=optional,
- org.eclipse.wst.sse.core.tests;resolution:=optional,
- org.eclipse.wst.sse.ui.tests;resolution:=optional,
- org.eclipse.wst.sse.ui.tests.performance;resolution:=optional,
- org.eclipse.wst.xml.core.tests;resolution:=optional,
- org.eclipse.wst.xml.tests.encoding;resolution:=optional,
- org.eclipse.wst.xml.ui.tests.performance;resolution:=optional,
- org.eclipse.wst.xml.validation.tests;resolution:=optional,
- org.eclipse.wst.javascript.ui;resolution:=optional,
- org.eclipse.wst.xsd.validation.tests;resolution:=optional,
- org.eclipse.wst.css.ui.tests;resolution:=optional,
- org.eclipse.wst.sse.ui;resolution:=optional,
- org.eclipse.wst.xml.ui;resolution:=optional,
- org.eclipse.wst.xml.ui.tests;resolution:=optional,
- org.eclipse.jst.jsp.core.tests;resolution:=optional,
- org.eclipse.jst.jsp.tests.encoding;resolution:=optional,
- org.eclipse.jst.jsp.ui.tests;resolution:=optional,
- org.eclipse.jst.jsp.ui.tests.performance;resolution:=optional,
- org.eclipse.wst.xsd.core.tests;resolution:=optional
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
-Eclipse-LazyStart: true
diff --git a/development/org.eclipse.wst.sse.unittests/build.properties b/development/org.eclipse.wst.sse.unittests/build.properties
deleted file mode 100644
index bde1454..0000000
--- a/development/org.eclipse.wst.sse.unittests/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-# 
-# Contributors:
-#     IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes = META-INF/,\
-               .,\
-               plugin.xml,\
-               plugin.properties
-source.. = src/
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.properties b/development/org.eclipse.wst.sse.unittests/plugin.properties
deleted file mode 100644
index 8c4370b..0000000
--- a/development/org.eclipse.wst.sse.unittests/plugin.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2006 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-# 
-# Contributors:
-#     IBM Corporation - initial API and implementation
-#     
-###############################################################################
-XML_Source_Page_Editor.name=XML Source Page Editor
-JavaScript_Source_Page_Editor.name=JavaScript Source Page Editor
-
-Bundle-Vendor.0 = Eclipse.org
-Bundle-Name.0 = Unit Tests
-additionalTests=Additional TestCases and TestSuites
\ No newline at end of file
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 6dd4917..0000000
--- a/development/org.eclipse.wst.sse.unittests/plugin.xml
+++ /dev/null
@@ -1,21 +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 id="additionalTests" name="%additionalTests" schema="schema/additionalTests.exsd"/>
-
-</plugin>
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 98762c7..0000000
--- a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterListTestSuite.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2004,2008 IBM Corporation and others.
- * 
- * All rights reserved. This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License v1.0 which
- * accompanies  this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors: IBM Corporation - initial API and implementation
- * 
- ****************************************************************************/
-
-package org.eclipse.wst.sse.unittests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-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.core.tests.DTDCoreTestSuite;
-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.core.tests.internal.AllXSDCoreTests;
-import org.eclipse.wst.xsd.validation.tests.internal.AllXSDTests;
-
-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(DTDCoreTestSuite.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(AllXSDCoreTests.suite());
-
-		// addTest(RegressionBucket.suite());
-		// addTest(AllTestCases.suite());
-
-		IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.wst.sse.unittests.additionalSuites");
-		for (int i = 0; i < elements.length; i++) {
-			if (elements[i].getName().equals("suite")) {
-				TestSuite suite;
-				try {
-					suite = (TestSuite) elements[i].createExecutableExtension("class");
-					addTest(suite);
-				}
-				catch (CoreException e) {
-					Platform.getLog(Platform.getBundle("org.eclipse.wst.sse.unittests")).log(e.getStatus());
-				}
-			}
-			else if (elements[i].getName().equals("test")) {
-				Test test;
-				try {
-					test = (Test) elements[i].createExecutableExtension("class");
-					addTest(new TestSuite(test.getClass()));
-				}
-				catch (CoreException e) {
-					Platform.getLog(Platform.getBundle("org.eclipse.wst.sse.unittests")).log(e.getStatus());
-				}
-			}
-		}
-	}
-
-	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/TestTurkish.java b/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/TestTurkish.java
deleted file mode 100644
index 939c544..0000000
--- a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/TestTurkish.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-
-package org.eclipse.wst.sse.unittests;
-
-import java.util.Locale;
-
-/**
- * TestTurkish
- * See http://www.i18nguy.com/unicode/turkish-i18n.html
- */
-
-public class TestTurkish {
-	public static void main(String[] args) {
-		String turkishLowerCase = "\u0131" + "\u0069";
-		String turkishUpperCase = "\u0130" + "\u0049";
-		Locale[] locales = Locale.getAvailableLocales();
-		for (int i = 0; i < locales.length; i++) {
-			// System.out.println(locales[i]);
-		}
-		Locale turkishLocale = new Locale("TR");
-		String testUppercase = turkishLowerCase.toUpperCase(turkishLocale);
-		System.out.println(turkishUpperCase.equals(testUppercase));
-	}
-}
diff --git a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/TestString.java b/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/TestString.java
deleted file mode 100644
index 578fc46..0000000
--- a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/TestString.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
-
-package org.eclipse.wst.sse.unittests.minortools;
-
-import java.io.IOException;
-import java.io.StringReader;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * TestString
- */
-
-public class TestString {
-
-	public static void main(String[] args) {
-
-
-		String xml = "<?xml version=\"1.0\" encoding=\"UTF-16\"?><message><sourceUri></sourceUri><body></body></message>";
-
-
-		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-		factory.setNamespaceAware(false);
-		factory.setValidating(false);
-		try {
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			Document document = builder.parse(new InputSource(new StringReader(xml)));
-			if (document != null) {
-				System.out.print(document.hasChildNodes());
-			}
-			System.out.println(document);
-		}
-		catch (ParserConfigurationException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		catch (SAXException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		catch (IOException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-
-	}
-
-}
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 aa2e238..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, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this 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;
-	}
-
-}
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 61ed9c5..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, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this 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);
-		}
-	}
-}
diff --git a/development/org.eclipse.wst.sse.unittests/src/testStringXML.jpage b/development/org.eclipse.wst.sse.unittests/src/testStringXML.jpage
deleted file mode 100644
index 0f1eaa0..0000000
--- a/development/org.eclipse.wst.sse.unittests/src/testStringXML.jpage
+++ /dev/null
Binary files differ
diff --git a/development/org.eclipse.wst.sse.unittests/tet.jsp b/development/org.eclipse.wst.sse.unittests/tet.jsp
deleted file mode 100644
index 191b21e..0000000
--- a/development/org.eclipse.wst.sse.unittests/tet.jsp
+++ /dev/null
@@ -1,21 +0,0 @@
-<%@ page language="java" contentType="text/html; charset=UTF-8"

-	pageEncoding="UTF-8"%>

-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

-<html>

-<head>

-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

-<title>content of lowercase title tags</title>

-<tıtle>content of lowercase title tags (no diaresis over i)</tıtle>

-<title>content of uppercase tags</title>

-<title></title>

-<title></title>

-<title></title>

-<title></title>

-</head>

-<body>

-<i></i>

-<i></i>

-<i></i>

-<i></i>

-</body>

-</html>

diff --git a/development/org.eclipse.wst.sse.unittests/turkishCase.jpage b/development/org.eclipse.wst.sse.unittests/turkishCase.jpage
deleted file mode 100644
index ba96e61..0000000
--- a/development/org.eclipse.wst.sse.unittests/turkishCase.jpage
+++ /dev/null
@@ -1,3 +0,0 @@
-
-String s = "\u0131"+"\u0069";
-s.toUpperCase();
\ No newline at end of file
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 a703c2c..2888f41 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,6 +2,6 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Plugin.name
 Bundle-SymbolicName: org.eclipse.jst.jsp.ui.infopop; singleton:=true
-Bundle-Version: 1.0.3.qualifier
+Bundle-Version: 1.0.200.qualifier
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: plugin
diff --git a/docs/org.eclipse.jst.jsp.ui.infopop/about.html b/docs/org.eclipse.jst.jsp.ui.infopop/about.html
index 73db36e..2199df3 100644
--- a/docs/org.eclipse.jst.jsp.ui.infopop/about.html
+++ b/docs/org.eclipse.jst.jsp.ui.infopop/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/docs/org.eclipse.jst.jsp.ui.infopop/build.properties b/docs/org.eclipse.jst.jsp.ui.infopop/build.properties
index 9c4adf9..58c6973 100644
--- a/docs/org.eclipse.jst.jsp.ui.infopop/build.properties
+++ b/docs/org.eclipse.jst.jsp.ui.infopop/build.properties
@@ -10,5 +10,4 @@
                plugin.properties,\
                plugin.xml,\
                plugin.properties
-src.includes = build.properties
-generateSourceBundle=false
\ No newline at end of file
+generateSourceBundle=false
diff --git a/docs/org.eclipse.jst.jsp.ui.infopop/plugin.properties b/docs/org.eclipse.jst.jsp.ui.infopop/plugin.properties
index 138c44e..aa9ca26 100644
--- a/docs/org.eclipse.jst.jsp.ui.infopop/plugin.properties
+++ b/docs/org.eclipse.jst.jsp.ui.infopop/plugin.properties
@@ -4,4 +4,4 @@
 # ==============================================================================
 Plugin.name = JSP tools infopops
 
-Bundle-Vendor.0 = Eclipse.org
\ No newline at end of file
+Bundle-Vendor.0 = Eclipse Web Tools Platform
\ 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 1c3bac2..5cf4c20 100644
--- a/docs/org.eclipse.wst.doc.user/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.wst.doc.user/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.doc.user; singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.2.0.qualifier
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Eclipse-LazyStart: true
diff --git a/docs/org.eclipse.wst.doc.user/about.html b/docs/org.eclipse.wst.doc.user/about.html
index 86cd081..c761715 100644
--- a/docs/org.eclipse.wst.doc.user/about.html
+++ b/docs/org.eclipse.wst.doc.user/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/docs/org.eclipse.wst.doc.user/build.properties b/docs/org.eclipse.wst.doc.user/build.properties
index 3d270e9..8307a8e 100644
--- a/docs/org.eclipse.wst.doc.user/build.properties
+++ b/docs/org.eclipse.wst.doc.user/build.properties
@@ -7,6 +7,7 @@
                plugin.properties,\
                plugin.xml,\
                toc.xml,\
+               reference_toc.xml,\
                topics/,\
                book.css,\
                commonrtl.css
diff --git a/docs/org.eclipse.wst.doc.user/plugin.xml b/docs/org.eclipse.wst.doc.user/plugin.xml
index 0aa617f..4e48f34 100644
--- a/docs/org.eclipse.wst.doc.user/plugin.xml
+++ b/docs/org.eclipse.wst.doc.user/plugin.xml
@@ -4,4 +4,7 @@
 	<extension point="org.eclipse.help.toc">
 		<toc file="toc.xml" primary="true" />
 	</extension>
+	<extension point="org.eclipse.help.toc">
+		<toc file="reference_toc.xml"/>
+	</extension>
 </plugin>
diff --git a/docs/org.eclipse.wst.doc.user/reference_toc.xml b/docs/org.eclipse.wst.doc.user/reference_toc.xml
new file mode 100644
index 0000000..9d4b726
--- /dev/null
+++ b/docs/org.eclipse.wst.doc.user/reference_toc.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+<!-- /*******************************************************************************
+	* Copyright (c) 2000, 2008 IBM Corporation and others.
+	* All rights reserved. This program and the accompanying materials
+	* are made available under the terms of the Eclipse Public License v1.0
+	* which accompanies this distribution, and is available at
+	* http://www.eclipse.org/legal/epl-v10.html
+	* 
+	* Contributors:
+	*     IBM Corporation - initial API and implementation
+	*******************************************************************************/ -->
+<!-- ============================================================================= -->
+<!-- Define the top level topics                                                   -->
+<!-- ============================================================================= -->
+<toc label="Web Tools Platform reference information">
+   <anchor id="command_reference"/>
+   <anchor id="UI_reference"/>
+   <anchor id="javadoc_common"/>
+   <anchor id="javadoc_ejbtools"/>
+   <anchor id="javadoc_jeetools"/>
+   <anchor id="javadoc_servertools"/>
+   <anchor id="javadoc_sourceediting"/>
+   <anchor id="javadoc_xml"/>
+   <anchor id="javadoc_webservices"/>
+</toc>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.doc.user/toc.xml b/docs/org.eclipse.wst.doc.user/toc.xml
index 5213a43..944270c 100644
--- a/docs/org.eclipse.wst.doc.user/toc.xml
+++ b/docs/org.eclipse.wst.doc.user/toc.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?NLS TYPE="org.eclipse.help.toc"?>
 <!-- /*******************************************************************************
-	* Copyright (c) 2000, 2007 IBM Corporation and others.
+	* Copyright (c) 2000, 2008 IBM Corporation and others.
 	* All rights reserved. This program and the accompanying materials
 	* are made available under the terms of the Eclipse Public License v1.0
 	* which accompanies this distribution, and is available at
@@ -13,14 +13,14 @@
 <!-- ============================================================================= -->
 <!-- Define the top level topics                                                   -->
 <!-- ============================================================================= -->
-<toc label="Web Application Development User Guide"
+<toc label="Web Tools Platform User Guide"
 	topic="topics/overview.html">
 
 	<topic label="Creating Web applications">
 		<link
 			toc="../org.eclipse.wst.webtools.doc.user/webtools_toc.xml" />
 	</topic>
-	<topic label="Creating J2EE and enterprise applications">
+	<topic label="Creating Java EE and enterprise applications">
 		<link toc="../org.eclipse.jst.j2ee.doc.user/jst_j2ee_toc.xml" />
 		<link toc="../org.eclipse.jst.ejb.doc.user/ejb_toc.xml" />
 	</topic>
@@ -41,6 +41,9 @@
 	<topic label="Using the server tools">
   		<link toc="../org.eclipse.wst.server.ui.doc.user/wtp_main_toc.xml" />
 	</topic>
+	<topic label="Reference">
+  		<link toc="reference_toc.xml" />
+	</topic>
 	<topic label="Limitations and Known Issues" href="topics/limitations.html" />
 	<topic label="Legal" href="notices.html" />
 </toc>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.doc.user/topics/limitations.html b/docs/org.eclipse.wst.doc.user/topics/limitations.html
index e3c110f..f890bd7 100644
--- a/docs/org.eclipse.wst.doc.user/topics/limitations.html
+++ b/docs/org.eclipse.wst.doc.user/topics/limitations.html
@@ -14,10 +14,10 @@
  *******************************************************************************/ -->
 <link rel="stylesheet" type="text/css"
 	href="../../org.eclipse.wst.doc.user/common.css" >
-<title>Web Tools Project Limitations and Known Issues</title>
+<title>Web Tools Platform Limitations and Known Issues</title>
 </head>
 <body>
-<h1>Web Tools Project Limitations and Known Issues</h1>
+<h1>Web Tools Platform Limitations and Known Issues</h1>
 <p>The following are limitations and known issues:</p>
 <dl>
 <dt class="dlterm"><b>When using XDoclet the generation does not appear to run.</b></dt>
@@ -38,6 +38,20 @@
 project's <samp>lib/</samp> directory.
 </p>
 </dd>
+<dt class="dlterm"><b>Problems encountered publishing from dynamic Web projects with non-ASCII characters in the context root</b></dt>
+<dd>
+<p>Cause: By default the context root of a dynamic Web project uses the project name. If non-ASCII characters are used as project names for dynamic Web projects, 
+the default context root causes problems when trying to publish from the Web project.</p>
+<p>You may encounter the following errors if this occurs:
+<ul>
+<li>If you create a dynamic Web project with non-ASCII characters (leaving the context root
+to default to the project name containing non ASCII characters) and try to
+publish, you will see an error message similar to "The requested resource is not available".</li>
+<li>If a dynamic Web project containing a non-ASCII context root is used in an Axis1 Web service creation 
+scenario, you will see an error message similar to "Unable to deploy to Axis".</li>
+</ul>
+<p>Solution: The following ASCII characters are valid in the context root: all letters, all numbers, an underscore, a hyphen (dash), a forward slash, or a period.</p>
+</dd>
 </dl>
 </body>
 </html>
\ 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 0cf4da1..ef66ce4 100644
--- a/docs/org.eclipse.wst.dtd.ui.infopop/EditorDtdContexts.xml
+++ b/docs/org.eclipse.wst.dtd.ui.infopop/EditorDtdContexts.xml
@@ -2,53 +2,79 @@
 <?NLS type="org.eclipse.help.contexts"?>
 
 <!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
+	* Copyright (c) 2000, 2005 IBM Corporation and others.
+	* All rights reserved. This program and the accompanying materials
+	* are made available under the terms of the Eclipse Public License v1.0
+	* which accompanies this distribution, and is available at
+	* http://www.eclipse.org/legal/epl-v10.html
+	* 
+	* Contributors:
+	*     IBM Corporation - initial API and implementation
+	*******************************************************************************/ -->
+
+<!-- plugin: org.eclipse.wst.dtd.ui -->
 
 <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"><!-- dtd files preference page -->
+		<description>
+			This page lets you choose which suffix (<b>dtd</b>, <b>ent</b>, or <b>mod</b>) is added when a new DTD file is created.
+		</description>
+	</context>
+	<context id="webx0021"><!-- dtd styles preference page -->
+		<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"><!-- dtd template preference page -->
+		<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=""><!-- create dtd page 1 has no id atm -->
+		<description>
+			In the <b>File name</b> field, type the name of the DTD. The name of your DTD file must end with the extension .dtd
+		</description>
+		<topic
+			href="../org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.html"
+			label="" />
+	</context>
+	<context id="dtdw0010"><!-- dtd new file wizard page 2, page 1 has no ID -->
+		<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/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.dtd.ui.infopop/META-INF/MANIFEST.MF
index c8829c7..d58a668 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
@@ -2,6 +2,6 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.dtd.ui.infopop; singleton:=true
-Bundle-Version: 1.0.2.qualifier
+Bundle-Version: 1.0.300.qualifier
 Bundle-Vendor: %pluginProvider
 Bundle-Localization: plugin
diff --git a/docs/org.eclipse.wst.dtd.ui.infopop/about.html b/docs/org.eclipse.wst.dtd.ui.infopop/about.html
index 73db36e..2199df3 100644
--- a/docs/org.eclipse.wst.dtd.ui.infopop/about.html
+++ b/docs/org.eclipse.wst.dtd.ui.infopop/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/DTDEditormap_toc.ditamap b/docs/org.eclipse.wst.dtdeditor.doc.user/DTDEditormap_toc.ditamap
index 58ca8f3..88a77ee 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/DTDEditormap_toc.ditamap
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/DTDEditormap_toc.ditamap
@@ -2,7 +2,7 @@
 <!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN"

  "map.dtd">

-<map collection-type="sequence" title="DTD Editor">

+<map collection-type="sequence" id="dtdeditorTOC" title="DTD Editor">

 <topicref href="topics/cworkdtds.dita" navtitle="Working with DTDs" type="concept">

 <anchor id="dtd_post_cworkdtds"/>

 <topicref href="topics/tcretdtd.dita" linking="normal" navtitle="Creating DTDs"

@@ -25,5 +25,8 @@
 <anchor id="dtd_post_tvaldtd"/>

 <topicref href="topics/rdtdicons.dita" navtitle="Icons used in the DTD editor"

 type="reference"></topicref>

-<anchor id="dtd_post_rdtdicons"/></topicref>

+<anchor id="dtd_post_rdtdicons"/>

+<topicref href="topics/rdtdkey.dita" navtitle="DTD editor keyboard shortcuts"

+type="reference"></topicref>

+<anchor id="dtd_post_rdtdkey"/></topicref>

 </map>

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 34fc3a6..105d988 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/DTDEditormap_toc.xml
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/DTDEditormap_toc.xml
@@ -20,5 +20,7 @@
 <anchor id="dtd_post_tvaldtd"/>
 <topic label="Icons used in the DTD editor" href="topics/rdtdicons.html"/>
 <anchor id="dtd_post_rdtdicons"/>
+<topic label="DTD editor keyboard shortcuts" href="topics/rdtdkey.html"/>
+<anchor id="dtd_post_rdtdkey"/>
 </topic>
 </toc>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/DTDreftable.xml b/docs/org.eclipse.wst.dtdeditor.doc.user/DTDreftable.xml
new file mode 100644
index 0000000..ebdd30a
--- /dev/null
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/DTDreftable.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc topic="topics/tcretdtd.html">
+<topic label="Creating DTDs" href="topics/tcretdtd.html"/>
+<topic label="Document type definitions (DTDs) - overview" href="topics/cdtdover.html"/>
+<topic label="Document type definitions (DTDs) - overview" href="topics/cdtdover.html"/>
+<topic label="Validating DTDs" href="topics/tvaldtd.html"/>
+<topic label="Creating DTDs" href="topics/tcretdtd.html"/>
+<topic label="Working with DTD templates" href="topics/tdtemplt.html"/>
+</toc>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/DocBuild.xml b/docs/org.eclipse.wst.dtdeditor.doc.user/DocBuild.xml
index 7599ca5..663d0eb 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/DocBuild.xml
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/DocBuild.xml
@@ -23,6 +23,9 @@
 	- Created.
 	2008-01-09 Kate Price <katep@ca.ibm.com>
 	- modified for new DITA-OT version
+	2008-05-05 Kate Price <katep@ca.ibm.com>
+	- modified to add generation of pre-built help index. 
+	- Must delete /index folder before running build
 -->
 <project name="eclipsehelp" default="all">
 
@@ -47,8 +50,8 @@
 			<property name="args.copycss" value="no" />
 			<property name="args.csspath" value="../org.eclipse.wst.doc.user" />
 			<property name="args.eclipse.provider" value="Eclipse.org" />
-			<property name="args.eclipse.version" value="1.5.0" />
-			<property name="args.input" location="DTDEditormap_toc.ditamap" />    		
+			<property name="args.eclipse.version" value="3.4.0" />
+			<property name="args.input" location="DTDreftable.ditamap" />    		
 			<property name="clean.temp" value="true" />
 			<property name="dita.extname" value=".dita" />
 			<property name="dita.temp.dir" location="temp" />
@@ -57,4 +60,7 @@
 		</ant>
 		<copy file="myplugin.xml" tofile="plugin.xml" overwrite="yes" />
 	</target>
+	<target name="build.index" description="Builds search index for the plug-in" if="eclipse.running">
+	     <help.buildHelpIndex manifest="plugin.xml" destination="."/>
+	</target>
 </project>
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 4040033..88dfb5d 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
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.dtdeditor.doc.user; singleton:=true
-Bundle-Version: 1.0.400.qualifier
+Bundle-Version: 1.0.600.qualifier
 Bundle-Vendor: %pluginProvider
 Bundle-Localization: plugin
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/about.html b/docs/org.eclipse.wst.dtdeditor.doc.user/about.html
index 73db36e..2199df3 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/about.html
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/dita.list b/docs/org.eclipse.wst.dtdeditor.doc.user/dita.list
new file mode 100644
index 0000000..4edd99a
--- /dev/null
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/dita.list
@@ -0,0 +1,12 @@
+#Thu Oct 15 11:36:49 EDT 2009

+user.input.file=DTDreftable.ditamap

+user.input.dir=D\:\\Docs\\WTP3\\org.eclipse.wst.dtdeditor.doc.user

+flagimagelist=

+fullditamaplist=DTDreftable.ditamap

+conreflist=

+hreftargetslist=topics/tdtemplt.dita,topics/tcretdtd.dita,topics/tvaldtd.dita,topics/cdtdover.dita

+fullditatopiclist=topics/tdtemplt.dita,topics/tcretdtd.dita,topics/tvaldtd.dita,topics/cdtdover.dita

+fullditamapandtopiclist=topics/tdtemplt.dita,topics/tcretdtd.dita,DTDreftable.ditamap,topics/tvaldtd.dita,topics/cdtdover.dita

+htmllist=

+imagelist=

+hrefditatopiclist=topics/tvaldtd.dita

diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/index/_8.cfs b/docs/org.eclipse.wst.dtdeditor.doc.user/index/_8.cfs
deleted file mode 100644
index 0f963ab..0000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/index/_8.cfs
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/index/_9.cfs b/docs/org.eclipse.wst.dtdeditor.doc.user/index/_9.cfs
new file mode 100644
index 0000000..2710567
--- /dev/null
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/index/_9.cfs
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/index/deletable b/docs/org.eclipse.wst.dtdeditor.doc.user/index/deletable
index e423242..593f470 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/index/deletable
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/index/deletable
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_contributions b/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_contributions
index 92fe3c5..4aea31e 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_contributions
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_contributions
@@ -1,3 +1,3 @@
 #This is a generated file; do not edit.

-#Wed May 09 14:14:27 EDT 2007

-org.eclipse.wst.dtdeditor.doc.user=org.eclipse.wst.dtdeditor.doc.user\n1.0.300.qualifier

+#Wed Apr 29 18:03:30 EDT 2009

+org.eclipse.wst.dtdeditor.doc.user=org.eclipse.wst.dtdeditor.doc.user\n1.0.400.qualifier

diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_dependencies b/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_dependencies
index 771ea1c..fa707bb 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_dependencies
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_dependencies
@@ -1,4 +1,4 @@
 #This is a generated file; do not edit.

-#Wed May 09 14:14:27 EDT 2007

-lucene=1.4.103.v20060601

-analyzer=org.eclipse.help.base\#3.2.0.v20060601?locale\=en

+#Wed Apr 29 18:03:30 EDT 2009

+lucene=1.9.1.v20080530-1600

+analyzer=org.eclipse.help.base\#3.3.101.M20080728_34x?locale\=en

diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_docs b/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_docs
index af1ba6a..30876b7 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_docs
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/index/indexed_docs
@@ -1,10 +1,11 @@
 #This is a generated file; do not edit.

-#Wed May 09 14:14:27 EDT 2007

-/org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.html=0

-/org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.html=0

-/org.eclipse.wst.dtdeditor.doc.user/topics/timptdtd.html=0

+#Wed Apr 29 18:03:30 EDT 2009

+/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdkey.html=0

 /org.eclipse.wst.dtdeditor.doc.user/topics/cworkdtds.html=0

-/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.html=0

-/org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.html=0

+/org.eclipse.wst.dtdeditor.doc.user/topics/timptdtd.html=0

 /org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.html=0

+/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.html=0

 /org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.html=0

+/org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.html=0

+/org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.html=0

+/org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.html=0

diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/index/segments b/docs/org.eclipse.wst.dtdeditor.doc.user/index/segments
index 19b5d0c..c84f1b2 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/index/segments
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/index/segments
Binary files differ
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/myplugin.xml b/docs/org.eclipse.wst.dtdeditor.doc.user/myplugin.xml
index 1f7b7fb..5275853 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/myplugin.xml
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/myplugin.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.1"?>
+<?eclipse version="3.6"?>
+<?NLS TYPE="org.eclipse.help.toc"?> 
 <!-- /*******************************************************************************
  * Copyright (c) 2000, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
@@ -19,4 +20,5 @@
 	<extension point="org.eclipse.help.index">
 		<index file="org.eclipse.wst.dtdeditor.doc.userindex.xml"/>     
 	</extension>
+
 </plugin>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/org.eclipse.wst.dtdeditor.doc.userindex.html b/docs/org.eclipse.wst.dtdeditor.doc.user/org.eclipse.wst.dtdeditor.doc.userindex.html
deleted file mode 100644
index 993d81a..0000000
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/org.eclipse.wst.dtdeditor.doc.userindex.html
+++ /dev/null
@@ -1,60 +0,0 @@
-<?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 lang="en-us" xml:lang="en-us">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="copyright" content="(C) Copyright IBM Corporation 2007" />
-<meta name="security" content="public" />
-<meta name="Robots" content="index,follow" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta name="DC.Format" content="XHTML" />
-<!-- All rights reserved. Licensed Materials Property of IBM -->
-<!-- US Government Users Restricted Rights -->
-<!-- Use, duplication or disclosure restricted by -->
-<!-- GSA ADP Schedule Contract with IBM Corp. -->
-<link rel="stylesheet" type="text/css" href="ibmdita.css" />
-<title>Index</title>
-</head>
-<body>
-<h1>Index</h1>
-<strong>D</strong>
-<ul class="indexlist">
-<li>DTD
-<ul class="indexlist">
-<li><a href="topics/tcretdtd.html#tcretdtd">creating</a>
-</li>
-<li><a href="topics/tdtemplt.html#twmacro">creating templates</a>
-</li>
-<li><a href="topics/rdtdicons.html#ricons">editor icons</a>
-</li>
-<li><a href="topics/tedtsrcst.html#ttaghilt">highlighting styles</a>
-</li>
-<li><a href="topics/timptdtd.html#timptdtd">importing</a>
-</li>
-<li><a href="topics/cdtdover.html#cdtdover">overview</a>
-</li>
-<li><a href="topics/tvaldtd.html#tvaldtd">validating</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong>T</strong>
-<ul class="indexlist">
-<li>templates
-<ul class="indexlist">
-<li><a href="topics/tdtemplt.html#twmacro">DTD</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong>X</strong>
-<ul class="indexlist">
-<li>XML editor
-<ul class="indexlist">
-<li><a href="topics/tedtsrcst.html#ttaghilt">DTD highlighting styles</a>
-</li>
-</ul>
-</li>
-</ul>
-</body></html>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/org.eclipse.wst.dtdeditor.doc.userindex.xml b/docs/org.eclipse.wst.dtdeditor.doc.user/org.eclipse.wst.dtdeditor.doc.userindex.xml
index ce9760d..badab2e 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/org.eclipse.wst.dtdeditor.doc.userindex.xml
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/org.eclipse.wst.dtdeditor.doc.userindex.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <index>
-  <entry keyword="DTD">
+  <entry keyword="DTDs">
     <entry keyword="creating">
       <topic href="topics/tcretdtd.html#tcretdtd" title="Creating DTDs"/>
     </entry>
@@ -16,9 +16,6 @@
     <entry keyword="importing">
       <topic href="topics/timptdtd.html#timptdtd" title="Importing DTDs"/>
     </entry>
-    <entry keyword="validating">
-      <topic href="topics/tvaldtd.html#tvaldtd" title="Validating DTDs"/>
-    </entry>
     <entry keyword="editor icons">
       <topic href="topics/rdtdicons.html#ricons" title="Icons used in the DTD editor"/>
     </entry>
@@ -33,4 +30,19 @@
       <topic href="topics/tdtemplt.html#twmacro" title="Working with DTD templates"/>
     </entry>
   </entry>
+  <entry keyword="DTD">
+    <entry keyword="validating">
+      <topic href="topics/tvaldtd.html#tvaldtd" title="Validating DTDs"/>
+    </entry>
+  </entry>
+  <entry keyword="DTD editor">
+    <entry keyword="keyboard shortcuts">
+      <topic href="topics/rdtdkey.html#keyboardshortcutsinthedtdeditor" title="DTD editor keyboard shortcuts"/>
+    </entry>
+  </entry>
+  <entry keyword="keyboard shortcuts">
+    <entry keyword="DTD editor">
+      <topic href="topics/rdtdkey.html#keyboardshortcutsinthedtdeditor" title="DTD editor keyboard shortcuts"/>
+    </entry>
+  </entry>
 </index>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/plugin.xml b/docs/org.eclipse.wst.dtdeditor.doc.user/plugin.xml
index 1f7b7fb..5275853 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/plugin.xml
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/plugin.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.1"?>
+<?eclipse version="3.6"?>
+<?NLS TYPE="org.eclipse.help.toc"?> 
 <!-- /*******************************************************************************
  * Copyright (c) 2000, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
@@ -19,4 +20,5 @@
 	<extension point="org.eclipse.help.index">
 		<index file="org.eclipse.wst.dtdeditor.doc.userindex.xml"/>     
 	</extension>
+
 </plugin>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.dita b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.dita
index a81aa1b..930a999 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.dita
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.dita
@@ -2,7 +2,7 @@
 <!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"

  "concept.dtd">

-<concept id="cdtdover" xml:lang="en-us"><?Pub Caret1?>

+<concept id="cdtdover" xml:lang="en-us">

 <title>Document type definitions (DTDs) - overview</title>

 <titlealts>

 <searchtitle>Document type definition (DTD) - overview</searchtitle>

@@ -12,7 +12,7 @@
 can specify rules that control the structure of any XML files that reference

 the DTD file.</shortdesc>

 <prolog><metadata>

-<keywords><indexterm>DTD<indexterm>overview</indexterm></indexterm></keywords>

+<keywords><indexterm>DTDs<indexterm>overview</indexterm></indexterm></keywords>

 </metadata></prolog>

 <conbody>

 <p>A DTD can contain declarations that define elements, attributes, notations,

@@ -31,4 +31,3 @@
 XML file against the DTD.</p>

 </conbody>

 </concept>

-<?Pub *0000001753?>

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 fa1219c..d89466e 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.html
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Document type definitions (DTDs) - overview" />
 <meta name="abstract" content="A document type definition (DTD) provides you with the means to validate XML files against a set of rules. When you create a DTD file, you can specify rules that control the structure of any XML files that reference the DTD file." />
 <meta name="description" content="A document type definition (DTD) provides you with the means to validate XML files against a set of rules. When you create a DTD file, you can specify rules that control the structure of any XML files that reference the DTD file." />
-<meta content="DTD, overview" name="DC.subject" />
-<meta content="DTD, overview" name="keywords" />
+<meta content="DTDs, overview" name="DC.subject" />
+<meta content="DTDs, overview" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/tvaldtd.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="cdtdover" name="DC.Identifier" />
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 f9a41ac..b2478b4 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cworkdtds.html
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cworkdtds.html
@@ -15,6 +15,7 @@
 <meta scheme="URI" name="DC.Relation" content="../topics/timptdtd.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/tvaldtd.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/rdtdicons.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/rdtdkey.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="workingwithdtds" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -40,6 +41,8 @@
 Validating a DTD file lets you verify that it is well formed and does not contain any errors.</li>
 <li class="ulchildlink"><strong><a href="../topics/rdtdicons.html">Icons used in the DTD editor</a></strong><br />
 These DTD editor icons appear in the Outline view.</li>
+<li class="ulchildlink"><strong><a href="../topics/rdtdkey.html">DTD editor keyboard shortcuts</a></strong><br />
+</li>
 </ul>
 </div>
 
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.dita b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.dita
index 003c581..b5a3e19 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.dita
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.dita
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

-<!DOCTYPE reference  PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">

+<!--Arbortext, Inc., 1988-2006, v.4002-->

+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"

+ "reference.dtd">

 <reference id="ricons" xml:lang="en-us">

 <title>Icons used in the DTD editor</title>

 <titlealts>

@@ -8,8 +9,7 @@
 </titlealts>

 <shortdesc>These DTD editor icons appear in the Outline view.</shortdesc>

 <prolog><metadata>

-<keywords><indexterm>DTD<indexterm>editor icons</indexterm></indexterm>

-</keywords>

+<keywords><indexterm>DTDs<indexterm>editor icons</indexterm></indexterm></keywords>

 </metadata></prolog>

 <refbody>

 <table>

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 61b82cc..180b394 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.html
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.html
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Icons used in the DTD editor" />
 <meta name="abstract" content="These DTD editor icons appear in the Outline view." />
 <meta name="description" content="These DTD editor icons appear in the Outline view." />
-<meta content="DTD, editor icons" name="DC.subject" />
-<meta content="DTD, editor icons" name="keywords" />
+<meta content="DTDs, editor icons" name="DC.subject" />
+<meta content="DTDs, editor icons" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/cworkdtds.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="ricons" name="DC.Identifier" />
@@ -34,9 +34,9 @@
 <div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="border" border="1" rules="all">
 <thead align="left">
 <tr>
-<th valign="top" id="N10064">Icon </th>
+<th valign="top" id="N10063">Icon </th>
 
-<th valign="top" id="N1006B">Description</th>
+<th valign="top" id="N1006A">Description</th>
 
 </tr>
 
@@ -44,86 +44,86 @@
 
 <tbody>
 <tr>
-<td valign="top" headers="N10064 ">&nbsp;</td>
+<td valign="top" headers="N10063 ">&nbsp;</td>
 
-<td valign="top" headers="N1006B ">&nbsp;</td>
+<td valign="top" headers="N1006A ">&nbsp;</td>
 
 </tr>
 
 <tr>
-<td valign="top" headers="N10064 "> <img src="../images/nany.gif" alt="This graphic is the ANY content&#10;icon" /> </td>
+<td valign="top" headers="N10063 "> <img src="../images/nany.gif" alt="This graphic is the ANY content&#10;icon" /> </td>
 
-<td valign="top" headers="N1006B ">ANY content (content model)</td>
+<td valign="top" headers="N1006A ">ANY content (content model)</td>
 
 </tr>
 
 <tr>
-<td valign="top" headers="N10064 "><img src="../images/attribute.gif" alt="This graphic is the attribute&#10;icon" /> </td>
+<td valign="top" headers="N10063 "><img src="../images/attribute.gif" alt="This graphic is the attribute&#10;icon" /> </td>
 
-<td valign="top" headers="N1006B ">attribute</td>
+<td valign="top" headers="N1006A ">attribute</td>
 
 </tr>
 
 <tr>
-<td valign="top" headers="N10064 "><img src="../images/attribute_list.gif" alt="This graphic is the&#10;attribute list icon" /> </td>
+<td valign="top" headers="N10063 "><img src="../images/attribute_list.gif" alt="This graphic is the&#10;attribute list icon" /> </td>
 
-<td valign="top" headers="N1006B ">attribute list</td>
+<td valign="top" headers="N1006A ">attribute list</td>
 
 </tr>
 
 <tr>
-<td valign="top" headers="N10064 "><img src="../images/ADD_Comment.gif" alt="This&#10;graphic is the comment icon" /></td>
+<td valign="top" headers="N10063 "><img src="../images/ADD_Comment.gif" alt="This&#10;graphic is the comment icon" /></td>
 
-<td valign="top" headers="N1006B ">comment</td>
+<td valign="top" headers="N1006A ">comment</td>
 
 </tr>
 
 <tr>
-<td valign="top" headers="N10064 "> <img src="../images/XSDChoice.gif" alt="This graphic is the content&#10;model - choice icon" /></td>
+<td valign="top" headers="N10063 "> <img src="../images/XSDChoice.gif" alt="This graphic is the content&#10;model - choice icon" /></td>
 
-<td valign="top" headers="N1006B ">content model - choice</td>
+<td valign="top" headers="N1006A ">content model - choice</td>
 
 </tr>
 
 <tr>
-<td valign="top" headers="N10064 "> <img src="../images/XSDSequence.gif" alt="This graphic is the content&#10;model - sequence icon" /></td>
+<td valign="top" headers="N10063 "> <img src="../images/XSDSequence.gif" alt="This graphic is the content&#10;model - sequence icon" /></td>
 
-<td valign="top" headers="N1006B ">content model - sequence</td>
+<td valign="top" headers="N1006A ">content model - sequence</td>
 
 </tr>
 
 <tr>
-<td valign="top" headers="N10064 "><img src="../images/ADD_Element.gif" alt="This graphic is the element&#10;icon" /> </td>
+<td valign="top" headers="N10063 "><img src="../images/ADD_Element.gif" alt="This graphic is the element&#10;icon" /> </td>
 
-<td valign="top" headers="N1006B ">element</td>
+<td valign="top" headers="N1006A ">element</td>
 
 </tr>
 
 <tr>
-<td valign="top" headers="N10064 "> <img src="../images/nempty.gif" alt="This graphic is the EMPTY&#10;content (content model) icon" /> </td>
+<td valign="top" headers="N10063 "> <img src="../images/nempty.gif" alt="This graphic is the EMPTY&#10;content (content model) icon" /> </td>
 
-<td valign="top" headers="N1006B ">EMPTY content (content model)</td>
+<td valign="top" headers="N1006A ">EMPTY content (content model)</td>
 
 </tr>
 
 <tr>
-<td valign="top" headers="N10064 "><img src="../images/ADD_Entity.gif" alt="This graphic is the entity&#10;icon" /> </td>
+<td valign="top" headers="N10063 "><img src="../images/ADD_Entity.gif" alt="This graphic is the entity&#10;icon" /> </td>
 
-<td valign="top" headers="N1006B ">entity</td>
+<td valign="top" headers="N1006A ">entity</td>
 
 </tr>
 
 <tr>
-<td valign="top" headers="N10064 "><img src="../images/ADD_Notation.gif" alt="This graphic is the notation&#10;icon" /> </td>
+<td valign="top" headers="N10063 "><img src="../images/ADD_Notation.gif" alt="This graphic is the notation&#10;icon" /> </td>
 
-<td valign="top" headers="N1006B ">notation</td>
+<td valign="top" headers="N1006A ">notation</td>
 
 </tr>
 
 <tr>
-<td valign="top" headers="N10064 "> <img src="../images/ADD_Entity_Reference.gif" alt="This graphic&#10;is the parameter entity reference icon" /></td>
+<td valign="top" headers="N10063 "> <img src="../images/ADD_Entity_Reference.gif" alt="This graphic&#10;is the parameter entity reference icon" /></td>
 
-<td valign="top" headers="N1006B ">parameter entity reference</td>
+<td valign="top" headers="N1006A ">parameter entity reference</td>
 
 </tr>
 
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdkey.dita b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdkey.dita
new file mode 100644
index 0000000..6357fa4
--- /dev/null
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdkey.dita
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>

+<!--Arbortext, Inc., 1988-2006, v.4002-->

+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"

+ "reference.dtd">

+<reference id="keyboardshortcutsinthedtdeditor" xml:lang="en-us">

+<title outputclass="id_title">DTD editor keyboard shortcuts</title>

+<shortdesc outputclass="id_shortdesc"></shortdesc>

+<prolog><metadata>

+<keywords><indexterm>DTD editor<indexterm>keyboard shortcuts</indexterm></indexterm>

+<indexterm>keyboard shortcuts<indexterm>DTD editor</indexterm></indexterm>

+</keywords>

+</metadata></prolog>

+<refbody>

+<table frame="all">

+<tgroup cols="2"><colspec colname="col1" colwidth="84*"/><colspec colname="col3"

+colwidth="93*"/>

+<thead>

+<row valign="bottom">

+<entry colname="col1">Key Combination</entry>

+<entry colname="col3">Function</entry>

+</row>

+</thead>

+<tbody>

+<row>

+<entry colname="col1">Shift+Alt+Up Arrow</entry>

+<entry colname="col3">Expand selection to enclosing element</entry>

+</row>

+<row>

+<entry colname="col1">Shift+Alt+Right Arrow</entry>

+<entry colname="col3">Expand selection to next element</entry>

+</row>

+<row>

+<entry colname="col1">Shift+Alt+Left Arrow</entry>

+<entry colname="col3">Expand selection to previous element</entry>

+</row>

+<row>

+<entry colname="col1">Shift+Alt+Down Arrow</entry>

+<entry colname="col3">Restore last selection</entry>

+</row>

+<row>

+<entry colname="col1">Ctrl+Shift+P</entry>

+<entry colname="col3">Go to matching bracket</entry>

+</row>

+</tbody>

+</tgroup>

+</table>

+</refbody>

+</reference>

diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdkey.html b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdkey.html
new file mode 100644
index 0000000..1c0a656
--- /dev/null
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdkey.html
@@ -0,0 +1,94 @@
+<?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 lang="en-us" xml:lang="en-us">
+<head>
+<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta content="public" name="security" />
+<meta content="index,follow" name="Robots" />
+<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
+<meta content="reference" name="DC.Type" />
+<meta name="DC.Title" content="DTD editor keyboard shortcuts" />
+<meta name="abstract" content="" />
+<meta name="description" content="" />
+<meta content="DTD editor, keyboard shortcuts" name="DC.subject" />
+<meta content="DTD editor, keyboard shortcuts" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cworkdtds.html" />
+<meta content="XHTML" name="DC.Format" />
+<meta content="keyboardshortcutsinthedtdeditor" name="DC.Identifier" />
+<meta content="en-us" name="DC.Language" />
+<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
+<title>DTD editor keyboard shortcuts</title>
+</head>
+<body id="keyboardshortcutsinthedtdeditor"><a name="keyboardshortcutsinthedtdeditor"><!-- --></a>
+
+
+<h1 class="id_title">DTD editor keyboard shortcuts</h1>
+
+
+
+<div><p class="id_shortdesc" />
+
+
+<div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="border" border="1" rules="all">
+<thead align="left">
+<tr valign="bottom">
+<th valign="bottom" width="47.45762711864407%" id="N10068">Key Combination</th>
+
+<th valign="bottom" width="52.54237288135594%" id="N1006F">Function</th>
+
+</tr>
+
+</thead>
+
+<tbody>
+<tr>
+<td valign="top" width="47.45762711864407%" headers="N10068 ">Shift+Alt+Up Arrow</td>
+
+<td valign="top" width="52.54237288135594%" headers="N1006F ">Expand selection to enclosing element</td>
+
+</tr>
+
+<tr>
+<td valign="top" width="47.45762711864407%" headers="N10068 ">Shift+Alt+Right Arrow</td>
+
+<td valign="top" width="52.54237288135594%" headers="N1006F ">Expand selection to next element</td>
+
+</tr>
+
+<tr>
+<td valign="top" width="47.45762711864407%" headers="N10068 ">Shift+Alt+Left Arrow</td>
+
+<td valign="top" width="52.54237288135594%" headers="N1006F ">Expand selection to previous element</td>
+
+</tr>
+
+<tr>
+<td valign="top" width="47.45762711864407%" headers="N10068 ">Shift+Alt+Down Arrow</td>
+
+<td valign="top" width="52.54237288135594%" headers="N1006F ">Restore last selection</td>
+
+</tr>
+
+<tr>
+<td valign="top" width="47.45762711864407%" headers="N10068 ">Ctrl+Shift+P</td>
+
+<td valign="top" width="52.54237288135594%" headers="N1006F ">Go to matching bracket</td>
+
+</tr>
+
+</tbody>
+
+</table>
+</div>
+
+</div>
+
+<div>
+<div class="familylinks">
+<div class="parentlink"><strong>Parent topic:</strong> <a href="../topics/cworkdtds.html" title="This sections contains information on the following:">Working with DTDs</a></div>
+</div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.dita b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.dita
index ae347b4..7af8ce3 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.dita
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.dita
@@ -2,7 +2,6 @@
 <!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

-<?Pub Inc?>

 <task id="tcretdtd" xml:lang="en-us">

 <title>Creating DTDs</title>

 <titlealts>

@@ -14,15 +13,14 @@
 and notations, and how they can be used for any XML files that reference the

 DTD file.</shortdesc>

 <prolog><metadata>

-<keywords><indexterm>DTD<indexterm>creating</indexterm></indexterm></keywords>

+<keywords><indexterm>DTDs<indexterm>creating</indexterm></indexterm></keywords>

 </metadata></prolog>

 <taskbody>

-<context><p></p><p>The following instructions were written for the Resource

-perspective, but they will also work in many other perspectives.</p><p>To

-create a new DTD, complete the following steps:</p></context>

+<context><p>The following instructions were written for the Resource perspective,

+but they will also work in many other perspectives.</p><p>To create a new

+DTD, complete the following steps:</p></context>

 <steps>

-<step><cmd>Create a project to contain the DTD if needed<?Pub Caret?>.</cmd>

-</step>

+<step><cmd>Create a project to contain the DTD if needed.</cmd></step>

 <step><cmd>In the workbench, click <menucascade><uicontrol>File</uicontrol>

 <uicontrol>New</uicontrol><uicontrol>Other</uicontrol></menucascade> and select <menucascade>

 <uicontrol>XML</uicontrol><uicontrol> DTD</uicontrol></menucascade>. Click <uicontrol>Next</uicontrol>. </cmd>

@@ -45,4 +43,3 @@
 Navigator view.</p></result>

 </taskbody>

 </task>

-<?Pub *0000002420?>

diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.html b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.html
index 8bea72e..eac25f0 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.html
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Creating DTDs" />
 <meta name="abstract" content="A document type definition (DTD) contains a set of rules that can be used to validate an XML file. After you have created a DTD, you can edit it manually, adding declarations that define elements, attributes, entities, and notations, and how they can be used for any XML files that reference the DTD file." />
 <meta name="description" content="A document type definition (DTD) contains a set of rules that can be used to validate an XML file. After you have created a DTD, you can edit it manually, adding declarations that define elements, attributes, entities, and notations, and how they can be used for any XML files that reference the DTD file." />
-<meta content="DTD, creating" name="DC.subject" />
-<meta content="DTD, creating" name="keywords" />
+<meta content="DTDs, creating" name="DC.subject" />
+<meta content="DTDs, creating" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/cdtdover.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/tdtemplt.html" />
 <meta content="XHTML" name="DC.Format" />
@@ -35,16 +35,14 @@
 and notations, and how they can be used for any XML files that reference the
 DTD file.</p>
 
-<div class="section"><p />
-<p>The following instructions were written for the Resource
-perspective, but they will also work in many other perspectives.</p>
-<p>To
-create a new DTD, complete the following steps:</p>
+<div class="section"><p>The following instructions were written for the Resource perspective,
+but they will also work in many other perspectives.</p>
+<p>To create a new
+DTD, complete the following steps:</p>
 </div>
 
 <ol>
-<li class="stepexpand"><span>Create a project to contain the DTD if needed.</span>
-</li>
+<li class="stepexpand"><span>Create a project to contain the DTD if needed.</span></li>
 
 <li class="stepexpand"><span>In the workbench, click <span class="menucascade"><span class="uicontrol">File</span>
  &gt; <span class="uicontrol">New</span> &gt; <span class="uicontrol">Other</span></span> and select <span class="menucascade">
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.dita b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.dita
index a1de3ba..47a267a 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.dita
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.dita
@@ -12,7 +12,7 @@
 a certain piece of code you want to reuse several times, and you do not want

 to write it out every time.</shortdesc>

 <prolog><metadata>

-<keywords><indexterm>DTD<indexterm>creating templates</indexterm></indexterm>

+<keywords><indexterm>DTDs<indexterm>creating templates</indexterm></indexterm>

 <indexterm>templates<indexterm>DTD</indexterm></indexterm></keywords>

 </metadata></prolog>

 <taskbody>

@@ -41,7 +41,6 @@
 <postreq>You can edit, remove, import, or export a template by using the same

 preferences page. <p>If you have a template that you do not want to remove,

 but you no longer want the template to appear in the DTD templates list when

-you create a file, clear its checkbox in the templates table<?Pub Caret?>.</p></postreq>

+you create a file, clear its checkbox in the templates table.</p></postreq>

 </taskbody>

 </task>

-<?Pub *0000002424?>

diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.html b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.html
index dc3bd0d..24b1c30 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.html
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Working with DTD templates" />
 <meta name="abstract" content="Templates are a chunk of predefined code that you can insert into a DTD file when it is created. You may find a template useful when you have a certain piece of code you want to reuse several times, and you do not want to write it out every time." />
 <meta name="description" content="Templates are a chunk of predefined code that you can insert into a DTD file when it is created. You may find a template useful when you have a certain piece of code you want to reuse several times, and you do not want to write it out every time." />
-<meta content="DTD, creating templates, templates" name="DC.subject" />
-<meta content="DTD, creating templates, templates" name="keywords" />
+<meta content="DTDs, creating templates, templates, DTD" name="DC.subject" />
+<meta content="DTDs, creating templates, templates, DTD" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/tcretdtd.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="twmacro" name="DC.Identifier" />
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.dita b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.dita
index 89feb15..5442f67 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.dita
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.dita
@@ -11,7 +11,7 @@
 code is displayed in the Source view of the DTD editor, such as the colors

 the tags will be displayed in.</shortdesc>

 <prolog><metadata>

-<keywords><indexterm>DTD<indexterm>highlighting styles</indexterm></indexterm>

+<keywords><indexterm>DTDs<indexterm>highlighting styles</indexterm></indexterm>

 <indexterm>XML editor<indexterm>DTD highlighting styles</indexterm></indexterm>

 </keywords>

 </metadata></prolog>

@@ -37,7 +37,7 @@
 options. </cmd></step>

 <step><cmd>Click <uicontrol>Restore Default</uicontrol> to set the highlighting

 styles back to their default values. If you only want to reset the value for

-a particular content type, select it in the <uicontrol>Content type<?Pub Caret?></uicontrol> field,

+a particular content type, select it in the <uicontrol>Content type</uicontrol> field,

 the click the <uicontrol>Restore Default</uicontrol> button next to it. </cmd>

 </step>

 <step><cmd>Click <uicontrol>OK</uicontrol> to save your changes.</cmd></step>

@@ -45,4 +45,3 @@
 <result></result>

 </taskbody>

 </task>

-<?Pub *0000002412?>

diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.html b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.html
index d3fb9a3..817521a 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.html
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.html
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Setting source highlighting styles" />
 <meta name="abstract" content="If desired, you can change various aspects of how the DTD source code is displayed in the Source view of the DTD editor, such as the colors the tags will be displayed in." />
 <meta name="description" content="If desired, you can change various aspects of how the DTD source code is displayed in the Source view of the DTD editor, such as the colors the tags will be displayed in." />
-<meta content="DTD, highlighting styles, XML editor, DTD highlighting styles" name="DC.subject" />
-<meta content="DTD, highlighting styles, XML editor, DTD highlighting styles" name="keywords" />
+<meta content="DTDs, highlighting styles, XML editor, DTD highlighting styles" name="DC.subject" />
+<meta content="DTDs, highlighting styles, XML editor, DTD highlighting styles" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/tcretdtd.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="ttaghilt" name="DC.Identifier" />
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/timptdtd.dita b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/timptdtd.dita
index 32d7538..937590b 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/timptdtd.dita
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/timptdtd.dita
@@ -11,7 +11,7 @@
 the product, you can import them into the workbench and open them in the DTD

 editor. </shortdesc>

 <prolog><metadata>

-<keywords><indexterm>DTD<indexterm>importing</indexterm></indexterm></keywords>

+<keywords><indexterm>DTDs<indexterm>importing</indexterm></indexterm></keywords>

 </metadata></prolog>

 <taskbody>

 <context><p>To import a DTD into the workbench, complete the following steps:</p></context>

@@ -23,7 +23,7 @@
 <step><cmd>Fill in the fields in the <uicontrol>Import</uicontrol> wizard

 as necessary.</cmd></step>

 <step><cmd>Click <uicontrol>Finish</uicontrol> to exit the wizard and import

-the files<?Pub Caret?>.</cmd></step>

+the files.</cmd></step>

 <step><cmd>Select the DTD file in the Navigator view and double-click it to

 open it in the DTD editor.</cmd></step>

 </steps>

@@ -31,4 +31,3 @@
 it in the DTD editor, you can edit it manually.</p></result>

 </taskbody>

 </task>

-<?Pub *0000001456?>

diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/timptdtd.html b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/timptdtd.html
index f0f0bcd..e813eb1 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/timptdtd.html
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/timptdtd.html
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Importing DTDs" />
 <meta name="abstract" content="If you want to work with DTD files that you created outside of the product, you can import them into the workbench and open them in the DTD editor." />
 <meta name="description" content="If you want to work with DTD files that you created outside of the product, you can import them into the workbench and open them in the DTD editor." />
-<meta content="DTD, importing" name="DC.subject" />
-<meta content="DTD, importing" name="keywords" />
+<meta content="DTDs, importing" name="DC.subject" />
+<meta content="DTDs, importing" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/cworkdtds.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="timptdtd" name="DC.Identifier" />
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.dita b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.dita
index cf44931..12c7aa7 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.dita
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.dita
@@ -1,39 +1,44 @@
-<?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2006, v.4002-->

+<?xml version="1.0" encoding="UTF-8"?>

+<!--Arbortext, Inc., 1988-2008, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

+<?Pub Sty _display FontColor="red"?>

 <task id="tvaldtd" xml:lang="en-us">

 <title>Validating DTDs</title>

 <titlealts>

 <searchtitle>Validating DTDs</searchtitle>

 </titlealts>

-<shortdesc>Validating a DTD file lets you verify that it is well formed and

-does not contain any errors.</shortdesc>

+<shortdesc>Validating a DTD file lets you verify that it is well formed

+and does not contain any errors.</shortdesc>

 <prolog><metadata>

-<keywords><indexterm>DTD<indexterm>validating</indexterm></indexterm></keywords>

+<keywords><indexterm>DTD<indexterm>validating</indexterm></indexterm>

+</keywords>

 </metadata></prolog>

 <taskbody>

-<context><p>The following instructions were written for the Resource perspective,

-but they will also work in many other perspectives.&nbsp;</p><p>To validate

-a DTD, right-click the DTD in the Navigator view and click <menucascade><uicontrol>Validate

-DTD File</uicontrol></menucascade>. A dialog opens, indicating if the DTD

-file was successfully validated or not. If the file is invalid, any errors

-will appear in the Problems view. &nbsp;</p></context>

-<result><note>If you receive an error message indicating that the Problems

-view is full, you can increase the number of error messages allowed in the

-view. Click <menucascade><uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol>

-</menucascade> and select <menucascade><uicontrol>General</uicontrol><uicontrol>Markers</uicontrol>

-</menucascade>. On this preferences page you can increase or decrease the

-number of visible items in the problems view. </note><p>You can set up a project's

-properties so that different types of project resources are automatically

-validated when you save them. Right click on the project, click <uicontrol>Properties</uicontrol>,

-and select <uicontrol>Validation</uicontrol>. Any validators you can run against

-your&nbsp;project<?Pub Caret?> will be listed in the Validation page.&nbsp;</p></result>

+<context><p>The following instructions were written for the Resource

+perspective, but they will also work in many other perspectives.</p><p>To

+validate a DTD, right-click the DTD in the Navigator view and click <menucascade>

+<uicontrol>Validate</uicontrol></menucascade>. A dialog opens, indicating

+if the DTD file was successfully validated or not. If the file is

+invalid, any errors will appear in the Problems view.<?Pub Caret?></p></context>

+<result><note>If you receive an error message indicating that the

+Problems view is full, you can increase the number of error messages

+allowed in the view. Click <menucascade><uicontrol>Window</uicontrol>

+<uicontrol>Preferences</uicontrol></menucascade> and select <menucascade>

+<uicontrol>General</uicontrol><uicontrol>Markers</uicontrol>

+</menucascade>. On this preferences page you can increase or decrease

+the number of visible items in the problems view. </note><p>You can

+set up a project's properties so that different types of project resources

+are automatically validated when you save them. Right click on the

+project, click <uicontrol>Properties</uicontrol>, and select <uicontrol>Validation</uicontrol>.

+Any validators you can run against your&nbsp;project will be listed

+in the Validation page.</p></result>

 </taskbody>

 <related-links>

-<link href="../../org.eclipse.jst.j2ee.doc.user/topics/tjval.dita" scope="peer">

+<link href="../../org.eclipse.jst.j2ee.doc.user/topics/tjval.dita"

+scope="peer"><linktext>Validating code in enterprise applications</linktext>

 <desc>General validation information</desc>

 </link>

 </related-links>

 </task>

-<?Pub *0000002030?>

+<?Pub *0000002105?>

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 a785e09..2098e50 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.html
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -28,35 +28,37 @@
 
 
 
-<div><p>Validating a DTD file lets you verify that it is well formed and
-does not contain any errors.</p>
+<div><p>Validating a DTD file lets you verify that it is well formed
+and does not contain any errors.</p>
 
-<div class="section"><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives. </p>
-<p>To validate
-a DTD, right-click the DTD in the Navigator view and click <span class="menucascade"><span class="uicontrol">Validate
-DTD File</span></span>. A dialog opens, indicating if the DTD
-file was successfully validated or not. If the file is invalid, any errors
-will appear in the Problems view.  </p>
+<div class="section"><p>The following instructions were written for the Resource
+perspective, but they will also work in many other perspectives.</p>
+<p>To
+validate a DTD, right-click the DTD in the Navigator view and click <span class="menucascade">
+<span class="uicontrol">Validate</span></span>. A dialog opens, indicating
+if the DTD file was successfully validated or not. If the file is
+invalid, any errors will appear in the Problems view.</p>
 </div>
 
-<div class="section"><div class="note"><span class="notetitle">Note:</span> If you receive an error message indicating that the Problems
-view is full, you can increase the number of error messages allowed in the
-view. Click <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span>
-</span> and select <span class="menucascade"><span class="uicontrol">General</span> &gt; <span class="uicontrol">Markers</span>
-</span>. On this preferences page you can increase or decrease the
-number of visible items in the problems view. </div>
-<p>You can set up a project's
-properties so that different types of project resources are automatically
-validated when you save them. Right click on the project, click <span class="uicontrol">Properties</span>,
-and select <span class="uicontrol">Validation</span>. Any validators you can run against
-your project will be listed in the Validation page. </p>
+<div class="section"><div class="note"><span class="notetitle">Note:</span> If you receive an error message indicating that the
+Problems view is full, you can increase the number of error messages
+allowed in the view. Click <span class="menucascade"><span class="uicontrol">Window</span>
+ &gt; <span class="uicontrol">Preferences</span></span> and select <span class="menucascade">
+<span class="uicontrol">General</span> &gt; <span class="uicontrol">Markers</span>
+</span>. On this preferences page you can increase or decrease
+the number of visible items in the problems view. </div>
+<p>You can
+set up a project's properties so that different types of project resources
+are automatically validated when you save them. Right click on the
+project, click <span class="uicontrol">Properties</span>, and select <span class="uicontrol">Validation</span>.
+Any validators you can run against your project will be listed
+in the Validation page.</p>
 </div>
 
 </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><a href="../../org.eclipse.jst.j2ee.doc.user/topics/tjval.html" title="General validation information">Validating code in enterprise applications</a></div>
 </div>
 </div>
 
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 6c2c257..4491593 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,6 +2,6 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name.0
 Bundle-SymbolicName: org.eclipse.wst.html.ui.infopop; singleton:=true
-Bundle-Version: 1.0.2.qualifier
+Bundle-Version: 1.0.200.qualifier
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: plugin
diff --git a/docs/org.eclipse.wst.html.ui.infopop/about.html b/docs/org.eclipse.wst.html.ui.infopop/about.html
index 73db36e..2199df3 100644
--- a/docs/org.eclipse.wst.html.ui.infopop/about.html
+++ b/docs/org.eclipse.wst.html.ui.infopop/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/docs/org.eclipse.wst.html.ui.infopop/build.properties b/docs/org.eclipse.wst.html.ui.infopop/build.properties
index 2073406..f1a352e 100644
--- a/docs/org.eclipse.wst.html.ui.infopop/build.properties
+++ b/docs/org.eclipse.wst.html.ui.infopop/build.properties
@@ -4,5 +4,4 @@
                META-INF/,\
                EditorHtmlContexts2.xml,\
                plugin.properties
-src.includes = build.properties
-generateSourceBundle=false
\ No newline at end of file
+generateSourceBundle=false
diff --git a/docs/org.eclipse.wst.html.ui.infopop/plugin.properties b/docs/org.eclipse.wst.html.ui.infopop/plugin.properties
index a24444c..8feb9e3 100644
--- a/docs/org.eclipse.wst.html.ui.infopop/plugin.properties
+++ b/docs/org.eclipse.wst.html.ui.infopop/plugin.properties
@@ -1,3 +1,3 @@
 # properties file for org.eclipse.wst.html.ui.infopop
-Bundle-Vendor.0 = Eclipse.org
+Bundle-Vendor.0 = Eclipse Web Tools Platform
 Bundle-Name.0 = HTML editor infopops
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/DocBuild.xml b/docs/org.eclipse.wst.sse.doc.user/DocBuild.xml
index d8406e0..1a18684 100644
--- a/docs/org.eclipse.wst.sse.doc.user/DocBuild.xml
+++ b/docs/org.eclipse.wst.sse.doc.user/DocBuild.xml
@@ -21,7 +21,9 @@
 	ChangeLog:
 	2006-04-05 Arthur Ryman <ryman@ca.ibm.com>
 	- Created.
-
+	2008-05-05 Kate Price <katep@ca.ibm.com>
+	- modified to add generation of pre-built help index. 
+	- Must delete /index folder before running build
 -->
 <project name="eclipsehelp" default="all">
 
@@ -44,16 +46,19 @@
 	<target name="eclipsehelp">
 		<ant antfile="${dita.ot.dir}${file.separator}conductor.xml" target="init" dir="${dita.ot.dir}">
 			<property name="args.copycss" value="no" />
-			<property name="args.csspath" value="org.eclipse.wst.doc.user" />
+			<property name="args.csspath" value="../org.eclipse.wst.doc.user" />
 			<property name="args.eclipse.provider" value="Eclipse.org" />
-			<property name="args.eclipse.version" value="1.5.0" />
+			<property name="args.eclipse.version" value="3.3.0" />
 			<property name="args.input" location="sse_toc.ditamap" />    		
 			<property name="clean.temp" value="true" />
 			<property name="dita.extname" value=".dita" />
 			<property name="dita.temp.dir" location="temp" />
-			<property name="output.dir" location=".." />
+			<property name="output.dir" location="" />
 			<property name="transtype" value="eclipsehelp" />
 		</ant>
 		<copy file="myplugin.xml" tofile="plugin.xml" overwrite="yes" />
 	</target>
+	<target name="build.index" description="Builds search index for the plug-in" if="eclipse.running">
+	     <help.buildHelpIndex manifest="plugin.xml" destination="."/>
+	</target>
 </project>
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 8192061..7da11f9 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: %Bundle-Name.0
 Bundle-SymbolicName: org.eclipse.wst.sse.doc.user; singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.1.100.qualifier
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: plugin
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/docs/org.eclipse.wst.sse.doc.user/about.html b/docs/org.eclipse.wst.sse.doc.user/about.html
index 73db36e..2199df3 100644
--- a/docs/org.eclipse.wst.sse.doc.user/about.html
+++ b/docs/org.eclipse.wst.sse.doc.user/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/docs/org.eclipse.wst.sse.doc.user/build.properties b/docs/org.eclipse.wst.sse.doc.user/build.properties
index 950d643..eec0c0d 100644
--- a/docs/org.eclipse.wst.sse.doc.user/build.properties
+++ b/docs/org.eclipse.wst.sse.doc.user/build.properties
@@ -7,10 +7,9 @@
                index/,\
                META-INF/,\
                plugin.properties
-src.includes = build.properties,\
-		       *.maplist,\
+src.includes = *.maplist,\
                *.ditamap,\
-		       topics/*.dita
+               topics/*.dita
 bin.excludes = DocBuild.xml,\
                myPlugin*.xml
                
diff --git a/docs/org.eclipse.wst.sse.doc.user/index/_p.cfs b/docs/org.eclipse.wst.sse.doc.user/index/_p.cfs
index ac3ffd2..ca41649 100644
--- a/docs/org.eclipse.wst.sse.doc.user/index/_p.cfs
+++ b/docs/org.eclipse.wst.sse.doc.user/index/_p.cfs
Binary files differ
diff --git a/docs/org.eclipse.wst.sse.doc.user/index/deletable b/docs/org.eclipse.wst.sse.doc.user/index/deletable
index e423242..593f470 100644
--- a/docs/org.eclipse.wst.sse.doc.user/index/deletable
+++ b/docs/org.eclipse.wst.sse.doc.user/index/deletable
Binary files differ
diff --git a/docs/org.eclipse.wst.sse.doc.user/index/indexed_contributions b/docs/org.eclipse.wst.sse.doc.user/index/indexed_contributions
index 1207a6c..6ba76dc 100644
--- a/docs/org.eclipse.wst.sse.doc.user/index/indexed_contributions
+++ b/docs/org.eclipse.wst.sse.doc.user/index/indexed_contributions
@@ -1,3 +1,3 @@
 #This is a generated file; do not edit.

-#Wed May 09 14:15:03 EDT 2007

-org.eclipse.wst.sse.doc.user=org.eclipse.wst.sse.doc.user\n1.0.300.qualifier

+#Wed May 14 18:56:03 EDT 2008

+org.eclipse.wst.sse.doc.user=org.eclipse.wst.sse.doc.user\n1.1.0.qualifier

diff --git a/docs/org.eclipse.wst.sse.doc.user/index/indexed_dependencies b/docs/org.eclipse.wst.sse.doc.user/index/indexed_dependencies
index 2810719..d2c7a64 100644
--- a/docs/org.eclipse.wst.sse.doc.user/index/indexed_dependencies
+++ b/docs/org.eclipse.wst.sse.doc.user/index/indexed_dependencies
@@ -1,4 +1,4 @@
 #This is a generated file; do not edit.

-#Wed May 09 14:15:03 EDT 2007

-lucene=1.4.103.v20060601

-analyzer=org.eclipse.help.base\#3.2.0.v20060601?locale\=en

+#Wed May 14 18:56:03 EDT 2008

+lucene=1.9.1.v200803061811

+analyzer=org.eclipse.help.base\#3.3.100.v20080425?locale\=en

diff --git a/docs/org.eclipse.wst.sse.doc.user/index/indexed_docs b/docs/org.eclipse.wst.sse.doc.user/index/indexed_docs
index ef97094..885cd48 100644
--- a/docs/org.eclipse.wst.sse.doc.user/index/indexed_docs
+++ b/docs/org.eclipse.wst.sse.doc.user/index/indexed_docs
@@ -1,5 +1,5 @@
 #This is a generated file; do not edit.

-#Wed May 09 14:15:03 EDT 2007

+#Wed May 14 18:56:03 EDT 2008

 /org.eclipse.wst.sse.doc.user/topics/tsrcedt028.html=0

 /org.eclipse.wst.sse.doc.user/topics/tsrcedt014.html=0

 /org.eclipse.wst.sse.doc.user/topics/tcontenttype.html=0

diff --git a/docs/org.eclipse.wst.sse.doc.user/index/segments b/docs/org.eclipse.wst.sse.doc.user/index/segments
index 19b5d0c..2d63c4c 100644
--- a/docs/org.eclipse.wst.sse.doc.user/index/segments
+++ b/docs/org.eclipse.wst.sse.doc.user/index/segments
Binary files differ
diff --git a/docs/org.eclipse.wst.sse.doc.user/myplugin.xml b/docs/org.eclipse.wst.sse.doc.user/myplugin.xml
index a994293..8255056 100644
--- a/docs/org.eclipse.wst.sse.doc.user/myplugin.xml
+++ b/docs/org.eclipse.wst.sse.doc.user/myplugin.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
+<?eclipse version="3.6"?>
+<?NLS TYPE="org.eclipse.help.toc"?> 
 <!-- /*******************************************************************************
  * Copyright (c) 2001, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
@@ -19,11 +20,11 @@
 <plugin>
 
     <extension point="org.eclipse.help.toc">
-      <toc file="sse_toc.xml">
+      <toc file="sse_toc.xml"/>
        <index path="index/"/>
-      </toc>
    </extension>
 	<extension point="org.eclipse.help.index">
       <index file="org.eclipse.wst.sse.doc.userindex.xml"/>
 </extension>
+
 </plugin>
diff --git a/docs/org.eclipse.wst.sse.doc.user/org.eclipse.wst.sse.doc.userindex.xml b/docs/org.eclipse.wst.sse.doc.user/org.eclipse.wst.sse.doc.userindex.xml
index 02d9209..9723ac5 100644
--- a/docs/org.eclipse.wst.sse.doc.user/org.eclipse.wst.sse.doc.userindex.xml
+++ b/docs/org.eclipse.wst.sse.doc.user/org.eclipse.wst.sse.doc.userindex.xml
@@ -4,12 +4,16 @@
     <entry keyword="overview">
       <topic href="topics/csrcedt004.html#csrcedt004" title="Structured text editors for markup languages"/>
     </entry>
-    <entry keyword="preference setting">
+    <entry keyword="preferences">
       <topic href="topics/tsrcedt025.html#tsrcedt025" title="Setting preferences for structured text editors"/>
     </entry>
     <entry keyword="content assistance">
-      <topic href="topics/tsrcedt005.html#tsrcedt005" title="Getting content assistance in structured text editors"/>
-      <topic href="topics/csrcedt006.html#csrcedt006" title="Content assist"/>
+      <entry keyword="text editors">
+        <topic href="topics/tsrcedt005.html#tsrcedt005" title="Getting content assistance in structured text editors"/>
+      </entry>
+      <entry keyword="overview">
+        <topic href="topics/csrcedt006.html#csrcedt006" title="Content assist"/>
+      </entry>
     </entry>
     <entry keyword="text search">
       <topic href="topics/tsrcedt007.html#tsrcedt007" title="Searching or finding text within a file"/>
@@ -52,11 +56,11 @@
     </entry>
   </entry>
   <entry keyword="validation">
-    <entry keyword="source vs batch">
+    <entry keyword="source versus batch">
       <topic href="topics/cvalidate.html#csrcedt001" title="Source and batch validation"/>
     </entry>
   </entry>
-  <entry keyword="annotation preferences">
+  <entry keyword="annotations">
     <entry keyword="markup language settings">
       <topic href="topics/tsrcedt001.html#tsrcedt001" title="Setting annotation preferences for markup languages"/>
     </entry>
@@ -79,6 +83,9 @@
     <entry keyword="character encoding">
       <topic href="topics/cencoding.html#cencoding" title="File Encoding"/>
     </entry>
+    <entry keyword="templates">
+      <topic href="topics/tsrcedt028.html#tsrcedt028" title="Adding and removing JSP templates"/>
+    </entry>
   </entry>
   <entry keyword="content types">
     <entry keyword="mapping file extensions">
@@ -109,6 +116,9 @@
     <entry keyword="character encoding">
       <topic href="topics/cencoding.html#cencoding" title="File Encoding"/>
     </entry>
+    <entry keyword="adding templates">
+      <topic href="topics/tsrcedt029.html#tsrcedt027" title="Adding and removing XML templates"/>
+    </entry>
   </entry>
   <entry keyword="spell check">
     <entry keyword="structured text editors">
@@ -125,16 +135,6 @@
       </entry>
     </entry>
   </entry>
-  <entry keyword="JSP pages">
-    <entry keyword="templates">
-      <topic href="topics/tsrcedt028.html#tsrcedt028" title="Adding and removing JSP templates"/>
-    </entry>
-  </entry>
-  <entry keyword="xml templates">
-    <entry keyword="adding">
-      <topic href="topics/tsrcedt029.html#tsrcedt027" title="Adding and removing XML templates"/>
-    </entry>
-  </entry>
   <entry keyword="snippets">
     <entry keyword="overview">
       <topic href="topics/tsrcedt026.html#tsrcedt026" title="Editing with snippets - overview"/>
@@ -142,6 +142,9 @@
     <entry keyword="drawer customization">
       <topic href="topics/tsrcedt014.html#tsrcedt014" title="Adding snippets drawers"/>
     </entry>
+    <entry keyword="drawers">
+      <topic href="topics/tsrcedt015.html#tsrcedt015" title="Adding items to snippets drawers"/>
+    </entry>
     <entry keyword="editing items">
       <topic href="topics/tsrcedt022.html#tsrcedt022" title="Editing snippet items"/>
     </entry>
@@ -154,16 +157,6 @@
       <topic href="topics/csrcedt001.html#csrcedt001" title="Snippets view"/>
     </entry>
   </entry>
-  <entry keyword="snippet drawers">
-    <entry keyword="adding items">
-      <topic href="topics/tsrcedt015.html#tsrcedt015" title="Adding items to snippets drawers"/>
-    </entry>
-  </entry>
-  <entry keyword="snippet items">
-    <entry keyword="adding to drawers">
-      <topic href="topics/tsrcedt015.html#tsrcedt015" title="Adding items to snippets drawers"/>
-    </entry>
-  </entry>
   <entry keyword="drawers">
     <entry keyword="snippets view">
       <topic href="topics/tsrcedt016.html#tsrcedt016" title="Deleting or hiding snippet items or drawers"/>
diff --git a/docs/org.eclipse.wst.sse.doc.user/plugin.properties b/docs/org.eclipse.wst.sse.doc.user/plugin.properties
index d97c2f1..426f3b7 100644
--- a/docs/org.eclipse.wst.sse.doc.user/plugin.properties
+++ b/docs/org.eclipse.wst.sse.doc.user/plugin.properties
@@ -1,3 +1,3 @@
 # properties file for org.eclipse.wst.sse.doc.user
-Bundle-Vendor.0 = Eclipse.org
+Bundle-Vendor.0 = Eclipse Web Tools Platform
 Bundle-Name.0 = Structured text editor and snippets documentation
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/plugin.xml b/docs/org.eclipse.wst.sse.doc.user/plugin.xml
index ebbb6bd..8255056 100644
--- a/docs/org.eclipse.wst.sse.doc.user/plugin.xml
+++ b/docs/org.eclipse.wst.sse.doc.user/plugin.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
+<?eclipse version="3.6"?>
+<?NLS TYPE="org.eclipse.help.toc"?> 
 <!-- /*******************************************************************************
  * Copyright (c) 2001, 2007 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
@@ -21,8 +22,9 @@
     <extension point="org.eclipse.help.toc">
       <toc file="sse_toc.xml"/>
        <index path="index/"/>
-       </extension>
+   </extension>
 	<extension point="org.eclipse.help.index">
       <index file="org.eclipse.wst.sse.doc.userindex.xml"/>
 </extension>
+
 </plugin>
diff --git a/docs/org.eclipse.wst.sse.doc.user/sse_toc.ditamap b/docs/org.eclipse.wst.sse.doc.user/sse_toc.ditamap
index 90bc751..f80b59b 100644
--- a/docs/org.eclipse.wst.sse.doc.user/sse_toc.ditamap
+++ b/docs/org.eclipse.wst.sse.doc.user/sse_toc.ditamap
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN"

  "map.dtd">

 <map id="wstssetoc" linking="none" title="Editing text coded in markup languages - overview">

@@ -50,6 +50,8 @@
 <topicref href="topics/tsrcedt016.dita" navtitle="Deleting or hiding snippet items or drawers"

 type="task"></topicref>

 </topicref>

+<topicref href="../org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.dita"

+navtitle="Source editor keyboard shortcuts" scope="peer"></topicref>

 </topicref>

 </topicref>

 </map>

diff --git a/docs/org.eclipse.wst.sse.doc.user/sse_toc.xml b/docs/org.eclipse.wst.sse.doc.user/sse_toc.xml
index 36f3b7f..f153618 100644
--- a/docs/org.eclipse.wst.sse.doc.user/sse_toc.xml
+++ b/docs/org.eclipse.wst.sse.doc.user/sse_toc.xml
@@ -1,42 +1,35 @@
-<?xml version="1.0" encoding="utf-8"?>
-<?NLS type="org.eclipse.help.contexts"?>
-<!-- /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
-<toc label="Structured text editors" topics="topics/csrcedt004.html">
-   <topic label="Structured text editors" href="topics/csrcedt004.html">
-      <topic label="Editing text coded in markup languages " href="topics/tsrcedt000.html">
-         <topic label="Source and batch validation" href="topics/cvalidate.html"/>
-         <topic label="Setting preferences for structured text editors" href="topics/tsrcedt025.html">
-            <topic label="Setting annotation preferences for markup languages" href="topics/tsrcedt001.html"/>
-         </topic>
-         <topic label="Getting content assistance in structured text editors" href="topics/tsrcedt005.html">
-            <topic label="Content assist" href="topics/csrcedt006.html"/>
-            <topic label="Making content assist work for JSP files" href="topics/tsrcedt023.html"/>
-         </topic>
-         <topic label="Associating editors with file types" href="topics/tcontenttype.html"/>
-         <topic label="File Encoding" href="topics/cencoding.html"/>
-         <topic label="Searching or finding text within a file" href="topics/tsrcedt007.html"/>
-         <topic label="Checking spelling" href="topics/tsrcedt010.html"/>
-         <topic label="Adding and removing markup language templates - overview" href="topics/tsrcedt027.html">
-            <topic label="Adding and removing HTML templates" href="topics/tsrcedt024.html"/>
-            <topic label="Adding and removing JSP templates" href="topics/tsrcedt028.html"/>
-            <topic label="Adding and removing XML templates" href="topics/tsrcedt029.html"/>
-         </topic>
-         <topic label="Editing with snippets - overview" href="topics/tsrcedt026.html">
-            <topic label="Snippets view" href="topics/csrcedt001.html"/>
-            <topic label="Adding snippets drawers" href="topics/tsrcedt014.html"/>
-            <topic label="Adding items to snippets drawers" href="topics/tsrcedt015.html"/>
-            <topic label="Editing snippet items" href="topics/tsrcedt022.html"/>
-            <topic label="Deleting or hiding snippet items or drawers" href="topics/tsrcedt016.html"/>
-         </topic>
-      </topic>
-   </topic>
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Editing text coded in markup languages - overview" topic="topics/csrcedt004.html">
+<topic label="Structured text editors" href="topics/csrcedt004.html">
+<topic label="Editing text coded in markup languages " href="topics/tsrcedt000.html">
+<topic label="Source and batch validation" href="topics/cvalidate.html"/>
+<topic label="Setting preferences for structured text editors" href="topics/tsrcedt025.html">
+<topic label="Setting annotation preferences for markup languages" href="topics/tsrcedt001.html"/>
+</topic>
+<topic label="Getting content assistance in structured text editors" href="topics/tsrcedt005.html">
+<topic label="Content assist" href="topics/csrcedt006.html"/>
+<topic label="Making content assist work for JSP files" href="topics/tsrcedt023.html"/>
+</topic>
+<topic label="Associating editors with file types" href="topics/tcontenttype.html"/>
+<topic label="File Encoding" href="topics/cencoding.html"/>
+<topic label="Searching or finding text within a file" href="topics/tsrcedt007.html"/>
+<topic label="Checking spelling" href="topics/tsrcedt010.html"/>
+<topic label="Adding and removing markup language templates - overview" href="topics/tsrcedt027.html">
+<topic label="Adding and removing HTML templates" href="topics/tsrcedt024.html"/>
+<topic label="Adding and removing JSP templates" href="topics/tsrcedt028.html"/>
+<topic label="Adding and removing XML templates" href="topics/tsrcedt029.html"/>
+</topic>
+<topic label="Editing with snippets - overview" href="topics/tsrcedt026.html">
+<topic label="Snippets view" href="topics/csrcedt001.html"/>
+<topic label="Adding snippets drawers" href="topics/tsrcedt014.html"/>
+<topic label="Adding items to snippets drawers" href="topics/tsrcedt015.html"/>
+<topic label="Editing snippet items" href="topics/tsrcedt022.html"/>
+<topic label="Deleting or hiding snippet items or drawers" href="topics/tsrcedt016.html"/>
+</topic>
+<topic label="Source editor keyboard shortcuts" href="../org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.html"/>
+</topic>
+</topic>
 </toc>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/cencoding.html b/docs/org.eclipse.wst.sse.doc.user/topics/cencoding.html
index a63fabd..1b63f4d 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/cencoding.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/cencoding.html
@@ -1,40 +1,56 @@
-<?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">
+<?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 lang="en-us" xml:lang="en-us">
 <head>
-<!-- /*******************************************************************************
- * 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
- *******************************************************************************/ -->
-<link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css" />
+<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta content="public" name="security" />
+<meta content="index,follow" name="Robots" />
+<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
+<meta content="concept" name="DC.Type" />
+<meta name="DC.Title" content="File Encoding" />
+<meta name="abstract" content="" />
+<meta name="description" content="" />
+<meta content="character encoding, location in files, JSP files, XHTML, XML" name="DC.subject" />
+<meta content="character encoding, location in files, JSP files, XHTML, XML" name="keywords" />
+<meta content="XHTML" name="DC.Format" />
+<meta content="cencoding" name="DC.Identifier" />
+<meta content="en-us" name="DC.Language" />
+<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
 <title>File Encoding</title>
 </head>
 <body id="cencoding"><a name="cencoding"><!-- --></a>
+
+
 <h1 class="topictitle1">File Encoding</h1>
-<div><p></p>
+
+
+
+<div><p />
+
 <p> The character encoding in XML, (X)HTML files, and JSP files can be specified
 and invoked in many different ways; however, we recommend that you specify
 the encoding in each one of your source files, for that is where many XML,
 HTML, JSP editors expect to find the encoding.</p>
+
 <div class="p">For example, for JSP files, you might use the pageEncoding attribute and/or
 the contentType attribute in the page directive, as shown in the following
 example:<pre>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
-    pageEncoding="ISO-8859-1"%&gt;</pre>
+    pageEncoding="ISO-8859-1"%&gt;
+</pre>
 </div>
+
 <div class="p">For XML files, you might use the encoding pseudo-attribute in the xml declaration
 at the start of a document or the text declaration at the start of an entity,
 as in the following example: <pre>&lt;?xml version="1.0" encoding="iso-8859-1" ?&gt;</pre>
 </div>
+
 <div class="p">For (X)HTML files, you might use the &lt;meta&gt; tag inside the &lt;head&gt;
 tags, as shown in the following example:<pre>&lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8" /&gt;</pre>
 </div>
+
 </div>
+
+
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt001.html b/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt001.html
index a37e9de..0d53f9d 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt001.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt001.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt004.dita b/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt004.dita
index de02cbe..2528094 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt004.dita
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt004.dita
@@ -1,27 +1,28 @@
-<?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<?xml version="1.0" encoding="UTF-8"?>

+<!--Arbortext, Inc., 1988-2009, v.4002-->

 <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"

  "..\dtd\concept.dtd">

+<?Pub Sty _display FontColor="red"?>

 <concept id="csrcedt004" xml:lang="en-us">

 <title>Structured text editors for markup languages</title>

 <titlealts>

 <navtitle>Structured text editors</navtitle>

 </titlealts>

-<shortdesc><q>Structured text editor</q> is any of several text editors that

-you can use to edit various markup languages such as HTML, JavaScript, or

-XML.</shortdesc>

+<shortdesc><q>Structured text editor</q> is any of several text editors

+that you can use to edit various markup languages such as HTML, JavaScript,

+or XML.</shortdesc>

 <prolog><metadata>

 <keywords><keyword>source editors</keyword></keywords>

 </metadata></prolog>

 <conbody>

-<p><indexterm>structured text editors<indexterm>overview</indexterm></indexterm>

-<indexterm>templates<indexterm>structured text editors</indexterm></indexterm>

-

-The structured text editor is represented by various editors that you can

-use to edit files coded with markup tags:</p>

+<p><indexterm>structured text editors<indexterm>overview</indexterm></indexterm> <indexterm>templates<indexterm>structured

+text editors</indexterm></indexterm>  The structured text editor is

+represented by various editors that you can use to edit files coded

+with markup tags:</p>

 <table>

-<tgroup cols="3"><colspec colname="col1" colwidth="89*"/><colspec colname="col2"

-colwidth="134*"/><colspec colname="COLSPEC0" colwidth="69*"/>

+<tgroup cols="3"><colspec colname="col1" colwidth="89*"/><colspec

+colname="col2" colwidth="134*"/><colspec colname="COLSPEC0"

+colwidth="69*"/>

 <thead>

 <row>

 <entry colname="col1" valign="top">File type</entry>

@@ -46,11 +47,11 @@
 <entry colname="COLSPEC0">Yes</entry>

 </row>

 <row>

-<entry colname="col1"><tm tmclass="special" tmowner="Sun Microsystems, Inc."

-tmtype="tm" trademark="JavaScript">JavaScript</tm></entry>

-<entry colname="col2"><tm tmclass="special" tmowner="Sun Microsystems, Inc."

-tmtype="tm" trademark="JavaScript">JavaScript</tm> source page editor or source

-tab of JavaScript editor</entry>

+<entry colname="col1"><tm tmclass="special"

+tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="JavaScript">JavaScript</tm></entry>

+<entry colname="col2"><tm tmclass="special"

+tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="JavaScript">JavaScript</tm> source

+page editor or source tab of JavaScript editor</entry>

 <entry colname="COLSPEC0">Yes</entry>

 </row>

 <row>

@@ -71,48 +72,57 @@
 </tbody>

 </tgroup>

 </table>

-<p>You can access the structured text editor by right-clicking on a relevant

-file name in Navigator or Package Explorer view and then clicking <uicontrol>Open

-With</uicontrol> and selecting the editor mentioned above.</p>

-<p>The structured text editor provides a consistent interface regardless of

-the markup language with which it is associated. It provides capabilities

-such as find and replace, undo, redo, a spelling checker, and coding assistance

-(unless otherwise noted). It also highlights syntax in different colors. Following

-is a brief description of some of the structured text editor's capabilities:</p>

+<p>You can access the structured text editor by right-clicking on

+a relevant file name in Navigator or Package Explorer view and then

+clicking <uicontrol>Open With</uicontrol> and selecting the editor

+mentioned above.</p>

+<p>The structured text editor provides a consistent interface regardless

+of the markup language with which it is associated. It provides capabilities

+such as find and replace, undo, redo, a spelling checker, and coding

+assistance (unless otherwise noted). It also highlights syntax in

+different colors. Following is a brief description of some of the

+structured text editor's capabilities:</p>

 <dl><dlentry>

 <dt>syntax highlighting</dt>

-<dd>Each keyword type and syntax type is highlighted differently, enabling

-you to easily find a certain kind of keyword for editing. For example, in

-HTML, element names, attribute names, attribute values, and comments have

-different colors; in <tm tmclass="special" tmowner="Sun Microsystems, Inc."

-tmtype="tm" trademark="JavaScript">JavaScript</tm>, function and variable

-names, quoted text strings, and comments have different colors.</dd>

+<dd>Each keyword type and syntax type is highlighted differently,

+enabling you to easily find a certain kind of keyword for editing.

+For example, in HTML, element names, attribute names, attribute values,

+and comments have different colors; in <tm tmclass="special"

+tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="JavaScript">JavaScript</tm>,

+function and variable names, quoted text strings, and comments have

+different colors.</dd>

 </dlentry><dlentry>

 <dt>unlimited undo and redo</dt>

-<dd>These options allow you to incrementally undo and redo every change made

-to a file for the entire editing session. For text, changes are incremented

-one character or set of selected characters at a time.</dd>

+<dd>These options allow you to incrementally undo and redo every change

+made to a file for the entire editing session. For text, changes are

+incremented one character or set of selected characters at a time.</dd>

 </dlentry><dlentry>

 <dt>content assist</dt>

-<dd>Content assist helps you to insert <tm tmclass="special" tmowner="Sun Microsystems, Inc."

-tmtype="tm" trademark="JavaScript">JavaScript</tm> functions, HTML tags, or

-other keywords. Choices available in the content assist list are based on

-functions defined by the syntax of the language in which the file is coded.</dd>

+<dd>Content assist helps you to insert <tm tmclass="special"

+tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="JavaScript">JavaScript</tm> functions,

+HTML tags, or other keywords. Choices available in the content assist

+list are based on functions defined by the syntax of the language

+in which the file is coded.</dd>

 </dlentry><dlentry>

 <dt>user-defined templates and snippets</dt>

 <dd>By using the Snippets view, you can access user-defined code snippets

-and (for all code types except <tm tmclass="special" tmowner="Sun Microsystems, Inc."

-tmtype="tm" trademark="JavaScript">JavaScript</tm>) templates to help you

-quickly add regularly used text strings.</dd>

+and (for all code types except <tm tmclass="special"

+tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="JavaScript">JavaScript</tm>)

+templates to help you quickly add regularly used text strings.</dd>

 </dlentry><dlentry>

 <dt>function selection</dt>

-<dd>Based on the location of your cursor, the function or tag selection indicator

-highlights the line numbers that include a function or tag in the vertical

-ruler on the left area of the Source page.</dd>

+<dd>Based on the location of your cursor, the function or tag selection

+indicator highlights the line numbers that include a function or tag

+in the vertical ruler on the left area of the Source page.</dd>

 </dlentry><dlentry>

 <dt>pop-up menu options</dt>

 <dd>These are the same editing options available in the workbench <uicontrol>Edit</uicontrol> menu.</dd>

-</dlentry></dl>

+</dlentry><dlentry>

+<dt>code folding</dt>

+<dd>Code folding allows collapsing and expanding of text and can be

+accessed by the <uicontrol>Folding</uicontrol> option in the pop-up

+menu.</dd>

+</dlentry></dl><?Pub Caret 1471?>

 </conbody>

 <related-links>

 <linkpool type="concept">

@@ -123,3 +133,4 @@
 </linkpool>

 </related-links>

 </concept>

+<?Pub *0000005543?>

diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt004.html b/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt004.html
index ec3d55e..eec0867 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt004.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt004.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -35,6 +35,7 @@
 
 <p>
 
+
 The structured text editor is represented by various editors that you can
 use to edit files coded with markup tags:</p>
 
@@ -42,11 +43,11 @@
 <div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="border" border="1" rules="all">
 <thead align="left">
 <tr>
-<th valign="top" width="30.47945205479452%" id="N1008A">File type</th>
+<th valign="top" width="30.47945205479452%" id="N10086">File type</th>
 
-<th valign="top" width="45.89041095890411%" id="N10092">Editor</th>
+<th valign="top" width="45.89041095890411%" id="N1008E">Editor</th>
 
-<th valign="top" width="23.63013698630137%" id="N1009A">Content assist?</th>
+<th valign="top" width="23.63013698630137%" id="N10096">Content assist?</th>
 
 </tr>
 
@@ -54,66 +55,66 @@
 
 <tbody>
 <tr>
-<td valign="top" width="30.47945205479452%" headers="N1008A ">Cascading style sheet</td>
+<td valign="top" width="30.47945205479452%" headers="N10086 ">Cascading style sheet</td>
 
-<td valign="top" width="45.89041095890411%" headers="N10092 ">CSS source page editor</td>
+<td valign="top" width="45.89041095890411%" headers="N1008E ">CSS source page editor</td>
 
-<td valign="top" width="23.63013698630137%" headers="N1009A ">Yes</td>
+<td valign="top" width="23.63013698630137%" headers="N10096 ">Yes</td>
 
 </tr>
 
 <tr>
-<td valign="top" width="30.47945205479452%" headers="N1008A ">Document type definitions</td>
+<td valign="top" width="30.47945205479452%" headers="N10086 ">Document type definitions</td>
 
-<td valign="top" width="45.89041095890411%" headers="N10092 ">DTD source page editor</td>
+<td valign="top" width="45.89041095890411%" headers="N1008E ">DTD source page editor</td>
 
-<td valign="top" width="23.63013698630137%" headers="N1009A ">No</td>
+<td valign="top" width="23.63013698630137%" headers="N10096 ">No</td>
 
 </tr>
 
 <tr>
-<td valign="top" width="30.47945205479452%" headers="N1008A ">HTML</td>
+<td valign="top" width="30.47945205479452%" headers="N10086 ">HTML</td>
 
-<td valign="top" width="45.89041095890411%" headers="N10092 ">HTML source page editor</td>
+<td valign="top" width="45.89041095890411%" headers="N1008E ">HTML source page editor</td>
 
-<td valign="top" width="23.63013698630137%" headers="N1009A ">Yes</td>
+<td valign="top" width="23.63013698630137%" headers="N10096 ">Yes</td>
 
 </tr>
 
 <tr>
-<td valign="top" width="30.47945205479452%" headers="N1008A ">JavaScript™</td>
+<td valign="top" width="30.47945205479452%" headers="N10086 ">JavaScript™</td>
 
-<td valign="top" width="45.89041095890411%" headers="N10092 ">JavaScript source page editor or source
+<td valign="top" width="45.89041095890411%" headers="N1008E ">JavaScript source page editor or source
 tab of JavaScript editor</td>
 
-<td valign="top" width="23.63013698630137%" headers="N1009A ">Yes</td>
+<td valign="top" width="23.63013698630137%" headers="N10096 ">Yes</td>
 
 </tr>
 
 <tr>
-<td valign="top" width="30.47945205479452%" headers="N1008A ">JSP</td>
+<td valign="top" width="30.47945205479452%" headers="N10086 ">JSP</td>
 
-<td valign="top" width="45.89041095890411%" headers="N10092 ">JSP source page editor</td>
+<td valign="top" width="45.89041095890411%" headers="N1008E ">JSP source page editor</td>
 
-<td valign="top" width="23.63013698630137%" headers="N1009A ">Yes</td>
+<td valign="top" width="23.63013698630137%" headers="N10096 ">Yes</td>
 
 </tr>
 
 <tr>
-<td valign="top" width="30.47945205479452%" headers="N1008A ">XML</td>
+<td valign="top" width="30.47945205479452%" headers="N10086 ">XML</td>
 
-<td valign="top" width="45.89041095890411%" headers="N10092 ">Source tab of XML editor</td>
+<td valign="top" width="45.89041095890411%" headers="N1008E ">Source tab of XML editor</td>
 
-<td valign="top" width="23.63013698630137%" headers="N1009A ">Yes</td>
+<td valign="top" width="23.63013698630137%" headers="N10096 ">Yes</td>
 
 </tr>
 
 <tr>
-<td valign="top" width="30.47945205479452%" headers="N1008A ">XSD (schema)</td>
+<td valign="top" width="30.47945205479452%" headers="N10086 ">XSD (schema)</td>
 
-<td valign="top" width="45.89041095890411%" headers="N10092 ">Source tab of XML schema editor</td>
+<td valign="top" width="45.89041095890411%" headers="N1008E ">Source tab of XML schema editor</td>
 
-<td valign="top" width="23.63013698630137%" headers="N1009A ">Yes</td>
+<td valign="top" width="23.63013698630137%" headers="N10096 ">Yes</td>
 
 </tr>
 
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt006.dita b/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt006.dita
index 79203a5..2dbfe9d 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt006.dita
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt006.dita
@@ -9,8 +9,9 @@
 in the source file provides the context for the content assist to offer suggestions

 for completion.</shortdesc>

 <prolog><metadata>

-<keywords><indexterm>content assistance<indexterm>overview</indexterm></indexterm>

-<indexterm>structured text editors<indexterm>content assistance</indexterm></indexterm>

+<keywords><indexterm keyref="csrcedt006|1|contentassistanceoverview" status="new">content

+assistance<indexterm>overview</indexterm></indexterm><indexterm keyref="csrcedt006|2|structuredtexteditorscontentassistance"

+status="changed">structured text editors<indexterm>content assistance<indexterm>overview</indexterm></indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <conbody>

@@ -65,16 +66,16 @@
 tmtype="tm" trademark="Java">Java</tm> VM to terminate. Instead of double-clicking

 on the list, use the arrows and Enter keys to make the selection from the

 list.</note></section>

-<section><?Pub Caret1?><title>JSP content assist</title><p>You have many options

-for embedding <tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm"

-trademark="Java">Java</tm> and HTML code in your JSP pages by using content

-assist.</p><p>All of the JSP tags are included both in the template list and

-in XML format (for example, <codeph>&lt;jsp:expression></codeph>). To add

-JSP scriptlet tags, for example, move the cursor to the appropriate position

-in the file and press Ctrl+Space to use content assist. Select <image alt="JSP scriptlet content assist"

-href="../images/nmacscrp.gif" placement="inline"></image> from the proposal

-list to insert <codeph>&lt;% %></codeph>  in the document.</p><p>Scriptlets

-are inserted in a tag <codeph>&lt;% %></codeph>. For example: <codeblock>&lt;% System.currentTimeMillis() %></codeblock></p><p>This

+<section><title>JSP content assist</title><p>You have many options for embedding <tm

+tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> and

+HTML code in your JSP pages by using content assist.</p><p>All of the JSP

+tags are included both in the template list and in XML format (for example, <codeph>&lt;jsp:expression></codeph>).

+To add JSP scriptlet tags, for example, move the cursor to the appropriate

+position in the file and press Ctrl+Space to use content assist. Select <image

+alt="JSP scriptlet content assist" href="../images/nmacscrp.gif" placement="inline">

+</image> from the proposal list to insert <codeph>&lt;% %></codeph>  in the

+document.</p><p>Scriptlets are inserted in a tag <codeph>&lt;% %></codeph>.

+For example: <codeblock>&lt;% System.currentTimeMillis() %></codeblock></p><p>This

 example will evaluate the <tm tmclass="special" tmowner="Sun Microsystems, Inc."

 tmtype="tm" trademark="Java">Java</tm> statement to get the current time in

 milliseconds.</p><p>To have the result of the statement inserted in the file,

@@ -112,4 +113,3 @@
 </linkpool>

 </related-links>

 </concept>

-<?Pub *0000008076?>

diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt006.html b/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt006.html
index 1fc5f54..a704679 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt006.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/csrcedt006.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2007 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2007" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Content assist" />
 <meta name="abstract" content="Content assist helps you insert or finish a tag or function or finish a line of code in a structured text editor. The placement of the cursor in the source file provides the context for the content assist to offer suggestions for completion." />
 <meta name="description" content="Content assist helps you insert or finish a tag or function or finish a line of code in a structured text editor. The placement of the cursor in the source file provides the context for the content assist to offer suggestions for completion." />
-<meta content="content assist, overview, structured text editors" name="DC.subject" />
-<meta content="content assist, overview, structured text editors" name="keywords" />
+<meta content="content assistance, overview, structured text editors, content assistance" name="DC.subject" />
+<meta content="content assistance, overview, structured text editors, content assistance" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt005.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt024.html" />
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/cvalidate.dita b/docs/org.eclipse.wst.sse.doc.user/topics/cvalidate.dita
index 92ed51e..c430e77 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/cvalidate.dita
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/cvalidate.dita
@@ -6,8 +6,8 @@
 <title>Source and batch validation</title>

 <shortdesc></shortdesc>

 <prolog><metadata>

-<keywords><indexterm>validation<indexterm>source vs batch</indexterm></indexterm>

-</keywords>

+<keywords><indexterm keyref="cvalidate|1|validationsourcevsbatch" status="changed">validation<indexterm>source

+versus batch</indexterm></indexterm></keywords>

 </metadata></prolog>

 <conbody>

 <p>There are two types of validation that can occur when you are working with

diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/cvalidate.html b/docs/org.eclipse.wst.sse.doc.user/topics/cvalidate.html
index 3f2388f..7796212 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/cvalidate.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/cvalidate.html
@@ -1,26 +1,37 @@
-<?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">
+<?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 lang="en-us" xml:lang="en-us">
 <head>
-<!-- /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
-<link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css" />
+<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta content="public" name="security" />
+<meta content="index,follow" name="Robots" />
+<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
+<meta content="concept" name="DC.Type" />
+<meta name="DC.Title" content="Source and batch validation" />
+<meta name="abstract" content="" />
+<meta name="description" content="" />
+<meta content="validation, source versus batch" name="DC.subject" />
+<meta content="validation, source versus batch" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
+<meta content="XHTML" name="DC.Format" />
+<meta content="csrcedt001" name="DC.Identifier" />
+<meta content="en-us" name="DC.Language" />
+<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
 <title>Source and batch validation</title>
 </head>
 <body id="csrcedt001"><a name="csrcedt001"><!-- --></a>
+
+
 <h1 class="topictitle1">Source and batch validation</h1>
-<div><p></p>
+
+
+
+<div><p />
+
 <p>There are two types of validation that can occur when you are working with
 source files in a structured source editor: source validation and batch validation. </p>
+
 <div class="p">Source validation occurs as you type your code; this validation reflects
 the "unsaved" and "unbuilt" contents of the source you are editing. For example,
 if you were to type the following code in a JSP editor:<p><samp class="codeph">&lt;foo:bar&gt;</samp></p>
@@ -28,27 +39,39 @@
 a tag that does not exist, the problem would be discovered immediately and
 would appear underlined in the editor. The advantage of this type of validation
 is that it can alert you to errors instantly.<div class="note"><span class="notetitle">Note:</span> To turn source validation
-on (or off) for all structured text editors, click <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span> &gt; <span class="uicontrol">General</span> &gt; <span class="uicontrol">Editors</span> &gt; <span class="uicontrol">Structured Text Editors</span></span> and check (or
+on (or off) for all structured text editors, click <span class="menucascade"><span class="uicontrol">Window</span>
+ &gt; <span class="uicontrol">Preferences</span> &gt; <span class="uicontrol">General</span> &gt; <span class="uicontrol">Editors</span>
+ &gt; <span class="uicontrol">Structured Text Editors</span></span> and check (or
 uncheck) <strong>Report problems as you type</strong>.</div>
 </div>
+
 <div class="p">Batch validation occurs on saved files. It can catch build process errors
 and other errors that the source validator cannot. For example, suppose you
-typed the following in a JSP editor:<p><samp class="codeph">&lt;%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%&gt;<br />
+typed the following in a JSP editor:<p><br />
+<samp class="codeph">&lt;%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%&gt;<br />
 &lt;%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%&gt;</samp></p>
 In
 this example, the same prefix is used twice. This would prompt the batch validator
 to trigger markers and to generate build warnings in the Problems view and
 in the Navigator. </div>
+
 <p>Batch validation can uncover errors in multiple files at once and give
 you a comprehensive view of where problematic code can be found in your project.
 Moreover, you do not need to open files in an editor to run batch validation.
 To run batch validation on specific files, select and right click the files
-in the Project Explorer and then select <span class="menucascade"><span class="uicontrol">Validate</span></span> from the popup menu.</p>
-<div class="note"><span class="notetitle">Note:</span> To set preferences for batch validation, click <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span> &gt; <span class="uicontrol">Validation</span></span></div>
+in the Project Explorer and then select <span class="menucascade"><span class="uicontrol">Validate</span>
+</span> from the popup menu.</p>
+
+<div class="note"><span class="notetitle">Note:</span> To set preferences for batch validation, click <span class="menucascade"><span class="uicontrol">Window</span>
+ &gt; <span class="uicontrol">Preferences</span> &gt; <span class="uicontrol">Validation</span></span></div>
+
 </div>
+
 <div><div class="relconcepts"><strong>Related concepts</strong><br />
 <div><a href="csrcedt004.html" title="Structured text editor is any of several text editors that you can use to edit various markup languages such as HTML, JavaScript, or XML.">Structured text editors for markup
 languages</a></div>
 </div>
-</div></body>
+</div>
+
+</body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tcontenttype.html b/docs/org.eclipse.wst.sse.doc.user/topics/tcontenttype.html
index ae9df23..b5f1861 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tcontenttype.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tcontenttype.html
@@ -1,26 +1,36 @@
-<?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">
+<?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 lang="en-us" xml:lang="en-us">
 <head>
-<!-- /*******************************************************************************
- * 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
- *******************************************************************************/ -->
-<link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css" />
+<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta content="public" name="security" />
+<meta content="index,follow" name="Robots" />
+<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
+<meta content="task" name="DC.Type" />
+<meta name="DC.Title" content="Associating editors with additional files types" />
+<meta name="abstract" content="" />
+<meta name="description" content="" />
+<meta content="content types, mapping file extensions, file extensions, mapping content types, file types, editors" name="DC.subject" />
+<meta content="content types, mapping file extensions, file extensions, mapping content types, file types, editors" name="keywords" />
+<meta content="XHTML" name="DC.Format" />
+<meta content="tcontenttype" name="DC.Identifier" />
+<meta content="en-us" name="DC.Language" />
+<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
 <title>Associating editors with additional files types</title>
 </head>
 <body id="tcontenttype"><a name="tcontenttype"><!-- --></a>
+
+
 <h1 class="topictitle1">Associating editors with additional files types</h1>
-<div><p></p>
+
+
+
+<div><p />
+
 <div class="section"><p>You can associate certain editors with a file type by clicking
-on <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span> &gt; <span class="uicontrol">General</span> &gt; <span class="uicontrol">Editors</span> &gt; <span class="uicontrol">File
+on <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span>
+ &gt; <span class="uicontrol">General</span> &gt; <span class="uicontrol">Editors</span> &gt; <span class="uicontrol">File
 Association</span></span> and setting up the associations in the
 File Associations Window.</p>
 <p>Some Eclipse-based editors, however, will
@@ -28,13 +38,21 @@
 you want to associate an additional file type with some editors, you may have
 to first map the content type with its file extension. To map a content type
 with a file extension, complete the following steps: </p>
-<ol><li>Click <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">General</span> &gt; <span class="uicontrol">Content Types</span></span>. The Content Type window
+<ol>
+<li>Click <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">General</span>
+ &gt; <span class="uicontrol">Content Types</span></span>. The Content Type window
 appears. </li>
+
 <li>Select a content type in the Content Type window, and then select <strong>Add</strong> .
 The Define a New File Type window appears.</li>
+
 <li>Type the name of the file type, and then click <strong>OK</strong>.</li>
+
 </ol>
 </div>
+
 </div>
+
+
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html
index e38d4f1..5094861 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Editing text coded in markup languages - overview" />
 <meta name="abstract" content="You can edit text coded in markup languages with a structured text editor. This is a generic term for several editors that you can use to edit any of several markup languages, such as HTML." />
 <meta name="description" content="You can edit text coded in markup languages with a structured text editor. This is a generic term for several editors that you can use to edit any of several markup languages, such as HTML." />
-<meta content="markup languages, editing, structured text editors, markup language editing, overview" name="DC.subject" />
-<meta content="markup languages, editing, structured text editors, markup language editing, overview" name="keywords" />
+<meta content="markup languages, editing text, text, editing in markup languages" name="DC.subject" />
+<meta content="markup languages, editing text, text, editing in markup languages" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
 <meta scheme="URI" name="DC.Relation" content="csrcedt006.html" />
 <meta scheme="URI" name="DC.Relation" content="csrcedt001.html" />
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt001.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt001.dita
index 471b837..d100c8c 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt001.dita
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt001.dita
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "..\dtd\task.dtd">

 <task id="tsrcedt001" xml:lang="en-us">

@@ -13,9 +13,10 @@
 to highlight errors, warnings, tasks, search results, bookmarks, and other

 text.</shortdesc>

 <prolog><metadata>

-<keywords><indexterm>annotation preferences<indexterm>markup language settings</indexterm></indexterm><indexterm>markup languages<indexterm>setting annotation preferences</indexterm></indexterm>

-

-

+<keywords><indexterm keyref="tsrcedt001|1|annotationpreferencesmarkuplanguagesettings"

+status="changed">annotations<indexterm>markup language settings</indexterm></indexterm>

+<indexterm keyref="tsrcedt001|2|markuplanguagessettingannotationpreferences"

+status="new">markup languages<indexterm>setting annotation preferences</indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <taskbody>

diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt001.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt001.html
index b069e85..1fca557 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt001.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt001.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Setting annotation preferences for markup languages" />
 <meta name="abstract" content="This documentation describes how to set annotation preferences for Web and XML files. The annotation preferences include whether to analyze the syntactic validity of your file while you are typing and what colors to use to highlight errors, warnings, tasks, search results, bookmarks, and other text." />
 <meta name="description" content="This documentation describes how to set annotation preferences for Web and XML files. The annotation preferences include whether to analyze the syntactic validity of your file while you are typing and what colors to use to highlight errors, warnings, tasks, search results, bookmarks, and other text." />
-<meta content="annotation preferences, markup language settings, markup languages, setting annotation preferences" name="DC.subject" />
-<meta content="annotation preferences, markup language settings, markup languages, setting annotation preferences" name="keywords" />
+<meta content="annotations, markup language settings, markup languages, setting annotation preferences" name="DC.subject" />
+<meta content="annotations, markup language settings, markup languages, setting annotation preferences" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt025.html" />
 <meta content="XHTML" name="DC.Format" />
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt005.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt005.dita
index 958f2ee..5083676 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt005.dita
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt005.dita
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "..\dtd\task.dtd">

 <task id="tsrcedt005" xml:lang="en-us">

@@ -12,8 +12,10 @@
 in a structured text editor. Content assist helps you insert or finish a tag

 or function or finish a line of code in a structured text editor.</shortdesc>

 <prolog><metadata>

-<keywords><indexterm>content assistance<indexterm>structured text editors</indexterm></indexterm>

-<indexterm>structured text editors<indexterm>content assistance</indexterm></indexterm>

+<keywords><indexterm keyref="tsrcedt005|1|contentassistancestructuredtexteditors"

+status="new">content assistance<indexterm>structured text editors</indexterm></indexterm>

+<indexterm keyref="tsrcedt005|2|structuredtexteditorscontentassistance" status="changed">structured

+text editors<indexterm>content assistance<indexterm>text editors</indexterm></indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <taskbody>

diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt005.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt005.html
index 39640bd..fb68fc1 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt005.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt005.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Getting content assistance in structured text editors" />
 <meta name="abstract" content="To get help in adding markup to a file, you can use content assist in a structured text editor. Content assist helps you insert or finish a tag or function or finish a line of code in a structured text editor." />
 <meta name="description" content="To get help in adding markup to a file, you can use content assist in a structured text editor. Content assist helps you insert or finish a tag or function or finish a line of code in a structured text editor." />
-<meta content="content assist, structured text editors" name="DC.subject" />
-<meta content="content assist, structured text editors" name="keywords" />
+<meta content="content assistance, structured text editors, structured text editors, text editors" name="DC.subject" />
+<meta content="content assistance, structured text editors, structured text editors, text editors" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="csrcedt006.html" />
 <meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt023.html" />
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt007.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt007.html
index 3c6a789..2f788ed 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt007.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt007.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt010.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt010.html
index 0df2732..adc62d3 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt010.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt010.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt014.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt014.html
index 22bbb84..45145e0 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt014.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt014.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Adding snippets drawers" />
 <meta name="abstract" content="This documentation explains how to customize the Snippets view by adding a new drawer." />
 <meta name="description" content="This documentation explains how to customize the Snippets view by adding a new drawer." />
-<meta content="snippets, drawers, adding, deleting, editing items, hiding" name="DC.subject" />
-<meta content="snippets, drawers, adding, deleting, editing items, hiding" name="keywords" />
+<meta content="snippets, drawer customization" name="DC.subject" />
+<meta content="snippets, drawer customization" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="csrcedt001.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt026.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt015.html" />
@@ -51,21 +51,21 @@
 The check boxes are as follows:</span>
 
 <table class="choicetableborder" summary="" cellspacing="0" cellpadding="4" rules="rows" frame="hsides" border="1">
-<thead><tr><th valign="bottom" id="N100A4-option" align="left">Option</th>
-<th valign="bottom" id="N100A4-desc" align="left">Description</th></tr></thead>
+<thead><tr><th valign="bottom" id="N10090-option" align="left">Option</th>
+<th valign="bottom" id="N10090-desc" align="left">Description</th></tr></thead>
 <tbody>
-<tr><td valign="top" headers="N100A4-option" id="N100AE"><strong>Hide</strong></td>
-<td valign="top" headers="N100A4-desc N100AE">Do not display the drawer.</td>
+<tr><td valign="top" headers="N10090-option" id="N1009A"><strong>Hide</strong></td>
+<td valign="top" headers="N10090-desc N1009A">Do not display the drawer.</td>
 
 </tr>
 
-<tr><td valign="top" headers="N100A4-option" id="N100BE"><strong>Open drawer at start-up</strong></td>
-<td valign="top" headers="N100A4-desc N100BE">At start-up, display
+<tr><td valign="top" headers="N10090-option" id="N100AA"><strong>Open drawer at start-up</strong></td>
+<td valign="top" headers="N10090-desc N100AA">At start-up, display
 the drawer's items.</td>
 </tr>
 
-<tr><td valign="top" headers="N100A4-option" id="N100CD"><strong>Pin drawer open at start-up</strong></td>
-<td valign="top" headers="N100A4-desc N100CD">Keep the drawer
+<tr><td valign="top" headers="N10090-option" id="N100B9"><strong>Pin drawer open at start-up</strong></td>
+<td valign="top" headers="N10090-desc N100B9">Keep the drawer
 open.</td>
 </tr>
 
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt015.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt015.dita
index e1195f9..72bcceb 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt015.dita
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt015.dita
@@ -1,16 +1,15 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "..\dtd\task.dtd">

 <task id="tsrcedt015" xml:lang="en-us">

 <title>Adding items to snippets drawers</title>

 <prolog><metadata>

-<keywords><indexterm>snippet drawers<indexterm>adding items</indexterm></indexterm>

-<indexterm>snippet items<indexterm>adding to drawers</indexterm></indexterm>

+<keywords><indexterm keyref="tsrcedt015|2|snippetitemsaddingtodrawers" status="changed">snippets<indexterm>drawers</indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <taskbody>

-<context> To add new items to an existing snippets drawer::</context>

+<context> To add new items to an existing snippets drawer:</context>

 <steps>

 <step><cmd>Do one of the following choices:</cmd><info><table colsep="0" frame="topbot">

 <tgroup cols="2"><colspec colname="col1" colwidth="72*"/><colspec colname="col2"

diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt015.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt015.html
index 2c928aa..db15ee8 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt015.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt015.html
@@ -2,15 +2,15 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="task" name="DC.Type" />
 <meta name="DC.Title" content="Adding items to snippets drawers" />
-<meta content="snippet drawers, adding items to, snippet items, adding to drawers" name="DC.subject" />
-<meta content="snippet drawers, adding items to, snippet items, adding to drawers" name="keywords" />
+<meta content="snippets, drawers" name="DC.subject" />
+<meta content="snippets, drawers" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="csrcedt001.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt026.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt014.html" />
@@ -29,16 +29,16 @@
 
 
 <div>
-<div class="section"> To add new items to an existing snippets drawer::</div>
+<div class="section"> To add new items to an existing snippets drawer:</div>
 
 <ol>
 <li class="stepexpand"><span>Do one of the following choices:</span> 
 <div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="hsides" border="1" rules="rows">
 <thead align="left">
 <tr>
-<th valign="top" width="36.18090452261307%" id="N10079">To start with this:</th>
+<th valign="top" width="36.18090452261307%" id="N10070">To start with this:</th>
 
-<th valign="top" width="63.81909547738693%" id="N10081">Do this:</th>
+<th valign="top" width="63.81909547738693%" id="N10078">Do this:</th>
 
 </tr>
 
@@ -46,28 +46,28 @@
 
 <tbody>
 <tr>
-<td valign="top" width="36.18090452261307%" headers="N10079 ">An empty item that you can edit</td>
+<td valign="top" width="36.18090452261307%" headers="N10070 ">An empty item that you can edit</td>
 
-<td valign="top" width="63.81909547738693%" headers="N10081 ">Right-click anywhere in an existing drawer, select <span class="uicontrol">Customize</span>,
+<td valign="top" width="63.81909547738693%" headers="N10078 ">Right-click anywhere in an existing drawer, select <span class="uicontrol">Customize</span>,
 and click <span class="menucascade"><span class="uicontrol">New</span> &gt; <span class="uicontrol">New Item</span>
 </span>.</td>
 
 </tr>
 
 <tr>
-<td valign="top" width="36.18090452261307%" headers="N10079 ">Existing text pasted into a new item in an existing
+<td valign="top" width="36.18090452261307%" headers="N10070 ">Existing text pasted into a new item in an existing
 drawer</td>
 
-<td valign="top" width="63.81909547738693%" headers="N10081 ">Copy or cut text to the clipboard. In the Snippets view,
+<td valign="top" width="63.81909547738693%" headers="N10078 ">Copy or cut text to the clipboard. In the Snippets view,
 right-click anywhere in an existing drawer and click <span class="uicontrol">Paste</span>.</td>
 
 </tr>
 
 <tr>
-<td valign="top" width="36.18090452261307%" headers="N10079 ">Existing text pasted into a new item in a new or existing
+<td valign="top" width="36.18090452261307%" headers="N10070 ">Existing text pasted into a new item in a new or existing
 drawer</td>
 
-<td valign="top" width="63.81909547738693%" headers="N10081 ">Select the text, right-click, click <span class="uicontrol">Add to
+<td valign="top" width="63.81909547738693%" headers="N10078 ">Select the text, right-click, click <span class="uicontrol">Add to
 Snippets</span>, specify the name of the drawer in the Snippets view
 to which you want to add the item, and click <span class="uicontrol">OK</span>.</td>
 
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt016.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt016.html
index f3d7504..f10d376 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt016.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt016.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Deleting or hiding snippet items or drawers" />
 <meta name="abstract" content="This documentation describes how to delete or hide drawers and items in the Snippets view." />
 <meta name="description" content="This documentation describes how to delete or hide drawers and items in the Snippets view." />
-<meta content="snippets, deleting or hiding drawers, drawers, deleting snippets, hiding snippets" name="DC.subject" />
-<meta content="snippets, deleting or hiding drawers, drawers, deleting snippets, hiding snippets" name="keywords" />
+<meta content="drawers, snippets view, snippets, modifying drawers" name="DC.subject" />
+<meta content="drawers, snippets view, snippets, modifying drawers" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="csrcedt001.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt026.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt014.html" />
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt022.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt022.html
index d1a8987..bd58a0e 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt022.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt022.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt023.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt023.html
index e50a155..7d0a869 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt023.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt023.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Enabling content assist for JSP files" />
 <meta name="abstract" content="Having the proper files defined in the Java build class path is essential for content assist to work properly in JSP files. It is also essential for the links builder to be able to correctly resolve links to servlets or Java beans in JSP and HTML files." />
 <meta name="description" content="Having the proper files defined in the Java build class path is essential for content assist to work properly in JSP files. It is also essential for the links builder to be able to correctly resolve links to servlets or Java beans in JSP and HTML files." />
-<meta content="JSP files, content assist enablement, content assist, enabling for JSP files" name="DC.subject" />
-<meta content="JSP files, content assist enablement, content assist, enabling for JSP files" name="keywords" />
+<meta content="content assistance, enabling for JSP files, JSP files, enabling content assistance" name="DC.subject" />
+<meta content="content assistance, enabling for JSP files, JSP files, enabling content assistance" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="csrcedt006.html" />
 <meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt005.html" />
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt024.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt024.html
index f627370..a16a406 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt024.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt024.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt025.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt025.dita
index e390542..6a3a83a 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt025.dita
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt025.dita
@@ -1,86 +1,100 @@
-<?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<?xml version="1.0" encoding="UTF-8"?>

+<!--Arbortext, Inc., 1988-2009, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "..\dtd\task.dtd">

+<?Pub Sty _display FontColor="red"?>

 <task id="tsrcedt025" xml:lang="en-us">

 <title>Setting preferences for structured text editors</title>

 <titlealts>

 <navtitle>Setting structured text editor preferences</navtitle>

 </titlealts>

 <prolog><metadata>

-<keywords><indexterm>structured text editors<indexterm>preference setting</indexterm></indexterm>

-

+<keywords><indexterm

+keyref="tsrcedt025|1|structuredtexteditorspreferencesetting"

+status="changed">structured text editors<indexterm>preferences</indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <taskbody>

-<context>You can customize your working environment by specifying preferences

-for the structured text editor.</context>

+<context>You can customize your working environment by specifying

+preferences for the structured text editor.</context>

 <steps>

 <step><cmd>In the main menu, click <menucascade><uicontrol>Window</uicontrol>

 <uicontrol>Preferences</uicontrol></menucascade>.</cmd></step>

-<step><cmd>Select one of the choices that are shown in the following table:</cmd>

+<step><cmd>Select one of the choices that are shown in the following

+table:</cmd>

 <choicetable relcolwidth="10* 30*">

-<chhead><choptionhd>Item</choptionhd><chdeschd>Menu path</chdeschd></chhead>

-<chrow><choption>Annotation settings</choption><chdesc><menucascade><uicontrol>Workbench</uicontrol>

-<uicontrol>Editors</uicontrol><uicontrol>Annotations</uicontrol></menucascade></chdesc>

+<chhead><choptionhd>Item</choptionhd><chdeschd>Menu path</chdeschd>

+</chhead>

+<chrow><choption>Annotation settings</choption><chdesc><menucascade>

+<uicontrol>Workbench</uicontrol><uicontrol>Editors</uicontrol>

+<uicontrol>Annotations</uicontrol></menucascade></chdesc></chrow>

+<chrow><choption>Character encoding</choption><chdesc><uicontrol>Web

+and XML</uicontrol>, then one of the following choices: <uicontrol>CSS

+Files</uicontrol>, <uicontrol>HTML Files</uicontrol>, <uicontrol>JSP

+Files</uicontrol>, <uicontrol>*XML Files ( *not implemented in WTP)</uicontrol></chdesc>

 </chrow>

-<chrow><choption>Character encoding</choption><chdesc><uicontrol>Web and XML</uicontrol>,

-then one of the following choices: <uicontrol>CSS Files</uicontrol>, <uicontrol>HTML

-Files</uicontrol>, <uicontrol>JSP Files</uicontrol>, <uicontrol>*XML Files

-( *not implemented in WTP)</uicontrol></chdesc></chrow>

-<chrow><choption>Content assist: HTML</choption><chdesc><menucascade><uicontrol>Web

-and XML</uicontrol><uicontrol>HTML Files</uicontrol><uicontrol>HTML Source</uicontrol>

-</menucascade></chdesc></chrow>

+<chrow><choption>Code folding</choption><chdesc><menucascade><uicontrol>General</uicontrol>

+<uicontrol>Editors</uicontrol><uicontrol>Structured Text Editors</uicontrol>

+</menucascade></chdesc></chrow><?Pub Caret 58?>

+<chrow><choption>Content assist: HTML</choption><chdesc><menucascade>

+<uicontrol>Web and XML</uicontrol><uicontrol>HTML Files</uicontrol>

+<uicontrol>HTML Source</uicontrol></menucascade></chdesc></chrow>

 <chrow><choption>Content assist: JavaScript</choption><chdesc><menucascade>

 <uicontrol>Web and XML</uicontrol><uicontrol>JavaScript Files</uicontrol>

 <uicontrol>JavaScript Source</uicontrol></menucascade></chdesc></chrow>

-<chrow><choption>Content assist: XML</choption><chdesc><menucascade><uicontrol>Web

-and XML</uicontrol><uicontrol>*XML Files (*not implemented in WTP)</uicontrol>

-<uicontrol>XML Source</uicontrol></menucascade></chdesc></chrow>

-<chrow><choption>Editor appearance</choption><chdesc><menucascade><uicontrol>Workbench</uicontrol>

-<uicontrol>Editors</uicontrol><uicontrol>Structured Text Editor</uicontrol>

-<uicontrol>Appearance</uicontrol></menucascade></chdesc></chrow>

-<chrow><choption>Editor font</choption><chdesc><menucascade><uicontrol>Workbench</uicontrol>

-<uicontrol>Colors and Fonts</uicontrol><uicontrol>Structured Text Editor</uicontrol>

-</menucascade></chdesc></chrow>

-<chrow><choption>Editor navigation</choption><chdesc><menucascade><uicontrol>Workbench</uicontrol>

-<uicontrol>Editors</uicontrol><uicontrol>Structured Text Editor</uicontrol>

-<uicontrol>Navigation</uicontrol></menucascade></chdesc></chrow>

-<chrow><choption>File-type-specific settings</choption><chdesc><uicontrol>Web

-and XML</uicontrol>, then navigate to the file type and particular setting</chdesc>

+<chrow><choption>Content assist: XML</choption><chdesc><menucascade>

+<uicontrol>Web and XML</uicontrol><uicontrol>*XML Files (*not implemented

+in WTP)</uicontrol><uicontrol>XML Source</uicontrol></menucascade></chdesc>

 </chrow>

+<chrow><choption>Editor appearance</choption><chdesc><menucascade>

+<uicontrol>Workbench</uicontrol><uicontrol>Editors</uicontrol>

+<uicontrol>Structured Text Editor</uicontrol><uicontrol>Appearance</uicontrol>

+</menucascade></chdesc></chrow>

+<chrow><choption>Editor font</choption><chdesc><menucascade><uicontrol>Workbench</uicontrol>

+<uicontrol>Colors and Fonts</uicontrol><uicontrol>Structured Text

+Editor</uicontrol></menucascade></chdesc></chrow>

+<chrow><choption>Editor navigation</choption><chdesc><menucascade>

+<uicontrol>Workbench</uicontrol><uicontrol>Editors</uicontrol>

+<uicontrol>Structured Text Editor</uicontrol><uicontrol>Navigation</uicontrol>

+</menucascade></chdesc></chrow>

+<chrow><choption>File-type-specific settings</choption><chdesc><uicontrol>Web

+and XML</uicontrol>, then navigate to the file type and particular

+setting</chdesc></chrow>

 <chrow><choption>Hover help</choption><chdesc><menucascade><uicontrol>Workbench</uicontrol>

 <uicontrol>Editors</uicontrol><uicontrol>Structured Text Editor</uicontrol>

 <uicontrol>Hovers</uicontrol></menucascade></chdesc></chrow>

 <chrow><choption>Key bindings</choption><chdesc><menucascade><uicontrol>Workbench</uicontrol>

-<uicontrol>Keys</uicontrol><uicontrol>Keyboard Shortcuts</uicontrol></menucascade> then

-in the <uicontrol>Category</uicontrol> field specify <uicontrol>Source</uicontrol></chdesc>

+<uicontrol>Keys</uicontrol><uicontrol>Keyboard Shortcuts</uicontrol>

+</menucascade> then in the <uicontrol>Category</uicontrol> field specify <uicontrol>Source</uicontrol></chdesc>

 </chrow>

-<chrow><choption>Spell checking</choption><chdesc><uicontrol>Spell Check</uicontrol></chdesc>

-</chrow>

-<chrow><choption>Syntax checking</choption><chdesc><menucascade><uicontrol>Workbench</uicontrol>

-<uicontrol>Editors</uicontrol><uicontrol>Structured Text Editor</uicontrol>

-<uicontrol>Appearance</uicontrol></menucascade> then check or uncheck the <uicontrol>Analyze

-annotations while typing</uicontrol> box.</chdesc></chrow>

+<chrow><choption>Spell checking</choption><chdesc><uicontrol>Spell

+Check</uicontrol></chdesc></chrow>

+<chrow><choption>Syntax checking</choption><chdesc><menucascade>

+<uicontrol>Workbench</uicontrol><uicontrol>Editors</uicontrol>

+<uicontrol>Structured Text Editor</uicontrol><uicontrol>Appearance</uicontrol>

+</menucascade> then check or uncheck the <uicontrol>Analyze annotations

+while typing</uicontrol> box.</chdesc></chrow>

 </choicetable>

 <info><note>You cannot set <uicontrol>Web and XML</uicontrol> preferences

 unless the Core XML Support capability (<menucascade><uicontrol>Workbench</uicontrol>

-<uicontrol>Capabilities</uicontrol></menucascade>) is enabled, and you cannot

-set preferences for DTD files unless the XML Development capability is enabled.</note></info>

-</step>

+<uicontrol>Capabilities</uicontrol></menucascade>) is enabled, and

+you cannot set preferences for DTD files unless the XML Development

+capability is enabled.</note></info></step>

 </steps>

 </taskbody>

 <related-links>

 <linkpool type="concept">

-<link href="csrcedt004.dita"><linktext>Structured text editors for markup

-languages</linktext></link>

+<link href="csrcedt004.dita"><linktext>Structured text editors for

+markup languages</linktext></link>

 </linkpool>

 <linkpool type="task">

-<link href="tsrcedt001.dita"><linktext>Setting annotation preferences for

-markup languages</linktext></link>

-<link href="tsrcedt010.dita"><linktext>Checking spelling</linktext></link>

-<link href="tsrcedt000.dita"><linktext>Editing text coded in markup languages

-- overview</linktext></link>

+<link href="tsrcedt001.dita"><linktext>Setting annotation preferences

+for markup languages</linktext></link>

+<link href="tsrcedt010.dita"><linktext>Checking spelling</linktext>

+</link>

+<link href="tsrcedt000.dita"><linktext>Editing text coded in markup

+languages - overview</linktext></link>

 </linkpool>

 </related-links>

 </task>

+<?Pub *0000005160?>

diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html
index 2194f1e..6763db3 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt025.html
@@ -2,15 +2,15 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="task" name="DC.Type" />
 <meta name="DC.Title" content="Setting preferences for structured text editors" />
-<meta content="structured text editors, preference setting" name="DC.subject" />
-<meta content="structured text editors, preference setting" name="keywords" />
+<meta content="structured text editors, preferences" name="DC.subject" />
+<meta content="structured text editors, preferences" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt001.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt010.html" />
@@ -39,85 +39,85 @@
 <li class="stepexpand"><span>Select one of the choices that are shown in the following table:</span>
 
 <table class="choicetableborder" summary="" cellspacing="0" cellpadding="4" rules="rows" frame="hsides" border="1">
-<thead><tr><th valign="bottom" id="N1006E-option">Item</th>
-<th valign="bottom" id="N1006E-desc">Menu path</th></tr></thead>
+<thead><tr><th valign="bottom" id="N10070-option">Item</th>
+<th valign="bottom" id="N10070-desc">Menu path</th></tr></thead>
 <tbody>
 
-<tr><td valign="top" headers="N1006E-option" id="N10088"><strong>Annotation settings</strong></td>
-<td valign="top" headers="N1006E-desc N10088"><span class="menucascade"><span class="uicontrol">Workbench</span>
+<tr><td valign="top" headers="N10070-option" id="N1008A"><strong>Annotation settings</strong></td>
+<td valign="top" headers="N10070-desc N1008A"><span class="menucascade"><span class="uicontrol">Workbench</span>
  &gt; <span class="uicontrol">Editors</span> &gt; <span class="uicontrol">Annotations</span></span></td>
 
 </tr>
 
-<tr><td valign="top" headers="N1006E-option" id="N100AB"><strong>Character encoding</strong></td>
-<td valign="top" headers="N1006E-desc N100AB"><span class="uicontrol">Web and XML</span>,
+<tr><td valign="top" headers="N10070-option" id="N100AD"><strong>Character encoding</strong></td>
+<td valign="top" headers="N10070-desc N100AD"><span class="uicontrol">Web and XML</span>,
 then one of the following choices: <span class="uicontrol">CSS Files</span>, <span class="uicontrol">HTML
 Files</span>, <span class="uicontrol">JSP Files</span>, <span class="uicontrol">*XML Files
 ( *not implemented in WTP)</span></td>
 </tr>
 
-<tr><td valign="top" headers="N1006E-option" id="N100D6"><strong>Content assist: HTML</strong></td>
-<td valign="top" headers="N1006E-desc N100D6"><span class="menucascade"><span class="uicontrol">Web
+<tr><td valign="top" headers="N10070-option" id="N100D8"><strong>Content assist: HTML</strong></td>
+<td valign="top" headers="N10070-desc N100D8"><span class="menucascade"><span class="uicontrol">Web
 and XML</span> &gt; <span class="uicontrol">HTML Files</span> &gt; <span class="uicontrol">HTML Source</span>
 </span></td>
 </tr>
 
-<tr><td valign="top" headers="N1006E-option" id="N100F8"><strong>Content assist: JavaScript</strong></td>
-<td valign="top" headers="N1006E-desc N100F8"><span class="menucascade">
+<tr><td valign="top" headers="N10070-option" id="N100FA"><strong>Content assist: JavaScript</strong></td>
+<td valign="top" headers="N10070-desc N100FA"><span class="menucascade">
 <span class="uicontrol">Web and XML</span> &gt; <span class="uicontrol">JavaScript Files</span>
  &gt; <span class="uicontrol">JavaScript Source</span></span></td>
 </tr>
 
-<tr><td valign="top" headers="N1006E-option" id="N1011B"><strong>Content assist: XML</strong></td>
-<td valign="top" headers="N1006E-desc N1011B"><span class="menucascade"><span class="uicontrol">Web
+<tr><td valign="top" headers="N10070-option" id="N1011D"><strong>Content assist: XML</strong></td>
+<td valign="top" headers="N10070-desc N1011D"><span class="menucascade"><span class="uicontrol">Web
 and XML</span> &gt; <span class="uicontrol">*XML Files (*not implemented in WTP)</span>
  &gt; <span class="uicontrol">XML Source</span></span></td>
 </tr>
 
-<tr><td valign="top" headers="N1006E-option" id="N1013D"><strong>Editor appearance</strong></td>
-<td valign="top" headers="N1006E-desc N1013D"><span class="menucascade"><span class="uicontrol">Workbench</span>
+<tr><td valign="top" headers="N10070-option" id="N1013F"><strong>Editor appearance</strong></td>
+<td valign="top" headers="N10070-desc N1013F"><span class="menucascade"><span class="uicontrol">Workbench</span>
  &gt; <span class="uicontrol">Editors</span> &gt; <span class="uicontrol">Structured Text Editor</span>
  &gt; <span class="uicontrol">Appearance</span></span></td>
 </tr>
 
-<tr><td valign="top" headers="N1006E-option" id="N10165"><strong>Editor font</strong></td>
-<td valign="top" headers="N1006E-desc N10165"><span class="menucascade"><span class="uicontrol">Workbench</span>
+<tr><td valign="top" headers="N10070-option" id="N10167"><strong>Editor font</strong></td>
+<td valign="top" headers="N10070-desc N10167"><span class="menucascade"><span class="uicontrol">Workbench</span>
  &gt; <span class="uicontrol">Colors and Fonts</span> &gt; <span class="uicontrol">Structured Text Editor</span>
 </span></td>
 </tr>
 
-<tr><td valign="top" headers="N1006E-option" id="N10188"><strong>Editor navigation</strong></td>
-<td valign="top" headers="N1006E-desc N10188"><span class="menucascade"><span class="uicontrol">Workbench</span>
+<tr><td valign="top" headers="N10070-option" id="N1018A"><strong>Editor navigation</strong></td>
+<td valign="top" headers="N10070-desc N1018A"><span class="menucascade"><span class="uicontrol">Workbench</span>
  &gt; <span class="uicontrol">Editors</span> &gt; <span class="uicontrol">Structured Text Editor</span>
  &gt; <span class="uicontrol">Navigation</span></span></td>
 </tr>
 
-<tr><td valign="top" headers="N1006E-option" id="N101B0"><strong>File-type-specific settings</strong></td>
-<td valign="top" headers="N1006E-desc N101B0"><span class="uicontrol">Web
+<tr><td valign="top" headers="N10070-option" id="N101B2"><strong>File-type-specific settings</strong></td>
+<td valign="top" headers="N10070-desc N101B2"><span class="uicontrol">Web
 and XML</span>, then navigate to the file type and particular setting</td>
 
 </tr>
 
-<tr><td valign="top" headers="N1006E-option" id="N101C5"><strong>Hover help</strong></td>
-<td valign="top" headers="N1006E-desc N101C5"><span class="menucascade"><span class="uicontrol">Workbench</span>
+<tr><td valign="top" headers="N10070-option" id="N101C7"><strong>Hover help</strong></td>
+<td valign="top" headers="N10070-desc N101C7"><span class="menucascade"><span class="uicontrol">Workbench</span>
  &gt; <span class="uicontrol">Editors</span> &gt; <span class="uicontrol">Structured Text Editor</span>
  &gt; <span class="uicontrol">Hovers</span></span></td>
 </tr>
 
-<tr><td valign="top" headers="N1006E-option" id="N101ED"><strong>Key bindings</strong></td>
-<td valign="top" headers="N1006E-desc N101ED"><span class="menucascade"><span class="uicontrol">Workbench</span>
+<tr><td valign="top" headers="N10070-option" id="N101EF"><strong>Key bindings</strong></td>
+<td valign="top" headers="N10070-desc N101EF"><span class="menucascade"><span class="uicontrol">Workbench</span>
  &gt; <span class="uicontrol">Keys</span> &gt; <span class="uicontrol">Keyboard Shortcuts</span></span> then
 in the <span class="uicontrol">Category</span> field specify <span class="uicontrol">Source</span></td>
 
 </tr>
 
-<tr><td valign="top" headers="N1006E-option" id="N1021C"><strong>Spell checking</strong></td>
-<td valign="top" headers="N1006E-desc N1021C"><span class="uicontrol">Spell Check</span></td>
+<tr><td valign="top" headers="N10070-option" id="N1021E"><strong>Spell checking</strong></td>
+<td valign="top" headers="N10070-desc N1021E"><span class="uicontrol">Spell Check</span></td>
 
 </tr>
 
-<tr><td valign="top" headers="N1006E-option" id="N10230"><strong>Syntax checking</strong></td>
-<td valign="top" headers="N1006E-desc N10230"><span class="menucascade"><span class="uicontrol">Workbench</span>
+<tr><td valign="top" headers="N10070-option" id="N10232"><strong>Syntax checking</strong></td>
+<td valign="top" headers="N10070-desc N10232"><span class="menucascade"><span class="uicontrol">Workbench</span>
  &gt; <span class="uicontrol">Editors</span> &gt; <span class="uicontrol">Structured Text Editor</span>
  &gt; <span class="uicontrol">Appearance</span></span> then check or uncheck the <span class="uicontrol">Analyze
 annotations while typing</span> box.</td>
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt026.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt026.html
index 85e03ed..2181e1a 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt026.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt026.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Editing with snippets - overview" />
 <meta name="abstract" content="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags. The view can be extended based on additional objects that you define and include." />
 <meta name="description" content="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags. The view can be extended based on additional objects that you define and include." />
-<meta content="snippets, overview, HTML, editing, reuse with snippets, JavaScript, JSP code, JSP tags, custom" name="DC.subject" />
-<meta content="snippets, overview, HTML, editing, reuse with snippets, JavaScript, JSP code, JSP tags, custom" name="keywords" />
+<meta content="snippets, overview" name="DC.subject" />
+<meta content="snippets, overview" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="csrcedt001.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt014.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt015.html" />
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt027.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt027.html
index 66434c3..801e45f 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt027.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt027.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Adding and removing markup language templates - overview" />
 <meta name="abstract" content="Content assist provides templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates." />
 <meta name="description" content="Content assist provides templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates." />
-<meta content="markup languages, adding and removing templates" name="DC.subject" />
-<meta content="markup languages, adding and removing templates" name="keywords" />
+<meta content="markup languages, templates" name="DC.subject" />
+<meta content="markup languages, templates" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt024.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt028.html" />
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt028.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt028.dita
index cb9bc26..bcf81da 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt028.dita
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt028.dita
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "..\dtd\task.dtd">

 <task id="tsrcedt028" xml:lang="en-us">

@@ -8,10 +8,9 @@
 code, that you can insert into a file. You can use the default templates as

 provided, customize the default templates, or create your own templates.</shortdesc>

 <prolog><metadata>

-<keywords><indexterm>JSP pages<indexterm>templates</indexterm></indexterm>

-<indexterm>templates<indexterm>JSP pages</indexterm></indexterm>

-

-</keywords>

+<keywords><indexterm keyref="tsrcedt028|1|JSPpagestemplates" status="changed">JSP

+files<indexterm>templates</indexterm></indexterm><indexterm keyref="tsrcedt028|2|templatesJSPpages"

+status="new">templates<indexterm>JSP pages</indexterm></indexterm></keywords>

 </metadata></prolog>

 <taskbody>

 <context> <p>For example, you may work on a group of JSP pages that should

diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt028.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt028.html
index 57cf2d4..09647fb 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt028.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt028.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Adding and removing JSP templates" />
 <meta name="abstract" content="JSP content assist provides several templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates." />
 <meta name="description" content="JSP content assist provides several templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates." />
-<meta content="JSP templates, adding, removing, templates, JSP" name="DC.subject" />
-<meta content="JSP templates, adding, removing, templates, JSP" name="keywords" />
+<meta content="JSP files, templates, JSP pages" name="DC.subject" />
+<meta content="JSP files, templates, JSP pages" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt027.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt024.html" />
diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt029.dita b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt029.dita
index e41bd7c..30ebb08 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt029.dita
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt029.dita
@@ -2,18 +2,15 @@
 <!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "..\dtd\task.dtd">

-<!-- $Id: tsrcedt029.dita,v 1.4 2006/04/13 20:37:13 bkorn Exp $ -->

 <task id="tsrcedt027" xml:lang="en-us">

 <title>Adding and removing XML templates</title>

 <shortdesc>XML content assist provides a comment template, a chunk of predefined

 code that you can insert into a file. You can use the default template as

 provided, customize that template, or create your own templates.</shortdesc>

 <prolog><metadata>

-<keywords><indexterm>templates<indexterm>XML</indexterm></indexterm>

-<indexterm>xml templates<indexterm>adding</indexterm></indexterm>

-

-

-</keywords>

+<keywords><indexterm keyref="tsrcedt029|1|templatesXML" status="new">templates<indexterm>XML</indexterm></indexterm>

+<indexterm keyref="tsrcedt029|2|xmltemplatesadding" status="changed">XML<indexterm>adding

+templates</indexterm></indexterm></keywords>

 </metadata></prolog>

 <taskbody>

 <context> <p>For example, you may work on a group of XML pages that should

diff --git a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt029.html b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt029.html
index 07d2669..f674243 100644
--- a/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt029.html
+++ b/docs/org.eclipse.wst.sse.doc.user/topics/tsrcedt029.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Adding and removing XML templates" />
 <meta name="abstract" content="XML content assist provides a comment template, a chunk of predefined code that you can insert into a file. You can use the default template as provided, customize that template, or create your own templates." />
 <meta name="description" content="XML content assist provides a comment template, a chunk of predefined code that you can insert into a file. You can use the default template as provided, customize that template, or create your own templates." />
-<meta content="xml templates, adding, removing, templates, XML" name="DC.subject" />
-<meta content="xml templates, adding, removing, templates, XML" name="keywords" />
+<meta content="templates, XML, adding templates" name="DC.subject" />
+<meta content="templates, XML, adding templates" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="csrcedt004.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt027.html" />
 <meta scheme="URI" name="DC.Relation" content="tsrcedt024.html" />
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 7bdd756..9d7c95e 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,6 +2,6 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name.0
 Bundle-SymbolicName: org.eclipse.wst.sse.ui.infopop; singleton:=true
-Bundle-Version: 1.0.102.qualifier
+Bundle-Version: 1.0.300.qualifier
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: plugin
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/about.html b/docs/org.eclipse.wst.sse.ui.infopop/about.html
index 73db36e..2199df3 100644
--- a/docs/org.eclipse.wst.sse.ui.infopop/about.html
+++ b/docs/org.eclipse.wst.sse.ui.infopop/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/build.properties b/docs/org.eclipse.wst.sse.ui.infopop/build.properties
index 41bc08b..94c7f99 100644
--- a/docs/org.eclipse.wst.sse.ui.infopop/build.properties
+++ b/docs/org.eclipse.wst.sse.ui.infopop/build.properties
@@ -4,5 +4,4 @@
                META-INF/,\
                EditorCssContexts2.xml,\
                plugin.properties
-src.includes = build.properties
-generateSourceBundle=false
\ No newline at end of file
+generateSourceBundle=false
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/plugin.properties b/docs/org.eclipse.wst.sse.ui.infopop/plugin.properties
index 84f306f..69025d2 100644
--- a/docs/org.eclipse.wst.sse.ui.infopop/plugin.properties
+++ b/docs/org.eclipse.wst.sse.ui.infopop/plugin.properties
@@ -1,3 +1,3 @@
 # properties file for org.eclipse.wst.sse.ui.infopop
-Bundle-Vendor.0 = Eclipse.org
+Bundle-Vendor.0 = Eclipse Web Tools Platform
 Bundle-Name.0 = SSE infopops
\ No newline at end of file
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
index f703703..8a60c52 100644
--- a/docs/org.eclipse.wst.web.ui.infopop/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.wst.web.ui.infopop/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: Static Web infopop
 Bundle-SymbolicName: org.eclipse.wst.web.ui.infopop; singleton:=true
-Bundle-Version: 1.0.202.qualifier
+Bundle-Version: 1.0.300.qualifier
 Bundle-Vendor: %pluginProvider
 Bundle-Localization: plugin
 Eclipse-AutoStart: true
diff --git a/docs/org.eclipse.wst.web.ui.infopop/about.html b/docs/org.eclipse.wst.web.ui.infopop/about.html
index 73db36e..2199df3 100644
--- a/docs/org.eclipse.wst.web.ui.infopop/about.html
+++ b/docs/org.eclipse.wst.web.ui.infopop/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/docs/org.eclipse.wst.webtools.doc.user/DocBuild.xml b/docs/org.eclipse.wst.webtools.doc.user/DocBuild.xml
index 9c9ddbe..235ccf2 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/DocBuild.xml
+++ b/docs/org.eclipse.wst.webtools.doc.user/DocBuild.xml
@@ -21,7 +21,11 @@
 	ChangeLog:
 	2006-04-05 Arthur Ryman <ryman@ca.ibm.com>
 	- Created.
-
+	2008-01-09 Kate Price <katep@ca.ibm.com>
+	- modified for new DITA-OT version
+	2008-05-05 Kate Price <katep@ca.ibm.com>
+	- modified to add generation of pre-built help index. 
+	- Must delete /index folder before running build
 -->
 <project name="eclipsehelp" default="all">
 
@@ -44,16 +48,19 @@
 	<target name="eclipsehelp">
 		<ant antfile="${dita.ot.dir}${file.separator}conductor.xml" target="init" dir="${dita.ot.dir}">
 			<property name="args.copycss" value="no" />
-			<property name="args.csspath" value="org.eclipse.wst.doc.user" />
+			<property name="args.csspath" value="../org.eclipse.wst.doc.user" />
 			<property name="args.eclipse.provider" value="Eclipse.org" />
-			<property name="args.eclipse.version" value="1.5.0" />
-			<property name="args.input" location="webtools_toc.ditamap" />    		
+			<property name="args.eclipse.version" value="3.3.0" />
+			<property name="args.input" location="relatedlinks.ditamap" />    		
 			<property name="clean.temp" value="true" />
 			<property name="dita.extname" value=".dita" />
 			<property name="dita.temp.dir" location="temp" />
-			<property name="output.dir" location=".." />
+			<property name="output.dir" location="" />
 			<property name="transtype" value="eclipsehelp" />
 		</ant>
 		<copy file="myplugin.xml" tofile="plugin.xml" overwrite="yes" />
 	</target>
+	<target name="build.index" description="Builds search index for the plug-in" if="eclipse.running">
+	     <help.buildHelpIndex manifest="plugin.xml" destination="."/>
+	</target>
 </project>
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 cf2b706..4e8f6a4 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
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.webtools.doc.user; singleton:=true
-Bundle-Version: 1.0.300.qualifier
+Bundle-Version: 1.0.500.qualifier
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Eclipse-LazyStart: true
diff --git a/docs/org.eclipse.wst.webtools.doc.user/about.html b/docs/org.eclipse.wst.webtools.doc.user/about.html
index 73db36e..2199df3 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/about.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/docs/org.eclipse.wst.webtools.doc.user/build.properties b/docs/org.eclipse.wst.webtools.doc.user/build.properties
index f7faab0..1e3a1c7 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/build.properties
+++ b/docs/org.eclipse.wst.webtools.doc.user/build.properties
@@ -7,9 +7,8 @@
                index/,\
                META-INF/,\
                plugin.properties
-src.includes = build.properties,\
-		       *.maplist,\
+src.includes = *.maplist,\
                *.ditamap,\
-		       topics/*.dita
+               topics/*.dita
 bin.excludes = DocBuild.xml,\
-               myPlugin*.xml
\ No newline at end of file
+               myPlugin*.xml
diff --git a/docs/org.eclipse.wst.webtools.doc.user/index/_10.cfs b/docs/org.eclipse.wst.webtools.doc.user/index/_10.cfs
new file mode 100644
index 0000000..740c4c5
--- /dev/null
+++ b/docs/org.eclipse.wst.webtools.doc.user/index/_10.cfs
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/index/_u.cfs b/docs/org.eclipse.wst.webtools.doc.user/index/_u.cfs
deleted file mode 100644
index 3a8c50a..0000000
--- a/docs/org.eclipse.wst.webtools.doc.user/index/_u.cfs
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/index/deletable b/docs/org.eclipse.wst.webtools.doc.user/index/deletable
index e423242..593f470 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/index/deletable
+++ b/docs/org.eclipse.wst.webtools.doc.user/index/deletable
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/index/indexed_contributions b/docs/org.eclipse.wst.webtools.doc.user/index/indexed_contributions
index c2b7f40..f11e1b7 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/index/indexed_contributions
+++ b/docs/org.eclipse.wst.webtools.doc.user/index/indexed_contributions
@@ -1,3 +1,3 @@
 #This is a generated file; do not edit.

-#Wed May 09 14:15:21 EDT 2007

-org.eclipse.wst.webtools.doc.user=org.eclipse.wst.webtools.doc.user\n1.0.300.qualifier

+#Wed May 14 20:03:02 EDT 2008

+org.eclipse.wst.webtools.doc.user=org.eclipse.wst.webtools.doc.user\n1.0.400.qualifier

diff --git a/docs/org.eclipse.wst.webtools.doc.user/index/indexed_dependencies b/docs/org.eclipse.wst.webtools.doc.user/index/indexed_dependencies
index 9e7fe0e..430c2cb 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/index/indexed_dependencies
+++ b/docs/org.eclipse.wst.webtools.doc.user/index/indexed_dependencies
@@ -1,4 +1,4 @@
 #This is a generated file; do not edit.

-#Wed May 09 14:15:21 EDT 2007

-lucene=1.4.103.v20060601

-analyzer=org.eclipse.help.base\#3.2.0.v20060601?locale\=en

+#Wed May 14 20:03:02 EDT 2008

+lucene=1.9.1.v200803061811

+analyzer=org.eclipse.help.base\#3.3.100.v20080425?locale\=en

diff --git a/docs/org.eclipse.wst.webtools.doc.user/index/indexed_docs b/docs/org.eclipse.wst.webtools.doc.user/index/indexed_docs
index f39e5f0..be0097c 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/index/indexed_docs
+++ b/docs/org.eclipse.wst.webtools.doc.user/index/indexed_docs
@@ -1,19 +1,24 @@
 #This is a generated file; do not edit.

-#Wed May 09 14:15:21 EDT 2007

+#Wed May 14 20:03:02 EDT 2008

+/org.eclipse.wst.webtools.doc.user/topics/cwfiltbn.html=0

 /org.eclipse.wst.webtools.doc.user/topics/ccwtover.html=0

 /org.eclipse.wst.webtools.doc.user/topics/tjdetags.html=0

 /org.eclipse.wst.webtools.doc.user/topics/cwebresources.html=0

-/org.eclipse.wst.webtools.doc.user/topics/twpcnvrt.html=0

 /org.eclipse.wst.webtools.doc.user/topics/tservertarget.html=0

+/org.eclipse.wst.webtools.doc.user/topics/twpcnvrt.html=0

 /org.eclipse.wst.webtools.doc.user/topics/ccwebvw.html=0

 /org.eclipse.wst.webtools.doc.user/topics/cwservbn.html=0

+/org.eclipse.wst.webtools.doc.user/topics/twlstwiz.html=0

 /org.eclipse.wst.webtools.doc.user/topics/twprjset.html=0

+/org.eclipse.wst.webtools.doc.user/topics/twfltwiz.html=0

 /org.eclipse.wst.webtools.doc.user/topics/tjprefs.html=0

 /org.eclipse.wst.webtools.doc.user/topics/twcvsr.html=0

 /org.eclipse.wst.webtools.doc.user/topics/twcreprj.html=0

 /org.eclipse.wst.webtools.doc.user/topics/tjcrejsp.html=0

+/org.eclipse.wst.webtools.doc.user/topics/cwebartifact.html=0

 /org.eclipse.wst.webtools.doc.user/topics/ccwebprj.html=0

 /org.eclipse.wst.webtools.doc.user/topics/tjcrehtm.html=0

+/org.eclipse.wst.webtools.doc.user/topics/cwlistbn.html=0

 /org.eclipse.wst.webtools.doc.user/topics/cwtfeatures.html=0

 /org.eclipse.wst.webtools.doc.user/topics/cwwedtvw.html=0

 /org.eclipse.wst.webtools.doc.user/topics/twcresta.html=0

diff --git a/docs/org.eclipse.wst.webtools.doc.user/index/segments b/docs/org.eclipse.wst.webtools.doc.user/index/segments
index 19b5d0c..4d97698 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/index/segments
+++ b/docs/org.eclipse.wst.webtools.doc.user/index/segments
Binary files differ
diff --git a/docs/org.eclipse.wst.webtools.doc.user/myplugin.xml b/docs/org.eclipse.wst.webtools.doc.user/myplugin.xml
index 1caf976..7b520b1 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/myplugin.xml
+++ b/docs/org.eclipse.wst.webtools.doc.user/myplugin.xml
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<?eclipse version="3.0"?> 
-<?NLS TYPE="org.eclipse.help.toc"?>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.6"?>
+<?NLS TYPE="org.eclipse.help.toc"?> 
 <!-- /*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -20,4 +20,5 @@
         <extension point="org.eclipse.help.index">
             <index file="org.eclipse.wst.webtools.doc.userindex.xml"/>
    </extension>
+
     </plugin>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/org.eclipse.wst.webtools.doc.userindex.html b/docs/org.eclipse.wst.webtools.doc.user/org.eclipse.wst.webtools.doc.userindex.html
deleted file mode 100644
index 86c8662..0000000
--- a/docs/org.eclipse.wst.webtools.doc.user/org.eclipse.wst.webtools.doc.userindex.html
+++ /dev/null
@@ -1,306 +0,0 @@
-<?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 lang="en-us" xml:lang="en-us">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="copyright" content="(C) Copyright IBM Corporation 2007" />
-<meta name="security" content="public" />
-<meta name="Robots" content="index,follow" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta name="DC.Format" content="XHTML" />
-<!-- All rights reserved. Licensed Materials Property of IBM -->
-<!-- US Government Users Restricted Rights -->
-<!-- Use, duplication or disclosure restricted by -->
-<!-- GSA ADP Schedule Contract with IBM Corp. -->
-<link rel="stylesheet" type="text/css" href="ibmdita.css" />
-<title>Index</title>
-</head>
-<body>
-<h1>Index</h1>
-<a name="IDX0_42" href="#IDX1_42">B</a>
-<a name="IDX0_43" href="#IDX1_43">C</a>
-<a name="IDX0_44" href="#IDX1_44">D</a>
-<a name="IDX0_45" href="#IDX1_45">E</a>
-<a name="IDX0_46" href="#IDX1_46">F</a>
-<a name="IDX0_48" href="#IDX1_48">H</a>
-<a name="IDX0_4A" href="#IDX1_4A">J</a>
-<a name="IDX0_50" href="#IDX1_50">P</a>
-<a name="IDX0_52" href="#IDX1_52">R</a>
-<a name="IDX0_53" href="#IDX1_53">S</a>
-<a name="IDX0_56" href="#IDX1_56">V</a>
-<a name="IDX0_57" href="#IDX1_57">W</a>
-<a name="IDX0_58" href="#IDX1_58">X</a>
-<hr></hr>
-<strong><a name="IDX1_42" href="#IDX0_42">B</a></strong>
-<ul class="indexlist">
-<li>build output folders
-<ul class="indexlist">
-<li><a href="topics/twcvsr.html#twcvsr">ignoring in CVS</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_43" href="#IDX0_43">C</a></strong>
-<ul class="indexlist">
-<li>CVS
-<ul class="indexlist">
-<li><a href="topics/twcvsr.html#twcvsr">setting repository defaults</a>
-</li>
-</ul>
-</li>
-<li>cvsignore files
-<ul class="indexlist">
-<li><a href="topics/twcvsr.html#twcvsr">creating</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_44" href="#IDX0_44">D</a></strong>
-<ul class="indexlist">
-<li>DOCTYPE declarations
-<ul class="indexlist">
-<li><a href="topics/tjprefs.html#tjprefs">adding automatically</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_45" href="#IDX0_45">E</a></strong>
-<ul class="indexlist">
-<li>enterprise applications
-<ul class="indexlist">
-<li>projects
-<ul class="indexlist">
-<li><a href="topics/ccwebprj.html#ccwebprj">dynamic Web projects</a>
-</li>
-</ul>
-</li>
-</ul>
-</li>
-<li>exporting
-<ul class="indexlist">
-<li><a href="topics/twcrewar.html#twcrewar">WAR files</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_46" href="#IDX0_46">F</a></strong>
-<ul class="indexlist">
-<li>framesets
-<ul class="indexlist">
-<li><a href="topics/tjcrehtm.html#tjcrehtm">creating</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_48" href="#IDX0_48">H</a></strong>
-<ul class="indexlist">
-<li>HTML
-<ul class="indexlist">
-<li><a href="topics/tjcrehtm.html#tjcrehtm">creating files</a>
-</li>
-</ul>
-</li>
-<li>HTML files
-<ul class="indexlist">
-<li><a href="topics/tjprefs.html#tjprefs">editing preferences</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_4A" href="#IDX0_4A">J</a></strong>
-<ul class="indexlist">
-<li>JSP files
-<ul class="indexlist">
-<li><a href="topics/tjcrejsp.html#tjcrejsp">creating</a>
-</li>
-</ul>
-</li>
-<li>JSP pages
-<ul class="indexlist">
-<li><a href="topics/cpdjsps.html#cpdjsps">overview</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_50" href="#IDX0_50">P</a></strong>
-<ul class="indexlist">
-<li>Project Explorer view
-<ul class="indexlist">
-<li><a href="topics/ccwebvw.html#ccwebvw">overview</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_52" href="#IDX0_52">R</a></strong>
-<ul class="indexlist">
-<li>repositories
-<ul class="indexlist">
-<li><a href="topics/twcvsr.html#twcvsr">default CVS settings</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_53" href="#IDX0_53">S</a></strong>
-<ul class="indexlist">
-<li>servers
-<ul class="indexlist">
-<li><a href="topics/tservertarget.html#tservertarget">targeting</a>
-</li>
-</ul>
-</li>
-<li>servlets
-<ul class="indexlist">
-<li><a href="topics/twsrvwiz.html#twsrvwiz">creating</a>
-</li>
-<li><a href="topics/cwservbn.html#cwservbn">overview</a>
-</li>
-</ul>
-</li>
-<li>static Web projects
-<ul class="indexlist">
-<li><a href="topics/twpcnvrt.html#twpcnvrt">converting to dynamic</a>
-</li>
-<li><a href="topics/twcresta.html#twcresta">creating</a>
-</li>
-<li><a href="topics/ccstatic.html#ccstatic">overview</a>
-</li>
-</ul>
-</li>
-<li>style sheets
-<ul class="indexlist">
-<li><a href="topics/tstylesheet.html#tstylesheet">creating</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_56" href="#IDX0_56">V</a></strong>
-<ul class="indexlist">
-<li>virtual JAR files associations
-<ul class="indexlist">
-<li><a href="topics/twplib.html#twplib">Web library projects</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_57" href="#IDX0_57">W</a></strong>
-<ul class="indexlist">
-<li>WAR files
-<ul class="indexlist">
-<li><a href="topics/twcrewar.html#twcrewar">exporting</a>
-</li>
-<li><a href="topics/twimpwar.html#twimpwar">importing</a>
-</li>
-<li><a href="topics/cwwarovr.html#cwwarovr">overview</a>
-</li>
-</ul>
-</li>
-<li>Web applications
-<ul class="indexlist">
-<li><a href="topics/cwebprojects.html#cwebprojects">creating or importing</a>
-</li>
-<li><a href="topics/ccwtover.html#ccwtover">overview</a>
-</li>
-<li><a href="topics/twcreprj.html#twcreprj">resources</a>
-</li>
-<li><a href="topics/tservertarget.html#tservertarget">server targeting</a>
-</li>
-</ul>
-</li>
-<li>Web content
-<ul class="indexlist">
-<li><a href="topics/cpdjsps.html#cpdjsps">generating dynamically</a>
-</li>
-</ul>
-</li>
-<li>Web development
-<ul class="indexlist">
-<li><a href="topics/ccwebvw.html#ccwebvw">Project Explorer view</a>
-</li>
-</ul>
-</li>
-<li>Web editors
-<ul class="indexlist">
-<li><a href="topics/cwwedtvw.html#cwwedtvw">workbench integration</a>
-</li>
-</ul>
-</li>
-<li>Web library projects
-<ul class="indexlist">
-<li><a href="topics/twplib.html#twplib">virtual JAR files and projects</a>
-</li>
-</ul>
-</li>
-<li>Web page design
-<ul class="indexlist">
-<li><a href="topics/cwebpagedesign.html#cwebpagedesign">overview</a>
-</li>
-</ul>
-</li>
-<li>Web pages
-<ul class="indexlist">
-<li><a href="topics/tjdetags.html#tjdetags">creating</a>
-</li>
-</ul>
-</li>
-<li>Web perspective
-<ul class="indexlist">
-<li><a href="topics/ccwebvw.html#ccwebvw">Project Explorer view</a>
-</li>
-</ul>
-</li>
-<li>Web projects
-<ul class="indexlist">
-<li><a href="topics/twpcnvrt.html#twpcnvrt">converting static to dynamic</a>
-</li>
-<li><a href="topics/twcreprj.html#twcreprj">creating dynamic projects</a>
-</li>
-<li><a href="topics/twcresta.html#twcresta">creating static</a>
-</li>
-<li><a href="topics/ccwebprj.html#ccwebprj">dynamic projects overview</a>
-</li>
-<li><a href="topics/twcrewar.html#twcrewar">exporting WAR files</a>
-</li>
-<li><a href="topics/cwebprojects.html#cwebprojects">overview</a>
-</li>
-<li><a href="topics/twprjset.html#twprjset">properties settings</a>
-</li>
-<li><a href="topics/ccstatic.html#ccstatic">static</a>
-</li>
-</ul>
-</li>
-<li>Web resources
-<ul class="indexlist">
-<li><a href="topics/cwebresources.html#cwebresources">overview</a>
-</li>
-</ul>
-</li>
-<li>Web servers
-<ul class="indexlist">
-<li><a href="topics/cwservbn.html#cwservbn">generating dynamic content</a>
-</li>
-</ul>
-</li>
-<li>Web tools
-<ul class="indexlist">
-<li><a href="topics/cwtfeatures.html#cwtfeatures">features</a>
-</li>
-</ul>
-</li>
-<li>WML
-<ul class="indexlist">
-<li><a href="topics/tjcrehtm.html#tjcrehtm">creating files</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_58" href="#IDX0_58">X</a></strong>
-<ul class="indexlist">
-<li>XHTML
-<ul class="indexlist">
-<li><a href="topics/tjcrehtm.html#tjcrehtm">creating files</a>
-</li>
-</ul>
-</li>
-</ul>
-</body></html>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/org.eclipse.wst.webtools.doc.userindex.xml b/docs/org.eclipse.wst.webtools.doc.user/org.eclipse.wst.webtools.doc.userindex.xml
index 83ed10a..42c8a4d 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/org.eclipse.wst.webtools.doc.userindex.xml
+++ b/docs/org.eclipse.wst.webtools.doc.user/org.eclipse.wst.webtools.doc.userindex.xml
@@ -24,27 +24,10 @@
       <topic href="topics/ccwebvw.html#ccwebvw" title="Project Explorer view and Web development"/>
     </entry>
   </entry>
-  <entry keyword="Web development">
-    <entry keyword="Project Explorer view">
-      <topic href="topics/ccwebvw.html#ccwebvw" title="Project Explorer view and Web development"/>
-    </entry>
-  </entry>
-  <entry keyword="Web perspective">
-    <entry keyword="Project Explorer view">
-      <topic href="topics/ccwebvw.html#ccwebvw" title="Project Explorer view and Web development"/>
-    </entry>
-  </entry>
-  <entry keyword="Web resources">
-    <entry keyword="overview">
-      <topic href="topics/cwebresources.html#cwebresources" title="Web resources"/>
-    </entry>
-  </entry>
-  <entry keyword="Web page design">
-    <entry keyword="overview">
-      <topic href="topics/cwebpagedesign.html#cwebpagedesign" title="Web page design"/>
-    </entry>
-  </entry>
   <entry keyword="Web projects">
+    <entry keyword="Project Explorer view">
+      <topic href="topics/ccwebvw.html#ccwebvw" title="Project Explorer view and Web development"/>
+    </entry>
     <entry keyword="overview">
       <topic href="topics/cwebprojects.html#cwebprojects" title="Web projects"/>
     </entry>
@@ -66,10 +49,23 @@
     <entry keyword="exporting WAR files">
       <topic href="topics/twcrewar.html#twcrewar" title="Exporting Web Archive (WAR) files"/>
     </entry>
+    <entry keyword="virtual JAR files and projects">
+      <topic href="topics/twplib.html#twplib" title="Adding Web library projects"/>
+    </entry>
     <entry keyword="properties settings">
       <topic href="topics/twprjset.html#twprjset" title="Setting Web project properties"/>
     </entry>
   </entry>
+  <entry keyword="Web resources">
+    <entry keyword="overview">
+      <topic href="topics/cwebresources.html#cwebresources" title="Web resources"/>
+    </entry>
+  </entry>
+  <entry keyword="Web page design">
+    <entry keyword="overview">
+      <topic href="topics/cwebpagedesign.html#cwebpagedesign" title="Web page design"/>
+    </entry>
+  </entry>
   <entry keyword="WAR files">
     <entry keyword="overview">
       <topic href="topics/cwwarovr.html#cwwarovr" title="Web archive (WAR) files"/>
@@ -104,18 +100,13 @@
       <topic href="topics/twcrewar.html#twcrewar" title="Exporting Web Archive (WAR) files"/>
     </entry>
   </entry>
-  <entry keyword="Web library projects">
-    <entry keyword="virtual JAR files and projects">
-      <topic href="topics/twplib.html#twplib" title="Adding Web library projects"/>
-    </entry>
-  </entry>
   <entry keyword="virtual JAR files associations">
     <entry keyword="Web library projects">
       <topic href="topics/twplib.html#twplib" title="Adding Web library projects"/>
     </entry>
   </entry>
-  <entry keyword="Web editors">
-    <entry keyword="workbench integration">
+  <entry keyword="workbench">
+    <entry keyword="Web editors">
       <topic href="topics/cwwedtvw.html#cwwedtvw" title="Workbench integration with Web editors"/>
     </entry>
   </entry>
@@ -133,6 +124,9 @@
     <entry keyword="creating files">
       <topic href="topics/tjcrehtm.html#tjcrehtm" title="Creating HTML and XHTML files and framesets"/>
     </entry>
+    <entry keyword="editing preferences">
+      <topic href="topics/tjprefs.html#tjprefs" title="Defining HTML file preferences"/>
+    </entry>
   </entry>
   <entry keyword="WML">
     <entry keyword="creating files">
@@ -159,9 +153,24 @@
       <topic href="topics/tstylesheet.html#tstylesheet" title="Creating cascading style sheets"/>
     </entry>
   </entry>
+  <entry keyword="JSP files">
+    <entry keyword="creating">
+      <topic href="topics/tjcrejsp.html#tjcrejsp" title="Creating JavaServer Pages (JSP) files"/>
+    </entry>
+    <entry keyword="overview">
+      <topic href="topics/cpdjsps.html#cpdjsps" title="JavaServer Pages (JSP) technology"/>
+    </entry>
+  </entry>
+  <entry keyword="Web content">
+    <entry keyword="generating dynamically">
+      <topic href="topics/cpdjsps.html#cpdjsps" title="JavaServer Pages (JSP) technology"/>
+    </entry>
+  </entry>
   <entry keyword="servlets">
     <entry keyword="creating">
       <topic href="topics/twsrvwiz.html#twsrvwiz" title="Creating servlets"/>
+      <topic href="topics/twlstwiz.html#twlstwiz" title="Creating Listeners"/>
+      <topic href="topics/twfltwiz.html#twfltwiz" title="Creating Filters"/>
     </entry>
     <entry keyword="overview">
       <topic href="topics/cwservbn.html#cwservbn" title="Servlets"/>
@@ -172,19 +181,14 @@
       <topic href="topics/cwservbn.html#cwservbn" title="Servlets"/>
     </entry>
   </entry>
-  <entry keyword="JSP files">
-    <entry keyword="creating">
-      <topic href="topics/tjcrejsp.html#tjcrejsp" title="Creating JavaServer Pages (JSP) files"/>
-    </entry>
-  </entry>
-  <entry keyword="JSP pages">
+  <entry keyword="listeners">
     <entry keyword="overview">
-      <topic href="topics/cpdjsps.html#cpdjsps" title="JavaServer Pages (JSP) technology"/>
+      <topic href="topics/cwlistbn.html#cwlistbn" title="Listeners"/>
     </entry>
   </entry>
-  <entry keyword="Web content">
-    <entry keyword="generating dynamically">
-      <topic href="topics/cpdjsps.html#cpdjsps" title="JavaServer Pages (JSP) technology"/>
+  <entry keyword="filters">
+    <entry keyword="overview">
+      <topic href="topics/cwfiltbn.html#cwfiltbn" title="Listeners"/>
     </entry>
   </entry>
   <entry keyword="build output folders">
diff --git a/docs/org.eclipse.wst.webtools.doc.user/plugin.properties b/docs/org.eclipse.wst.webtools.doc.user/plugin.properties
index acba026..5d32518 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/plugin.properties
+++ b/docs/org.eclipse.wst.webtools.doc.user/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2004 IBM Corporation and others.
+# Copyright (c) 2001, 2008 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
diff --git a/docs/org.eclipse.wst.webtools.doc.user/plugin.xml b/docs/org.eclipse.wst.webtools.doc.user/plugin.xml
index 1caf976..7b520b1 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/plugin.xml
+++ b/docs/org.eclipse.wst.webtools.doc.user/plugin.xml
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<?eclipse version="3.0"?> 
-<?NLS TYPE="org.eclipse.help.toc"?>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.6"?>
+<?NLS TYPE="org.eclipse.help.toc"?> 
 <!-- /*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -20,4 +20,5 @@
         <extension point="org.eclipse.help.index">
             <index file="org.eclipse.wst.webtools.doc.userindex.xml"/>
    </extension>
+
     </plugin>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/relatedlinks.ditamap b/docs/org.eclipse.wst.webtools.doc.user/relatedlinks.ditamap
index 2a26dff..4778f32 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/relatedlinks.ditamap
+++ b/docs/org.eclipse.wst.webtools.doc.user/relatedlinks.ditamap
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

-<!DOCTYPE map PUBLIC "-//IBM//DTD DITA IBM Map//EN"

- "ibm-map.dtd">

-<map title="Web tools related links"><?Pub Caret1?>

+<!--Arbortext, Inc., 1988-2006, v.4002-->

+<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN"

+ "map.dtd">

+<map title="Web tools related links">

 <reltable>

 <relheader>

 <relcolspec type="concept"></relcolspec>

@@ -159,7 +159,27 @@
 scope="peer"></topicref>

 </relcell>

 <relcell collection-type="family">

-<topicref href="topics/twsrvwiz.dita" navtitle="Creating servlets"></topicref>

+<topicref href="topics/twsrvwiz.dita" navtitle="Creating Servlets"></topicref>

+</relcell>

+<relcell></relcell>

+</relrow>

+<relrow>

+<relcell collection-type="family">

+<topicref href="topics/cwlistbn.dita" linking="targetonly" navtitle="Listeners"

+scope="peer"></topicref>

+</relcell>

+<relcell collection-type="family">

+<topicref href="topics/twlstwiz.dita" navtitle="Creating Listeners"></topicref>

+</relcell>

+<relcell></relcell>

+</relrow>

+<relrow>

+<relcell collection-type="family">

+<topicref href="topics/cwfiltbn.dita" linking="targetonly" navtitle="Filters"

+scope="peer"></topicref>

+</relcell>

+<relcell collection-type="family">

+<topicref href="topics/twfltwiz.dita" navtitle="Creating Filters"></topicref>

 </relcell>

 <relcell></relcell>

 </relrow>

@@ -199,6 +219,8 @@
 <topicref href="topics/twcreprj.dita" linking="targetonly" navtitle="Creating a dynamic Web project"

 scope="peer">

 <topicref href="topics/tjdetags.dita" linking="targetonly" navtitle="Creating and editing Web pages - overview">

+<topicref href="topics/cwebartifact.dita" linking="targetonly" navtitle="Creating Web Artifacts">

+</topicref>

 </topicref>

 </topicref>

 </relcell>

@@ -221,7 +243,11 @@
 scope="peer"></topicref>

 <topicref href="topics/tjcrejsp.dita" linking="targetonly" navtitle="Creating JavaServer Pages (JSP) files"

 scope="peer"></topicref>

-<topicref href="topics/twsrvwiz.dita" linking="targetonly" navtitle="Creating servlets"

+<topicref href="topics/twsrvwiz.dita" linking="targetonly" navtitle="Creating Servlets"

+scope="peer"></topicref>

+<topicref href="topics/twlstwiz.dita" linking="targetonly" navtitle="Creating Listeners"

+scope="peer"></topicref>

+<topicref href="topics/twfltwiz.dita" linking="targetonly" navtitle="Creating Filters"

 scope="peer"></topicref>

 </relcell>

 <relcell></relcell>

@@ -244,6 +270,10 @@
 </topicref>

 <topicref href="topics/cwservbn.dita" linking="targetonly" navtitle="Servlets">

 </topicref>

+<topicref href="topics/cwlistbn.dita" linking="targetonly" navtitle="Listeners">

+</topicref>

+<topicref href="topics/cwfiltbn.dita" linking="targetonly" navtitle="Filters">

+</topicref>

 </relcell>

 <relcell collection-type="family">

 <topicref href="topics/tjcrejsp.dita" linking="targetonly" navtitle="Creating JavaServer Pages (JSP) files"

@@ -254,13 +284,19 @@
 <relrow>

 <relcell collection-type="family">

 <topicref href="topics/cwservbn.dita" navtitle="Servlets"></topicref>

+<topicref href="topics/cwlistbn.dita" navtitle="Listeners"></topicref>

+<topicref href="topics/cwfiltbn.dita" navtitle="Filters"></topicref>

 <topicref href="topics/ccwtover.dita" linking="targetonly" navtitle="Web application overview">

 </topicref>

 <!-- <topicref href="topics/cwebdevelopmenttools.dita" linking="targetonly" navtitle="Web development tools">

 </topicref> -->

 </relcell>

 <relcell>

-<topicref href="topics/twsrvwiz.dita" linking="targetonly" navtitle="Creating servlets"

+<topicref href="topics/twsrvwiz.dita" linking="targetonly" navtitle="Creating Servlets"

+scope="peer"></topicref>

+<topicref href="topics/twlstwiz.dita" linking="targetonly" navtitle="Creating Listeners"

+scope="peer"></topicref>

+<topicref href="topics/twfltwiz.dita" linking="targetonly" navtitle="Creating Filters"

 scope="peer"></topicref>

 </relcell>

 <relcell></relcell>

@@ -444,4 +480,3 @@
 </relrow>

 </reltable>

 </map>

-<?Pub *0000014944?>

diff --git a/docs/org.eclipse.wst.webtools.doc.user/relatedlinks.xml b/docs/org.eclipse.wst.webtools.doc.user/relatedlinks.xml
new file mode 100644
index 0000000..718a329
--- /dev/null
+++ b/docs/org.eclipse.wst.webtools.doc.user/relatedlinks.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Web tools related links"/>
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 ae164c9..6dae355 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/ccstatic.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/ccstatic.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,6 +11,9 @@
 <meta name="DC.Title" content="Static Web projects" />
 <meta content="Web projects, static, static Web projects, overview" name="DC.subject" />
 <meta content="Web projects, static, static Web projects, overview" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwebresources.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwwarovr.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twcresta.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="ccstatic" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -94,6 +97,14 @@
 
 </div>
 
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/cwebresources.html" title="">Web resources</a></div>
+<div><a href="../topics/cwwarovr.html" title="">Web archive (WAR) files</a></div>
+</div>
+<div class="reltasks"><strong>Related tasks</strong><br />
+<div><a href="../topics/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.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.dita
index ade1bbb..e15ac5f 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.dita
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.dita
@@ -1,24 +1,24 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"

  "concept.dtd">

 <concept id="ccwebprj" xml:lang="en-us">

 <title>Dynamic Web projects and applications</title>

 <prolog><metadata>

-<keywords><indexterm>enterprise applications<indexterm>projects<indexterm>dynamic Web projects</indexterm></indexterm></indexterm>

-<indexterm>Web projects<indexterm>dynamic projects overview</indexterm></indexterm>

-</keywords>

+<keywords><indexterm>enterprise applications<indexterm>projects<indexterm>dynamic

+Web projects</indexterm></indexterm></indexterm><indexterm>Web projects<indexterm>dynamic

+projects overview</indexterm></indexterm></keywords>

 </metadata></prolog>

 <conbody>

 <p>There are two types of Web projects: dynamic and <xref href="ccstatic.dita"

 scope="peer"><desc></desc>static</xref>. Dynamic web projects can contain

-dynamic J2EE resources such as servlets, JSP files, filters, and associated

+dynamic Java EE 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.

+<p>Dynamic Web projects are always embedded 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 <filepath>application.xml</filepath> deployment descriptor

@@ -26,15 +26,15 @@
 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

+<p>Java EE 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 <xref

 href="ccstatic.dita" scope="peer"><desc></desc>Static Web projects</xref>).

  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 <tm tmclass="special"

-tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> Servlet

+<p>The Java EE model, and more specifically, the <cite>Sun Microsystems <tm

+tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> 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

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 9ac3b45..558e5c2 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.html
@@ -2,15 +2,19 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="concept" name="DC.Type" />
 <meta name="DC.Title" content="Dynamic Web projects and applications" />
-<meta content="Web projects, dynamic, overview, dynamic Web projects" name="DC.subject" />
-<meta content="Web projects, dynamic, overview, dynamic Web projects" name="keywords" />
+<meta content="enterprise applications, projects, dynamic Web projects, Web projects, dynamic projects overview" name="DC.subject" />
+<meta content="enterprise applications, projects, dynamic Web projects, Web projects, dynamic projects overview" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwebresources.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwwarovr.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twcreprj.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/tjcrejsp.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="ccwebprj" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -25,14 +29,14 @@
 
 <div>
 <p>There are two types of Web projects: dynamic and <a href="ccstatic.html" title="">static</a>. Dynamic web projects can contain
-dynamic J2EE resources such as servlets, JSP files, filters, and associated
+dynamic Java EE 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.
+<p>Dynamic Web projects are always embedded 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
@@ -41,14 +45,14 @@
 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
+<p>Java EE 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 <em>static</em> Web project type (see <a href="ccstatic.html" title="">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™ Servlet
+<p>The Java EE model, and more specifically, the <cite>Sun Microsystems Java™ 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
@@ -168,6 +172,15 @@
 
 </div>
 
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/cwebresources.html" title="">Web resources</a></div>
+<div><a href="../topics/cwwarovr.html" title="">Web archive (WAR) files</a></div>
+</div>
+<div class="reltasks"><strong>Related tasks</strong><br />
+<div><a href="../topics/twcreprj.html">Creating a dynamic Web project</a></div>
+<div><a href="../topics/tjcrejsp.html">Creating JavaServer Pages (JSP) files</a></div>
+</div>
+</div>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebvw.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebvw.dita
index cc86113..4c043e0 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebvw.dita
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebvw.dita
@@ -5,9 +5,9 @@
 <concept id="ccwebvw" xml:lang="en-us">

 <title>Project Explorer view and Web development</title>

 <prolog><metadata>

-<keywords><indexterm>Project Explorer view<indexterm>overview</indexterm></indexterm>

-<indexterm>Web development<indexterm>Project Explorer view</indexterm></indexterm>

-<indexterm>Web perspective<indexterm>Project Explorer view</indexterm></indexterm>

+<keywords><indexterm keyref="ccwebvw|1|ProjectExplorerviewoverview" status="new">Project

+Explorer view<indexterm>overview</indexterm></indexterm><indexterm keyref="ccwebvw|2|WebdevelopmentProjectExplorerview"

+status="changed">Web projects<indexterm>Project Explorer view</indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <conbody>

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 b067d6d..abf57ac 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebvw.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebvw.html
@@ -2,15 +2,15 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="concept" name="DC.Type" />
 <meta name="DC.Title" content="Project Explorer view and Web development" />
-<meta content="Project Explorer view, overview, Web perspective, project explorer view, version control management, turning on and off, Web development" name="DC.subject" />
-<meta content="Project Explorer view, overview, Web perspective, project explorer view, version control management, turning on and off, Web development" name="keywords" />
+<meta content="Project Explorer view, overview, Web projects, Project Explorer view" name="DC.subject" />
+<meta content="Project Explorer view, overview, Web projects, Project Explorer view" name="keywords" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="ccwebvw" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwtover.html b/docs/org.eclipse.wst.webtools.doc.user/topics/ccwtover.html
index 36bf69b..d886e37 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwtover.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/ccwtover.html
@@ -2,15 +2,19 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="concept" name="DC.Type" />
 <meta name="DC.Title" content="Web application overview" />
-<meta content="Web applications, overview, development phases, information pathways" name="DC.subject" />
-<meta content="Web applications, overview, development phases, information pathways" name="keywords" />
+<meta content="Web applications, overview" name="DC.subject" />
+<meta content="Web applications, overview" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwtfeatures.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twcreprj.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/tjdetags.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwebartifact.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="ccwtover" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -37,6 +41,15 @@
 
 </div>
 
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/cwtfeatures.html" title="The integrated Web development environment makes it easy to cooperatively create, assemble, publish, deploy and maintain dynamic, interactive Web applications.">Web tools features</a></div>
+</div>
+<div class="reltasks"><strong>Related tasks</strong><br />
+<div><a href="../topics/twcreprj.html">Creating a dynamic Web project</a></div>
+<div><a href="../topics/tjdetags.html">Creating and editing Web pages - overview</a></div>
+<div><a href="../topics/cwebartifact.html">Creating Web Artifacts</a></div>
+</div>
+</div>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cpdjsps.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cpdjsps.dita
index 07a94f1..d7224f0 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cpdjsps.dita
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cpdjsps.dita
@@ -1,12 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"

  "concept.dtd">

 <concept id="cpdjsps" xml:lang="en-us">

 <title>JavaServer Pages (JSP) technology</title>

 <prolog><metadata>

-<keywords><indexterm>JSP pages<indexterm>overview</indexterm></indexterm>

-<indexterm>Web content<indexterm>generating dynamically</indexterm></indexterm>

+<keywords><indexterm keyref="cpdjsps|1|JSPpagesoverview" status="changed">JSP

+files<indexterm>overview</indexterm></indexterm><indexterm keyref="cpdjsps|2|Webcontentgeneratingdynamically"

+status="new">Web content<indexterm>generating dynamically</indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <conbody>

diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cpdjsps.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cpdjsps.html
index 183a375..50dc629 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cpdjsps.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cpdjsps.html
@@ -2,15 +2,19 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="concept" name="DC.Type" />
 <meta name="DC.Title" content="JavaServer Pages (JSP) technology" />
-<meta content="JavaServer pages, overview, dynamic Web content, generating" name="DC.subject" />
-<meta content="JavaServer pages, overview, dynamic Web content, generating" name="keywords" />
+<meta content="JSP files, overview, Web content, generating dynamically" name="DC.subject" />
+<meta content="JSP files, overview, Web content, generating dynamically" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwservbn.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwlistbn.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwfiltbn.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/tjcrejsp.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="cpdjsps" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -58,6 +62,15 @@
 
 </div>
 
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/cwservbn.html" title="">Servlets</a></div>
+<div><a href="../topics/cwlistbn.html" title="">Listeners</a></div>
+<div><a href="../topics/cwfiltbn.html" title="">Listeners</a></div>
+</div>
+<div class="reltasks"><strong>Related tasks</strong><br />
+<div><a href="../topics/tjcrejsp.html">Creating JavaServer Pages (JSP) files</a></div>
+</div>
+</div>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebartifact.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebartifact.dita
new file mode 100644
index 0000000..1b4bdaf
--- /dev/null
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebartifact.dita
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>

+<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"

+ "concept.dtd">

+<!-- ArborText, Inc., 1988-2002, v.4002 -->

+<concept id="cwebartifact" xml:lang="en-us">

+<title>Creating Web Artifacts</title>

+<conbody>

+<p>Contents:</p>

+<ul>

+<li><xref href="twsrvwiz.dita" scope="peer"><desc></desc>Creating Servlets</xref></li>

+<li><xref href="twlstwiz.dita" scope="peer"><desc></desc>Creating Listeners</xref></li>

+<li><xref href="twfltwiz.dita" scope="peer"><desc></desc>Creating Filters</xref></li>

+</ul>

+</conbody>

+</concept>

diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebartifact.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebartifact.html
new file mode 100644
index 0000000..0adf749
--- /dev/null
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebartifact.html
@@ -0,0 +1,39 @@
+<?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 lang="en-us" xml:lang="en-us">
+<head>
+<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta content="public" name="security" />
+<meta content="index,follow" name="Robots" />
+<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
+<meta content="concept" name="DC.Type" />
+<meta name="DC.Title" content="Creating Web Artifacts" />
+<meta content="XHTML" name="DC.Format" />
+<meta content="cwebartifact" name="DC.Identifier" />
+<meta content="en-us" name="DC.Language" />
+<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
+<title>Creating Web Artifacts</title>
+</head>
+<body id="cwebartifact"><a name="cwebartifact"><!-- --></a>
+
+
+<h1 class="topictitle1">Creating Web Artifacts</h1>
+
+<div>
+<p>Contents:</p>
+
+<ul>
+<li><a href="twsrvwiz.html" title="">Creating Servlets</a></li>
+
+<li><a href="twlstwiz.html" title="">Creating Listeners</a></li>
+
+<li><a href="twfltwiz.html" title="">Creating Filters</a></li>
+
+</ul>
+
+</div>
+
+
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebpagedesign.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebpagedesign.html
index 4e33359..b2e217f 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebpagedesign.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebpagedesign.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,6 +11,7 @@
 <meta name="DC.Title" content="Web page design" />
 <meta content="Web page design, overview" name="DC.subject" />
 <meta content="Web page design, overview" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/tjdetags.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="cwebpagedesign" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -36,6 +37,10 @@
 
 </div>
 
+<div><div class="reltasks"><strong>Related tasks</strong><br />
+<div><a href="../topics/tjdetags.html" title="">Creating and editing Web pages - overview</a></div>
+</div>
+</div>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebprojects.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebprojects.dita
index 99b82cd..4058610 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebprojects.dita
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebprojects.dita
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"

  "concept.dtd">

 <concept id="cwebprojects" xml:lang="en-us">

@@ -18,7 +18,7 @@
 will use more complicated, dynamic Web technologies, such as JavaServer Pages

 files, and possibly data access resources.</p>

 <p>Though the Web project is structured on your file system in compliance

-with the J2EE Web application standard for deployment purposes, the Project

+with the Java EE Web application standard for deployment purposes, the Project

 Explorer view is designed to show the most convenient display of project resources

 for use while you are actually developing the Web application. When you are

 finished developing your Web application, you use the Web project to deploy

diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebprojects.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebprojects.html
index 782fcfe..09bfae2 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebprojects.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebprojects.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,6 +11,11 @@
 <meta name="DC.Title" content="Web projects" />
 <meta content="Web projects, overview, Web applications, creating or importing" name="DC.subject" />
 <meta content="Web projects, overview, Web applications, creating or importing" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/ccstatic.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/ccwebprj.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwwarovr.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twcresta.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twcreprj.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="cwebprojects" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -33,7 +38,7 @@
 files, and possibly data access resources.</p>
 
 <p>Though the Web project is structured on your file system in compliance
-with the J2EE Web application standard for deployment purposes, the Project
+with the Java EE Web application standard for deployment purposes, the Project
 Explorer view is designed to show the most convenient display of project resources
 for use while you are actually developing the Web application. When you are
 finished developing your Web application, you use the Web project to deploy
@@ -42,6 +47,16 @@
 
 </div>
 
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/ccstatic.html" title="">Static Web projects</a></div>
+<div><a href="../topics/ccwebprj.html" title="">Dynamic Web projects and applications</a></div>
+<div><a href="../topics/cwwarovr.html" title="">Web archive (WAR) files</a></div>
+</div>
+<div class="reltasks"><strong>Related tasks</strong><br />
+<div><a href="../topics/twcresta.html">Creating a static Web project</a></div>
+<div><a href="../topics/twcreprj.html">Creating a dynamic 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/cwebresources.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebresources.html
index c288bc0..1d3300b 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwebresources.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cwebresources.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,6 +11,7 @@
 <meta name="DC.Title" content="Web resources" />
 <meta content="Web resources, overview" name="DC.subject" />
 <meta content="Web resources, overview" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwwarovr.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="cwebresources" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -39,6 +40,10 @@
 
 </div>
 
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/cwwarovr.html" title="">Web archive (WAR) files</a></div>
+</div>
+</div>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwfiltbn.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cwfiltbn.dita
new file mode 100644
index 0000000..5cd875a
--- /dev/null
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cwfiltbn.dita
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>

+<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"

+ "concept.dtd">

+<concept id="cwfiltbn" xml:lang="en-us">

+<title>Listeners</title>

+<prolog><metadata>

+<keywords><indexterm>filters<indexterm>overview</indexterm></indexterm>

+</keywords>

+</metadata></prolog>

+<conbody>

+<p>Filters are new in the <cite>Sun Microsystems Java Servlet

+2.3 Specification</cite>. They enable you to intercept to intercept a

+request before it reaches a resource. In other words, a filter gives you

+access to the HttpServletRequest and the HttpServletResponse objects

+before they are passed on to a servlet.</p>

+<p>Filters can be very useful. For example, you can write a filter

+that records all incoming requests and logs the IP addresses of the

+computers from which the requests originate. You also can use a filter

+as an encryption and decryption device. Other uses include user

+authentication, data compression, user input validation, and so on.</p>

+<p>You also can put a set of filters in a chain. The first filter in

+the chain will be called first and then pass control to the second

+filter, and so on. Filter chaining ensures that you can write a filter

+that does a specific task but adds some functionality in another filter.</p>

+<p>When writing a filter, you basically deal with the

+following three interfaces in the javax.servlet package:

+<ul>

+	<li><b>javax.servlet.Filter:</b> represents the

+	life-cycle of the filter.</li>

+	<li><b>javax.servlet.FilterConfig:</b> represents the

+	configuration of the filter.</li>

+	<li><b>javax.servlet.FilterChain:</b> object provided by

+	the servlet container to the developer giving a view into the

+	invocation chain of a filtered request for a resource.</li>

+</ul></p>

+<p>For more information about filters, refer to the <cite>Sun Microsystems <tm

+tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> Servlet

+2.3 Specification</cite> at <codeph>java.sun.com/products/servlet/download.html</codeph>.</p>

+</conbody>

+</concept>

diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwfiltbn.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwfiltbn.html
new file mode 100644
index 0000000..54a5228
--- /dev/null
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cwfiltbn.html
@@ -0,0 +1,84 @@
+<?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 lang="en-us" xml:lang="en-us">
+<head>
+<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta content="public" name="security" />
+<meta content="index,follow" name="Robots" />
+<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
+<meta content="concept" name="DC.Type" />
+<meta name="DC.Title" content="Listeners" />
+<meta content="filters, overview" name="DC.subject" />
+<meta content="filters, overview" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwservbn.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwlistbn.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/ccwtover.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twsrvwiz.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twlstwiz.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twfltwiz.html" />
+<meta content="XHTML" name="DC.Format" />
+<meta content="cwfiltbn" name="DC.Identifier" />
+<meta content="en-us" name="DC.Language" />
+<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
+<title>Listeners</title>
+</head>
+<body id="cwfiltbn"><a name="cwfiltbn"><!-- --></a>
+
+
+<h1 class="topictitle1">Listeners</h1>
+
+
+<div>
+<p>Filters are new in the <cite>Sun Microsystems Java Servlet
+2.3 Specification</cite>. They enable you to intercept to intercept a
+request before it reaches a resource. In other words, a filter gives you
+access to the HttpServletRequest and the HttpServletResponse objects
+before they are passed on to a servlet.</p>
+
+<p>Filters can be very useful. For example, you can write a filter
+that records all incoming requests and logs the IP addresses of the
+computers from which the requests originate. You also can use a filter
+as an encryption and decryption device. Other uses include user
+authentication, data compression, user input validation, and so on.</p>
+
+<p>You also can put a set of filters in a chain. The first filter in
+the chain will be called first and then pass control to the second
+filter, and so on. Filter chaining ensures that you can write a filter
+that does a specific task but adds some functionality in another filter.</p>
+
+<div class="p">When writing a filter, you basically deal with the
+following three interfaces in the javax.servlet package:
+<ul>
+	<li><strong>javax.servlet.Filter:</strong> represents the
+	life-cycle of the filter.</li>
+
+	<li><strong>javax.servlet.FilterConfig:</strong> represents the
+	configuration of the filter.</li>
+
+	<li><strong>javax.servlet.FilterChain:</strong> object provided by
+	the servlet container to the developer giving a view into the
+	invocation chain of a filtered request for a resource.</li>
+
+</ul>
+</div>
+
+<p>For more information about filters, refer to the <cite>Sun Microsystems Java™ Servlet
+2.3 Specification</cite> at <samp class="codeph">java.sun.com/products/servlet/download.html</samp>.</p>
+
+</div>
+
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/cwservbn.html" title="">Servlets</a></div>
+<div><a href="../topics/cwlistbn.html" title="">Listeners</a></div>
+<div><a href="../topics/ccwtover.html" title="">Web application overview</a></div>
+</div>
+<div class="reltasks"><strong>Related tasks</strong><br />
+<div><a href="../topics/twsrvwiz.html">Creating Servlets</a></div>
+<div><a href="../topics/twlstwiz.html">Creating Listeners</a></div>
+<div><a href="../topics/twfltwiz.html">Creating Filters</a></div>
+</div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwlistbn.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cwlistbn.dita
new file mode 100644
index 0000000..c7a5132
--- /dev/null
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cwlistbn.dita
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>

+<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"

+ "concept.dtd">

+<concept id="cwlistbn" xml:lang="en-us">

+<title>Listeners</title>

+<prolog><metadata>

+<keywords><indexterm>listeners<indexterm>overview</indexterm></indexterm>

+</keywords>

+</metadata></prolog>

+<conbody>

+<p>Listeners are new feature in the <cite>Sun

+Microsystems <tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm"

+trademark="Java">Java</tm> Servlet 2.3 Specification</cite>. A listener can be used to monitor and

+react to events in a servlet's life-cycle by defining methods that get

+invoked when life-cycle events occur. Support for application level

+events is defined in the Java Servlet Specification 2.3.</p>

+<p>Application event listeners are classes that

+implement one or more of the servlet event listener interfaces. Servlet

+event listeners support notification for state changes in the

+<b>ServletContext</b> and <b>HttpSession</b> objects, specifically:

+<ul>

+	<li><b>Servlet context listeners</b> are used to manage resources or state held at a VM

+	level for the application.</li>

+	<li><b>HTTP session	listeners</b> are used to manage state or resources associated with a

+	series of requests made in a Web application from the same client or

+	user.</li>

+</ul></p>

+<p>For more information about listeners, refer to the <cite>Sun Microsystems <tm

+tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> Servlet

+2.3 Specification</cite> at <codeph>java.sun.com/products/servlet/download.html</codeph>.</p>

+</conbody>

+</concept>

diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwlistbn.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwlistbn.html
new file mode 100644
index 0000000..c21109d
--- /dev/null
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cwlistbn.html
@@ -0,0 +1,72 @@
+<?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 lang="en-us" xml:lang="en-us">
+<head>
+<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta content="public" name="security" />
+<meta content="index,follow" name="Robots" />
+<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
+<meta content="concept" name="DC.Type" />
+<meta name="DC.Title" content="Listeners" />
+<meta content="listeners, overview" name="DC.subject" />
+<meta content="listeners, overview" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwservbn.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwfiltbn.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/ccwtover.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twsrvwiz.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twlstwiz.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twfltwiz.html" />
+<meta content="XHTML" name="DC.Format" />
+<meta content="cwlistbn" name="DC.Identifier" />
+<meta content="en-us" name="DC.Language" />
+<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
+<title>Listeners</title>
+</head>
+<body id="cwlistbn"><a name="cwlistbn"><!-- --></a>
+
+
+<h1 class="topictitle1">Listeners</h1>
+
+
+<div>
+<p>Listeners are new feature in the <cite>Sun
+Microsystems Java™ Servlet 2.3 Specification</cite>. A listener can be used to monitor and
+react to events in a servlet's life-cycle by defining methods that get
+invoked when life-cycle events occur. Support for application level
+events is defined in the Java Servlet Specification 2.3.</p>
+
+<div class="p">Application event listeners are classes that
+implement one or more of the servlet event listener interfaces. Servlet
+event listeners support notification for state changes in the
+<strong>ServletContext</strong> and <strong>HttpSession</strong> objects, specifically:
+<ul>
+	<li><strong>Servlet context listeners</strong> are used to manage resources or state held at a VM
+	level for the application.</li>
+
+	<li><strong>HTTP session	listeners</strong> are used to manage state or resources associated with a
+	series of requests made in a Web application from the same client or
+	user.</li>
+
+</ul>
+</div>
+
+<p>For more information about listeners, refer to the <cite>Sun Microsystems Java Servlet
+2.3 Specification</cite> at <samp class="codeph">java.sun.com/products/servlet/download.html</samp>.</p>
+
+</div>
+
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/cwservbn.html" title="">Servlets</a></div>
+<div><a href="../topics/cwfiltbn.html" title="">Listeners</a></div>
+<div><a href="../topics/ccwtover.html" title="">Web application overview</a></div>
+</div>
+<div class="reltasks"><strong>Related tasks</strong><br />
+<div><a href="../topics/twsrvwiz.html">Creating Servlets</a></div>
+<div><a href="../topics/twlstwiz.html">Creating Listeners</a></div>
+<div><a href="../topics/twfltwiz.html">Creating Filters</a></div>
+</div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwservbn.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cwservbn.dita
index fb05e74..41b5813 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwservbn.dita
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cwservbn.dita
@@ -1,13 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"

  "concept.dtd">

 <concept id="cwservbn" xml:lang="en-us">

 <title>Servlets</title>

 <prolog><metadata>

-<keywords><indexterm>servlets<indexterm>overview</indexterm></indexterm>

-<indexterm>Web servers<indexterm>generating dynamic content</indexterm></indexterm>

-</keywords>

+<keywords><indexterm>servlets<indexterm>overview</indexterm></indexterm><indexterm>Web

+servers<indexterm>generating dynamic content</indexterm></indexterm></keywords>

 </metadata></prolog>

 <conbody>

 <p>Servlets are server-side <tm tmclass="special" tmowner="Sun Microsystems, Inc."

@@ -34,10 +33,10 @@
 </ul>Using this paradigm, you may choose to have business logic handled by <tm

 tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> beans,

 the presentation logic handled by JavaServer Pages (JSP) or HTML files, and

-the HTTP protocol handled by a servlet. <note>JSP files can be used to manage

-both the presentation and business logic for a Web application. JSP files

-use structured markup for presentation, and supply servlet model behavior

-at run time.</note></p>

+the HTTP protocol handled by a servlet.</p>

+<note>JSP files can be used to manage both the presentation and business logic

+for a Web application. JSP files use structured markup for presentation, and

+supply servlet model behavior at run time.</note>

 <p>You can develop, debug, and deploy servlets, set breakpoints within servlet

 objects, and step through code to make changes that are dynamically folded

 into the running servlet on a running server, without having to restart each

diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwservbn.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwservbn.html
index 3ab7815..a471e78 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwservbn.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cwservbn.html
@@ -2,15 +2,21 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="concept" name="DC.Type" />
 <meta name="DC.Title" content="Servlets" />
-<meta content="servlets, overview, dynamic content" name="DC.subject" />
-<meta content="servlets, overview, dynamic content" name="keywords" />
+<meta content="servlets, overview, Web servers, generating dynamic content" name="DC.subject" />
+<meta content="servlets, overview, Web servers, generating dynamic content" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwlistbn.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwfiltbn.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/ccwtover.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twsrvwiz.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twlstwiz.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twfltwiz.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="cwservbn" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -48,11 +54,11 @@
 </ul>
 Using this paradigm, you may choose to have business logic handled by Java beans,
 the presentation logic handled by JavaServer Pages (JSP) or HTML files, and
-the HTTP protocol handled by a servlet. <div class="note"><span class="notetitle">Note:</span> JSP files can be used to manage
-both the presentation and business logic for a Web application. JSP files
-use structured markup for presentation, and supply servlet model behavior
-at run time.</div>
-</div>
+the HTTP protocol handled by a servlet.</div>
+
+<div class="note"><span class="notetitle">Note:</span> JSP files can be used to manage both the presentation and business logic
+for a Web application. JSP files use structured markup for presentation, and
+supply servlet model behavior at run time.</div>
 
 <p>You can develop, debug, and deploy servlets, set breakpoints within servlet
 objects, and step through code to make changes that are dynamically folded
@@ -64,6 +70,17 @@
 
 </div>
 
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/cwlistbn.html" title="">Listeners</a></div>
+<div><a href="../topics/cwfiltbn.html" title="">Listeners</a></div>
+<div><a href="../topics/ccwtover.html" title="">Web application overview</a></div>
+</div>
+<div class="reltasks"><strong>Related tasks</strong><br />
+<div><a href="../topics/twsrvwiz.html">Creating Servlets</a></div>
+<div><a href="../topics/twlstwiz.html">Creating Listeners</a></div>
+<div><a href="../topics/twfltwiz.html">Creating Filters</a></div>
+</div>
+</div>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwtfeatures.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cwtfeatures.dita
index 623bc9f..a26e416 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwtfeatures.dita
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cwtfeatures.dita
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"

  "concept.dtd">

 <!-- ArborText, Inc., 1988-2002, v.4002 -->

@@ -14,9 +14,9 @@
 <conbody>

 <p>The Web development environment provides the following high-level capabilities:

  <ul>

-<li>Dynamic Web project creation, using the J2EE-defined hierarchy, or a static

-version that reduces project overhead when dynamic elements are not required.

- Static Web projects can later be converted to dynamic Web projects.<p></p></li>

+<li>Dynamic Web project creation, using the Java EE-defined hierarchy, or

+a static version that reduces project overhead when dynamic elements are not

+required.  Static Web projects can later be converted to dynamic Web projects.<p></p></li>

 <li>Creation and editing of a Web application deployment descriptor (<filepath>web.xml</filepath>)

  file<p></p></li>

 <li>JSP and HTML file creation, validation, editing, and debugging<p></p></li>

diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwtfeatures.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwtfeatures.html
index ab3323d..6532e5a 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwtfeatures.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cwtfeatures.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,15 @@
 <meta name="DC.Title" content="Web tools features" />
 <meta name="abstract" content="The integrated Web development environment makes it easy to cooperatively create, assemble, publish, deploy and maintain dynamic, interactive Web applications." />
 <meta name="description" content="The integrated Web development environment makes it easy to cooperatively create, assemble, publish, deploy and maintain dynamic, interactive Web applications." />
-<meta content="Web tools, features and capabilities" name="DC.subject" />
-<meta content="Web tools, features and capabilities" name="keywords" />
+<meta content="Web tools, features" name="DC.subject" />
+<meta content="Web tools, features" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/ccwebprj.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwebpagedesign.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twcreprj.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/tjcrejsp.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twsrvwiz.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twlstwiz.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twfltwiz.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="cwtfeatures" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -31,9 +38,9 @@
 
 <div class="p">The Web development environment provides the following high-level capabilities:
  <ul>
-<li>Dynamic Web project creation, using the J2EE-defined hierarchy, or a static
-version that reduces project overhead when dynamic elements are not required.
- Static Web projects can later be converted to dynamic Web projects.<p />
+<li>Dynamic Web project creation, using the Java EE-defined hierarchy, or
+a static version that reduces project overhead when dynamic elements are not
+required.  Static Web projects can later be converted to dynamic Web projects.<p />
 </li>
 
 <li>Creation and editing of a Web application deployment descriptor (<span class="filepath">web.xml</span>)
@@ -75,6 +82,18 @@
 
 </div>
 
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/ccwebprj.html" title="">Dynamic Web projects and applications</a></div>
+<div><a href="../topics/cwebpagedesign.html" title="">Web page design</a></div>
+</div>
+<div class="reltasks"><strong>Related tasks</strong><br />
+<div><a href="../topics/twcreprj.html">Creating a dynamic Web project</a></div>
+<div><a href="../topics/tjcrejsp.html">Creating JavaServer Pages (JSP) files</a></div>
+<div><a href="../topics/twsrvwiz.html">Creating Servlets</a></div>
+<div><a href="../topics/twlstwiz.html">Creating Listeners</a></div>
+<div><a href="../topics/twfltwiz.html">Creating Filters</a></div>
+</div>
+</div>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwwarovr.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cwwarovr.dita
index 23e1ee0..6f1adf5 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwwarovr.dita
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cwwarovr.dita
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"

  "concept.dtd">

 <concept id="cwwarovr" xml:lang="en-us">

@@ -18,7 +18,7 @@
 deployment information, MIME types, session configuration details, and other

 settings for a Web application. The Web deployment descriptor file (<filepath>web.xml</filepath>)

 provides information about the WAR file is shared with the developers, assemblers,

-and deployers in a J2EE environment.</p>

+and deployers in a Java EE environment.</p>

 <p>The Web development environment provides facilities for importing and exporting

 WAR files, using the following wizards: <ul>

 <li><ph>Import Resources from a WAR File</ph>, which requires that you to

diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwwarovr.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwwarovr.html
index 16d50c5..d5b5d63 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwwarovr.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cwwarovr.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,6 +11,9 @@
 <meta name="DC.Title" content="Web archive (WAR) files" />
 <meta content="WAR files, overview" name="DC.subject" />
 <meta content="WAR files, overview" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwebresources.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twimpwar.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twcrewar.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="cwwarovr" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -34,7 +37,7 @@
 deployment information, MIME types, session configuration details, and other
 settings for a Web application. The Web deployment descriptor file (<span class="filepath">web.xml</span>)
 provides information about the WAR file is shared with the developers, assemblers,
-and deployers in a J2EE environment.</p>
+and deployers in a Java EE environment.</p>
 
 <div class="p">The Web development environment provides facilities for importing and exporting
 WAR files, using the following wizards: <ul>
@@ -50,6 +53,14 @@
 
 </div>
 
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/cwebresources.html" title="">Web resources</a></div>
+</div>
+<div class="reltasks"><strong>Related tasks</strong><br />
+<div><a href="../topics/twimpwar.html">Importing Web archive (WAR) files</a></div>
+<div><a href="../topics/twcrewar.html">Exporting Web Archive (WAR) files</a></div>
+</div>
+</div>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwwedtvw.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/cwwedtvw.dita
index 7c8ea61..d3733dd 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwwedtvw.dita
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cwwedtvw.dita
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"

  "concept.dtd">

 <concept id="cwwedtvw" xml:lang="en-us">

 <title>Workbench integration with Web editors</title>

 <prolog><metadata>

-<keywords><indexterm>Web editors<indexterm>workbench integration</indexterm></indexterm>

-</keywords>

+<keywords><indexterm keyref="cwwedtvw|1|Webeditorsworkbenchintegration" status="changed">workbench<indexterm>Web

+editors</indexterm></indexterm></keywords>

 </metadata></prolog>

 <conbody>

 <p>There are several editors for use in various contexts for various file

diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/cwwedtvw.html b/docs/org.eclipse.wst.webtools.doc.user/topics/cwwedtvw.html
index 546ffce..a911f51 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/cwwedtvw.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/cwwedtvw.html
@@ -2,15 +2,15 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="concept" name="DC.Type" />
 <meta name="DC.Title" content="Workbench integration with Web editors" />
-<meta content="Web editors, workbench integration" name="DC.subject" />
-<meta content="Web editors, workbench integration" name="keywords" />
+<meta content="workbench, Web editors" name="DC.subject" />
+<meta content="workbench, Web editors" name="keywords" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="cwwedtvw" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tjchgxdt.html b/docs/org.eclipse.wst.webtools.doc.user/topics/tjchgxdt.html
index 00a974d..4ecbf9a 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tjchgxdt.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/tjchgxdt.html
@@ -1,23 +1,30 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html
-  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
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
-<link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css"/>
+<?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 lang="en-us" xml:lang="en-us">
+<head>
+<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta content="public" name="security" />
+<meta content="index,follow" name="Robots" />
+<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
+<meta content="task" name="DC.Type" />
+<meta name="DC.Title" content="Specifying an implicit document type for an HTML, XHTML, or JSP fragment" />
+<meta content="DOCTYPE declarations, implicit for fragments, document types, HTML fragments, implicit document types, JSP fragments, XHTML fragments, implicit document type for fragments" name="DC.subject" />
+<meta content="DOCTYPE declarations, implicit for fragments, document types, HTML fragments, implicit document types, JSP fragments, XHTML fragments, implicit document type for fragments" name="keywords" />
+<meta content="XHTML" name="DC.Format" />
+<meta content="tjchgxdt" name="DC.Identifier" />
+<meta content="en-us" name="DC.Language" />
+<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
 <title>Specifying an implicit document type for an HTML, XHTML, or JSP fragment</title>
 </head>
 <body id="tjchgxdt"><a name="tjchgxdt"><!-- --></a>
+
+
 <h1 class="topictitle1">Specifying an implicit document type for an HTML, XHTML, or JSP fragment</h1>
-<div><div class="section"> <p>An <em>implicit</em> document type is used for content assist (CTRL+Spacebar),
+
+
+<div>
+<div class="section"> <p>An <em>implicit</em> document type is used for content assist (CTRL+Spacebar),
 the Properties view, and other editing contexts when no DOCTYPE declaration
 is specified in an HTML, XHTML, or JSP file. Typically, this feature is used
 for a fragment (partial document) that can be included in other pages using
@@ -25,20 +32,29 @@
 <p>To assign an implicit document type
 to an HTML, XHTML, or JSP fragment, do the following: </p>
  </div>
-<ol><li class="stepexpand"><span>From the Project Explorer view, select the HTML, XHTML, or JSP
+
+<ol>
+<li class="stepexpand"><span>From the Project Explorer view, select the HTML, XHTML, or JSP
 fragment.</span></li>
-<li class="stepexpand"><span>Select <span><b>Properties</b></span> from the file's
+
+<li class="stepexpand"><span>Select <span><span class="uicontrol">Properties</span></span> from the file's
 pop-up menu.</span></li>
-<li class="stepexpand"><span>In the <b>Web Content Settings</b> page, select
-the desired DOCTYPE from the <span><b>Document type</b></span> drop-down
-list.</span> <p>The <span><b>Properties</b></span> dialog
-for Web projects also includes an <span><b>Web Content Settings</b></span> page,
+
+<li class="stepexpand"><span>In the <span class="uicontrol">Web Content Settings</span> page, select
+the desired DOCTYPE from the <span><span class="uicontrol">Document type</span></span> drop-down
+list.</span> <p>The <span><span class="uicontrol">Properties</span></span> dialog
+for Web projects also includes an <span><span class="uicontrol">Web Content Settings</span></span> page,
 where you can specify project-default HTML document type. This setting will
 be used if no DOCTYPE declaration is specified in the file, and no default
-document type is specified in the <span><b>Web Content Settings</b></span> page
-on the <span><b>Properties</b></span> dialog for the file.</p>
+document type is specified in the <span><span class="uicontrol">Web Content Settings</span></span> page
+on the <span><span class="uicontrol">Properties</span></span> dialog for the file.</p>
+
 </li>
+
 </ol>
+
 </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/tjcrehtm.html b/docs/org.eclipse.wst.webtools.doc.user/topics/tjcrehtm.html
index 8af7382..e75e8f8 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tjcrehtm.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/tjcrehtm.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Creating HTML and XHTML files and framesets" />
 <meta name="abstract" content="You can use the New HTML File wizard to create HTML and XHTML files and framesets." />
 <meta name="description" content="You can use the New HTML File wizard to create HTML and XHTML files and framesets." />
-<meta content="HTML files, creating, XHTML files, WML files, framesets" name="DC.subject" />
-<meta content="HTML files, creating, XHTML files, WML files, framesets" name="keywords" />
+<meta content="framesets, creating, HTML, creating files, WML, XHTML" name="DC.subject" />
+<meta content="framesets, creating, HTML, creating files, WML, XHTML" name="keywords" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="tjcrehtm" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -69,6 +69,7 @@
 
 </div>
 
+<div />
 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tjcrejsp.html b/docs/org.eclipse.wst.webtools.doc.user/topics/tjcrejsp.html
index 0c56302..f037f4b 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tjcrejsp.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/tjcrejsp.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,6 +11,8 @@
 <meta name="DC.Title" content="Creating JavaServer Pages (JSP) files" />
 <meta content="JSP files, creating" name="DC.subject" />
 <meta content="JSP files, creating" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twcreprj.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cpdjsps.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="tjcrejsp" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -67,6 +69,13 @@
 
 </div>
 
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/cpdjsps.html">JavaServer Pages (JSP) technology</a></div>
+</div>
+<div class="reltasks"><strong>Related tasks</strong><br />
+<div><a href="../topics/twcreprj.html" title="You create and maintain the resources for your Web applications in Web projects.">Creating a dynamic 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/tjdetags.html b/docs/org.eclipse.wst.webtools.doc.user/topics/tjdetags.html
index 14cec57..e14ff9c 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tjdetags.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/tjdetags.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2007 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2007" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,6 +11,7 @@
 <meta name="DC.Title" content="Creating and editing Web pages - overview" />
 <meta content="Web pages, creating" name="DC.subject" />
 <meta content="Web pages, creating" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/ccwtover.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="tjdetags" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -43,6 +44,10 @@
 
 </div>
 
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/ccwtover.html" title="">Web application overview</a></div>
+</div>
+</div>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tjprefs.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/tjprefs.dita
index 94e4948..02c73d4 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tjprefs.dita
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/tjprefs.dita
@@ -1,19 +1,19 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

-<!-- ArborText, Inc.,  1988-2002, v.4002-->

 <task id="tjprefs" xml:lang="en-us">

 <title>Defining HTML file preferences</title>

 <prolog><metadata>

-<keywords>

-</keywords>

+<keywords><indexterm keyref="tjprefs|1|DOCTYPEdeclarationsaddingautomatically"

+status="new">DOCTYPE declarations<indexterm>adding automatically</indexterm></indexterm>

+<indexterm keyref="tjprefs|2|HTMLfileseditingpreferences" status="changed">HTML<indexterm>editing

+preferences</indexterm></indexterm></keywords>

 </metadata></prolog>

 <taskbody>

-<context> <p><indexterm>DOCTYPE declarations<indexterm>adding automatically</indexterm></indexterm>

-<indexterm>HTML files<indexterm>editing preferences</indexterm></indexterm>

-To define general HTML file preferences, complete the following

-steps::</p></context>

+<context> <p><indexterm>DOCTYPE declarations<indexterm>adding automatically</indexterm></indexterm> <indexterm>HTML

+files<indexterm>editing preferences</indexterm></indexterm> To define general

+HTML file preferences, complete the following steps:</p></context>

 <steps>

 <step><cmd>From the <uicontrol>Window</uicontrol> menu, select <uicontrol>Preferences</uicontrol>.</cmd>

 </step>

diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tjprefs.html b/docs/org.eclipse.wst.webtools.doc.user/topics/tjprefs.html
index 65ab12d..772f123 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tjprefs.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/tjprefs.html
@@ -2,13 +2,15 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="task" name="DC.Type" />
 <meta name="DC.Title" content="Defining HTML file preferences" />
+<meta content="DOCTYPE declarations, adding automatically, HTML, editing preferences" name="DC.subject" />
+<meta content="DOCTYPE declarations, adding automatically, HTML, editing preferences" name="keywords" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="tjprefs" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -22,9 +24,8 @@
 
 
 <div>
-<div class="section"> <p>
-To define general HTML file preferences, complete the following
-steps::</p>
+<div class="section"> <p>  To define general
+HTML file preferences, complete the following steps:</p>
 </div>
 
 <ol>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tservertarget.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/tservertarget.dita
index 3c481d7..9671718 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tservertarget.dita
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/tservertarget.dita
@@ -1,15 +1,15 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"

  "concept.dtd">

 <concept id="tservertarget" xml:lang="en-us">

 <title>Server targeting for Web applications</title>

 <prolog><metadata>

-<keywords><indexterm>servers<indexterm>targeting</indexterm></indexterm><indexterm>Web applications<indexterm>server targeting</indexterm></indexterm>

-</keywords>

+<keywords><indexterm>servers<indexterm>targeting</indexterm></indexterm><indexterm>Web

+applications<indexterm>server targeting</indexterm></indexterm></keywords>

 </metadata></prolog>

 <conbody>

-<p>To support different J2EE application servers, the J2EE tooling allows

+<p>To support different Java EE application servers, the Java EE tooling allows

 you to target a specific server during your Enterprise Application (EAR) project

 development. In most cases, a Web project must target the same server as the

 EAR project in order to deploy the Web application to the server properly. </p>

diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/tservertarget.html b/docs/org.eclipse.wst.webtools.doc.user/topics/tservertarget.html
index 6980747..808fc08 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tservertarget.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/tservertarget.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,6 +11,7 @@
 <meta name="DC.Title" content="Server targeting for Web applications" />
 <meta content="servers, targeting, Web applications, server targeting" name="DC.subject" />
 <meta content="servers, targeting, Web applications, server targeting" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/twcreprj.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="tservertarget" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -24,7 +25,7 @@
 
 
 <div>
-<p>To support different J2EE application servers, the J2EE tooling allows
+<p>To support different Java EE application servers, the Java EE tooling allows
 you to target a specific server during your Enterprise Application (EAR) project
 development. In most cases, a Web project must target the same server as the
 EAR project in order to deploy the Web application to the server properly. </p>
@@ -36,6 +37,10 @@
 
 </div>
 
+<div><div class="reltasks"><strong>Related tasks</strong><br />
+<div><a href="../topics/twcreprj.html" title="You create and maintain the resources for your Web applications in Web projects.">Creating a dynamic 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/tstylesheet.html b/docs/org.eclipse.wst.webtools.doc.user/topics/tstylesheet.html
index d3aa09b..46f0a0c 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/tstylesheet.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/tstylesheet.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twcreprj.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/twcreprj.dita
index e2b3add..7cc3b3a 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twcreprj.dita
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/twcreprj.dita
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <!-- ArborText, Inc., 1988-2002, v.4002-->

@@ -9,9 +9,7 @@
 in Web projects.</shortdesc>

 <prolog><metadata>

 <keywords><indexterm>Web projects<indexterm>creating dynamic projects</indexterm></indexterm>

-<indexterm>Web applications<indexterm>resources</indexterm></indexterm>

-

-</keywords>

+<indexterm>Web applications<indexterm>resources</indexterm></indexterm></keywords>

 </metadata></prolog>

 <taskbody>

 <context> <p> Unlike with <xref href="twcresta.dita" scope="peer"><desc></desc>static</xref> Web

@@ -19,7 +17,7 @@
 Pages and servlets.</p><p>To create a new dynamic Web project, complete the

 following steps:</p></context>

 <steps>

-<step><cmd>Open the J2EE perspective.</cmd></step>

+<step><cmd>Open the Java EE perspective.</cmd></step>

 <step><cmd>In the Project Explorer, right click on Dynamic Web Projects, and

 select <menucascade><uicontrol>New</uicontrol><uicontrol>Dynamic Web Project</uicontrol>

 </menucascade> from the context menu. The New Dynamic Web Project wizard starts.</cmd>

diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twcreprj.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twcreprj.html
index a4699b0..07ae7d1 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twcreprj.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/twcreprj.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,11 @@
 <meta name="DC.Title" content="Creating a dynamic Web project" />
 <meta name="abstract" content="You create and maintain the resources for your Web applications in Web projects." />
 <meta name="description" content="You create and maintain the resources for your Web applications in Web projects." />
-<meta content="dynamic Web projects, creating, Web projects, dynamic" name="DC.subject" />
-<meta content="dynamic Web projects, creating, Web projects, dynamic" name="keywords" />
+<meta content="Web projects, creating dynamic projects, Web applications, resources" name="DC.subject" />
+<meta content="Web projects, creating dynamic projects, Web applications, resources" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/tjcrejsp.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/ccstatic.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/ccwebprj.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="twcreprj" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -37,7 +40,7 @@
 </div>
 
 <ol>
-<li><span>Open the J2EE perspective.</span></li>
+<li><span>Open the Java EE perspective.</span></li>
 
 <li><span>In the Project Explorer, right click on Dynamic Web Projects, and
 select <span class="menucascade"><span class="uicontrol">New</span> &gt; <span class="uicontrol">Dynamic Web Project</span>
@@ -92,6 +95,14 @@
 
 </div>
 
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/ccstatic.html">Static Web projects</a></div>
+<div><a href="../topics/ccwebprj.html">Dynamic Web projects and applications</a></div>
+</div>
+<div class="reltasks"><strong>Related tasks</strong><br />
+<div><a href="../topics/tjcrejsp.html" title="">Creating JavaServer Pages (JSP) files</a></div>
+</div>
+</div>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twcresta.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/twcresta.dita
index f3e6b59..8be5130 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twcresta.dita
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/twcresta.dita
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <task id="twcresta" xml:lang="en-us">

@@ -17,7 +17,7 @@
 Static Web Project</uicontrol></ph> wizard. </p><p>To create a new static

 Web project, complete the following steps:</p></context>

 <steps>

-<step><cmd>Open the J2EE perspective </cmd><info></info></step>

+<step><cmd>Open the Java EE perspective </cmd><info></info></step>

 <step><cmd>In the Project Explorer, right click on Other Projects and select <b>New->Other->Web->Static

 Web Project</b> from the context menu. The New Static Web Project wizard starts. </cmd>

 </step>

diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twcresta.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twcresta.html
index 45e52f6..dd9af08 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twcresta.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/twcresta.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -13,6 +13,7 @@
 <meta name="description" content="" />
 <meta content="static Web projects, creating, Web projects, creating static" name="DC.subject" />
 <meta content="static Web projects, creating, Web projects, creating static" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/ccstatic.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="twcresta" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -37,7 +38,7 @@
 </div>
 
 <ol>
-<li class="stepexpand"><span>Open the J2EE perspective </span> </li>
+<li class="stepexpand"><span>Open the Java EE perspective </span> </li>
 
 <li class="stepexpand"><span>In the Project Explorer, right click on Other Projects and select <strong>New-&gt;Other-&gt;Web-&gt;Static
 Web Project</strong> from the context menu. The New Static Web Project wizard starts. </span>
@@ -75,6 +76,10 @@
 
 </div>
 
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/ccstatic.html">Static Web projects</a></div>
+</div>
+</div>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twcrewar.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twcrewar.html
index 15d4537..a3a6576 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twcrewar.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/twcrewar.html
@@ -2,15 +2,16 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="task" name="DC.Type" />
 <meta name="DC.Title" content="Exporting Web Archive (WAR) files" />
-<meta content="WAR files, exporting, War files, Web projects, exporting WAR files, War files" name="DC.subject" />
-<meta content="WAR files, exporting, War files, Web projects, exporting WAR files, War files" name="keywords" />
+<meta content="exporting, WAR files, Web projects, exporting WAR files" name="DC.subject" />
+<meta content="exporting, WAR files, Web projects, exporting WAR files" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwwarovr.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="twcrewar" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -51,6 +52,10 @@
 
 </div>
 
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/cwwarovr.html">Web archive (WAR) files</a></div>
+</div>
+</div>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twcvsr.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twcvsr.html
index bea54aa..236e52e 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twcvsr.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/twcvsr.html
@@ -2,15 +2,15 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="task" name="DC.Type" />
 <meta name="DC.Title" content="Setting CVS repository defaults" />
-<meta content="CVS, setting repository defaults, cvsignore file, creating" name="DC.subject" />
-<meta content="CVS, setting repository defaults, cvsignore file, creating" name="keywords" />
+<meta content="build output folders, ignoring in CVS, CVS, setting repository defaults, cvsignore files, creating, repositories, default CVS settings" name="DC.subject" />
+<meta content="build output folders, ignoring in CVS, CVS, setting repository defaults, cvsignore files, creating, repositories, default CVS settings" name="keywords" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="twcvsr" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twfltwiz.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/twfltwiz.dita
new file mode 100644
index 0000000..23c92fe
--- /dev/null
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/twfltwiz.dita
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>

+<!--Arbortext, Inc., 1988-2006, v.4002-->

+<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

+ "task.dtd">

+<task id="twfltwiz" xml:lang="en-us">

+<title>Creating Filters</title>

+<shortdesc>The filters wizard helps you to create <tm tmclass="special" tmowner="Sun Microsystems, Inc."

+tmtype="tm" trademark="Java">Java</tm> servlet filters by walking you through

+the creation process and by providing you with output files that you can use

+or that you can modify for use with your Web application. The filters can

+run on Java EE-compliant Web servers.</shortdesc>

+<prolog><metadata>

+<keywords><indexterm>servlets<indexterm>creating</indexterm></indexterm></keywords>

+</metadata></prolog>

+<taskbody>

+<context> <p>To create a filter, complete the following steps: </p></context>

+<steps>

+<step><cmd>In the Java EE perspective, expand your  <xref href="ccwebprj.dita"

+scope="peer"><desc></desc>dynamic project</xref> in the Project Explorer view.</cmd>

+</step>

+<step><cmd>Right click on the <b>Filter</b> icon, and select <menucascade>

+<uicontrol>New</uicontrol><uicontrol>Filter</uicontrol></menucascade> from

+the pop-up menu.</cmd><stepresult> The <uicontrol>Create Filter</uicontrol> wizard

+appears.</stepresult></step>

+<step><cmd>Follow the project wizard prompts.</cmd></step>

+</steps>

+<postreq><p><b>General Information</b></p><dl><dlentry>

+<dt>Modifiers</dt>

+<dd>The <cite>Sun Microsystems <tm tmclass="special" tmowner="Sun Microsystems, Inc."

+tmtype="tm" trademark="Java">Java</tm> Servlet 2.3 Specification</cite> states

+that a Servlet class must be <b>public</b> and not <b>abstract</b>. Therefore,

+you cannot change these modifiers. The only one available for change is the <b>final</b> modifier.</dd>

+</dlentry><dlentry>

+<dt>Interfaces</dt>

+<dd>There is one obligatory interface that filter classes must implement: <b>javax.servlet.Filter</b>.

+This interface is provided by javax.servlet package and is used to represent

+the life-cycle of the filter. This interface has three methods: init, doFilter

+and destroy. <ul>

+<li>The <b>init</b> method is called by the servlet container only once, when

+it finishes instantiating the filter.</li>

+<li>The<b>doFilter</b> method is where the filtering is performed and is called

+every time a user requests a resource, such as a servlet, to which the filter

+is mapped.</li>

+<li>The <b>destroy</b> method is called by the servlet container to tell the

+filter that it will be taken out of service.</li>

+</ul> Although, that the javax.servlet.Filter interface is provided in the <b>Interfaces</b> field

+by default, you can add additional interfaces to implement by using the <b>Add</b> button.</dd>

+</dlentry><dlentry>

+<dt>Interface selection dialog</dt>

+<dd>This dialog appears if you select to add an interface to your filter.

+As you type the name of the interface that you are adding, a list of available

+interfaces listed in the <b>Matching items</b> list box updates dynamically

+to display only the interfaces that match the pattern. Choose an interface

+to see the qualifier, and then click <b>OK</b> when finished.</dd>

+</dlentry><dlentry>

+<dt>Filter Mappings</dt>

+<dd>For a filter to intercept a request to a servlet, you must: <ol>

+<li>declare the filter with a <b>&lt;filter&gt;</b> element in the deployment

+descriptor</li>

+<li>map the filter to the servlet using the <b>&lt;filter-mapping&gt;</b> 

+element.</li>

+</ol> Sometimes you want a filter to work on multiple servlets. You can do

+this by mapping a filter to a URL pattern so that any request that matches

+that URL pattern will be filtered. All this is made automatically if you use

+the <b>Filter Mappings</b> field.</dd>

+</dlentry><dlentry>

+<dt>Method stubs</dt>

+<dd>Because each filter must implement the javax.servlet.Filter interface,

+the <b>Inherited abstract methods</b> option is always checked and cannot

+be changed.</dd>

+</dlentry></dl></postreq>

+</taskbody>

+</task>

diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twfltwiz.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twfltwiz.html
new file mode 100644
index 0000000..fcb8aa0
--- /dev/null
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/twfltwiz.html
@@ -0,0 +1,123 @@
+<?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 lang="en-us" xml:lang="en-us">
+<head>
+<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta content="public" name="security" />
+<meta content="index,follow" name="Robots" />
+<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
+<meta content="task" name="DC.Type" />
+<meta name="DC.Title" content="Creating Filters" />
+<meta name="abstract" content="The filters wizard helps you to create Java servlet filters by walking you through the creation process and by providing you with output files that you can use or that you can modify for use with your Web application. The filters can run on Java EE-compliant Web servers." />
+<meta name="description" content="The filters wizard helps you to create Java servlet filters by walking you through the creation process and by providing you with output files that you can use or that you can modify for use with your Web application. The filters can run on Java EE-compliant Web servers." />
+<meta content="servlets, creating" name="DC.subject" />
+<meta content="servlets, creating" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwfiltbn.html" />
+<meta content="XHTML" name="DC.Format" />
+<meta content="twfltwiz" name="DC.Identifier" />
+<meta content="en-us" name="DC.Language" />
+<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
+<title>Creating Filters</title>
+</head>
+<body id="twfltwiz"><a name="twfltwiz"><!-- --></a>
+
+
+<h1 class="topictitle1">Creating Filters</h1>
+
+
+
+<div><p>The filters wizard helps you to create Java™ servlet filters by walking you through
+the creation process and by providing you with output files that you can use
+or that you can modify for use with your Web application. The filters can
+run on Java EE-compliant Web servers.</p>
+
+<div class="section"> <p>To create a filter, complete the following steps: </p>
+</div>
+
+<ol>
+<li class="stepexpand"><span>In the Java EE perspective, expand your  <a href="ccwebprj.html" title="">dynamic project</a> in the Project Explorer view.</span>
+</li>
+
+<li class="stepexpand"><span>Right click on the <strong>Filter</strong> icon, and select <span class="menucascade">
+<span class="uicontrol">New</span> &gt; <span class="uicontrol">Filter</span></span> from
+the pop-up menu.</span>  The <span class="uicontrol">Create Filter</span> wizard
+appears.</li>
+
+<li class="stepexpand"><span>Follow the project wizard prompts.</span></li>
+
+</ol>
+
+<div class="section"><p><strong>General Information</strong></p>
+<dl>
+<dt class="dlterm">Modifiers</dt>
+
+<dd>The <cite>Sun Microsystems Java Servlet 2.3 Specification</cite> states
+that a Servlet class must be <strong>public</strong> and not <strong>abstract</strong>. Therefore,
+you cannot change these modifiers. The only one available for change is the <strong>final</strong> modifier.</dd>
+
+
+<dt class="dlterm">Interfaces</dt>
+
+<dd>There is one obligatory interface that filter classes must implement: <strong>javax.servlet.Filter</strong>.
+This interface is provided by javax.servlet package and is used to represent
+the life-cycle of the filter. This interface has three methods: init, doFilter
+and destroy. <ul>
+<li>The <strong>init</strong> method is called by the servlet container only once, when
+it finishes instantiating the filter.</li>
+
+<li>The<strong>doFilter</strong> method is where the filtering is performed and is called
+every time a user requests a resource, such as a servlet, to which the filter
+is mapped.</li>
+
+<li>The <strong>destroy</strong> method is called by the servlet container to tell the
+filter that it will be taken out of service.</li>
+
+</ul>
+ Although, that the javax.servlet.Filter interface is provided in the <strong>Interfaces</strong> field
+by default, you can add additional interfaces to implement by using the <strong>Add</strong> button.</dd>
+
+
+<dt class="dlterm">Interface selection dialog</dt>
+
+<dd>This dialog appears if you select to add an interface to your filter.
+As you type the name of the interface that you are adding, a list of available
+interfaces listed in the <strong>Matching items</strong> list box updates dynamically
+to display only the interfaces that match the pattern. Choose an interface
+to see the qualifier, and then click <strong>OK</strong> when finished.</dd>
+
+
+<dt class="dlterm">Filter Mappings</dt>
+
+<dd>For a filter to intercept a request to a servlet, you must: <ol>
+<li>declare the filter with a <strong>&lt;filter&gt;</strong> element in the deployment
+descriptor</li>
+
+<li>map the filter to the servlet using the <strong>&lt;filter-mapping&gt;</strong> 
+element.</li>
+
+</ol>
+ Sometimes you want a filter to work on multiple servlets. You can do
+this by mapping a filter to a URL pattern so that any request that matches
+that URL pattern will be filtered. All this is made automatically if you use
+the <strong>Filter Mappings</strong> field.</dd>
+
+
+<dt class="dlterm">Method stubs</dt>
+
+<dd>Because each filter must implement the javax.servlet.Filter interface,
+the <strong>Inherited abstract methods</strong> option is always checked and cannot
+be changed.</dd>
+
+</dl>
+</div>
+
+</div>
+
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/cwfiltbn.html">Filters</a></div>
+</div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twimpwar.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/twimpwar.dita
index a797bd3..309c061 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twimpwar.dita
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/twimpwar.dita
@@ -31,11 +31,7 @@
 same name as the WAR file. If you accept this choice, the project will be

 created with the same servlet version as specified by the WAR file and in

 the same location. If you want to override these settings, you can click <b>New</b> and

-specify your new settings in the Dynamic Web Project wizard.</cmd><info> <p>If

-you want to import the WAR file into an existing Web project, you can select

-the project from the Web project drop-down list. Note that if you select an

-existing project, you must decide whether you want to select the setting to <b>overwrite

-existing resources without warning</b></p></info></step>

+specify your new settings in the Dynamic Web Project wizard.</cmd></step>

 <step><cmd>Click <ph><uicontrol>Finish</uicontrol></ph> to populate the Web

 project.</cmd></step>

 </steps>

diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twimpwar.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twimpwar.html
index 0ad0a96..90dfb8a 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twimpwar.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/twimpwar.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,6 +11,7 @@
 <meta name="DC.Title" content="Importing Web archive (WAR) files" />
 <meta content="WAR files, importing" name="DC.subject" />
 <meta content="WAR files, importing" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwwarovr.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="twimpwar" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -39,34 +40,32 @@
 </div>
 
 <ol>
-<li class="stepexpand"><span>Select <span><span class="menucascade"><span class="uicontrol">File</span> &gt; <span class="uicontrol">Import</span>
+<li><span>Select <span><span class="menucascade"><span class="uicontrol">File</span> &gt; <span class="uicontrol">Import</span>
 </span></span>.</span></li>
 
-<li class="stepexpand"><span> In the Import dialog, select <span><span class="uicontrol">WAR file</span></span> and
+<li><span> In the Import dialog, select <span><span class="uicontrol">WAR file</span></span> and
 then click <span><span class="uicontrol">Next</span></span>. </span></li>
 
-<li class="stepexpand"><span>Locate the WAR file that you want to import using the <span><span class="uicontrol">Browse</span></span> button.</span>
+<li><span>Locate the WAR file that you want to import using the <span><span class="uicontrol">Browse</span></span> button.</span>
 </li>
 
-<li class="stepexpand"><span> The wizard assumes you want to create a new Web project with the
+<li><span> The wizard assumes you want to create a new Web project with the
 same name as the WAR file. If you accept this choice, the project will be
 created with the same servlet version as specified by the WAR file and in
 the same location. If you want to override these settings, you can click <strong>New</strong> and
-specify your new settings in the Dynamic Web Project wizard.</span>  <p>If
-you want to import the WAR file into an existing Web project, you can select
-the project from the Web project drop-down list. Note that if you select an
-existing project, you must decide whether you want to select the setting to <strong>overwrite
-existing resources without warning</strong></p>
-</li>
+specify your new settings in the Dynamic Web Project wizard.</span></li>
 
-<li class="stepexpand"><span>Click <span><span class="uicontrol">Finish</span></span> to populate the Web
+<li><span>Click <span><span class="uicontrol">Finish</span></span> to populate the Web
 project.</span></li>
 
 </ol>
 
 </div>
 
-<div />
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/cwwarovr.html">Web archive (WAR) files</a></div>
+</div>
+</div>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twlstwiz.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/twlstwiz.dita
new file mode 100644
index 0000000..f8b1edb
--- /dev/null
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/twlstwiz.dita
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>

+<!--Arbortext, Inc., 1988-2006, v.4002-->

+<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">

+<task id="twlstwiz" xml:lang="en-us">

+<title>Creating Listeners</title>

+<shortdesc>The listener wizard helps you create application lifecycle listeners by walking you through the creation process and by providing you with output files that you can use or that you can modify for use with your Web application. The listeners can run on Java EE-compliant Web servers.</shortdesc>

+<prolog><metadata>

+<keywords><indexterm>servlets<indexterm>creating</indexterm></indexterm></keywords>

+</metadata></prolog>

+<taskbody>

+<context> <p>To create a listener, complete the following steps: </p></context>

+<steps>

+<step><cmd>From the Java EE perspective, expand your  <xref href="ccwebprj.dita" scope="peer"><desc></desc>dynamic project</xref> in the Project Explorer view.</cmd></step>

+<step><cmd>Right click on the <b>Listener</b> icon, and select <menucascade><uicontrol>New</uicontrol><uicontrol>Listener</uicontrol></menucascade> from the pop-up menu.</cmd><stepresult> The <uicontrol>Create Listener</uicontrol> wizard appears.</stepresult></step>

+<step><cmd>Follow the project wizard prompts.</cmd></step>

+</steps>

+<postreq><dl><dlentry>

+<dt>Application lifecycle listeners</dt>

+<dd>The <cite>Sun Microsystems <tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> Servlet 2.3 Specification</cite>defines the 	following interfaces that represent that application lifecycle 	listeners. You should select at least one of the intefaces. 	<ul>

+<li><b>javax.servlet.ServletContextListener:</b> This interface is provided by javax.servlet package and can be used to listen to the ServletContext life-cycle events. This interface has two methods: contextInitialized and contextDestroyed. The <b><i>contextInitialized</i></b> method is called when the web application is ready to service requests and the <b><i>contextDestroyed</i></b> method is invoked when the servlet context is about to be shut down.</li>

+<li><b>javax.servlet.ServletContextAttributeListener:</b> This interface is provided by javax.servlet package. It can be used to be notified when any attribute is added to the ServletContext or if any of the ServletContext's attributes are changed or removed. This inetface has three methods: <b><i>attributeAdded, attributeRemoved</i></b> and <b><i>attributeReplaced</i></b>.</li>

+<li><b>javax.servlet.ServletRequestListener:</b> This interface is provided by javax.servlet package. It can be used to be notified when a request is coming in or out of scope in a Web component. This interface has two methods: requestInitialized and requestDestroyed. The <b><i>requestInitialized</i></b> method is called when it is about to enter the first servlet or filter in each Web application. The <b><i>requestDestroyed</i></b> method is called when it exits the last servlet or the first filter in the chain.</li>

+<li><b>javax.servlet.ServletRequestAttributeListener:</b> This interface is provided by javax.servlet package and can be used to be notified when any request attribute is changed. This interface has three methods: attributeAdded, attributeRemoved and attributeReplaced. The <b><i>attributteAdded</i></b> method is called when a new attribute was added to servlet request. The <b><i>attributeRemoved</i></b> method is called when an existing attribute has been removed from the servlet request. The <b><i>attributeReplaced</i></b> method is called when an attribute was replaced on the servlet request.</li>

+<li><b>javax.servlet.http.HttpSessionListener:</b> This interface is provided by javax.servlet.http package and can be used to listen to a sessions life cycle events. This interface has two methods: sessionCreated and sessionDestroyed. The <b><i>sessionCreated</i></b>  	method is called when an HttpSession object is created. The <b><i>sessionDestroyed</i></b> method is called when an HttpSession object is invalidated.</li>

+<li><b>javax.servlet.http.HttpSessionActivationListener:</b> This interface is provided by javax.servlet.http package. It can be used to listen to a container events notifying that sessions will be passivated or activated. This interface has two methods: sessionDidActivate and sessionWillPasivate. The <b><i>sessionDidActivate</i></b> is called when the session has just been activated and the <b><i>sessionWillPasivate</i></b> is called when the session is about to be passivated.</li>

+<li><b>javax.servlet.http.HttpSessionAttributeListener:</b> This interface is provided by javax.servlet.http package and can be used to listen to events related to session attributes. This interface has three methods: attributeAdded, attributeRemoved and attributeReplaced. The <b><i>attributeAdded</i></b> method is called when an attribute is added to an HttpSession object. The <b><i>attributeRemoved</i></b> and <b><i>attributeReplaced</i></b> methods are called when an HttpSession attribute is removed or replaced, respectively.</li>

+<li><b>javax.servlet.http.HttpSessionBindingListener:</b> This interface is provided by javax.servlet.http package and can be used to be notified when an object is bound to or unbound from a session. This interface has two methods: valueBound and valueUnbound. The <b><i>valueBound</i></b> method is called when the object is being bound to a session and identifies the session. The <b><i>valueUnbound</i></b> method is called when the object is being unbound from a session and identifies the session.</li>

+</ul> 	</dd>

+</dlentry><dlentry>

+<dt>Modifiers</dt>

+<dd>The <cite>Sun Microsystems <tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> Servlet 2.3 Specification</cite> states that a 	Listener class must be <b>public</b> and not <b>abstract</b>. Therefore, 	you cannot change these modifiers. The only one available for change is 	the <b>final</b> modifier.</dd>

+</dlentry><dlentry>

+<dt>Interfaces</dt>

+<dd>The interfaces that you selected in the previous page of the wizard 	are provided as default values in the <b>Interfaces</b> field. To add 	additional interfaces, click the <b>Add</b> button next to this field.</dd>

+</dlentry><dlentry>

+<dt>Interface selection dialog</dt>

+<dd>This dialog appears if you select to add an interface to your 	servlet. As you type the name of the interface that you are adding, a 	list of available interfaces listed in the <b>Matching items</b> list box 	updates dynamically to display only the interfaces that match the 	pattern. Choose an interface to see the qualifier, and then click <b>OK</b> 	when finished.</dd>

+</dlentry></dl></postreq>

+</taskbody>

+</task>

diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twlstwiz.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twlstwiz.html
new file mode 100644
index 0000000..1462cc6
--- /dev/null
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/twlstwiz.html
@@ -0,0 +1,93 @@
+<?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 lang="en-us" xml:lang="en-us">
+<head>
+<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta content="public" name="security" />
+<meta content="index,follow" name="Robots" />
+<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
+<meta content="task" name="DC.Type" />
+<meta name="DC.Title" content="Creating Listeners" />
+<meta name="abstract" content="The listener wizard helps you create application lifecycle listeners by walking you through the creation process and by providing you with output files that you can use or that you can modify for use with your Web application. The listeners can run on Java EE-compliant Web servers." />
+<meta name="description" content="The listener wizard helps you create application lifecycle listeners by walking you through the creation process and by providing you with output files that you can use or that you can modify for use with your Web application. The listeners can run on Java EE-compliant Web servers." />
+<meta content="servlets, creating" name="DC.subject" />
+<meta content="servlets, creating" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwlistbn.html" />
+<meta content="XHTML" name="DC.Format" />
+<meta content="twlstwiz" name="DC.Identifier" />
+<meta content="en-us" name="DC.Language" />
+<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
+<title>Creating Listeners</title>
+</head>
+<body id="twlstwiz"><a name="twlstwiz"><!-- --></a>
+
+
+<h1 class="topictitle1">Creating Listeners</h1>
+
+
+
+<div><p>The listener wizard helps you create application lifecycle listeners by walking you through the creation process and by providing you with output files that you can use or that you can modify for use with your Web application. The listeners can run on Java EE-compliant Web servers.</p>
+
+<div class="section"> <p>To create a listener, complete the following steps: </p>
+</div>
+
+<ol>
+<li class="stepexpand"><span>From the Java EE perspective, expand your  <a href="ccwebprj.html" title="">dynamic project</a> in the Project Explorer view.</span></li>
+
+<li class="stepexpand"><span>Right click on the <strong>Listener</strong> icon, and select <span class="menucascade"><span class="uicontrol">New</span> &gt; <span class="uicontrol">Listener</span></span> from the pop-up menu.</span>  The <span class="uicontrol">Create Listener</span> wizard appears.</li>
+
+<li class="stepexpand"><span>Follow the project wizard prompts.</span></li>
+
+</ol>
+
+<div class="section"><dl>
+<dt class="dlterm">Application lifecycle listeners</dt>
+
+<dd>The <cite>Sun Microsystems Java™ Servlet 2.3 Specification</cite>defines the 	following interfaces that represent that application lifecycle 	listeners. You should select at least one of the intefaces. 	<ul>
+<li><strong>javax.servlet.ServletContextListener:</strong> This interface is provided by javax.servlet package and can be used to listen to the ServletContext life-cycle events. This interface has two methods: contextInitialized and contextDestroyed. The <strong><em>contextInitialized</em></strong> method is called when the web application is ready to service requests and the <strong><em>contextDestroyed</em></strong> method is invoked when the servlet context is about to be shut down.</li>
+
+<li><strong>javax.servlet.ServletContextAttributeListener:</strong> This interface is provided by javax.servlet package. It can be used to be notified when any attribute is added to the ServletContext or if any of the ServletContext's attributes are changed or removed. This inetface has three methods: <strong><em>attributeAdded, attributeRemoved</em></strong> and <strong><em>attributeReplaced</em></strong>.</li>
+
+<li><strong>javax.servlet.ServletRequestListener:</strong> This interface is provided by javax.servlet package. It can be used to be notified when a request is coming in or out of scope in a Web component. This interface has two methods: requestInitialized and requestDestroyed. The <strong><em>requestInitialized</em></strong> method is called when it is about to enter the first servlet or filter in each Web application. The <strong><em>requestDestroyed</em></strong> method is called when it exits the last servlet or the first filter in the chain.</li>
+
+<li><strong>javax.servlet.ServletRequestAttributeListener:</strong> This interface is provided by javax.servlet package and can be used to be notified when any request attribute is changed. This interface has three methods: attributeAdded, attributeRemoved and attributeReplaced. The <strong><em>attributteAdded</em></strong> method is called when a new attribute was added to servlet request. The <strong><em>attributeRemoved</em></strong> method is called when an existing attribute has been removed from the servlet request. The <strong><em>attributeReplaced</em></strong> method is called when an attribute was replaced on the servlet request.</li>
+
+<li><strong>javax.servlet.http.HttpSessionListener:</strong> This interface is provided by javax.servlet.http package and can be used to listen to a sessions life cycle events. This interface has two methods: sessionCreated and sessionDestroyed. The <strong><em>sessionCreated</em></strong>  	method is called when an HttpSession object is created. The <strong><em>sessionDestroyed</em></strong> method is called when an HttpSession object is invalidated.</li>
+
+<li><strong>javax.servlet.http.HttpSessionActivationListener:</strong> This interface is provided by javax.servlet.http package. It can be used to listen to a container events notifying that sessions will be passivated or activated. This interface has two methods: sessionDidActivate and sessionWillPasivate. The <strong><em>sessionDidActivate</em></strong> is called when the session has just been activated and the <strong><em>sessionWillPasivate</em></strong> is called when the session is about to be passivated.</li>
+
+<li><strong>javax.servlet.http.HttpSessionAttributeListener:</strong> This interface is provided by javax.servlet.http package and can be used to listen to events related to session attributes. This interface has three methods: attributeAdded, attributeRemoved and attributeReplaced. The <strong><em>attributeAdded</em></strong> method is called when an attribute is added to an HttpSession object. The <strong><em>attributeRemoved</em></strong> and <strong><em>attributeReplaced</em></strong> methods are called when an HttpSession attribute is removed or replaced, respectively.</li>
+
+<li><strong>javax.servlet.http.HttpSessionBindingListener:</strong> This interface is provided by javax.servlet.http package and can be used to be notified when an object is bound to or unbound from a session. This interface has two methods: valueBound and valueUnbound. The <strong><em>valueBound</em></strong> method is called when the object is being bound to a session and identifies the session. The <strong><em>valueUnbound</em></strong> method is called when the object is being unbound from a session and identifies the session.</li>
+
+</ul>
+ 	</dd>
+
+
+<dt class="dlterm">Modifiers</dt>
+
+<dd>The <cite>Sun Microsystems Java Servlet 2.3 Specification</cite> states that a 	Listener class must be <strong>public</strong> and not <strong>abstract</strong>. Therefore, 	you cannot change these modifiers. The only one available for change is 	the <strong>final</strong> modifier.</dd>
+
+
+<dt class="dlterm">Interfaces</dt>
+
+<dd>The interfaces that you selected in the previous page of the wizard 	are provided as default values in the <strong>Interfaces</strong> field. To add 	additional interfaces, click the <strong>Add</strong> button next to this field.</dd>
+
+
+<dt class="dlterm">Interface selection dialog</dt>
+
+<dd>This dialog appears if you select to add an interface to your 	servlet. As you type the name of the interface that you are adding, a 	list of available interfaces listed in the <strong>Matching items</strong> list box 	updates dynamically to display only the interfaces that match the 	pattern. Choose an interface to see the qualifier, and then click <strong>OK</strong> 	when finished.</dd>
+
+</dl>
+</div>
+
+</div>
+
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/cwlistbn.html">Listeners</a></div>
+</div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twpcnvrt.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twpcnvrt.html
index 522a484..80efb29 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twpcnvrt.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/twpcnvrt.html
@@ -2,15 +2,17 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="task" name="DC.Type" />
 <meta name="DC.Title" content="Converting static Web projects to dynamic Web projects" />
-<meta content="static Web projects, converting to dynamic, dynamic Web projects, converting from static, Web projects, dynamic" name="DC.subject" />
-<meta content="static Web projects, converting to dynamic, dynamic Web projects, converting from static, Web projects, dynamic" name="keywords" />
+<meta content="static Web projects, converting to dynamic, Web projects, converting static to dynamic" name="DC.subject" />
+<meta content="static Web projects, converting to dynamic, Web projects, converting static to dynamic" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/ccstatic.html" />
+<meta scheme="URI" name="DC.Relation" content="../topics/ccwebprj.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="twpcnvrt" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -45,6 +47,11 @@
 
 </div>
 
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/ccstatic.html">Static Web projects</a></div>
+<div><a href="../topics/ccwebprj.html">Dynamic Web projects and applications</a></div>
+</div>
+</div>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twplib.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/twplib.dita
index afbb10d..511bd33 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twplib.dita
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/twplib.dita
@@ -1,13 +1,15 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <task id="twplib" xml:lang="en-us">

 <title>Adding Web library projects</title>

 <prolog><metadata>

-<keywords><indexterm>Web library projects<indexterm>virtual JAR files and

-projects</indexterm></indexterm><indexterm>virtual JAR files associations<indexterm>Web

-library projects</indexterm></indexterm></keywords>

+<keywords><indexterm keyref="twplib|1|WeblibraryprojectsvirtualJARfilesandprojects"

+status="changed">Web projects<indexterm>virtual JAR files and projects</indexterm></indexterm>

+<indexterm keyref="twplib|2|virtualJARfilesassociationsWeblibraryprojects"

+status="new">virtual JAR files associations<indexterm>Web library projects</indexterm></indexterm>

+</keywords>

 </metadata></prolog>

 <taskbody>

 <context> <p>Web library projects allow you to associate <tm tmclass="special"

@@ -21,9 +23,9 @@
 <steps>

 <step><cmd>Right click on a Web project and select <uicontrol>Properties</uicontrol> from

 the pop-up menu.</cmd><info></info></step>

-<step><cmd>Click on <uicontrol>J2EE Module Dependencies</uicontrol></cmd>

+<step><cmd>Click on <uicontrol>Java EE Module Dependencies</uicontrol></cmd>

 </step>

-<step><cmd>Set up your associations in the J2EE Module Dependencies window</cmd>

+<step><cmd>Set up your associations in the Java EE Module Dependencies window</cmd>

 </step>

 <step><cmd>Click <ph><uicontrol>OK</uicontrol></ph> when you are done.</cmd>

 </step>

diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twplib.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twplib.html
index 6aae398..e4987c7 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twplib.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/twplib.html
@@ -2,15 +2,15 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="task" name="DC.Type" />
 <meta name="DC.Title" content="Adding Web library projects" />
-<meta content="Web library projects, virtual JAR files and projects, virtual JAR files associations, Web library projects" name="DC.subject" />
-<meta content="Web library projects, virtual JAR files and projects, virtual JAR files associations, Web library projects" name="keywords" />
+<meta content="Web projects, virtual JAR files and projects, virtual JAR files associations, Web library projects" name="DC.subject" />
+<meta content="Web projects, virtual JAR files and projects, virtual JAR files associations, Web library projects" name="keywords" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="twplib" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -38,10 +38,10 @@
 <li class="stepexpand"><span>Right click on a Web project and select <span class="uicontrol">Properties</span> from
 the pop-up menu.</span> </li>
 
-<li class="stepexpand"><span>Click on <span class="uicontrol">J2EE Module Dependencies</span></span>
+<li class="stepexpand"><span>Click on <span class="uicontrol">Java EE Module Dependencies</span></span>
 </li>
 
-<li class="stepexpand"><span>Set up your associations in the J2EE Module Dependencies window</span>
+<li class="stepexpand"><span>Set up your associations in the Java EE Module Dependencies window</span>
 </li>
 
 <li class="stepexpand"><span>Click <span><span class="uicontrol">OK</span></span> when you are done.</span>
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twprjset.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/twprjset.dita
index 23ef25a..dc28269 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twprjset.dita
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/twprjset.dita
@@ -39,7 +39,7 @@
 create a new external tool to the list, the New External Tool wizard opens,

 so that you can define the new build tool.</dd>

 </dlentry><dlentry>

-<dt>J2EE (Dynamic Web project only)</dt>

+<dt>Java EE (Dynamic Web project only)</dt>

 <dd>Identify Web level specification and modify context root and Web content

 folder name</dd>

 </dlentry><dlentry>

diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twprjset.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twprjset.html
index 8fcec30..b1d1e40 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twprjset.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/twprjset.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -63,7 +63,7 @@
 so that you can define the new build tool.</dd>
 
 
-<dt class="dlterm">J2EE (Dynamic Web project only)</dt>
+<dt class="dlterm">Java EE (Dynamic Web project only)</dt>
 
 <dd>Identify Web level specification and modify context root and Web content
 folder name</dd>
@@ -177,6 +177,7 @@
 
 </div>
 
+<div />
 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twsrvwiz.dita b/docs/org.eclipse.wst.webtools.doc.user/topics/twsrvwiz.dita
index ce1102b..15092e7 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twsrvwiz.dita
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/twsrvwiz.dita
@@ -8,15 +8,16 @@
 tmtype="tm" trademark="Java">Java</tm> servlets by walking you through the

 creation process and by providing you with output files that you can use or

 that you can modify for use with your Web application. The servlets can run

-on J2EE-compliant Web servers.</shortdesc>

+on Java EE-compliant Web servers.</shortdesc>

 <prolog><metadata>

 <keywords><indexterm>servlets<indexterm>creating</indexterm></indexterm></keywords>

 </metadata></prolog>

 <taskbody>

 <context> <p>To create a servlet, complete the following steps: </p></context>

 <steps>

-<step><cmd>From the J2EE perspective, expand your  <xref href="ccwebprj.dita"

-scope="peer"><desc></desc>dynamic project</xref> in the Project Explorer view.</cmd></step>

+<step><cmd>From the Java EE perspective, expand your  <xref href="ccwebprj.dita"

+scope="peer"><desc></desc>dynamic project</xref> in the Project Explorer view.</cmd>

+</step>

 <step><cmd>Right click on the <b>Servlet</b> icon, and select <menucascade>

 <uicontrol>New</uicontrol><uicontrol>Servlet</uicontrol></menucascade> from

 the pop-up menu.</cmd><stepresult> The <uicontrol>Create Servlet</uicontrol> wizard

diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/twsrvwiz.html b/docs/org.eclipse.wst.webtools.doc.user/topics/twsrvwiz.html
index 6168cca..a1a1ac6 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/twsrvwiz.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/twsrvwiz.html
@@ -2,17 +2,18 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="task" name="DC.Type" />
 <meta name="DC.Title" content="Creating servlets" />
-<meta name="abstract" content="The servlet wizard helps you create Java servlets by walking you through the creation process and by providing you with output files that you can use or that you can modify for use with your Web application. The servlets can run on J2EE-compliant Web servers." />
-<meta name="description" content="The servlet wizard helps you create Java servlets by walking you through the creation process and by providing you with output files that you can use or that you can modify for use with your Web application. The servlets can run on J2EE-compliant Web servers." />
+<meta name="abstract" content="The servlet wizard helps you create Java servlets by walking you through the creation process and by providing you with output files that you can use or that you can modify for use with your Web application. The servlets can run on Java EE-compliant Web servers." />
+<meta name="description" content="The servlet wizard helps you create Java servlets by walking you through the creation process and by providing you with output files that you can use or that you can modify for use with your Web application. The servlets can run on Java EE-compliant Web servers." />
 <meta content="servlets, creating" name="DC.subject" />
 <meta content="servlets, creating" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/cwservbn.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="twsrvwiz" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -29,13 +30,14 @@
 <div><p>The servlet wizard helps you create Java™ servlets by walking you through the
 creation process and by providing you with output files that you can use or
 that you can modify for use with your Web application. The servlets can run
-on J2EE-compliant Web servers.</p>
+on Java EE-compliant Web servers.</p>
 
 <div class="section"> <p>To create a servlet, complete the following steps: </p>
 </div>
 
 <ol>
-<li class="stepexpand"><span>From the J2EE perspective, expand your  <a href="ccwebprj.html" title="">dynamic project</a> in the Project Explorer view.</span></li>
+<li class="stepexpand"><span>From the Java EE perspective, expand your  <a href="ccwebprj.html" title="">dynamic project</a> in the Project Explorer view.</span>
+</li>
 
 <li class="stepexpand"><span>Right click on the <strong>Servlet</strong> icon, and select <span class="menucascade">
 <span class="uicontrol">New</span> &gt; <span class="uicontrol">Servlet</span></span> from
@@ -82,6 +84,10 @@
 
 </div>
 
+<div><div class="relconcepts"><strong>Related concepts</strong><br />
+<div><a href="../topics/cwservbn.html">Servlets</a></div>
+</div>
+</div>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/webtools_toc.ditamap b/docs/org.eclipse.wst.webtools.doc.user/webtools_toc.ditamap
index f1ed01c..262591e 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/webtools_toc.ditamap
+++ b/docs/org.eclipse.wst.webtools.doc.user/webtools_toc.ditamap
@@ -1,9 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN"

  "map.dtd">

-<map linking="none" title="Web application development">

-<topicmeta></topicmeta>

+<map id="webappdevelopment" linking="none" title="Web application development">

 <topicref href="topics/ccwtover.dita" navtitle="Web application overview">

 <topicref href="topics/cwtfeatures.dita" navtitle="Web tools features">

 <topicref href="topics/ccwebvw.dita" navtitle="Project Explorer view and Web development">

@@ -42,11 +41,19 @@
 </topicref>

 <topicref href="topics/tstylesheet.dita" navtitle="Creating cascading style sheets">

 </topicref>

+<topicref href="topics/tjcrejsp.dita" navtitle="Creating JavaServer Pages (JSP) files">

+<topicref href="topics/cpdjsps.dita" navtitle="JavaServer Pages (JSP) technology">

+</topicref>

+</topicref>

+<topicref href="topics/cwebartifact.dita" navtitle="Creating Web Artifacts">

 <topicref href="topics/twsrvwiz.dita" navtitle="Creating servlets">

 <topicref href="topics/cwservbn.dita" navtitle="Servlets"></topicref>

 </topicref>

-<topicref href="topics/tjcrejsp.dita" navtitle="Creating JavaServer Pages (JSP) files">

-<topicref href="topics/cpdjsps.dita" navtitle="JavaServer Pages (JSP) technology">

+<topicref href="topics/twlstwiz.dita" navtitle="Creating Listeners">

+<topicref href="topics/cwlistbn.dita" navtitle="Listeners"></topicref>

+</topicref>

+<topicref href="topics/twfltwiz.dita" navtitle="Creating Filters">

+<topicref href="topics/cwfiltbn.dita" navtitle="Filters"></topicref>

 </topicref>

 </topicref>

 </topicref>

diff --git a/docs/org.eclipse.wst.webtools.doc.user/webtools_toc.xml b/docs/org.eclipse.wst.webtools.doc.user/webtools_toc.xml
index f274bd5..83e1f6a 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/webtools_toc.xml
+++ b/docs/org.eclipse.wst.webtools.doc.user/webtools_toc.xml
@@ -29,11 +29,19 @@
 <topic label="Creating HTML and XHTML files and framesets" href="topics/tjcrehtm.html"/>
 <topic label="Defining HTML file preferences" href="topics/tjprefs.html"/>
 <topic label="Creating cascading style sheets" href="topics/tstylesheet.html"/>
+<topic label="Creating JavaServer Pages (JSP) files" href="topics/tjcrejsp.html">
+<topic label="JavaServer Pages (JSP) technology" href="topics/cpdjsps.html"/>
+</topic>
+<topic label="Creating Web Artifacts" href="topics/cwebartifact.html">
 <topic label="Creating servlets" href="topics/twsrvwiz.html">
 <topic label="Servlets" href="topics/cwservbn.html"/>
 </topic>
-<topic label="Creating JavaServer Pages (JSP) files" href="topics/tjcrejsp.html">
-<topic label="JavaServer Pages (JSP) technology" href="topics/cpdjsps.html"/>
+<topic label="Creating Listeners" href="topics/twlstwiz.html">
+<topic label="Listeners" href="topics/cwlistbn.html"/>
+</topic>
+<topic label="Creating Filters" href="topics/twfltwiz.html">
+<topic label="Listeners" href="topics/cwfiltbn.html"/>
+</topic>
 </topic>
 </topic>
 <topic label="Setting CVS repository defaults" href="topics/twcvsr.html"/>
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/EditorXmlContexts.xml b/docs/org.eclipse.wst.xml.ui.infopop/EditorXmlContexts.xml
index 364fca9..c62b4a2 100644
--- a/docs/org.eclipse.wst.xml.ui.infopop/EditorXmlContexts.xml
+++ b/docs/org.eclipse.wst.xml.ui.infopop/EditorXmlContexts.xml
@@ -1,143 +1,193 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?NLS type="org.eclipse.help.contexts"?>
 <!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
+	* Copyright (c) 2000, 2008 IBM Corporation and others.
+	* All rights reserved. This program and the accompanying materials
+	* are made available under the terms of the Eclipse Public License v1.0
+	* which accompanies this distribution, and is available at
+	* http://www.eclipse.org/legal/epl-v10.html
+	* 
+	* Contributors:
+	*     IBM Corporation - initial API and implementation
+	*******************************************************************************/ -->
+<!--plugin: org.eclipse.wst.xml.ui -->
 <contexts>
-<context id="csh_outer_container">
-<description/>
-</context>
-<context id="webx0060">
-<description>This page lets you specify the line delimiter and the text encoding that will be used when you create or save an XML related file.
+	<context id="csh_outer_container">
+		<description />
+	</context>
+	<context id="webx0060"><!-- XML Files preference page  -->
+		<description>
+			<p>This page lets you specify the file suffix and text encoding that will be used when you create or save an XML related file.</p>
 
-Various development platforms use different line delimiters to indicate the start of a new line. Select the operating system that corresponds to your development or deployment platform.
+			<p>The encoding attribute is used to specify the default character encoding set that is used when creating XML related files (DTDs, XML files, XML schemas). Changing the encoding causes any new, XML related files that are created from scratch to use the selected encoding.</p>
 
-<b>Note:</b> This delimiter will not automatically be added to any documents that currently exist. It will be added only to documents that you create after you select the line delimiter type and click <b>Apply</b>, or to existing files that you open and then resave after you select the line delimiter type and click <b>Apply</b>.
+			<p>You can also set the type of message that will appear in the problems view when a resource is validated with no specified grammar.</p>
+		</description>
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tedtenc.html" label="Specifying XML default encoding and line delimiters" />
+	</context>
+	<context id="webx0061"><!-- Editor preferences page -->
+		<description>
+			<p>This page lets you specify the formatting and content assist preferences that will be used when editing an XML file.</p>
 
-The encoding attribute is used to specify the default character encoding set that is used when creating XML related files (DTDs, XML files, XML schemas). Changing the encoding causes any new, XML related files that are created from scratch to use the selected encoding.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tedtenc.html" label="Specifying XML default encoding and line delimiters"/>
-</context>
-<context id="webx0061">
-<description>This page lets you specify the formatting and content assist preferences that will be used when editing an XML file.
+			<p>Enter a maximum width in the <b>Line width</b> field to specify when a line should be broken to fit onto more than one line. This will be applied when the document is formatted.
+			</p>
+		
 
-Enter a maximum width in the <b>Line width</b> field to specify when a line should be broken to fit onto more than one line. This will be applied when the document is formatted.
+			<p>Select <b>Split multiple attributes each on a new line</b> to start every attribute on a new line when the document is formatted.
+			</p>
 
-Select <b>Split multiple attributes each on a new line</b> to start every attribute on a new line when the document is formatted.
+			<p>
+				Select <b>Clear all blank lines</b> to remove blank lines when the document is formatted.
+			</p>
 
-Select <b>Clear all blank lines</b> to remove blank lines when the document is formatted.
+			<p>
+				Select <b>Indent using tabs</b> if you want to use tab characters (\t) as the standard formatting indentation. If you prefer to use spaces, select <b>Indent using spaces</b>.
+			</p>
 
-Select <b>Indent using tabs</b> if you want to use tab characters (\t) as the standard formatting indentation.
+			<p>
+				You can also specify the <b>Indentation size</b> which is the number of tabs or space characters used for formatting indentation.
+			</p>
 
-If you prefer to use spaces, select <b>Indent using spaces</b>.
+			<p>
+				To apply these formatting styles, right-click in your XML document, and click <b>Format &gt; Document</b>.
+			</p>
 
-You can also specify the <b>Indentation size</b> which is the number of tabs or space characters used for formatting indentation.
+			<p>
+				If the <b>Automatically make suggestions</b> check box is selected, you can specify that certain characters will cause the content assist list to pop up automatically. Specify these characters in the <b>Prompt when these characters are inserted</b> field.
+			</p>
 
-To apply these formatting styles, right-click in your XML document, and click <b>Format &gt; Document</b>.
+			<p>
+				If you select <b>Strict</b> from the <b>Suggestion strategy</b> list, suggestions that are grammatically valid will be shown first (with bold icons) in the content assist list. Other suggestions that are applicable to the element scope, but not grammatically valid, will be shown below them with a de-emphasized icon. The default value for this field is <b>Lax</b>.
+			</p>
 
-If the <b>Automatically make suggestions</b> check box is selected, you can specify that certain characters will cause the content assist list to pop up automatically. Specify these characters in the <b>Prompt when these characters are inserted</b> field.
+			<p>
+				If a DTD or schema (or other model) is not specified for an XML file, selecting <b>Use inferred grammar in absence of DTD/Schema</b> allows the editor to "guess" what elements or attributes are available based on existing content.
+			</p>
+		</description>
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txprefs.html" label="Defining XML editor preferences" />
+	</context>
+	<context id="webx0062"><!-- Syntax Coloring preference page -->
+		<description>
+			<p>This page lets you customize the syntax highlighting that the XML editor does when you are editing a file.</p>
 
-If you select <b>Strict</b> from the <b>Suggestion strategy</b> list, suggestions that are grammatically valid will be shown first (with bold icons) in the content assist list. Other suggestions that are applicable to the element scope, but not grammatically valid, will be shown below them with a de-emphasized icon. The default value for this field is <b>Lax</b>.
+			<p>
+				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.
+			</p>
 
-If a DTD or schema (or other model) is not specified for an XML file, selecting <b>Use inferred grammar in absence of DTD/Schema</b> allows the editor to "guess" what elements or attributes are available based on existing content.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txprefs.html" label="Defining XML editor preferences"/>
-</context>
-<context id="webx0062">
-<description>This page lets you customize the syntax highlighting that the XML editor does when you are editing a file.
+			<p>
+				The <b>Foreground</b> and <b>Background</b> 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.
+			</p>
 
-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.
+			<p>
+				Click the <b>Restore Defaults</b> button to set the highlighting styles back to their default values. If you only want to reset the value for a particular content type, select it in the <b>Content type</b> field, the click the <b>Restore Default</b> button next to it.
+			</p>
+		</description>
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/ttaghilt.html" label="Setting source highlighting styles" />
+	</context>
+	<context id="webx0063"><!-- Templates preference page -->
+		<description>
+			<p>This page lets you create new templates and edit existing ones that can be used when editing an XML file. A template is a chunk of predefined code that you can insert into a file.</p>
 
-The <b>Foreground</b> and <b>Background</b> 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.
+			<p>Click <b>New</b> if you want to create a completely new template.
+			</p>
 
-Click the <b>Restore Defaults</b> button to set the highlighting styles back to their default values. If you only want to reset the value for a particular content type, select it in the <b>Content type</b> field, the click the <b>Restore Default</b> button next to it.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/ttaghilt.html" label="Setting source highlighting styles"/>
-</context>
-<context id="webx0063">
-<description>This page lets you create new templates and edit existing ones that can be used when editing an XML file. A template is a chunk of predefined code that you can insert into a file.
+			<p>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.
+			</p>
 
-Click <b>New</b> if you want to create a completely new template.
+			<p>
+				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.
+			</p>
 
-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.
+			<p>You can edit, remove, import, or export a template by using the same Preferences page. If you have modified a default template, you can restore it to its default value. You can also restore a removed template if you have not exited from the workbench since it was removed.</p>
 
-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.
+			<p>
+				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.
+			</p>
+		</description>
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/twmacro.html" label="Working with XML templates" />
+	</context>
+	<context id="xmlm1200"><!-- doesn't exist in xml preferences -->
+		<description>
+			Cleanup options enable you to update a document so that it is well-formed and consistently formatted.
 
-You can edit, remove, import, or export a template by using the same Preferences page. If you have modified a default template, you can restore it to its default value. You can also restore a removed template if you have not exited from the workbench since it was removed.
+			The following cleanup options can be set to on or off, so that you can limit the type of cleanup performed:
 
-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.xmleditor.doc.user/topics/twmacro.html" label="Working with XML templates"/>
-</context>
-<context id="xmlm1200">
-<description>Cleanup options enable you to update a document so that it is well-formed and consistently formatted.
+			- <b>Compress empty element tags</b>: Compress element tags with no content to one tag with an end tag delimiter (ie: change &lt;tag&gt;&lt;/tag&gt; to &lt;tag/&gt;).
 
-The following cleanup options can be set to on or off, so that you can limit the type of cleanup performed:
+			- <b>Insert required attributes</b>: Inserts any missing attributes that are required by the tag to make the element or document well-formed.
 
-- <b>Compress empty element tags</b>: Compress element tags with no content to one tag with an end tag delimiter (ie: change &lt;tag&gt;&lt;/tag&gt; to &lt;tag/&gt;).
+			- <b>Insert missing tags</b>: Completes any missing tags (such as adding an end tag) necessary to make the element or document well-formed.
 
-- <b>Insert required attributes</b>: Inserts any missing attributes that are required by the tag to make the element or document well-formed.
+			- <b>Quote attribute values</b>: Appropriately adds double- or single-quotes before and after attribute values if they are missing.
 
-- <b>Insert missing tags</b>: Completes any missing tags (such as adding an end tag) necessary to make the element or document well-formed.
+			- <b>Format source</b>: Formats the document just as the <b>Format Document</b> context menu option does, immediately after performing any other specified <b>Cleanup</b> options.
 
-- <b>Quote attribute values</b>: Appropriately adds double- or single-quotes before and after attribute values if they are missing.
+			- <b>Convert line delimiters to</b>: Converts all line delimiters in the file to the selected operating system's type.
+		</description>
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtsrc.html" label="Editing in the Source view" />
+	</context>
+	<context id="xcui0500"><!-- add new attribute dialog -->
+		<description>
+			Enter the name of the attribute in the <b>Name</b> field, then enter the value of the attribute in the <b>Value</b> field. Click <b>OK</b>. The attribute will be added to the file.
+		</description>
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view" />
+	</context>
+	<context id="xcui0010"><!--  -->
+		<description>
+			The DOCTYPE declaration in an XML file is used at the beginning of it to associate it with a DTD file. You can use the <b>Public ID</b> field to create an association using an XML Catalog entry or the <b>System ID</b> field to create an association using a file in the workbench.
+		</description>
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view" />
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html" label="Editing DOCTYPE declarations" />
+	</context>
+	<context id="xcui0020"><!-- edit doctype declaration dialog -->
+		<description>This should match the name of your XML file's root element.</description>
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view" />
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html" label="Editing DOCTYPE declarations" />
+	</context>
+	<context id="xcui0030"><!-- edit doctype declaration dialog -->
+		<description>The value in this field is the Public Identifier. It is used to associate the XML file (using an XML catalog entry) with a DTD file by providing a hint to the XML processor.</description>
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view" />
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html" label="Editing DOCTYPE declarations" />
+	</context>
+	<context id="xcui0050"><!-- edit doctype declaration dialog -->
+		<description>The value in this field is the DTD the XML file is associated with. You can change the DTD the file is associated with by editing this field. The XML processor will try to use the Public ID to locate the DTD, and if this fails, it will use the System ID to find it.</description>
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view" />
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html" label="Editing DOCTYPE declarations" />
+	</context>
+	<context id="xcui0600"><!-- add element dialog -->
+		<description>
+			Enter the name of the element in the <b>Element name</b> field, then click <b>OK</b>. The element will be added to the file.
+		</description>
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view" />
+	</context>
+	<context id="xcui0300"><!-- edit processing instruction dialog -->
+		<description>
+			A processing instruction is a syntax in XML for passing instructions along to the application using an XML document. The <b>Target</b> field is used to identify the application the instructions belongs to. The <b>Data</b> field contains the instructions.
+		</description>
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view" />
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tedtproc.html" label="Editing XML processing instructions" />
+	</context>
+	<context id="xcui0100"><!-- edit schema information (namespace declaration) dialog -->
+		<description>
+			This is a read-only dialog. Select the entry you want to edit and click <b>Edit</b>.
+		</description>
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view" />
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing your namespace information" />
+	</context>
+	<context id="xcui0200"><!-- add namespace declaration dialog -->
+		<description>
+			The value in the <b>Namespace Name</b> field is the namespace the XML file belongs to.
 
-- <b>Format source</b>: Formats the document just as the <b>Format Document</b> context menu option does, immediately after performing any other specified <b>Cleanup</b> options.
+			All qualified elements and attributes in the XML file associated with the namespace will be prefixed with the <b>Prefix</b> value.
 
-- <b>Convert line delimiters to</b>: Converts all line delimiters in the file to the selected operating system's type.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtsrc.html" label="Editing in the Source view"/>
-</context>
-<context id="xcui0500">
-<description>Enter the name of the attribute in the <b>Name</b> field, then enter the value of the attribute in the <b>Value</b> field. Click <b>OK</b>. The attribute will be added to the file.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view"/>
-</context>
-<context id="xcui0010">
-<description>The DOCTYPE declaration in an XML file is used at the beginning of it to associate it with a DTD file. You can use the <b>Public ID</b> field to create an association using an XML Catalog entry or the <b>System ID</b> field to create an association using a file in the workbench.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view"/>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html" label="Editing DOCTYPE declarations"/>
-</context>
-<context id="xcui0020">
-<description>This should match the name of your XML file's root element.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view"/>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html" label="Editing DOCTYPE declarations"/>
-</context>
-<context id="xcui0030">
-<description>The value in this field is the Public Identifier. It is used to associate the XML file (using an XML catalog entry) with a DTD file by providing a hint to the XML processor.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view"/>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html" label="Editing DOCTYPE declarations"/>
-</context>
-<context id="xcui0050">
-<description>The value in this field is the DTD the XML file is associated with. You can change the DTD the file is associated with by editing this field. The XML processor will try to use the Public ID to locate the DTD, and if this fails, it will use the System ID to find it.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view"/>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html" label="Editing DOCTYPE declarations"/>
-</context>
-<context id="xcui0600">
-<description>Enter the name of the element in the <b>Element name</b> field, then click <b>OK</b>. The element will be added to the file.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view"/>
-</context>
-<context id="xcui0300">
-<description>A processing instruction is a syntax in XML for passing instructions along to the application using an XML document. The <b>Target</b> field is used to identify the application the instructions belongs to. The <b>Data</b> field contains the instructions.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view"/>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tedtproc.html" label="Editing XML processing instructions"/>
-</context>
-<context id="xcui0100">
-<description>This is a read-only dialog. Select the entry you want to edit and click <b>Edit</b>.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view"/>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing your namespace information"/>
-</context>
-<context id="xcui0200">
-<description>The value in the <b>Namespace Name</b> field is the namespace the XML file belongs to.
+			The <b>Location Hint</b> field contains the location of the XML schema the XML file is associated with. An XML Catalog ID or a URI can be specified in this field. You can search for the schema you want to use by clicking <b>Browse</b>. Once you select a file, the <b>Namespace Name</b> and <b>Prefix</b> fields will automatically be filled with the appropriate values from the schema (you must leave the fields blank for this to occur).
 
-All qualified elements and attributes in the XML file associated with the namespace will be prefixed with the <b>Prefix</b> value.
-
-The <b>Location Hint</b> field contains the location of the XML schema the XML file is associated with. An XML Catalog ID or a URI can be specified in this field. You can search for the schema you want to use by clicking <b>Browse</b>. Once you select a file, the <b>Namespace Name</b> and <b>Prefix</b> fields will automatically be filled with the appropriate values from the schema (you must leave the fields blank for this to occur). <b>Note</b>: If you are creating an XML file from an XML schema, you cannot change the <b>Namespace Name</b> or <b>Location Hint</b> values.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view"/>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing your namespace information"/>
-</context>
-<context id="xcui0400">
-<description>An XML Catalog entry contains two parts - a Key (which represents a DTD or XML schema) and a URI (which contains information about a DTD or XML schema's location). Select the catalog entry you want to associate your XML file with.</description>
-</context>
+			<b>Note</b> : If you are creating an XML file from an XML schema, you cannot change the <b>Namespace Name</b> or <b>Location Hint</b> values.
+		</description>
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view" />
+		<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing your namespace information" />
+	</context>
+	<context id="xcui0400"><!--  -->
+		<description>An XML Catalog entry contains two parts - a Key (which represents a DTD or XML schema) and a URI (which contains information about a DTD or XML schema's location). Select the catalog entry you want to associate your XML file with.</description>
+	</context>
 </contexts>
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/EditorXmlContexts2.xml b/docs/org.eclipse.wst.xml.ui.infopop/EditorXmlContexts2.xml
index 60ebab5..e8504ef 100644
--- a/docs/org.eclipse.wst.xml.ui.infopop/EditorXmlContexts2.xml
+++ b/docs/org.eclipse.wst.xml.ui.infopop/EditorXmlContexts2.xml
@@ -1,21 +1,23 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?NLS type="org.eclipse.help.contexts"?>
 <!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
+	* Copyright (c) 2000, 2008 IBM Corporation and others.
+	* All rights reserved. This program and the accompanying materials
+	* are made available under the terms of the Eclipse Public License v1.0
+	* which accompanies this distribution, and is available at
+	* http://www.eclipse.org/legal/epl-v10.html
+	* 
+	* Contributors:
+	*     IBM Corporation - initial API and implementation
+	*******************************************************************************/ -->
 <contexts>
-<context id="csh_outer_container">
-<description/>
-</context>
-<context id="xml_source_HelpId">
-<description>The XML source view lets you edit a file that is coded in the Extensible Markup Language. The editor provides many text editing features, such as content assist, user-defined templates, syntax highlighting, unlimited undo and redo, element selection and formatting, and document formatting.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtsrc.html" label="Editing in the Source view"/>
-</context>
+	<context id="csh_outer_container">
+		<description />
+	</context>
+	<context id="xml_source_HelpId">
+		<description>The XML source view lets you edit a file that is coded in the Extensible Markup Language. The editor provides many text editing features, such as content assist, user-defined templates, syntax highlighting, unlimited undo and redo, element selection and formatting, and document formatting.</description>
+		<topic
+			href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtsrc.html"
+			label="Editing in the Source view" />
+	</context>
 </contexts>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.xml.ui.infopop/META-INF/MANIFEST.MF
index 0c58dbc..d2a19eb 100644
--- a/docs/org.eclipse.wst.xml.ui.infopop/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.wst.xml.ui.infopop/META-INF/MANIFEST.MF
@@ -2,6 +2,6 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.xml.ui.infopop; singleton:=true
-Bundle-Version: 1.0.300.qualifier
+Bundle-Version: 1.0.400.qualifier
 Bundle-Vendor: %pluginProvider
 Bundle-Localization: plugin
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/TableTree.xml b/docs/org.eclipse.wst.xml.ui.infopop/TableTree.xml
index 263c6e1..a662efb 100644
--- a/docs/org.eclipse.wst.xml.ui.infopop/TableTree.xml
+++ b/docs/org.eclipse.wst.xml.ui.infopop/TableTree.xml
@@ -1,22 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?NLS type="org.eclipse.help.contexts"?>
 <!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
- 
+	* Copyright (c) 2000, 2008 IBM Corporation and others.
+	* All rights reserved. This program and the accompanying materials
+	* are made available under the terms of the Eclipse Public License v1.0
+	* which accompanies this distribution, and is available at
+	* http://www.eclipse.org/legal/epl-v10.html
+	* 
+	* Contributors:
+	*     IBM Corporation - initial API and implementation
+	*******************************************************************************/ -->
+
 <contexts>
-<context id="csh_outer_container">
-<description/>
-</context>
-<context id="xmlm3000">
-<description>The Design view of the XML editor represents your file simultaneously as a table and a tree, which helps make navigation and editing easier. Depending on the kind of file you are working with, content and attribute values can be edited directly in table cells, while pop-up menus on tree elements give alternatives that are valid for that location.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html" label="Editing in the Design view"/>
-</context>
+	<context id="csh_outer_container">
+		<description />
+	</context>
+	<context id="xmlm3000">
+		<description>The Design view of the XML editor represents your file simultaneously as a table and a tree, which helps make navigation and editing easier. Depending on the kind of file you are working with, content and attribute values can be edited directly in table cells, while pop-up menus on tree elements give alternatives that are valid for that location.</description>
+		<topic
+			href="../org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html"
+			label="Editing in the Design view" />
+	</context>
 </contexts>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/WSDLContexts.xml b/docs/org.eclipse.wst.xml.ui.infopop/WSDLContexts.xml
new file mode 100644
index 0000000..31462b7
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.ui.infopop/WSDLContexts.xml
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS type="org.eclipse.help.contexts"?>
+<!-- /*******************************************************************************
+	* Copyright (c) 2000, 2008 IBM Corporation and others.
+	* All rights reserved. This program and the accompanying materials
+	* are made available under the terms of the Eclipse Public License v1.0
+	* which accompanies this distribution, and is available at
+	* http://www.eclipse.org/legal/epl-v10.html
+	* 
+	* Contributors:
+	*     IBM Corporation - initial API and implementation
+	*******************************************************************************/ -->
+
+<!-- plugin: org.eclipse.wst.wsdl.ui -->
+
+<contexts>
+	<context id="csh_outer_container">
+		<description />
+	</context>
+	<context id=""><!-- change later, this has no id atm -->
+		<description>
+			Select the project or folder that will contain the WSDL file. In the <b>File name</b> field, type the name of the WSDL file, for example <i>NewWSDLFile.wsdl</i>. The name of your WSDL file must end in <i>.wsdl</i>.
+		</description>
+		<topic
+			href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
+			label="" />
+	</context>
+	<context id="wsdlu0000">
+		<description>
+			<b>Target namespace</b> is used for the names of messages and the port type, binding and service defined in the WSDL file. The value must take the form of a valid URI (for example, http://www.mycompany.com/myservice/).
+		</description>
+		<topic
+			href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
+			label="" />
+	</context>
+	<context id="wsdlu0001">
+		<description>
+			<b>Prefix</b> is the prefix associated with the target namespace.
+		</description>
+		<topic
+			href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
+			label="" />
+	</context>
+	<context id="wsdlu0002">
+		<description>
+			<b>Create WSDL Skeleton</b> will generate the WSDL elements required for your service, including bindings, ports and messages. You can then modify these to meet the requirements of your Web service.
+		</description>
+		<topic
+			href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
+			label="" />
+	</context>
+	<context id="wsdlu0003">
+		<description>If you have chosen to create a WSDL skeleton, select the binding options you want to use in the Protocol drop down. The options are SOAP and HTTP. Use the SOAP protocol when you want to exchange structured and typed information. Use the HTTP protocol when you want your application client to just request or update information.</description>
+		<topic
+			href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
+			label="" />
+	</context>
+	<context id="wsdlu0010">
+		<description>
+			If you select SOAP you can then select the encoding style you want to use:
+			<ul>
+				<li>
+					<b>document literal</b>: Document style messages, literal encoding. Use this style of binding when you want to send SOAP messages that can be validated by an XML validator. All the data types in the SOAP message body are defined in a schema, so the WSDL parts must point to schema elements.
+				</li>
+			</ul>
+		</description>
+		<topic
+			href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
+			label="" />
+	</context>
+	<context id="wsdlu0011">
+		<description>
+			<ul>
+				<li>
+					<b>rpc literal</b>: RPC style messages, literal encoding. Use this style of binding when you want to specify the operation method names in your SOAP messages so a server can dispatch the specified methods. Data types must be defined, so the WSDL parts must point to XSD types.
+				</li>
+			</ul>
+		</description>
+		<topic
+			href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
+			label="" />
+	</context>
+	<context id="wsdlu0012">
+		<description>
+			<ul>
+				<li>
+					<b>rpc encoded</b>: RPC style messages and SOAP encoding. Use this style of binding when you want to encode data graphs in your SOAP messages so a server can deserialize the object data. Data types must be defined, so the WSDL parts must point to XSD types.
+				</li>
+			</ul>
+		</description>
+		<topic
+			href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
+			label="" />
+	</context>
+	<context id="wsdlu0013">
+		<description>
+			If you select HTTP you can select whether to create an HTTP getter or setter:
+			<ul>
+				<li>
+					<b>HTTP GET</b>: A GET request fetches data from a Web server based on an URL value and a set of HTTP headers. Use this method when you want to retrieve information specified in the request.
+				</li>
+			</ul>
+		</description>
+		<topic
+			href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
+			label="" />
+	</context>
+	<context id="wsdlu0014">
+		<description>
+			<ul>
+				<li>
+					<b>HTTP POST</b>: A POST request sends additional data to the server, specified after the URL and the headers. Use this method when you want to send data enclosed in the body of the request.
+				</li>
+			</ul>
+		</description>
+		<topic
+			href="../org.eclipse.wst.wsdl.ui.doc.user/tasks/tcrtwsdl.html"
+			label="" />
+	</context>
+</contexts>
+
+
+
+
+
+
+
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/XMLWizardContexts.xml b/docs/org.eclipse.wst.xml.ui.infopop/XMLWizardContexts.xml
index 4e781c5..f5bb914 100644
--- a/docs/org.eclipse.wst.xml.ui.infopop/XMLWizardContexts.xml
+++ b/docs/org.eclipse.wst.xml.ui.infopop/XMLWizardContexts.xml
@@ -1,78 +1,122 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?NLS type="org.eclipse.help.contexts"?>
 <!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/ -->
+	* Copyright (c) 2000, 2008 IBM Corporation and others.
+	* All rights reserved. This program and the accompanying materials
+	* are made available under the terms of the Eclipse Public License v1.0
+	* which accompanies this distribution, and is available at
+	* http://www.eclipse.org/legal/epl-v10.html
+	* 
+	* Contributors:
+	*     IBM Corporation - initial API and implementation
+	*******************************************************************************/ -->
 
 <contexts>
-<context id="csh_outer_container">
-<description/>
-</context>
-<context id="xmlc0101">
-<description>Select the <b>Create XML file from a DTD file</b> radio button to create an XML file from a DTD file. The file will contain the selected root element, populated with any required elements and attributes.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html" label="Generating XML files from DTDs"/>
-</context>
-<context id="xmlc0102">
-<description>Select the <b>Create XML file from an XML schema file</b> radio button to create an XML file from an XML schema. The file will contain the selected root element of the XML schema and any elements or attributes it contains.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html" label="Generating XML files from XML schemas"/>
-</context>
-<context id="xmlc0103">
-<description>Select the <b>Create XML file from scratch</b> radio button if you want to create an XML file not associated with any XML schema or DTD file.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tcretxml.html" label="Creating empty XML files"/>
-</context>
-<context id="xmlc0500">
-<description>Select the <b>Select file from workbench</b> radio button if you want to create your XML file from a DTD or XML schema that is in the workbench.
+	<context id="csh_outer_container">
+		<description />
+	</context>
+	<context id="xmlc0101">
+		<description>
+			Select the <b>Create XML file from a DTD file</b> radio button to create an XML file from a DTD file. The file will contain the selected root element, populated with any required elements and attributes.
+		</description>
+		<topic
+			href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html"
+			label="Generating XML files from DTDs" />
+	</context>
+	<context id="xmlc0102">
+		<description>
+			Select the <b>Create XML file from an XML schema file</b> radio button to create an XML file from an XML schema. The file will contain the selected root element of the XML schema and any elements or attributes it contains.
+		</description>
+		<topic
+			href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html"
+			label="Generating XML files from XML schemas" />
+	</context>
+	<context id="xmlc0103">
+		<description>
+			Select the <b>Create XML file from scratch</b> radio button if you want to create an XML file not associated with any XML schema or DTD file.
+		</description>
+		<topic
+			href="../org.eclipse.wst.xmleditor.doc.user/topics/tcretxml.html"
+			label="Creating empty XML files" />
+	</context>
+	<context id="xmlc0500">
+		<description>
+			Select the <b>Select file from workbench</b> radio button if you want to create your XML file from a DTD or XML schema that is in the workbench.
 
-Select the <b>Select XML Catalog entry</b> radio button if you want to use a file listed in the XML Catalog to create your XML file.</description>
-</context>
-<context id="xmlc0410">
-<description>The root element of an XML file is the element that contains all other elements in that file. All elements defined in the DTD or all global elements defined in the XML schema are included in this list.
+			Select the <b>Select XML Catalog entry</b> radio button if you want to use a file listed in the XML Catalog to create your XML file.
+		</description>
+	</context>
+	<context id="xmlc0410">
+		<description>
+			The root element of an XML file is the element that contains all other elements in that file. All elements defined in the DTD or all global elements defined in the XML schema are included in this list.
 
-<b>Note</b>: If you do not have any elements in your DTD or any global elements in your XML schema, you cannot create an XML file from it.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html" label="Generating XML files from DTDs"/>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html" label="Generating XML files from XML schemas"/>
-</context>
-<context id="xmlc0441">
-<description>If you select this check box, both mandatory and optional attributes will be generated. If you do not select it, only mandatory attributes will be generated.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html" label="Generating XML files from DTDs"/>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html" label="Generating XML files from XML schemas"/>
-</context>
-<context id="xmlc0442">
-<description>If you select this check box, both the mandatory and optional elements will be generated. If you do not select it, only mandatory elements will be generated.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html" label="Generating XML files from DTDs"/>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html" label="Generating XML files from XML schemas"/>
-</context>
-<context id="xmlc0443">
-<description>If you select this check box, the first choice of a required choice will be generated in your XML file.
+			<b>Note</b>: If you do not have any elements in your DTD or any global elements in your XML schema, you cannot create an XML file from it.
+		</description>
+		<topic
+			href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html"
+			label="Generating XML files from DTDs" />
+		<topic
+			href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html"
+			label="Generating XML files from XML schemas" />
+	</context>
+	<context id="xmlc0441">
+		<description>If you select this check box, both mandatory and optional attributes will be generated. If you do not select it, only mandatory attributes will be generated.</description>
+		<topic
+			href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html"
+			label="Generating XML files from DTDs" />
+		<topic
+			href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html"
+			label="Generating XML files from XML schemas" />
+	</context>
+	<context id="xmlc0442">
+		<description>If you select this check box, both the mandatory and optional elements will be generated. If you do not select it, only mandatory elements will be generated.</description>
+		<topic
+			href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html"
+			label="Generating XML files from DTDs" />
+		<topic
+			href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html"
+			label="Generating XML files from XML schemas" />
+	</context>
+	<context id="xmlc0443">
+		<description>
+			If you select this check box, the first choice of a required choice will be generated in your XML file.
 
-For example, if you have the following code in your source file:
+			For example, if you have the following code in your source file:
 
-<b>&lt;choice&gt; &lt;element name="a" type="string&gt; &lt;element name="b" type="integer&gt; &lt;/choice&gt;</b> 
+			<b>&lt;choice&gt; &lt;element name="a" type="string&gt; &lt;element name="b" type="integer&gt; &lt;/choice&gt;</b>
 
-and you select this check box, an element such as the following will be created in your XML file:
+			and you select this check box, an element such as the following will be created in your XML file:
 
-<b>&lt;a&gt;hello&lt;/a&gt;</b> </description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html" label="Generating XML files from DTDs"/>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html" label="Generating XML files from XML schemas"/>
-</context>
-<context id="xmlc0444">
-<description>If you select this check box, any elements and attributes generated will be filled with sample data, such as <b>&lt;text&gt;EmptyText&lt;/text&gt;.</b> Otherwise, they will be empty - that is, <b>&lt;text&gt;&lt;/text&gt;.</b> </description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html" label="Generating XML files from DTDs"/>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html" label="Generating XML files from XML schemas"/>
-</context>
-<context id="xmlc0210">
-<description>The System ID value corresponds to the URI (physical location) of the DTD file. The Public ID value can refer to a DTD entry in an XML Catalog.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html" label="Generating XML files from DTDs"/>
-</context>
-<context id="xmlc0220">
-<description>The System ID value corresponds to the URI (physical location) of the DTD file. The Public ID value can refer to a DTD entry in an XML Catalog.</description>
-<topic href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html" label="Generating XML files from DTDs"/>
-</context>
+			<b>&lt;a&gt;hello&lt;/a&gt;</b>
+		</description>
+		<topic
+			href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html"
+			label="Generating XML files from DTDs" />
+		<topic
+			href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html"
+			label="Generating XML files from XML schemas" />
+	</context>
+	<context id="xmlc0444">
+		<description>
+			If you select this check box, any elements and attributes generated will be filled with sample data, such as <b>&lt;text&gt;EmptyText&lt;/text&gt;.</b> Otherwise, they will be empty - that is, <b>&lt;text&gt;&lt;/text&gt;.</b>
+		</description>
+		<topic
+			href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html"
+			label="Generating XML files from DTDs" />
+		<topic
+			href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html"
+			label="Generating XML files from XML schemas" />
+	</context>
+	<context id="xmlc0210">
+		<description>The System ID value corresponds to the URI (physical location) of the DTD file. The Public ID value can refer to a DTD entry in an XML Catalog.</description>
+		<topic
+			href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html"
+			label="Generating XML files from DTDs" />
+	</context>
+	<context id="xmlc0220">
+		<description>The System ID value corresponds to the URI (physical location) of the DTD file. The Public ID value can refer to a DTD entry in an XML Catalog.</description>
+		<topic
+			href="../org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html"
+			label="Generating XML files from DTDs" />
+	</context>
 </contexts>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/XSDContexts.xml b/docs/org.eclipse.wst.xml.ui.infopop/XSDContexts.xml
new file mode 100644
index 0000000..a2ea89e
--- /dev/null
+++ b/docs/org.eclipse.wst.xml.ui.infopop/XSDContexts.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS type="org.eclipse.help.contexts"?>
+<!-- /*******************************************************************************
+	* Copyright (c) 2000, 2008 IBM Corporation and others.
+	* All rights reserved. This program and the accompanying materials
+	* are made available under the terms of the Eclipse Public License v1.0
+	* which accompanies this distribution, and is available at
+	* http://www.eclipse.org/legal/epl-v10.html
+	* 
+	* Contributors:
+	*     IBM Corporation - initial API and implementation
+	*******************************************************************************/ -->
+
+<!-- plugins: org.eclipse.ui.ide and org.eclipse.wst.xsd.ui.internal -->
+
+<contexts>
+	<context id="csh_outer_container">
+		<description />
+	</context>
+	<context id="new_file_wizard_page_context"><!-- fix this, there is no context id atm -->
+		<description>
+			Select the project or folder that will contain the XML schema. In the <b>File name</b> field, type the name of the XML schema, for example <i>MyXMLSchema.xsd</i>. The name of your XML schema must end in <i>.xsd</i>.
+		</description>
+		<topic
+			href="../org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.html"
+			label="Creating XML schemas" />
+	</context>
+	<context id="xsdp0010">
+		<description>
+			Select the <b>Qualify XML schema language constructs</b> check box if you want a prefix applied to all XML Schema language constructs in your XML schema.
+
+			In the <b>XML schema language constructs prefix</b> field, type the prefix you want applied to XML Schema language constructs in your XML schema. The prefix <i>xsd</i> is used by convention to denote the XML Schema namespace, but any prefix can be used. The purpose of the association is to identify the elements and simple types as belonging to the vocabulary of the XML Schema language rather than the vocabulary of the schema author.
+
+			<b>Note:</b> This prefix will not appear in any schemas that currently exist - it will only appear in new schemas you create after you type the prefix and click <b>Apply</b>. Any schemas that already exist will have the prefix specified in the schema applied to the XML schema language constructs.
+
+			You can change the <b>Default Target Namespace</b> value. The value specified in this field will be the default target namespace for any new XML schema files created.
+
+		</description>
+		<topic
+			href="../org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.html"
+			label="Editing XML schema file prefereces" />
+	</context>
+</contexts>
+
+
+
+
+
+
+
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/about.html b/docs/org.eclipse.wst.xml.ui.infopop/about.html
index 73db36e..2199df3 100644
--- a/docs/org.eclipse.wst.xml.ui.infopop/about.html
+++ b/docs/org.eclipse.wst.xml.ui.infopop/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/build.properties b/docs/org.eclipse.wst.xml.ui.infopop/build.properties
index ce23e37..780ce89 100644
--- a/docs/org.eclipse.wst.xml.ui.infopop/build.properties
+++ b/docs/org.eclipse.wst.xml.ui.infopop/build.properties
@@ -5,5 +5,8 @@
                plugin.properties,\
                plugin.xml,\
                XMLWizardContexts.xml,\
-               TableTree.xml
+               TableTree.xml,\
+               WSDLContexts.xml,\
+               XSDContexts.xml
+               
 generateSourceBundle=false
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/plugin.properties b/docs/org.eclipse.wst.xml.ui.infopop/plugin.properties
index 8725f94..8f91c49 100644
--- a/docs/org.eclipse.wst.xml.ui.infopop/plugin.properties
+++ b/docs/org.eclipse.wst.xml.ui.infopop/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2006 IBM Corporation and others.
+# Copyright (c) 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -10,4 +10,4 @@
 ###############################################################################
 
 pluginName     = XML infopops
-pluginProvider = Eclipse.org
+pluginProvider = Eclipse Web Tools Platform
diff --git a/docs/org.eclipse.wst.xml.ui.infopop/plugin.xml b/docs/org.eclipse.wst.xml.ui.infopop/plugin.xml
index 16e7be2..ccf4c5a 100644
--- a/docs/org.eclipse.wst.xml.ui.infopop/plugin.xml
+++ b/docs/org.eclipse.wst.xml.ui.infopop/plugin.xml
@@ -17,6 +17,8 @@
        <contexts file="EditorXmlContexts2.xml" plugin ="org.eclipse.core.runtime"/>
        <contexts file="TableTree.xml" plugin ="org.eclipse.wst.xml.ui"/>
        <contexts file="XMLWizardContexts.xml" plugin ="org.eclipse.wst.xml.ui"/>
+       <contexts file="WSDLContexts.xml" plugin ="org.eclipse.wst.wsdl.ui"/>
+       <contexts file="XSDContexts.xml" plugin ="org.eclipse.wst.xsd.ui"/>
 
 </extension>
 
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/DocBuild.xml b/docs/org.eclipse.wst.xmleditor.doc.user/DocBuild.xml
index 5a668fd..41f8355 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/DocBuild.xml
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/DocBuild.xml
@@ -23,6 +23,9 @@
 	- Created.
 	2008-01-09 Kate Price <katep@ca.ibm.com>
 	- modified for new DITA-OT version
+	2008-05-05 Kate Price <katep@ca.ibm.com>
+	- modified to add generation of pre-built help index. 
+	- Must delete /index folder before running build
 -->
 <project name="eclipsehelp" default="all">
 
@@ -47,8 +50,8 @@
 			<property name="args.copycss" value="no" />
 			<property name="args.csspath" value="../org.eclipse.wst.doc.user" />
 			<property name="args.eclipse.provider" value="Eclipse.org" />
-			<property name="args.eclipse.version" value="3.3.0" />
-			<property name="args.input" location="XMLBuildermap_toc.ditamap" />    		
+			<property name="args.eclipse.version" value="3.6.0" />
+			<property name="args.input" location="XMLBuilderrel.ditamap" />    		
 			<property name="clean.temp" value="true" />
 			<property name="dita.extname" value=".dita" />
 			<property name="dita.temp.dir" location="temp" />
@@ -57,4 +60,7 @@
 		</ant>
 		<copy file="myplugin.xml" tofile="plugin.xml" overwrite="yes" />
 	</target>
+	<target name="build.index" description="Builds search index for the plug-in" if="eclipse.running">
+	     <help.buildHelpIndex manifest="plugin.xml" destination="."/>
+	</target>
 </project>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.xmleditor.doc.user/META-INF/MANIFEST.MF
index 61bc49f..32bd50e 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.xmleditor.doc.user; singleton:=true
-Bundle-Version: 1.0.400.qualifier
+Bundle-Version: 1.0.700.qualifier
 Bundle-Vendor: %pluginProvider
 Bundle-Localization: plugin
 Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuildermap_toc.ditamap b/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuildermap_toc.ditamap
index 2ccd930..fcf32d5 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuildermap_toc.ditamap
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuildermap_toc.ditamap
@@ -73,6 +73,11 @@
 <anchor id="xml_post_txmlcat"/>

 <topicref href="topics/tedtgram.dita" id="tedtgram" navtitle="Updating XML files with changes made to DTDs and schemas">

 </topicref>

+<topicref href="topics/rxmlcatkey.dita" id="rxmlcatkey" navtitle="XML Catalog keyboard shortcuts">

+</topicref>

+<anchor id="xml_post_rxmlcatkey"/>

+<topicref href="topics/rxmltoolskey.dita" navtitle="XML editor keyboard shortcuts">

+</topicref>

 <anchor id="xml_post_tedtgram"/></topicref>

 <topicref href="topics/rxmlbicons.dita" id="ricons" navtitle="Icons used in the XML editor">

 </topicref>

diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuildermap_toc.xml b/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuildermap_toc.xml
index b36f4c9..929c809 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuildermap_toc.xml
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/XMLBuildermap_toc.xml
@@ -62,6 +62,9 @@
 <topic label="Adding entries to the XML Catalog" href="topics/txmlcat.html"/>
 <anchor id="xml_post_txmlcat"/>
 <topic label="Updating XML files with changes made to DTDs and schemas" href="topics/tedtgram.html"/>
+<topic label="XML Catalog keyboard shortcuts" href="topics/rxmlcatkey.html"/>
+<anchor id="xml_post_rxmlcatkey"/>
+<topic label="Source editor and XML tools keyboard shortcuts" href="topics/rxmltoolskey.html"/>
 <anchor id="xml_post_tedtgram"/>
 </topic>
 <topic label="Icons used in the XML editor" href="topics/rxmlbicons.html"/>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/about.html b/docs/org.eclipse.wst.xmleditor.doc.user/about.html
index 73db36e..2199df3 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/about.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/index/_u.cfs b/docs/org.eclipse.wst.xmleditor.doc.user/index/_u.cfs
deleted file mode 100644
index 795be84..0000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/index/_u.cfs
+++ /dev/null
Binary files differ
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/index/_w.cfs b/docs/org.eclipse.wst.xmleditor.doc.user/index/_w.cfs
new file mode 100644
index 0000000..a028898
--- /dev/null
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/index/_w.cfs
Binary files differ
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/index/deletable b/docs/org.eclipse.wst.xmleditor.doc.user/index/deletable
index e423242..593f470 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/index/deletable
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/index/deletable
Binary files differ
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_contributions b/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_contributions
index 66ea04d..2552ccf 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_contributions
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_contributions
@@ -1,3 +1,3 @@
 #This is a generated file; do not edit.

-#Wed May 09 14:16:15 EDT 2007

-org.eclipse.wst.xmleditor.doc.user=org.eclipse.wst.xmleditor.doc.user\n1.0.300.qualifier

+#Tue May 20 11:13:05 EDT 2008

+org.eclipse.wst.xmleditor.doc.user=org.eclipse.wst.xmleditor.doc.user\n1.0.400.qualifier

diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_dependencies b/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_dependencies
index 5d57cad..2d09d4e 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_dependencies
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_dependencies
@@ -1,4 +1,4 @@
 #This is a generated file; do not edit.

-#Wed May 09 14:16:15 EDT 2007

-lucene=1.4.103.v20060601

-analyzer=org.eclipse.help.base\#3.2.0.v20060601?locale\=en

+#Tue May 20 11:13:05 EDT 2008

+lucene=1.9.1.v200803061811

+analyzer=org.eclipse.help.base\#3.3.100.v20080425?locale\=en

diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_docs b/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_docs
index 56fe33a..6420de2 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_docs
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/index/indexed_docs
@@ -1,10 +1,11 @@
 #This is a generated file; do not edit.

-#Wed May 09 14:16:15 EDT 2007

+#Tue May 20 11:13:05 EDT 2008

 /org.eclipse.wst.xmleditor.doc.user/topics/tedtsch.html=0

 /org.eclipse.wst.xmleditor.doc.user/topics/cworkXML.html=0

 /org.eclipse.wst.xmleditor.doc.user/topics/txedttag.html=0

 /org.eclipse.wst.xmleditor.doc.user/topics/tedtcnst.html=0

 /org.eclipse.wst.xmleditor.doc.user/topics/cxmlcat.html=0

+/org.eclipse.wst.xmleditor.doc.user/topics/rxmlcatkey.html=0

 /org.eclipse.wst.xmleditor.doc.user/topics/tedtenc.html=0

 /org.eclipse.wst.xmleditor.doc.user/topics/cwxmledt.html=0

 /org.eclipse.wst.xmleditor.doc.user/topics/txprefs.html=0

@@ -21,6 +22,7 @@
 /org.eclipse.wst.xmleditor.doc.user/topics/twcdast.html=0

 /org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html=0

 /org.eclipse.wst.xmleditor.doc.user/topics/tcretxml.html=0

+/org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.html=0

 /org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html=0

 /org.eclipse.wst.xmleditor.doc.user/topics/twmacro.html=0

 /org.eclipse.wst.xmleditor.doc.user/topics/tedtgram.html=0

diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/index/segments b/docs/org.eclipse.wst.xmleditor.doc.user/index/segments
index 19b5d0c..a4a692b 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/index/segments
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/index/segments
Binary files differ
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/myplugin.xml b/docs/org.eclipse.wst.xmleditor.doc.user/myplugin.xml
index f0c28f1..a5f2007 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/myplugin.xml
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/myplugin.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
+<?eclipse version="3.6"?>
 <?NLS TYPE="org.eclipse.help.toc"?>
 <!-- /*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -28,5 +28,5 @@
         point="org.eclipse.help.index">
         <index file="org.eclipse.wst.xmleditor.doc.userindex.xml"/>     
   </extension>
-  
+
 </plugin>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/org.eclipse.wst.xmleditor.doc.user.maplist b/docs/org.eclipse.wst.xmleditor.doc.user/org.eclipse.wst.xmleditor.doc.user.maplist
new file mode 100644
index 0000000..6c3e248
--- /dev/null
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/org.eclipse.wst.xmleditor.doc.user.maplist
@@ -0,0 +1,8 @@
+<maplist version="3.6.2">

+  <nav>

+    <map file="XMLBuildermap_toc.ditamap"/>

+  </nav>

+  <link>

+    <map file="XMLBuilderrel.ditamap"/>

+  </link>

+</maplist>

diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/org.eclipse.wst.xmleditor.doc.userindex.html b/docs/org.eclipse.wst.xmleditor.doc.user/org.eclipse.wst.xmleditor.doc.userindex.html
deleted file mode 100644
index 384cdcd..0000000
--- a/docs/org.eclipse.wst.xmleditor.doc.user/org.eclipse.wst.xmleditor.doc.userindex.html
+++ /dev/null
@@ -1,162 +0,0 @@
-<?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 lang="en-us" xml:lang="en-us">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="copyright" content="(C) Copyright IBM Corporation 2007" />
-<meta name="security" content="public" />
-<meta name="Robots" content="index,follow" />
-<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
-<meta name="DC.Format" content="XHTML" />
-<!-- All rights reserved. Licensed Materials Property of IBM -->
-<!-- US Government Users Restricted Rights -->
-<!-- Use, duplication or disclosure restricted by -->
-<!-- GSA ADP Schedule Contract with IBM Corp. -->
-<link rel="stylesheet" type="text/css" href="ibmdita.css" />
-<title>Index</title>
-</head>
-<body>
-<h1>Index</h1>
-<a name="IDX0_43" href="#IDX1_43">C</a>
-<a name="IDX0_44" href="#IDX1_44">D</a>
-<a name="IDX0_45" href="#IDX1_45">E</a>
-<a name="IDX0_4C" href="#IDX1_4C">L</a>
-<a name="IDX0_50" href="#IDX1_50">P</a>
-<a name="IDX0_58" href="#IDX1_58">X</a>
-<hr></hr>
-<strong><a name="IDX1_43" href="#IDX0_43">C</a></strong>
-<ul class="indexlist">
-<li>character encoding
-<ul class="indexlist">
-<li><a href="topics/cxmlenc.html#cxmlenc">text in files</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_44" href="#IDX0_44">D</a></strong>
-<ul class="indexlist">
-<li>DOCTYPE declarations
-<ul class="indexlist">
-<li><a href="topics/tedtdoc.html#tedtdoc">XML editor</a>
-</li>
-</ul>
-</li>
-<li>DTD
-<ul class="indexlist">
-<li><a href="topics/tcrexdtd.html#tcrexdtd">generating XML files</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_45" href="#IDX0_45">E</a></strong>
-<ul class="indexlist">
-<li>encodings
-<ul class="indexlist">
-<li><a href="topics/cxmlenc.html#cxmlenc">supported character sets</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_4C" href="#IDX0_4C">L</a></strong>
-<ul class="indexlist">
-<li>line delimiters
-<ul class="indexlist">
-<li><a href="topics/tedtenc.html#tedtenc">XML files</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_50" href="#IDX0_50">P</a></strong>
-<ul class="indexlist">
-<li>preferences
-<ul class="indexlist">
-<li><a href="topics/txprefs.html#txprefs">XML editor</a>
-</li>
-</ul>
-</li>
-</ul>
-<strong><a name="IDX1_58" href="#IDX0_58">X</a></strong>
-<ul class="indexlist">
-<li>XML catalog
-<ul class="indexlist">
-<li><a href="topics/txmlcat.html#txmlcat">adding entries</a>
-</li>
-<li><a href="topics/cxmlcat.html#cxmlcat">overview</a>
-</li>
-</ul>
-</li>
-<li>XML editor
-<ul class="indexlist">
-<li><a href="topics/twcdast.html#twcdast">content assist</a>
-</li>
-<li><a href="topics/txedtdes.html#txedtdes">Design view</a>
-</li>
-<li><a href="topics/tedtdoc.html#tedtdoc">DOCTYPE declarations</a>
-</li>
-<li><a href="topics/tedtcnst.html#tedtcnst">editing with constraints</a>
-</li>
-<li><a href="topics/rxmlbicons.html#ricons">icons</a>
-</li>
-<li><a href="topics/tedtsch.html#tedtsch">namespace information</a>
-</li>
-<li><a href="topics/cwxmledt.html#cwxmledt">overview</a>
-</li>
-<li><a href="topics/txprefs.html#txprefs">preferences</a>
-</li>
-<li><a href="topics/tedtproc.html#tedtproc">processing instructions</a>
-</li>
-<li><a href="topics/ttaghilt.html#ttaghilt">setting source highlighting styles</a>
-</li>
-<li><a href="topics/tsugstrat.html#xmlsourcesuggestionstrategy">source suggestion strategy</a>
-</li>
-<li><a href="topics/txedtsrc.html#txedtsrc">Source view</a>
-</li>
-<li><a href="topics/tedtgram.html#tedtgram">updating XML files</a>
-</li>
-<li><a href="topics/txedttag.html#txedttag">XML files</a>
-</li>
-</ul>
-</li>
-<li>XML files
-<ul class="indexlist">
-<li><a href="topics/cxmlcat.html#cxmlcat">associations</a>
-</li>
-<li><a href="topics/twcdast.html#twcdast">content assist</a>
-</li>
-<li><a href="topics/tcretxml.html#tcretxml">creating</a>
-</li>
-<li><a href="topics/txedttag.html#txedttag">editing</a>
-</li>
-<li><a href="topics/tedtcnst.html#tedtcnst">editing with constraints</a>
-</li>
-<li><a href="topics/tcrexdtd.html#tcrexdtd">generating from DTDs</a>
-</li>
-<li><a href="topics/tcrexxsd.html#tcrexxsd">generating from XML schemas</a>
-</li>
-<li><a href="topics/tedtsch.html#tedtsch">namespace information</a>
-</li>
-<li><a href="topics/tedtproc.html#tedtproc">processing instructions</a>
-</li>
-<li><a href="topics/tedtenc.html#tedtenc">specifying line delimiters</a>
-</li>
-<li><a href="topics/tedtgram.html#tedtgram">updating with associated changes</a>
-</li>
-<li><a href="topics/twxvalid.html#twxvalid">validating</a>
-</li>
-</ul>
-</li>
-<li>XML schemas
-<ul class="indexlist">
-<li><a href="topics/tcrexxsd.html#tcrexxsd">generating XML files</a>
-</li>
-</ul>
-</li>
-<li>XML templates
-<ul class="indexlist">
-<li><a href="topics/twmacro.html#twmacro">working with predefined code</a>
-</li>
-</ul>
-</li>
-</ul>
-</body></html>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/org.eclipse.wst.xmleditor.doc.userindex.xml b/docs/org.eclipse.wst.xmleditor.doc.user/org.eclipse.wst.xmleditor.doc.userindex.xml
index 4b66584..2218ba0 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/org.eclipse.wst.xmleditor.doc.userindex.xml
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/org.eclipse.wst.xmleditor.doc.userindex.xml
@@ -10,6 +10,9 @@
     <entry keyword="generating from XML schemas">
       <topic href="topics/tcrexxsd.html#tcrexxsd" title="Generating XML files from XML schemas"/>
     </entry>
+    <entry keyword="schemas">
+      <topic href="topics/tcrexxsd.html#tcrexxsd" title="Generating XML files from XML schemas"/>
+    </entry>
     <entry keyword="editing">
       <topic href="topics/txedttag.html#txedttag" title="Editing XML files"/>
     </entry>
@@ -25,6 +28,9 @@
     <entry keyword="content assist">
       <topic href="topics/twcdast.html#twcdast" title="Using XML content assist"/>
     </entry>
+    <entry keyword="templates">
+      <topic href="topics/twmacro.html#twmacro" title="Working with XML templates"/>
+    </entry>
     <entry keyword="editing with constraints">
       <topic href="topics/tedtcnst.html#tedtcnst" title="Editing with DTD or XML schema constraints"/>
     </entry>
@@ -38,12 +44,12 @@
       <topic href="topics/tedtgram.html#tedtgram" title="Updating XML files with changes made to DTDs and schemas"/>
     </entry>
   </entry>
-  <entry keyword="DTD">
+  <entry keyword="DTDs">
     <entry keyword="generating XML files">
       <topic href="topics/tcrexdtd.html#tcrexdtd" title="Generating XML files from DTDs"/>
     </entry>
   </entry>
-  <entry keyword="XML schemas">
+  <entry keyword="schemas">
     <entry keyword="generating XML files">
       <topic href="topics/tcrexxsd.html#tcrexxsd" title="Generating XML files from XML schemas"/>
     </entry>
@@ -88,6 +94,12 @@
     <entry keyword="updating XML files">
       <topic href="topics/tedtgram.html#tedtgram" title="Updating XML files with changes made to DTDs and schemas"/>
     </entry>
+    <entry keyword="accessibility">
+      <topic href="topics/rxmlcatkey.html#xmlcatalogkeyboardshortcuts" title="XML Catalog keyboard shortcuts"/>
+    </entry>
+    <entry keyword="keyboard shortcuts">
+      <topic href="topics/rxmlcatkey.html#xmlcatalogkeyboardshortcuts" title="XML Catalog keyboard shortcuts"/>
+    </entry>
     <entry keyword="icons">
       <topic href="topics/rxmlbicons.html#ricons" title="Icons used in the XML editor"/>
     </entry>
@@ -103,11 +115,6 @@
     </entry>
   </entry>
   <entry keyword="character encoding">
-    <entry keyword="text in files">
-      <topic href="topics/cxmlenc.html#cxmlenc" title="XML and HTML encodings"/>
-    </entry>
-  </entry>
-  <entry keyword="encodings">
     <entry keyword="supported character sets">
       <topic href="topics/cxmlenc.html#cxmlenc" title="XML and HTML encodings"/>
     </entry>
@@ -117,8 +124,8 @@
       <topic href="topics/tedtdoc.html#tedtdoc" title="Editing DOCTYPE declarations"/>
     </entry>
   </entry>
-  <entry keyword="XML templates">
-    <entry keyword="working with predefined code">
+  <entry keyword="templates">
+    <entry keyword="working with predefined XML code">
       <topic href="topics/twmacro.html#twmacro" title="Working with XML templates"/>
     </entry>
   </entry>
@@ -130,4 +137,23 @@
       <topic href="topics/txmlcat.html#txmlcat" title="Adding entries to the XML Catalog"/>
     </entry>
   </entry>
+  <entry keyword="accessibility">
+    <entry keyword="keyboard shortcuts">
+      <entry keyword="XML editor">
+        <topic href="topics/rxmlcatkey.html#xmlcatalogkeyboardshortcuts" title="XML Catalog keyboard shortcuts"/>
+      </entry>
+    </entry>
+  </entry>
+  <entry keyword="keyboard shortcuts">
+    <entry keyword="XML editor">
+      <topic href="topics/rxmlcatkey.html#xmlcatalogkeyboardshortcuts" title="XML Catalog keyboard shortcuts"/>
+    </entry>
+  </entry>
+  <entry keyword="shortcuts">
+    <entry keyword="keyboard">
+      <entry keyword="XML editor">
+        <topic href="topics/rxmlcatkey.html#xmlcatalogkeyboardshortcuts" title="XML Catalog keyboard shortcuts"/>
+      </entry>
+    </entry>
+  </entry>
 </index>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/plugin.properties b/docs/org.eclipse.wst.xmleditor.doc.user/plugin.properties
index 13ed1ee..0eed379 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/plugin.properties
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2006 IBM Corporation and others.
+# Copyright (c) 2006, 2010 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -10,4 +10,4 @@
 ###############################################################################
 
 pluginName     = XML editor
-pluginProvider = Eclipse.org
+pluginProvider = Eclipse Web Tools Platform
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/plugin.xml b/docs/org.eclipse.wst.xmleditor.doc.user/plugin.xml
index f0c28f1..a5f2007 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/plugin.xml
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/plugin.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
+<?eclipse version="3.6"?>
 <?NLS TYPE="org.eclipse.help.toc"?>
 <!-- /*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -28,5 +28,5 @@
         point="org.eclipse.help.index">
         <index file="org.eclipse.wst.xmleditor.doc.userindex.xml"/>     
   </extension>
-  
+
 </plugin>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/ccreatxm.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/ccreatxm.html
index ef49057..c311767 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/ccreatxm.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/ccreatxm.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cworkXML.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cworkXML.html
index 9775da8..4e93c8a 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cworkXML.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cworkXML.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cwxmledt.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cwxmledt.dita
index 1e406fa..654b609 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cwxmledt.dita
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cwxmledt.dita
@@ -50,7 +50,6 @@
 need to do form-oriented editing. For example, you could use the Create XML

 File wizard to create a template XML file for a job description form from

 a job description DTD. After those steps are completed, you would only have

-to fill in the form data using the Design view.</p><p></p><?Pub Caret1?></section>

+to fill in the form data using the Design view.</p></section>

 </conbody>

 </concept>

-<?Pub *0000002948?>

diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cwxmledt.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cwxmledt.html
index a0d3a4e..59a1ed7 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cwxmledt.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cwxmledt.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -93,7 +93,6 @@
 File wizard to create a template XML file for a job description form from
 a job description DTD. After those steps are completed, you would only have
 to fill in the form data using the Design view.</p>
-<p />
 </div>
 
 </div>
@@ -106,7 +105,7 @@
 <div><a href="../topics/tcrexdtd.html" title="You can generate an XML file from your DTD if you want to quickly create an XML file based on your DTD file. Generating an XML file from your DTD saves you time by creating an XML file that is already associated with your DTD, and contains at least some of the elements and attributes in your DTD.">Generating XML files from DTDs</a></div>
 <div><a href="../topics/tcrexxsd.html" title="You can generate an XML file from your XML schema if you want to quickly create an XML file based on your XML schema file. Generating an XML file from your XML schema saves you time by creating an XML file that is already associated with your XML schema, and contains at least some of the elements and attributes in your XML schema.">Generating XML files from XML schemas</a></div>
 <div><a href="../topics/txedttag.html" title="This file contains information about editing XML files.">Editing XML files</a></div>
-<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
+<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
 <div><a href="../topics/txedtsrc.html" title="You can use the Source view to view and work with a file's source code directly.">Editing in the Source view</a></div>
 <div><a href="../topics/twxvalid.html" title="When you validate your XML file, the XML validator will check to see that your file is valid and well-formed.">Validating XML files</a></div>
 </div>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlcat.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlcat.html
index 7a58bec..45d1c40 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlcat.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlcat.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -182,11 +182,11 @@
 <div class="reltasks"><strong>Related tasks</strong><br />
 <div><a href="../topics/tedtcnst.html" title="In the Design view, when you edit an XML file that has a set of constraints or rules defined by a DTD or an XML schema, you can turn the constraints on and off to provide flexibility in the way you edit, but still maintain the validity of the document periodically.">Editing with DTD or XML schema constraints</a></div>
 <div><a href="../topics/tedtdoc.html" title="The DOCTYPE declaration in an XML file is used at the beginning of it to associate it with a DTD file. You can edit your DOCTYPE declaration to change the DTD file your XML file is associated with.">Editing DOCTYPE declarations</a></div>
-<div><a href="../topics/txmlcat.html" title="An XML Catalog entry contains two parts - a Key (which represents a DTD or XML schema) and a Location (similar to a URI, which contains information about a DTD or XML schema's location). You can place the Key in an XML file. When the XML processor encounters it, it will use the XML Catalog entry to find the location of the DTD or XML schema associated with the Key">Adding entries to the XML Catalog</a></div>
+<div><a href="../topics/txmlcat.html" title="XML Catalog entries are used to map external entity references to locally defined resources. You can provide rules specify how these entities are resolved">Adding entries to the XML Catalog</a></div>
 <div><a href="../topics/tedtgram.html" title="If you make changes to a DTD file or XML schema associated with an XML file (that is currently open), click XML &gt; Reload Dependencies to update the XML file with these changes. The changes will be reflected in the guided editing mechanisms available in the editor, such as content assist.">Updating XML files with changes made to DTDs and schemas</a></div>
 <div><a href="../topics/tedtsch.html" title="Your namespace information is used to provide various information about the XML file, such as the XML schema and namespace it is associated with. If desired, you can change the schema and namespace your XML file is associated with or add a new association. Modifying any associations can impact what content is allowed in the XML file.">Editing namespace information</a></div>
 <div><a href="../topics/tedtproc.html" title="If you have instructions you want to send to an application using an XML document, you can use a processing instruction.">Editing XML processing instructions</a></div>
-<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
+<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
 <div><a href="../topics/txedtsrc.html" title="You can use the Source view to view and work with a file's source code directly.">Editing in the Source view</a></div>
 </div>
 </div>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlenc.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlenc.dita
index a291679..b5f74d8 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlenc.dita
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlenc.dita
@@ -2,7 +2,6 @@
 <!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"

  "concept.dtd">

-<?Pub Inc?>

 <concept id="cxmlenc" xml:lang="en-us">

 <title>XML and HTML encodings</title>

 <titlealts>

@@ -11,9 +10,8 @@
 <shortdesc>Encodings enable you to specify what character encoding your text

 is in.</shortdesc>

 <prolog><metadata>

-<keywords><indexterm>character encoding<indexterm>text in files</indexterm></indexterm>

-<indexterm>encodings<indexterm>supported character sets</indexterm></indexterm>

-</keywords>

+<keywords><indexterm keyref="cxmlenc|1|characterencodingtextinfiles" status="changed">character

+encoding<indexterm>supported character sets</indexterm></indexterm></keywords>

 </metadata></prolog>

 <conbody>

 <p>The IANA name is used in the encoding statement of an XML file, or charset

@@ -118,7 +116,7 @@
 <entry> <p>Unicode LittleEndian</p> </entry>

 </row>

 <row>

-<entry colname="COLSPEC0"><p>WINDOWS-31J<?Pub Caret?></p></entry>

+<entry colname="COLSPEC0"><p>WINDOWS-31J</p></entry>

 <entry colname="COLSPEC1"><p>Japanese, Windows-31J</p></entry>

 </row>

 <row>

@@ -134,4 +132,3 @@
 </table>

 </conbody>

 </concept>

-<?Pub *0000003415?>

diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlenc.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlenc.html
index f58ec34..7e723b1 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlenc.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/cxmlenc.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="XML and HTML encodings" />
 <meta name="abstract" content="Encodings enable you to specify what character encoding your text is in." />
 <meta name="description" content="Encodings enable you to specify what character encoding your text is in." />
-<meta content="character encoding, text in files, encodings, supported character sets" name="DC.subject" />
-<meta content="character encoding, text in files, encodings, supported character sets" name="keywords" />
+<meta content="character encoding, supported character sets" name="DC.subject" />
+<meta content="character encoding, supported character sets" name="keywords" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="cxmlenc" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -39,10 +39,10 @@
 <div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="border" border="1" rules="all">
 <thead align="left">
 <tr>
-<th valign="top" class="firstcol" id="N1007C"> <p><strong>XML Encoding (IANA Name)</strong></p>
+<th valign="top" class="firstcol" id="N10072"> <p><strong>XML Encoding (IANA Name)</strong></p>
  </th>
 
-<th valign="top" id="N1008E"> <p><strong>Description</strong></p>
+<th valign="top" id="N10084"> <p><strong>Description</strong></p>
  </th>
 
 </tr>
@@ -51,211 +51,211 @@
 
 <tbody>
 <tr>
-<th valign="top" class="firstcol" id="N100AC" headers="N1007C "> <p>BIG5</p>
+<th valign="top" class="firstcol" id="N100A2" headers="N10072 "> <p>BIG5</p>
  </th>
 
-<td valign="top" headers="N100AC N1008E "> <p>Big5, Traditional Chinese</p>
+<td valign="top" headers="N100A2 N10084 "> <p>Big5, Traditional Chinese</p>
  </td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N100CC" headers="N1007C "> <p>EUC-JP</p>
+<th valign="top" class="firstcol" id="N100C2" headers="N10072 "> <p>EUC-JP</p>
  </th>
 
-<td valign="top" headers="N100CC N1008E "> <p>EUC encoding, Japanese</p>
+<td valign="top" headers="N100C2 N10084 "> <p>EUC encoding, Japanese</p>
  </td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N100EC" headers="N1007C "> <p>EUC-KR</p>
+<th valign="top" class="firstcol" id="N100E2" headers="N10072 "> <p>EUC-KR</p>
  </th>
 
-<td valign="top" headers="N100EC N1008E "> <p>EUC encoding, Korean</p>
+<td valign="top" headers="N100E2 N10084 "> <p>EUC encoding, Korean</p>
  </td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N1010C" headers="N1007C ">GB18030</th>
+<th valign="top" class="firstcol" id="N10102" headers="N10072 ">GB18030</th>
 
-<td valign="top" headers="N1010C N1008E ">National Standard, Chinese</td>
+<td valign="top" headers="N10102 N10084 ">National Standard, Chinese</td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N10120" headers="N1007C "> <p>ISO-2022-JP</p>
+<th valign="top" class="firstcol" id="N10116" headers="N10072 "> <p>ISO-2022-JP</p>
  </th>
 
-<td valign="top" headers="N10120 N1008E "> <p>ISO 2022, Japanese</p>
+<td valign="top" headers="N10116 N10084 "> <p>ISO 2022, Japanese</p>
  </td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N10140" headers="N1007C "> <p>ISO-2022-KR</p>
+<th valign="top" class="firstcol" id="N10136" headers="N10072 "> <p>ISO-2022-KR</p>
  </th>
 
-<td valign="top" headers="N10140 N1008E "> <p>ISO 2022, Korean</p>
+<td valign="top" headers="N10136 N10084 "> <p>ISO 2022, Korean</p>
  </td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N10160" headers="N1007C "> <p>ISO-8859-1</p>
+<th valign="top" class="firstcol" id="N10156" headers="N10072 "> <p>ISO-8859-1</p>
  </th>
 
-<td valign="top" headers="N10160 N1008E "> <p>ISO Latin-1</p>
+<td valign="top" headers="N10156 N10084 "> <p>ISO Latin-1</p>
  </td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N10180" headers="N1007C ">ISO-8859-2</th>
+<th valign="top" class="firstcol" id="N10176" headers="N10072 ">ISO-8859-2</th>
 
-<td valign="top" headers="N10180 N1008E ">Central/East European (Slavic)</td>
+<td valign="top" headers="N10176 N10084 ">Central/East European (Slavic)</td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N10194" headers="N1007C ">ISO-8859-3</th>
+<th valign="top" class="firstcol" id="N1018A" headers="N10072 ">ISO-8859-3</th>
 
-<td valign="top" headers="N10194 N1008E ">Southern European</td>
+<td valign="top" headers="N1018A N10084 ">Southern European</td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N101A8" headers="N1007C ">ISO-8859-4</th>
+<th valign="top" class="firstcol" id="N1019E" headers="N10072 ">ISO-8859-4</th>
 
-<td valign="top" headers="N101A8 N1008E ">ISO 8859-4, Cyrillic</td>
+<td valign="top" headers="N1019E N10084 ">ISO 8859-4, Cyrillic</td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N101BC" headers="N1007C ">ISO-8859-5</th>
+<th valign="top" class="firstcol" id="N101B2" headers="N10072 ">ISO-8859-5</th>
 
-<td valign="top" headers="N101BC N1008E ">ISO 8859-5, Cyrillic</td>
+<td valign="top" headers="N101B2 N10084 ">ISO 8859-5, Cyrillic</td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N101D0" headers="N1007C "> <p>ISO-8859-6</p>
+<th valign="top" class="firstcol" id="N101C6" headers="N10072 "> <p>ISO-8859-6</p>
  </th>
 
-<td valign="top" headers="N101D0 N1008E "> <p>Arabic (Logical)</p>
+<td valign="top" headers="N101C6 N10084 "> <p>Arabic (Logical)</p>
  </td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N101F0" headers="N1007C ">ISO-8859-7</th>
+<th valign="top" class="firstcol" id="N101E6" headers="N10072 ">ISO-8859-7</th>
 
-<td valign="top" headers="N101F0 N1008E ">Greek</td>
+<td valign="top" headers="N101E6 N10084 ">Greek</td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N10204" headers="N1007C "> <p>ISO-8859-8</p>
+<th valign="top" class="firstcol" id="N101FA" headers="N10072 "> <p>ISO-8859-8</p>
  </th>
 
-<td valign="top" headers="N10204 N1008E "> <p>Hebrew (Visual) (encoding supported, but not supported by the Page
+<td valign="top" headers="N101FA N10084 "> <p>Hebrew (Visual) (encoding supported, but not supported by the Page
 Designer Design page)</p>
  </td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N10224" headers="N1007C ">ISO-8859-9</th>
+<th valign="top" class="firstcol" id="N1021A" headers="N10072 ">ISO-8859-9</th>
 
-<td valign="top" headers="N10224 N1008E ">Turkish</td>
+<td valign="top" headers="N1021A N10084 ">Turkish</td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N10238" headers="N1007C "> <p>SHIFT_JIS</p>
+<th valign="top" class="firstcol" id="N1022E" headers="N10072 "> <p>SHIFT_JIS</p>
  </th>
 
-<td valign="top" headers="N10238 N1008E "> <p>Shift-JIS, Japanese</p>
+<td valign="top" headers="N1022E N10084 "> <p>Shift-JIS, Japanese</p>
  </td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N10258" headers="N1007C ">TIS-620</th>
+<th valign="top" class="firstcol" id="N1024E" headers="N10072 ">TIS-620</th>
 
-<td valign="top" headers="N10258 N1008E ">TISI, Thai</td>
+<td valign="top" headers="N1024E N10084 ">TISI, Thai</td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N1026C" headers="N1007C "> <p>US-ASCII</p>
+<th valign="top" class="firstcol" id="N10262" headers="N10072 "> <p>US-ASCII</p>
  </th>
 
-<td valign="top" headers="N1026C N1008E "> <p>US ASCII</p>
+<td valign="top" headers="N10262 N10084 "> <p>US ASCII</p>
  </td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N1028C" headers="N1007C "> <p>UTF-8</p>
+<th valign="top" class="firstcol" id="N10282" headers="N10072 "> <p>UTF-8</p>
  </th>
 
-<td valign="top" headers="N1028C N1008E "> <p>ISO 10646/Unicode, one-byte encoding</p>
+<td valign="top" headers="N10282 N10084 "> <p>ISO 10646/Unicode, one-byte encoding</p>
  </td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N102AC" headers="N1007C "> <p>UTF-16</p>
+<th valign="top" class="firstcol" id="N102A2" headers="N10072 "> <p>UTF-16</p>
  </th>
 
-<td valign="top" headers="N102AC N1008E "> <p>ISO 10646/Unicode, two-byte encoding</p>
+<td valign="top" headers="N102A2 N10084 "> <p>ISO 10646/Unicode, two-byte encoding</p>
  </td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N102CC" headers="N1007C "> <p>UTF-16BE</p>
+<th valign="top" class="firstcol" id="N102C2" headers="N10072 "> <p>UTF-16BE</p>
  </th>
 
-<td valign="top" headers="N102CC N1008E "> <p>Unicode BigEndian</p>
+<td valign="top" headers="N102C2 N10084 "> <p>Unicode BigEndian</p>
  </td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N102EC" headers="N1007C "> <p>UTF-16LE</p>
+<th valign="top" class="firstcol" id="N102E2" headers="N10072 "> <p>UTF-16LE</p>
  </th>
 
-<td valign="top" headers="N102EC N1008E "> <p>Unicode LittleEndian</p>
+<td valign="top" headers="N102E2 N10084 "> <p>Unicode LittleEndian</p>
  </td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N1030C" headers="N1007C "><p>WINDOWS-31J</p>
+<th valign="top" class="firstcol" id="N10302" headers="N10072 "><p>WINDOWS-31J</p>
 </th>
 
-<td valign="top" headers="N1030C N1008E "><p>Japanese, Windows-31J</p>
+<td valign="top" headers="N10302 N10084 "><p>Japanese, Windows-31J</p>
 </td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N10328" headers="N1007C "> <p>WINDOWS-1255</p>
+<th valign="top" class="firstcol" id="N1031E" headers="N10072 "> <p>WINDOWS-1255</p>
  </th>
 
-<td valign="top" headers="N10328 N1008E "> <p>Hebrew</p>
+<td valign="top" headers="N1031E N10084 "> <p>Hebrew</p>
  </td>
 
 </tr>
 
 <tr>
-<th valign="top" class="firstcol" id="N10348" headers="N1007C "> <p>WINDOWS-1256</p>
+<th valign="top" class="firstcol" id="N1033E" headers="N10072 "> <p>WINDOWS-1256</p>
  </th>
 
-<td valign="top" headers="N10348 N1008E "> <p>Arabic</p>
+<td valign="top" headers="N1033E N10084 "> <p>Arabic</p>
  </td>
 
 </tr>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rextctn.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rextctn.html
index 0b7ff5b..7b9c4e2 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rextctn.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rextctn.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rlimitations_slushXML.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rlimitations_slushXML.html
index e9b23f5..dba12c0 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rlimitations_slushXML.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rlimitations_slushXML.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlbicons.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlbicons.html
index 660543a..7b99c63 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlbicons.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlbicons.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -91,7 +91,7 @@
 </div>
 
 <div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
+<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
 </div>
 </div>
 
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlcatkey.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlcatkey.dita
new file mode 100644
index 0000000..4952c8d
--- /dev/null
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlcatkey.dita
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>

+<!--Arbortext, Inc., 1988-2006, v.4002-->

+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"

+ "reference.dtd">

+<reference id="xmlcatalogkeyboardshortcuts" xml:lang="en-us">

+<title outputclass="id_title">XML Catalog keyboard shortcuts</title>

+<shortdesc outputclass="id_shortdesc">Accelerator keys can be used in the

+catalog tree structure and catalog entry wizard by first pressing and holding

+the Alt key.</shortdesc>

+<prolog><metadata>

+<keywords><indexterm>accessibility<indexterm>keyboard shortcuts<indexterm>XML

+catalog wizard</indexterm></indexterm></indexterm><indexterm>keyboard shortcuts<indexterm>XML

+catalog wizard</indexterm></indexterm><indexterm>shortcuts<indexterm>keyboard<indexterm>XML

+catalog wizard</indexterm></indexterm></indexterm><indexterm>XML catalog wizard<indexterm>accessibility</indexterm></indexterm>

+<indexterm>XML catalog wizard<indexterm>keyboard shortcuts</indexterm></indexterm>

+</keywords>

+</metadata></prolog>

+<refbody>

+<table frame="all">

+<tgroup cols="2"><colspec colname="col1" colwidth="84*"/><colspec colname="col3"

+colwidth="93*"/>

+<thead>

+<row valign="bottom">

+<entry colname="col1">Key Combination</entry>

+<entry colname="col3">Function</entry>

+</row>

+</thead>

+<tbody>

+<row>

+<entry colname="col1">Alt+A</entry>

+<entry colname="col3">Add catalog entry</entry>

+</row>

+<row>

+<entry colname="col1">Alt+E</entry>

+<entry colname="col3">Edit selected catalog entry</entry>

+</row>

+<row>

+<entry colname="col1">Alt+R</entry>

+<entry colname="col3">Remove selected catalog entry</entry>

+</row>

+</tbody>

+</tgroup>

+</table>

+</refbody>

+</reference>

diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlcatkey.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlcatkey.html
new file mode 100644
index 0000000..2ebc145
--- /dev/null
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmlcatkey.html
@@ -0,0 +1,76 @@
+<?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 lang="en-us" xml:lang="en-us">
+<head>
+<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
+<meta content="public" name="security" />
+<meta content="index,follow" name="Robots" />
+<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
+<meta content="reference" name="DC.Type" />
+<meta name="DC.Title" content="XML Catalog keyboard shortcuts" />
+<meta name="abstract" content="Accelerator keys can be used in the catalog tree structure and catalog entry wizard by first pressing and holding the Alt key." />
+<meta name="description" content="Accelerator keys can be used in the catalog tree structure and catalog entry wizard by first pressing and holding the Alt key." />
+<meta content="accessibility, keyboard shortcuts, XML catalog wizard, shortcuts, keyboard, XML catalog wizard" name="DC.subject" />
+<meta content="accessibility, keyboard shortcuts, XML catalog wizard, shortcuts, keyboard, XML catalog wizard" name="keywords" />
+<meta content="XHTML" name="DC.Format" />
+<meta content="xmlcatalogkeyboardshortcuts" name="DC.Identifier" />
+<meta content="en-us" name="DC.Language" />
+<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
+<title>XML Catalog keyboard shortcuts</title>
+</head>
+<body id="xmlcatalogkeyboardshortcuts"><a name="xmlcatalogkeyboardshortcuts"><!-- --></a>
+
+
+<h1 class="id_title">XML Catalog keyboard shortcuts</h1>
+
+
+
+<div><p class="id_shortdesc">Accelerator keys can be used in the
+catalog tree structure and catalog entry wizard by first pressing and holding
+the Alt key.</p>
+
+
+<div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="border" border="1" rules="all">
+<thead align="left">
+<tr valign="bottom">
+<th valign="bottom" width="47.45762711864407%" id="N10091">Key Combination</th>
+
+<th valign="bottom" width="52.54237288135594%" id="N10098">Function</th>
+
+</tr>
+
+</thead>
+
+<tbody>
+<tr>
+<td valign="top" width="47.45762711864407%" headers="N10091 ">Alt+A</td>
+
+<td valign="top" width="52.54237288135594%" headers="N10098 ">Add catalog entry</td>
+
+</tr>
+
+<tr>
+<td valign="top" width="47.45762711864407%" headers="N10091 ">Alt+E</td>
+
+<td valign="top" width="52.54237288135594%" headers="N10098 ">Edit selected catalog entry</td>
+
+</tr>
+
+<tr>
+<td valign="top" width="47.45762711864407%" headers="N10091 ">Alt+R</td>
+
+<td valign="top" width="52.54237288135594%" headers="N10098 ">Remove selected catalog entry</td>
+
+</tr>
+
+</tbody>
+
+</table>
+</div>
+
+</div>
+
+
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.dita
new file mode 100644
index 0000000..b0edc3f
--- /dev/null
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.dita
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="utf-8"?>

+<!--Arbortext, Inc., 1988-2006, v.4002-->

+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"

+ "reference.dtd">

+<reference id="xmltoolskeyboardshortcuts" xml:lang="en-us">

+<title>Source editor and XML tools keyboard shortcuts</title>

+<shortdesc>The following keyboard shortcuts are available for the XML, XSD,

+WSDL, HTML, JSP, CSS and DTD editors.</shortdesc>

+<prolog><metadata>

+<keywords><indexterm>accessibility<indexterm>keyboard shortcuts<indexterm>XML

+editor</indexterm></indexterm></indexterm><indexterm>accessibility<indexterm>keyboard

+shortcuts<indexterm>source editor</indexterm></indexterm></indexterm><indexterm>keyboard

+shortcuts<indexterm>XML editor</indexterm></indexterm><indexterm>shortcuts<indexterm>keyboard<indexterm>XML

+editor</indexterm></indexterm></indexterm><indexterm>XML editor<indexterm>accessibility</indexterm></indexterm>

+<indexterm>XML editor<indexterm>keyboard shortcuts</indexterm></indexterm>

+<indexterm>XSD editor<indexterm>keyboard shortcuts</indexterm></indexterm>

+<indexterm>WSDL editor<indexterm>keyboard shortcuts</indexterm></indexterm>

+<indexterm>HTML editor<indexterm>keyboard shortcuts</indexterm></indexterm>

+<indexterm>JSP editor<indexterm>keyboard shortcuts</indexterm></indexterm>

+<indexterm>CSS editor<indexterm>keyboard shortcuts</indexterm></indexterm>

+<indexterm>DTD editor<indexterm>keyboard shortcuts</indexterm></indexterm>

+</keywords>

+</metadata></prolog>

+<refbody>

+<section><title>Shortcuts available in all source editors</title><simpletable>

+<sthead>

+<stentry>Command</stentry>

+<stentry>Shortcut</stentry>

+</sthead>

+<strow>

+<stentry>Go To Matching Bracket</stentry>

+<stentry>Ctrl+Shift+P</stentry>

+</strow>

+<strow>

+<stentry>Restore Last Selection</stentry>

+<stentry>Atl+Shift+Down</stentry>

+</strow>

+<strow>

+<stentry>Select Enclosing Element</stentry>

+<stentry>Alt+Shift+Up</stentry>

+</strow>

+<strow>

+<stentry>Select Next Element</stentry>

+<stentry>Alt+Shift+Right</stentry>

+</strow>

+<strow>

+<stentry>Select Previous Element</stentry>

+<stentry>Alt+Shift+Left</stentry>

+</strow>

+</simpletable></section>

+<section><title>Shortcuts available in the XML, XSD, WSDL, HTML, JSP, and

+CSS editors (excludes the DTD editor)</title><simpletable>

+<sthead>

+<stentry>Command</stentry>

+<stentry>Shortcut</stentry>

+</sthead>

+<strow>

+<stentry>Format</stentry>

+<stentry>Ctrl+Shift+F</stentry>

+</strow>

+<strow>

+<stentry>Format Active Elements</stentry>

+<stentry>Ctrl+I</stentry>

+</strow>

+</simpletable></section>

+<section><title>Shortcuts available in the XML, XSD, WSDL, HTML, and JSP editors

+(excludes the DTD and CSS editors)</title><simpletable>

+<sthead>

+<stentry>Command</stentry>

+<stentry>Shortcut</stentry>

+</sthead>

+<strow>

+<stentry>Add Block Comment</stentry>

+<stentry>Ctrl+Shift+/</stentry>

+</strow>

+<strow>

+<stentry>Go To Matching Tag</stentry>

+<stentry>Ctrl+Shift+></stentry>

+</strow>

+<strow>

+<stentry>Go To Next Sibling</stentry>

+<stentry>Ctrl+Shift+Down</stentry>

+</strow>

+<strow>

+<stentry>Occurrences in File</stentry>

+<stentry>Ctrl+Shift+A</stentry>

+</strow>

+<strow>

+<stentry>Open Selection</stentry>

+<stentry>F3</stentry>

+</strow>

+<strow>

+<stentry>Go To Previous Sibling</stentry>

+<stentry>Ctrl+Shift+Up</stentry>

+</strow>

+<strow>

+<stentry>Remove Block Comment</stentry>

+<stentry>Ctrl+Shift+\</stentry>

+</strow>

+<strow>

+<stentry>Toggle Comment</stentry>

+<stentry>Ctrl+Shift+C</stentry>

+</strow>

+</simpletable></section>

+<section><title>Shortcuts available in the design view of the XSD and WSDL

+editors</title><simpletable>

+<sthead>

+<stentry>Command</stentry>

+<stentry>Shortcut</stentry>

+</sthead>

+<strow>

+<stentry>Zoom In</stentry>

+<stentry>Ctrl+=</stentry>

+</strow>

+<strow>

+<stentry>Zoom Out</stentry>

+<stentry>Ctrl+-</stentry>

+</strow>

+</simpletable></section>

+<section><title>Shortcuts available in the design view of the WSDL editor</title><simpletable>

+<sthead>

+<stentry>Command</stentry>

+<stentry>Shortcut</stentry>

+</sthead>

+<strow>

+<stentry>Export Diagram as Image</stentry>

+<stentry>Ctrl+Shift+X</stentry>

+</strow>

+</simpletable></section>

+</refbody>

+</reference>

diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.html
new file mode 100644
index 0000000..9958698
--- /dev/null
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/rxmltoolskey.html
@@ -0,0 +1,220 @@
+<?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 lang="en-us" xml:lang="en-us">
+<head>
+<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
+<meta content="public" name="security" />
+<meta content="index,follow" name="Robots" />
+<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
+<meta content="reference" name="DC.Type" />
+<meta name="DC.Title" content="Source editor and XML tools keyboard shortcuts" />
+<meta name="abstract" content="The following keyboard shortcuts are available for the XML, XSD, WSDL, HTML, JSP, CSS and DTD editors." />
+<meta name="description" content="The following keyboard shortcuts are available for the XML, XSD, WSDL, HTML, JSP, CSS and DTD editors." />
+<meta content="accessibility, keyboard shortcuts, XML editor, keyboard shortcuts, source editor, XML editor, shortcuts, keyboard, XSD editor, WSDL editor, HTML editor, JSP editor, CSS editor, DTD editor" name="DC.subject" />
+<meta content="accessibility, keyboard shortcuts, XML editor, keyboard shortcuts, source editor, XML editor, shortcuts, keyboard, XSD editor, WSDL editor, HTML editor, JSP editor, CSS editor, DTD editor" name="keywords" />
+<meta content="XHTML" name="DC.Format" />
+<meta content="xmltoolskeyboardshortcuts" name="DC.Identifier" />
+<meta content="en-us" name="DC.Language" />
+<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
+<title>Source editor and XML tools keyboard shortcuts</title>
+</head>
+<body id="xmltoolskeyboardshortcuts"><a name="xmltoolskeyboardshortcuts"><!-- --></a>
+
+
+<h1 class="topictitle1">Source editor and XML tools keyboard shortcuts</h1>
+
+
+
+<div><p>The following keyboard shortcuts are available for the XML, XSD,
+WSDL, HTML, JSP, CSS and DTD editors.</p>
+
+<div class="section"><h4 class="sectiontitle">Shortcuts available in all source editors</h4><table summary="" cellspacing="0" cellpadding="4" border="1" class="simpletableborder">
+<tr>
+<th valign="bottom" align="left" id="N100D0">Command</th>
+
+<th valign="bottom" align="left" id="N100D6">Shortcut</th>
+
+</tr>
+
+<tr>
+<td valign="top" headers="N100D0">Go To Matching Bracket</td>
+
+<td valign="top" headers="N100D6">Ctrl+Shift+P</td>
+
+</tr>
+
+<tr>
+<td valign="top" headers="N100D0">Restore Last Selection</td>
+
+<td valign="top" headers="N100D6">Atl+Shift+Down</td>
+
+</tr>
+
+<tr>
+<td valign="top" headers="N100D0">Select Enclosing Element</td>
+
+<td valign="top" headers="N100D6">Alt+Shift+Up</td>
+
+</tr>
+
+<tr>
+<td valign="top" headers="N100D0">Select Next Element</td>
+
+<td valign="top" headers="N100D6">Alt+Shift+Right</td>
+
+</tr>
+
+<tr>
+<td valign="top" headers="N100D0">Select Previous Element</td>
+
+<td valign="top" headers="N100D6">Alt+Shift+Left</td>
+
+</tr>
+
+</table>
+</div>
+
+<div class="section"><h4 class="sectiontitle">Shortcuts available in the XML, XSD, WSDL, HTML, JSP, and
+CSS editors (excludes the DTD editor)</h4><table summary="" cellspacing="0" cellpadding="4" border="1" class="simpletableborder">
+<tr>
+<th valign="bottom" align="left" id="N1014B">Command</th>
+
+<th valign="bottom" align="left" id="N10151">Shortcut</th>
+
+</tr>
+
+<tr>
+<td valign="top" headers="N1014B">Format</td>
+
+<td valign="top" headers="N10151">Ctrl+Shift+F</td>
+
+</tr>
+
+<tr>
+<td valign="top" headers="N1014B">Format Active Elements</td>
+
+<td valign="top" headers="N10151">Ctrl+I</td>
+
+</tr>
+
+</table>
+</div>
+
+<div class="section"><h4 class="sectiontitle">Shortcuts available in the XML, XSD, WSDL, HTML, and JSP editors
+(excludes the DTD and CSS editors)</h4><table summary="" cellspacing="0" cellpadding="4" border="1" class="simpletableborder">
+<tr>
+<th valign="bottom" align="left" id="N10190">Command</th>
+
+<th valign="bottom" align="left" id="N10196">Shortcut</th>
+
+</tr>
+
+<tr>
+<td valign="top" headers="N10190">Add Block Comment</td>
+
+<td valign="top" headers="N10196">Ctrl+Shift+/</td>
+
+</tr>
+
+<tr>
+<td valign="top" headers="N10190">Go To Matching Tag</td>
+
+<td valign="top" headers="N10196">Ctrl+Shift+&gt;</td>
+
+</tr>
+
+<tr>
+<td valign="top" headers="N10190">Go To Next Sibling</td>
+
+<td valign="top" headers="N10196">Ctrl+Shift+Down</td>
+
+</tr>
+
+<tr>
+<td valign="top" headers="N10190">Occurrences in File</td>
+
+<td valign="top" headers="N10196">Ctrl+Shift+A</td>
+
+</tr>
+
+<tr>
+<td valign="top" headers="N10190">Open Selection</td>
+
+<td valign="top" headers="N10196">F3</td>
+
+</tr>
+
+<tr>
+<td valign="top" headers="N10190">Go To Previous Sibling</td>
+
+<td valign="top" headers="N10196">Ctrl+Shift+Up</td>
+
+</tr>
+
+<tr>
+<td valign="top" headers="N10190">Remove Block Comment</td>
+
+<td valign="top" headers="N10196">Ctrl+Shift+\</td>
+
+</tr>
+
+<tr>
+<td valign="top" headers="N10190">Toggle Comment</td>
+
+<td valign="top" headers="N10196">Ctrl+Shift+C</td>
+
+</tr>
+
+</table>
+</div>
+
+<div class="section"><h4 class="sectiontitle">Shortcuts available in the design view of the XSD and WSDL
+editors</h4><table summary="" cellspacing="0" cellpadding="4" border="1" class="simpletableborder">
+<tr>
+<th valign="bottom" align="left" id="N10241">Command</th>
+
+<th valign="bottom" align="left" id="N10247">Shortcut</th>
+
+</tr>
+
+<tr>
+<td valign="top" headers="N10241">Zoom In</td>
+
+<td valign="top" headers="N10247">Ctrl+=</td>
+
+</tr>
+
+<tr>
+<td valign="top" headers="N10241">Zoom Out</td>
+
+<td valign="top" headers="N10247">Ctrl+-</td>
+
+</tr>
+
+</table>
+</div>
+
+<div class="section"><h4 class="sectiontitle">Shortcuts available in the design view of the WSDL editor</h4><table summary="" cellspacing="0" cellpadding="4" border="1" class="simpletableborder">
+<tr>
+<th valign="bottom" align="left" id="N10286">Command</th>
+
+<th valign="bottom" align="left" id="N1028C">Shortcut</th>
+
+</tr>
+
+<tr>
+<td valign="top" headers="N10286">Export Diagram as Image</td>
+
+<td valign="top" headers="N1028C">Ctrl+Shift+X</td>
+
+</tr>
+
+</table>
+</div>
+
+</div>
+
+
+</body>
+</html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcretxml.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcretxml.html
index 72d3089..495d04f 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcretxml.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcretxml.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.dita
index 16864ce..e1efde5 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.dita
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.dita
@@ -13,8 +13,10 @@
 your DTD, and contains at least some of the elements and attributes in your

 DTD.</shortdesc>

 <prolog><metadata>

-<keywords><indexterm>XML files<indexterm>generating from DTDs</indexterm></indexterm>

-<indexterm>DTD<indexterm>generating XML files</indexterm></indexterm></keywords>

+<keywords><indexterm keyref="tcrexdtd|1|XMLfilesgeneratingfromDTDs" status="new">XML

+files<indexterm>generating from DTDs</indexterm></indexterm><indexterm keyref="tcrexdtd|2|DTDgeneratingXMLfiles"

+status="changed">DTDs<indexterm>generating XML files</indexterm></indexterm>

+</keywords>

 </metadata></prolog>

 <taskbody>

 <context><p>After you have generated your XML file, you can further customize

@@ -41,8 +43,8 @@
 optional elements will be generated.</choice>

 <choice><uicontrol>Create first choice of required choice</uicontrol>: the

 first option of a required choice will be generated in your XML file.</choice>

-<choice><uicontrol>Fill elements and attributes with data</uicontrol>:<?Pub Caret?>

-any elements and attributes generated will be filled with sample data.</choice>

+<choice><uicontrol>Fill elements and attributes with data</uicontrol>: any

+elements and attributes generated will be filled with sample data.</choice>

 </choices>

 <info> If you do not select any of these options, then only the minimum amount

 of content required for the XML file will be created.</info></step>

@@ -57,4 +59,3 @@
 the rules established in the DTD that you used to create the XML file.</p></result>

 </taskbody>

 </task>

-<?Pub *0000003391?>

diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html
index 29d6b7b..82fba1f 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexdtd.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Generating XML files from DTDs" />
 <meta name="abstract" content="You can generate an XML file from your DTD if you want to quickly create an XML file based on your DTD file. Generating an XML file from your DTD saves you time by creating an XML file that is already associated with your DTD, and contains at least some of the elements and attributes in your DTD." />
 <meta name="description" content="You can generate an XML file from your DTD if you want to quickly create an XML file based on your DTD file. Generating an XML file from your DTD saves you time by creating an XML file that is already associated with your DTD, and contains at least some of the elements and attributes in your DTD." />
-<meta content="XML files, generating from DTDs, DTD, generating XML files" name="DC.subject" />
-<meta content="XML files, generating from DTDs, DTD, generating XML files" name="keywords" />
+<meta content="XML files, generating from DTDs, DTDs, generating XML files" name="DC.subject" />
+<meta content="XML files, generating from DTDs, DTDs, generating XML files" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/tcretxml.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/tcrexxsd.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/txedttag.html" />
@@ -71,8 +71,8 @@
 <li><span class="uicontrol">Create first choice of required choice</span>: the
 first option of a required choice will be generated in your XML file.</li>
 
-<li><span class="uicontrol">Fill elements and attributes with data</span>:
-any elements and attributes generated will be filled with sample data.</li>
+<li><span class="uicontrol">Fill elements and attributes with data</span>: any
+elements and attributes generated will be filled with sample data.</li>
 
 </ul>
 
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.dita
index afb257c..6ba3873 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.dita
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.dita
@@ -2,7 +2,6 @@
 <!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

-<?Pub Inc?>

 <task id="tcrexxsd" xml:lang="en-us">

 <title>Generating XML files from XML schemas</title>

 <titlealts>

@@ -14,9 +13,13 @@
 associated with your XML schema, and contains at least some of the elements

 and attributes in your XML schema.</shortdesc>

 <prolog><metadata>

-<keywords><indexterm>XML files<indexterm>generating from XML schemas</indexterm></indexterm>

-<indexterm>XML schemas<indexterm>generating XML files</indexterm></indexterm>

-</keywords>

+<keywords><indexterm keyref="tcrexxsd|1|XMLfilesgeneratingfromXMLschemas"

+status="new">XML files<indexterm>generating from XML schemas</indexterm></indexterm>

+<indexterm keyref="tcrexxsd|2|XMLschemasgeneratingXMLfiles" status="changed">schemas<indexterm>generating

+XML files</indexterm></indexterm></keywords>

+</metadata><metadata>

+<keywords><indexterm keyref="tcrexxsd|11|XMLfilesschemas" status="new">XML

+files<indexterm>schemas</indexterm></indexterm></keywords>

 </metadata></prolog>

 <taskbody>

 <context><p>After you have generated your XML file, you can further customize

@@ -72,7 +75,7 @@
 from a complex XML schema file, the XML file might not be valid. If this occurs,

 you can open the generated file in the XML editor and correct any errors that

 occur. Usually, only a few errors need to be fixed. The following XML schema

-constructs might present problems:</note><ul><?Pub Caret?>

+constructs might present problems:</note><ul>

 <li>Restrictions: sometimes restricted elements are erroneously generated. </li>

 <li>Facets: default generated data values might not conform to complex facets

 (for example, patterns).</li>

@@ -80,4 +83,3 @@
 </ul></result>

 </taskbody>

 </task>

-<?Pub *0000004762?>

diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html
index 27134c5..9d165bc 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Generating XML files from XML schemas" />
 <meta name="abstract" content="You can generate an XML file from your XML schema if you want to quickly create an XML file based on your XML schema file. Generating an XML file from your XML schema saves you time by creating an XML file that is already associated with your XML schema, and contains at least some of the elements and attributes in your XML schema." />
 <meta name="description" content="You can generate an XML file from your XML schema if you want to quickly create an XML file based on your XML schema file. Generating an XML file from your XML schema saves you time by creating an XML file that is already associated with your XML schema, and contains at least some of the elements and attributes in your XML schema." />
-<meta content="XML files, generating from XML schemas, XML schemas, generating XML files" name="DC.subject" />
-<meta content="XML files, generating from XML schemas, XML schemas, generating XML files" name="keywords" />
+<meta content="XML files, generating from XML schemas, schemas, generating XML files, XML files" name="DC.subject" />
+<meta content="XML files, generating from XML schemas, schemas, generating XML files, XML files" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/tcretxml.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/tcrexdtd.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/txedttag.html" />
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtcnst.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtcnst.html
index 3574b49..1693ebc 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtcnst.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtcnst.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -105,7 +105,7 @@
 </div>
 <div class="reltasks"><strong>Related tasks</strong><br />
 <div><a href="../topics/tedtdoc.html" title="The DOCTYPE declaration in an XML file is used at the beginning of it to associate it with a DTD file. You can edit your DOCTYPE declaration to change the DTD file your XML file is associated with.">Editing DOCTYPE declarations</a></div>
-<div><a href="../topics/txmlcat.html" title="An XML Catalog entry contains two parts - a Key (which represents a DTD or XML schema) and a Location (similar to a URI, which contains information about a DTD or XML schema's location). You can place the Key in an XML file. When the XML processor encounters it, it will use the XML Catalog entry to find the location of the DTD or XML schema associated with the Key">Adding entries to the XML Catalog</a></div>
+<div><a href="../topics/txmlcat.html" title="XML Catalog entries are used to map external entity references to locally defined resources. You can provide rules specify how these entities are resolved">Adding entries to the XML Catalog</a></div>
 <div><a href="../topics/tedtgram.html" title="If you make changes to a DTD file or XML schema associated with an XML file (that is currently open), click XML &gt; Reload Dependencies to update the XML file with these changes. The changes will be reflected in the guided editing mechanisms available in the editor, such as content assist.">Updating XML files with changes made to DTDs and schemas</a></div>
 <div><a href="../topics/tedtsch.html" title="Your namespace information is used to provide various information about the XML file, such as the XML schema and namespace it is associated with. If desired, you can change the schema and namespace your XML file is associated with or add a new association. Modifying any associations can impact what content is allowed in the XML file.">Editing namespace information</a></div>
 </div>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.dita
index 9249ccf..aec0531 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.dita
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.dita
@@ -22,14 +22,14 @@
 <steps>

 <step><cmd>In the Design view of the XML editor, right-click <uicontrol>DOCTYPE</uicontrol> and

 click <uicontrol>Edit DOCTYPE</uicontrol>.</cmd></step>

-<step><cmd>The <?Pub Caret?>value in the <uicontrol>Root element name</uicontrol> field

+<step><cmd>The value in the <uicontrol>Root element name</uicontrol> field

 should match the root element of your XML file exactly.</cmd><info>You should

 only edit the value in this field if your root element changes.</info></step>

 <step><cmd>You can select a Public ID for any existing XML Catalog entries

 by clicking <uicontrol>Browse</uicontrol>. </cmd><info>The value in the <uicontrol>Public

 ID</uicontrol> field is the Public Identifier. It is used to associate the

 XML file (using an XML Catalog entry) with a DTD file. For more information,

-see <xref format="html" href="txmlcat.dita" scope="peer">Adding entries to

+see <xref format="dita" href="txmlcat.dita" scope="local">Adding entries to

 the XML Catalog</xref>.</info></step>

 <step><cmd>The value in the <uicontrol>System ID</uicontrol> field is the

 DTD the XML file is associated with. Type the path of the DTD file (or browse

@@ -44,4 +44,3 @@
 add one.</postreq>

 </taskbody>

 </task>

-<?Pub *0000002518?>

diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html
index ea28494..7949292 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtdoc.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -54,7 +54,7 @@
 by clicking <span class="uicontrol">Browse</span>. </span> The value in the <span class="uicontrol">Public
 ID</span> field is the Public Identifier. It is used to associate the
 XML file (using an XML Catalog entry) with a DTD file. For more information,
-see <a href="txmlcat.dita">Adding entries to the XML Catalog</a>.</li>
+see <a href="txmlcat.html">Adding entries to the XML Catalog</a>.</li>
 
 <li class="stepexpand"><span>The value in the <span class="uicontrol">System ID</span> field is the
 DTD the XML file is associated with. Type the path of the DTD file (or browse
@@ -79,9 +79,9 @@
 </div>
 <div class="reltasks"><strong>Related tasks</strong><br />
 <div><a href="../topics/tedtcnst.html" title="In the Design view, when you edit an XML file that has a set of constraints or rules defined by a DTD or an XML schema, you can turn the constraints on and off to provide flexibility in the way you edit, but still maintain the validity of the document periodically.">Editing with DTD or XML schema constraints</a></div>
-<div><a href="../topics/txmlcat.html" title="An XML Catalog entry contains two parts - a Key (which represents a DTD or XML schema) and a Location (similar to a URI, which contains information about a DTD or XML schema's location). You can place the Key in an XML file. When the XML processor encounters it, it will use the XML Catalog entry to find the location of the DTD or XML schema associated with the Key">Adding entries to the XML Catalog</a></div>
+<div><a href="../topics/txmlcat.html" title="XML Catalog entries are used to map external entity references to locally defined resources. You can provide rules specify how these entities are resolved">Adding entries to the XML Catalog</a></div>
 <div><a href="../topics/tedtgram.html" title="If you make changes to a DTD file or XML schema associated with an XML file (that is currently open), click XML &gt; Reload Dependencies to update the XML file with these changes. The changes will be reflected in the guided editing mechanisms available in the editor, such as content assist.">Updating XML files with changes made to DTDs and schemas</a></div>
-<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
+<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
 </div>
 </div>
 
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtenc.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtenc.html
index 39a6c98..3030782 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtenc.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtenc.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtgram.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtgram.html
index 686e23b..944a116 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtgram.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtgram.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -63,7 +63,7 @@
 <div class="reltasks"><strong>Related tasks</strong><br />
 <div><a href="../topics/tedtcnst.html" title="In the Design view, when you edit an XML file that has a set of constraints or rules defined by a DTD or an XML schema, you can turn the constraints on and off to provide flexibility in the way you edit, but still maintain the validity of the document periodically.">Editing with DTD or XML schema constraints</a></div>
 <div><a href="../topics/tedtdoc.html" title="The DOCTYPE declaration in an XML file is used at the beginning of it to associate it with a DTD file. You can edit your DOCTYPE declaration to change the DTD file your XML file is associated with.">Editing DOCTYPE declarations</a></div>
-<div><a href="../topics/txmlcat.html" title="An XML Catalog entry contains two parts - a Key (which represents a DTD or XML schema) and a Location (similar to a URI, which contains information about a DTD or XML schema's location). You can place the Key in an XML file. When the XML processor encounters it, it will use the XML Catalog entry to find the location of the DTD or XML schema associated with the Key">Adding entries to the XML Catalog</a></div>
+<div><a href="../topics/txmlcat.html" title="XML Catalog entries are used to map external entity references to locally defined resources. You can provide rules specify how these entities are resolved">Adding entries to the XML Catalog</a></div>
 <div><a href="../topics/tedtsch.html" title="Your namespace information is used to provide various information about the XML file, such as the XML schema and namespace it is associated with. If desired, you can change the schema and namespace your XML file is associated with or add a new association. Modifying any associations can impact what content is allowed in the XML file.">Editing namespace information</a></div>
 </div>
 </div>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtproc.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtproc.html
index e5de866..ce8da6f 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtproc.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtproc.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -55,7 +55,7 @@
 </div>
 
 <div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
+<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
 </div>
 </div>
 
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtsch.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtsch.dita
index 116db62..fbc70c9 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtsch.dita
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtsch.dita
@@ -1,7 +1,8 @@
-<?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2006, v.4002-->

+<?xml version="1.0" encoding="UTF-8"?>

+<!--Arbortext, Inc., 1988-2008, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

+<?Pub Sty _display FontColor="red"?>

 <task id="tedtsch" xml:lang="en-us">

 <title>Editing namespace information</title>

 <titlealts>

@@ -9,49 +10,52 @@
 </titlealts>

 <shortdesc>Your namespace information is used to provide various information

 about the XML file, such as the XML schema and namespace it is associated

-with. If desired, you can change the schema and namespace your XML file is

-associated with or add a new association. Modifying any associations can impact

-what content is allowed in the XML file.</shortdesc>

+with. If desired, you can change the schema and namespace your XML

+file is associated with or add a new association. Modifying any associations

+can impact what content is allowed in the XML file.</shortdesc>

 <prolog><metadata>

 <keywords><indexterm>XML editor<indexterm>namespace information</indexterm></indexterm>

 <indexterm>XML files<indexterm>namespace information</indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <taskbody>

-<context><p>The following instructions were written for the Resource perspective,

-but they will also work in many other perspectives.</p><p>To edit your schema

-information, complete the following steps:</p></context>

+<context><p>The following instructions were written for the Resource

+perspective, but they will also work in many other perspectives.</p><p>To

+edit your schema information, complete the following steps:</p></context>

 <steps>

-<step><cmd>In the Design view of the XML editor, right-click your root element

-and click <uicontrol>Edit Namespaces</uicontrol>.</cmd></step>

-<step><cmd>Your XML file can be associated with more than one namespace or

-schema.</cmd><info>Select the entry you want to edit and click <uicontrol>Edit</uicontrol>.</info>

+<step><cmd>In the Design view of the XML editor, right-click your

+root element and click <uicontrol>Edit Namespaces</uicontrol>.</cmd>

 </step>

-<step><cmd>The value in the <uicontrol>Namespace Name</uicontrol> field is

-a namespace the XML file is associated with.</cmd><info>Your XML file should

-be associated with the same namespace(s) its XML schema is associated with.

-For more information about namespaces, refer to the related reference. For

-more information, see <xref format="html" href="/../../org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.dita"

+<step><cmd>Your XML file can be associated with more than one namespace

+or schema.</cmd><info>Select the entry you want to edit and click <uicontrol>Edit</uicontrol>.</info>

+</step>

+<step><cmd>The value in the <uicontrol>Namespace Name</uicontrol> field

+is a namespace the XML file is associated with.</cmd><info>Your XML

+file should be associated with the same namespace(s) its XML schema

+is associated with. For more information about namespaces, refer to

+the related reference. For more information, see <xref

+href="../../org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.dita"

 scope="peer">XML namespaces</xref>.</info></step>

-<step><cmd>All qualified elements and attributes in the XML file associated

-with the namespace will be prefixed with the <uicontrol>Prefix</uicontrol> value.</cmd>

+<step><cmd>All qualified elements and attributes in the XM<?Pub Caret?>L

+file associated with the namespace will be prefixed with the <uicontrol>Prefix</uicontrol> value.</cmd>

 </step>

-<step><cmd>The <uicontrol>Location Hint</uicontrol> field contains the location

-of the XML schema the XML file is associated with.</cmd><info>An XML Catalog

-Key or a namespace name can be specified in this field. Click <uicontrol>Browse</uicontrol> to

-view all XML schemas in the workbench and XML Catalog.</info></step>

+<step><cmd>The <uicontrol>Location Hint</uicontrol> field contains

+the location of the XML schema the XML file is associated with.</cmd>

+<info>An XML Catalog Key or a namespace name can be specified in this

+field. Click <uicontrol>Browse</uicontrol> to view all XML schemas

+in the workbench and XML Catalog.</info></step>

 <step><cmd>Click <uicontrol>OK</uicontrol>, then click <uicontrol>OK</uicontrol> again.</cmd>

 </step>

 </steps>

 <result><p>If you want to create a new association, click <uicontrol>Add</uicontrol> instead

-of <uicontrol>Edit</uicontrol>. You can then either select the <uicontrol><?Pub Caret1?>Specify

-From Registered Namespace</uicontrol> radio button and select the namespace

-declarations you want to add or select the <uicontrol>Specify New Namespace</uicontrol> radio

-button and fill in the fields as necessary.</p></result>

-<postreq>If you do not have namespace information in your XML file, you can

-right-click your root element in the Design view and click <uicontrol>Edit

-Namespaces</uicontrol> to add it. If you do not have a root element, you must

-create one before you can add the namespace information.</postreq>

+of <uicontrol>Edit</uicontrol>. You can then either select the <uicontrol>Specify

+From Registered Namespace</uicontrol> radio button and select the

+namespace declarations you want to add or select the <uicontrol>Specify

+New Namespace</uicontrol> radio button and fill in the fields as necessary.</p></result>

+<postreq>If you do not have namespace information in your XML file,

+you can right-click your root element in the Design view and click <uicontrol>Edit

+Namespaces</uicontrol> to add it. If you do not have a root element,

+you must create one before you can add the namespace information.</postreq>

 </taskbody>

 </task>

-<?Pub *0000003265?>

+<?Pub *0000003288?>

diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtsch.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtsch.html
index 17e6a0d..ffd8743 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtsch.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tedtsch.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -35,38 +35,40 @@
 
 <div><p>Your namespace information is used to provide various information
 about the XML file, such as the XML schema and namespace it is associated
-with. If desired, you can change the schema and namespace your XML file is
-associated with or add a new association. Modifying any associations can impact
-what content is allowed in the XML file.</p>
+with. If desired, you can change the schema and namespace your XML
+file is associated with or add a new association. Modifying any associations
+can impact what content is allowed in the XML file.</p>
 
-<div class="section"><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p>
-<p>To edit your schema
-information, complete the following steps:</p>
+<div class="section"><p>The following instructions were written for the Resource
+perspective, but they will also work in many other perspectives.</p>
+<p>To
+edit your schema information, complete the following steps:</p>
 </div>
 
 <ol>
-<li class="stepexpand"><span>In the Design view of the XML editor, right-click your root element
-and click <span class="uicontrol">Edit Namespaces</span>.</span></li>
-
-<li class="stepexpand"><span>Your XML file can be associated with more than one namespace or
-schema.</span> Select the entry you want to edit and click <span class="uicontrol">Edit</span>.
+<li class="stepexpand"><span>In the Design view of the XML editor, right-click your
+root element and click <span class="uicontrol">Edit Namespaces</span>.</span>
 </li>
 
-<li class="stepexpand"><span>The value in the <span class="uicontrol">Namespace Name</span> field is
-a namespace the XML file is associated with.</span> Your XML file should
-be associated with the same namespace(s) its XML schema is associated with.
-For more information about namespaces, refer to the related reference. For
-more information, see <a href="/../../org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.dita">XML namespaces</a>.</li>
-
-<li class="stepexpand"><span>All qualified elements and attributes in the XML file associated
-with the namespace will be prefixed with the <span class="uicontrol">Prefix</span> value.</span>
+<li class="stepexpand"><span>Your XML file can be associated with more than one namespace
+or schema.</span> Select the entry you want to edit and click <span class="uicontrol">Edit</span>.
 </li>
 
-<li class="stepexpand"><span>The <span class="uicontrol">Location Hint</span> field contains the location
-of the XML schema the XML file is associated with.</span> An XML Catalog
-Key or a namespace name can be specified in this field. Click <span class="uicontrol">Browse</span> to
-view all XML schemas in the workbench and XML Catalog.</li>
+<li class="stepexpand"><span>The value in the <span class="uicontrol">Namespace Name</span> field
+is a namespace the XML file is associated with.</span> Your XML
+file should be associated with the same namespace(s) its XML schema
+is associated with. For more information about namespaces, refer to
+the related reference. For more information, see <a href="../../org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.html">XML namespaces</a>.</li>
+
+<li class="stepexpand"><span>All qualified elements and attributes in the XML
+file associated with the namespace will be prefixed with the <span class="uicontrol">Prefix</span> value.</span>
+</li>
+
+<li class="stepexpand"><span>The <span class="uicontrol">Location Hint</span> field contains
+the location of the XML schema the XML file is associated with.</span>
+ An XML Catalog Key or a namespace name can be specified in this
+field. Click <span class="uicontrol">Browse</span> to view all XML schemas
+in the workbench and XML Catalog.</li>
 
 <li class="stepexpand"><span>Click <span class="uicontrol">OK</span>, then click <span class="uicontrol">OK</span> again.</span>
 </li>
@@ -75,15 +77,15 @@
 
 <div class="section"><p>If you want to create a new association, click <span class="uicontrol">Add</span> instead
 of <span class="uicontrol">Edit</span>. You can then either select the <span class="uicontrol">Specify
-From Registered Namespace</span> radio button and select the namespace
-declarations you want to add or select the <span class="uicontrol">Specify New Namespace</span> radio
-button and fill in the fields as necessary.</p>
+From Registered Namespace</span> radio button and select the
+namespace declarations you want to add or select the <span class="uicontrol">Specify
+New Namespace</span> radio button and fill in the fields as necessary.</p>
 </div>
 
-<div class="section">If you do not have namespace information in your XML file, you can
-right-click your root element in the Design view and click <span class="uicontrol">Edit
-Namespaces</span> to add it. If you do not have a root element, you must
-create one before you can add the namespace information.</div>
+<div class="section">If you do not have namespace information in your XML file,
+you can right-click your root element in the Design view and click <span class="uicontrol">Edit
+Namespaces</span> to add it. If you do not have a root element,
+you must create one before you can add the namespace information.</div>
 
 </div>
 
@@ -92,9 +94,9 @@
 </div>
 <div class="reltasks"><strong>Related tasks</strong><br />
 <div><a href="../topics/tedtcnst.html" title="In the Design view, when you edit an XML file that has a set of constraints or rules defined by a DTD or an XML schema, you can turn the constraints on and off to provide flexibility in the way you edit, but still maintain the validity of the document periodically.">Editing with DTD or XML schema constraints</a></div>
-<div><a href="../topics/txmlcat.html" title="An XML Catalog entry contains two parts - a Key (which represents a DTD or XML schema) and a Location (similar to a URI, which contains information about a DTD or XML schema's location). You can place the Key in an XML file. When the XML processor encounters it, it will use the XML Catalog entry to find the location of the DTD or XML schema associated with the Key">Adding entries to the XML Catalog</a></div>
+<div><a href="../topics/txmlcat.html" title="XML Catalog entries are used to map external entity references to locally defined resources. You can provide rules specify how these entities are resolved">Adding entries to the XML Catalog</a></div>
 <div><a href="../topics/tedtgram.html" title="If you make changes to a DTD file or XML schema associated with an XML file (that is currently open), click XML &gt; Reload Dependencies to update the XML file with these changes. The changes will be reflected in the guided editing mechanisms available in the editor, such as content assist.">Updating XML files with changes made to DTDs and schemas</a></div>
-<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
+<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
 </div>
 <div class="relinfo"><strong>Related information</strong><br />
 <div><a href="../../org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.html">XML namespaces</a></div>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tsugstrat.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tsugstrat.html
index 70a8055..2b1624d 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/tsugstrat.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/tsugstrat.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/ttaghilt.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/ttaghilt.html
index a461cfb..3b96b1f 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/ttaghilt.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/ttaghilt.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twcdast.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/twcdast.dita
index 0e94754..f29a64a 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twcdast.dita
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/twcdast.dita
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2006, v.4002-->

+<?xml version="1.0" encoding="UTF-8"?>

+<!--Arbortext, Inc., 1988-2009, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <?Pub Inc?>

@@ -8,43 +8,50 @@
 <titlealts>

 <searchtitle>Using XML content assist</searchtitle>

 </titlealts>

-<shortdesc>You can use content assist to help you finish a tag or line of

-code in the Source view of the XML editor. You can also use content assist

-to insert templates into your XML code.</shortdesc>

+<shortdesc>You can use content assist to help you finish a tag or

+line of code in the Source view of the XML editor. You can also use

+content assist to insert templates into your XML code.</shortdesc>

 <prolog><metadata>

 <keywords><indexterm>XML editor<indexterm>content assist</indexterm></indexterm>

-<indexterm>XML files<indexterm>content assist</indexterm></indexterm></keywords>

+<indexterm>XML files<indexterm>content assist</indexterm></indexterm>

+</keywords>

 </metadata></prolog>

 <taskbody>

-<context><p>The placement of the cursor in your source file provides the context

-for the content assist to offer suggestions for completion.</p><p>You can

-launch content assist in either of the following ways:</p><ul>

-<li>From the <uicontrol>Edit</uicontrol> menu, click <uicontrol>Content Assist</uicontrol>,

-or</li>

+<context><p>The placement of the cursor in your source file provides

+the context for the content assist to offer suggestions for completion.</p><p>You

+can launch content assist in either of the following ways:</p><ul>

+<li>From the <uicontrol>Edit</uicontrol> menu, click <uicontrol>Content

+Assist</uicontrol>, or</li>

 <li>Press Ctrl+Space</li>

-</ul><p>In addition, you can set up an option that causes content assist to

-pop up automatically when certain characters are typed. To set up this option,

-click <menucascade><uicontrol>Window</uicontrol><uicontrol> Preferences</uicontrol>

-</menucascade> to open the Preferences window, then select <menucascade><uicontrol>XML</uicontrol>

-<uicontrol>XML Files </uicontrol><uicontrol>Editor</uicontrol></menucascade> .

-In the <uicontrol>Content assist</uicontrol> group box, select the <uicontrol>Automatically

-make suggestions</uicontrol> check box, and supply any additional characters

-that should trigger content assist.</p><p>If your cursor is in a position

-where content assist is available, a pop-up list of available choices is displayed

-when you launch content assist. The list is based on the context and whether

-a DTD or XML schema is associated with the XML file being edited. For example,

-if you have an Address element that can contain any of the following children

-elements: Name, Street, City, Zip Code, Country, and Province, and you place

-your cursor after any of them and launch content assist, all of the child

-elements will be listed in the content assist list.</p><p>The content assist

-list displays all valid tags for the current cursor position, including templates.

-If your grammar constraints are turned off, all available tags, not just valid

-ones, are displayed. </p><p>As you type the first one or two letters of the

-tag that you want, the list automatically refreshes with alphabetized choices

-that match your input. Scroll down and select the tag that you want to use

-by double-clicking on it.<?Pub Caret?></p><note>The list only refreshes as

-described if you first type <userinput>&lt;</userinput> before prompting for

+</ul><p>In addition, you can set up an option that causes content

+assist to pop up automatically when certain characters are typed.

+To set up this option, click <menucascade><uicontrol>Window</uicontrol>

+<uicontrol> Preferences</uicontrol></menucascade> to open the Preferences

+window, then select <menucascade><uicontrol>XML</uicontrol><uicontrol>XML

+Files </uicontrol><uicontrol>Editor</uicontrol><uicontrol>Content

+assist</uicontrol></menucascade> . Select the <uicontrol>Automatically

+make suggestions</uicontrol> check box, and supply any additional

+characters that should trigger content assist.</p><p>If your cursor

+is in a position where content assist is available, a pop-up list

+of available choices is displayed when you launch content assist.

+The list is based on the context and whether a DTD or XML schema is

+associated with the XML file being edited. For example, if you have

+an Address element that can contain any of the following children

+elements: Name, Street, City, Zip Code, Country, and Province, and

+you place your cursor after any of them and launch content assist,

+all of the child elements will be listed in the content assist list.</p><p>Content

+assist cycling is available in the XML editor, offering multiple pages

+of content assist. You can set preferences for the proposal categories

+and the cycle order when repeatedly invoking content assist </p><?Pub

+Caret 53?><p>The content assist list displays all valid tags for the

+current cursor position, including templates. If your grammar constraints

+are turned off, all available tags, not just valid ones, are displayed. </p><p>As

+you type the first one or two letters of the tag that you want, the

+list automatically refreshes with alphabetized choices that match

+your input. Scroll down and select the tag that you want to use by

+double-clicking on it.</p><note>The list only refreshes as described

+if you first type <userinput>&lt;</userinput> before prompting for

 content assist.</note></context>

 </taskbody>

 </task>

-<?Pub *0000002891?>

+<?Pub *0000003092?>

diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twcdast.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/twcdast.html
index 57be527..600d4f7 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twcdast.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/twcdast.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -30,47 +30,53 @@
 
 
 
-<div><p>You can use content assist to help you finish a tag or line of
-code in the Source view of the XML editor. You can also use content assist
-to insert templates into your XML code.</p>
+<div><p>You can use content assist to help you finish a tag or
+line of code in the Source view of the XML editor. You can also use
+content assist to insert templates into your XML code.</p>
 
-<div class="section"><p>The placement of the cursor in your source file provides the context
-for the content assist to offer suggestions for completion.</p>
-<p>You can
-launch content assist in either of the following ways:</p>
+<div class="section"><p>The placement of the cursor in your source file provides
+the context for the content assist to offer suggestions for completion.</p>
+<p>You
+can launch content assist in either of the following ways:</p>
 <ul>
-<li>From the <span class="uicontrol">Edit</span> menu, click <span class="uicontrol">Content Assist</span>,
-or</li>
+<li>From the <span class="uicontrol">Edit</span> menu, click <span class="uicontrol">Content
+Assist</span>, or</li>
 
 <li>Press Ctrl+Space</li>
 
 </ul>
-<p>In addition, you can set up an option that causes content assist to
-pop up automatically when certain characters are typed. To set up this option,
-click <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol"> Preferences</span>
-</span> to open the Preferences window, then select <span class="menucascade"><span class="uicontrol">XML</span>
- &gt; <span class="uicontrol">XML Files </span> &gt; <span class="uicontrol">Editor</span></span> .
-In the <span class="uicontrol">Content assist</span> group box, select the <span class="uicontrol">Automatically
-make suggestions</span> check box, and supply any additional characters
-that should trigger content assist.</p>
-<p>If your cursor is in a position
-where content assist is available, a pop-up list of available choices is displayed
-when you launch content assist. The list is based on the context and whether
-a DTD or XML schema is associated with the XML file being edited. For example,
-if you have an Address element that can contain any of the following children
-elements: Name, Street, City, Zip Code, Country, and Province, and you place
-your cursor after any of them and launch content assist, all of the child
-elements will be listed in the content assist list.</p>
-<p>The content assist
-list displays all valid tags for the current cursor position, including templates.
-If your grammar constraints are turned off, all available tags, not just valid
-ones, are displayed. </p>
-<p>As you type the first one or two letters of the
-tag that you want, the list automatically refreshes with alphabetized choices
-that match your input. Scroll down and select the tag that you want to use
-by double-clicking on it.</p>
-<div class="note"><span class="notetitle">Note:</span> The list only refreshes as
-described if you first type <kbd class="userinput">&lt;</kbd> before prompting for
+<p>In addition, you can set up an option that causes content
+assist to pop up automatically when certain characters are typed.
+To set up this option, click <span class="menucascade"><span class="uicontrol">Window</span>
+ &gt; <span class="uicontrol"> Preferences</span></span> to open the Preferences
+window, then select <span class="menucascade"><span class="uicontrol">XML</span> &gt; <span class="uicontrol">XML
+Files </span> &gt; <span class="uicontrol">Editor</span> &gt; <span class="uicontrol">Content
+assist</span></span> . Select the <span class="uicontrol">Automatically
+make suggestions</span> check box, and supply any additional
+characters that should trigger content assist.</p>
+<p>If your cursor
+is in a position where content assist is available, a pop-up list
+of available choices is displayed when you launch content assist.
+The list is based on the context and whether a DTD or XML schema is
+associated with the XML file being edited. For example, if you have
+an Address element that can contain any of the following children
+elements: Name, Street, City, Zip Code, Country, and Province, and
+you place your cursor after any of them and launch content assist,
+all of the child elements will be listed in the content assist list.</p>
+<p>Content
+assist cycling is available in the XML editor, offering multiple pages
+of content assist. You can set preferences for the proposal categories
+and the cycle order when repeatedly invoking content assist </p>
+<p>The content assist list displays all valid tags for the
+current cursor position, including templates. If your grammar constraints
+are turned off, all available tags, not just valid ones, are displayed. </p>
+<p>As
+you type the first one or two letters of the tag that you want, the
+list automatically refreshes with alphabetized choices that match
+your input. Scroll down and select the tag that you want to use by
+double-clicking on it.</p>
+<div class="note"><span class="notetitle">Note:</span> The list only refreshes as described
+if you first type <kbd class="userinput">&lt;</kbd> before prompting for
 content assist.</div>
 </div>
 
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twmacro.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/twmacro.dita
index dd1cebc..7a1b4c5 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twmacro.dita
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/twmacro.dita
@@ -2,7 +2,6 @@
 <!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

-<?Pub Inc?>

 <task id="twmacro" xml:lang="en-us">

 <title>Working with XML templates</title>

 <titlealts>

@@ -13,8 +12,12 @@
 you have a certain piece of code you want to reuse several times, and you

 do not want to write it out every time.</shortdesc>

 <prolog><metadata>

-<keywords><indexterm>XML templates<indexterm>working with predefined code</indexterm></indexterm>

+<keywords><indexterm keyref="twmacro|1|XMLtemplatesworkingwithpredefinedcode"

+status="changed">templates<indexterm>working with predefined XML code</indexterm></indexterm>

 </keywords>

+</metadata><metadata>

+<keywords><indexterm keyref="twmacro|10|XMLfilestemplates" status="new">XML

+files<indexterm>templates</indexterm></indexterm></keywords>

 </metadata></prolog>

 <taskbody>

 <context><p>You can use a default template as provided, customize that template,

@@ -43,7 +46,7 @@
 <step><cmd>If you want to insert a variable, click the <uicontrol>Insert Variable</uicontrol> button

 and select the variable to be inserted. </cmd><info>For example, the <b>date</b> variable

 indicates the current date will be inserted. </info></step>

-<step><cmd>Click <uicontrol>OK</uicontrol> and then <uicontrol>Apply<?Pub Caret?></uicontrol> to

+<step><cmd>Click <uicontrol>OK</uicontrol> and then <uicontrol>Apply</uicontrol> to

 save your changes.</cmd></step>

 </steps>

 <postreq>You can edit, remove, import, or export a template by using the same

@@ -55,4 +58,3 @@
 page.</p></postreq>

 </taskbody>

 </task>

-<?Pub *0000003238?>

diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twmacro.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/twmacro.html
index cd16ee4..73c14fa 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twmacro.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/twmacro.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Working with XML templates" />
 <meta name="abstract" content="XML content assist provides a comment template, a section of predefined code that you can insert into a file. You may find a template useful when you have a certain piece of code you want to reuse several times, and you do not want to write it out every time." />
 <meta name="description" content="XML content assist provides a comment template, a section of predefined code that you can insert into a file. You may find a template useful when you have a certain piece of code you want to reuse several times, and you do not want to write it out every time." />
-<meta content="XML templates, working with predefined code" name="DC.subject" />
-<meta content="XML templates, working with predefined code" name="keywords" />
+<meta content="templates, working with predefined XML code, XML files" name="DC.subject" />
+<meta content="templates, working with predefined XML code, XML files" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/txedtsrc.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/twcdast.html" />
 <meta content="XHTML" name="DC.Format" />
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twxvalid.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/twxvalid.html
index ce22a1e..c5d3f37 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/twxvalid.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/twxvalid.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.dita
index c179f07..1de5f51 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.dita
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.dita
@@ -1,49 +1,53 @@
-<?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2006, v.4002-->

+<?xml version="1.0" encoding="UTF-8"?>

+<!--Arbortext, Inc., 1988-2009, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

-<?Pub Inc?>

+<?Pub Sty _display FontColor="red"?>

 <task id="txedtdes" xml:lang="en-us">

 <title>Editing in the Design view</title>

 <titlealts>

 <searchtitle>Editing in the Design view</searchtitle>

 </titlealts>

-<shortdesc>The XML editor has a Design view, which represents the XML file

-simultaneously as a table and a tree. This helps make navigation and editing

-easier. Content and attribute values can be edited directly in the table cells,

-while pop-up menus on the tree elements give alternatives that are valid for

-that particular element.</shortdesc>

+<shortdesc>The XML editor has a Design view, which represents the

+XML file simultaneously as a table with Node and Content columns and

+a tree. This helps make navigation and editing easier. Content and

+attribute values can be edited directly in the table cells, while

+pop-up menus on the tree elements give alternatives that are valid

+for that particular element.</shortdesc>

 <prolog><metadata>

 <keywords><indexterm>XML editor<indexterm>Design view</indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <taskbody>

-<context><p>For example, the <uicontrol>Add child</uicontrol> menu item will

-list only those elements from a DTD or XML schema which would be valid children

-at that point.</p><p>When you have an XML file associated with an XML schema

-or DTD file, certain tags and rules for that file have already been established,

-which is why the Design view can provide prompts (via a pop-up menu) for those

-tags. When you create an XML file that is not associated with an XML schema

-or DTD file, it has no tags or rules associated with it, so the Design view

-cannot provide prompts for specific tags, but it can provide prompts to create

-new elements and attributes.</p><p>For any XML file associated with an XML

-schema or DTD file, you can use the Design view to add any items defined in

-the XML schema or DTD (such as elements and attributes) to the XML file. You

-can also use it to add processing instructions and comments to all XML files.</p><p>To

-open and edit a XML file in the XML editor, right-click the file in the Navigator

-view and click <uicontrol>Open With > XML Editor</uicontrol>. If necessary,

-click the <uicontrol>Design</uicontrol> tab to open the Design view.</p><p>To

-expand all the items in your XML file, click <menucascade><uicontrol>XML</uicontrol>

-<uicontrol>Expand All</uicontrol></menucascade> <image href="../images/expand_all.gif">

-<alt>This graphic is the Expand All toolbar button</alt></image> on the toolbar.

-To collapse them, click the <menucascade><uicontrol>XML</uicontrol><uicontrol>Collapse

-A<?Pub Caret?>ll</uicontrol></menucascade> <image href="../images/collapse_all.gif">

-<alt>This graphic is the Collapse All toolbar button</alt></image> on the

-toolbar.</p><p>If you right-click the item that you want to work with, some

-or all of the following options (as applicable) will be available from the

-pop-up menu that appears:</p><p></p><table>

-<tgroup cols="2"><colspec colname="col1" colwidth="48*"/><colspec colname="col2"

-colwidth="150*"/>

+<context><p>For example, the <uicontrol>Add child</uicontrol> menu

+item will list only those elements from a DTD or XML schema which

+would be valid children at that point.</p><p>When you have an XML

+file associated with an XML schema or DTD file, certain tags and rules

+for that file have already been established, which is why the Design

+view can provide prompts (via a pop-up menu) for those tags. When

+you create an XML file that is not associated with an XML schema or

+DTD file, it has no tags or rules associated with it, so the Design

+view cannot provide prompts for specific tags, but it can provide

+prompts to create new elements and attributes.</p><p>For any XML file

+associated with an XML schema or DTD file, you can use the Design

+view to add any items defined in the XML schema or DTD (such as elements

+and attributes) to the XML file. You can also use it to add processing

+instructions and comments to all XML files.</p><p>To open and edit

+a XML file in the XML editor, right-click the file in the Project

+Explorer view and click <uicontrol>Open With > XML Editor</uicontrol>.

+If necessary, click the <uicontrol>Design</uicontrol> tab to open

+the Design view.</p><?Pub Caret 92?><p>To expand all the items in

+your XML file, click the <uicontrol>Expand All</uicontrol> button<image

+href="../images/expand_all.gif"><alt>This graphic is the Expand All

+button</alt></image> on the top right corner of the editor. To collapse

+them, click the <uicontrol>Collapse All</uicontrol> button<image

+href="../images/collapse_all.gif"><alt>This graphic is the Collapse

+All button</alt></image> on the top right corner of the editor.</p><p>If

+you right-click the item that you want to work with, some or all of

+the following options (as applicable) will be available from the pop-up

+menu that appears:</p><table>

+<tgroup cols="2"><colspec colname="col1" colwidth="48*"/><colspec

+colname="col2" colwidth="150*"/>

 <thead>

 <row valign="bottom">

 <entry colname="col1">Select this</entry>

@@ -57,76 +61,80 @@
 </row>

 <row>

 <entry colname="col1">Edit DOCTYPE</entry>

-<entry colname="col2">Edit the DOCTYPE declaration. Refer to the related task

-for more details. For more information, see <xref format="html" href="tedtdoc.dita"

-scope="peer">Editing DOCTYPE declarations</xref>.</entry>

+<entry colname="col2">Edit the DOCTYPE declaration. Refer to the related

+task for more details. For more information, see <xref format="dita"

+href="tedtdoc.dita" scope="local">Editing DOCTYPE declarations</xref>.</entry>

 </row>

 <row>

 <entry colname="col1">Edit Namespaces</entry>

-<entry colname="col2">Edit the existing namespace information or create a

-new association with a namespace. Refer to the related task for more details.

-For more information, see <xref format="html" href="tedtsch.dita" scope="peer">Editing

-namespace information</xref>.</entry>

+<entry colname="col2">Edit the existing namespace information or create

+a new association with a namespace. Refer to the related task for

+more details. For more information, see <xref format="dita"

+href="tedtsch.dita" scope="local">Editing namespace information</xref>.</entry>

 </row>

 <row>

 <entry colname="col1">Edit Processing Instruction</entry>

-<entry colname="col2">Edit the processing instruction. Refer to the related

-task for more details. For more information, see <xref format="html" href="tedtproc.dita"

-scope="peer">Editing XML processing instructions</xref>.</entry>

+<entry colname="col2">Edit the processing instruction. Refer to the

+related task for more details. For more information, see <xref

+format="dita" href="tedtproc.dita" scope="local">Editing XML processing

+instructions</xref>.</entry>

 </row>

 <row>

 <entry colname="col1">Remove</entry>

-<entry colname="col2">Remove the item that you have selected from the XML

-file. If the selected item or related items are defined so that the item must

-exist in the file, this option will not be available. For example, in your

-DTD, if you have declared that "One or more" of the item must always exist

-in your XML file, and the item you have selected is the only one that exists

-in your XML file.</entry>

+<entry colname="col2">Remove the item that you have selected from

+the XML file. If the selected item or related items are defined so

+that the item must exist in the file, this option will not be available.

+For example, in your DTD, if you have declared that "One or more"

+of the item must always exist in your XML file, and the item you have

+selected is the only one that exists in your XML file.</entry>

 </row>

 <row>

 <entry colname="col1">Add Attribute</entry>

-<entry colname="col2">Add an attribute to the element that you selected. Any

-attributes you are allowed to add to the element will be listed. After you

-have added the attribute to the XML file, you can click in the right-hand

-column to change the value of the attribute. If the attribute has set values,

-they will appear in a list.</entry>

+<entry colname="col2">Add an attribute to the element that you selected.

+Any attributes you are allowed to add to the element will be listed.

+After you have added the attribute to the XML file, you can click

+in the right-hand column to change the value of the attribute. If

+the attribute has set values, they will appear in a list.</entry>

 </row>

 <row>

 <entry colname="col1">Add Child</entry>

-<entry colname="col2">Add another element, a comment, or a processing instruction

-as a child of the parent element.</entry>

+<entry colname="col2">Add another element, a comment, or a processing

+instruction as a child of the parent element.</entry>

 </row>

 <row>

 <entry colname="col1">Add Before</entry>

-<entry colname="col2">Add a child element, comment, or processing instruction

-that can go before the item you have selected. For example, if you have a

-parent element called <userinput>CD Collections</userinput> that can contain

-an unlimited amount of children called <userinput>CD</userinput>, you could

-click a <userinput>CD</userinput> element and click <menucascade><uicontrol>Add

-Before</uicontrol><uicontrol> CD</uicontrol></menucascade> , as a <userinput>CD</userinput> element

-can go before another <userinput>CD</userinput> element.</entry>

+<entry colname="col2">Add a child element, comment, or processing

+instruction that can go before the item you have selected. For example,

+if you have a parent element called <userinput>CD Collections</userinput> that

+can contain an unlimited amount of children called <userinput>CD</userinput>,

+you could click a <userinput>CD</userinput> element and click <menucascade>

+<uicontrol>Add Before</uicontrol><uicontrol> CD</uicontrol>

+</menucascade> , as a <userinput>CD</userinput> element can go before

+another <userinput>CD</userinput> element.</entry>

 </row>

 <row>

 <entry colname="col1">Add After</entry>

-<entry colname="col2">Add a child element, comment, or processing instruction

-that can go after the item you have selected. For example, if you have a parent

-element called <userinput>CD Collections</userinput> that can contain an unlimited

-amount of children called <userinput>CD</userinput>, you could click a <userinput>CD</userinput> element

-and click  <menucascade><uicontrol>Add After</uicontrol><uicontrol> CD</uicontrol>

-</menucascade>, as a <userinput>CD</userinput> element can go after another <userinput>CD</userinput> element.</entry>

+<entry colname="col2">Add a child element, comment, or processing

+instruction that can go after the item you have selected. For example,

+if you have a parent element called <userinput>CD Collections</userinput> that

+can contain an unlimited amount of children called <userinput>CD</userinput>,

+you could click a <userinput>CD</userinput> element and click  <menucascade>

+<uicontrol>Add After</uicontrol><uicontrol> CD</uicontrol></menucascade>,

+as a <userinput>CD</userinput> element can go after another <userinput>CD</userinput> element.</entry>

 </row>

 <row>

 <entry colname="col1">Replace With</entry>

-<entry colname="col2">Replace one item with another. This option is not available

-if you turn grammar constraints off or if there are no valid alternatives

-for you to replace the item with.</entry>

+<entry colname="col2">Replace one item with another. This option is

+not available if you turn grammar constraints off or if there are

+no valid alternatives for you to replace the item with.</entry>

 </row>

 </tbody>

 </tgroup>

 </table></context>

-<result><p>Any changes you make in the Design view are also reflected in the

-Source view and the Outline view.</p><note>These instructions were written

-for the Resource perspective, but they will also work in many other perspectives.</note></result>

+<result><p>Any changes you make in the Design view are also reflected

+in the Source view and the Outline view.</p><note>These instructions

+were written for the Resource perspective, but they will also work

+in many other perspectives.</note></result>

 </taskbody>

 </task>

 <?Pub *0000006781?>

diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html
index 91c1d1e..76370eb 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtdes.html
@@ -2,15 +2,15 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="task" name="DC.Type" />
 <meta name="DC.Title" content="Editing in the Design view" />
-<meta name="abstract" content="The XML editor has a Design view, which represents the XML file simultaneously as a table and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element." />
-<meta name="description" content="The XML editor has a Design view, which represents the XML file simultaneously as a table and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element." />
+<meta name="abstract" content="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element." />
+<meta name="description" content="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element." />
 <meta content="XML editor, Design view" name="DC.subject" />
 <meta content="XML editor, Design view" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/cwxmledt.html" />
@@ -34,47 +34,48 @@
 
 
 
-<div><p>The XML editor has a Design view, which represents the XML file
-simultaneously as a table and a tree. This helps make navigation and editing
-easier. Content and attribute values can be edited directly in the table cells,
-while pop-up menus on the tree elements give alternatives that are valid for
-that particular element.</p>
+<div><p>The XML editor has a Design view, which represents the
+XML file simultaneously as a table with Node and Content columns and
+a tree. This helps make navigation and editing easier. Content and
+attribute values can be edited directly in the table cells, while
+pop-up menus on the tree elements give alternatives that are valid
+for that particular element.</p>
 
-<div class="section"><p>For example, the <span class="uicontrol">Add child</span> menu item will
-list only those elements from a DTD or XML schema which would be valid children
-at that point.</p>
-<p>When you have an XML file associated with an XML schema
-or DTD file, certain tags and rules for that file have already been established,
-which is why the Design view can provide prompts (via a pop-up menu) for those
-tags. When you create an XML file that is not associated with an XML schema
-or DTD file, it has no tags or rules associated with it, so the Design view
-cannot provide prompts for specific tags, but it can provide prompts to create
-new elements and attributes.</p>
-<p>For any XML file associated with an XML
-schema or DTD file, you can use the Design view to add any items defined in
-the XML schema or DTD (such as elements and attributes) to the XML file. You
-can also use it to add processing instructions and comments to all XML files.</p>
-<p>To
-open and edit a XML file in the XML editor, right-click the file in the Navigator
-view and click <span class="uicontrol">Open With &gt; XML Editor</span>. If necessary,
-click the <span class="uicontrol">Design</span> tab to open the Design view.</p>
-<p>To
-expand all the items in your XML file, click <span class="menucascade"><span class="uicontrol">XML</span>
- &gt; <span class="uicontrol">Expand All</span></span> <img src="../images/expand_all.gif" alt="This graphic is the Expand All toolbar button" /> on the toolbar.
-To collapse them, click the <span class="menucascade"><span class="uicontrol">XML</span> &gt; <span class="uicontrol">Collapse
-All</span></span> <img src="../images/collapse_all.gif" alt="This graphic is the Collapse All toolbar button" /> on the
-toolbar.</p>
-<p>If you right-click the item that you want to work with, some
-or all of the following options (as applicable) will be available from the
-pop-up menu that appears:</p>
-<p />
+<div class="section"><p>For example, the <span class="uicontrol">Add child</span> menu
+item will list only those elements from a DTD or XML schema which
+would be valid children at that point.</p>
+<p>When you have an XML
+file associated with an XML schema or DTD file, certain tags and rules
+for that file have already been established, which is why the Design
+view can provide prompts (via a pop-up menu) for those tags. When
+you create an XML file that is not associated with an XML schema or
+DTD file, it has no tags or rules associated with it, so the Design
+view cannot provide prompts for specific tags, but it can provide
+prompts to create new elements and attributes.</p>
+<p>For any XML file
+associated with an XML schema or DTD file, you can use the Design
+view to add any items defined in the XML schema or DTD (such as elements
+and attributes) to the XML file. You can also use it to add processing
+instructions and comments to all XML files.</p>
+<p>To open and edit
+a XML file in the XML editor, right-click the file in the Project
+Explorer view and click <span class="uicontrol">Open With &gt; XML Editor</span>.
+If necessary, click the <span class="uicontrol">Design</span> tab to open
+the Design view.</p>
+<p>To expand all the items in
+your XML file, click the <span class="uicontrol">Expand All</span> button<img src="../images/expand_all.gif" alt="This graphic is the Expand All&#10;button" /> on the top right corner of the editor. To collapse
+them, click the <span class="uicontrol">Collapse All</span> button<img src="../images/collapse_all.gif" alt="This graphic is the Collapse&#10;All button" /> on the top right corner of the editor.</p>
+<p>If
+you right-click the item that you want to work with, some or all of
+the following options (as applicable) will be available from the pop-up
+menu that appears:</p>
 
 <div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="border" border="1" rules="all">
 <thead align="left">
 <tr valign="bottom">
-<th valign="bottom" width="24.242424242424242%" id="N100D8">Select this</th>
+<th valign="bottom" width="24.242424242424242%" id="N100BF">Select this</th>
 
-<th valign="bottom" width="75.75757575757575%" id="N100DF">If you want to do this</th>
+<th valign="bottom" width="75.75757575757575%" id="N100C6">If you want to do this</th>
 
 </tr>
 
@@ -82,99 +83,101 @@
 
 <tbody>
 <tr>
-<td valign="top" width="24.242424242424242%" headers="N100D8 ">Add DTD Information</td>
+<td valign="top" width="24.242424242424242%" headers="N100BF ">Add DTD Information</td>
 
-<td valign="top" width="75.75757575757575%" headers="N100DF ">Associate the XML file with a DTD.</td>
+<td valign="top" width="75.75757575757575%" headers="N100C6 ">Associate the XML file with a DTD.</td>
 
 </tr>
 
 <tr>
-<td valign="top" width="24.242424242424242%" headers="N100D8 ">Edit DOCTYPE</td>
+<td valign="top" width="24.242424242424242%" headers="N100BF ">Edit DOCTYPE</td>
 
-<td valign="top" width="75.75757575757575%" headers="N100DF ">Edit the DOCTYPE declaration. Refer to the related task
-for more details. For more information, see <a href="tedtdoc.dita">Editing DOCTYPE declarations</a>.</td>
+<td valign="top" width="75.75757575757575%" headers="N100C6 ">Edit the DOCTYPE declaration. Refer to the related
+task for more details. For more information, see <a href="tedtdoc.html">Editing DOCTYPE declarations</a>.</td>
 
 </tr>
 
 <tr>
-<td valign="top" width="24.242424242424242%" headers="N100D8 ">Edit Namespaces</td>
+<td valign="top" width="24.242424242424242%" headers="N100BF ">Edit Namespaces</td>
 
-<td valign="top" width="75.75757575757575%" headers="N100DF ">Edit the existing namespace information or create a
-new association with a namespace. Refer to the related task for more details.
-For more information, see <a href="tedtsch.dita">Editing namespace information</a>.</td>
+<td valign="top" width="75.75757575757575%" headers="N100C6 ">Edit the existing namespace information or create
+a new association with a namespace. Refer to the related task for
+more details. For more information, see <a href="tedtsch.html">Editing namespace information</a>.</td>
 
 </tr>
 
 <tr>
-<td valign="top" width="24.242424242424242%" headers="N100D8 ">Edit Processing Instruction</td>
+<td valign="top" width="24.242424242424242%" headers="N100BF ">Edit Processing Instruction</td>
 
-<td valign="top" width="75.75757575757575%" headers="N100DF ">Edit the processing instruction. Refer to the related
-task for more details. For more information, see <a href="tedtproc.dita">Editing XML processing instructions</a>.</td>
+<td valign="top" width="75.75757575757575%" headers="N100C6 ">Edit the processing instruction. Refer to the
+related task for more details. For more information, see <a href="tedtproc.html">Editing XML processing instructions</a>.</td>
 
 </tr>
 
 <tr>
-<td valign="top" width="24.242424242424242%" headers="N100D8 ">Remove</td>
+<td valign="top" width="24.242424242424242%" headers="N100BF ">Remove</td>
 
-<td valign="top" width="75.75757575757575%" headers="N100DF ">Remove the item that you have selected from the XML
-file. If the selected item or related items are defined so that the item must
-exist in the file, this option will not be available. For example, in your
-DTD, if you have declared that "One or more" of the item must always exist
-in your XML file, and the item you have selected is the only one that exists
-in your XML file.</td>
+<td valign="top" width="75.75757575757575%" headers="N100C6 ">Remove the item that you have selected from
+the XML file. If the selected item or related items are defined so
+that the item must exist in the file, this option will not be available.
+For example, in your DTD, if you have declared that "One or more"
+of the item must always exist in your XML file, and the item you have
+selected is the only one that exists in your XML file.</td>
 
 </tr>
 
 <tr>
-<td valign="top" width="24.242424242424242%" headers="N100D8 ">Add Attribute</td>
+<td valign="top" width="24.242424242424242%" headers="N100BF ">Add Attribute</td>
 
-<td valign="top" width="75.75757575757575%" headers="N100DF ">Add an attribute to the element that you selected. Any
-attributes you are allowed to add to the element will be listed. After you
-have added the attribute to the XML file, you can click in the right-hand
-column to change the value of the attribute. If the attribute has set values,
-they will appear in a list.</td>
+<td valign="top" width="75.75757575757575%" headers="N100C6 ">Add an attribute to the element that you selected.
+Any attributes you are allowed to add to the element will be listed.
+After you have added the attribute to the XML file, you can click
+in the right-hand column to change the value of the attribute. If
+the attribute has set values, they will appear in a list.</td>
 
 </tr>
 
 <tr>
-<td valign="top" width="24.242424242424242%" headers="N100D8 ">Add Child</td>
+<td valign="top" width="24.242424242424242%" headers="N100BF ">Add Child</td>
 
-<td valign="top" width="75.75757575757575%" headers="N100DF ">Add another element, a comment, or a processing instruction
-as a child of the parent element.</td>
+<td valign="top" width="75.75757575757575%" headers="N100C6 ">Add another element, a comment, or a processing
+instruction as a child of the parent element.</td>
 
 </tr>
 
 <tr>
-<td valign="top" width="24.242424242424242%" headers="N100D8 ">Add Before</td>
+<td valign="top" width="24.242424242424242%" headers="N100BF ">Add Before</td>
 
-<td valign="top" width="75.75757575757575%" headers="N100DF ">Add a child element, comment, or processing instruction
-that can go before the item you have selected. For example, if you have a
-parent element called <kbd class="userinput">CD Collections</kbd> that can contain
-an unlimited amount of children called <kbd class="userinput">CD</kbd>, you could
-click a <kbd class="userinput">CD</kbd> element and click <span class="menucascade"><span class="uicontrol">Add
-Before</span> &gt; <span class="uicontrol"> CD</span></span> , as a <kbd class="userinput">CD</kbd> element
-can go before another <kbd class="userinput">CD</kbd> element.</td>
+<td valign="top" width="75.75757575757575%" headers="N100C6 ">Add a child element, comment, or processing
+instruction that can go before the item you have selected. For example,
+if you have a parent element called <kbd class="userinput">CD Collections</kbd> that
+can contain an unlimited amount of children called <kbd class="userinput">CD</kbd>,
+you could click a <kbd class="userinput">CD</kbd> element and click <span class="menucascade">
+<span class="uicontrol">Add Before</span> &gt; <span class="uicontrol"> CD</span>
+</span> , as a <kbd class="userinput">CD</kbd> element can go before
+another <kbd class="userinput">CD</kbd> element.</td>
 
 </tr>
 
 <tr>
-<td valign="top" width="24.242424242424242%" headers="N100D8 ">Add After</td>
+<td valign="top" width="24.242424242424242%" headers="N100BF ">Add After</td>
 
-<td valign="top" width="75.75757575757575%" headers="N100DF ">Add a child element, comment, or processing instruction
-that can go after the item you have selected. For example, if you have a parent
-element called <kbd class="userinput">CD Collections</kbd> that can contain an unlimited
-amount of children called <kbd class="userinput">CD</kbd>, you could click a <kbd class="userinput">CD</kbd> element
-and click  <span class="menucascade"><span class="uicontrol">Add After</span> &gt; <span class="uicontrol"> CD</span>
-</span>, as a <kbd class="userinput">CD</kbd> element can go after another <kbd class="userinput">CD</kbd> element.</td>
+<td valign="top" width="75.75757575757575%" headers="N100C6 ">Add a child element, comment, or processing
+instruction that can go after the item you have selected. For example,
+if you have a parent element called <kbd class="userinput">CD Collections</kbd> that
+can contain an unlimited amount of children called <kbd class="userinput">CD</kbd>,
+you could click a <kbd class="userinput">CD</kbd> element and click  <span class="menucascade">
+<span class="uicontrol">Add After</span> &gt; <span class="uicontrol"> CD</span></span>,
+as a <kbd class="userinput">CD</kbd> element can go after another <kbd class="userinput">CD</kbd> element.</td>
 
 </tr>
 
 <tr>
-<td valign="top" width="24.242424242424242%" headers="N100D8 ">Replace With</td>
+<td valign="top" width="24.242424242424242%" headers="N100BF ">Replace With</td>
 
-<td valign="top" width="75.75757575757575%" headers="N100DF ">Replace one item with another. This option is not available
-if you turn grammar constraints off or if there are no valid alternatives
-for you to replace the item with.</td>
+<td valign="top" width="75.75757575757575%" headers="N100C6 ">Replace one item with another. This option is
+not available if you turn grammar constraints off or if there are
+no valid alternatives for you to replace the item with.</td>
 
 </tr>
 
@@ -184,10 +187,11 @@
 </div>
 </div>
 
-<div class="section"><p>Any changes you make in the Design view are also reflected in the
-Source view and the Outline view.</p>
-<div class="note"><span class="notetitle">Note:</span> These instructions were written
-for the Resource perspective, but they will also work in many other perspectives.</div>
+<div class="section"><p>Any changes you make in the Design view are also reflected
+in the Source view and the Outline view.</p>
+<div class="note"><span class="notetitle">Note:</span> These instructions
+were written for the Resource perspective, but they will also work
+in many other perspectives.</div>
 </div>
 
 </div>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtsrc.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtsrc.html
index 1095260..a0839e0 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtsrc.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedtsrc.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -120,7 +120,7 @@
 <div><a href="../topics/cxmlcat.html" title="When an XML file is associated with a DTD or XML schema, it is bound by any structural rules contained in the DTD or XML schema. To be considered a valid XML file, a document must be accompanied by a DTD or an XML schema, and conform to all of the declarations in the DTD or the XML schema.">XML file associations with DTDs and XML schemas</a></div>
 </div>
 <div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
+<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
 <div><a href="../topics/twcdast.html" title="You can use content assist to help you finish a tag or line of code in the Source view of the XML editor. You can also use content assist to insert templates into your XML code.">Using XML content assist</a></div>
 <div><a href="../topics/twmacro.html" title="XML content assist provides a comment template, a section of predefined code that you can insert into a file. You may find a template useful when you have a certain piece of code you want to reuse several times, and you do not want to write it out every time.">Working with XML templates</a></div>
 <div><a href="../topics/ttaghilt.html" title="If desired, you can change various aspects of how the XML source code is displayed in the Source view of the XML editor, such as the colors the tags will be displayed in.">Setting source highlighting styles</a></div>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedttag.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedttag.html
index 178a1aa..ef53b7d 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedttag.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txedttag.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -81,7 +81,7 @@
 <div><a href="../topics/cwxmledt.html" title="The XML editor is a tool for creating and viewing XML files.">XML editor</a></div>
 </div>
 <div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
+<div><a href="../topics/txedtdes.html" title="The XML editor has a Design view, which represents the XML file simultaneously as a table with Node and Content columns and a tree. This helps make navigation and editing easier. Content and attribute values can be edited directly in the table cells, while pop-up menus on the tree elements give alternatives that are valid for that particular element.">Editing in the Design view</a></div>
 <div><a href="../topics/txedtsrc.html" title="You can use the Source view to view and work with a file's source code directly.">Editing in the Source view</a></div>
 </div>
 </div>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txmlcat.dita b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txmlcat.dita
index 015673f..9dff82d 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txmlcat.dita
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txmlcat.dita
@@ -1,104 +1,181 @@
-<?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2006, v.4002-->

+<?xml version="1.0" encoding="UTF-8"?>

+<!--Arbortext, Inc., 1988-2008, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

+<?Pub Sty _display FontColor="red"?>

 <?Pub Inc?>

 <task id="txmlcat" xml:lang="en-us">

 <title>Adding entries to the XML Catalog</title>

 <titlealts>

 <searchtitle>Adding entries to the XML Catalog</searchtitle>

 </titlealts>

-<shortdesc>An XML Catalog entry contains two parts - a Key (which represents

-a DTD or XML schema) and a Location (similar to a URI, which contains information

-about a DTD or XML schema's location). You can place the Key in an XML file.

-When the XML processor encounters it, it will use the XML Catalog entry to

-find the location of the DTD or XML schema associated with the Key</shortdesc>

+<shortdesc>XML Catalog entries are used to map external entity references

+to locally defined resources. You can provide rules specify how these

+entities are resolved</shortdesc>

 <prolog><metadata>

 <keywords><indexterm>XML catalog<indexterm>adding entries</indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <taskbody>

-<context><p>XML Catalog entries can be used in various situations. For example,

-you are working on an XML file on your main desktop computer and point its <codeph>schemaLocation</codeph> towards

-a schema called <codeph>c:\MySchema.xsd</codeph>. You then save it to your

-laptop computer so you can work on it later. When you open the file on your

-laptop, however, you encounter a problem - the XML editor cannot find the <codeph>MySchema.xsd</codeph> schema

-because it is actually installed on your D drive. You will have to edit the <codeph>schemaLocation</codeph> to

-point to <codeph>d:\MySchema.xsd</codeph>. When you have finished editing

-the XML file and are ready to publish it on the Web, you will need to edit

-the URI again so that it points to a resource that is accessible on the Web.

-By now, the problem is obvious. A URI used within an XML file is not as portable

-as you would like it to be. To avoid making frequent changes to your XML document,

-you can use the XML Catalog.</p><p>An XML Catalog entry is used by an XML

-processor when resolving entity references. You can provide rules to the catalog

-to specify how entities should be resolved. If you consider the preceding

-example, you could specify a rule that redirects an Internet resource reference

-(for example,  <codeph>"http://www.ibm.com/published-schemas/MySchema.xsd"</codeph>)

-so that it points to a resource on the developer's local machine (for example,

- <codeph>"file:///C:/MySchema.xsd"</codeph>). Now, instead of frequently editing

-XML documents to update the URIs or locations (especially when there are many

-documents in your project), you only need to update a single rule in your

-XML Catalog.</p><p>The following instructions were written for the Resource

-perspective, but they will also work in many other perspectives.</p><p>To

-add an entry to the XML Catalog, follow these steps:</p></context>

+<context><p>For details on the standard for XML Catalogs, see: <xref

+href="http://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html"

+scope="external"></xref>.</p><p>For example: you are working on an

+XML file on a computer and point its <codeph>schemaLocation</codeph> towards

+a schema called <codeph>c:\MySchema.xsd</codeph>. If you do not use

+an XML catalog, then when you finish editing the XML file and are

+ready to publish it on the Web, you will need to edit <codeph>schemaLocation</codeph> so

+that it points to a resource that is accessible on the Web.</p><p>To

+avoid making frequent changes to your XML document, you can use the

+XML Catalog: you could specify a rule that redirects an Internet resource

+reference (for example,  <codeph>"http://www.ibm.com/published-schemas/MySchema.xsd"</codeph>)

+so that it points to a resource on the local machine (for example,

+ <codeph>"file:///C:/MySchema.xsd"</codeph>). Now, instead of frequently

+editing XML documents to update the URIs or locations (especially

+when there are many documents in your project), you only need to update

+a single rule in your XML Catalog.</p><p>The following instructions

+were written for the Resource perspective, but they will also work

+in many other perspectives.</p><p>To add an entry to the XML Catalog,

+follow these steps:</p></context>

 <steps>

-<step><cmd>Open the XML file that you want to associate with a DTD or XML

-schema.</cmd></step>

+<step><cmd>Open the XML file that you want to associate with a DTD

+or XML schema.</cmd></step>

 <step><cmd>Click  <menucascade><uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol>

-</menucascade> and select <menucascade><uicontrol>XML</uicontrol><uicontrol>XML

-Catalog</uicontrol></menucascade>.</cmd><info>The  <uicontrol>XML Catalog

-Entries</uicontrol> section contains a list of any user-defined and plug-in

-defined catalog entries. Select any entry to see information about it in the <uicontrol>Details</uicontrol> section.</info>

+</menucascade> and select <menucascade><uicontrol>XML</uicontrol>

+<uicontrol>XML Catalog</uicontrol></menucascade>.</cmd><info>The  <uicontrol>XML

+Catalog Entries</uicontrol> section contains a list of any user-defined

+and plug-in defined catalog entries. Select any entry to see information

+about it in the <uicontrol>Details</uicontrol> section.</info></step>

+<step><cmd>Click <uicontrol>Add</uicontrol> to create a new catalog

+entry.</cmd></step>

+<step><cmd>In the left-hand column, click the type of catalog entry

+that you want to add:</cmd>

+<choicetable>

+<chrow><choption>Catalog Entry</choption><chdesc>Used by an XML processor

+when resolving entity references. You can provide rules to the catalog

+to specify how entities should be resolved.<p>An XML Catalog entry

+contains two parts:<ul>

+<li>A key (which represents a DTD or XML schema)</li>

+<li>A location (similar to a URI, which contains information about

+a DTD or XML schema's location).</li>

+</ul> You can place the Key in an XML file. When the XML processor

+encounters it, it will use the XML Catalog entry to find the location

+of the DTD or XML schema associated with the Key</p></chdesc></chrow>

+<chrow><choption>Rewrite Entry</choption><chdesc>Used to redirect

+a set of entities.</chdesc></chrow>

+<chrow><choption>Suffix Entry</choption><chdesc>Used to match the

+suffix of a URI or systemID.</chdesc></chrow>

+<chrow><choption>Next Catalog</choption><chdesc>Used to refer to another

+catalog without importing it into the workbench.</chdesc></chrow>

+<chrow><choption>Delegate Catalog</choption><chdesc>Used to associate

+an alternate catalog with an identifier.</chdesc></chrow>

+</choicetable>

 </step>

-<step><cmd>Click <uicontrol>Add</uicontrol> to create a new catalog entry.</cmd>

-</step>

-<step><cmd>In the <uicontrol>Location</uicontrol> field, enter or browse for

-the location or URI of the DTD or XML schema file. This uses your computer's

-path style to describe the location of the file.</cmd></step>

-<step><cmd>Select a key type for the catalog entry from the <uicontrol>Key

-Type</uicontrol> drop down.</cmd><info>The values in this list will change

-depending on the type of file you specified in the <uicontrol>Location</uicontrol> field:<ul>

+<step><cmd>Complete the fields for the catalog entry that you selected:</cmd>

+<info><table><title> Cata<?Pub Caret?>log entry types and associated

+fields</title>

+<tgroup cols="2"><colspec colname="col1"/><colspec colname="col2"/>

+<thead>

+<row valign="bottom">

+<entry colname="col1">Catalog type</entry>

+<entry colname="col2">Fields</entry>

+</row>

+</thead>

+<tbody>

+<row>

+<entry char="." colname="col1">Catalog Entry</entry>

+<entry colname="col2"><ul>

+<li>In the <uicontrol>Location</uicontrol> field, enter or browse

+for the location or URI of the DTD or XML schema file. This uses your

+computer's path style to describe the location of the file. </li>

+<li>Select a <uicontrol>Key Type</uicontrol>:<ul>

 <li>If you specified a DTD: select <uicontrol>Public ID</uicontrol>, <uicontrol>System

-ID</uicontrol>, or <uicontrol>URI</uicontrol> from the <uicontrol>Key Type</uicontrol> field.

-If you select <uicontrol>Public ID,</uicontrol> the value you enter in the <uicontrol>Key</uicontrol> field

-should be the same as the Public ID in the XML file's DOCTYPE declaration.

-If you select <uicontrol>System ID</uicontrol>, the value you enter should

-correspond to the System ID in an XML file's DOCTYPE declaration. If you select <uicontrol>URI</uicontrol>,

-the value you enter must be a fully qualified URI.</li>

-<li>If you specified an XML schema: select either <uicontrol>Namespace Name</uicontrol> or

- <uicontrol>Schema Location</uicontrol> from the <uicontrol>Key Type</uicontrol> field.

-If the schema defines a target namespace, it will automatically appear in

-the <uicontrol>Key</uicontrol> field. Otherwise, you can enter the schema

-location in the <uicontrol>Key</uicontrol> field.</li>

-</ul></info></step>

-<step><cmd>Select the <uicontrol>Specify alternative Web address</uicontrol> check

-box if you want to be able to specify an alternate Web address for the resource.</cmd>

-<info>This Web address is used when an XML instance is generated from this

-catalog entry.<note>This option is only available if you select <uicontrol>Public

-ID</uicontrol> (for a DTD) or  <uicontrol>Namespace Name</uicontrol> (for

-a schema) in the  <uicontrol>Key type</uicontrol> field.</note></info></step>

-<step><cmd>If you want to refer to another catalog without importing it into

-the workbench, click <uicontrol>Next Catalog</uicontrol>. Type or browse for

-the XML catalog you want to refer to. </cmd></step>

+ID</uicontrol>, or <uicontrol>URI</uicontrol> from the <uicontrol>Key

+Type</uicontrol> field. If you select <uicontrol>Public ID,</uicontrol> the

+value you enter in the <uicontrol>Key</uicontrol> field should be

+the same as the Public ID in the XML file's DOCTYPE declaration. If

+you select <uicontrol>System ID</uicontrol>, the value you enter should

+correspond to the System ID in an XML file's DOCTYPE declaration.

+If you select <uicontrol>URI</uicontrol>, the value you enter must

+be a fully qualified URI.</li>

+<li>If you specified an XML schema: select either <uicontrol>Namespace

+Name</uicontrol> or  <uicontrol>Schema Location</uicontrol> from the <uicontrol>Key

+Type</uicontrol> field. If the schema defines a target namespace,

+it will automatically appear in the <uicontrol>Key</uicontrol> field.

+Otherwise, you can enter the schema location in the <uicontrol>Key</uicontrol> field.</li>

+</ul></li>

+<li>Select the <uicontrol>Specify alternative Web address</uicontrol> check

+box if you want to be able to specify an alternate Web address for

+the resource. <p>This Web address is used when an XML instance is

+generated from this catalog entry.<note>This option is only available

+if you select <uicontrol>Public ID</uicontrol> (for a DTD) or  <uicontrol>Namespace

+Name</uicontrol> (for a schema) in the  <uicontrol>Key type</uicontrol> field.</note></p></li>

+</ul></entry>

+</row>

+<row>

+<entry char="." colname="col1">Rewrite Entry</entry>

+<entry colname="col2"><ul>

+<li>Select a <uicontrol>Key type to match</uicontrol>, either URI

+or systemID.</li>

+<li><uicontrol>Matching start string</uicontrol>: The matching prefix

+to be removed from the supplied identifier.</li>

+<li><uicontrol>Rewrite prefix</uicontrol>: The prefix is be used instead

+of the prefix that is removed.</li>

+</ul></entry>

+</row>

+<row>

+<entry char="." colname="col1">Suffix Entry</entry>

+<entry colname="col2"><ul>

+<li>In the <uicontrol>Location</uicontrol> field, enter or browse

+for the location or URI of the DTD or XML schema file. This uses your

+computer's path style to describe the location of the file. </li>

+<li>Select a <uicontrol>Key Type</uicontrol> (URI or systemID) to

+match. </li>

+<li>Type the <uicontrol>Suffix</uicontrol> of the identifier to match.</li>

+</ul></entry>

+</row>

+<row>

+<entry char="." colname="col1">Next Catalog</entry>

+<entry colname="col2">In the <uicontrol>Location of another XML Catalog

+file</uicontrol> field, type or browse for the XML catalog you want

+to refer to. </entry>

+</row>

+<row>

+<entry char="." colname="col1">Delegate Catalog</entry>

+<entry colname="col2"><ul>

+<li>Select a <uicontrol>Key type to match</uicontrol>, either URI

+or systemID.</li>

+<li><uicontrol>Matching start string</uicontrol>: The prefix of the

+supplied identifier to match.</li>

+<li><uicontrol>Delegate to this XML file</uicontrol>: The alternate

+catalog to associate.</li>

+</ul></entry>

+</row>

+</tbody>

+</tgroup>

+</table></info></step>

 <step><cmd>When you are done creating catalog entries, click <uicontrol>OK</uicontrol> to

 close the Add XML Catalog Entry dialog. Click <uicontrol>OK</uicontrol> again

 to save your settings.</cmd></step>

 <step><cmd>Make sure the XML file is in focus and click the <uicontrol>Reload

 dependencies</uicontrol> toolbar button. </cmd></step>

 </steps>

-<result>The XML file is now associated with the latest version of the XML

-schema or DTD.</result>

-<postreq><p>You can also export and import XML Catalog information:<?Pub Caret?> </p><p>To

-export, click <uicontrol>File > Export</uicontrol> and select <uicontrol>XML

-> XML Catalog</uicontrol>. You will be prompted to select a project and provide

-a file name to store your catalog entries in an .xmlcatalog file, which can

-be opened from the Navigator view. Since your catalog entries are stored in

-an .xmlcatalog file, you can check them in and out and share them like any

-other project resource.</p><p>To import, click <uicontrol>File > Import</uicontrol> and

-select <uicontrol>XML > XML Catalog</uicontrol>. Then specify the file that

-will be used to load the XML Catalog settings. When you import a .xmlcatalog

-file, any entries in it will be loaded into the XML Catalog (and any existing

-entries will be overwritten). </p></postreq>

+<result>The XML file is now associated with the latest version of

+the XML schema or DTD.</result>

+<postreq><p>You can also export and import XML Catalog information: </p><p>To

+export, click <menucascade><uicontrol>File</uicontrol><uicontrol>Export</uicontrol>

+</menucascade> and select <menucascade><uicontrol>XML</uicontrol>

+<uicontrol>XML Catalog</uicontrol></menucascade>. You will be prompted

+to select a project and provide a file name to store your catalog

+entries in an .xmlcatalog file, which can be opened from the Navigator

+view. Since your catalog entries are stored in an .xmlcatalog file,

+you can check them in and out and share them like any other project

+resource.</p><p>To import, click <menucascade><uicontrol>File</uicontrol>

+<uicontrol>Import</uicontrol></menucascade> and select <menucascade>

+<uicontrol>XML</uicontrol><uicontrol>XML Catalog</uicontrol>

+</menucascade>. Then specify the file that will be used to load the

+XML Catalog settings. When you import a .xmlcatalog file, any entries

+in it will be loaded into the XML Catalog (and any existing entries

+will be overwritten). </p></postreq>

 </taskbody>

 </task>

-<?Pub *0000006868?>

+<?Pub *0000009117?>

diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txmlcat.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txmlcat.html
index 025015b..59f6605 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txmlcat.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txmlcat.html
@@ -2,15 +2,15 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="task" name="DC.Type" />
 <meta name="DC.Title" content="Adding entries to the XML Catalog" />
-<meta name="abstract" content="An XML Catalog entry contains two parts - a Key (which represents a DTD or XML schema) and a Location (similar to a URI, which contains information about a DTD or XML schema's location). You can place the Key in an XML file. When the XML processor encounters it, it will use the XML Catalog entry to find the location of the DTD or XML schema associated with the Key" />
-<meta name="description" content="An XML Catalog entry contains two parts - a Key (which represents a DTD or XML schema) and a Location (similar to a URI, which contains information about a DTD or XML schema's location). You can place the Key in an XML file. When the XML processor encounters it, it will use the XML Catalog entry to find the location of the DTD or XML schema associated with the Key" />
+<meta name="abstract" content="XML Catalog entries are used to map external entity references to locally defined resources. You can provide rules specify how these entities are resolved" />
+<meta name="description" content="XML Catalog entries are used to map external entity references to locally defined resources. You can provide rules specify how these entities are resolved" />
 <meta content="XML catalog, adding entries" name="DC.subject" />
 <meta content="XML catalog, adding entries" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/cxmlcat.html" />
@@ -35,89 +35,220 @@
 
 
 
-<div><p>An XML Catalog entry contains two parts - a Key (which represents
-a DTD or XML schema) and a Location (similar to a URI, which contains information
-about a DTD or XML schema's location). You can place the Key in an XML file.
-When the XML processor encounters it, it will use the XML Catalog entry to
-find the location of the DTD or XML schema associated with the Key</p>
+<div><p>XML Catalog entries are used to map external entity references
+to locally defined resources. You can provide rules specify how these
+entities are resolved</p>
 
-<div class="section"><p>XML Catalog entries can be used in various situations. For example,
-you are working on an XML file on your main desktop computer and point its <samp class="codeph">schemaLocation</samp> towards
-a schema called <samp class="codeph">c:\MySchema.xsd</samp>. You then save it to your
-laptop computer so you can work on it later. When you open the file on your
-laptop, however, you encounter a problem - the XML editor cannot find the <samp class="codeph">MySchema.xsd</samp> schema
-because it is actually installed on your D drive. You will have to edit the <samp class="codeph">schemaLocation</samp> to
-point to <samp class="codeph">d:\MySchema.xsd</samp>. When you have finished editing
-the XML file and are ready to publish it on the Web, you will need to edit
-the URI again so that it points to a resource that is accessible on the Web.
-By now, the problem is obvious. A URI used within an XML file is not as portable
-as you would like it to be. To avoid making frequent changes to your XML document,
-you can use the XML Catalog.</p>
-<p>An XML Catalog entry is used by an XML
-processor when resolving entity references. You can provide rules to the catalog
-to specify how entities should be resolved. If you consider the preceding
-example, you could specify a rule that redirects an Internet resource reference
-(for example,  <samp class="codeph">"http://www.ibm.com/published-schemas/MySchema.xsd"</samp>)
-so that it points to a resource on the developer's local machine (for example,
- <samp class="codeph">"file:///C:/MySchema.xsd"</samp>). Now, instead of frequently editing
-XML documents to update the URIs or locations (especially when there are many
-documents in your project), you only need to update a single rule in your
-XML Catalog.</p>
-<p>The following instructions were written for the Resource
-perspective, but they will also work in many other perspectives.</p>
+<div class="section"><p>For details on the standard for XML Catalogs, see: <a href="http://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html" target="_blank">http://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html</a>.</p>
+<p>For example: you are working on an
+XML file on a computer and point its <samp class="codeph">schemaLocation</samp> towards
+a schema called <samp class="codeph">c:\MySchema.xsd</samp>. If you do not use
+an XML catalog, then when you finish editing the XML file and are
+ready to publish it on the Web, you will need to edit <samp class="codeph">schemaLocation</samp> so
+that it points to a resource that is accessible on the Web.</p>
 <p>To
-add an entry to the XML Catalog, follow these steps:</p>
+avoid making frequent changes to your XML document, you can use the
+XML Catalog: you could specify a rule that redirects an Internet resource
+reference (for example,  <samp class="codeph">"http://www.ibm.com/published-schemas/MySchema.xsd"</samp>)
+so that it points to a resource on the local machine (for example,
+ <samp class="codeph">"file:///C:/MySchema.xsd"</samp>). Now, instead of frequently
+editing XML documents to update the URIs or locations (especially
+when there are many documents in your project), you only need to update
+a single rule in your XML Catalog.</p>
+<p>The following instructions
+were written for the Resource perspective, but they will also work
+in many other perspectives.</p>
+<p>To add an entry to the XML Catalog,
+follow these steps:</p>
 </div>
 
 <ol>
-<li class="stepexpand"><span>Open the XML file that you want to associate with a DTD or XML
-schema.</span></li>
+<li class="stepexpand"><span>Open the XML file that you want to associate with a DTD
+or XML schema.</span></li>
 
 <li class="stepexpand"><span>Click  <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span>
-</span> and select <span class="menucascade"><span class="uicontrol">XML</span> &gt; <span class="uicontrol">XML
-Catalog</span></span>.</span> The  <span class="uicontrol">XML Catalog
-Entries</span> section contains a list of any user-defined and plug-in
-defined catalog entries. Select any entry to see information about it in the <span class="uicontrol">Details</span> section.
+</span> and select <span class="menucascade"><span class="uicontrol">XML</span>
+ &gt; <span class="uicontrol">XML Catalog</span></span>.</span> The  <span class="uicontrol">XML
+Catalog Entries</span> section contains a list of any user-defined
+and plug-in defined catalog entries. Select any entry to see information
+about it in the <span class="uicontrol">Details</span> section.</li>
+
+<li class="stepexpand"><span>Click <span class="uicontrol">Add</span> to create a new catalog
+entry.</span></li>
+
+<li class="stepexpand"><span>In the left-hand column, click the type of catalog entry
+that you want to add:</span>
+
+<table class="choicetableborder" summary="" cellspacing="0" cellpadding="4" rules="rows" frame="hsides" border="1">
+<thead><tr><th valign="bottom" id="N100EE-option" align="left">Option</th>
+<th valign="bottom" id="N100EE-desc" align="left">Description</th></tr></thead>
+<tbody>
+<tr><td valign="top" headers="N100EE-option" id="N100F8"><strong>Catalog Entry</strong></td>
+<td valign="top" headers="N100EE-desc N100F8">Used by an XML processor
+when resolving entity references. You can provide rules to the catalog
+to specify how entities should be resolved.<div class="p">An XML Catalog entry
+contains two parts:<ul>
+<li>A key (which represents a DTD or XML schema)</li>
+
+<li>A location (similar to a URI, which contains information about
+a DTD or XML schema's location).</li>
+
+</ul>
+ You can place the Key in an XML file. When the XML processor
+encounters it, it will use the XML Catalog entry to find the location
+of the DTD or XML schema associated with the Key</div>
+</td>
+</tr>
+
+<tr><td valign="top" headers="N100EE-option" id="N1011E"><strong>Rewrite Entry</strong></td>
+<td valign="top" headers="N100EE-desc N1011E">Used to redirect
+a set of entities.</td>
+</tr>
+
+<tr><td valign="top" headers="N100EE-option" id="N1012D"><strong>Suffix Entry</strong></td>
+<td valign="top" headers="N100EE-desc N1012D">Used to match the
+suffix of a URI or systemID.</td>
+</tr>
+
+<tr><td valign="top" headers="N100EE-option" id="N1013C"><strong>Next Catalog</strong></td>
+<td valign="top" headers="N100EE-desc N1013C">Used to refer to another
+catalog without importing it into the workbench.</td>
+</tr>
+
+<tr><td valign="top" headers="N100EE-option" id="N1014B"><strong>Delegate Catalog</strong></td>
+<td valign="top" headers="N100EE-desc N1014B">Used to associate
+an alternate catalog with an identifier.</td>
+</tr>
+
+</tbody></table>
+
 </li>
 
-<li class="stepexpand"><span>Click <span class="uicontrol">Add</span> to create a new catalog entry.</span>
-</li>
+<li class="stepexpand"><span>Complete the fields for the catalog entry that you selected:</span>
+ 
+<div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="border" border="1" rules="all"><caption>Table 1.  Catalog entry types and associated
+fields</caption>
+<thead align="left">
+<tr valign="bottom">
+<th valign="bottom" id="N1018B">Catalog type</th>
 
-<li class="stepexpand"><span>In the <span class="uicontrol">Location</span> field, enter or browse for
-the location or URI of the DTD or XML schema file. This uses your computer's
-path style to describe the location of the file.</span></li>
+<th valign="bottom" id="N10192">Fields</th>
 
-<li class="stepexpand"><span>Select a key type for the catalog entry from the <span class="uicontrol">Key
-Type</span> drop down.</span> The values in this list will change
-depending on the type of file you specified in the <span class="uicontrol">Location</span> field:<ul>
+</tr>
+
+</thead>
+
+<tbody>
+<tr>
+<td char="." valign="top" headers="N1018B ">Catalog Entry</td>
+
+<td valign="top" headers="N10192 "><ul>
+<li>In the <span class="uicontrol">Location</span> field, enter or browse
+for the location or URI of the DTD or XML schema file. This uses your
+computer's path style to describe the location of the file. </li>
+
+<li>Select a <span class="uicontrol">Key Type</span>:<ul>
 <li>If you specified a DTD: select <span class="uicontrol">Public ID</span>, <span class="uicontrol">System
-ID</span>, or <span class="uicontrol">URI</span> from the <span class="uicontrol">Key Type</span> field.
-If you select <span class="uicontrol">Public ID,</span> the value you enter in the <span class="uicontrol">Key</span> field
-should be the same as the Public ID in the XML file's DOCTYPE declaration.
-If you select <span class="uicontrol">System ID</span>, the value you enter should
-correspond to the System ID in an XML file's DOCTYPE declaration. If you select <span class="uicontrol">URI</span>,
-the value you enter must be a fully qualified URI.</li>
+ID</span>, or <span class="uicontrol">URI</span> from the <span class="uicontrol">Key
+Type</span> field. If you select <span class="uicontrol">Public ID,</span> the
+value you enter in the <span class="uicontrol">Key</span> field should be
+the same as the Public ID in the XML file's DOCTYPE declaration. If
+you select <span class="uicontrol">System ID</span>, the value you enter should
+correspond to the System ID in an XML file's DOCTYPE declaration.
+If you select <span class="uicontrol">URI</span>, the value you enter must
+be a fully qualified URI.</li>
 
-<li>If you specified an XML schema: select either <span class="uicontrol">Namespace Name</span> or
- <span class="uicontrol">Schema Location</span> from the <span class="uicontrol">Key Type</span> field.
-If the schema defines a target namespace, it will automatically appear in
-the <span class="uicontrol">Key</span> field. Otherwise, you can enter the schema
-location in the <span class="uicontrol">Key</span> field.</li>
+<li>If you specified an XML schema: select either <span class="uicontrol">Namespace
+Name</span> or  <span class="uicontrol">Schema Location</span> from the <span class="uicontrol">Key
+Type</span> field. If the schema defines a target namespace,
+it will automatically appear in the <span class="uicontrol">Key</span> field.
+Otherwise, you can enter the schema location in the <span class="uicontrol">Key</span> field.</li>
 
 </ul>
 </li>
 
-<li class="stepexpand"><span>Select the <span class="uicontrol">Specify alternative Web address</span> check
-box if you want to be able to specify an alternate Web address for the resource.</span>
- This Web address is used when an XML instance is generated from this
-catalog entry.<div class="note"><span class="notetitle">Note:</span> This option is only available if you select <span class="uicontrol">Public
-ID</span> (for a DTD) or  <span class="uicontrol">Namespace Name</span> (for
-a schema) in the  <span class="uicontrol">Key type</span> field.</div>
+<li>Select the <span class="uicontrol">Specify alternative Web address</span> check
+box if you want to be able to specify an alternate Web address for
+the resource. <div class="p">This Web address is used when an XML instance is
+generated from this catalog entry.<div class="note"><span class="notetitle">Note:</span> This option is only available
+if you select <span class="uicontrol">Public ID</span> (for a DTD) or  <span class="uicontrol">Namespace
+Name</span> (for a schema) in the  <span class="uicontrol">Key type</span> field.</div>
+</div>
 </li>
 
-<li class="stepexpand"><span>If you want to refer to another catalog without importing it into
-the workbench, click <span class="uicontrol">Next Catalog</span>. Type or browse for
-the XML catalog you want to refer to. </span></li>
+</ul>
+</td>
+
+</tr>
+
+<tr>
+<td char="." valign="top" headers="N1018B ">Rewrite Entry</td>
+
+<td valign="top" headers="N10192 "><ul>
+<li>Select a <span class="uicontrol">Key type to match</span>, either URI
+or systemID.</li>
+
+<li><span class="uicontrol">Matching start string</span>: The matching prefix
+to be removed from the supplied identifier.</li>
+
+<li><span class="uicontrol">Rewrite prefix</span>: The prefix is be used instead
+of the prefix that is removed.</li>
+
+</ul>
+</td>
+
+</tr>
+
+<tr>
+<td char="." valign="top" headers="N1018B ">Suffix Entry</td>
+
+<td valign="top" headers="N10192 "><ul>
+<li>In the <span class="uicontrol">Location</span> field, enter or browse
+for the location or URI of the DTD or XML schema file. This uses your
+computer's path style to describe the location of the file. </li>
+
+<li>Select a <span class="uicontrol">Key Type</span> (URI or systemID) to
+match. </li>
+
+<li>Type the <span class="uicontrol">Suffix</span> of the identifier to match.</li>
+
+</ul>
+</td>
+
+</tr>
+
+<tr>
+<td char="." valign="top" headers="N1018B ">Next Catalog</td>
+
+<td valign="top" headers="N10192 ">In the <span class="uicontrol">Location of another XML Catalog
+file</span> field, type or browse for the XML catalog you want
+to refer to. </td>
+
+</tr>
+
+<tr>
+<td char="." valign="top" headers="N1018B ">Delegate Catalog</td>
+
+<td valign="top" headers="N10192 "><ul>
+<li>Select a <span class="uicontrol">Key type to match</span>, either URI
+or systemID.</li>
+
+<li><span class="uicontrol">Matching start string</span>: The prefix of the
+supplied identifier to match.</li>
+
+<li><span class="uicontrol">Delegate to this XML file</span>: The alternate
+catalog to associate.</li>
+
+</ul>
+</td>
+
+</tr>
+
+</tbody>
+
+</table>
+</div>
+</li>
 
 <li class="stepexpand"><span>When you are done creating catalog entries, click <span class="uicontrol">OK</span> to
 close the Add XML Catalog Entry dialog. Click <span class="uicontrol">OK</span> again
@@ -128,22 +259,26 @@
 
 </ol>
 
-<div class="section">The XML file is now associated with the latest version of the XML
-schema or DTD.</div>
+<div class="section">The XML file is now associated with the latest version of
+the XML schema or DTD.</div>
 
 <div class="section"><p>You can also export and import XML Catalog information: </p>
 <p>To
-export, click <span class="uicontrol">File &gt; Export</span> and select <span class="uicontrol">XML
-&gt; XML Catalog</span>. You will be prompted to select a project and provide
-a file name to store your catalog entries in an .xmlcatalog file, which can
-be opened from the Navigator view. Since your catalog entries are stored in
-an .xmlcatalog file, you can check them in and out and share them like any
-other project resource.</p>
-<p>To import, click <span class="uicontrol">File &gt; Import</span> and
-select <span class="uicontrol">XML &gt; XML Catalog</span>. Then specify the file that
-will be used to load the XML Catalog settings. When you import a .xmlcatalog
-file, any entries in it will be loaded into the XML Catalog (and any existing
-entries will be overwritten). </p>
+export, click <span class="menucascade"><span class="uicontrol">File</span> &gt; <span class="uicontrol">Export</span>
+</span> and select <span class="menucascade"><span class="uicontrol">XML</span>
+ &gt; <span class="uicontrol">XML Catalog</span></span>. You will be prompted
+to select a project and provide a file name to store your catalog
+entries in an .xmlcatalog file, which can be opened from the Navigator
+view. Since your catalog entries are stored in an .xmlcatalog file,
+you can check them in and out and share them like any other project
+resource.</p>
+<p>To import, click <span class="menucascade"><span class="uicontrol">File</span>
+ &gt; <span class="uicontrol">Import</span></span> and select <span class="menucascade">
+<span class="uicontrol">XML</span> &gt; <span class="uicontrol">XML Catalog</span>
+</span>. Then specify the file that will be used to load the
+XML Catalog settings. When you import a .xmlcatalog file, any entries
+in it will be loaded into the XML Catalog (and any existing entries
+will be overwritten). </p>
 </div>
 
 </div>
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txprefs.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txprefs.html
index 466eaaa..57445f2 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txprefs.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txprefs.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
diff --git a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txsityp.html b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txsityp.html
index dfc4641..fc47c4c 100644
--- a/docs/org.eclipse.wst.xmleditor.doc.user/topics/txsityp.html
+++ b/docs/org.eclipse.wst.xmleditor.doc.user/topics/txsityp.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/DocBuild.xml b/docs/org.eclipse.wst.xsdeditor.doc.user/DocBuild.xml
index 40cf7a4..07cf32d 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/DocBuild.xml
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/DocBuild.xml
@@ -23,6 +23,9 @@
 	- Created.
 	2008-01-09 Kate Price <katep@ca.ibm.com>
 	- modified for new DITA-OT version
+	2008-05-05 Kate Price <katep@ca.ibm.com>
+	- modified to add generation of pre-built help index. 
+	- Must delete /index folder before running build
 -->
 <project name="eclipsehelp" default="all">
 
@@ -45,10 +48,10 @@
 	<target name="eclipsehelp">
 		<ant antfile="${dita.ot.dir}${file.separator}conductor.xml" target="init" dir="${dita.ot.dir}">
 			<property name="args.copycss" value="no" />
-			<property name="args.csspath" value="org.eclipse.wst.doc.user" />
+			<property name="args.csspath" value="../org.eclipse.wst.doc.user" />
 			<property name="args.eclipse.provider" value="Eclipse.org" />
-			<property name="args.eclipse.version" value="3.3.0" />
-			<property name="args.input" location="XSDeditormap_toc.ditamap" />    		
+			<property name="args.eclipse.version" value="3.4.0" />
+			<property name="args.input" location="XSDLeditorrel.ditamap" />    		
 			<property name="clean.temp" value="true" />
 			<property name="dita.extname" value=".dita" />
 			<property name="dita.temp.dir" location="temp" />
@@ -57,4 +60,7 @@
 		</ant>
 		<copy file="myplugin.xml" tofile="plugin.xml" overwrite="yes" />
 	</target>
+	<target name="build.index" description="Builds search index for the plug-in" if="eclipse.running">
+	     <help.buildHelpIndex manifest="plugin.xml" destination="."/>
+	</target>
 </project>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.xsdeditor.doc.user/META-INF/MANIFEST.MF
index 3649845..27509ae 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/META-INF/MANIFEST.MF
@@ -2,6 +2,6 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Plugin.name
 Bundle-SymbolicName: org.eclipse.wst.xsdeditor.doc.user; singleton:=true
-Bundle-Version: 1.0.400.qualifier
+Bundle-Version: 1.0.800.qualifier
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: plugin
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/XSDeditormap_toc.ditamap b/docs/org.eclipse.wst.xsdeditor.doc.user/XSDeditormap_toc.ditamap
index 5a34cb8..3207c05 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/XSDeditormap_toc.ditamap
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/XSDeditormap_toc.ditamap
@@ -80,3 +80,4 @@
 <topicref href="topics/rnmspc.dita" navtitle="XML namespaces"></topicref>

 <anchor id="xsd_post_rnmspc"/></topicref>

 </map>

+<?Pub *0000003828?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/about.html b/docs/org.eclipse.wst.xsdeditor.doc.user/about.html
index 73db36e..2199df3 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/about.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/about.html
@@ -10,7 +10,7 @@
 
 <H3>About This Content</H3>
 
-<P>June 06, 2007</P>
+<P>June, 2008</P>
 
 <H3>License</H3>
 
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/index/_v.cfs b/docs/org.eclipse.wst.xsdeditor.doc.user/index/_v.cfs
index 88fa958..f075c79 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/index/_v.cfs
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/index/_v.cfs
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/index/deletable b/docs/org.eclipse.wst.xsdeditor.doc.user/index/deletable
index e423242..593f470 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/index/deletable
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/index/deletable
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_contributions b/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_contributions
index de9744f..0b2a149 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_contributions
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_contributions
@@ -1,3 +1,3 @@
 #This is a generated file; do not edit.

-#Wed May 09 14:16:38 EDT 2007

-org.eclipse.wst.xsdeditor.doc.user=org.eclipse.wst.xsdeditor.doc.user\n1.0.300.qualifier

+#Mon May 18 17:38:24 EDT 2009

+org.eclipse.wst.xsdeditor.doc.user=org.eclipse.wst.xsdeditor.doc.user\n1.0.700.qualifier

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_dependencies b/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_dependencies
index 93c25b2..f2b76ee 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_dependencies
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_dependencies
@@ -1,4 +1,4 @@
 #This is a generated file; do not edit.

-#Wed May 09 14:16:38 EDT 2007

-lucene=1.4.103.v20060601

-analyzer=org.eclipse.help.base\#3.2.0.v20060601?locale\=en

+#Mon May 18 17:38:24 EDT 2009

+lucene=1.9.1.v20080530-1600

+analyzer=org.eclipse.help.base\#3.3.101.M20080728_34x?locale\=en

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_docs b/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_docs
index 3951dc1..8f7fef4 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_docs
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/index/indexed_docs
@@ -1,5 +1,5 @@
 #This is a generated file; do not edit.

-#Wed May 09 14:16:38 EDT 2007

+#Mon May 18 17:38:24 EDT 2009

 /org.eclipse.wst.xsdeditor.doc.user/topics/taddcmxt.html=0

 /org.eclipse.wst.xsdeditor.doc.user/topics/cworkXSD.html=0

 /org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.html=0

@@ -10,8 +10,8 @@
 /org.eclipse.wst.xsdeditor.doc.user/topics/taddglem.html=0

 /org.eclipse.wst.xsdeditor.doc.user/topics/rxsdicons.html=0

 /org.eclipse.wst.xsdeditor.doc.user/topics/taddimpt.html=0

-/org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.html=0

 /org.eclipse.wst.xsdeditor.doc.user/topics/taddglba.html=0

+/org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.html=0

 /org.eclipse.wst.xsdeditor.doc.user/topics/rrefintg.html=0

 /org.eclipse.wst.xsdeditor.doc.user/topics/tedtschm.html=0

 /org.eclipse.wst.xsdeditor.doc.user/topics/taddcmod.html=0

@@ -19,11 +19,11 @@
 /org.eclipse.wst.xsdeditor.doc.user/topics/taddgrup.html=0

 /org.eclipse.wst.xsdeditor.doc.user/topics/taddelm.html=0

 /org.eclipse.wst.xsdeditor.doc.user/topics/taddrdfn.html=0

-/org.eclipse.wst.xsdeditor.doc.user/topics/taddsmpt.html=0

 /org.eclipse.wst.xsdeditor.doc.user/topics/taddincl.html=0

+/org.eclipse.wst.xsdeditor.doc.user/topics/taddsmpt.html=0

 /org.eclipse.wst.xsdeditor.doc.user/topics/taddreg.html=0

-/org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.html=0

 /org.eclipse.wst.xsdeditor.doc.user/topics/tdelscmp.html=0

+/org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.html=0

 /org.eclipse.wst.xsdeditor.doc.user/topics/tvdtschm.html=0

 /org.eclipse.wst.xsdeditor.doc.user/topics/taddelmr.html=0

 /org.eclipse.wst.xsdeditor.doc.user/topics/taddagrp.html=0

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/index/segments b/docs/org.eclipse.wst.xsdeditor.doc.user/index/segments
index 19b5d0c..66564c5 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/index/segments
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/index/segments
Binary files differ
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/myplugin.xml b/docs/org.eclipse.wst.xsdeditor.doc.user/myplugin.xml
index 2e1bd94..737c5cd 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/myplugin.xml
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/myplugin.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
+<?eclipse version="3.6"?>
 <?NLS TYPE="org.eclipse.help.toc"?>
 <!-- /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -27,4 +27,5 @@
 	<extension point="org.eclipse.help.index">
       <index file="org.eclipse.wst.xsdeditor.doc.userindex.xml"/>
 </extension>
+
 </plugin>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/org.eclipse.wst.xsdeditor.doc.userindex.xml b/docs/org.eclipse.wst.xsdeditor.doc.user/org.eclipse.wst.xsdeditor.doc.userindex.xml
index f143942..4cdd883 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/org.eclipse.wst.xsdeditor.doc.userindex.xml
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/org.eclipse.wst.xsdeditor.doc.userindex.xml
@@ -69,7 +69,7 @@
     </entry>
   </entry>
   <entry keyword="dependent artifacts">
-    <entry keyword="refactorting XML schema files">
+    <entry keyword="refactoring XML schema files">
       <topic href="topics/trefactrXSD.html#refactoring" title="Refactoring in XML Schema Files"/>
     </entry>
   </entry>
@@ -83,7 +83,7 @@
       <topic href="topics/trefactrXSD.html#refactoring" title="Refactoring in XML Schema Files"/>
     </entry>
   </entry>
-  <entry keyword="XML schemas">
+  <entry keyword="schemas">
     <entry keyword="editing">
       <topic href="topics/trefactrXSD.html#refactoring" title="Refactoring in XML Schema Files"/>
     </entry>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/plugin.properties b/docs/org.eclipse.wst.xsdeditor.doc.user/plugin.properties
index 4b1a11a1..81da418 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/plugin.properties
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/plugin.properties
@@ -1,3 +1,5 @@
+# NLS_MESSAGEFORMAT_VAR 
+# NLS_ENCODING=UTF-8 
 Plugin.name = XML schema editor
 
-Bundle-Vendor.0 = Eclipse.org
\ No newline at end of file
+Bundle-Vendor.0 = Eclipse Web Tools Platform
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/plugin.xml b/docs/org.eclipse.wst.xsdeditor.doc.user/plugin.xml
index 2e1bd94..737c5cd 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/plugin.xml
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/plugin.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
+<?eclipse version="3.6"?>
 <?NLS TYPE="org.eclipse.help.toc"?>
 <!-- /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -27,4 +27,5 @@
 	<extension point="org.eclipse.help.index">
       <index file="org.eclipse.wst.xsdeditor.doc.userindex.xml"/>
 </extension>
+
 </plugin>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cworkXSD.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cworkXSD.html
index 45f35b6..558def2 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cworkXSD.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cworkXSD.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -42,7 +42,7 @@
 <div><div class="reltasks"><strong>Related tasks</strong><br />
 <div><a href="tcxmlsch.html" title="You can create an XML schema and then edit it using the XML schema editor. Using the XML schema editor, you can specify element names that indicates which elements are allowed in an XML file, and in which combinations.">Creating XML schemas</a></div>
 <div><a href="timpschm.html" title="If you want to work with XML schema files that you created outside of the product, you can import them into the workbench and open them in the XML schema editor. The XML schema editor provides you with a structured view of the XML schema.">Importing XML schemas</a></div>
-<div><a href="tnavsrc.html" title="When you are working in the Source view, you can use F3 to navigate through the file by placing your cursor in the appropriate item and clicking F3 to jump to the item it refers to.">Navigating XML schemas</a></div>
+<div><a href="tnavsrc.html" title="When you are working in the Source view, you can use F3 to navigate through the file by placing your cursor in the appropriate item and pressing F3 to jump to the item it refers to.">Navigating XML schemas</a></div>
 <div><a href="trefactrXSD.html" title="Within an XML Schema file, refactoring allows authors to make a single artifact change, and have that change implemented throughout all other dependant artifacts.">Refactoring in XML schemas</a></div>
 <div><a href="tedtpref.html" title="You can set various preferences for XML schema files such as the default target namespace and XML Schema language constructs prefix used.">Editing XML schema file preferences</a></div>
 <div><a href="tdelscmp.html" title="If you have created any XML schema components you no longer need, you can delete them.">Deleting XML schema components</a></div>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cxmlsced.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cxmlsced.dita
index 9b3ad30..edaab3f 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cxmlsced.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cxmlsced.dita
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"

  "concept.dtd">

 <concept id="cxmlsced" xml:lang="en-us">

@@ -8,18 +8,18 @@
 <searchtitle>XML schema editor</searchtitle>

 </titlealts>

 <shortdesc>This product provides an XML schema editor for creating, viewing,

-and validating XML schemas. XML schemas are a formal specification

-of element names that indicates which elements are allowed in an XML file,

-and in which combinations. </shortdesc>

+and validating XML schemas. XML schemas are a formal specification of element

+names that indicates which elements are allowed in an XML file, and in which

+combinations. </shortdesc>

 <prolog><metadata>

 <keywords><indexterm>XML schema editor<indexterm>overview</indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <conbody>

-<p>A schema is functionally equivalent to a DTD, but is written in XML; a

-schema also provides for extended functionality such as data typing, inheritance,

+<p>A schema is functionally equivalent to a DTD, but is written in XML. A

+schema also provides extended functionality such as data typing, inheritance,

 and presentation rules.</p>

-<p>For more information on XML schema, refer to:</p>

+<p>For more information on XML schema, see the following:</p>

 <ul>

 <li> <xref format="html" href="http://www.w3.org/TR/xmlschema-0/" scope="external">http://www.w3.org/TR/xmlschema-0/</xref> </li>

 <li> <xref format="html" href="http://www.w3.org/TR/xmlschema-1/" scope="external">http://www.w3.org/TR/xmlschema-1/</xref> </li>

@@ -49,8 +49,9 @@
 <li> (Source view only) <uicontrol>Smart Insert</uicontrol> or <uicontrol>Overwrite</uicontrol>.

 To toggle between these modes, press the <uicontrol>Insert</uicontrol> button

 on your keyboard.</li>

-<li> <uicontrol>Line</uicontrol> and <uicontrol>column</uicontrol> number. </li>

+<li> Line and column number (displayed in the format <?Pub Caret?><userinput>column

+# : line #</userinput>)</li>

 </ul></section>

 </conbody>

 </concept>

-<?Pub *0000002883?>

+<?Pub *0000002906?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cxmlsced.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cxmlsced.html
index 869ad39..d6a9914 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cxmlsced.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/cxmlsced.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -31,15 +31,15 @@
 
 
 <div><p>This product provides an XML schema editor for creating, viewing,
-and validating XML schemas. XML schemas are a formal specification
-of element names that indicates which elements are allowed in an XML file,
-and in which combinations. </p>
+and validating XML schemas. XML schemas are a formal specification of element
+names that indicates which elements are allowed in an XML file, and in which
+combinations. </p>
 
-<p>A schema is functionally equivalent to a DTD, but is written in XML; a
-schema also provides for extended functionality such as data typing, inheritance,
+<p>A schema is functionally equivalent to a DTD, but is written in XML. A
+schema also provides extended functionality such as data typing, inheritance,
 and presentation rules.</p>
 
-<p>For more information on XML schema, refer to:</p>
+<p>For more information on XML schema, see the following:</p>
 
 <ul>
 <li> <a href="http://www.w3.org/TR/xmlschema-0/" target="_blank">http://www.w3.org/TR/xmlschema-0/</a> </li>
@@ -90,7 +90,8 @@
 To toggle between these modes, press the <span class="uicontrol">Insert</span> button
 on your keyboard.</li>
 
-<li> <span class="uicontrol">Line</span> and <span class="uicontrol">column</span> number. </li>
+<li> Line and column number (displayed in the format <kbd class="userinput">column
+# : line #</kbd>)</li>
 
 </ul>
 </div>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rlimitations_slushXSD.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rlimitations_slushXSD.html
index 1a5cc54..142fc28 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rlimitations_slushXSD.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rlimitations_slushXSD.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.dita
index 0237e98..909a463 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.dita
@@ -1,58 +1,62 @@
-<?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

-<!DOCTYPE reference  PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">

+<?xml version="1.0" encoding="UTF-8"?>

+<!--Arbortext, Inc., 1988-2008, v.4002-->

+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"

+ "reference.dtd">

+<?Pub Sty _display FontColor="red"?>

 <reference id="rnmspc" xml:lang="en-us">

 <title>XML namespaces</title>

 <titlealts>

 <searchtitle>XML namespaces</searchtitle>

 </titlealts>

-<shortdesc>An XML namespace is a collection of names, identified by a URI

-reference, which are used in XML documents as element types and attribute

-names.</shortdesc>

+<shortdesc>An XML namespace is a collection of names, identified by

+a URI reference, which are used in XML documents as element types

+and attribute names.</shortdesc>

 <prolog><metadata>

 <keywords><indexterm>XML namespaces<indexterm>overview</indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <refbody>

-<section>XML namespaces are defined by a W3C recommendation, dating 14 January

-1999, called <xref format="html" href="http://www.w3.org/TR/REC-xml-names/"

-scope="external">Namespaces in XML</xref>. XML tag names should be globally

-unique, as well as short for performance reasons. In order to resolve this

-conflict, the W3C namespace recommendation defines an attribute <b>xmlns</b> which

-can amend any XML element. If it is present in an element, it identifies the

-namespace for this element.</section>

-<section><p>The xmlns attribute has the following syntax:</p><p><codeph>xmlns:<varname>prefix</varname>=namespace</codeph> </p><p>where <codeph>namespace</codeph

-> is a unique URI (such as www.ibm.com) and where <codeph><varname>prefix</varname></codeph> represents

-the namespace and provides a pointer to it.</p><p>In the following customer

-element definition, an accounting namespace is defined in order to be able

-to distinguish the element tags from those appearing in customer records created

-by other business applications:</p><p><codeblock>&lt;acct:customer xmlns:acct="http://www.my.com/acct-REV10">

+<section>XML namespaces are defined by a W3C recommendation, dating

+16 August 2006, called <xref format="html"

+href="http://www.w3.org/TR/2006/REC-xml-names-20060816/" scope="external">Namespaces

+in XML</xref>. XML tag names should be globally unique, as well as

+short for performance reasons. In order to resolve this conflict,

+the W3C namespace recommendation defines an attribute <b>xmlns</b> which

+can amend any XML element. If it is present in an element, it identifies

+the namespace for this element.</section>

+<section><p>The xmlns attribute has the following syntax:</p><p><codeph>xmlns:<varname>prefix</varname>=namespace</codeph> </p><p>where <codeph>namespace</codeph> is

+a unique URI (such as www.ibm.com) and where <codeph><varname>prefix</varname></codeph> represents

+the namespace and provides a pointer to it.</p><p>In the following

+customer element definition, an accounting namespace is defined in

+order to be able to distinguish the element tags from those appearing

+in customer records created by other business applications:</p><p><codeblock>&lt;acct:customer xmlns:acct="http://www.my.com/acct-REV10">

 	&lt;acct:name>Corporation&lt;/acct:name>

 	&lt;acct:order acct:ref="5566"/>

 	&lt;acct:status>invoice&lt;/acct:status>

-&lt;/acct:customer>  </codeblock> </p><p>The <i>namespace definition</i> in

-the first line assigns the namespace <i>http://www.my.com/acct-REV10</i> to

-the prefix. This prefix is used on the element names such as name in order

-to attach them to the namespace. A second application, for example, a fulfillment

-system, can assign a different namespace to its customer elements:</p><p><codeblock>&lt;ful:customer xmlns:ful="http://www.your.com/ful">

+&lt;/acct:customer>  </codeblock> </p><p>The namespace definition

+in the first line assigns the namespace http://www.my.com/acct-REV10

+to the prefix. This prefix is used on the element names such as name

+in order to attach them to the namespace. A second application, for

+example, a fulfillment system, can assign a different namespace to

+its customer elements:</p><p><codeblock>&lt;ful:customer xmlns:ful="http://www.your.com/ful">

 	&lt;ful:name>Corporation&lt;/ful:name>

 	&lt;ful:order ful:ref="A98756"/>

 	&lt;ful:status>shipped&lt;/ful:status>

- &lt;/ful:customer></codeblock> </p><p>An application processing both data

-structures is now able to treat the accounting and the fulfillment data differently.

-There is a default namespace. It is set if no local name is assigned in the

-namespace definition:</p><p><codeblock>&lt;acct:customer xmlns="http://www.my.com/acct-REV10" xmlns:acct="http://www.my.com/acct-REV10 ">

+ &lt;/ful:customer></codeblock> </p><p>An application processing both

+data structures is now able to treat the accounting and the fulfillment

+data differently. There is a default namespace. It is set if no local

+name is assigned in the namespace definition:</p><p><codeblock>&lt;acct:customer xmlns="http://www.my.com/acct-REV10" xmlns:acct="http://www.my.com/acct-REV10 ">

 &lt;name>Corporation&lt;/name>

 &lt;order acct:ref="5566"/>

 &lt;status>invoice&lt;/status>

-&lt;/customer></codeblock></p><p>In this example, all tags in the customer

-record are qualified to reside in the namespace <i>http://www.my.com/acct-REV10.</i> No

-explicit prefix is needed because the default namespace is used. Note that

-the default namespace applies to any attributes definitions.</p></section>

-<section><title>XML schemas and namespaces</title><p>In the following XML

-schema, the default namespace for the schema is defined as the standard XML

-schema namespace <i>http://www.w3.org/2001/XMLSchem</i>a; there is also a

-schema specific namespace <i>http://www.ibm.com</i>.</p><p><codeblock>&lt;?xml version="1.0"?>

+&lt;/customer></codeblock></p><p>In this example, all tags in the

+customer record are qualified to reside in the namespace http://www.my.com/acct-REV10.

+No explicit prefix is needed because the default namespace is used.

+Note that the default namespace applies to any attributes definitions.</p></section>

+<section><title>XML schemas and namespaces</title><p>In the following

+XML schema, the default namespace for the schema is defined as the

+standard XML schema namespace http://www.w3.org/2001/XMLSchema; there

+is also a schema specific namespace http://www.ibm.com.</p><p><codeblock>&lt;?xml version="1.0"?>

 &lt;schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com" xmlns:TestSchema="http://www.ibm.com">

  &lt;simpleType name="ZipCodeType">

  &lt;restriction base="integer">

@@ -61,9 +65,9 @@
 &lt;/restriction>

  &lt;/simpleType> 

  &lt;!--element definitions skipped -->  

-&lt;/schema>  </codeblock></p><p>Assuming that the preceding XML schema is

-saved as <filepath>C:\temp\TestSchema.xsd</filepath>, a sample XML file that

-validates against this schema is:</p><p><codeblock>&lt;?xml version="1.0"?>

+&lt;/schema>  </codeblock></p><p>Assuming that the preceding XML schema

+is saved as <filepath>C:\temp\TestSchema.xsd</filepath>, a sample

+XML file that validates against this schema is:</p><p><codeblock>&lt;?xml version="1.0"?>

 &lt;x:addressList xmlns:x="http://www.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://www.ibm.com file:///C:/temp/TestSchema.xsd">

  xsi:schemaLocation="http://www.ibm.com file:///C:/temp/TestSchema.xsd">

 &lt;x:address>

@@ -77,20 +81,21 @@
      &lt;x:city>x:San Jose&lt;/x:city>

  &lt;/x:address>

 &lt;/x:addressList> </codeblock></p></section>

-<section><title>Target namespace</title><p> The target namespace serves to

-identify the namespace within which the association between the element and

-its name exists. In the case of declarations, this association determines

-the namespace of the elements in XML files conforming to the schema. An XML

-file importing a schema must reference its target namespace in the schemaLocation

-attribute. Any mismatches between the target and the actual namespace of an

-element are reported as schema validation errors. In our example, the target

-namespace is http://www.ibm.com; it is defined in the  XML schema file and

-referenced twice in the XML file. Any mismatch between these three occurrences

+<section><title>Target namespace</title><p> The target namespace serves

+to identify the namespace within which the association between the

+element and its name exists. In the case of declarations, this association

+determines the namespace of the elements in XML files conforming to

+the schema. An XML file importing a schema must reference its target

+namespace in the schemaLocation attribute. Any mismatches between

+the target and the actual namespace of an element are reported as

+schema validation errors. In our example, the target namespace is

+http://www.ibm.com; it is defined in the  XML schema file and referenced

+twice in the XML file. Any mismatch between these three occurrences

 of the namespace lead to validation errors.</p><p> The following examples

-show how target namespaces and namespace prefixes work in XML schemas and

-their corresponding XML instance documents.</p></section>

-<section><title>Sample 1 - A schema with both a default and target namespace

-and unqualified locals</title><p>The XML schema:  </p><p><codeblock>&lt;?xml version="1.0"?>

+show how target namespaces and namespace prefixes work in XML schemas

+and their corresponding XML instance documents.</p></section>

+<section><title>Sample 1 - A schema with both a default and target

+namespace and unqualified locals</title><p>The XML schema:  </p><p><codeblock>&lt;?xml version="1.0"?>

 &lt;schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com" xmlns:x="http://www.ibm.com">

 &lt;complexType name="AddressType">

 &lt;sequence>

@@ -98,17 +103,19 @@
 &lt;/sequence>

 &lt;/complexType>

 &lt;element name="MyAddress" type="x:AddressType">&lt;/element>

-&lt;/schema> </codeblock> </p><p>A valid XML instance document created from

-this schema looks like this. Local elements and attributes are <i>unqualified</i>.</p><p><codeblock>&lt;?xml version="1.0"?>

+&lt;/schema> </codeblock> </p><p>A valid XML instance document created

+from this schema looks like this. Local elements and attributes are

+unqualified.</p><p><codeblock>&lt;?xml version="1.0"?>

 &lt;x:MyAddress xmlns:x="http://www.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com x.xsd ">

 &lt;name>Peter Smith&lt;/name>

-&lt;/x:MyAddress> </codeblock></p><p>When local elements (such as the <i>"name"</i> element)

-and attributes are unqualified in an XML file, then only the root element

-is qualified. So, in this example, the <i>"x"</i> namespace prefix is assigned

-to the root element <i>"MyAddress"</i>, associating it with the namespace <i>"http://www.ibm.com",</i> but

-the<i>"x"</i> prefix is not assigned to the local element <i>"name"</i>.</p></section>

-<section><title>Sample 2 - A schema with both a default and target namespace

-and qualified locals</title><p><codeblock>&lt;?xml version="1.0"?>

+&lt;/x:MyAddress> </codeblock></p><p>When local elements (such as

+the "name" element) and attributes are unqualified in an XML file,

+then only the root element is qualified. So, in this example, the

+"x" namespace prefix is assigned to the root element "MyAddress",

+associating it with the namespace "http://www.ibm.com", but the"x"

+prefix is not assigned to the local element "name".</p></section>

+<section><title>Sample 2 - A schema with both a default and target

+namespace and qualified locals</title><p><codeblock>&lt;?xml version="1.0"?>

 &lt;schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com" xmlns:x="http://www.ibm.com" elementFormDefault="qualified">

 &lt;complexType name="AddressType">

 &lt;sequence>

@@ -116,27 +123,27 @@
 &lt;/sequence>

 &lt;/complexType>

 &lt;element name="MyAddress" type="x:AddressType">&lt;/element>

- &lt;/schema>  </codeblock></p><p>A valid XML instance document created from

-this schema looks like this. Local elements and attributes are <i>qualified</i> This

-is because the elementFormDefault attribute is set to qualified in the XML

-schema.</p><p><codeblock>&lt;?xml version="1.0"?>

+ &lt;/schema>  </codeblock></p><p>A valid XML instance document created

+from this schema looks like this. Local elements and attributes are

+qualified This is because the elementFormDefault attribute is set

+to qualified in the XML schema.</p><p><codeblock>&lt;?xml version="1.0"?>

   &lt;x:MyAddress xmlns:x="http://www.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

  xsi:schemaLocation="http://www.ibm.com x.xsd "> 

 &lt;x:name>Peter Smith&lt;/x:name>

- &lt;/x:MyAddress></codeblock> </p><p>In this example, the <i>"x"</i> namespace

-prefix is assigned to both the root element <i>"MyAddress"</i> and the local

-element <i>"name"</i>, associating them with the namespace <i>"http://www.ibm.com",</i>.</p></section>

-<section><title>Sample 3 - Schema with target Namespace, and explicitly defines

-xmlns:xsd</title><p>This XML schema adds this attribute:  </p><codeph>xmlns:xsd="http://www.w3.org/2001/XMLSchema </codeph><p>What

-this means is that each of the constructs that are defined by the XML schema

-language will need to be qualified with the <varname>"xsd"</varname> prefix.

-For example, xsd:complexType and  xsd:string</p><p>. Note that you can chose

-any other prefixes such as <varname>"xs"</varname> or <varname>"foobar"</varname> in

-your declaration and usage.</p><p>You can specify this prefix in the XML schema

-preferences page. For more information, refer to the related tasks.</p><p>All

-user defined types belong to the namespace  http://www.ibm.com as defined

-by the targetNamespace attribute, and the prefix is <i>"x"</i> as defined

-by the xmlns:x attribute.</p><p><codeblock>&lt;?xml version="1.0"?>

+ &lt;/x:MyAddress></codeblock> </p><p>In this example, the "x" namespace

+prefix is assigned to both the root element "MyAddress" and the local

+element "name", associating them with the namespace "http://www.ibm.com",.</p></section>

+<section><title>Sample 3 - Schema with target Namespace, and explicitly

+defines xmlns:xsd</title><p>This XML schema adds this attribute:  </p><codeph>xmlns:xsd="http://www.w3.org/2001/XMLSchema </codeph><p>What

+this means is that each of the constructs that are defined by the

+XML schema language will need to be qualified with the "xsd" prefix.

+For example, xsd:complexType and  xsd:string</p><p>. Note that you

+can chose any other prefixes such as "xs" or "foobar" in your declaration

+and usage.</p><p>You can specify this prefix in the XML schema preferences

+page. For more information, refer to the related tasks.</p><p>All

+user defined types belong to the namespace  http://www.ibm.com as

+defined by the targetNamespace attribute, and the prefix is "x" as

+defined by the xmlns:x attribute.</p><p><codeblock>&lt;?xml version="1.0"?>

 &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com" xmlns:x="http://www.ibm.com">

 &lt;xsd:complexType name="AddressType">

 &lt;xsd:sequence>

@@ -144,18 +151,20 @@
 &lt;/xsd:sequence>

  &lt;/xsd:complexType>

  &lt;xsd:element name="MyAddress" type="x:AddressType">&lt;/xsd:element>

-&lt;/xsd:schema></codeblock> </p><p>A valid XML instance document created

-from this schema looks like this. Local elements and attributes are <i>unqualified</i>.

-The semantics of qualification is the same as Sample 1.</p><p><codeblock>&lt;?xml version="1.0"?>

+&lt;/xsd:schema></codeblock> </p><p>A valid XML instance document

+created from this schema looks like this. Local elements and attributes

+are unqualified. The semantics of qualification is the same as Sample

+1.</p><p><codeblock>&lt;?xml version="1.0"?>

  &lt;x:MyAddress xmlns:x="http://www.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.ibm.com x.xsd ">

 &lt;name>Peter Smith&lt;/name>

  &lt;/x:MyAddress></codeblock></p></section>

-<section><title>Sample 4 - Schema with undeclared target Namespace that explicitly

-defines xmlns:xsd</title><p>This XML schema has no target namespace for itself.

-In this case, it is highly recommended that all XML schema constructs be explicitly

-qualified with a prefix such as <i>"xsd"</i>. The definitions and declarations

-from this schema such as <i>AddressType</i> are referenced without namespace

-qualification since there is no namespace prefix.  </p><p><codeblock>&lt;?xml version="1.0"?>

+<section><title>Sample 4 - Schema with undeclared target Namespace

+that explicitly defines xmlns:xsd</title><p>This XML schema has no

+target namespace for itself. In this case, it is highly recommended

+that all XML schema constructs be explicitly qualified with a prefix

+such as "xsd". The definitions and declarations from this schema such

+as AddressType are referenced without namespace qualification since

+there is no namespace prefix.  </p><p><codeblock>&lt;?xml version="1.0"?>

 &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

 &lt;xsd:complexType name="AddressType">

 &lt;xsd:sequence>

@@ -165,14 +174,15 @@
 &lt;/xsd:sequence> 

 &lt;/xsd:complexType>

 &lt;xsd:element name="MyAddress" type="AddressType">&lt;/xsd:element> 

-&lt;/xsd:schema> </codeblock></p><p>A valid XML instance document created

-from the schema looks like this. All elements are <i>unqualified</i>.</p><p><codeblock>&lt;?xml version="1.0"?>

+&lt;/xsd:schema> </codeblock></p><p>A valid XML instance document

+created from the schema looks like this. All elements are unqualified.</p><p><codeblock>&lt;?xml version="1.0"?>

 &lt;MyAddress xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="x.xsd">

 &lt;name>name&lt;/name>

 &lt;/MyAddress></codeblock>  </p></section>

-<section><title>Sample 5 - A schema where the target namespace is the default

-namespace</title><p>This is an XML schema where the target namespace is the

-default namespace. As well, the namespace has no namespace prefix.</p><p><codeblock>&lt;?xml version="1.0"?>

+<section><title>Sample 5 - A schema where the target namespace is

+the default namespace</title><p>This is an XML schema where the target

+namespace is the default namespace. As well, the namespace has no

+namespace prefix.</p><p><codeblock>&lt;?xml version="1.0"?>

  &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com" xmlns="http://www.ibm.com">

 &lt;xsd:complexType name="AddressType">

 &lt;xsd:sequence>

@@ -180,10 +190,11 @@
 &lt;/xsd:sequence>

 &lt;/xsd:complexType>

  &lt;xsd:element name="MyAddress" type="AddressType">&lt;/xsd:element>

- &lt;/xsd:schema> </codeblock> </p><p>A valid XML instance document created

-from the schema looks like this:</p><p><codeblock>&lt;?xml version="1.0" encoding="UTF-8"?>

+ &lt;/xsd:schema> </codeblock> </p><p>A valid XML instance document

+created from the schema looks like this:</p><p><codeblock>&lt;?xml version="1.0" encoding="UTF-8"?>

 &lt;MyAddress xmlns="http://www.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com NewXMLSchema.xsd">

 &lt;name>name&lt;/name>

  &lt;/MyAddress>  </codeblock> </p></section>

 </refbody>

-</reference>

+</reference><?Pub Caret?>

+<?Pub *0000012038?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.html
index f4a0b4f..1e81024 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rnmspc.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -13,6 +13,7 @@
 <meta name="description" content="An XML namespace is a collection of names, identified by a URI reference, which are used in XML documents as element types and attribute names." />
 <meta content="XML namespaces, overview" name="DC.subject" />
 <meta content="XML namespaces, overview" name="keywords" />
+<meta scheme="URI" name="DC.Relation" content="../topics/tedtpref.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="rnmspc" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -31,8 +32,8 @@
 reference, which are used in XML documents as element types and attribute
 names.</p>
 
-<div class="section">XML namespaces are defined by a W3C recommendation, dating 14 January
-1999, called <a href="http://www.w3.org/TR/REC-xml-names/" target="_blank">Namespaces in XML</a>. XML tag names should be globally
+<div class="section">XML namespaces are defined by a W3C recommendation, dating 16 August
+2006, called <a href="http://www.w3.org/TR/2006/REC-xml-names-20060816/" target="_blank">Namespaces in XML</a>. XML tag names should be globally
 unique, as well as short for performance reasons. In order to resolve this
 conflict, the W3C namespace recommendation defines an attribute <strong>xmlns</strong> which
 can amend any XML element. If it is present in an element, it identifies the
@@ -52,11 +53,11 @@
 	&lt;acct:status&gt;invoice&lt;/acct:status&gt;
 &lt;/acct:customer&gt;  </pre>
  </div>
-<p>The <em>namespace definition</em> in
-the first line assigns the namespace <em>http://www.my.com/acct-REV10</em> to
-the prefix. This prefix is used on the element names such as name in order
-to attach them to the namespace. A second application, for example, a fulfillment
-system, can assign a different namespace to its customer elements:</p>
+<p>The namespace definition in the first
+line assigns the namespace http://www.my.com/acct-REV10 to the prefix. This
+prefix is used on the element names such as name in order to attach them to
+the namespace. A second application, for example, a fulfillment system, can
+assign a different namespace to its customer elements:</p>
 <div class="p"><pre>&lt;ful:customer xmlns:ful="http://www.your.com/ful"&gt;
 	&lt;ful:name&gt;Corporation&lt;/ful:name&gt;
 	&lt;ful:order ful:ref="A98756"/&gt;
@@ -74,15 +75,15 @@
 &lt;/customer&gt;</pre>
 </div>
 <p>In this example, all tags in the customer
-record are qualified to reside in the namespace <em>http://www.my.com/acct-REV10.</em> No
-explicit prefix is needed because the default namespace is used. Note that
+record are qualified to reside in the namespace http://www.my.com/acct-REV10.
+No explicit prefix is needed because the default namespace is used. Note that
 the default namespace applies to any attributes definitions.</p>
 </div>
 
 <div class="section"><h4 class="sectiontitle">XML schemas and namespaces</h4><p>In the following XML
 schema, the default namespace for the schema is defined as the standard XML
-schema namespace <em>http://www.w3.org/2001/XMLSchem</em>a; there is also a
-schema specific namespace <em>http://www.ibm.com</em>.</p>
+schema namespace http://www.w3.org/2001/XMLSchema; there is also a schema
+specific namespace http://www.ibm.com.</p>
 <div class="p"><pre>&lt;?xml version="1.0"?&gt;
 &lt;schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com" xmlns:TestSchema="http://www.ibm.com"&gt;
  &lt;simpleType name="ZipCodeType"&gt;
@@ -142,17 +143,17 @@
 &lt;/schema&gt; </pre>
  </div>
 <p>A valid XML instance document created from
-this schema looks like this. Local elements and attributes are <em>unqualified</em>.</p>
+this schema looks like this. Local elements and attributes are unqualified.</p>
 <div class="p"><pre>&lt;?xml version="1.0"?&gt;
 &lt;x:MyAddress xmlns:x="http://www.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com x.xsd "&gt;
 &lt;name&gt;Peter Smith&lt;/name&gt;
 &lt;/x:MyAddress&gt; </pre>
 </div>
-<p>When local elements (such as the <em>"name"</em> element)
-and attributes are unqualified in an XML file, then only the root element
-is qualified. So, in this example, the <em>"x"</em> namespace prefix is assigned
-to the root element <em>"MyAddress"</em>, associating it with the namespace <em>"http://www.ibm.com",</em> but
-the<em>"x"</em> prefix is not assigned to the local element <em>"name"</em>.</p>
+<p>When local elements (such as the "name"
+element) and attributes are unqualified in an XML file, then only the root
+element is qualified. So, in this example, the "x" namespace prefix is assigned
+to the root element "MyAddress", associating it with the namespace "http://www.ibm.com",
+but the"x" prefix is not assigned to the local element "name".</p>
 </div>
 
 <div class="section"><h4 class="sectiontitle">Sample 2 - A schema with both a default and target namespace
@@ -167,7 +168,7 @@
  &lt;/schema&gt;  </pre>
 </div>
 <p>A valid XML instance document created from
-this schema looks like this. Local elements and attributes are <em>qualified</em> This
+this schema looks like this. Local elements and attributes are qualified This
 is because the elementFormDefault attribute is set to qualified in the XML
 schema.</p>
 <div class="p"><pre>&lt;?xml version="1.0"?&gt;
@@ -176,25 +177,24 @@
 &lt;x:name&gt;Peter Smith&lt;/x:name&gt;
  &lt;/x:MyAddress&gt;</pre>
  </div>
-<p>In this example, the <em>"x"</em> namespace
-prefix is assigned to both the root element <em>"MyAddress"</em> and the local
-element <em>"name"</em>, associating them with the namespace <em>"http://www.ibm.com",</em>.</p>
+<p>In this example, the "x" namespace prefix
+is assigned to both the root element "MyAddress" and the local element "name",
+associating them with the namespace "http://www.ibm.com",.</p>
 </div>
 
 <div class="section"><h4 class="sectiontitle">Sample 3 - Schema with target Namespace, and explicitly defines
 xmlns:xsd</h4><p>This XML schema adds this attribute:  </p>
 <samp class="codeph">xmlns:xsd="http://www.w3.org/2001/XMLSchema </samp><p>What
 this means is that each of the constructs that are defined by the XML schema
-language will need to be qualified with the <var class="varname">"xsd"</var> prefix.
-For example, xsd:complexType and  xsd:string</p>
-<p>. Note that you can chose
-any other prefixes such as <var class="varname">"xs"</var> or <var class="varname">"foobar"</var> in
-your declaration and usage.</p>
-<p>You can specify this prefix in the XML schema
-preferences page. For more information, refer to the related tasks.</p>
-<p>All
-user defined types belong to the namespace  http://www.ibm.com as defined
-by the targetNamespace attribute, and the prefix is <em>"x"</em> as defined
+language will need to be qualified with the "xsd" prefix. For example, xsd:complexType
+and  xsd:string</p>
+<p>. Note that you can chose any other prefixes such as
+"xs" or "foobar" in your declaration and usage.</p>
+<p>You can specify this
+prefix in the XML schema preferences page. For more information, refer to
+the related tasks.</p>
+<p>All user defined types belong to the namespace  http://www.ibm.com
+as defined by the targetNamespace attribute, and the prefix is "x" as defined
 by the xmlns:x attribute.</p>
 <div class="p"><pre>&lt;?xml version="1.0"?&gt;
 &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com" xmlns:x="http://www.ibm.com"&gt;
@@ -207,7 +207,7 @@
 &lt;/xsd:schema&gt;</pre>
  </div>
 <p>A valid XML instance document created
-from this schema looks like this. Local elements and attributes are <em>unqualified</em>.
+from this schema looks like this. Local elements and attributes are unqualified.
 The semantics of qualification is the same as Sample 1.</p>
 <div class="p"><pre>&lt;?xml version="1.0"?&gt;
  &lt;x:MyAddress xmlns:x="http://www.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.ibm.com x.xsd "&gt;
@@ -219,9 +219,9 @@
 <div class="section"><h4 class="sectiontitle">Sample 4 - Schema with undeclared target Namespace that explicitly
 defines xmlns:xsd</h4><p>This XML schema has no target namespace for itself.
 In this case, it is highly recommended that all XML schema constructs be explicitly
-qualified with a prefix such as <em>"xsd"</em>. The definitions and declarations
-from this schema such as <em>AddressType</em> are referenced without namespace
-qualification since there is no namespace prefix.  </p>
+qualified with a prefix such as "xsd". The definitions and declarations from
+this schema such as AddressType are referenced without namespace qualification
+since there is no namespace prefix.  </p>
 <div class="p"><pre>&lt;?xml version="1.0"?&gt;
 &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
 &lt;xsd:complexType name="AddressType"&gt;
@@ -235,7 +235,7 @@
 &lt;/xsd:schema&gt; </pre>
 </div>
 <p>A valid XML instance document created
-from the schema looks like this. All elements are <em>unqualified</em>.</p>
+from the schema looks like this. All elements are unqualified.</p>
 <div class="p"><pre>&lt;?xml version="1.0"?&gt;
 &lt;MyAddress xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="x.xsd"&gt;
 &lt;name&gt;name&lt;/name&gt;
@@ -267,6 +267,10 @@
 
 </div>
 
+<div><div class="reltasks"><strong>Related tasks</strong><br />
+<div><a href="../topics/tedtpref.html" title="You can set various preferences for XML schema files such as the default target namespace and XML Schema language constructs prefix used.">Editing XML schema file preferences</a></div>
+</div>
+</div>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rrefintg.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rrefintg.dita
index 97d9893..812b302 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rrefintg.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rrefintg.dita
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

-<!DOCTYPE reference  PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">

+<!--Arbortext, Inc., 1988-2006, v.4002-->

+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"

+ "reference.dtd">

 <reference id="rrefintg" xml:lang="en-us">

 <title>Referential integrity in the XML schema editor</title>

 <titlealts>

@@ -20,7 +21,7 @@
  &lt;element name="comment" type="string">

 	&lt;complexType name="Items">

 		&lt;sequence>

-				&lt;element ref="comment">

+<?Pub Caret?>				&lt;element ref="comment">

 		 &lt;/sequence>

 	 &lt;/complexType>

 &lt;/schema></codeblock></p><p>If the global element (comment) was deleted,

@@ -34,11 +35,12 @@
 <section><title>Deleting included and imported schema</title><p>If an included

 or imported schema is deleted, you must manually reset the following type

 references as appropriate: <ul>

-<li>Global element and element's type</li>

-<li>Attribute type</li>

-<li>Complex type derivation</li>

-<li>Simple type derivation </li>

+<li>Global element and element's type.</li>

+<li>Attribute type.</li>

+<li>Complex type derivation.</li>

+<li>Simple type derivation.</li>

 </ul>They will not automatically be reset if an included or imported schema

 is deleted.</p></section>

 </refbody>

 </reference>

+<?Pub *0000002046?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rrefintg.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rrefintg.html
index e319a3b..1d7b42d 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rrefintg.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rrefintg.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -60,13 +60,13 @@
 <div class="section"><h4 class="sectiontitle">Deleting included and imported schema</h4><div class="p">If an included
 or imported schema is deleted, you must manually reset the following type
 references as appropriate: <ul>
-<li>Global element and element's type</li>
+<li>Global element and element's type.</li>
 
-<li>Attribute type</li>
+<li>Attribute type.</li>
 
-<li>Complex type derivation</li>
+<li>Complex type derivation.</li>
 
-<li>Simple type derivation </li>
+<li>Simple type derivation.</li>
 
 </ul>
 They will not automatically be reset if an included or imported schema
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rxsdicons.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rxsdicons.html
index 92f68a6..b6cce03 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rxsdicons.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/rxsdicons.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Icons used in the XML schema editor" />
 <meta name="abstract" content="The following XML schema editor icons appear in the Outline, Design, and Properties view." />
 <meta name="description" content="The following XML schema editor icons appear in the Outline, Design, and Properties view." />
-<meta content="XML schema editor, icons, Icons" name="DC.subject" />
-<meta content="XML schema editor, icons, Icons" name="keywords" />
+<meta content="XML schema editor, icons" name="DC.subject" />
+<meta content="XML schema editor, icons" name="keywords" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="ricons" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddagrp.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddagrp.dita
index 336ae4e..ad61517 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddagrp.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddagrp.dita
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<?xml version="1.0" encoding="UTF-8"?>

+<!--Arbortext, Inc., 1988-2008, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <task id="taddagrp" xml:lang="en-us">

@@ -7,94 +7,100 @@
 <titlealts>

 <searchtitle>Adding attribute groups</searchtitle>

 </titlealts>

-<shortdesc>An attribute group definition is an association between a name

-and a set of attribute declarations. Named groups of attribute declarations

-can greatly facilitate the maintenance and reuse of common attribute declarations

-in an XML schema.</shortdesc>

+<shortdesc>An attribute group definition is an association between

+a name and a set of attribute declarations. Named groups of attribute

+declarations can greatly facilitate the maintenance and reuse of common

+attribute declarations in an XML schema.</shortdesc>

 <prolog><metadata>

 <keywords><indexterm>XML schema editor<indexterm>attribute groups</indexterm></indexterm>

 <indexterm>XML schema files<indexterm>attribute groups</indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <taskbody>

-<context><p>The following instructions were written for the Resource perspective,

-but they will also work in many other perspectives.</p><p>To add an attribute

-group to an XML schema, follow these steps:</p></context>

+<context><p>The following instructions were written for the Resource

+perspective, but they will also work in many other perspectives.</p><p>To

+add an attribute group to an XML schema, complete the following steps:</p></context>

 <steps>

 <step><cmd>Open your XML schema in the XML schema editor.</cmd></step>

-<step><cmd>In the Outline view, right-click the <uicontrol>Attribute Groups</uicontrol> folder

-and click  <uicontrol>Add Attribute Group</uicontrol>.</cmd><info>It appears

-in the <uicontrol>Attribute Groups</uicontrol> folder.</info></step>

-<step><cmd>Select your new group, and in the Design view, right-click the

-attribute group and select <menucascade><uicontrol>Refactor</uicontrol><uicontrol>Rename</uicontrol>

-</menucascade>. In the <uicontrol>New Name</uicontrol> field, type a name

-for the attribute group.</cmd></step>

-<step><cmd>To add an attribute, right-click your attribute group in the Outline

-view, click <uicontrol>Add Attribute</uicontrol>.</cmd><info>The attribute

-appears below the attribute group in the Outline view.</info>

+<step><cmd>In the Outline view, right-click the <uicontrol>Attributes</uicontrol> folder

+and click  <uicontrol>Add Attribute Group</uicontrol>. </cmd><info>It

+appears in the <uicontrol>Attributes</uicontrol> folder.</info></step>

+<step><cmd>Select your new group, and in the Design view, right-click

+the attribute group and select <menucascade><uicontrol>Refactor</uicontrol>

+<uicontrol>Rename</uicontrol></menucascade>. In the <uicontrol>New

+Name</uicontrol> field, type a name for the attribute group and click <uicontrol>OK</uicontrol>.</cmd>

+</step>

+<step><cmd>To add an attribute, right-click your attribute group in

+the Outline view, click <uicontrol>Add Attribute</uicontrol>. </cmd>

+<info>The attribute appears below the attribute group in the Outline

+view.</info>

 <substeps>

-<substep><cmd>Select the attribute, and in the Design view, click the current

-(default) name of the attribute, then type the new <uicontrol>Name</uicontrol>.</cmd>

+<substep><cmd>Select the attribute, and in the Design view, click

+the current (default) name of the attribute, then type the new <uicontrol>Name</uicontrol>.</cmd>

 </substep>

-<substep><cmd>In the Design view, click the current (default) attribute type

-and select a type from the menu. Alternately, you can select browse to invoke

-the Set Type menu for more options.</cmd><info>The Set Type dialog lists all

-built-in and user-defined types currently available. You can change the <uicontrol>Scope</uicontrol> of

-the list by selecting one of the following options:<ul>

-<li><uicontrol>Workspace</uicontrol>. Lists all of the types available in

-your workspace. </li>

-<li><uicontrol>Enclosing Project</uicontrol>. Lists all of the types available

-in the project that contains your file. </li>

-<li>(Default) <uicontrol>Current Resource</uicontrol>. List all of the types

-available in your current file.</li>

-<li><uicontrol>Working Sets</uicontrol>. List all the types available within

-the selected working set.</li>

+<substep><cmd>In the Design view, click the current (default) attribute

+type and select a type from the menu. Alternately, you can select

+browse to invoke the Set Type menu for more options. </cmd><info>The

+Set Type dialog lists all built-in and user-defined types currently

+available. You can change the <uicontrol>Scope</uicontrol> of the

+list by selecting one of the following options:<ul>

+<li><uicontrol>Workspace</uicontrol>. Lists all of the types available

+in your workspace. </li>

+<li><uicontrol>Enclosing Project</uicontrol>. Lists all of the types

+available in the project that contains your file. </li>

+<li><uicontrol>Current Resource</uicontrol> (default). List all of

+the types available in your current file.</li>

+<li><uicontrol>Working Sets</uicontrol>. List all the types available

+within the selected working set.</li>

 </ul></info></substep>

 </substeps>

 </step>

-<step><cmd>An attribute reference provides a reference to a global attribute.

-To add an attribute reference, in the Design view, right-click the complex

-type containing the element, and click <uicontrol>Add Attribute Ref</uicontrol>.</cmd>

-<info>A declaration that references a global attribute enables the referenced

-attribute to appear in the instance document in the context of the referencing

-declaration. Select the reference, then select the attribute group you want

-it to reference in the Properties view, from the<uicontrol>Ref</uicontrol> menu.</info>

+<step><cmd>An attribute reference provides a reference to a global

+attribute. To add an attribute reference, in the Design view, right-click

+the complex type containing the element, and click <uicontrol>Add

+Attribute Ref</uicontrol>. </cmd><info>A declaration that references

+a global attribute enables the referenced attribute to appear in the

+instance document in the context of the referencing declaration. Select

+the reference, then in the Properties view, select the attribute you

+want it to reference from the <uicontrol>Reference</uicontrol> list.<?Pub

+Caret?></info></step>

+<step><cmd>An attribute group reference provides a reference to an

+attribute group. To add an attribute group reference, in the Design

+view, right-click the complex type containing the element, and click <uicontrol>Add

+Attribute Group Ref</uicontrol>. </cmd><info>A declaration that references

+a global attribute enables the referenced attribute to appear in the

+instance document in the context of the referencing declaration. Select

+the reference, then in the Properties view, select the attribute group

+you want it to reference from the <uicontrol>Reference</uicontrol> list.</info>

 </step>

-<step><cmd>An attribute group reference provides a reference to an attribute

-group. To add an attribute group reference, in the Design view, right-click

-the complex type containing the element, and click <uicontrol>Add Attribute

-Group Ref</uicontrol>.</cmd><info>A declaration that references a global attribute

-enables the referenced attribute to appear in the instance document in the

-context of the referencing declaration. Select the reference, then select

-the attribute group you want it to reference in the Properties view, from

-the<uicontrol>Ref</uicontrol> menu.</info></step>

-<step><cmd>An <codeph>any</codeph> element enables element content according

-to namespaces, and the corresponding <codeph>any</codeph> attribute element

-enables attributes to appear in elements. To add an <codeph>any</codeph> attribute,

-right-click your attribute group and click <uicontrol>Add Any Attribute</uicontrol>.</cmd>

-<info>The <codeph>any</codeph> appears below the attribute group in the Outline

-view. You can specify the following values for an <codeph>any</codeph> attribute:</info>

+<step><cmd>An <codeph>any</codeph> element enables element content

+according to namespaces, and the corresponding <codeph>any</codeph> attribute

+element enables attributes to appear in elements. To add an <codeph>any</codeph> attribute,

+right-click your attribute group and click <uicontrol>Add Any Attribute</uicontrol>. </cmd>

+<info>The <codeph>any</codeph> appears below the attribute group in

+the Outline view. You can specify the following values for an <codeph>any</codeph> attribute:</info>

 <choices>

-<choice>For a <uicontrol>namespace</uicontrol> value, you can

-select:<ul>

-<li><b>##any</b>. This allows any well-formed XML from any namespace.</li>

-<li><b>##local </b>. This allows any well-formed XML that is not declared

+<choice>For a <uicontrol>Namespace</uicontrol> value, you can select:<ul>

+<li><b>##any</b>: this allows any well-formed XML from any namespace.</li>

+<li><b>##local </b>: this allows any well-formed XML that is not declared

 to be in a namespace.</li>

-<li><b>##other</b>. This allows any well-formed XML that is not from the target

-namespace of the type being defined.</li>

-<li><b>##targetNamespace </b>. This is shorthand for the target namespace

+<li><b>##other</b>: this allows any well-formed XML that is not from

+the target namespace of the type being defined.</li>

+<li><b>##targetNamespace </b>: this is shorthand for the target namespace

 of the type being defined.</li>

 </ul></choice>

-<choice>For a <uicontrol>processContents</uicontrol> value, you can select:<ul>

-<li><b>skip</b>. The XML processor will not validate the attribute content

-at all.</li>

-<li><b>lax</b>. The XML processor will validate the attribute content as much

-as it can.</li>

-<li><b>strict</b>. The XML processor will validate all the attribute content.</li>

+<choice>For a <uicontrol>Process Contents</uicontrol> value, you can

+select:<ul>

+<li><b>skip</b>: the XML processor will not validate the attribute

+content at all.</li>

+<li><b>lax</b>: the XML processor will validate the attribute content

+as much as it can.</li>

+<li><b>strict</b>: the XML processor will validate all the attribute

+content.</li>

 </ul></choice>

 </choices>

 </step>

 </steps>

 </taskbody>

 </task>

-<?Pub *0000005769?>

+<?Pub *0000005544?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddagrp.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddagrp.html
index 500b3b0..723b39a 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddagrp.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddagrp.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Adding attribute groups" />
 <meta name="abstract" content="An attribute group definition is an association between a name and a set of attribute declarations. Named groups of attribute declarations can greatly facilitate the maintenance and reuse of common attribute declarations in an XML schema." />
 <meta name="description" content="An attribute group definition is an association between a name and a set of attribute declarations. Named groups of attribute declarations can greatly facilitate the maintenance and reuse of common attribute declarations in an XML schema." />
-<meta content="XML schema editor, adding, attribute groups, attributes groups, XML schema files, attribute groups, XML schema files, attributes groups" name="DC.subject" />
-<meta content="XML schema editor, adding, attribute groups, attributes groups, XML schema files, attribute groups, XML schema files, attributes groups" name="keywords" />
+<meta content="XML schema editor, attribute groups, XML schema files" name="DC.subject" />
+<meta content="XML schema editor, attribute groups, XML schema files" name="keywords" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="taddagrp" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -27,53 +27,56 @@
 
 
 
-<div><p>An attribute group definition is an association between a name
-and a set of attribute declarations. Named groups of attribute declarations
-can greatly facilitate the maintenance and reuse of common attribute declarations
-in an XML schema.</p>
+<div><p>An attribute group definition is an association between
+a name and a set of attribute declarations. Named groups of attribute
+declarations can greatly facilitate the maintenance and reuse of common
+attribute declarations in an XML schema.</p>
 
-<div class="section"><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p>
-<p>To add an attribute
-group to an XML schema, follow these steps:</p>
+<div class="section"><p>The following instructions were written for the Resource
+perspective, but they will also work in many other perspectives.</p>
+<p>To
+add an attribute group to an XML schema, complete the following steps:</p>
 </div>
 
 <ol>
 <li class="stepexpand"><span>Open your XML schema in the XML schema editor.</span></li>
 
-<li class="stepexpand"><span>In the Outline view, right-click the <span class="uicontrol">Attribute Groups</span> folder
-and click  <span class="uicontrol">Add Attribute Group</span>.</span> It appears
-in the <span class="uicontrol">Attribute Groups</span> folder.</li>
+<li class="stepexpand"><span>In the Outline view, right-click the <span class="uicontrol">Attributes</span> folder
+and click  <span class="uicontrol">Add Attribute Group</span>. </span> It
+appears in the <span class="uicontrol">Attributes</span> folder.</li>
 
-<li class="stepexpand"><span>Select your new group, and in the Design view, right-click the
-attribute group and select <span class="menucascade"><span class="uicontrol">Refactor</span> &gt; <span class="uicontrol">Rename</span>
-</span>. In the <span class="uicontrol">New Name</span> field, type a name
-for the attribute group.</span></li>
-
-<li class="stepexpand"><span>To add an attribute, right-click your attribute group in the Outline
-view, click <span class="uicontrol">Add Attribute</span>.</span> The attribute
-appears below the attribute group in the Outline view.
-<ol type="a">
-<li class="substepexpand"><span>Select the attribute, and in the Design view, click the current
-(default) name of the attribute, then type the new <span class="uicontrol">Name</span>.</span>
+<li class="stepexpand"><span>Select your new group, and in the Design view, right-click
+the attribute group and select <span class="menucascade"><span class="uicontrol">Refactor</span>
+ &gt; <span class="uicontrol">Rename</span></span>. In the <span class="uicontrol">New
+Name</span> field, type a name for the attribute group and click <span class="uicontrol">OK</span>.</span>
 </li>
 
-<li class="substepexpand"><span>In the Design view, click the current (default) attribute type
-and select a type from the menu. Alternately, you can select browse to invoke
-the Set Type menu for more options.</span> The Set Type dialog lists all
-built-in and user-defined types currently available. You can change the <span class="uicontrol">Scope</span> of
-the list by selecting one of the following options:<ul>
-<li><span class="uicontrol">Workspace</span>. Lists all of the types available in
-your workspace. </li>
+<li class="stepexpand"><span>To add an attribute, right-click your attribute group in
+the Outline view, click <span class="uicontrol">Add Attribute</span>. </span>
+ The attribute appears below the attribute group in the Outline
+view.
+<ol type="a">
+<li class="substepexpand"><span>Select the attribute, and in the Design view, click
+the current (default) name of the attribute, then type the new <span class="uicontrol">Name</span>.</span>
+</li>
 
-<li><span class="uicontrol">Enclosing Project</span>. Lists all of the types available
-in the project that contains your file. </li>
+<li class="substepexpand"><span>In the Design view, click the current (default) attribute
+type and select a type from the menu. Alternately, you can select
+browse to invoke the Set Type menu for more options. </span> The
+Set Type dialog lists all built-in and user-defined types currently
+available. You can change the <span class="uicontrol">Scope</span> of the
+list by selecting one of the following options:<ul>
+<li><span class="uicontrol">Workspace</span>. Lists all of the types available
+in your workspace. </li>
 
-<li>(Default) <span class="uicontrol">Current Resource</span>. List all of the types
-available in your current file.</li>
+<li><span class="uicontrol">Enclosing Project</span>. Lists all of the types
+available in the project that contains your file. </li>
 
-<li><span class="uicontrol">Working Sets</span>. List all the types available within
-the selected working set.</li>
+<li><span class="uicontrol">Current Resource</span> (default). List all of
+the types available in your current file.</li>
+
+<li><span class="uicontrol">Working Sets</span>. List all the types available
+within the selected working set.</li>
 
 </ul>
 </li>
@@ -82,55 +85,57 @@
 
 </li>
 
-<li class="stepexpand"><span>An attribute reference provides a reference to a global attribute.
-To add an attribute reference, in the Design view, right-click the complex
-type containing the element, and click <span class="uicontrol">Add Attribute Ref</span>.</span>
- A declaration that references a global attribute enables the referenced
-attribute to appear in the instance document in the context of the referencing
-declaration. Select the reference, then select the attribute group you want
-it to reference in the Properties view, from the<span class="uicontrol">Ref</span> menu.
+<li class="stepexpand"><span>An attribute reference provides a reference to a global
+attribute. To add an attribute reference, in the Design view, right-click
+the complex type containing the element, and click <span class="uicontrol">Add
+Attribute Ref</span>. </span> A declaration that references
+a global attribute enables the referenced attribute to appear in the
+instance document in the context of the referencing declaration. Select
+the reference, then in the Properties view, select the attribute you
+want it to reference from the <span class="uicontrol">Reference</span> list.</li>
+
+<li class="stepexpand"><span>An attribute group reference provides a reference to an
+attribute group. To add an attribute group reference, in the Design
+view, right-click the complex type containing the element, and click <span class="uicontrol">Add
+Attribute Group Ref</span>. </span> A declaration that references
+a global attribute enables the referenced attribute to appear in the
+instance document in the context of the referencing declaration. Select
+the reference, then in the Properties view, select the attribute group
+you want it to reference from the <span class="uicontrol">Reference</span> list.
 </li>
 
-<li class="stepexpand"><span>An attribute group reference provides a reference to an attribute
-group. To add an attribute group reference, in the Design view, right-click
-the complex type containing the element, and click <span class="uicontrol">Add Attribute
-Group Ref</span>.</span> A declaration that references a global attribute
-enables the referenced attribute to appear in the instance document in the
-context of the referencing declaration. Select the reference, then select
-the attribute group you want it to reference in the Properties view, from
-the<span class="uicontrol">Ref</span> menu.</li>
-
-<li class="stepexpand"><span>An <samp class="codeph">any</samp> element enables element content according
-to namespaces, and the corresponding <samp class="codeph">any</samp> attribute element
-enables attributes to appear in elements. To add an <samp class="codeph">any</samp> attribute,
-right-click your attribute group and click <span class="uicontrol">Add Any Attribute</span>.</span>
- The <samp class="codeph">any</samp> appears below the attribute group in the Outline
-view. You can specify the following values for an <samp class="codeph">any</samp> attribute:
+<li class="stepexpand"><span>An <samp class="codeph">any</samp> element enables element content
+according to namespaces, and the corresponding <samp class="codeph">any</samp> attribute
+element enables attributes to appear in elements. To add an <samp class="codeph">any</samp> attribute,
+right-click your attribute group and click <span class="uicontrol">Add Any Attribute</span>. </span>
+ The <samp class="codeph">any</samp> appears below the attribute group in
+the Outline view. You can specify the following values for an <samp class="codeph">any</samp> attribute:
 <ul>
-<li>For a <span class="uicontrol">namespace</span> value, you can
-select:<ul>
-<li><strong>##any</strong>. This allows any well-formed XML from any namespace.</li>
+<li>For a <span class="uicontrol">Namespace</span> value, you can select:<ul>
+<li><strong>##any</strong>: this allows any well-formed XML from any namespace.</li>
 
-<li><strong>##local </strong>. This allows any well-formed XML that is not declared
+<li><strong>##local </strong>: this allows any well-formed XML that is not declared
 to be in a namespace.</li>
 
-<li><strong>##other</strong>. This allows any well-formed XML that is not from the target
-namespace of the type being defined.</li>
+<li><strong>##other</strong>: this allows any well-formed XML that is not from
+the target namespace of the type being defined.</li>
 
-<li><strong>##targetNamespace </strong>. This is shorthand for the target namespace
+<li><strong>##targetNamespace </strong>: this is shorthand for the target namespace
 of the type being defined.</li>
 
 </ul>
 </li>
 
-<li>For a <span class="uicontrol">processContents</span> value, you can select:<ul>
-<li><strong>skip</strong>. The XML processor will not validate the attribute content
-at all.</li>
+<li>For a <span class="uicontrol">Process Contents</span> value, you can
+select:<ul>
+<li><strong>skip</strong>: the XML processor will not validate the attribute
+content at all.</li>
 
-<li><strong>lax</strong>. The XML processor will validate the attribute content as much
-as it can.</li>
+<li><strong>lax</strong>: the XML processor will validate the attribute content
+as much as it can.</li>
 
-<li><strong>strict</strong>. The XML processor will validate all the attribute content.</li>
+<li><strong>strict</strong>: the XML processor will validate all the attribute
+content.</li>
 
 </ul>
 </li>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddanye.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddanye.dita
index 5b2c285..c18c7cd 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddanye.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddanye.dita
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<?xml version="1.0" encoding="UTF-8"?>

+<!--Arbortext, Inc., 1988-2008, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <?Pub Inc?>

@@ -8,10 +8,10 @@
 <titlealts>

 <searchtitle>Adding an any element</searchtitle>

 </titlealts>

-<shortdesc>You can use the <codeph>any</codeph> element in a similar way as

-a DTD's ANY content model, however, it must be done in conjunction with namespaces.

-This enables you to include any well-formed XML content, such as an HTML Web

-page that conforms to XHTML 1.0 syntax.</shortdesc>

+<shortdesc>You can use the <codeph>any</codeph> element in a similar

+way as a DTD's ANY content model, however, it must be done in conjunction

+with namespaces. This enables you to include any well-formed XML content,

+such as an HTML Web page that conforms to XHTML 1.0 syntax.</shortdesc>

 <prolog><metadata>

 <keywords><indexterm>XML schema editor<indexterm>adding an any element</indexterm></indexterm>

 <indexterm>XML schema files<indexterm>adding an any element</indexterm></indexterm>

@@ -20,57 +20,65 @@
 <taskbody>

 <context><p>For example:</p><p><codeblock>&lt;element name = "MyWebPage">

 &lt;complexType>

-&lt;any namespace ="http://www.w3.org/1999/xhtml>

- &lt; minOccurs="1" maxOccurs="unbounded" processContents="skip"/>

+&lt;any namespace="http://www.w3.org/1999/xhtml"

+   minOccurs="1" maxOccurs="unbounded" processContents="skip"/>

 &lt;/complexType>

-&lt;/element></codeblock></p><p>The preceding schema fragment allows a <codeph>&lt;MyWebPage></codeph> element

-to contain any well-formed XHTML data that appears in the specified namespace.</p><p>The

-following instructions were written for the Resource perspective, but they

-will also work in many other perspectives.</p><p>To add an <codeph>any</codeph> element:</p></context>

+&lt;/element></codeblock></p><p>The preceding schema fragment allows

+a <codeph>&lt;MyWebPage></codeph> element to contain any well-formed

+XHTML data that appears in the specified namespace.</p><p>The following

+instructions were written for the Resource perspective, but they will

+also work in many other perspectives.</p><p>To add an <codeph>any</codeph> element,

+complete the following steps:</p></context>

 <steps>

-<step><cmd>In the Outline view, right-click the content model that you want

-to work with and click <uicontrol>Add Any</uicontrol>. </cmd></step>

+<step><cmd>In the Outline view, right-click the content model that

+you want to work with and click <uicontrol>Add Any</uicontrol>. </cmd>

+</step>

 <step><cmd>Select the new <codeph>any</codeph> element.</cmd></step>

-<step><cmd>In the Properties view of the schema editor, for a <uicontrol>namespace</uicontrol> value,

+<step><cmd>In the Properties view, for a <uicontrol>Namespace</uicontrol> value,

 you can select:</cmd>

 <choices>

-<choice><b>##any</b>. This allows any well-formed XML from any namespace.</choice>

-<choice><b>##local </b>. This allows any well-formed XML that is not declared

-to be in a namespace.</choice>

-<choice><b>##other </b>. This allows any well-formed XML that is not from

-the target namespace of the type being defined.</choice>

-<choice><b>##targetNamespace</b>. This is shorthand for the target namespace

-of the type being defined.</choice>

+<choice><b>##any</b>: this allows any well-formed XML from any namespace.</choice>

+<choice><b>##local </b>: this allows any well-formed XML that is not

+declared to be in a namespace.</choice>

+<choice><b>##other </b>: this allows any well-formed XML that is not

+from the target namespace of the type being defined.</choice>

+<choice><b>##targetNamespace</b>: this is shorthand for the target

+namespace of the type being defined.</choice>

 </choices>

 </step>

-<step><cmd>For a <uicontrol>processContents</uicontrol> value, you can select:</cmd>

+<step><cmd>For a <uicontrol>Process Contents</uicontrol> value, you

+can select:</cmd>

 <choices>

-<choice><b>skip</b>. The XML processor will not validate the content at all.</choice>

-<choice><b>lax</b>. The XML processor will validate the content as much as

-it can.</choice>

-<choice><b>strict</b>. The XML processor will validate all the content.</choice>

+<choice><b>skip</b>: the XML processor will not validate the content

+at all.</choice>

+<choice><b>lax</b>: the XML processor will validate the content as

+much as it can.</choice>

+<choice><b>strict</b>: the XML processor will validate all the content.</choice>

 </choices>

 </step>

-<step><cmd>The <uicontrol>minOccurs</uicontrol> value is the number of times

-the <codeph>any</codeph> element must appear in an instance document. You

-can select <uicontrol>0</uicontrol> if you want the element to be optional;

-otherwise, select <uicontrol>1</uicontrol>. </cmd></step>

-<step><cmd>The <uicontrol>maxOccurs</uicontrol> value is the maximum number

-of times an <codeph>any</codeph> element can appear in an instance document.

-You can select <uicontrol>0</uicontrol>, <uicontrol>1</uicontrol>, or, to

-indicate there is no maximum number of occurrences, <uicontrol>unbounded</uicontrol>.</cmd>

+<step><cmd>The <uicontrol>Minimum Occurrence</uicontrol> value is

+the number of times the <codeph>any</codeph> element must appear in

+an instance document. You can select <uicontrol>0</uicontrol> if you

+want the element to be optional; otherwise, select <uicontrol>1</uicontrol>. </cmd>

 </step>

-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want

-to provide any information about this element.</cmd><info>The <uicontrol>Documentation</uicontrol> page

-is used for human readable material, such as a description.</info></step>

-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to

-add application information elements to your annotations of schema components.</cmd>

-<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the

-schema and add XML content to your annotations.</info></step>

+<step><cmd>The <uicontrol>Maximum Occurrence</uicontrol> value is

+the maximum number of times an <codeph>any</codeph> element can appear

+in an instance document. You can select <uicontrol>0</uicontrol>, <uicontrol>1</uicontrol>,

+or, to indicate there is no maximum number of occurrences, <uicontrol>unbounded</uicontrol>.</cmd>

+</step>

+<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you

+want to provide any information about this element. <?Pub Caret?></cmd>

+<info>The <uicontrol>Documentation</uicontrol> page is used for human

+readable material, such as a description.</info></step>

+<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you

+want to add application information elements to your annotations of

+schema components. </cmd><info>The <uicontrol>Extensions</uicontrol> page

+allows you to specify the schema and add XML content to your annotations.</info>

+</step>

 </steps>

-<postreq><p>(c) Copyright 2001, World Wide Web (Massachusetts Institute of

-Technology, Institut National de Recherche en Informatique et en Automatique,

-Keio University).</p></postreq>

+<postreq><draft-comment>(c) Copyright 2001, World Wide Web (Massachusetts

+Institute of Technology, Institut National de Recherche en Informatique

+et en Automatique, Keio University).</draft-comment></postreq>

 </taskbody>

 </task>

-<?Pub *0000004291?>

+<?Pub *0000004086?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddanye.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddanye.html
index 8540ecb..625b7a5 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddanye.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddanye.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Adding an any element" />
 <meta name="abstract" content="You can use the any element in a similar way as a DTD's ANY content model, however, it must be done in conjunction with namespaces. This enables you to include any well-formed XML content, such as an HTML Web page that conforms to XHTML 1.0 syntax." />
 <meta name="description" content="You can use the any element in a similar way as a DTD's ANY content model, however, it must be done in conjunction with namespaces. This enables you to include any well-formed XML content, such as an HTML Web page that conforms to XHTML 1.0 syntax." />
-<meta content="XML schema editor, adding, an any element, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, adding, an any element, XML schema files" name="keywords" />
+<meta content="XML schema editor, adding an any element, XML schema files" name="DC.subject" />
+<meta content="XML schema editor, adding an any element, XML schema files" name="keywords" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="taddanye" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -27,90 +27,95 @@
 
 
 
-<div><p>You can use the <samp class="codeph">any</samp> element in a similar way as
-a DTD's ANY content model, however, it must be done in conjunction with namespaces.
-This enables you to include any well-formed XML content, such as an HTML Web
-page that conforms to XHTML 1.0 syntax.</p>
+<div><p>You can use the <samp class="codeph">any</samp> element in a similar
+way as a DTD's ANY content model, however, it must be done in conjunction
+with namespaces. This enables you to include any well-formed XML content,
+such as an HTML Web page that conforms to XHTML 1.0 syntax.</p>
 
 <div class="section"><p>For example:</p>
 <div class="p"><pre>&lt;element name = "MyWebPage"&gt;
 &lt;complexType&gt;
-&lt;any namespace ="http://www.w3.org/1999/xhtml&gt;
- &lt; minOccurs="1" maxOccurs="unbounded" processContents="skip"/&gt;
+&lt;any namespace="http://www.w3.org/1999/xhtml"
+   minOccurs="1" maxOccurs="unbounded" processContents="skip"/&gt;
 &lt;/complexType&gt;
 &lt;/element&gt;</pre>
 </div>
-<p>The preceding schema fragment allows a <samp class="codeph">&lt;MyWebPage&gt;</samp> element
-to contain any well-formed XHTML data that appears in the specified namespace.</p>
-<p>The
-following instructions were written for the Resource perspective, but they
-will also work in many other perspectives.</p>
-<p>To add an <samp class="codeph">any</samp> element:</p>
+<p>The preceding schema fragment allows
+a <samp class="codeph">&lt;MyWebPage&gt;</samp> element to contain any well-formed
+XHTML data that appears in the specified namespace.</p>
+<p>The following
+instructions were written for the Resource perspective, but they will
+also work in many other perspectives.</p>
+<p>To add an <samp class="codeph">any</samp> element,
+complete the following steps:</p>
 </div>
 
 <ol>
-<li class="stepexpand"><span>In the Outline view, right-click the content model that you want
-to work with and click <span class="uicontrol">Add Any</span>. </span></li>
+<li class="stepexpand"><span>In the Outline view, right-click the content model that
+you want to work with and click <span class="uicontrol">Add Any</span>. </span>
+</li>
 
 <li class="stepexpand"><span>Select the new <samp class="codeph">any</samp> element.</span></li>
 
-<li class="stepexpand"><span>In the Properties view of the schema editor, for a <span class="uicontrol">namespace</span> value,
+<li class="stepexpand"><span>In the Properties view, for a <span class="uicontrol">Namespace</span> value,
 you can select:</span>
 <ul>
-<li><strong>##any</strong>. This allows any well-formed XML from any namespace.</li>
+<li><strong>##any</strong>: this allows any well-formed XML from any namespace.</li>
 
-<li><strong>##local </strong>. This allows any well-formed XML that is not declared
-to be in a namespace.</li>
+<li><strong>##local </strong>: this allows any well-formed XML that is not
+declared to be in a namespace.</li>
 
-<li><strong>##other </strong>. This allows any well-formed XML that is not from
-the target namespace of the type being defined.</li>
+<li><strong>##other </strong>: this allows any well-formed XML that is not
+from the target namespace of the type being defined.</li>
 
-<li><strong>##targetNamespace</strong>. This is shorthand for the target namespace
-of the type being defined.</li>
+<li><strong>##targetNamespace</strong>: this is shorthand for the target
+namespace of the type being defined.</li>
 
 </ul>
 
 </li>
 
-<li class="stepexpand"><span>For a <span class="uicontrol">processContents</span> value, you can select:</span>
+<li class="stepexpand"><span>For a <span class="uicontrol">Process Contents</span> value, you
+can select:</span>
 <ul>
-<li><strong>skip</strong>. The XML processor will not validate the content at all.</li>
+<li><strong>skip</strong>: the XML processor will not validate the content
+at all.</li>
 
-<li><strong>lax</strong>. The XML processor will validate the content as much as
-it can.</li>
+<li><strong>lax</strong>: the XML processor will validate the content as
+much as it can.</li>
 
-<li><strong>strict</strong>. The XML processor will validate all the content.</li>
+<li><strong>strict</strong>: the XML processor will validate all the content.</li>
 
 </ul>
 
 </li>
 
-<li class="stepexpand"><span>The <span class="uicontrol">minOccurs</span> value is the number of times
-the <samp class="codeph">any</samp> element must appear in an instance document. You
-can select <span class="uicontrol">0</span> if you want the element to be optional;
-otherwise, select <span class="uicontrol">1</span>. </span></li>
-
-<li class="stepexpand"><span>The <span class="uicontrol">maxOccurs</span> value is the maximum number
-of times an <samp class="codeph">any</samp> element can appear in an instance document.
-You can select <span class="uicontrol">0</span>, <span class="uicontrol">1</span>, or, to
-indicate there is no maximum number of occurrences, <span class="uicontrol">unbounded</span>.</span>
+<li class="stepexpand"><span>The <span class="uicontrol">Minimum Occurrence</span> value is
+the number of times the <samp class="codeph">any</samp> element must appear in
+an instance document. You can select <span class="uicontrol">0</span> if you
+want the element to be optional; otherwise, select <span class="uicontrol">1</span>. </span>
 </li>
 
-<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
-to provide any information about this element.</span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.</li>
+<li class="stepexpand"><span>The <span class="uicontrol">Maximum Occurrence</span> value is
+the maximum number of times an <samp class="codeph">any</samp> element can appear
+in an instance document. You can select <span class="uicontrol">0</span>, <span class="uicontrol">1</span>,
+or, to indicate there is no maximum number of occurrences, <span class="uicontrol">unbounded</span>.</span>
+</li>
 
-<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you want to
-add application information elements to your annotations of schema components.</span>
- The <span class="uicontrol">Extensions</span> page allows you to specify the
-schema and add XML content to your annotations.</li>
+<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you
+want to provide any information about this element. </span>
+ The <span class="uicontrol">Documentation</span> page is used for human
+readable material, such as a description.</li>
+
+<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you
+want to add application information elements to your annotations of
+schema components. </span> The <span class="uicontrol">Extensions</span> page
+allows you to specify the schema and add XML content to your annotations.
+</li>
 
 </ol>
 
-<div class="section"><p>(c) Copyright 2001, World Wide Web (Massachusetts Institute of
-Technology, Institut National de Recherche en Informatique et en Automatique,
-Keio University).</p>
-</div>
+<div class="section" />
 
 </div>
 
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmod.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmod.dita
index f5d45f7..7f69dda 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmod.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmod.dita
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <?Pub Inc?>

@@ -31,8 +31,8 @@
 in the content model can appear more than once.</li>

 </ul></p><p>The following instructions were written for the Resource perspective,

 but they will also work in many other perspectives.</p><p>To add a content

-model to an element, global element, complex type, or group, follow these

-steps:</p></context>

+model to an element, global element, complex type, or group, complete the

+following steps:</p></context>

 <steps>

 <step><cmd>In the Design view, select your complex type, or group:</cmd>

 <choices>

@@ -49,27 +49,27 @@
 <choice>Your group is automatically created with a sequence content model

 child. Expand it in the Outline view to see it and select it. In the Properties

 view, you can select to change it to a <uicontrol>choice</uicontrol> or <uicontrol>all</uicontrol> content

-model by selecting these options from the <uicontrol>Kind</uicontrol> menu.</choice>

+model by selecting these options from the <uicontrol>Kind</uicontrol> drop-down.</choice>

 </choices>

 </step>

-<step><cmd>(Optional) Select the appropriate value in the <uicontrol>MinOccurs</uicontrol> field.</cmd>

-<info>This is the minimum number of times the content model must appear. If

-you want the content model to be optional, select <uicontrol>0</uicontrol>.

-Otherwise, select <uicontrol>1</uicontrol>. </info></step>

-<step><cmd>(Optional) Select the appropriate value in the <uicontrol>MaxOccurs</uicontrol> field.</cmd>

-<info>This is the maximum number of times a content model can appear. You

-can select <uicontrol>unbounded</uicontrol> to indicate there is no maximum

-number of occurrences.</info></step>

+<step importance="optional"><cmd>Select the appropriate value in the <uicontrol>Minimum

+Occurr<?Pub Caret?>ence</uicontrol> field.</cmd><info>This is the minimum

+number of times the content model must appear. If you want the content model

+to be optional, select <uicontrol>0</uicontrol>. Otherwise, select <uicontrol>1</uicontrol>. </info>

+</step>

+<step importance="optional"><cmd>Select the appropriate value in the <uicontrol>Maximum

+Occurrence</uicontrol> field.</cmd><info>This is the maximum number of times

+a content model can appear. You can select <uicontrol>unbounded</uicontrol> to

+indicate there is no maximum number of occurrences.</info></step>

 <step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want

 to provide any information about this content model.</cmd><info>The <uicontrol>Documentation</uicontrol> page

-is used for human readable material, such as a description.</info>

-</step>

+is used for human readable material, such as a description.</info></step>

 <step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to

 add application information elements to your annotations of schema components.</cmd>

 <info>The <uicontrol>Extensions</uicontrol> page allows you to specify the

 schema and add XML content to your annotations.</info></step>

 </steps>

-<postreq><p>You can add the following items to a content object model. </p><ul>

+<postreq><p>You can add the following items to a content object model: </p><ul>

 <li>Another content model.</li>

 <li>A group reference which enables the referenced group to appear in the

 instance document in the context of the referencing declaration. This menu

@@ -84,4 +84,4 @@
 </ul></postreq>

 </taskbody>

 </task>

-<?Pub *0000005317?>

+<?Pub *0000005101?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmod.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmod.html
index 1e0afe1..06915be 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmod.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmod.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Adding content models" />
 <meta name="abstract" content="A content model is the representation of any data that can be contained inside an element, global element, complex type, or group. It is a formal description of the structure and permissible content of an element, global element, complex type, or group, which may be used to validate a document instance." />
 <meta name="description" content="A content model is the representation of any data that can be contained inside an element, global element, complex type, or group. It is a formal description of the structure and permissible content of an element, global element, complex type, or group, which may be used to validate a document instance." />
-<meta content="XML schema editor, adding, content models, XML schema files, content models, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, adding, content models, XML schema files, content models, XML schema files" name="keywords" />
+<meta content="XML schema editor, content models, XML schema files" name="DC.subject" />
+<meta content="XML schema editor, content models, XML schema files" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddanye.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddelm.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddelmr.html" />
@@ -55,8 +55,8 @@
 <p>The following instructions were written for the Resource perspective,
 but they will also work in many other perspectives.</p>
 <p>To add a content
-model to an element, global element, complex type, or group, follow these
-steps:</p>
+model to an element, global element, complex type, or group, complete the
+following steps:</p>
 </div>
 
 <ol>
@@ -76,26 +76,26 @@
 <li>Your group is automatically created with a sequence content model
 child. Expand it in the Outline view to see it and select it. In the Properties
 view, you can select to change it to a <span class="uicontrol">choice</span> or <span class="uicontrol">all</span> content
-model by selecting these options from the <span class="uicontrol">Kind</span> menu.</li>
+model by selecting these options from the <span class="uicontrol">Kind</span> drop-down.</li>
 
 </ul>
 
 </li>
 
-<li class="stepexpand"><span>(Optional) Select the appropriate value in the <span class="uicontrol">MinOccurs</span> field.</span>
- This is the minimum number of times the content model must appear. If
-you want the content model to be optional, select <span class="uicontrol">0</span>.
-Otherwise, select <span class="uicontrol">1</span>. </li>
+<li class="stepexpand"><strong>Optional: </strong><span>Select the appropriate value in the <span class="uicontrol">Minimum
+Occurrence</span> field.</span> This is the minimum
+number of times the content model must appear. If you want the content model
+to be optional, select <span class="uicontrol">0</span>. Otherwise, select <span class="uicontrol">1</span>. 
+</li>
 
-<li class="stepexpand"><span>(Optional) Select the appropriate value in the <span class="uicontrol">MaxOccurs</span> field.</span>
- This is the maximum number of times a content model can appear. You
-can select <span class="uicontrol">unbounded</span> to indicate there is no maximum
-number of occurrences.</li>
+<li class="stepexpand"><strong>Optional: </strong><span>Select the appropriate value in the <span class="uicontrol">Maximum
+Occurrence</span> field.</span> This is the maximum number of times
+a content model can appear. You can select <span class="uicontrol">unbounded</span> to
+indicate there is no maximum number of occurrences.</li>
 
 <li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
 to provide any information about this content model.</span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.
-</li>
+is used for human readable material, such as a description.</li>
 
 <li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you want to
 add application information elements to your annotations of schema components.</span>
@@ -104,7 +104,7 @@
 
 </ol>
 
-<div class="section"><p>You can add the following items to a content object model. </p>
+<div class="section"><p>You can add the following items to a content object model: </p>
 <ul>
 <li>Another content model.</li>
 
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmxt.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmxt.dita
index ef5c946..b8bd7eb 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmxt.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmxt.dita
@@ -1,105 +1,76 @@
-<?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<?xml version="1.0" encoding="UTF-8"?>

+<!--Arbortext, Inc., 1988-2008, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

+<?Pub Sty _display FontColor="red"?>

 <?Pub Inc?>

 <task id="taddcmxt" xml:lang="en-us">

 <title>Adding complex types</title>

 <titlealts>

 <searchtitle>Adding complex types</searchtitle>

 </titlealts>

-<shortdesc>A complex type allows elements in its content and can carry attributes.

-Complex types can be used to help determine the appropriate content for any

-instance documents generated from or associated with your XML schema.</shortdesc>

+<shortdesc>A complex type allows elements in its content and can carry

+attributes. Complex types can be used to help determine the appropriate

+content for any instance documents generated from or associated with

+your XML schema.</shortdesc>

 <prolog><metadata>

 <keywords><indexterm>XML schema editor<indexterm>complex types</indexterm></indexterm>

 <indexterm>XML schema files<indexterm>complex types</indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <taskbody>

-<context><p>You can add as many complex types as you want to an XML schema.</p><p>The

-following instructions were written for the Resource perspective, but they

-will also work in many other perspectives.</p><p>To add a complex type to

-an XML schema, follow these steps:</p></context>

+<context><p>You can add as many complex types as you want to an XML

+schema.</p><p>The following instructions were written for the Resource

+perspective, but they will also work in many other perspectives.</p><p>To

+add a complex type to an XML schema, complete the following steps:</p></context>

 <steps>

 <step><cmd>Open your XML schema in the XML schema editor.</cmd></step>

-<step><cmd>Right-click the Types category in the Design view, and click <uicontrol>Add

-Complex Type</uicontrol>.</cmd></step>

-<step><cmd>In the Properties view, type a new name for the complex type in

-the <uicontrol>Name</uicontrol> field.</cmd></step>

-<step><cmd>Click <uicontrol>Browse</uicontrol> <image href="../images/Browse.gif">

-<alt>Browse icon</alt></image> to select a base type for your complex type.</cmd>

-<info>You can either set a base type for your complex type, or you can add

-a content model to it (which represents any data that can be contained inside

-an element), but you cannot do both. For more information about content models,

-refer to the related tasks.</info></step>

-<step><cmd>Select <uicontrol>restriction</uicontrol> or <uicontrol>extension</uicontrol> from

-the <uicontrol>Inherited by</uicontrol> list.</cmd><info>This specifies whether

-your type is derived from its base type by restriction or extension.</info>

+<step><cmd>Right-click the Types category in the Design view, click <uicontrol>Add

+Complex Type</uicontrol> and type the name for the complex type. If

+you need to change the name later, you can edit it in the <uicontrol>General</uicontrol> tab

+of the Properties view.</cmd></step>

+<step><cmd>To set a base type for the complex type, right-click the

+type in the Design view and click <uicontrol>Set Base Type</uicontrol>. </cmd>

+<info>You can either set a base type for your complex type, or you

+can add a content model to it (which represents any data that can

+be contained inside an element), but you cannot do both. For more

+information about content models, see <xref href="taddcmod.dita"

+scope="peer">Adding content models</xref>.</info></step>

+<step><cmd>Your new type can be derived from its base type either

+by extension or restriction. By default, the derivation is set to

+extension. To change how the type is derived, click the <uicontrol>General</uicontrol> tab

+in the Properties view and select <uicontrol>restriction</uicontrol> or <uicontrol>extension</uicontrol> from

+the <uicontrol>Inherited By</uicontrol> list. </cmd></step>

+<step><cmd>To add attributes to your complex type, in the Design view,

+right-click your complex type and select <uicontrol>Add Attribute</uicontrol>. </cmd>

+<info>An attribute associates an attribute name with a specific type

+and value. </info><?Pub Caret1?>

+<substeps>

+<substep><cmd>To set the name of the attribute, in the Design view,

+double-click the name of the attribute and type the name.</cmd>

+</substep>

+<substep><cmd>To set the type of the attribute, in the Design view,

+double-click the attribute type and then select the new type from

+the list.</cmd></substep>

+</substeps>

+<info>For information about adding attributes, attribute references,

+and <userinput>any</userinput> attributes, see <xref href="taddagrp.dita"

+scope="peer">Adding attribute groups</xref>.</info></step>

+<step><cmd>You can further define your complex type in the Properties

+view:</cmd>

+<substeps>

+<substep><cmd>Click the <uicontrol>Documentation</uicontrol> tab if

+you want to provide any information about this complex type. </cmd>

+<info>The <uicontrol>Documentation</uicontrol> page is used for human

+readable material, such as a description.</info></substep>

+<substep><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you

+want to add application information elements to your annotations of

+schema components. </cmd><info>The <uicontrol>Extensions</uicontrol> page

+allows you to specify the schema and add XML content to your annotations.</info>

+</substep>

+</substeps>

 </step>

-<step><cmd>The Design view will display the attributes within the complex

-type.</cmd><info>You can also use this view to add attributes to your complex

-type. An attribute associates an attribute name with a specific type and value.</info>

-<choices>

-<choice>To add an attribute, in the Design view, right click your complex

-type and select <uicontrol>Add Attribute</uicontrol>.<ul>

-<li><uicontrol>name</uicontrol>. In the Design view, click the name of the

-attribute to make a change.</li>

-<li><uicontrol>type</uicontrol>. In the Design view, click the type of the

-attribute to make a change. The drop-down menu provides commonly used types.

-For more options, simply select <uicontrol>Browse</uicontrol> from the menu.</li>

-</ul></choice>

-</choices>

-</step>

-<step><cmd>An attribute reference provides a reference to a global attribute.

-To add an attribute reference, in the Design view, right-click the complex

-type containing the element, and click <uicontrol>Add Attribute Ref</uicontrol>.</cmd>

-<info>A declaration that references a global attribute enables the referenced

-attribute to appear in the instance document in the context of the referencing

-declaration. Select the reference, then select the attribute group you want

-it to reference in the Properties view, from the<uicontrol> Ref</uicontrol> menu.</info>

-</step>

-<step><cmd>An attribute group reference provides a reference to an attribute

-group. To add an attribute group reference, in the Design view, right-click

-the complex type containing the element, and click <uicontrol>Add Attribute

-Group Ref</uicontrol>.</cmd><info>A declaration that references an attribute

-group enables the referenced attribute group to appear in the instance document

-in the context of the referencing declaration. Select the reference, then

-select the attribute group you want it to reference in the Properties view,

-from the<uicontrol> Ref</uicontrol> menu.</info></step>

-<step><cmd>An <codeph>any</codeph> element enables element content according

-to namespaces, and the corresponding <codeph>any</codeph> attribute element

-enables attributes to appear in elements. To add an <codeph>any</codeph> attribute,

-right-click in the complex type header, and click <uicontrol>Add Any Attribute</uicontrol>.</cmd>

-<info>You can specify the following values for an <codeph>any</codeph> attribute:</info>

-<choices>

-<choice>For a <uicontrol>namespace</uicontrol> value, you can

-select:<ul>

-<li><b>##any</b>. This allows any well-formed XML from any namespace.</li>

-<li><b>##local </b>. This allows any well-formed XML that is not declared

-to be in a namespace.</li>

-<li><b>##other</b>. This allows any well-formed XML that is not from the target

-namespace of the type being defined.</li>

-<li><b>##targetNamespace </b>. This is shorthand for the target namespace

-of the type being defined.</li>

-</ul></choice>

-<choice>For a <uicontrol>processContents</uicontrol> value, you can select:<ul>

-<li><b>skip</b>. The XML processor will not validate the attribute content

-at all.</li>

-<li><b>lax</b>. The XML processor will validate the attribute content as much

-as it can.</li>

-<li><b>strict</b>. The XML processor will validate all the attribute content.</li>

-</ul></choice>

-</choices>

-<info></info></step>

-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want

-to provide any information about this complex type.</cmd><info>The <uicontrol>Documentation</uicontrol> page

-is used for human readable material, such as a description.</info></step>

-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to

-add application information elements to your annotations of schema components.</cmd>

-<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the

-schema and add XML content to your annotations.</info></step>

 </steps>

 </taskbody>

 </task>

-<?Pub *0000006207?>

+<?Pub *0000003841?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmxt.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmxt.html
index 6204c40..78ee6f3 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmxt.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddcmxt.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Adding complex types" />
 <meta name="abstract" content="A complex type allows elements in its content and can carry attributes. Complex types can be used to help determine the appropriate content for any instance documents generated from or associated with your XML schema." />
 <meta name="description" content="A complex type allows elements in its content and can carry attributes. Complex types can be used to help determine the appropriate content for any instance documents generated from or associated with your XML schema." />
-<meta content="XML schema editor, adding, complex types, XML schema files, complex types, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, adding, complex types, XML schema files, complex types, XML schema files" name="keywords" />
+<meta content="XML schema editor, complex types, XML schema files" name="DC.subject" />
+<meta content="XML schema editor, complex types, XML schema files" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddcmod.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="taddcmxt" name="DC.Identifier" />
@@ -28,123 +28,76 @@
 
 
 
-<div><p>A complex type allows elements in its content and can carry attributes.
-Complex types can be used to help determine the appropriate content for any
-instance documents generated from or associated with your XML schema.</p>
+<div><p>A complex type allows elements in its content and can carry
+attributes. Complex types can be used to help determine the appropriate
+content for any instance documents generated from or associated with
+your XML schema.</p>
 
-<div class="section"><p>You can add as many complex types as you want to an XML schema.</p>
-<p>The
-following instructions were written for the Resource perspective, but they
-will also work in many other perspectives.</p>
-<p>To add a complex type to
-an XML schema, follow these steps:</p>
+<div class="section"><p>You can add as many complex types as you want to an XML
+schema.</p>
+<p>The following instructions were written for the Resource
+perspective, but they will also work in many other perspectives.</p>
+<p>To
+add a complex type to an XML schema, complete the following steps:</p>
 </div>
 
 <ol>
 <li class="stepexpand"><span>Open your XML schema in the XML schema editor.</span></li>
 
-<li class="stepexpand"><span>Right-click the Types category in the Design view, and click <span class="uicontrol">Add
-Complex Type</span>.</span></li>
+<li class="stepexpand"><span>Right-click the Types category in the Design view, click <span class="uicontrol">Add
+Complex Type</span> and type the name for the complex type. If
+you need to change the name later, you can edit it in the <span class="uicontrol">General</span> tab
+of the Properties view.</span></li>
 
-<li class="stepexpand"><span>In the Properties view, type a new name for the complex type in
-the <span class="uicontrol">Name</span> field.</span></li>
+<li class="stepexpand"><span>To set a base type for the complex type, right-click the
+type in the Design view and click <span class="uicontrol">Set Base Type</span>. </span>
+ You can either set a base type for your complex type, or you
+can add a content model to it (which represents any data that can
+be contained inside an element), but you cannot do both. For more
+information about content models, see <a href="taddcmod.html">Adding content models</a>.</li>
 
-<li class="stepexpand"><span>Click <span class="uicontrol">Browse</span> <img src="../images/Browse.gif" alt="Browse icon" /> to select a base type for your complex type.</span>
- You can either set a base type for your complex type, or you can add
-a content model to it (which represents any data that can be contained inside
-an element), but you cannot do both. For more information about content models,
-refer to the related tasks.</li>
+<li class="stepexpand"><span>Your new type can be derived from its base type either
+by extension or restriction. By default, the derivation is set to
+extension. To change how the type is derived, click the <span class="uicontrol">General</span> tab
+in the Properties view and select <span class="uicontrol">restriction</span> or <span class="uicontrol">extension</span> from
+the <span class="uicontrol">Inherited By</span> list. </span></li>
 
-<li class="stepexpand"><span>Select <span class="uicontrol">restriction</span> or <span class="uicontrol">extension</span> from
-the <span class="uicontrol">Inherited by</span> list.</span> This specifies whether
-your type is derived from its base type by restriction or extension.
+<li class="stepexpand"><span>To add attributes to your complex type, in the Design view,
+right-click your complex type and select <span class="uicontrol">Add Attribute</span>. </span>
+ An attribute associates an attribute name with a specific type
+and value. 
+<ol type="a">
+<li><span>To set the name of the attribute, in the Design view,
+double-click the name of the attribute and type the name.</span>
 </li>
 
-<li class="stepexpand"><span>The Design view will display the attributes within the complex
-type.</span> You can also use this view to add attributes to your complex
-type. An attribute associates an attribute name with a specific type and value.
-<ul>
-<li>To add an attribute, in the Design view, right click your complex
-type and select <span class="uicontrol">Add Attribute</span>.<ul>
-<li><span class="uicontrol">name</span>. In the Design view, click the name of the
-attribute to make a change.</li>
+<li><span>To set the type of the attribute, in the Design view,
+double-click the attribute type and then select the new type from
+the list.</span></li>
 
-<li><span class="uicontrol">type</span>. In the Design view, click the type of the
-attribute to make a change. The drop-down menu provides commonly used types.
-For more options, simply select <span class="uicontrol">Browse</span> from the menu.</li>
+</ol>
 
-</ul>
+ For information about adding attributes, attribute references,
+and <kbd class="userinput">any</kbd> attributes, see <a href="taddagrp.html">Adding attribute groups</a>.</li>
+
+<li class="stepexpand"><span>You can further define your complex type in the Properties
+view:</span>
+<ol type="a">
+<li class="substepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if
+you want to provide any information about this complex type. </span>
+ The <span class="uicontrol">Documentation</span> page is used for human
+readable material, such as a description.</li>
+
+<li class="substepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you
+want to add application information elements to your annotations of
+schema components. </span> The <span class="uicontrol">Extensions</span> page
+allows you to specify the schema and add XML content to your annotations.
 </li>
 
-</ul>
+</ol>
 
 </li>
 
-<li class="stepexpand"><span>An attribute reference provides a reference to a global attribute.
-To add an attribute reference, in the Design view, right-click the complex
-type containing the element, and click <span class="uicontrol">Add Attribute Ref</span>.</span>
- A declaration that references a global attribute enables the referenced
-attribute to appear in the instance document in the context of the referencing
-declaration. Select the reference, then select the attribute group you want
-it to reference in the Properties view, from the<span class="uicontrol"> Ref</span> menu.
-</li>
-
-<li class="stepexpand"><span>An attribute group reference provides a reference to an attribute
-group. To add an attribute group reference, in the Design view, right-click
-the complex type containing the element, and click <span class="uicontrol">Add Attribute
-Group Ref</span>.</span> A declaration that references an attribute
-group enables the referenced attribute group to appear in the instance document
-in the context of the referencing declaration. Select the reference, then
-select the attribute group you want it to reference in the Properties view,
-from the<span class="uicontrol"> Ref</span> menu.</li>
-
-<li class="stepexpand"><span>An <samp class="codeph">any</samp> element enables element content according
-to namespaces, and the corresponding <samp class="codeph">any</samp> attribute element
-enables attributes to appear in elements. To add an <samp class="codeph">any</samp> attribute,
-right-click in the complex type header, and click <span class="uicontrol">Add Any Attribute</span>.</span>
- You can specify the following values for an <samp class="codeph">any</samp> attribute:
-<ul>
-<li>For a <span class="uicontrol">namespace</span> value, you can
-select:<ul>
-<li><strong>##any</strong>. This allows any well-formed XML from any namespace.</li>
-
-<li><strong>##local </strong>. This allows any well-formed XML that is not declared
-to be in a namespace.</li>
-
-<li><strong>##other</strong>. This allows any well-formed XML that is not from the target
-namespace of the type being defined.</li>
-
-<li><strong>##targetNamespace </strong>. This is shorthand for the target namespace
-of the type being defined.</li>
-
-</ul>
-</li>
-
-<li>For a <span class="uicontrol">processContents</span> value, you can select:<ul>
-<li><strong>skip</strong>. The XML processor will not validate the attribute content
-at all.</li>
-
-<li><strong>lax</strong>. The XML processor will validate the attribute content as much
-as it can.</li>
-
-<li><strong>strict</strong>. The XML processor will validate all the attribute content.</li>
-
-</ul>
-</li>
-
-</ul>
-
- </li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
-to provide any information about this complex type.</span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you want to
-add application information elements to your annotations of schema components.</span>
- The <span class="uicontrol">Extensions</span> page allows you to specify the
-schema and add XML content to your annotations.</li>
-
 </ol>
 
 </div>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelm.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelm.dita
index 57eeb53..8b19bf5 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelm.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelm.dita
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2006, v.4002-->

+<?xml version="1.0" encoding="UTF-8"?>

+<!--Arbortext, Inc., 1988-2008, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <task id="taddelm" xml:lang="en-us">

@@ -7,61 +7,68 @@
 <titlealts>

 <searchtitle>Adding elements</searchtitle>

 </titlealts>

-<shortdesc>Elements are fundamental building blocks in XML. Element declarations

-provide value constraints, provide a description that can be used for validation,

-establish constraining relationships between related elements and attributes,

-and control the substitution of elements.</shortdesc>

+<shortdesc>Elements are fundamental building blocks in XML. Element

+declarations provide value constraints, provide a description that

+can be used for validation, establish constraining relationships between

+related elements and attributes, and control the substitution of elements.</shortdesc>

 <prolog><metadata>

 <keywords><indexterm>XML schema editor<indexterm>elements</indexterm></indexterm>

 <indexterm>XML schema files<indexterm>elements</indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <taskbody>

-<context><p>The following instructions were written for the Resource perspective,

-but they will also work in many other perspectives.</p><p>To add an element:</p></context>

+<context><p>The following instructions were written for the Resource

+perspective, but they will also work in many other perspectives.</p><p>To

+add an element, complete the following steps:</p></context>

 <steps>

-<step><cmd>To add an element, in the Design view, right-click the content

-model you want to work with and click <uicontrol>Add Element</uicontrol>.</cmd>

-<info>The element appears attached to the content model in the Design view.</info>

+<step><cmd>To add an element, in the Design view, right-click the

+content model (sequence, choice, or all element) you want to work

+with and click <uicontrol>Add Element</uicontrol>.</cmd><info>The

+element appears attached to the content model in the Design view.</info>

 <substeps>

-<substep><cmd>In the Design view, select the element, and click the current

-(default) name of the element, which puts you in direct editing mode, then

-type the new <uicontrol>Name</uicontrol> and press enter.</cmd></substep>

-<substep><cmd>In the Design view, click the current (default) element type

-and select a type from the menu. Alternately, you can select browse to invoke

-the Set Type dialog for more options.</cmd><info>The Set Type dialog lists

-all built-in and user-defined types currently available. You can change the <uicontrol>Scope</uicontrol> of

-the list by selecting one of the following options:<ul>

-<li><uicontrol>Workspace</uicontrol>. Lists all of the types available in

-your workspace.</li>

-<li><uicontrol>Enclosing Project</uicontrol>. Lists all of the types available

-in the project that contains your file.</li>

-<li>(Default) <uicontrol>Current Resource</uicontrol>. List all of the types

-available in your current file.</li>

-<li><uicontrol>Working Sets</uicontrol>. List all the types available within

-the selected working set.</li>

+<substep><cmd>In the Design view, select the element, and click the

+current (default) name of the element, which puts you in direct editing

+mode, then type the new <uicontrol>Name</uicontrol> and press enter.</cmd>

+</substep>

+<substep><cmd>In the Design view, click the current (default) element

+type and select a type from the menu. Alternately, you can select

+browse to invoke the Set Type dialog for more options.</cmd><info>The

+Set Type dialog lists all built-in and user-defined types currently

+available. You can change the <uicontrol>Scope</uicontrol> of the

+list by selecting one of the following options:<ul>

+<li><uicontrol>Workspace</uicontrol>: lists all of the types available

+in your workspace.</li>

+<li><uicontrol>Enclosing Project</uicontrol>: lists all of the types

+available in the project that contains your file.</li>

+<li>(Default) <uicontrol>Current Resource</uicontrol>: list all of

+the types available in your current file.</li>

+<li><uicontrol>Working Sets</uicontrol>: list all the types available

+within the selected working set.</li>

 </ul></info></substep>

 </substeps>

 </step>

-<step><cmd>(Optional) In the Properties view, select the appropriate value

-in the <uicontrol>MinOccurs</uicontrol> field.</cmd><info>This is the number

-of times the element can appear in an instance document. If you want the element

-to be optional, select <uicontrol>0</uicontrol>. Otherwise, select <uicontrol>1</uicontrol>. </info>

+<step><cmd>(Optional) In the Properties view, select the appropriate

+value in the <uicontrol>Minimum Occurrence</uicontrol> field. </cmd>

+<info>This is the number of times the element can appear in an instance

+document. If you want the element to be optional, select <uicontrol>0</uicontrol>.

+Otherwise, select <uicontrol>1</uicontrol>. </info></step>

+<step><cmd>(Optional) Select the appropriate value in the <uicontrol>Maximum

+Occurrence</uicontrol> field. </cmd><info>This is the maximum number

+of times the element can appear in an instance document. Select <uicontrol>unbounded</uicontrol> to

+indicate there is no maximum number of occurrences.</info></step>

+<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you

+want to provide any information about this element. </cmd><info>The <uicontrol>Documentation</uicontrol> page

+is used for human readable material, such as a description.</info>

 </step>

-<step><cmd>(Optional) Select the appropriate value in the <uicontrol>MaxOccurs</uicontrol> field.</cmd>

-<info>This is the maximum number of times the element can appear in an instance

-document. Select <uicontrol>unbounded</uicontrol> to indicate there is no

-maximum number of occurrences.</info></step>

-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want

-to provide any information about this element.</cmd><info>The <uicontrol>Documentation</uicontrol> page

-is used for human readable material, such as a description.</info></step>

-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to

-add application information elements to your annotations of schema components.</cmd>

-<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the

-schema and add XML content to your annotations.</info></step>

+<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you

+want to add application information elements to your annotations of

+schema components. <?Pub Caret?></cmd><info>The <uicontrol>Extensions</uicontrol> page

+allows you to specify the schema and add XML content to your annotations.</info>

+</step>

 </steps>

 <postreq>You can add a content model to an element, which is the representation

 of any data that can be contained inside the element. For more information

 about working with content models, refer to the related tasks.</postreq>

 </taskbody>

 </task>

+<?Pub *0000003893?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelm.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelm.html
index a9b3cb7..4b15f37 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelm.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelm.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Adding elements" />
 <meta name="abstract" content="Elements are fundamental building blocks in XML. Element declarations provide value constraints, provide a description that can be used for validation, establish constraining relationships between related elements and attributes, and control the substitution of elements." />
 <meta name="description" content="Elements are fundamental building blocks in XML. Element declarations provide value constraints, provide a description that can be used for validation, establish constraining relationships between related elements and attributes, and control the substitution of elements." />
-<meta content="XML schema editor, adding, elements, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, adding, elements, XML schema files" name="keywords" />
+<meta content="XML schema editor, elements, XML schema files" name="DC.subject" />
+<meta content="XML schema editor, elements, XML schema files" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddcmod.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddelmr.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddanye.html" />
@@ -31,41 +31,45 @@
 
 
 
-<div><p>Elements are fundamental building blocks in XML. Element declarations
-provide value constraints, provide a description that can be used for validation,
-establish constraining relationships between related elements and attributes,
-and control the substitution of elements.</p>
+<div><p>Elements are fundamental building blocks in XML. Element
+declarations provide value constraints, provide a description that
+can be used for validation, establish constraining relationships between
+related elements and attributes, and control the substitution of elements.</p>
 
-<div class="section"><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p>
-<p>To add an element:</p>
+<div class="section"><p>The following instructions were written for the Resource
+perspective, but they will also work in many other perspectives.</p>
+<p>To
+add an element, complete the following steps:</p>
 </div>
 
 <ol>
-<li class="stepexpand"><span>To add an element, in the Design view, right-click the content
-model you want to work with and click <span class="uicontrol">Add Element</span>.</span>
- The element appears attached to the content model in the Design view.
+<li class="stepexpand"><span>To add an element, in the Design view, right-click the
+content model (sequence, choice, or all element) you want to work
+with and click <span class="uicontrol">Add Element</span>.</span> The
+element appears attached to the content model in the Design view.
 <ol type="a">
-<li class="substepexpand"><span>In the Design view, select the element, and click the current
-(default) name of the element, which puts you in direct editing mode, then
-type the new <span class="uicontrol">Name</span> and press enter.</span></li>
+<li class="substepexpand"><span>In the Design view, select the element, and click the
+current (default) name of the element, which puts you in direct editing
+mode, then type the new <span class="uicontrol">Name</span> and press enter.</span>
+</li>
 
-<li class="substepexpand"><span>In the Design view, click the current (default) element type
-and select a type from the menu. Alternately, you can select browse to invoke
-the Set Type dialog for more options.</span> The Set Type dialog lists
-all built-in and user-defined types currently available. You can change the <span class="uicontrol">Scope</span> of
-the list by selecting one of the following options:<ul>
-<li><span class="uicontrol">Workspace</span>. Lists all of the types available in
-your workspace.</li>
+<li class="substepexpand"><span>In the Design view, click the current (default) element
+type and select a type from the menu. Alternately, you can select
+browse to invoke the Set Type dialog for more options.</span> The
+Set Type dialog lists all built-in and user-defined types currently
+available. You can change the <span class="uicontrol">Scope</span> of the
+list by selecting one of the following options:<ul>
+<li><span class="uicontrol">Workspace</span>: lists all of the types available
+in your workspace.</li>
 
-<li><span class="uicontrol">Enclosing Project</span>. Lists all of the types available
-in the project that contains your file.</li>
+<li><span class="uicontrol">Enclosing Project</span>: lists all of the types
+available in the project that contains your file.</li>
 
-<li>(Default) <span class="uicontrol">Current Resource</span>. List all of the types
-available in your current file.</li>
+<li>(Default) <span class="uicontrol">Current Resource</span>: list all of
+the types available in your current file.</li>
 
-<li><span class="uicontrol">Working Sets</span>. List all the types available within
-the selected working set.</li>
+<li><span class="uicontrol">Working Sets</span>: list all the types available
+within the selected working set.</li>
 
 </ul>
 </li>
@@ -74,25 +78,27 @@
 
 </li>
 
-<li class="stepexpand"><span>(Optional) In the Properties view, select the appropriate value
-in the <span class="uicontrol">MinOccurs</span> field.</span> This is the number
-of times the element can appear in an instance document. If you want the element
-to be optional, select <span class="uicontrol">0</span>. Otherwise, select <span class="uicontrol">1</span>. 
+<li class="stepexpand"><span>(Optional) In the Properties view, select the appropriate
+value in the <span class="uicontrol">Minimum Occurrence</span> field. </span>
+ This is the number of times the element can appear in an instance
+document. If you want the element to be optional, select <span class="uicontrol">0</span>.
+Otherwise, select <span class="uicontrol">1</span>. </li>
+
+<li class="stepexpand"><span>(Optional) Select the appropriate value in the <span class="uicontrol">Maximum
+Occurrence</span> field. </span> This is the maximum number
+of times the element can appear in an instance document. Select <span class="uicontrol">unbounded</span> to
+indicate there is no maximum number of occurrences.</li>
+
+<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you
+want to provide any information about this element. </span> The <span class="uicontrol">Documentation</span> page
+is used for human readable material, such as a description.
 </li>
 
-<li class="stepexpand"><span>(Optional) Select the appropriate value in the <span class="uicontrol">MaxOccurs</span> field.</span>
- This is the maximum number of times the element can appear in an instance
-document. Select <span class="uicontrol">unbounded</span> to indicate there is no
-maximum number of occurrences.</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
-to provide any information about this element.</span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you want to
-add application information elements to your annotations of schema components.</span>
- The <span class="uicontrol">Extensions</span> page allows you to specify the
-schema and add XML content to your annotations.</li>
+<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you
+want to add application information elements to your annotations of
+schema components. </span> The <span class="uicontrol">Extensions</span> page
+allows you to specify the schema and add XML content to your annotations.
+</li>
 
 </ol>
 
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelmr.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelmr.dita
index 0a41c6a..21c66d3 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelmr.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelmr.dita
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <?Pub Inc?>

@@ -20,30 +20,31 @@
 <taskbody>

 <context><p>The following instructions were written for the Resource perspective,

 but they will also work in many other perspectives.</p><p>To add an element

-reference:</p></context>

+reference, complete the following steps:</p></context>

 <steps>

-<step><cmd>In the Design view, right-click the content model you want to work

-with and click <uicontrol>Add Element Ref</uicontrol>.</cmd><stepresult>If

-no global element is defined in the document, a new global element is created

-for you, and the element reference will point to it.</stepresult></step>

+<step><cmd>In the Design view, right-click the content model (sequence, choice,

+or all element) you want to work with and click <uicontrol>Add Element Ref</uicontrol>.</cmd>

+<stepresult>If no global element is defined in the document, a new global

+element is created for you, and the element reference will point to it.</stepresult>

+</step>

 <step><cmd>Select the element reference. To specify values for an element

 reference:</cmd>

 <choices>

 <choice>Click the name of the element reference in the Design view. Enter

 the name of the element reference.</choice>

-<choice>Click the element reference type in the Design view.

-Select a type from the menu, or select <uicontrol>Browse</uicontrol> for more

-options.</choice>

+<choice>Click the element reference type in the Design view. Select a type

+from the menu, or select <uicontrol>Browse</uicontrol> for more options.</choice>

 </choices>

 </step>

-<step><cmd>(Optional) Select the appropriate value in the <uicontrol>MinOccurs</uicontrol> field.</cmd>

-<info>This is the number of times the global element referenced can appear

-in an instance document. If you want the element to be optional, select <uicontrol>0</uicontrol>.

-Otherwise, select <uicontrol>1</uicontrol>. </info></step>

-<step><cmd>(Optional) Select the appropriate value in the <uicontrol>MaxOccurs</uicontrol> field.</cmd>

-<info>This is the maximum number of times the global element referenced can

-appear. You can select <uicontrol>unbounded</uicontrol> to indicate there

-is no maximum number of occurrences.</info></step>

+<step><cmd>(Optional) Select the appropriate value in the <uicontrol>Minimum

+Occurrence</uicontrol> field.</cmd><info>This is the number of times the global

+element referenced can appear in an instance document. If you want the element

+to be optional, select <uicontrol>0</uicontrol>. Otherwise, select <uicontrol>1</uicontrol>. </info>

+</step>

+<step><cmd>(Optional) Select the appropriate value in the <uicontrol>Maximum

+Occurrence<?Pub Caret?></uicontrol> field.</cmd><info>This is the maximum

+number of times the global element referenced can appear. You can select <uicontrol>unbounded</uicontrol> to

+indicate there is no maximum number of occurrences.</info></step>

 <step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want

 to provide any information about this element reference.</cmd><info>The <uicontrol>Documentation</uicontrol> page

 is used for human readable material, such as a description.</info></step>

@@ -54,4 +55,4 @@
 </steps>

 </taskbody>

 </task>

-<?Pub *0000003232?>

+<?Pub *0000003039?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelmr.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelmr.html
index 40177eb..a85ec38 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelmr.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddelmr.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Adding element references" />
 <meta name="abstract" content="An element reference provides a reference to a global element. A declaration that references a global element enables the referenced global element to appear in the instance document in the context of the referencing declaration." />
 <meta name="description" content="An element reference provides a reference to a global element. A declaration that references a global element enables the referenced global element to appear in the instance document in the context of the referencing declaration." />
-<meta content="XML schema editor, adding, element references, XML schema files, element references, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, adding, element references, XML schema files, element references, XML schema files" name="keywords" />
+<meta content="XML schema editor, element references, XML schema files" name="DC.subject" />
+<meta content="XML schema editor, element references, XML schema files" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddglem.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddelm.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddanye.html" />
@@ -39,14 +39,15 @@
 <div class="section"><p>The following instructions were written for the Resource perspective,
 but they will also work in many other perspectives.</p>
 <p>To add an element
-reference:</p>
+reference, complete the following steps:</p>
 </div>
 
 <ol>
-<li class="stepexpand"><span>In the Design view, right-click the content model you want to work
-with and click <span class="uicontrol">Add Element Ref</span>.</span> If
-no global element is defined in the document, a new global element is created
-for you, and the element reference will point to it.</li>
+<li class="stepexpand"><span>In the Design view, right-click the content model (sequence, choice,
+or all element) you want to work with and click <span class="uicontrol">Add Element Ref</span>.</span>
+ If no global element is defined in the document, a new global
+element is created for you, and the element reference will point to it.
+</li>
 
 <li class="stepexpand"><span>Select the element reference. To specify values for an element
 reference:</span>
@@ -54,23 +55,23 @@
 <li>Click the name of the element reference in the Design view. Enter
 the name of the element reference.</li>
 
-<li>Click the element reference type in the Design view.
-Select a type from the menu, or select <span class="uicontrol">Browse</span> for more
-options.</li>
+<li>Click the element reference type in the Design view. Select a type
+from the menu, or select <span class="uicontrol">Browse</span> for more options.</li>
 
 </ul>
 
 </li>
 
-<li class="stepexpand"><span>(Optional) Select the appropriate value in the <span class="uicontrol">MinOccurs</span> field.</span>
- This is the number of times the global element referenced can appear
-in an instance document. If you want the element to be optional, select <span class="uicontrol">0</span>.
-Otherwise, select <span class="uicontrol">1</span>. </li>
+<li class="stepexpand"><span>(Optional) Select the appropriate value in the <span class="uicontrol">Minimum
+Occurrence</span> field.</span> This is the number of times the global
+element referenced can appear in an instance document. If you want the element
+to be optional, select <span class="uicontrol">0</span>. Otherwise, select <span class="uicontrol">1</span>. 
+</li>
 
-<li class="stepexpand"><span>(Optional) Select the appropriate value in the <span class="uicontrol">MaxOccurs</span> field.</span>
- This is the maximum number of times the global element referenced can
-appear. You can select <span class="uicontrol">unbounded</span> to indicate there
-is no maximum number of occurrences.</li>
+<li class="stepexpand"><span>(Optional) Select the appropriate value in the <span class="uicontrol">Maximum
+Occurrence</span> field.</span> This is the maximum
+number of times the global element referenced can appear. You can select <span class="uicontrol">unbounded</span> to
+indicate there is no maximum number of occurrences.</li>
 
 <li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
 to provide any information about this element reference.</span> The <span class="uicontrol">Documentation</span> page
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglba.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglba.dita
index 719033f..e3ad077 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglba.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglba.dita
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <?Pub Inc?>

@@ -19,7 +19,7 @@
 <taskbody>

 <context><p>The following instructions were written for the Resource perspective,

 but they will also work in many other perspectives.</p><p>To add a global

-attribute:</p></context>

+attribute, complete the following steps:</p></context>

 <steps>

 <step><cmd>Open your XML schema in the XML schema editor.</cmd></step>

 <step><cmd>In the Design view, right-click in the <b>Attributes</b> section

@@ -32,14 +32,14 @@
 the list for more options. </p><p>The Set Type dialog will appear, and lists

 all built-in and user-defined types currently available. You can change the <uicontrol>Scope</uicontrol> of

 the list by selecting one of the following options:<ul>

-<li><uicontrol>Workspace</uicontrol>. Lists all of the types available in

+<li><uicontrol>Workspace</uicontrol>: lists all of the types available in

 your workspace. </li>

-<li><uicontrol>Enclosing Project</uicontrol>. Lists all of the types available

+<li><uicontrol>Enclosing Project</uicontrol>: lists all of the types available

 in the project that contains your file. </li>

-<li>(Default) <uicontrol>Current Resource</uicontrol>. List all of the types

+<li>(Default) <uicontrol>Current Resource</uicontrol>: list all of the types

 available in your current file.</li>

-<li><uicontrol>Working Sets</uicontrol>. List all the types available within

-the selected working set.</li>

+<li><uicontrol>Working Sets</uicontrol>: l<?Pub Caret?>ist all the types available

+within the selected working set.</li>

 </ul></p><p>Select the type you want in the type list, then click <uicontrol>OK</uicontrol>. </p></info>

 </step>

 <step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want

@@ -52,4 +52,4 @@
 </steps>

 </taskbody>

 </task>

-<?Pub *0000003230?>

+<?Pub *0000002983?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglba.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglba.html
index 29b0abf..f7b145b 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglba.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglba.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Adding global attributes" />
 <meta name="abstract" content="A global attribute is an attribute that can be recognized anywhere in a document. Once declared, a global attribute can be referenced in one or more declarations using an attribute reference." />
 <meta name="description" content="A global attribute is an attribute that can be recognized anywhere in a document. Once declared, a global attribute can be referenced in one or more declarations using an attribute reference." />
-<meta content="XML schema editor, adding, global attributes, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, adding, global attributes, XML schema files" name="keywords" />
+<meta content="XML schema editor, global attributes, XML schema files" name="DC.subject" />
+<meta content="XML schema editor, global attributes, XML schema files" name="keywords" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="taddglba" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -34,7 +34,7 @@
 <div class="section"><p>The following instructions were written for the Resource perspective,
 but they will also work in many other perspectives.</p>
 <p>To add a global
-attribute:</p>
+attribute, complete the following steps:</p>
 </div>
 
 <ol>
@@ -53,17 +53,17 @@
 <div class="p">The Set Type dialog will appear, and lists
 all built-in and user-defined types currently available. You can change the <span class="uicontrol">Scope</span> of
 the list by selecting one of the following options:<ul>
-<li><span class="uicontrol">Workspace</span>. Lists all of the types available in
+<li><span class="uicontrol">Workspace</span>: lists all of the types available in
 your workspace. </li>
 
-<li><span class="uicontrol">Enclosing Project</span>. Lists all of the types available
+<li><span class="uicontrol">Enclosing Project</span>: lists all of the types available
 in the project that contains your file. </li>
 
-<li>(Default) <span class="uicontrol">Current Resource</span>. List all of the types
+<li>(Default) <span class="uicontrol">Current Resource</span>: list all of the types
 available in your current file.</li>
 
-<li><span class="uicontrol">Working Sets</span>. List all the types available within
-the selected working set.</li>
+<li><span class="uicontrol">Working Sets</span>: list all the types available
+within the selected working set.</li>
 
 </ul>
 </div>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglem.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglem.dita
index 1dfe97d..90abd00 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglem.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglem.dita
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <?Pub Inc?>

@@ -19,7 +19,7 @@
 <taskbody>

 <context><p>The following instructions were written for the Resource perspective,

 but they will also work in many other perspectives.</p><p>To add a global

-element:</p></context>

+element, complete the following steps:</p></context>

 <steps>

 <step><cmd>Open your XML schema in the XML schema editor.</cmd></step>

 <step><cmd>In the Outline view, select your schema.</cmd><info>The entire

@@ -36,122 +36,44 @@
 box appears, and lists all built-in and user-defined types currently available.

 You can change the <uicontrol>Scope</uicontrol> of the list by selecting one

 of the following options:<ul>

-<li><uicontrol>Workspace</uicontrol>. Lists all of the types available in

+<li><uicontrol>Workspace</uicontrol>: lists all of the types available in

 your workspace. </li>

-<li><uicontrol>Enclosing Project</uicontrol>. Lists all of the types available

+<li><uicontrol>Enclosing Project</uicontrol>: lists all of the types available

 in the project that contains your file. </li>

-<li>(Default) <uicontrol>Current Resource</uicontrol>. List all of the types

+<li>(Default) <uicontrol>Current Resource</uicontrol>: list all of the types

 available in your current file.</li>

-<li><uicontrol>Working Sets</uicontrol>. List all the types available within

+<li><uicontrol>Working Sets</uicontrol>: list all the types available within

 the selected working set.</li>

 </ul></p><p>Select the type you want in the type list, then click <uicontrol>OK</uicontrol>. </p></info>

 </step>

-<step><cmd>(Optional) Click the <uicontrol>Other</uicontrol> tab.</cmd><info>In

-this page, you can specify the following various values for the global element: </info>

+<step><cmd>Click the <uicontrol>Advanced</uicontrol> tab.</cmd><info>In this

+page, you can specify the following various values for the global element: </info>

 <choices>

-<choice><uicontrol>abstract</uicontrol>. Click <b>true </b>if you want the

+<choice><uicontrol>Abstract</uicontrol>: click <b>true</b> if you want the

 global element to be abstract. When a global element is declared to be abstract,

 it cannot be used in an instance document. Instead, a member of that global

 element's substitution group must appear in the instance document.</choice>

-<choice><uicontrol>block</uicontrol>. This field determines whether the global

-element may be replaced by an element derived from it.</choice>

-<choice><uicontrol>final</uicontrol>. This field determines whether this global

-element may be derived from.</choice>

-<choice><uicontrol>fixed/default</uicontrol>. Click <uicontrol>Browse</uicontrol> and

-select <uicontrol>Fixed</uicontrol> or <uicontrol>Default</uicontrol> and

-specify an appropriate value. If you select <b>Fixed</b>, the global element

-has a fixed value, which cannot be changed. If you select <b>Default</b>,

-the element has a default value.</choice>

-<choice><uicontrol>form</uicontrol>. Use this field to indicate if the appearance

-of this global element in an instance of the XML schema (an XML file associated

-with the XML schema) must be qualified by a namespace.</choice>

-<choice><uicontrol>nillable</uicontrol>. Select <b>true</b> if you do not

-want the global element to be able to have any child elements, only attributes. </choice>

-<choice><uicontrol>substitutionGroup</uicontrol>. A substitution group allows

+<choice><uicontrol>Block</uicontrol>: determines whether the global element

+may be replaced by an element derived from it.</choice>

+<choice><uicontrol>Final</uicontrol>: determines whether this global element

+may be derived from.</choice>

+<choice><uicontrol>Substitution Group</uicontrol>: a substitution group allows

 elements to be substituted for other elements.</choice>

+<choice><uicontrol>Nillable</uicontrol>: select <b>true</b> if you do not

+want the global element to be able to have any child elements, only attributes. </choice>

 </choices>

 </step>

-<step><cmd>Click the <uicontrol>Attributes</uicontrol> tab.</cmd><info>You

-can use this page to add attributes, attribute references, attributes group

-references, and <codeph>any</codeph> attributes to your global element.</info>

-</step>

-<step><cmd>An attribute associates an attribute name with a specific type

-and value. To add an attribute, right-click in the Attributes page, and click <uicontrol>Add

-Attribute</uicontrol>.</cmd><info>You can specify the following values for

-an attribute:</info>

-<choices>

-<choice><uicontrol>fixed/default</uicontrol>. Click <uicontrol>Browse</uicontrol> and

-select <uicontrol>Fixed</uicontrol> or <uicontrol>Default</uicontrol> and

-specify an appropriate value. If you select <b>Fixed</b>, the attribute has

-a fixed value, which cannot be changed. If you select <b>Default</b>, the

-attribute has a default value.</choice>

-<choice><uicontrol>form</uicontrol>. Use this field to indicate if the appearance

-of this attribute in an instance of the XML schema must be qualified by a

-namespace.</choice>

-<choice><uicontrol>name</uicontrol>. Enter the name of the attribute.</choice>

-<choice><uicontrol>type</uicontrol>. Click <uicontrol>Browse</uicontrol> and

-select the type of the attribute. </choice>

-<choice><uicontrol>use</uicontrol>. This field indicates how an attribute

-can be used in an instance document. If you select optional, the attribute

-can appear once, but it does not have to. If you select required, the attribute

-must appear once. If you select prohibited, the attribute must not appear. <b>Note</b>:

-If you selected <uicontrol>Default</uicontrol>, you must select <b>optional</b> in

-this field, otherwise the default value will not be valid.</choice>

-</choices>

-</step>

-<step><cmd>An attribute reference provides a reference to a global attribute.

-To add an attribute reference, right-click in the Attributes page, and click <uicontrol>Add

-Attribute Ref</uicontrol>.</cmd><info>A declaration that references a global

-attribute enables the referenced attribute to appear in the instance document

-in the context of the referencing declaration. The menu option to add an attribute

-reference only appears if there are global attributes defined elsewhere in

-the document. Select the reference, then select the global attribute you want

-it to reference from the <uicontrol>ref</uicontrol> list.</info></step>

-<step><cmd>An attribute group reference provides a reference to an attribute

-group. To add an attribute group reference, right-click in the Attributes

-page, and click <uicontrol>Add Attribute Group Ref</uicontrol>.</cmd><info>A

-declaration that references an attribute group enables the referenced attribute

-group to appear in the instance document in the context of the referencing

-declaration. The menu option to add an attribute group reference only appears

-if there are attribute groups defined elsewhere in the document. Select the

-reference, then select the attribute group you want it to reference from the <uicontrol>ref</uicontrol> list.</info>

-</step>

-<step><cmd>An <codeph>any</codeph> element enables element content according

-to namespaces, and the corresponding <codeph>any</codeph> attribute element

-enables attributes to appear in elements. To add an <codeph>any</codeph> attribute,

-right-click in the Attributes page and click <uicontrol>Add Any Attribute</uicontrol>.</cmd>

-<info>You can specify the following values for an <codeph>any</codeph> attribute:</info>

-<choices>

-<choice>For a <uicontrol>namespace</uicontrol> value, you can

-select:<ul>

-<li><b>##any</b>. This allows any well-formed XML from any namespace.</li>

-<li><b>##local </b>. This allows any well-formed XML that is not declared

-to be in a namespace.</li>

-<li><b>##other</b>. This allows any well-formed XML that is not from the target

-namespace of the type being defined.</li>

-<li><b>##targetNamespace </b>. This is shorthand for the target namespace

-of the type being defined.</li>

-</ul></choice>

-<choice>For a <uicontrol>processContents</uicontrol> value, you can select:<ul>

-<li><b>skip</b>. The XML processor will not validate the attribute content

-at all.</li>

-<li><b>lax</b>. The XML processor will validate the attribute content as much

-as it can.</li>

-<li><b>strict</b>. The XML processor will validate all the attribute content.</li>

-</ul></choice>

-</choices>

-</step>

-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want

-to provide any information about this global element.</cmd><info>The <uicontrol>Documentation</uicontrol> page

+<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab to provide any

+information about this global element.</cmd><info>The <uicontrol>Documentation</uicontrol> page

 is used for human readable material, such as a description.</info></step>

-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to

-add application information elements to your annotations of schema components.</cmd>

-<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the

-schema and add XML content to your annotations.</info></step>

+<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab to add application

+information elements to your annotations of schema components.</cmd><info>The <uicontrol>Extensions</uicontrol> page

+allows you to specify the schema and add XML content to your annotations.</info>

+</step><?Pub Caret?>

 </steps>

 <postreq>You can add a content model to a global element, which is the representation

 of any data that can be contained inside the global element. For more information

 about working with content models, refer to the related tasks.</postreq>

 </taskbody>

 </task>

-<?Pub *0000009579?>

+<?Pub *0000004383?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglem.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglem.html
index f38c0d5..2ba1df3 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglem.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddglem.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Adding global elements" />
 <meta name="abstract" content="A global element is an element with a global scope. It is one that has been declared as part of the main schema rather than as part of a content model." />
 <meta name="description" content="A global element is an element with a global scope. It is one that has been declared as part of the main schema rather than as part of a content model." />
-<meta content="XML schema editor, adding, global elements, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, adding, global elements, XML schema files" name="keywords" />
+<meta content="XML schema editor, global elements, XML schema files" name="DC.subject" />
+<meta content="XML schema editor, global elements, XML schema files" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddcmod.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddelmr.html" />
 <meta content="XHTML" name="DC.Format" />
@@ -36,7 +36,7 @@
 <div class="section"><p>The following instructions were written for the Resource perspective,
 but they will also work in many other perspectives.</p>
 <p>To add a global
-element:</p>
+element, complete the following steps:</p>
 </div>
 
 <ol>
@@ -60,16 +60,16 @@
 box appears, and lists all built-in and user-defined types currently available.
 You can change the <span class="uicontrol">Scope</span> of the list by selecting one
 of the following options:<ul>
-<li><span class="uicontrol">Workspace</span>. Lists all of the types available in
+<li><span class="uicontrol">Workspace</span>: lists all of the types available in
 your workspace. </li>
 
-<li><span class="uicontrol">Enclosing Project</span>. Lists all of the types available
+<li><span class="uicontrol">Enclosing Project</span>: lists all of the types available
 in the project that contains your file. </li>
 
-<li>(Default) <span class="uicontrol">Current Resource</span>. List all of the types
+<li>(Default) <span class="uicontrol">Current Resource</span>: list all of the types
 available in your current file.</li>
 
-<li><span class="uicontrol">Working Sets</span>. List all the types available within
+<li><span class="uicontrol">Working Sets</span>: list all the types available within
 the selected working set.</li>
 
 </ul>
@@ -78,141 +78,38 @@
 
 </li>
 
-<li class="stepexpand"><span>(Optional) Click the <span class="uicontrol">Other</span> tab.</span> In
-this page, you can specify the following various values for the global element: 
+<li class="stepexpand"><span>Click the <span class="uicontrol">Advanced</span> tab.</span> In this
+page, you can specify the following various values for the global element: 
 <ul>
-<li><span class="uicontrol">abstract</span>. Click <strong>true </strong>if you want the
+<li><span class="uicontrol">Abstract</span>: click <strong>true</strong> if you want the
 global element to be abstract. When a global element is declared to be abstract,
 it cannot be used in an instance document. Instead, a member of that global
 element's substitution group must appear in the instance document.</li>
 
-<li><span class="uicontrol">block</span>. This field determines whether the global
-element may be replaced by an element derived from it.</li>
+<li><span class="uicontrol">Block</span>: determines whether the global element
+may be replaced by an element derived from it.</li>
 
-<li><span class="uicontrol">final</span>. This field determines whether this global
-element may be derived from.</li>
+<li><span class="uicontrol">Final</span>: determines whether this global element
+may be derived from.</li>
 
-<li><span class="uicontrol">fixed/default</span>. Click <span class="uicontrol">Browse</span> and
-select <span class="uicontrol">Fixed</span> or <span class="uicontrol">Default</span> and
-specify an appropriate value. If you select <strong>Fixed</strong>, the global element
-has a fixed value, which cannot be changed. If you select <strong>Default</strong>,
-the element has a default value.</li>
-
-<li><span class="uicontrol">form</span>. Use this field to indicate if the appearance
-of this global element in an instance of the XML schema (an XML file associated
-with the XML schema) must be qualified by a namespace.</li>
-
-<li><span class="uicontrol">nillable</span>. Select <strong>true</strong> if you do not
-want the global element to be able to have any child elements, only attributes. </li>
-
-<li><span class="uicontrol">substitutionGroup</span>. A substitution group allows
+<li><span class="uicontrol">Substitution Group</span>: a substitution group allows
 elements to be substituted for other elements.</li>
 
-</ul>
-
-</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Attributes</span> tab.</span> You
-can use this page to add attributes, attribute references, attributes group
-references, and <samp class="codeph">any</samp> attributes to your global element.
-</li>
-
-<li class="stepexpand"><span>An attribute associates an attribute name with a specific type
-and value. To add an attribute, right-click in the Attributes page, and click <span class="uicontrol">Add
-Attribute</span>.</span> You can specify the following values for
-an attribute:
-<ul>
-<li><span class="uicontrol">fixed/default</span>. Click <span class="uicontrol">Browse</span> and
-select <span class="uicontrol">Fixed</span> or <span class="uicontrol">Default</span> and
-specify an appropriate value. If you select <strong>Fixed</strong>, the attribute has
-a fixed value, which cannot be changed. If you select <strong>Default</strong>, the
-attribute has a default value.</li>
-
-<li><span class="uicontrol">form</span>. Use this field to indicate if the appearance
-of this attribute in an instance of the XML schema must be qualified by a
-namespace.</li>
-
-<li><span class="uicontrol">name</span>. Enter the name of the attribute.</li>
-
-<li><span class="uicontrol">type</span>. Click <span class="uicontrol">Browse</span> and
-select the type of the attribute. </li>
-
-<li><span class="uicontrol">use</span>. This field indicates how an attribute
-can be used in an instance document. If you select optional, the attribute
-can appear once, but it does not have to. If you select required, the attribute
-must appear once. If you select prohibited, the attribute must not appear. <strong>Note</strong>:
-If you selected <span class="uicontrol">Default</span>, you must select <strong>optional</strong> in
-this field, otherwise the default value will not be valid.</li>
+<li><span class="uicontrol">Nillable</span>: select <strong>true</strong> if you do not
+want the global element to be able to have any child elements, only attributes. </li>
 
 </ul>
 
 </li>
 
-<li class="stepexpand"><span>An attribute reference provides a reference to a global attribute.
-To add an attribute reference, right-click in the Attributes page, and click <span class="uicontrol">Add
-Attribute Ref</span>.</span> A declaration that references a global
-attribute enables the referenced attribute to appear in the instance document
-in the context of the referencing declaration. The menu option to add an attribute
-reference only appears if there are global attributes defined elsewhere in
-the document. Select the reference, then select the global attribute you want
-it to reference from the <span class="uicontrol">ref</span> list.</li>
-
-<li class="stepexpand"><span>An attribute group reference provides a reference to an attribute
-group. To add an attribute group reference, right-click in the Attributes
-page, and click <span class="uicontrol">Add Attribute Group Ref</span>.</span> A
-declaration that references an attribute group enables the referenced attribute
-group to appear in the instance document in the context of the referencing
-declaration. The menu option to add an attribute group reference only appears
-if there are attribute groups defined elsewhere in the document. Select the
-reference, then select the attribute group you want it to reference from the <span class="uicontrol">ref</span> list.
-</li>
-
-<li class="stepexpand"><span>An <samp class="codeph">any</samp> element enables element content according
-to namespaces, and the corresponding <samp class="codeph">any</samp> attribute element
-enables attributes to appear in elements. To add an <samp class="codeph">any</samp> attribute,
-right-click in the Attributes page and click <span class="uicontrol">Add Any Attribute</span>.</span>
- You can specify the following values for an <samp class="codeph">any</samp> attribute:
-<ul>
-<li>For a <span class="uicontrol">namespace</span> value, you can
-select:<ul>
-<li><strong>##any</strong>. This allows any well-formed XML from any namespace.</li>
-
-<li><strong>##local </strong>. This allows any well-formed XML that is not declared
-to be in a namespace.</li>
-
-<li><strong>##other</strong>. This allows any well-formed XML that is not from the target
-namespace of the type being defined.</li>
-
-<li><strong>##targetNamespace </strong>. This is shorthand for the target namespace
-of the type being defined.</li>
-
-</ul>
-</li>
-
-<li>For a <span class="uicontrol">processContents</span> value, you can select:<ul>
-<li><strong>skip</strong>. The XML processor will not validate the attribute content
-at all.</li>
-
-<li><strong>lax</strong>. The XML processor will validate the attribute content as much
-as it can.</li>
-
-<li><strong>strict</strong>. The XML processor will validate all the attribute content.</li>
-
-</ul>
-</li>
-
-</ul>
-
-</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
-to provide any information about this global element.</span> The <span class="uicontrol">Documentation</span> page
+<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab to provide any
+information about this global element.</span> The <span class="uicontrol">Documentation</span> page
 is used for human readable material, such as a description.</li>
 
-<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you want to
-add application information elements to your annotations of schema components.</span>
- The <span class="uicontrol">Extensions</span> page allows you to specify the
-schema and add XML content to your annotations.</li>
+<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab to add application
+information elements to your annotations of schema components.</span> The <span class="uicontrol">Extensions</span> page
+allows you to specify the schema and add XML content to your annotations.
+</li>
 
 </ol>
 
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrpr.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrpr.dita
index 3aa051e..6f0ec02 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrpr.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrpr.dita
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <?Pub Inc?>

@@ -20,7 +20,7 @@
 <context>The menu option to add a group reference only appears if there are

 groups defined elsewhere in the document.<p>The following instructions were

 written for the Resource perspective, but they will also work in many other

-perspectives.</p><p>To add a group reference, follow these steps:</p></context>

+perspectives.</p><p>To add a group reference, complete the following steps<?Pub Caret?>:</p></context>

 <steps>

 <step><cmd>In the Design view, right-click the content model you want to work

 with and select <uicontrol>Add Group Ref</uicontrol>.</cmd></step>

@@ -29,8 +29,7 @@
 the <uicontrol>ref</uicontrol> list.</cmd></step>

 <step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want

 to provide any information about this group reference.</cmd><info>The <uicontrol>Documentation</uicontrol> page

-is used for human readable material, such as a description.</info>

-</step>

+is used for human readable material, such as a description.</info></step>

 <step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to

 add application information elements to your annotations of schema components.</cmd>

 <info>The <uicontrol>Extensions</uicontrol> page allows you to specify the

@@ -38,4 +37,4 @@
 </steps>

 </taskbody>

 </task>

-<?Pub *0000002277?>

+<?Pub *0000002007?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrpr.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrpr.html
index 130e49a..fe0d7bb 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrpr.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrpr.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Adding group references" />
 <meta name="abstract" content="A group reference is a declaration that references a group. It enables the referenced group to appear in the instance document in the context of the referencing declaration." />
 <meta name="description" content="A group reference is a declaration that references a group. It enables the referenced group to appear in the instance document in the context of the referencing declaration." />
-<meta content="XML schema editor, adding, group references, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, adding, group references, XML schema files" name="keywords" />
+<meta content="XML schema editor, group features, XML schema files" name="DC.subject" />
+<meta content="XML schema editor, group features, XML schema files" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddgrup.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="taddgrpr" name="DC.Identifier" />
@@ -36,7 +36,7 @@
 groups defined elsewhere in the document.<p>The following instructions were
 written for the Resource perspective, but they will also work in many other
 perspectives.</p>
-<p>To add a group reference, follow these steps:</p>
+<p>To add a group reference, complete the following steps:</p>
 </div>
 
 <ol>
@@ -50,8 +50,7 @@
 
 <li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
 to provide any information about this group reference.</span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.
-</li>
+is used for human readable material, such as a description.</li>
 
 <li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you want to
 add application information elements to your annotations of schema components.</span>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrup.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrup.dita
index 5dce7f2..e79721b 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrup.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrup.dita
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <task id="taddgrup" xml:lang="en-us">

@@ -12,13 +12,12 @@
 by the group, such as elements, element references, and group references.</shortdesc>

 <prolog><metadata>

 <keywords><indexterm>XML schema editor<indexterm>groups</indexterm></indexterm>

-<indexterm>XML schema files<indexterm>groups</indexterm></indexterm>

-</keywords>

+<indexterm>XML schema files<indexterm>groups</indexterm></indexterm></keywords>

 </metadata></prolog>

 <taskbody>

 <context><p></p><p>The following instructions were written for the Resource

-perspective, but they will also work in many other perspectives.</p><p>To

-add a group, follow these steps:</p></context>

+perspective, but they ws<?Pub Caret?>ill also work in many other perspectives.</p><p>To

+add a group, complete the following steps:</p></context>

 <steps>

 <step><cmd>Open your XML schema in the XML schema editor.</cmd></step>

 <step><cmd>In the Outline view, right-click <b>Groups</b>, and click <uicontrol>Add

@@ -30,15 +29,14 @@
 is used for human readable material, such as a description.</info></step>

 <step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to

 add application information elements to your annotations of schema components.</cmd>

-<info>The <uicontrol>Extensions</uicontrol> page allows you to

-specify the schema and add XML content to your annotations.</info></step>

+<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the

+schema and add XML content to your annotations.</info></step>

 <step><cmd>In the Outline view, expand the <uicontrol>Groups</uicontrol> folder

-and your new group.</cmd></step>

-<step><cmd>Your group automatically contains a content model. </cmd><info>A

-group's content model is the representation of any data that can be contained

-inside the group. For more information about working with content models,

-refer to the related tasks.</info></step>

+and your new group.</cmd><info>Your group automatically contains a content

+model. A group's content model is the representation of any data that can

+be contained inside the group. For more information about working with content

+models, refer to the related tasks.</info></step>

 </steps>

 </taskbody>

 </task>

-<?Pub *0000002502?>

+<?Pub *0000002232?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrup.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrup.html
index b8141ed..f3a6f3c 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrup.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddgrup.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Adding groups" />
 <meta name="abstract" content="When you create a group, it automatically contains a content model. The content model is a representation of any data that can be grouped together by the group, such as elements, element references, and group references." />
 <meta name="description" content="When you create a group, it automatically contains a content model. The content model is a representation of any data that can be grouped together by the group, such as elements, element references, and group references." />
-<meta content="XML schema editor, adding, groups, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, adding, groups, XML schema files" name="keywords" />
+<meta content="XML schema editor, groups, XML schema files" name="DC.subject" />
+<meta content="XML schema editor, groups, XML schema files" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddgrpr.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddcmod.html" />
 <meta content="XHTML" name="DC.Format" />
@@ -35,9 +35,9 @@
 
 <div class="section"><p />
 <p>The following instructions were written for the Resource
-perspective, but they will also work in many other perspectives.</p>
+perspective, but they wsill also work in many other perspectives.</p>
 <p>To
-add a group, follow these steps:</p>
+add a group, complete the following steps:</p>
 </div>
 
 <ol>
@@ -55,16 +55,14 @@
 
 <li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you want to
 add application information elements to your annotations of schema components.</span>
- The <span class="uicontrol">Extensions</span> page allows you to
-specify the schema and add XML content to your annotations.</li>
+ The <span class="uicontrol">Extensions</span> page allows you to specify the
+schema and add XML content to your annotations.</li>
 
 <li class="stepexpand"><span>In the Outline view, expand the <span class="uicontrol">Groups</span> folder
-and your new group.</span></li>
-
-<li class="stepexpand"><span>Your group automatically contains a content model. </span> A
-group's content model is the representation of any data that can be contained
-inside the group. For more information about working with content models,
-refer to the related tasks.</li>
+and your new group.</span> Your group automatically contains a content
+model. A group's content model is the representation of any data that can
+be contained inside the group. For more information about working with content
+models, refer to the related tasks.</li>
 
 </ol>
 
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddimpt.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddimpt.dita
index 0188c47..cf0d158 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddimpt.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddimpt.dita
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<?xml version="1.0" encoding="UTF-8"?>

+<!--Arbortext, Inc., 1988-2008, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <?Pub Inc?>

@@ -8,69 +8,70 @@
 <titlealts>

 <searchtitle>Adding import elements</searchtitle>

 </titlealts>

-<shortdesc>As schemas become larger, it is often desirable to divide their

-content among several schema documents for purposes such as ease of maintenance,

-reuse, and readability. You can use an <codeph>import</codeph> element to

-bring in definitions and declarations from an imported schema into the current

-schema. </shortdesc>

+<shortdesc>If your schemas are large, you might choose to divide their

+content among several schema documents to make them easier to maintain,

+reuse, and read. You can use an <codeph>import</codeph> element to

+bring in definitions and declarations from an imported schema into

+the current schema. </shortdesc>

 <prolog><metadata>

 <keywords><indexterm>XML schema editor<indexterm>import elements</indexterm></indexterm>

 <indexterm>XML schema files<indexterm>import elements</indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <taskbody>

-<context><p>The imported schema can come from a different namespace than the

-current schema does.</p><p>You can add multiple import elements to an XML

-schema, however, prefixes and namespaces have to unique amongst the imported

-schemas.</p><p>The following instructions were written for the Resource perspective,

-but they will also work in many other perspectives.</p><p>To add an import

-element, follow these steps:</p></context>

+<context><p>You can import a schema from a different namespace than

+the current schema. You can add multiple import elements to an XML

+schema; however, an imported schema cannot have the same namespace

+or prefix as another imported schema.</p><p>The following instructions

+were written for the Resource perspective, but they will also work

+in many other perspectives.</p><p>To add an import element, complete

+the following steps:</p></context>

 <steps>

 <step><cmd>Open your XML schema in the XML schema editor.</cmd></step>

-<step><cmd>In the Outline view, select your schema.</cmd><info>The entire

-schema and its contents should be displayed in the Design view.</info></step>

-<step><cmd>In the Design view, right click in the <b>Directives</b> section

+<step><cmd>In the Design view, right-click in the <b>Directives</b> section

 and click <uicontrol>Add Import</uicontrol>.</cmd></step>

-<step><cmd>In the Properties view, click the <b>General</b> tab and click <uicontrol>Browse</uicontrol> <image

-href="../images/Browse.gif"><alt>This graphic is the Browse button</alt></image> to

-the right of the <uicontrol>Schema location</uicontrol> field.</cmd></step>

-<step><cmd>If you want to import an XML schema located in the workbench:</cmd>

+<step><cmd>In the Select XML schema file wizard, you can import an

+XML schema that is located in your workspace or you can import a schema

+from an HTTP Web address.</cmd>

+<choices>

+<choice>If you want to import an XML schema located in your workspace:<ol>

+<li>Select <uicontrol>Workbench projects</uicontrol> and click <uicontrol>Next</uicontrol>. </li>

+<li>Select the schema that you want to import and click <uicontrol>Finish</uicontrol>.</li>

+</ol></choice>

+<choice>If you want to import an XML schema located at an HTTP Web

+address:<ol>

+<li>Select <uicontrol>HTTP</uicontrol> and click <uicontrol>Next</uicontrol>.</li>

+<li>Type the URL of the XML schema and click <uicontrol>Finish</uicontrol>.<note>A

+local copy of the schema is not stored in your workspace. If you validate

+your schema, the schema's contents are checked from the URL that you

+specify.</note></li>

+</ol></choice>

+</choices>

+</step>

+<step importance="optional"><cmd>Use the Properties view to define

+additional properties for your import element.</cmd>

 <substeps>

-<substep><cmd>Select <uicontrol>Workbench projects</uicontrol> and click <uicontrol>Next</uicontrol>. </cmd>

-</substep>

-<substep><cmd>Select the schema you want to import and click <uicontrol>Finish</uicontrol>.</cmd>

+<substep><cmd>If you want to add a unique prefix for this namespace,

+click the <uicontrol>General</uicontrol> tab and type the prefix in

+the <uicontrol>Prefix</uicontrol> field.</cmd></substep>

+<substep><cmd>Click the <uicontrol>Documentation</uicontrol> tab if

+you want to provide any information about this import element. </cmd>

+<info>The <uicontrol>Documentation</uicontrol> page is used for human

+readable material, such as a description.</info></substep>

+<substep><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you

+want to add application information elements to your annotations of

+schema components. </cmd><info>The <uicontrol>Extensions</uicontrol> page

+allows you to specify the schema and add XML content to your annotations.</info>

 </substep>

 </substeps>

 </step>

-<step><cmd>If you want to import an XML schema located on the Web:</cmd>

-<substeps>

-<substep><cmd>Select <uicontrol>HTTP</uicontrol> and click <uicontrol>Next</uicontrol>.</cmd>

-</substep>

-<substep><cmd>Type the URL of the XML schema and click <uicontrol>Finish</uicontrol>.</cmd>

-<info><note>A local copy of the schema will not be stored in the workbench.

-Every time you validate your schema, the schema's contents will be checked

-from the URL you specify.</note></info></substep>

-</substeps>

-</step>

-<step><cmd>The XML schema editor will retrieve the namespace for the imported

-XML schema file and display it as read-only in the <uicontrol>Namespace</uicontrol> field.</cmd>

-</step>

-<step><cmd>If necessary, type a unique prefix for this namespace in the <uicontrol>Prefix</uicontrol> field.</cmd>

-</step>

-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want

-to provide any information about this import element.</cmd><info>The <uicontrol>Documentation</uicontrol> page

-is used for human readable material, such as a description.</info></step>

-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to

-add application information elements to your annotations of schema components.</cmd>

-<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the

-schema and add XML content to your annotations.</info></step>

-</steps>

-<result><p>Once you have added an import element to your XML schema, when

-you define new elements, attributes, complex types, or simple types where

-you can specify type information, any declarations from the included schema

-will be available in the <uicontrol>Type</uicontrol> list for the element,

-attribute, complex or simple type.</p></result>

+</steps><?Pub Caret1?>

+<result><p>Once you have added an import element to your XML schema,

+when you define new elements, attributes, complex types, or simple

+types where you can specify type information, any declarations from

+the included schema will be available in the <uicontrol>Type</uicontrol> list

+for the element, attribute, complex or simple type.</p></result>

 <postreq></postreq>

 </taskbody>

 </task>

-<?Pub *0000004340?>

+<?Pub *0000003756?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddimpt.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddimpt.html
index d6946ec..ec0083a 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddimpt.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddimpt.html
@@ -2,17 +2,17 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="task" name="DC.Type" />
 <meta name="DC.Title" content="Adding import elements" />
-<meta name="abstract" content="As schemas become larger, it is often desirable to divide their content among several schema documents for purposes such as ease of maintenance, reuse, and readability. You can use an import element to bring in definitions and declarations from an imported schema into the current schema." />
-<meta name="description" content="As schemas become larger, it is often desirable to divide their content among several schema documents for purposes such as ease of maintenance, reuse, and readability. You can use an import element to bring in definitions and declarations from an imported schema into the current schema." />
-<meta content="XML schema editor, adding, import elements, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, adding, import elements, XML schema files" name="keywords" />
+<meta name="abstract" content="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use an import element to bring in definitions and declarations from an imported schema into the current schema." />
+<meta name="description" content="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use an import element to bring in definitions and declarations from an imported schema into the current schema." />
+<meta content="XML schema editor, import elements, XML schema files" name="DC.subject" />
+<meta content="XML schema editor, import elements, XML schema files" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddincl.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddrdfn.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/rnmspc.html" />
@@ -30,85 +30,87 @@
 
 
 
-<div><p>As schemas become larger, it is often desirable to divide their
-content among several schema documents for purposes such as ease of maintenance,
-reuse, and readability. You can use an <samp class="codeph">import</samp> element to
-bring in definitions and declarations from an imported schema into the current
-schema. </p>
+<div><p>If your schemas are large, you might choose to divide their
+content among several schema documents to make them easier to maintain,
+reuse, and read. You can use an <samp class="codeph">import</samp> element to
+bring in definitions and declarations from an imported schema into
+the current schema. </p>
 
-<div class="section"><p>The imported schema can come from a different namespace than the
-current schema does.</p>
-<p>You can add multiple import elements to an XML
-schema, however, prefixes and namespaces have to unique amongst the imported
-schemas.</p>
-<p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p>
-<p>To add an import
-element, follow these steps:</p>
+<div class="section"><p>You can import a schema from a different namespace than
+the current schema. You can add multiple import elements to an XML
+schema; however, an imported schema cannot have the same namespace
+or prefix as another imported schema.</p>
+<p>The following instructions
+were written for the Resource perspective, but they will also work
+in many other perspectives.</p>
+<p>To add an import element, complete
+the following steps:</p>
 </div>
 
 <ol>
-<li class="stepexpand"><span>Open your XML schema in the XML schema editor.</span></li>
+<li><span>Open your XML schema in the XML schema editor.</span></li>
 
-<li class="stepexpand"><span>In the Outline view, select your schema.</span> The entire
-schema and its contents should be displayed in the Design view.</li>
-
-<li class="stepexpand"><span>In the Design view, right click in the <strong>Directives</strong> section
+<li><span>In the Design view, right-click in the <strong>Directives</strong> section
 and click <span class="uicontrol">Add Import</span>.</span></li>
 
-<li class="stepexpand"><span>In the Properties view, click the <strong>General</strong> tab and click <span class="uicontrol">Browse</span> <img src="../images/Browse.gif" alt="This graphic is the Browse button" /> to
-the right of the <span class="uicontrol">Schema location</span> field.</span></li>
+<li><span>In the Select XML schema file wizard, you can import an
+XML schema that is located in your workspace or you can import a schema
+from an HTTP Web address.</span>
+<ul>
+<li>If you want to import an XML schema located in your workspace:<ol type="a">
+<li>Select <span class="uicontrol">Workbench projects</span> and click <span class="uicontrol">Next</span>. </li>
 
-<li class="stepexpand"><span>If you want to import an XML schema located in the workbench:</span>
+<li>Select the schema that you want to import and click <span class="uicontrol">Finish</span>.</li>
+
+</ol>
+</li>
+
+<li>If you want to import an XML schema located at an HTTP Web
+address:<ol type="a">
+<li>Select <span class="uicontrol">HTTP</span> and click <span class="uicontrol">Next</span>.</li>
+
+<li>Type the URL of the XML schema and click <span class="uicontrol">Finish</span>.<div class="note"><span class="notetitle">Note:</span> A
+local copy of the schema is not stored in your workspace. If you validate
+your schema, the schema's contents are checked from the URL that you
+specify.</div>
+</li>
+
+</ol>
+</li>
+
+</ul>
+
+</li>
+
+<li><strong>Optional: </strong><span>Use the Properties view to define
+additional properties for your import element.</span>
 <ol type="a">
-<li><span>Select <span class="uicontrol">Workbench projects</span> and click <span class="uicontrol">Next</span>. </span>
-</li>
+<li class="substepexpand"><span>If you want to add a unique prefix for this namespace,
+click the <span class="uicontrol">General</span> tab and type the prefix in
+the <span class="uicontrol">Prefix</span> field.</span></li>
 
-<li><span>Select the schema you want to import and click <span class="uicontrol">Finish</span>.</span>
+<li class="substepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if
+you want to provide any information about this import element. </span>
+ The <span class="uicontrol">Documentation</span> page is used for human
+readable material, such as a description.</li>
+
+<li class="substepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you
+want to add application information elements to your annotations of
+schema components. </span> The <span class="uicontrol">Extensions</span> page
+allows you to specify the schema and add XML content to your annotations.
 </li>
 
 </ol>
 
 </li>
 
-<li class="stepexpand"><span>If you want to import an XML schema located on the Web:</span>
-<ol type="a">
-<li class="substepexpand"><span>Select <span class="uicontrol">HTTP</span> and click <span class="uicontrol">Next</span>.</span>
-</li>
-
-<li class="substepexpand"><span>Type the URL of the XML schema and click <span class="uicontrol">Finish</span>.</span>
- <div class="note"><span class="notetitle">Note:</span> A local copy of the schema will not be stored in the workbench.
-Every time you validate your schema, the schema's contents will be checked
-from the URL you specify.</div>
-</li>
-
 </ol>
 
-</li>
-
-<li class="stepexpand"><span>The XML schema editor will retrieve the namespace for the imported
-XML schema file and display it as read-only in the <span class="uicontrol">Namespace</span> field.</span>
-</li>
-
-<li class="stepexpand"><span>If necessary, type a unique prefix for this namespace in the <span class="uicontrol">Prefix</span> field.</span>
-</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
-to provide any information about this import element.</span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.</li>
-
-<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you want to
-add application information elements to your annotations of schema components.</span>
- The <span class="uicontrol">Extensions</span> page allows you to specify the
-schema and add XML content to your annotations.</li>
-
-</ol>
-
-<div class="section"><p>Once you have added an import element to your XML schema, when
-you define new elements, attributes, complex types, or simple types where
-you can specify type information, any declarations from the included schema
-will be available in the <span class="uicontrol">Type</span> list for the element,
-attribute, complex or simple type.</p>
+<div class="section"><p>Once you have added an import element to your XML schema,
+when you define new elements, attributes, complex types, or simple
+types where you can specify type information, any declarations from
+the included schema will be available in the <span class="uicontrol">Type</span> list
+for the element, attribute, complex or simple type.</p>
 </div>
 
 <div class="section" />
@@ -116,7 +118,7 @@
 </div>
 
 <div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/taddincl.html" title="As schemas become larger, it is often desirable to divide their content among several schema documents for purposes such as ease of maintenance, reuse, and readability. You can use the include element to bring in definitions and declarations from the included schema into the current schema. The included schema must be in the same target namespace as the including schema.">Adding include elements</a></div>
+<div><a href="../topics/taddincl.html" title="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use the include element to bring in definitions and declarations from the included schema into the current schema. The included schema must be in the same target namespace as the including schema.">Adding include elements</a></div>
 <div><a href="../topics/taddrdfn.html" title="You can use the redefine mechanism to redefine simple and complex types, groups, and attribute groups obtained from external schema files. When you redefine a component, you are modifying its contents.">Adding redefine elements</a></div>
 </div>
 <div class="relref"><strong>Related reference</strong><br />
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddincl.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddincl.dita
index bdc5924..be011ed 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddincl.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddincl.dita
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<?xml version="1.0" encoding="UTF-8"?>

+<!--Arbortext, Inc., 1988-2008, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <?Pub Inc?>

@@ -8,70 +8,78 @@
 <titlealts>

 <searchtitle>Adding include elements</searchtitle>

 </titlealts>

-<shortdesc>As schemas become larger, it is often desirable to divide their

-content among several schema documents for purposes such as ease of maintenance,

-reuse, and readability. You can use the <codeph>include</codeph> element to

-bring in definitions and declarations from the included schema

-into the current schema. The included schema must be in the same target namespace

-as the including schema. </shortdesc>

+<shortdesc>If your schemas are large, you might choose to divide their

+content among several schema documents to make them easier to maintain,

+reuse, and read.  You can use the <codeph>include</codeph> element

+to bring in definitions and declarations from the included schema

+into the current schema. The included schema must be in the same target

+namespace as the including schema. </shortdesc>

 <prolog><metadata>

 <keywords><indexterm>XML schema editor<indexterm>include elements</indexterm></indexterm>

 <indexterm>XML schema files<indexterm>include elements</indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <taskbody>

-<context><p>The following instructions were written for the XML perspective,

-but they will also work in many other perspectives.</p><p>To add an include

-element, follow these steps:</p></context>

+<context><p>The following instructions were written for the Resource

+perspective, but they will also work in many other perspectives.</p><p>To

+add an include element, complete the following steps:</p></context>

 <steps>

 <step><cmd>Open your XML schema in the XML schema editor.</cmd></step>

-<step><cmd>In the Outline view, select your schema.</cmd><info>The entire

-schema and its contents are displayed in the Design view.</info></step>

 <step><cmd>In the Design view, right-click in the <b>Directives</b> section

 and click <uicontrol>Add Include</uicontrol>.</cmd></step>

-<step><cmd>In the Properties view, click the <b>General</b> tab and click <uicontrol>Browse</uicontrol> <image

-href="../images/Browse.gif"><alt>This graphic is the Browse button</alt></image> to

-the right of the <uicontrol>Schema location</uicontrol> field.</cmd><info>The

-XML schema file you select must have the same namespace as the current schema.</info>

+<step><cmd>In the Select XML schema file wizard, you can include an

+XML schema that is located in your workspace or you can include a

+schema from an HTTP Web address. The XML schema file that you select

+must have the same namespace as the current schema.</cmd>

+<choices>

+<choice>If you want to include an XML schema located in your workspace:<ol>

+<li>Select <uicontrol>Workbench projects</uicontrol> and click <uicontrol>Next</uicontrol>. </li>

+<li>Select the schema that you want to import and click <uicontrol>Finish</uicontrol>.</li>

+</ol></choice>

+<choice>If you want to include an XML schema located at an HTTP Web

+address:<ol>

+<li>Select <uicontrol>HTTP</uicontrol> and click <uicontrol>Next</uicontrol>.</li>

+<li>Type the URL of the XML schema and click <uicontrol>Finish</uicontrol>.<note>A

+local copy of the schema is not stored in your workspace. If you validate

+your schema, the schema's contents are checked from the URL that you

+specify.</note></li>

+</ol></choice>

+</choices>

 </step>

-<step><cmd>If you want to select an XML schema located in the workbench, select <uicontrol>Workbench

-projects</uicontrol> and click <uicontrol>Next</uicontrol>. </cmd></step>

-<step><cmd>Select the schema you want to include and click <uicontrol>Finish</uicontrol>.</cmd>

+<step importance="optional"><cmd>Use the Properties view to define

+additional properties for your import element.</cmd>

+<substeps>

+<substep><cmd>If you want to edit the location of the included XML

+schema file, click the <uicontrol>General</uicontrol> tab and type

+the new location display in the <uicontrol>Schema location</uicontrol> field.</cmd>

+</substep>

+<substep><cmd>Click the <uicontrol>Documentation</uicontrol> tab if

+you want to provide any information about this include<?Pub Caret?>

+element. </cmd><info>The <uicontrol>Documentation</uicontrol> page

+is used for human readable material, such as a description.</info>

+</substep>

+<substep><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you

+want to add application information elements to your annotations of

+schema components. </cmd><info>The <uicontrol>Extensions</uicontrol> page

+allows you to specify the schema and add XML content to your annotations.</info>

+</substep>

+</substeps>

 </step>

-<step><cmd>If you want to select an XML schema located on the Web, select <uicontrol>HTTP</uicontrol> and

-click <uicontrol>Next</uicontrol>.</cmd></step>

-<step><cmd>Type the URL of the XML schema and click <uicontrol>Finish</uicontrol>.</cmd>

-<info><note> A local copy of the schema will not be stored in the workbench.

-Every time you validate your schema, the schema's contents will be checked

-from the URL you specify.</note></info></step>

-<step><cmd>The XML schema editor will retrieve the location of the included

-XML schema file, and display it in the <uicontrol>Schema location</uicontrol> field.

-This field can be edited at any time to reflect the location of the XML schema

-file.</cmd></step>

-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want

-to provide any information about this include element.</cmd><info>The <uicontrol>Documentation</uicontrol> page

-is used for human readable material, such as a description.</info></step>

-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to

-add application information elements to your annotations of schema components.</cmd>

-<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the

-schema and add XML content to your annotations.</info></step>

 </steps>

-<result><p>Once you have added the include element to your XML schema, when

-you define new elements, attributes, complex types, or simple types where

-you can specify type information, any declarations from the included schema

-will be available in the <uicontrol>Type</uicontrol> list for the element,

-attribute, complex or simple type.</p><p>For example, if Address.xsd has the

-following content:</p><codeblock>&lt;complexType name="Address">

+<result><p>Once you have added the include element to your XML schema,

+when you define new elements, attributes, complex types, or simple

+types where you can specify type information, any declarations from

+the included schema will be available in the <uicontrol>Type</uicontrol> list

+for the element, attribute, complex or simple type.</p><p>For example,

+if Address.xsd has the following content:</p><codeblock>&lt;complexType name="Address">

     &lt;sequence>

         &lt;element name="name" type="string">

         &lt;element name="street" type="string">

     &lt;/sequence>

 &lt;/complexType>

-</codeblock>and you have an XML schema called PurchaseOrder.xsd that has added

-an include for Address.xsd, then when defining a new element in  PurchaseOrder,

-you can select Address as its type.  <p>(c) Copyright 2001, World Wide Web

-Consortium (Massachusetts Institute of Technology, Institut National de Recherche

-en Informatique et en Automatique, Keio University).</p></result>

+</codeblock>and you have an XML schema called PurchaseOrder.xsd that

+has added an include for Address.xsd, then when defining a new element

+in  PurchaseOrder, you can select Address as its type.  </result>

 </taskbody>

 </task>

-<?Pub *0000004728?>

+<?Pub *0000004174?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddincl.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddincl.html
index 7abba83..0b9d52f 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddincl.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddincl.html
@@ -2,17 +2,17 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="task" name="DC.Type" />
 <meta name="DC.Title" content="Adding include elements" />
-<meta name="abstract" content="As schemas become larger, it is often desirable to divide their content among several schema documents for purposes such as ease of maintenance, reuse, and readability. You can use the include element to bring in definitions and declarations from the included schema into the current schema. The included schema must be in the same target namespace as the including schema." />
-<meta name="description" content="As schemas become larger, it is often desirable to divide their content among several schema documents for purposes such as ease of maintenance, reuse, and readability. You can use the include element to bring in definitions and declarations from the included schema into the current schema. The included schema must be in the same target namespace as the including schema." />
-<meta content="XML schema editor, adding, include elements, XML schema files, include elements, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, adding, include elements, XML schema files, include elements, XML schema files" name="keywords" />
+<meta name="abstract" content="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use the include element to bring in definitions and declarations from the included schema into the current schema. The included schema must be in the same target namespace as the including schema." />
+<meta name="description" content="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use the include element to bring in definitions and declarations from the included schema into the current schema. The included schema must be in the same target namespace as the including schema." />
+<meta content="XML schema editor, include elements, XML schema files" name="DC.subject" />
+<meta content="XML schema editor, include elements, XML schema files" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddimpt.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddrdfn.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/rnmspc.html" />
@@ -30,71 +30,88 @@
 
 
 
-<div><p>As schemas become larger, it is often desirable to divide their
-content among several schema documents for purposes such as ease of maintenance,
-reuse, and readability. You can use the <samp class="codeph">include</samp> element to
-bring in definitions and declarations from the included schema
-into the current schema. The included schema must be in the same target namespace
-as the including schema. </p>
+<div><p>If your schemas are large, you might choose to divide their
+content among several schema documents to make them easier to maintain,
+reuse, and read.  You can use the <samp class="codeph">include</samp> element
+to bring in definitions and declarations from the included schema
+into the current schema. The included schema must be in the same target
+namespace as the including schema. </p>
 
-<div class="section"><p>The following instructions were written for the XML perspective,
-but they will also work in many other perspectives.</p>
-<p>To add an include
-element, follow these steps:</p>
+<div class="section"><p>The following instructions were written for the Resource
+perspective, but they will also work in many other perspectives.</p>
+<p>To
+add an include element, complete the following steps:</p>
 </div>
 
 <ol>
-<li class="stepexpand"><span>Open your XML schema in the XML schema editor.</span></li>
+<li><span>Open your XML schema in the XML schema editor.</span></li>
 
-<li class="stepexpand"><span>In the Outline view, select your schema.</span> The entire
-schema and its contents are displayed in the Design view.</li>
-
-<li class="stepexpand"><span>In the Design view, right-click in the <strong>Directives</strong> section
+<li><span>In the Design view, right-click in the <strong>Directives</strong> section
 and click <span class="uicontrol">Add Include</span>.</span></li>
 
-<li class="stepexpand"><span>In the Properties view, click the <strong>General</strong> tab and click <span class="uicontrol">Browse</span> <img src="../images/Browse.gif" alt="This graphic is the Browse button" /> to
-the right of the <span class="uicontrol">Schema location</span> field.</span> The
-XML schema file you select must have the same namespace as the current schema.
+<li><span>In the Select XML schema file wizard, you can include an
+XML schema that is located in your workspace or you can include a
+schema from an HTTP Web address. The XML schema file that you select
+must have the same namespace as the current schema.</span>
+<ul>
+<li>If you want to include an XML schema located in your workspace:<ol type="a">
+<li>Select <span class="uicontrol">Workbench projects</span> and click <span class="uicontrol">Next</span>. </li>
+
+<li>Select the schema that you want to import and click <span class="uicontrol">Finish</span>.</li>
+
+</ol>
 </li>
 
-<li class="stepexpand"><span>If you want to select an XML schema located in the workbench, select <span class="uicontrol">Workbench
-projects</span> and click <span class="uicontrol">Next</span>. </span></li>
+<li>If you want to include an XML schema located at an HTTP Web
+address:<ol type="a">
+<li>Select <span class="uicontrol">HTTP</span> and click <span class="uicontrol">Next</span>.</li>
 
-<li class="stepexpand"><span>Select the schema you want to include and click <span class="uicontrol">Finish</span>.</span>
+<li>Type the URL of the XML schema and click <span class="uicontrol">Finish</span>.<div class="note"><span class="notetitle">Note:</span> A
+local copy of the schema is not stored in your workspace. If you validate
+your schema, the schema's contents are checked from the URL that you
+specify.</div>
 </li>
 
-<li class="stepexpand"><span>If you want to select an XML schema located on the Web, select <span class="uicontrol">HTTP</span> and
-click <span class="uicontrol">Next</span>.</span></li>
-
-<li class="stepexpand"><span>Type the URL of the XML schema and click <span class="uicontrol">Finish</span>.</span>
- <div class="note"><span class="notetitle">Note:</span>  A local copy of the schema will not be stored in the workbench.
-Every time you validate your schema, the schema's contents will be checked
-from the URL you specify.</div>
+</ol>
 </li>
 
-<li class="stepexpand"><span>The XML schema editor will retrieve the location of the included
-XML schema file, and display it in the <span class="uicontrol">Schema location</span> field.
-This field can be edited at any time to reflect the location of the XML schema
-file.</span></li>
+</ul>
 
-<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
-to provide any information about this include element.</span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.</li>
+</li>
 
-<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you want to
-add application information elements to your annotations of schema components.</span>
- The <span class="uicontrol">Extensions</span> page allows you to specify the
-schema and add XML content to your annotations.</li>
+<li><strong>Optional: </strong><span>Use the Properties view to define
+additional properties for your import element.</span>
+<ol type="a">
+<li class="substepexpand"><span>If you want to edit the location of the included XML
+schema file, click the <span class="uicontrol">General</span> tab and type
+the new location display in the <span class="uicontrol">Schema location</span> field.</span>
+</li>
+
+<li class="substepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if
+you want to provide any information about this include
+element. </span> The <span class="uicontrol">Documentation</span> page
+is used for human readable material, such as a description.
+</li>
+
+<li class="substepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you
+want to add application information elements to your annotations of
+schema components. </span> The <span class="uicontrol">Extensions</span> page
+allows you to specify the schema and add XML content to your annotations.
+</li>
 
 </ol>
 
-<div class="section"><p>Once you have added the include element to your XML schema, when
-you define new elements, attributes, complex types, or simple types where
-you can specify type information, any declarations from the included schema
-will be available in the <span class="uicontrol">Type</span> list for the element,
-attribute, complex or simple type.</p>
-<p>For example, if Address.xsd has the
-following content:</p>
+</li>
+
+</ol>
+
+<div class="section"><p>Once you have added the include element to your XML schema,
+when you define new elements, attributes, complex types, or simple
+types where you can specify type information, any declarations from
+the included schema will be available in the <span class="uicontrol">Type</span> list
+for the element, attribute, complex or simple type.</p>
+<p>For example,
+if Address.xsd has the following content:</p>
 <pre>&lt;complexType name="Address"&gt;
     &lt;sequence&gt;
         &lt;element name="name" type="string"&gt;
@@ -102,17 +119,14 @@
     &lt;/sequence&gt;
 &lt;/complexType&gt;
 </pre>
-and you have an XML schema called PurchaseOrder.xsd that has added
-an include for Address.xsd, then when defining a new element in  PurchaseOrder,
-you can select Address as its type.  <p>(c) Copyright 2001, World Wide Web
-Consortium (Massachusetts Institute of Technology, Institut National de Recherche
-en Informatique et en Automatique, Keio University).</p>
-</div>
+and you have an XML schema called PurchaseOrder.xsd that
+has added an include for Address.xsd, then when defining a new element
+in  PurchaseOrder, you can select Address as its type.  </div>
 
 </div>
 
 <div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/taddimpt.html" title="As schemas become larger, it is often desirable to divide their content among several schema documents for purposes such as ease of maintenance, reuse, and readability. You can use an import element to bring in definitions and declarations from an imported schema into the current schema.">Adding import elements</a></div>
+<div><a href="../topics/taddimpt.html" title="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use an import element to bring in definitions and declarations from an imported schema into the current schema.">Adding import elements</a></div>
 <div><a href="../topics/taddrdfn.html" title="You can use the redefine mechanism to redefine simple and complex types, groups, and attribute groups obtained from external schema files. When you redefine a component, you are modifying its contents.">Adding redefine elements</a></div>
 </div>
 <div class="relref"><strong>Related reference</strong><br />
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddrdfn.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddrdfn.dita
index 78fc383..085e62e 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddrdfn.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddrdfn.dita
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<?xml version="1.0" encoding="UTF-8"?>

+<!--Arbortext, Inc., 1988-2008, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <?Pub Inc?>

@@ -8,9 +8,10 @@
 <titlealts>

 <searchtitle>Adding redefine elements</searchtitle>

 </titlealts>

-<shortdesc>You can use the <codeph>redefine</codeph> mechanism to redefine

-simple and complex types, groups, and attribute groups obtained from external

-schema files. When you redefine a component, you are modifying its contents.</shortdesc>

+<shortdesc>You can use the <codeph>redefine</codeph> mechanism to

+redefine simple and complex types, groups, and attribute groups obtained

+from external schema files. When you redefine a component, you are

+modifying its contents.</shortdesc>

 <prolog><metadata>

 <keywords><indexterm>XML schema editor<indexterm>adding redefine elements</indexterm></indexterm>

 <indexterm>XML schema files<indexterm>adding redefine elements</indexterm></indexterm>

@@ -18,47 +19,57 @@
 </metadata></prolog>

 <taskbody>

 <context><p>Like the <codeph>include</codeph> mechanism, <codeph>redefine</codeph> requires

-the external components to be in the same target namespace as the redefining

-schema, although external components from schemas that have no namespace can

-also be redefined.</p><p>The following instructions were written for the Resource

-perspective, but they will also work in many other perspectives.</p><p>To

-add a redefine element:</p></context>

+the external components to be in the same target namespace as the

+redefining schema, although external components from schemas that

+have no namespace can also be redefined.</p><p>The following instructions

+were written for the Resource perspective, but they will also work

+in many other perspectives.</p><p>To add a redefine element, complete

+the following steps:</p></context>

 <steps>

 <step><cmd>Open your XML schema in the XML schema editor.</cmd></step>

-<step><cmd>In the Outline view, select your schema.</cmd><info>The entire

-schema and its contents are displayed in the Design view.</info></step>

 <step><cmd>In the Design view, right-click in the <b>Directives</b> section

 and click <uicontrol>Add Redefine</uicontrol>.</cmd></step>

-<step><cmd>In the Properties view, click the <b>General</b> tab and click <uicontrol>Browse</uicontrol> <image

-href="../images/Browse.gif"><alt>This graphic is the Browse button</alt></image> to

-the right of the <uicontrol>Schema location</uicontrol> field.</cmd>

-<info>The XML schema file you select must have the same namespace as the current

-schema.</info></step>

-<step><cmd>If you want to select an XML schema located in the workbench, select <uicontrol>Workbench

-projects</uicontrol> and click <uicontrol>Next.</uicontrol></cmd></step>

-<step><cmd>Select the schema you want to include and click <uicontrol>Finish</uicontrol>.</cmd>

+<step><cmd>In the Select XML schema file wizard, you can import an

+XML schema that is located in your workspace or you can import a schema

+from an HTTP Web address. The XML schema file that you select must

+have the same namespace as the current schema.</cmd>

+<choices>

+<choice>If you want to import an XML schema located in your workspace:<ol>

+<li>Select <uicontrol>Workbench projects</uicontrol> and click <uicontrol>Next</uicontrol>. </li>

+<li>Select the schema that you want to import and click <uicontrol>Finish</uicontrol>.</li>

+</ol></choice>

+<choice>If you want to import an XML schema located at an HTTP Web

+address:<ol>

+<li>Select <uicontrol>HTTP</uicontrol> and click <uicontrol>Next</uicontrol>.</li>

+<li>Type the URL of the XML schema and click <uicontrol>Finish</uicontrol>.<note>A

+local copy of the schema is not stored in your workspace. If you validate

+your schema, the schema's contents are checked from the URL that you

+specify.</note></li>

+</ol></choice>

+</choices>

 </step>

-<step><cmd>If you want to select an XML schema located on the Web, select <uicontrol>HTTP</uicontrol> and

-click <uicontrol>Next</uicontrol>.</cmd></step>

-<step><cmd>Type the URL of the XML schema and click <uicontrol>Finish</uicontrol>.</cmd>

-<info> <note>A local copy of the schema will not be stored in the workbench.

-Every time you validate your schema, the schema's contents will be checked

-from the URL you specify.</note></info></step>

-<step><cmd>The XML schema editor will retrieve the location of the included

-XML schema file, and display it in the <uicontrol>Schema location</uicontrol> field.

-This field can be edited at any time to reflect the location of the XML schema

-file.</cmd></step>

-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want

-to provide any information about this redefine element.</cmd><info>The <uicontrol>Documentation</uicontrol> page

-is used for human readable material, such as a description.</info></step>

-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to

-add application information elements to your annotations of schema components.</cmd>

-<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the

-schema and add XML content to your annotations.</info></step>

-</steps>

-<result><p>Once you have added the redefine element to your XML schema, you

-can redefine any of the simple and complex types, groups, and attribute groups

-in the XML schema you selected in the redefine element. </p></result>

+<step importance="optional"><cmd>Use the Properties view to define

+additional properties for your import element.</cmd>

+<substeps>

+<substep><cmd>If you want to edit the location of the included XML

+schema file, click the <uicontrol>General</uicontrol> tab and type

+the new location display in the <uicontrol>Schema location</uicontrol> field.</cmd>

+</substep>

+<substep><cmd>Click the <uicontrol>Documentation</uicontrol> tab if

+you want to provide any information about this redefine element. </cmd>

+<info>The <uicontrol>Documentation</uicontrol> page is used for human

+readable material, such as a description.</info></substep>

+<substep><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you

+want to add application information elements to your annotations of

+schema components. </cmd><info>The <uicontrol>Extensions</uicontrol> page

+allows you to specify the schema and add XML content to your annotations.</info>

+</substep>

+</substeps>

+</step>

+</steps><?Pub Caret1?>

+<result><p>Once you have added the redefine element to your XML schema,

+you can redefine any of the simple and complex types, groups, and

+attribute groups in the XML schema you selected in the redefine element. </p></result>

 </taskbody>

 </task>

-<?Pub *0000004055?>

+<?Pub *0000003721?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddrdfn.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddrdfn.html
index d7820c8..ef66d4a 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddrdfn.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddrdfn.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Adding redefine elements" />
 <meta name="abstract" content="You can use the redefine mechanism to redefine simple and complex types, groups, and attribute groups obtained from external schema files. When you redefine a component, you are modifying its contents." />
 <meta name="description" content="You can use the redefine mechanism to redefine simple and complex types, groups, and attribute groups obtained from external schema files. When you redefine a component, you are modifying its contents." />
-<meta content="XML schema editor, adding, redefine elements, XML schema files, redefine elements, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, adding, redefine elements, XML schema files, redefine elements, XML schema files" name="keywords" />
+<meta content="XML schema editor, adding redefine elements, XML schema files" name="DC.subject" />
+<meta content="XML schema editor, adding redefine elements, XML schema files" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddimpt.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddincl.html" />
 <meta scheme="URI" name="DC.Relation" content="../topics/rnmspc.html" />
@@ -30,75 +30,93 @@
 
 
 
-<div><p>You can use the <samp class="codeph">redefine</samp> mechanism to redefine
-simple and complex types, groups, and attribute groups obtained from external
-schema files. When you redefine a component, you are modifying its contents.</p>
+<div><p>You can use the <samp class="codeph">redefine</samp> mechanism to
+redefine simple and complex types, groups, and attribute groups obtained
+from external schema files. When you redefine a component, you are
+modifying its contents.</p>
 
 <div class="section"><p>Like the <samp class="codeph">include</samp> mechanism, <samp class="codeph">redefine</samp> requires
-the external components to be in the same target namespace as the redefining
-schema, although external components from schemas that have no namespace can
-also be redefined.</p>
-<p>The following instructions were written for the Resource
-perspective, but they will also work in many other perspectives.</p>
-<p>To
-add a redefine element:</p>
+the external components to be in the same target namespace as the
+redefining schema, although external components from schemas that
+have no namespace can also be redefined.</p>
+<p>The following instructions
+were written for the Resource perspective, but they will also work
+in many other perspectives.</p>
+<p>To add a redefine element, complete
+the following steps:</p>
 </div>
 
 <ol>
-<li class="stepexpand"><span>Open your XML schema in the XML schema editor.</span></li>
+<li><span>Open your XML schema in the XML schema editor.</span></li>
 
-<li class="stepexpand"><span>In the Outline view, select your schema.</span> The entire
-schema and its contents are displayed in the Design view.</li>
-
-<li class="stepexpand"><span>In the Design view, right-click in the <strong>Directives</strong> section
+<li><span>In the Design view, right-click in the <strong>Directives</strong> section
 and click <span class="uicontrol">Add Redefine</span>.</span></li>
 
-<li class="stepexpand"><span>In the Properties view, click the <strong>General</strong> tab and click <span class="uicontrol">Browse</span> <img src="../images/Browse.gif" alt="This graphic is the Browse button" /> to
-the right of the <span class="uicontrol">Schema location</span> field.</span>
- The XML schema file you select must have the same namespace as the current
-schema.</li>
+<li><span>In the Select XML schema file wizard, you can import an
+XML schema that is located in your workspace or you can import a schema
+from an HTTP Web address. The XML schema file that you select must
+have the same namespace as the current schema.</span>
+<ul>
+<li>If you want to import an XML schema located in your workspace:<ol type="a">
+<li>Select <span class="uicontrol">Workbench projects</span> and click <span class="uicontrol">Next</span>. </li>
 
-<li class="stepexpand"><span>If you want to select an XML schema located in the workbench, select <span class="uicontrol">Workbench
-projects</span> and click <span class="uicontrol">Next.</span></span></li>
+<li>Select the schema that you want to import and click <span class="uicontrol">Finish</span>.</li>
 
-<li class="stepexpand"><span>Select the schema you want to include and click <span class="uicontrol">Finish</span>.</span>
+</ol>
 </li>
 
-<li class="stepexpand"><span>If you want to select an XML schema located on the Web, select <span class="uicontrol">HTTP</span> and
-click <span class="uicontrol">Next</span>.</span></li>
+<li>If you want to import an XML schema located at an HTTP Web
+address:<ol type="a">
+<li>Select <span class="uicontrol">HTTP</span> and click <span class="uicontrol">Next</span>.</li>
 
-<li class="stepexpand"><span>Type the URL of the XML schema and click <span class="uicontrol">Finish</span>.</span>
-  <div class="note"><span class="notetitle">Note:</span> A local copy of the schema will not be stored in the workbench.
-Every time you validate your schema, the schema's contents will be checked
-from the URL you specify.</div>
+<li>Type the URL of the XML schema and click <span class="uicontrol">Finish</span>.<div class="note"><span class="notetitle">Note:</span> A
+local copy of the schema is not stored in your workspace. If you validate
+your schema, the schema's contents are checked from the URL that you
+specify.</div>
 </li>
 
-<li class="stepexpand"><span>The XML schema editor will retrieve the location of the included
-XML schema file, and display it in the <span class="uicontrol">Schema location</span> field.
-This field can be edited at any time to reflect the location of the XML schema
-file.</span></li>
+</ol>
+</li>
 
-<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
-to provide any information about this redefine element.</span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.</li>
+</ul>
 
-<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you want to
-add application information elements to your annotations of schema components.</span>
- The <span class="uicontrol">Extensions</span> page allows you to specify the
-schema and add XML content to your annotations.</li>
+</li>
+
+<li><strong>Optional: </strong><span>Use the Properties view to define
+additional properties for your import element.</span>
+<ol type="a">
+<li class="substepexpand"><span>If you want to edit the location of the included XML
+schema file, click the <span class="uicontrol">General</span> tab and type
+the new location display in the <span class="uicontrol">Schema location</span> field.</span>
+</li>
+
+<li class="substepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if
+you want to provide any information about this redefine element. </span>
+ The <span class="uicontrol">Documentation</span> page is used for human
+readable material, such as a description.</li>
+
+<li class="substepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you
+want to add application information elements to your annotations of
+schema components. </span> The <span class="uicontrol">Extensions</span> page
+allows you to specify the schema and add XML content to your annotations.
+</li>
 
 </ol>
 
-<div class="section"><p>Once you have added the redefine element to your XML schema, you
-can redefine any of the simple and complex types, groups, and attribute groups
-in the XML schema you selected in the redefine element. </p>
+</li>
+
+</ol>
+
+<div class="section"><p>Once you have added the redefine element to your XML schema,
+you can redefine any of the simple and complex types, groups, and
+attribute groups in the XML schema you selected in the redefine element. </p>
 </div>
 
 </div>
 
 <div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/taddimpt.html" title="As schemas become larger, it is often desirable to divide their content among several schema documents for purposes such as ease of maintenance, reuse, and readability. You can use an import element to bring in definitions and declarations from an imported schema into the current schema.">Adding import elements</a></div>
-<div><a href="../topics/taddincl.html" title="As schemas become larger, it is often desirable to divide their content among several schema documents for purposes such as ease of maintenance, reuse, and readability. You can use the include element to bring in definitions and declarations from the included schema into the current schema. The included schema must be in the same target namespace as the including schema.">Adding include elements</a></div>
+<div><a href="../topics/taddimpt.html" title="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use an import element to bring in definitions and declarations from an imported schema into the current schema.">Adding import elements</a></div>
+<div><a href="../topics/taddincl.html" title="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use the include element to bring in definitions and declarations from the included schema into the current schema. The included schema must be in the same target namespace as the including schema.">Adding include elements</a></div>
 </div>
 <div class="relref"><strong>Related reference</strong><br />
 <div><a href="../topics/rnmspc.html" title="An XML namespace is a collection of names, identified by a URI reference, which are used in XML documents as element types and attribute names.">XML namespaces</a></div>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddreg.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddreg.dita
index 3122220..df9d7b1 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddreg.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddreg.dita
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <task id="taddreg" xml:lang="en-us">

@@ -18,7 +18,7 @@
 <taskbody>

 <context><p> The value of the pattern is called a regular expression. You

 can specify it using the <uicontrol>Regular Expression</uicontrol> wizard.</p><p>To

-add a pattern to a simple type:</p></context>

+add a pattern to a simple type, complete the following steps:</p></context>

 <steps>

 <step><cmd>In the Design view, select the simple type you want to work with.</cmd>

 </step>

@@ -45,8 +45,8 @@
 </step>

 <step><cmd>When you are finished, click <uicontrol>Next</uicontrol>.</cmd>

 </step>

-<step><cmd>(Optional) To test against the regular expression and see if a

-match occurs, enter sample text.</cmd></step>

+<step><cmd>T<?Pub Caret1?>o test against the regular expression and see if

+a match occurs, enter sample text.</cmd></step>

 <step><cmd>Click <uicontrol>Finish</uicontrol>.</cmd><stepresult> The regular

 expression will appear in the Patterns page. <note type="tip"> To edit an

 existing pattern, select it in the Patterns page and click <uicontrol>Edit</uicontrol>.

@@ -55,4 +55,4 @@
 </steps>

 </taskbody>

 </task>

-<?Pub *0000002952?>

+<?Pub *0000002703?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddreg.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddreg.html
index 2a0c07a..845f4f7 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddreg.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddreg.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Adding pattern facets to simple types" />
 <meta name="abstract" content="A pattern facet can be used to constrain the value of a type's lexical space (the set of string literals that represent the values of a type), which indirectly constrains the value space." />
 <meta name="description" content="A pattern facet can be used to constrain the value of a type's lexical space (the set of string literals that represent the values of a type), which indirectly constrains the value space." />
-<meta content="XML schema editor, adding, pattern facets, XML schema files, pattern facets, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, adding, pattern facets, XML schema files, pattern facets, XML schema files" name="keywords" />
+<meta content="XML schema editor, pattern facets, XML schema files" name="DC.subject" />
+<meta content="XML schema editor, pattern facets, XML schema files" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddsmpt.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="taddreg" name="DC.Identifier" />
@@ -35,7 +35,7 @@
 <div class="section"><p> The value of the pattern is called a regular expression. You
 can specify it using the <span class="uicontrol">Regular Expression</span> wizard.</p>
 <p>To
-add a pattern to a simple type:</p>
+add a pattern to a simple type, complete the following steps:</p>
 </div>
 
 <ol>
@@ -76,8 +76,8 @@
 <li class="stepexpand"><span>When you are finished, click <span class="uicontrol">Next</span>.</span>
 </li>
 
-<li class="stepexpand"><span>(Optional) To test against the regular expression and see if a
-match occurs, enter sample text.</span></li>
+<li class="stepexpand"><span>To test against the regular expression and see if
+a match occurs, enter sample text.</span></li>
 
 <li class="stepexpand"><span>Click <span class="uicontrol">Finish</span>.</span>  The regular
 expression will appear in the Patterns page. <div class="tip"><span class="tiptitle">Tip:</span>  To edit an
@@ -91,7 +91,7 @@
 </div>
 
 <div><div class="reltasks"><strong>Related tasks</strong><br />
-<div><a href="../topics/taddsmpt.html" title="Simple types are used to create derived datatypes. They provide a set of constraints on the value space (a set of values) and the lexical space (a set of valid literals) of a datatype.">Adding simple types</a></div>
+<div><a href="../topics/taddsmpt.html" title="Simple types are used to create derived data types. They provide a set of constraints on the value space (a set of values) and the lexical space (a set of valid literals) of a datatype.">Adding simple types</a></div>
 </div>
 </div>
 
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddsmpt.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddsmpt.dita
index 189a8ac..9ca3d6c 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddsmpt.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddsmpt.dita
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<?xml version="1.0" encoding="UTF-8"?>

+<!--Arbortext, Inc., 1988-2008, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <?Pub Inc?>

@@ -8,20 +8,21 @@
 <titlealts>

 <searchtitle>Adding simple types</searchtitle>

 </titlealts>

-<shortdesc>Simple types are used to create derived datatypes.

-They provide a set of constraints on the value space (a set of values) and

-the lexical space (a set of valid literals) of a datatype.</shortdesc>

+<shortdesc>Simple types are used to create derived data types. They

+provide a set of constraints on the value space (a set of values)

+and the lexical space (a set of valid literals) of a datatype.</shortdesc>

 <prolog><metadata>

 <keywords><indexterm>XML schema editor<indexterm>simple types</indexterm></indexterm>

 <indexterm>XML schema files<indexterm>simple types</indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <taskbody>

-<context><p>A simple type cannot have element content and cannot carry attributes.

-Elements that contain numbers (and strings, and dates, and so on) but do not

-contain any sub-elements have a simple type.</p><p>The following instructions

-were written for the Resource perspective, but they will also work in many

-other perspectives.</p><p>To add a simple type:</p></context>

+<context><p>A simple type cannot have element content and cannot carry

+attributes. Elements that contain numbers (and strings, and dates,

+and so on) but do not contain any sub-elements have a simple type.</p><p>The

+following instructions were written for the Resource perspective,

+but they will also work in many other perspectives.</p><p>To add a

+simple type, complete the following steps:</p></context>

 <steps>

 <step><cmd>Open your XML schema in the XML schema editor.</cmd></step>

 <step><cmd>In the Outline view, right-click <b>Types</b>, and click <uicontrol>Add

@@ -33,100 +34,92 @@
 </step>

 <step><cmd>You can select the following options from the <uicontrol>Variety</uicontrol> list:</cmd>

 <choices>

-<choice><uicontrol>atomic</uicontrol>. Atomic types are all the simple types

-built into the XML schema language.</choice>

-<choice><uicontrol>list</uicontrol>. List types are comprised of sequences

-of atomic types. They have values that are comprised of finite-length sequences

-of atomic values. </choice>

-<choice><uicontrol>union</uicontrol>. A union type enables an element or attribute

-value to be one or more instances of one type drawn from the union of multiple

-atomic and list types.</choice>

+<choice><uicontrol>atomic</uicontrol>: atomic types are all the simple

+types built into the XML schema language.</choice>

+<choice><uicontrol>list</uicontrol>: list types are comprised of sequences

+of atomic types. They have values that are comprised of finite-length

+sequences of atomic values. </choice>

+<choice><uicontrol>union</uicontrol>: union types enable an element

+or attribute value to be one or more instances of one type drawn from

+the union of multiple atomic and list types.</choice>

 </choices>

 </step>

-<step><cmd>If you selected <uicontrol>atomic</uicontrol> from the <uicontrol>Variety</uicontrol> list,

-click <uicontrol>Browse</uicontrol> <image href="../images/Browse.gif"><alt>This

-graphic is the Browse button</alt></image> next to the <uicontrol>Base type</uicontrol> field

-to specify a base type for the simple type.</cmd><info>The Set Type dialog

-box lists all built-in and user-defined types currently available. You can

-change the <uicontrol>Scope</uicontrol> of the list by selecting one of the

-following options:<ul>

-<li><uicontrol>Workspace</uicontrol>. Lists all of the types available in

-your workspace. </li>

-<li><uicontrol>Enclosing Project</uicontrol>. Lists all of the types available

-in the project that contains your file. </li>

-<li>(Default) <uicontrol>Current Resource</uicontrol>. List all of the types

-available in your current file.</li>

-<li><uicontrol>Working Sets</uicontrol>. List all the types available within

-the selected working set.</li>

-</ul></info></step>

-<step><cmd>If you selected <uicontrol>list</uicontrol> from the <uicontrol>Variety</uicontrol> list,

-click <uicontrol>Browse</uicontrol> <image href="../images/Browse.gif"><alt>This

-graphic is the Browse button</alt></image> next to the <uicontrol>Item type</uicontrol> field

-to specify a item type for the simple type.</cmd><info>The Set Type dialog

-box lists all built-in and user-defined types currently available. You can

-change the <uicontrol>Scope</uicontrol> of the list by selecting one of the

-following options:<ul>

-<li><uicontrol>Workspace</uicontrol>. Lists all of the types available in

-your workspace. </li>

-<li><uicontrol>Enclosing Project</uicontrol>. Lists all of the types available

-in the project that contains your file. </li>

-<li>(Default) <uicontrol>Current Resource</uicontrol>. List all of the types

-available in your current file.</li>

-<li><uicontrol>Working Sets</uicontrol>. List all the types available within

-the selected working set.</li>

+<step><cmd>If you selected <uicontrol>atomic</uicontrol> or <uicontrol>list</uicontrol> from

+the <uicontrol>Variety</uicontrol> list, click <uicontrol>Browse</uicontrol> <image

+href="../images/Browse.gif"><alt>This graphic is the Browse button</alt>

+</image> next to the <uicontrol>Base type</uicontrol> or <uicontrol>Item

+type</uicontrol> field to specify a base type for the simple type. </cmd>

+<info>The Set Type dialog box lists all built-in and user-defined

+types currently available. You can change the <uicontrol>Scope</uicontrol> of

+the list by selecting one of the following options:<ul>

+<li><uicontrol>Workspace</uicontrol>: lists all of the types available

+in your workspace. </li>

+<li><uicontrol>Enclosing Project</uicontrol>: lists all of the types

+available in the project that contains your file. </li>

+<li>(Default) <uicontrol>Current Resource</uicontrol>: lists all of

+the types available in your current file.</li>

+<li><uicontrol>Working Sets</uicontrol>: lists all the types available

+within the selected working set.</li>

 </ul></info></step>

 <step><cmd>If you selected <uicontrol>union</uicontrol> from the <uicontrol>Variety</uicontrol> list,

-click <uicontrol>Browse</uicontrol> <image href="../images/Browse.gif"><alt>This

-graphic is the Browse button</alt></image> next to the <uicontrol>Member types</uicontrol> field

-to specify the member types for the simple type.</cmd><info>You can select

-to add both <uicontrol>Built-in simple types</uicontrol> and <uicontrol>User-defined

-simple types</uicontrol> to the member types value list. </info></step>

-<step><cmd>Click the <uicontrol>Constraints</uicontrol> tab.</cmd><info>From

-here you will be able to set specific constraint values including length constraints,

-enumerations, and patterns. </info>

+click <uicontrol>Browse</uicontrol> <image href="../images/Browse.gif">

+<alt>This graphic is the Browse button</alt></image> next to the <uicontrol>Member

+types</uicontrol> field to specify the member types for the simple

+type. </cmd><info>You can select to add both <uicontrol>Built-in simple

+types</uicontrol> and <uicontrol>User-defined simple types</uicontrol> to

+the member types value list. </info></step>

+<step><cmd>To set specific constraint values on your simple type,

+such as length constraints, enumerations, and patterns, click the <uicontrol>Constraints</uicontrol> tab.</cmd>

 <substeps>

-<substep><cmd>Enumerations help you to define a set of valid values for simple

-types. They are the actual values the simple type can take as valid values

-in the instance document. You can either add one enumeration or several enumerations

-at a time:</cmd><info><ul>

+<substep><cmd>You can use <i>enumerations</i> to define a set of valid

+values for simple types. They are the actual values the simple type

+can take as valid values in the instance document. You can add one

+enumeration or several enumerations at a time:</cmd><info><ul>

 <li>To add one enumeration at a time, under <uicontrol>Specific constraint

-values</uicontrol>, select <uicontrol>Enumerations</uicontrol> and click <uicontrol>Add</uicontrol> and

-specify a value for the enumeration.</li>

-<li>To add several enumerations at one time, follow these steps:<ol>

-<li>Select <uicontrol>Enumerations</uicontrol>.</li>

-<li>Click <uicontrol>Add</uicontrol>.</li>

-<li>Enter the value of each enumeration. Each value must be separated by the <uicontrol>Delimiter

-character</uicontrol>. For example: <codeph>First, Second</codeph> will create

-two enumerations, one with the value "First" and one with the value "Second".</li>

+values</uicontrol>, select <uicontrol>Enumerations</uicontrol> and

+click <uicontrol>Add</uicontrol> and specify a value for the enumeration.</li>

+<li>To add several enumerations at one time:<ol>

+<li>Select <uicontrol>Enumerations</uicontrol> and click <uicontrol>Add</uicontrol>.</li>

+<li>Enter the value of each enumeration. Each value must be separated

+by the <uicontrol>Delimiter character</uicontrol>. For example: <codeph>First,

+Second</codeph> will create two enumerations, one with the value "First"

+and one with the value "Second".</li>

 <li>Select the <uicontrol>Preserve leading and trailing whitespace</uicontrol> check

-box if you want any white space around your enumeration values to be preserved.

-If you select this check box, the values of <codeph>First, Second</codeph> will

-show up as "First" and " Second" (there is a space before Second) because

-you put a space before "Second" when entering the value.</li>

-<li>Click <uicontrol>OK</uicontrol>. Your enumerations will be created and

-appear in the Properties view.</li>

+box if you want any white space around your enumeration values to

+be preserved. If you select this check box, the values of <codeph>First,

+Second</codeph> will show up as "First" and " Second" (there is a

+space before Second) because you put a space before "Second" when

+entering the value.</li>

+<li>Click <uicontrol>OK</uicontrol>. Your enumerations will be created

+and appear in the Properties view.</li>

 </ol></li>

 </ul></info></substep>

-<substep><cmd>Patterns help you to place certain constraints regarding allowable

-values.</cmd><info>For example, you could restrict the field to only accept

-input which follows the pattern "five digits followed by two upper-case ASCII

-letters". To set a pattern constraint:<ol>

-<li>Select <uicontrol>Patterns</uicontrol>.</li>

-<li>Click <uicontrol>Add</uicontrol>.</li>

-<li>Create the regular expression pattern you wish to use as your constraint

-using the <uicontrol>Regular Expression</uicontrol> wizard.</li>

+<substep><cmd>You can use <i>patterns</i> to place certain constraints

+regarding allowable values. </cmd><info>For example, you could restrict

+the field to only accept input which follows the pattern "five digits

+followed by two upper-case ASCII letters". To set a pattern constraint:<ol>

+<li>Select <uicontrol>Patterns</uicontrol> and click <uicontrol>Add</uicontrol>.</li>

+<li>Create the regular expression pattern you wish to use as your

+constraint using the <uicontrol>Regular Expression</uicontrol> wizard.</li>

 <li>Click <uicontrol>Finish</uicontrol>.</li>

 </ol></info></substep>

 </substeps>

 </step>

-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want

-to provide any information about this simple type.</cmd><info>The <uicontrol>Documentation</uicontrol> page

-is used for human readable material, such as a description.</info></step>

-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to

-add application information elements to your annotations of schema components.</cmd>

-<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the

-schema and add XML content to your annotations.</info></step>

+<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you

+want to provide any information about this simple type. </cmd><info>The <uicontrol>Documentation</uicontrol> page

+is used for human readable material, such as a description.</info>

+</step>

+<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you

+want to add application information elements to your annotations of

+schema components. </cmd><info>The <uicontrol>Extensions</uicontrol> page

+allows you to specify the schema and add XML content to your annotations.</info>

+</step>

+<step><cmd>If you do not want the simple type to be used to derive

+other types, click the <uicontrol>Advanced</uicontrol> tab and, in

+the <uicontrol>Final</uicontrol> list, select if derivations should

+be prevented by <uicontrol>list</uicontrol>, <uicontrol>restriction</uicontrol>, <uicontrol>union</uicontrol> or <uicontrol>#all</uicontrol>.</cmd><?Pub

+Caret1?></step>

 </steps>

 </taskbody>

 </task>

-<?Pub *0000007829?>

+<?Pub *0000006999?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddsmpt.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddsmpt.html
index f699167..9f09ca2 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddsmpt.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/taddsmpt.html
@@ -2,17 +2,17 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="task" name="DC.Type" />
 <meta name="DC.Title" content="Adding simple types" />
-<meta name="abstract" content="Simple types are used to create derived datatypes. They provide a set of constraints on the value space (a set of values) and the lexical space (a set of valid literals) of a datatype." />
-<meta name="description" content="Simple types are used to create derived datatypes. They provide a set of constraints on the value space (a set of values) and the lexical space (a set of valid literals) of a datatype." />
-<meta content="XML schema editor, adding, simple types, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, adding, simple types, XML schema files" name="keywords" />
+<meta name="abstract" content="Simple types are used to create derived data types. They provide a set of constraints on the value space (a set of values) and the lexical space (a set of valid literals) of a datatype." />
+<meta name="description" content="Simple types are used to create derived data types. They provide a set of constraints on the value space (a set of values) and the lexical space (a set of valid literals) of a datatype." />
+<meta content="XML schema editor, simple types, XML schema files" name="DC.subject" />
+<meta content="XML schema editor, simple types, XML schema files" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/taddreg.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="taddsmpt" name="DC.Identifier" />
@@ -28,17 +28,18 @@
 
 
 
-<div><p>Simple types are used to create derived datatypes.
-They provide a set of constraints on the value space (a set of values) and
-the lexical space (a set of valid literals) of a datatype.</p>
+<div><p>Simple types are used to create derived data types. They
+provide a set of constraints on the value space (a set of values)
+and the lexical space (a set of valid literals) of a datatype.</p>
 
-<div class="section"><p>A simple type cannot have element content and cannot carry attributes.
-Elements that contain numbers (and strings, and dates, and so on) but do not
-contain any sub-elements have a simple type.</p>
-<p>The following instructions
-were written for the Resource perspective, but they will also work in many
-other perspectives.</p>
-<p>To add a simple type:</p>
+<div class="section"><p>A simple type cannot have element content and cannot carry
+attributes. Elements that contain numbers (and strings, and dates,
+and so on) but do not contain any sub-elements have a simple type.</p>
+<p>The
+following instructions were written for the Resource perspective,
+but they will also work in many other perspectives.</p>
+<p>To add a
+simple type, complete the following steps:</p>
 </div>
 
 <ol>
@@ -57,98 +58,77 @@
 
 <li class="stepexpand"><span>You can select the following options from the <span class="uicontrol">Variety</span> list:</span>
 <ul>
-<li><span class="uicontrol">atomic</span>. Atomic types are all the simple types
-built into the XML schema language.</li>
+<li><span class="uicontrol">atomic</span>: atomic types are all the simple
+types built into the XML schema language.</li>
 
-<li><span class="uicontrol">list</span>. List types are comprised of sequences
-of atomic types. They have values that are comprised of finite-length sequences
-of atomic values. </li>
+<li><span class="uicontrol">list</span>: list types are comprised of sequences
+of atomic types. They have values that are comprised of finite-length
+sequences of atomic values. </li>
 
-<li><span class="uicontrol">union</span>. A union type enables an element or attribute
-value to be one or more instances of one type drawn from the union of multiple
-atomic and list types.</li>
+<li><span class="uicontrol">union</span>: union types enable an element
+or attribute value to be one or more instances of one type drawn from
+the union of multiple atomic and list types.</li>
 
 </ul>
 
 </li>
 
-<li class="stepexpand"><span>If you selected <span class="uicontrol">atomic</span> from the <span class="uicontrol">Variety</span> list,
-click <span class="uicontrol">Browse</span> <img src="../images/Browse.gif" alt="This&#10;graphic is the Browse button" /> next to the <span class="uicontrol">Base type</span> field
-to specify a base type for the simple type.</span> The Set Type dialog
-box lists all built-in and user-defined types currently available. You can
-change the <span class="uicontrol">Scope</span> of the list by selecting one of the
-following options:<ul>
-<li><span class="uicontrol">Workspace</span>. Lists all of the types available in
-your workspace. </li>
+<li class="stepexpand"><span>If you selected <span class="uicontrol">atomic</span> or <span class="uicontrol">list</span> from
+the <span class="uicontrol">Variety</span> list, click <span class="uicontrol">Browse</span> <img src="../images/Browse.gif" alt="This graphic is the Browse button" /> next to the <span class="uicontrol">Base type</span> or <span class="uicontrol">Item
+type</span> field to specify a base type for the simple type. </span>
+ The Set Type dialog box lists all built-in and user-defined
+types currently available. You can change the <span class="uicontrol">Scope</span> of
+the list by selecting one of the following options:<ul>
+<li><span class="uicontrol">Workspace</span>: lists all of the types available
+in your workspace. </li>
 
-<li><span class="uicontrol">Enclosing Project</span>. Lists all of the types available
-in the project that contains your file. </li>
+<li><span class="uicontrol">Enclosing Project</span>: lists all of the types
+available in the project that contains your file. </li>
 
-<li>(Default) <span class="uicontrol">Current Resource</span>. List all of the types
-available in your current file.</li>
+<li>(Default) <span class="uicontrol">Current Resource</span>: lists all of
+the types available in your current file.</li>
 
-<li><span class="uicontrol">Working Sets</span>. List all the types available within
-the selected working set.</li>
-
-</ul>
-</li>
-
-<li class="stepexpand"><span>If you selected <span class="uicontrol">list</span> from the <span class="uicontrol">Variety</span> list,
-click <span class="uicontrol">Browse</span> <img src="../images/Browse.gif" alt="This&#10;graphic is the Browse button" /> next to the <span class="uicontrol">Item type</span> field
-to specify a item type for the simple type.</span> The Set Type dialog
-box lists all built-in and user-defined types currently available. You can
-change the <span class="uicontrol">Scope</span> of the list by selecting one of the
-following options:<ul>
-<li><span class="uicontrol">Workspace</span>. Lists all of the types available in
-your workspace. </li>
-
-<li><span class="uicontrol">Enclosing Project</span>. Lists all of the types available
-in the project that contains your file. </li>
-
-<li>(Default) <span class="uicontrol">Current Resource</span>. List all of the types
-available in your current file.</li>
-
-<li><span class="uicontrol">Working Sets</span>. List all the types available within
-the selected working set.</li>
+<li><span class="uicontrol">Working Sets</span>: lists all the types available
+within the selected working set.</li>
 
 </ul>
 </li>
 
 <li class="stepexpand"><span>If you selected <span class="uicontrol">union</span> from the <span class="uicontrol">Variety</span> list,
-click <span class="uicontrol">Browse</span> <img src="../images/Browse.gif" alt="This&#10;graphic is the Browse button" /> next to the <span class="uicontrol">Member types</span> field
-to specify the member types for the simple type.</span> You can select
-to add both <span class="uicontrol">Built-in simple types</span> and <span class="uicontrol">User-defined
-simple types</span> to the member types value list. </li>
+click <span class="uicontrol">Browse</span> <img src="../images/Browse.gif" alt="This graphic is the Browse button" /> next to the <span class="uicontrol">Member
+types</span> field to specify the member types for the simple
+type. </span> You can select to add both <span class="uicontrol">Built-in simple
+types</span> and <span class="uicontrol">User-defined simple types</span> to
+the member types value list. </li>
 
-<li class="stepexpand"><span>Click the <span class="uicontrol">Constraints</span> tab.</span> From
-here you will be able to set specific constraint values including length constraints,
-enumerations, and patterns. 
+<li class="stepexpand"><span>To set specific constraint values on your simple type,
+such as length constraints, enumerations, and patterns, click the <span class="uicontrol">Constraints</span> tab.</span>
 <ol type="a">
-<li class="substepexpand"><span>Enumerations help you to define a set of valid values for simple
-types. They are the actual values the simple type can take as valid values
-in the instance document. You can either add one enumeration or several enumerations
-at a time:</span> <ul>
+<li class="substepexpand"><span>You can use <em>enumerations</em> to define a set of valid
+values for simple types. They are the actual values the simple type
+can take as valid values in the instance document. You can add one
+enumeration or several enumerations at a time:</span> <ul>
 <li>To add one enumeration at a time, under <span class="uicontrol">Specific constraint
-values</span>, select <span class="uicontrol">Enumerations</span> and click <span class="uicontrol">Add</span> and
-specify a value for the enumeration.</li>
+values</span>, select <span class="uicontrol">Enumerations</span> and
+click <span class="uicontrol">Add</span> and specify a value for the enumeration.</li>
 
-<li>To add several enumerations at one time, follow these steps:<ol type="i">
-<li>Select <span class="uicontrol">Enumerations</span>.</li>
+<li>To add several enumerations at one time:<ol type="i">
+<li>Select <span class="uicontrol">Enumerations</span> and click <span class="uicontrol">Add</span>.</li>
 
-<li>Click <span class="uicontrol">Add</span>.</li>
-
-<li>Enter the value of each enumeration. Each value must be separated by the <span class="uicontrol">Delimiter
-character</span>. For example: <samp class="codeph">First, Second</samp> will create
-two enumerations, one with the value "First" and one with the value "Second".</li>
+<li>Enter the value of each enumeration. Each value must be separated
+by the <span class="uicontrol">Delimiter character</span>. For example: <samp class="codeph">First,
+Second</samp> will create two enumerations, one with the value "First"
+and one with the value "Second".</li>
 
 <li>Select the <span class="uicontrol">Preserve leading and trailing whitespace</span> check
-box if you want any white space around your enumeration values to be preserved.
-If you select this check box, the values of <samp class="codeph">First, Second</samp> will
-show up as "First" and " Second" (there is a space before Second) because
-you put a space before "Second" when entering the value.</li>
+box if you want any white space around your enumeration values to
+be preserved. If you select this check box, the values of <samp class="codeph">First,
+Second</samp> will show up as "First" and " Second" (there is a
+space before Second) because you put a space before "Second" when
+entering the value.</li>
 
-<li>Click <span class="uicontrol">OK</span>. Your enumerations will be created and
-appear in the Properties view.</li>
+<li>Click <span class="uicontrol">OK</span>. Your enumerations will be created
+and appear in the Properties view.</li>
 
 </ol>
 </li>
@@ -156,16 +136,14 @@
 </ul>
 </li>
 
-<li class="substepexpand"><span>Patterns help you to place certain constraints regarding allowable
-values.</span> For example, you could restrict the field to only accept
-input which follows the pattern "five digits followed by two upper-case ASCII
-letters". To set a pattern constraint:<ol type="i">
-<li>Select <span class="uicontrol">Patterns</span>.</li>
+<li class="substepexpand"><span>You can use <em>patterns</em> to place certain constraints
+regarding allowable values. </span> For example, you could restrict
+the field to only accept input which follows the pattern "five digits
+followed by two upper-case ASCII letters". To set a pattern constraint:<ol type="i">
+<li>Select <span class="uicontrol">Patterns</span> and click <span class="uicontrol">Add</span>.</li>
 
-<li>Click <span class="uicontrol">Add</span>.</li>
-
-<li>Create the regular expression pattern you wish to use as your constraint
-using the <span class="uicontrol">Regular Expression</span> wizard.</li>
+<li>Create the regular expression pattern you wish to use as your
+constraint using the <span class="uicontrol">Regular Expression</span> wizard.</li>
 
 <li>Click <span class="uicontrol">Finish</span>.</li>
 
@@ -176,14 +154,21 @@
 
 </li>
 
-<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
-to provide any information about this simple type.</span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.</li>
+<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you
+want to provide any information about this simple type. </span> The <span class="uicontrol">Documentation</span> page
+is used for human readable material, such as a description.
+</li>
 
-<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you want to
-add application information elements to your annotations of schema components.</span>
- The <span class="uicontrol">Extensions</span> page allows you to specify the
-schema and add XML content to your annotations.</li>
+<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you
+want to add application information elements to your annotations of
+schema components. </span> The <span class="uicontrol">Extensions</span> page
+allows you to specify the schema and add XML content to your annotations.
+</li>
+
+<li class="stepexpand"><span>If you do not want the simple type to be used to derive
+other types, click the <span class="uicontrol">Advanced</span> tab and, in
+the <span class="uicontrol">Final</span> list, select if derivations should
+be prevented by <span class="uicontrol">list</span>, <span class="uicontrol">restriction</span>, <span class="uicontrol">union</span> or <span class="uicontrol">#all</span>.</span></li>
 
 </ol>
 
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.dita
index bde45d1..50abd13 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.dita
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">

+<!--Arbortext, Inc., 1988-2006, v.4002-->

+<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

+ "task.dtd">

 <task id="tcxmlsch" xml:lang="en-us">

 <title>Creating XML schemas</title>

 <titlealts>

@@ -14,12 +15,12 @@
 </keywords>

 </metadata></prolog>

 <taskbody>

-<context>To create an XML schema, follow these steps:</context>

+<context>To create an XML schema, complete the following steps<?Pub Caret?>:</context>

 <steps>

 <step><cmd>Create a project to contain the XML schema.</cmd></step>

-<step><cmd>In the workbench, select  <menucascade><uicontrol>File > New >

-Other > XML > XML Schema</uicontrol></menucascade> and click <uicontrol>Next</uicontrol>.</cmd>

-</step>

+<step><cmd>In the workbench, click <menucascade><uicontrol>File > New > Other</uicontrol>

+</menucascade> and select <menucascade><uicontrol>XML > XML Schema</uicontrol>

+</menucascade>. Click <uicontrol>Next</uicontrol>.</cmd></step>

 <step><cmd>Select the project or folder that will contain the XML schema.

 In the </cmd><info><uicontrol>File name</uicontrol> field, type the name of

 the XML schema, for example <userinput>MyXMLSchema.xsd</userinput>. The name

@@ -29,3 +30,4 @@
 <result>The XML schema opens in the XML schema editor. </result>

 </taskbody>

 </task>

+<?Pub *0000001558?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.html
index 9aec932..9b57492 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tcxmlsch.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -34,14 +34,14 @@
 editor. Using the XML schema editor, you can specify element names that indicates
 which elements are allowed in an XML file, and in which combinations.</p>
 
-<div class="section">To create an XML schema, follow these steps:</div>
+<div class="section">To create an XML schema, complete the following steps:</div>
 
 <ol>
 <li class="stepexpand"><span>Create a project to contain the XML schema.</span></li>
 
-<li class="stepexpand"><span>In the workbench, select  <span class="menucascade"><span class="uicontrol">File &gt; New &gt;
-Other &gt; XML &gt; XML Schema</span></span> and click <span class="uicontrol">Next</span>.</span>
-</li>
+<li class="stepexpand"><span>In the workbench, click <span class="menucascade"><span class="uicontrol">File &gt; New &gt; Other</span>
+</span> and select <span class="menucascade"><span class="uicontrol">XML &gt; XML Schema</span>
+</span>. Click <span class="uicontrol">Next</span>.</span></li>
 
 <li class="stepexpand"><span>Select the project or folder that will contain the XML schema.
 In the </span> <span class="uicontrol">File name</span> field, type the name of
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tdelscmp.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tdelscmp.dita
index 8c1475c..b13288c 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tdelscmp.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tdelscmp.dita
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">

+<!--Arbortext, Inc., 1988-2006, v.4002-->

+<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

+ "task.dtd">

 <task id="tdelscmp" xml:lang="en-us">

 <title>Deleting XML schema components</title>

 <titlealts>

@@ -16,7 +17,7 @@
 <taskbody>

 <context><p>The following instructions were written for the Resource perspective,

 but they will also work in many other perspectives.</p><p>To delete an XML

-schema component, follow these steps:</p></context>

+schema component, complete the following steps:</p></context>

 <steps>

 <step><cmd>Open your XML schema in the XML schema editor.</cmd></step>

 <step><cmd>In the Outline view, click the item to delete.</cmd></step>

@@ -27,4 +28,5 @@
 integrity issues. When you delete certain components, cleanup will automatically

 occur.</p></result>

 </taskbody>

-</task>

+</task><?Pub Caret?>

+<?Pub *0000001384?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tdelscmp.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tdelscmp.html
index a4cc200..ef880c1 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tdelscmp.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tdelscmp.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Deleting XML schema components" />
 <meta name="abstract" content="If you have created any XML schema components you no longer need, you can delete them." />
 <meta name="description" content="If you have created any XML schema components you no longer need, you can delete them." />
-<meta content="XML schema editor, deleting, components, XML schema files" name="DC.subject" />
-<meta content="XML schema editor, deleting, components, XML schema files" name="keywords" />
+<meta content="XML schema editor, deleting components, XML schema files" name="DC.subject" />
+<meta content="XML schema editor, deleting components, XML schema files" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/rrefintg.html" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="tdelscmp" name="DC.Identifier" />
@@ -34,7 +34,7 @@
 <div class="section"><p>The following instructions were written for the Resource perspective,
 but they will also work in many other perspectives.</p>
 <p>To delete an XML
-schema component, follow these steps:</p>
+schema component, complete the following steps:</p>
 </div>
 
 <ol>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.dita
index 6276242..2c84134 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.dita
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">

+<!--Arbortext, Inc., 1988-2006, v.4002-->

+<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

+ "task.dtd">

 <task id="tedtpref" xml:lang="en-us">

 <title>Editing XML schema file preferences</title>

 <titlealts>

@@ -14,16 +15,18 @@
 </keywords>

 </metadata></prolog>

 <taskbody>

-<context><p>To define XML schema file preferences, follow these steps:</p></context>

+<context><p>To define XML schema file preferences, complete the following

+steps:</p></context>

 <steps>

-<step><cmd>Select  <menucascade><uicontrol>Window > Preferences > Web and

-XML > XML Schema Files</uicontrol></menucascade>.</cmd></step>

+<step><cmd>Click <menucascade><uicontrol>Window > Preferences</uicontrol>

+</menucascade> and select <menucascade><uicontrol>XML</uicontrol><uicontrol>XML

+Schema Files</uicontrol></menucascade>.</cmd></step>

 <step><cmd>Select the <uicontrol>Qualify XML schema language constructs</uicontrol> check

 box if you want a prefix applied to all XML Schema language constructs in

 your XML schema.</cmd></step>

 <step><cmd>In the <uicontrol>XML schema language constructs prefix</uicontrol> field,

 type the prefix you want applied to XML Schema language constructs in your

-XML schema.</cmd><info> The prefix <uicontrol>xsd</uicontrol> is used by convention

+XML schema.</cmd><info>The prefix <uicontrol>xsd</uicontrol> is used by convention

 to denote the XML Schema namespace, but any prefix can be used. The purpose

 of the association is to identify the elements and simple types as belonging

 to the vocabulary of the XML Schema language rather than the vocabulary of

@@ -40,3 +43,4 @@
 <result></result>

 </taskbody>

 </task>

+<?Pub *0000002381?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.html
index fe76430..bb329ed 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtpref.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Editing XML schema file preferences" />
 <meta name="abstract" content="You can set various preferences for XML schema files such as the default target namespace and XML Schema language constructs prefix used." />
 <meta name="description" content="You can set various preferences for XML schema files such as the default target namespace and XML Schema language constructs prefix used." />
-<meta content="XML schema files, defining, default target namespace, XML schema files, schema prefix" name="DC.subject" />
-<meta content="XML schema files, defining, default target namespace, XML schema files, schema prefix" name="keywords" />
+<meta content="XML schema files, editing preferences, preferences" name="DC.subject" />
+<meta content="XML schema files, editing preferences, preferences" name="keywords" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="tedtpref" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -30,12 +30,14 @@
 <div><p>You can set various preferences for XML schema files such as the
 default target namespace and XML Schema language constructs prefix used.</p>
 
-<div class="section"><p>To define XML schema file preferences, follow these steps:</p>
+<div class="section"><p>To define XML schema file preferences, complete the following
+steps:</p>
 </div>
 
 <ol>
-<li class="stepexpand"><span>Select  <span class="menucascade"><span class="uicontrol">Window &gt; Preferences &gt; Web and
-XML &gt; XML Schema Files</span></span>.</span></li>
+<li class="stepexpand"><span>Click <span class="menucascade"><span class="uicontrol">Window &gt; Preferences</span>
+</span> and select <span class="menucascade"><span class="uicontrol">XML</span> &gt; <span class="uicontrol">XML
+Schema Files</span></span>.</span></li>
 
 <li class="stepexpand"><span>Select the <span class="uicontrol">Qualify XML schema language constructs</span> check
 box if you want a prefix applied to all XML Schema language constructs in
@@ -43,7 +45,7 @@
 
 <li class="stepexpand"><span>In the <span class="uicontrol">XML schema language constructs prefix</span> field,
 type the prefix you want applied to XML Schema language constructs in your
-XML schema.</span>  The prefix <span class="uicontrol">xsd</span> is used by convention
+XML schema.</span> The prefix <span class="uicontrol">xsd</span> is used by convention
 to denote the XML Schema namespace, but any prefix can be used. The purpose
 of the association is to identify the elements and simple types as belonging
 to the vocabulary of the XML Schema language rather than the vocabulary of
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtschm.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtschm.dita
index 666ecb8..1cf2b95 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtschm.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtschm.dita
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<?xml version="1.0" encoding="UTF-8"?>

+<!--Arbortext, Inc., 1988-2008, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <?Pub Inc?>

@@ -8,40 +8,51 @@
 <titlealts>

 <searchtitle>Editing XML schema properties</searchtitle>

 </titlealts>

-<shortdesc>After you create an XML schema, you can edit its various properties,

-such as its namespace and prefix.</shortdesc>

+<shortdesc>After you create an XML schema, you can edit its various

+properties, such as its namespace and prefix.</shortdesc>

 <prolog><metadata>

 <keywords><indexterm>XML schema editor<indexterm>XML schema properties</indexterm></indexterm>

 <indexterm>XML schema files<indexterm>editing properties</indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <taskbody>

-<context><p>The following instructions were written for the Resource perspective,

-but they will also work in many other perspectives.</p><p>To edit an XML schema's

-properties follow these steps:</p></context>

+<context><p><?Pub Caret1?>The following instructions were written

+for the Resource perspective, but they will also work in many other

+perspectives.</p><p>To edit an XML schema's properties, complete the

+following steps:</p></context>

 <steps>

-<step><cmd>Create a new XML schema or double-click an existing schema in the

-Navigator view.</cmd><info> It will automatically open in the XML schema editor.</info>

-</step>

+<step><cmd>Create a new XML schema or double-click an existing schema

+in the Navigator view.</cmd><info> It will automatically open in the

+XML schema editor.</info></step>

 <step><cmd>In the Outline view, click <uicontrol>Directives</uicontrol>.</cmd>

 </step>

 <step><cmd>In the Properties view, click the <uicontrol>General</uicontrol> tab.</cmd>

 </step>

-<step><cmd>You can change the <uicontrol>Prefix</uicontrol> associated with

-the current namespace.</cmd><info>Element and attribute names that are associated

-with this namespace will be prefixed with this value.</info></step>

+<step><cmd>You can change the <uicontrol>Prefix</uicontrol> associated

+with the current namespace. </cmd><info>Element and attribute names

+that are associated with this namespace will be prefixed with this

+value.</info></step>

 <step><cmd>You can also edit the <uicontrol>Target namespace</uicontrol> for

-this schema.</cmd><info> A namespace is a URI that provides a unique name

-to associate with all the elements and type definitions in a schema.</info>

+this schema.</cmd><info> A namespace is a URI that provides a unique

+name to associate with all the elements and type definitions in a

+schema.</info></step>

+<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you

+want to provide any information about this XML schema. </cmd><info>The <uicontrol>Documentation</uicontrol> page

+is used for human readable material, such as a description.</info>

 </step>

-<step><cmd>Click the <uicontrol>Documentation</uicontrol> tab if you want

-to provide any information about this XML schema.</cmd><info>The <uicontrol>Documentation</uicontrol> page

-is used for human readable material, such as a description.</info></step>

-<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you want to

-add application information elements to your annotations of schema components.</cmd>

-<info>The <uicontrol>Extensions</uicontrol> page allows you to specify the

-schema and add XML content to your annotations.</info></step>

+<step><cmd>Click the <uicontrol>Extensions</uicontrol> tab if you

+want to add application information elements to your annotations of

+schema components. </cmd><info>The <uicontrol>Extensions</uicontrol> page

+allows you to specify the schema and add XML content to your annotations.</info>

+</step>

+<step><cmd>Click the <uicontrol>Advanced</uicontrol> tab if you want

+to define the following additional schema attributes: </cmd><info><ul>

+<li><uicontrol>Prefix for elements</uicontrol> (elementFormDefault)</li>

+<li><uicontrol>Prefix for attributes</uicontrol> (attributeFormDefault)</li>

+<li><uicontrol>Block default</uicontrol> (blockDefault)</li>

+<li><uicontrol>Final default</uicontrol> (finalDefault)</li>

+</ul></info></step>

 </steps>

 </taskbody>

 </task>

-<?Pub *0000002389?>

+<?Pub *0000002780?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtschm.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtschm.html
index 840ef3a..aed5ae6 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtschm.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tedtschm.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Editing XML schema properties" />
 <meta name="abstract" content="After you create an XML schema, you can edit its various properties, such as its namespace and prefix." />
 <meta name="description" content="After you create an XML schema, you can edit its various properties, such as its namespace and prefix." />
-<meta content="XML schema editor, editing XML schemas, simple types, XML schema files, editing" name="DC.subject" />
-<meta content="XML schema editor, editing XML schemas, simple types, XML schema files, editing" name="keywords" />
+<meta content="XML schema editor, XML schema properties, XML schema files, editing properties" name="DC.subject" />
+<meta content="XML schema editor, XML schema properties, XML schema files, editing properties" name="keywords" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="tedtschm" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -27,19 +27,20 @@
 
 
 
-<div><p>After you create an XML schema, you can edit its various properties,
-such as its namespace and prefix.</p>
+<div><p>After you create an XML schema, you can edit its various
+properties, such as its namespace and prefix.</p>
 
-<div class="section"><p>The following instructions were written for the Resource perspective,
-but they will also work in many other perspectives.</p>
-<p>To edit an XML schema's
-properties follow these steps:</p>
+<div class="section"><p>The following instructions were written
+for the Resource perspective, but they will also work in many other
+perspectives.</p>
+<p>To edit an XML schema's properties, complete the
+following steps:</p>
 </div>
 
 <ol>
-<li class="stepexpand"><span>Create a new XML schema or double-click an existing schema in the
-Navigator view.</span>  It will automatically open in the XML schema editor.
-</li>
+<li class="stepexpand"><span>Create a new XML schema or double-click an existing schema
+in the Navigator view.</span>  It will automatically open in the
+XML schema editor.</li>
 
 <li class="stepexpand"><span>In the Outline view, click <span class="uicontrol">Directives</span>.</span>
 </li>
@@ -47,23 +48,39 @@
 <li class="stepexpand"><span>In the Properties view, click the <span class="uicontrol">General</span> tab.</span>
 </li>
 
-<li class="stepexpand"><span>You can change the <span class="uicontrol">Prefix</span> associated with
-the current namespace.</span> Element and attribute names that are associated
-with this namespace will be prefixed with this value.</li>
+<li class="stepexpand"><span>You can change the <span class="uicontrol">Prefix</span> associated
+with the current namespace. </span> Element and attribute names
+that are associated with this namespace will be prefixed with this
+value.</li>
 
 <li class="stepexpand"><span>You can also edit the <span class="uicontrol">Target namespace</span> for
-this schema.</span>  A namespace is a URI that provides a unique name
-to associate with all the elements and type definitions in a schema.
+this schema.</span>  A namespace is a URI that provides a unique
+name to associate with all the elements and type definitions in a
+schema.</li>
+
+<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you
+want to provide any information about this XML schema. </span> The <span class="uicontrol">Documentation</span> page
+is used for human readable material, such as a description.
 </li>
 
-<li class="stepexpand"><span>Click the <span class="uicontrol">Documentation</span> tab if you want
-to provide any information about this XML schema.</span> The <span class="uicontrol">Documentation</span> page
-is used for human readable material, such as a description.</li>
+<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you
+want to add application information elements to your annotations of
+schema components. </span> The <span class="uicontrol">Extensions</span> page
+allows you to specify the schema and add XML content to your annotations.
+</li>
 
-<li class="stepexpand"><span>Click the <span class="uicontrol">Extensions</span> tab if you want to
-add application information elements to your annotations of schema components.</span>
- The <span class="uicontrol">Extensions</span> page allows you to specify the
-schema and add XML content to your annotations.</li>
+<li class="stepexpand"><span>Click the <span class="uicontrol">Advanced</span> tab if you want
+to define the following additional schema attributes: </span> <ul>
+<li><span class="uicontrol">Prefix for elements</span> (elementFormDefault)</li>
+
+<li><span class="uicontrol">Prefix for attributes</span> (attributeFormDefault)</li>
+
+<li><span class="uicontrol">Block default</span> (blockDefault)</li>
+
+<li><span class="uicontrol">Final default</span> (finalDefault)</li>
+
+</ul>
+</li>
 
 </ol>
 
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/timpschm.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/timpschm.dita
index bc1b82a..90014ec 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/timpschm.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/timpschm.dita
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <task id="timpschm" xml:lang="en-us">

@@ -18,17 +18,35 @@
 <taskbody>

 <context><p>The following instructions were written for the Resource perspective,

 but they will also work in many other perspectives.</p><p>To import an XML

-schema into the workbench:</p></context>

+schema into the workbench, complete the following steps:</p></context>

 <steps>

 <step><cmd>Click <menucascade><uicontrol>File > Import</uicontrol></menucascade>.</cmd>

 </step>

-<step><cmd>Select the import source.</cmd><info> Click <uicontrol>Next</uicontrol>.</info>

+<step><cmd>Select <menucascade><uicontrol>General</uicontrol><uicontrol>File

+System</uicontrol></menucascade> and click  <uicontrol>Next</uicontrol>.</cmd>

 </step>

-<step><cmd>Fill in the fields in the Import wizard as necessary.</cmd><info> When

-you are finished, click <uicontrol>Finish</uicontrol>.</info></step>

-</steps>

+<step><cmd>Click <uicontrol>Browse</uicontrol> on the next page of the wizard

+to select the directories from which you would like to add the XML schema.</cmd>

+</step>

+<step><cmd>In the import selection panes, use the following methods to select

+exactly the resources you want to add:  </cmd><info><ul>

+<li>Expand the hierarchies in the left pane and select or clear the checkboxes

+that represent the folders in the selected directory. Then in the right pane,

+select or clear check boxes for individual files.</li>

+<li>Click <uicontrol>Filter Types</uicontrol> to filter the current selection

+for files of a specific type.</li>

+<li>Click <uicontrol>Select All</uicontrol> to select all resources in the

+directory, then go through and deselect the ones that you do not want to add.</li>

+<li>Click <uicontrol>Deselect All</uicontrol> to deselect all resources in

+the directory, then go through and choose individual resources to add.</li>

+</ul></info></step>

+<step><cmd>In the <uicontrol>Into folder</uicontrol> field, specify the Workbench

+project or folder that will be the import destination.</cmd></step>

+<step><cmd>When you have finished specifying your import options, click <uicontrol>Finish.</uicontrol></cmd>

+</step>

+</steps><?Pub Caret1?>

 <result><p>The imported schema now appears in the Navigator view. Double-click

 it to open it in the XML schema editor.</p></result>

 </taskbody>

 </task>

-<?Pub *0000001448?>

+<?Pub *0000002616?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/timpschm.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/timpschm.html
index 8726a2c..44f38a8 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/timpschm.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/timpschm.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -40,18 +40,44 @@
 <div class="section"><p>The following instructions were written for the Resource perspective,
 but they will also work in many other perspectives.</p>
 <p>To import an XML
-schema into the workbench:</p>
+schema into the workbench, complete the following steps:</p>
 </div>
 
 <ol>
 <li class="stepexpand"><span>Click <span class="menucascade"><span class="uicontrol">File &gt; Import</span></span>.</span>
 </li>
 
-<li class="stepexpand"><span>Select the import source.</span>  Click <span class="uicontrol">Next</span>.
+<li class="stepexpand"><span>Select <span class="menucascade"><span class="uicontrol">General</span> &gt; <span class="uicontrol">File
+System</span></span> and click  <span class="uicontrol">Next</span>.</span>
 </li>
 
-<li class="stepexpand"><span>Fill in the fields in the Import wizard as necessary.</span>  When
-you are finished, click <span class="uicontrol">Finish</span>.</li>
+<li class="stepexpand"><span>Click <span class="uicontrol">Browse</span> on the next page of the wizard
+to select the directories from which you would like to add the XML schema.</span>
+</li>
+
+<li class="stepexpand"><span>In the import selection panes, use the following methods to select
+exactly the resources you want to add:  </span> <ul>
+<li>Expand the hierarchies in the left pane and select or clear the checkboxes
+that represent the folders in the selected directory. Then in the right pane,
+select or clear check boxes for individual files.</li>
+
+<li>Click <span class="uicontrol">Filter Types</span> to filter the current selection
+for files of a specific type.</li>
+
+<li>Click <span class="uicontrol">Select All</span> to select all resources in the
+directory, then go through and deselect the ones that you do not want to add.</li>
+
+<li>Click <span class="uicontrol">Deselect All</span> to deselect all resources in
+the directory, then go through and choose individual resources to add.</li>
+
+</ul>
+</li>
+
+<li class="stepexpand"><span>In the <span class="uicontrol">Into folder</span> field, specify the Workbench
+project or folder that will be the import destination.</span></li>
+
+<li class="stepexpand"><span>When you have finished specifying your import options, click <span class="uicontrol">Finish.</span></span>
+</li>
 
 </ol>
 
@@ -67,8 +93,8 @@
 <div class="reltasks"><strong>Related tasks</strong><br />
 <div><a href="../topics/tedtschm.html" title="After you create an XML schema, you can edit its various properties, such as its namespace and prefix.">Editing XML schema properties</a></div>
 <div><a href="../topics/tvdtschm.html" title="Validating an XML schema determines whether the current state of the XML schema file is semantically valid. Any errors will be displayed in the Problems view.">Validating XML schemas</a></div>
-<div><a href="../topics/taddimpt.html" title="As schemas become larger, it is often desirable to divide their content among several schema documents for purposes such as ease of maintenance, reuse, and readability. You can use an import element to bring in definitions and declarations from an imported schema into the current schema.">Adding import elements</a></div>
-<div><a href="../topics/taddincl.html" title="As schemas become larger, it is often desirable to divide their content among several schema documents for purposes such as ease of maintenance, reuse, and readability. You can use the include element to bring in definitions and declarations from the included schema into the current schema. The included schema must be in the same target namespace as the including schema.">Adding include elements</a></div>
+<div><a href="../topics/taddimpt.html" title="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use an import element to bring in definitions and declarations from an imported schema into the current schema.">Adding import elements</a></div>
+<div><a href="../topics/taddincl.html" title="If your schemas are large, you might choose to divide their content among several schema documents to make them easier to maintain, reuse, and read. You can use the include element to bring in definitions and declarations from the included schema into the current schema. The included schema must be in the same target namespace as the including schema.">Adding include elements</a></div>
 </div>
 </div>
 
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tnavsrc.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tnavsrc.dita
index c4f2a0f..60386d1 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tnavsrc.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tnavsrc.dita
@@ -1,13 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

-<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">

+<!--Arbortext, Inc., 1988-2006, v.4002-->

+<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

+ "task.dtd">

 <task id="tnavsrc" xml:lang="en-us">

 <title>Navigating XML schemas</title>

 <titlealts>

 <searchtitle>Navigating XML schemas</searchtitle>

 </titlealts>

 <shortdesc>When you are working in the Source view, you can use F3 to navigate

-through the file by placing your cursor in the appropriate item and clicking

+through the file by placing your cursor in the appropriate item and pressing

 F3 to jump to the item it refers to. </shortdesc>

 <prolog><metadata>

 <keywords><indexterm>XML schema files<indexterm>navigating</indexterm></indexterm>

@@ -22,11 +23,12 @@
 <li>Attribute group references</li>

 <li>Import, include, and redefine element (the external schema will open in

 the XML schema editor. This only works with schemas in the workspace).</li>

-</ul><p>You must place your cursor exactly in the location of the reference

-(for example between the double quotes for <systemoutput>type = " "</systemoutput> or

- <systemoutput>base = " "</systemoutput>).</p><p>For example, if you place

-your cursor anywhere in the following text and click F3:</p><p> <systemoutput>&lt;element

-name="shipTo" type="po:USAddress">&lt;/element></systemoutput> </p><p>the

+<li></li>

+</ul><p>You<?Pub Caret?> must place your cursor exactly in the location of

+the reference (for example between the double quotes for <systemoutput>type

+= " "</systemoutput> or  <systemoutput>base = " "</systemoutput>).</p><p>For

+example, if you place your cursor anywhere in the following text and press

+F3:</p><p> <systemoutput>&lt;element name="shipTo" type="po:USAddress">&lt;/element></systemoutput> </p><p>the

 cursor will automatically jump to the location in the file where the type

 USAddress is defined.</p><p>Or, if you place your cursor anywhere in the following

 text and click F3:</p><p> <systemoutput>&lt;element ref="po:ContactElement">&lt;/element></systemoutput> </p><p>the

@@ -36,3 +38,4 @@
 F3, you will automatically be taken to that file.</p></context>

 </taskbody>

 </task>

+<?Pub *0000002066?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tnavsrc.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tnavsrc.html
index 582def5..21e4df0 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tnavsrc.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tnavsrc.html
@@ -2,15 +2,15 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
 <meta content="task" name="DC.Type" />
 <meta name="DC.Title" content="Navigating XML schemas" />
-<meta name="abstract" content="When you are working in the Source view, you can use F3 to navigate through the file by placing your cursor in the appropriate item and clicking F3 to jump to the item it refers to." />
-<meta name="description" content="When you are working in the Source view, you can use F3 to navigate through the file by placing your cursor in the appropriate item and clicking F3 to jump to the item it refers to." />
+<meta name="abstract" content="When you are working in the Source view, you can use F3 to navigate through the file by placing your cursor in the appropriate item and pressing F3 to jump to the item it refers to." />
+<meta name="description" content="When you are working in the Source view, you can use F3 to navigate through the file by placing your cursor in the appropriate item and pressing F3 to jump to the item it refers to." />
 <meta content="XML schema files, navigating" name="DC.subject" />
 <meta content="XML schema files, navigating" name="keywords" />
 <meta scheme="URI" name="DC.Relation" content="../topics/cxmlsced.html" />
@@ -29,7 +29,7 @@
 
 
 <div><p>When you are working in the Source view, you can use F3 to navigate
-through the file by placing your cursor in the appropriate item and clicking
+through the file by placing your cursor in the appropriate item and pressing
 F3 to jump to the item it refers to. </p>
 
 <div class="section"><p>You can jump to any of the following items:</p>
@@ -47,14 +47,16 @@
 <li>Import, include, and redefine element (the external schema will open in
 the XML schema editor. This only works with schemas in the workspace).</li>
 
+<li />
+
 </ul>
-<p>You must place your cursor exactly in the location of the reference
-(for example between the double quotes for <tt class="sysout">type = " "</tt> or
- <tt class="sysout">base = " "</tt>).</p>
-<p>For example, if you place
-your cursor anywhere in the following text and click F3:</p>
-<p> <tt class="sysout">&lt;element
-name="shipTo" type="po:USAddress"&gt;&lt;/element&gt;</tt> </p>
+<p>You must place your cursor exactly in the location of
+the reference (for example between the double quotes for <tt class="sysout">type
+= " "</tt> or  <tt class="sysout">base = " "</tt>).</p>
+<p>For
+example, if you place your cursor anywhere in the following text and press
+F3:</p>
+<p> <tt class="sysout">&lt;element name="shipTo" type="po:USAddress"&gt;&lt;/element&gt;</tt> </p>
 <p>the
 cursor will automatically jump to the location in the file where the type
 USAddress is defined.</p>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/trefactrXSD.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/trefactrXSD.dita
index eea3411..8736a4a 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/trefactrXSD.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/trefactrXSD.dita
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>

-<!--Arbortext, Inc., 1988-2005, v.4002-->

+<!--Arbortext, Inc., 1988-2006, v.4002-->

 <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"

  "task.dtd">

 <task id="refactoring" xml:lang="en-us">

@@ -11,10 +11,12 @@
 single artifact change, and have that change implemented throughout all other

 dependant artifacts.</shortdesc>

 <prolog><metadata>

-<keywords><indexterm>dependent artifacts<indexterm>refactorting XML schema files</indexterm></indexterm>

-<indexterm>refactoring<indexterm>XML schema files</indexterm></indexterm>

-<indexterm>renaming<indexterm>XML schema files</indexterm></indexterm>

-<indexterm>XML schemas<indexterm>editing</indexterm></indexterm>

+<keywords><indexterm keyref="trefactrXSD|1|dependentartifactsrefactortingXMLschemafiles"

+status="new">dependent artifacts<indexterm>refactoring XML schema files</indexterm></indexterm>

+<indexterm keyref="trefactrXSD|2|refactoringXMLschemafiles" status="new">refactoring<indexterm>XML

+schema files</indexterm></indexterm><indexterm keyref="trefactrXSD|3|renamingXMLschemafiles"

+status="new">renaming<indexterm>XML schema files</indexterm></indexterm><indexterm

+keyref="trefactrXSD|4|XMLschemasediting" status="changed">schemas<indexterm>editing</indexterm></indexterm>

 </keywords>

 </metadata></prolog>

 <taskbody>

@@ -32,15 +34,15 @@
 for that artifact</info>

 <substeps>

 <substep><cmd>Type in the new name of the artifact.</cmd></substep>

-<substep><cmd>(Optional) Click <b>Preview</b>.</cmd><info>A window

-will open indicating all of the changes which will take place due to the refactoring.</info>

+<substep><cmd>(Optional) Click <b>Preview</b>.</cmd><info>A window will open

+indicating all of the changes which will take place due to the refactoring.</info>

 </substep>

 <substep><cmd>Click <uicontrol>OK.</uicontrol></cmd></substep>

 </substeps>

 </step>

 </steps>

 <result>The new name will be entered in the opened XSD source, as well as

-in all dependant artifacts</result>

+in all dependant artifacts.</result>

 <example><b><u>Component References in XML Schema</u></b><simpletable>

 <sthead>

 <stentry>Global named components</stentry>

@@ -94,4 +96,3 @@
 <postreq></postreq>

 </taskbody>

 </task>

-<?Pub *0000003131?>

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/trefactrXSD.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/trefactrXSD.html
index ceb881d..521a937 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/trefactrXSD.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/trefactrXSD.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -11,8 +11,8 @@
 <meta name="DC.Title" content="Refactoring in XML Schema Files" />
 <meta name="abstract" content="Within an XML Schema file, refactoring allows authors to make a single artifact change, and have that change implemented throughout all other dependant artifacts." />
 <meta name="description" content="Within an XML Schema file, refactoring allows authors to make a single artifact change, and have that change implemented throughout all other dependant artifacts." />
-<meta content="XML schema files, XML schema editor, refactoring, renaming, editing XML schemas, dependant artifacts" name="DC.subject" />
-<meta content="XML schema files, XML schema editor, refactoring, renaming, editing XML schemas, dependant artifacts" name="keywords" />
+<meta content="dependent artifacts, refactoring XML schema files, refactoring, XML schema files, renaming, XML schema files, schemas, editing" name="DC.subject" />
+<meta content="dependent artifacts, refactoring XML schema files, refactoring, XML schema files, renaming, XML schema files, schemas, editing" name="keywords" />
 <meta content="XHTML" name="DC.Format" />
 <meta content="refactoring" name="DC.Identifier" />
 <meta content="en-us" name="DC.Language" />
@@ -49,8 +49,8 @@
 <ol type="a">
 <li class="substepexpand"><span>Type in the new name of the artifact.</span></li>
 
-<li class="substepexpand"><span>(Optional) Click <strong>Preview</strong>.</span> A window
-will open indicating all of the changes which will take place due to the refactoring.
+<li class="substepexpand"><span>(Optional) Click <strong>Preview</strong>.</span> A window will open
+indicating all of the changes which will take place due to the refactoring.
 </li>
 
 <li class="substepexpand"><span>Click <span class="uicontrol">OK.</span></span></li>
@@ -62,24 +62,24 @@
 </ol>
 
 <div class="section">The new name will be entered in the opened XSD source, as well as
-in all dependant artifacts</div>
+in all dependant artifacts.</div>
 
 <div class="example"><strong><u>Component References in XML Schema</u></strong><table summary="" cellspacing="0" cellpadding="4" border="1" class="simpletableborder">
 <tr>
-<th valign="bottom" align="left" id="N100EB">Global named components</th>
+<th valign="bottom" align="left" id="N100FE">Global named components</th>
 
-<th valign="bottom" align="left" id="N100F1">Reference</th>
+<th valign="bottom" align="left" id="N10104">Reference</th>
 
 </tr>
 
 <tr>
-<td valign="top" headers="N100EB"><ul>
+<td valign="top" headers="N100FE"><ul>
 <li>&lt;element name="foo"&gt;</li>
 
 </ul>
 </td>
 
-<td valign="top" headers="N100F1"><ul>
+<td valign="top" headers="N10104"><ul>
 <li>&lt;element ref="foo"&gt;</li>
 
 <li>&lt;element substitutionGroup="foo"</li>
@@ -90,13 +90,13 @@
 </tr>
 
 <tr>
-<td valign="top" headers="N100EB"><ul>
+<td valign="top" headers="N100FE"><ul>
 <li>&lt;simple/complexType name="foo"&gt;</li>
 
 </ul>
 </td>
 
-<td valign="top" headers="N100F1"><ul>
+<td valign="top" headers="N10104"><ul>
 <li>&lt;element type="foo"&gt;</li>
 
 <li>&lt;attribute type="foo"&gt;</li>
@@ -111,13 +111,13 @@
 </tr>
 
 <tr>
-<td valign="top" headers="N100EB"><ul>
+<td valign="top" headers="N100FE"><ul>
 <li>&lt;attribute name="foo"&gt;</li>
 
 </ul>
 </td>
 
-<td valign="top" headers="N100F1"><ul>
+<td valign="top" headers="N10104"><ul>
 <li>&lt;attribute ref="foo"&gt;</li>
 
 </ul>
@@ -126,13 +126,13 @@
 </tr>
 
 <tr>
-<td valign="top" headers="N100EB"><ul>
+<td valign="top" headers="N100FE"><ul>
 <li>&lt;attributeGroup name="foo"&gt;</li>
 
 </ul>
 </td>
 
-<td valign="top" headers="N100F1"><ul>
+<td valign="top" headers="N10104"><ul>
 <li>&lt;attributeGroup ref="foo"&gt;</li>
 
 </ul>
@@ -141,13 +141,13 @@
 </tr>
 
 <tr>
-<td valign="top" headers="N100EB"><ul>
+<td valign="top" headers="N100FE"><ul>
 <li>&lt;group name="foo"&gt;</li>
 
 </ul>
 </td>
 
-<td valign="top" headers="N100F1"><ul>
+<td valign="top" headers="N10104"><ul>
 <li>&lt;group ref="foo"&gt;</li>
 
 </ul>
diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tvdtschm.dita b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tvdtschm.dita
index 580f90c..4573f7e 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tvdtschm.dita
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tvdtschm.dita
@@ -17,16 +17,19 @@
 <taskbody>

 <context><p>The following instructions were written for the Resource perspective,

 but they will also work in many other perspectives.</p><p>To validate an XML

-schema:</p></context>

+schema, complete the following steps:</p></context>

 <steps>

 <step><cmd>Right-click your file in the Navigator view and click <uicontrol>Validate</uicontrol>.</cmd>

 </step>

 <step><cmd> If validation was not successful, you can refer to the Problems

-view to see what problems were logged. </cmd><info> <note>If you receive an

-error message indicating that the Problems view is full, you can increase

-the number of error messages allowed by selecting  <menucascade><uicontrol>Properties

-> Validation</uicontrol></menucascade> and specifying the maximum number of

-error messages allowed.</note></info></step>

+view to see what problems were logged. </cmd><info> <note> If you receive

+an error message indicating that the Problems view is full, you can increase

+the number of error messages allowed by clicking <menucascade><uicontrol>Window</uicontrol>

+<uicontrol>Preferences</uicontrol></menucascade> and selecting <menucascade>

+<uicontrol>General</uicontrol><uicontrol>Markers</uicontrol></menucascade>.

+Select the <uicontrol>Use marker limits</uicontrol> check box and change the

+number in the <uicontrol>Limit visible items per group</uicontrol> field.</note></info>

+</step>

 </steps>

 <result><p>The XML schema support in the XML schema editor is based on the

 W3C XML Schema Recommendation Specification. The XML Schema specifications

@@ -34,17 +37,18 @@
 Web site are used for validation.</p><p>Certain error messages contain a reference

 to the schema constraints listed in Appendix C of the XML Schema Part 1: Structures

 document. Each constraint has a unique name that will be referenced in the

-error message. For example, if you receive an error message with this text:

- <systemoutput>ct-props-correct</systemoutput> and you searched in the Structure

-document for the text, you would find that it is for the section "Schema Component

-Constraint: Complex Type Definition Properties Correct". </p><p>You can set

-up a project's properties so that different types of project resources are

-automatically validated when you save them. From a project's pop-up menu select <uicontrol>Properties</uicontrol>,

+error message. For example, if you receive an error message with this text: <systemoutput>ct-props-correct</systemoutput> and

+you searched in the Structure document for the text, you would find that it

+is for the section "Schema Component Constraint: Complex Type Definition Properties

+Correct". </p><p>You can set up a project's properties so that different types

+of project resources are automatically validated when you save them (this

+is set for all resources by default). From a project's pop-up menu select <uicontrol>Properties</uicontrol>,

 then select <uicontrol>Validation</uicontrol>. Any validators you can run

 against your project will be listed in the Validation page.</p></result>

 </taskbody>

 <related-links>

 <link href="../../org.eclipse.jst.j2ee.doc.user/topics/tjval.dita" scope="peer">

+<linktext>Validating code in enterprise applications</linktext>

 <desc>General validation information</desc>

 </link>

 <link href="http://www.w3.org/TR/xmlschema-1" scope="external"><linktext>XML

diff --git a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tvdtschm.html b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tvdtschm.html
index f6ef002..179c169 100644
--- a/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tvdtschm.html
+++ b/docs/org.eclipse.wst.xsdeditor.doc.user/topics/tvdtschm.html
@@ -2,8 +2,8 @@
 <html lang="en-us" xml:lang="en-us">
 <head>
 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
-<meta name="copyright" content="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" />
-<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
+<meta name="copyright" content="Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
+<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
 <meta content="public" name="security" />
 <meta content="index,follow" name="Robots" />
 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
@@ -38,7 +38,7 @@
 <div class="section"><p>The following instructions were written for the Resource perspective,
 but they will also work in many other perspectives.</p>
 <p>To validate an XML
-schema:</p>
+schema, complete the following steps:</p>
 </div>
 
 <ol>
@@ -46,11 +46,14 @@
 </li>
 
 <li class="stepexpand"><span> If validation was not successful, you can refer to the Problems
-view to see what problems were logged. </span>  <div class="note"><span class="notetitle">Note:</span> If you receive an
-error message indicating that the Problems view is full, you can increase
-the number of error messages allowed by selecting  <span class="menucascade"><span class="uicontrol">Properties
-&gt; Validation</span></span> and specifying the maximum number of
-error messages allowed.</div>
+view to see what problems were logged. </span>  <div class="note"><span class="notetitle">Note:</span>  If you receive
+an error message indicating that the Problems view is full, you can increase
+the number of error messages allowed by clicking <span class="menucascade"><span class="uicontrol">Window</span>
+ &gt; <span class="uicontrol">Preferences</span></span> and selecting <span class="menucascade">
+<span class="uicontrol">General</span> &gt; <span class="uicontrol">Markers</span></span>.
+Select the <span class="uicontrol">Use marker limits</span> check box and change the
+number in the <span class="uicontrol">Limit visible items per group</span> field.</div>
+
 </li>
 
 </ol>
@@ -62,13 +65,13 @@
 <p>Certain error messages contain a reference
 to the schema constraints listed in Appendix C of the XML Schema Part 1: Structures
 document. Each constraint has a unique name that will be referenced in the
-error message. For example, if you receive an error message with this text:
- <tt class="sysout">ct-props-correct</tt> and you searched in the Structure
-document for the text, you would find that it is for the section "Schema Component
-Constraint: Complex Type Definition Properties Correct". </p>
-<p>You can set
-up a project's properties so that different types of project resources are
-automatically validated when you save them. From a project's pop-up menu select <span class="uicontrol">Properties</span>,
+error message. For example, if you receive an error message with this text: <tt class="sysout">ct-props-correct</tt> and
+you searched in the Structure document for the text, you would find that it
+is for the section "Schema Component Constraint: Complex Type Definition Properties
+Correct". </p>
+<p>You can set up a project's properties so that different types
+of project resources are automatically validated when you save them (this
+is set for all resources by default). From a project's pop-up menu select <span class="uicontrol">Properties</span>,
 then select <span class="uicontrol">Validation</span>. Any validators you can run
 against your project will be listed in the Validation page.</p>
 </div>
@@ -79,7 +82,7 @@
 <div><a href="../topics/tcxmlsch.html" title="You can create an XML schema and then edit it using the XML schema editor. Using the XML schema editor, you can specify element names that indicates which elements are allowed in an XML file, and in which combinations.">Creating XML schemas</a></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><a href="../../org.eclipse.jst.j2ee.doc.user/topics/tjval.html" title="General validation information">Validating code in enterprise applications</a></div>
 <div><a href="http://www.w3.org/TR/xmlschema-1" target="_blank" title="See the W3C Web site for more information on XML Schema specifications">XML
 Schema Part 1: Structures</a></div>
 <div><a href="http://www.w3.org/TR/xmlschema-2" target="_blank" title="See the W3C Web site for more information on XML Schema specifications">XML
diff --git a/features/org.eclipse.wst.web_core.feature.patch/.project b/features/org.eclipse.wst.web_core.feature.patch/.project
deleted file mode 100644
index 1825661..0000000
--- a/features/org.eclipse.wst.web_core.feature.patch/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.web_core.feature.patch</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.pde.FeatureBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.FeatureNature</nature>
-	</natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.web_core.feature.patch/build.properties b/features/org.eclipse.wst.web_core.feature.patch/build.properties
deleted file mode 100644
index 64f93a9..0000000
--- a/features/org.eclipse.wst.web_core.feature.patch/build.properties
+++ /dev/null
@@ -1 +0,0 @@
-bin.includes = feature.xml
diff --git a/features/org.eclipse.wst.web_core.feature.patch/buildnotes_org.eclipse.wst.xml_ui.feature.patch.html b/features/org.eclipse.wst.web_core.feature.patch/buildnotes_org.eclipse.wst.xml_ui.feature.patch.html
deleted file mode 100644
index 60c3bc4..0000000
--- a/features/org.eclipse.wst.web_core.feature.patch/buildnotes_org.eclipse.wst.xml_ui.feature.patch.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-   <meta name="Build" content="Build">
-   <title>WTP 1.5.5 Patches</title>
-</head>
-
-<body>
-
-<h1>WTP 1.5.5 Patches</h1>
-
-<h2>org.eclipse.jst.web_ui.feature</h2>
-
-<p>Bug <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=185402'>185402</a>. JSP validation fails because of defaulted attribute flush on jsp:include</p>
-<p>Bug <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=203711'>203711</a>. taglib declarations in JSP fragments</p>
-<p>Bug <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=199053'>199053</a>. Syntax errors outside of scripting areas not reported</p>
-
diff --git a/features/org.eclipse.wst.web_core.feature.patch/eclipse_update_120.jpg b/features/org.eclipse.wst.web_core.feature.patch/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/features/org.eclipse.wst.web_core.feature.patch/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_core.feature.patch/epl-v10.html b/features/org.eclipse.wst.web_core.feature.patch/epl-v10.html
deleted file mode 100644
index ed4b196..0000000
--- a/features/org.eclipse.wst.web_core.feature.patch/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
-  <o:Revision>2</o:Revision>
-  <o:TotalTime>3</o:TotalTime>
-  <o:Created>2004-03-05T23:03:00Z</o:Created>
-  <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
-  <o:Pages>4</o:Pages>
-  <o:Words>1626</o:Words>
-  <o:Characters>9270</o:Characters>
-   <o:Lines>77</o:Lines>
-  <o:Paragraphs>18</o:Paragraphs>
-  <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
-  <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
-  <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
-	{font-family:Tahoma;
-	panose-1:2 11 6 4 3 5 4 4 2 4;
-	mso-font-charset:0;
-	mso-generic-font-family:swiss;
-	mso-font-pitch:variable;
-	mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
-	{mso-style-parent:"";
-	margin:0in;
-	margin-bottom:.0001pt;
-	mso-pagination:widow-orphan;
-	font-size:12.0pt;
-	font-family:"Times New Roman";
-	mso-fareast-font-family:"Times New Roman";}
-p
-	{margin-right:0in;
-	mso-margin-top-alt:auto;
-	mso-margin-bottom-alt:auto;
-	margin-left:0in;
-	mso-pagination:widow-orphan;
-	font-size:12.0pt;
-	font-family:"Times New Roman";
-	mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
-	{mso-style-name:"Balloon Text";
-	margin:0in;
-	margin-bottom:.0001pt;
-	mso-pagination:widow-orphan;
-	font-size:8.0pt;
-	font-family:Tahoma;
-	mso-fareast-font-family:"Times New Roman";}
-@page Section1
-	{size:8.5in 11.0in;
-	margin:1.0in 1.25in 1.0in 1.25in;
-	mso-header-margin:.5in;
-	mso-footer-margin:.5in;
-	mso-paper-source:0;}
-div.Section1
-	{page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
\ No newline at end of file
diff --git a/features/org.eclipse.wst.web_core.feature.patch/feature.properties b/features/org.eclipse.wst.web_core.feature.patch/feature.properties
deleted file mode 100644
index 7997b4a..0000000
--- a/features/org.eclipse.wst.web_core.feature.patch/feature.properties
+++ /dev/null
@@ -1,156 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-# 
-# Contributors:
-#     IBM Corporation - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=WTP Patch for wst.xml_ui
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=\
-A patch for sse.ui\n\
-This patch fixes problems described in the following bugs: \n\
-\n\
-Bug 185402 JSP validation fails because of defaulted attribute flush on jsp:include  \n\
-See bug 185402 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=185402)) \n\
-\n\
-Bug 203711 taglib declarations in JSP fragments  \n\
-See bug 203711 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=203711)) \n\
-\n\
-Bug 199053 Syntax errors outside of scripting areas not reported  \n\
-See bug 199053 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=199053)) \n\
-\n\
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2007 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
-    IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-October, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
-   - Content may be structured and packaged into modules to facilitate delivering,\n\
-     extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
-     plug-in fragments ("Fragments"), and features ("Features").\n\
-   - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
-     in a directory named "plugins".\n\
-   - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
-     Each Feature may be packaged as a sub-directory in a directory named "features".\n\
-     Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
-     numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
-   - Features may also include other Features ("Included Features"). Within a Feature, files\n\
-     named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
-   - The top-level (root) directory\n\
-   - Plug-in and Fragment directories\n\
-   - Inside Plug-ins and Fragments packaged as JARs\n\
-   - Sub-directories of the directory named "src" of certain Plug-ins\n\
-   - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
-    - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
-    - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
-    - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
-    - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
-    - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
-    - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.web_core.feature.patch/feature.xml b/features/org.eclipse.wst.web_core.feature.patch/feature.xml
deleted file mode 100644
index a781364..0000000
--- a/features/org.eclipse.wst.web_core.feature.patch/feature.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
-      id="org.eclipse.wst.web_core.feature.patch"
-      label="%featureName"
-      version="1.5.5.qualifier"
-      provider-name="%providerName">
-
-   <description>
-      %description
-   </description>
-
-   <copyright>
-      %copyright
-   </copyright>
-
-   <license url="%licenseURL">
-      %license
-   </license>
-
-   <requires>
-      <import feature="org.eclipse.wst.web_core.feature" version="1.5.5.v200708090518--4hNDDiEnJWDdRQ" patch="true"/>
-   </requires>
-
-   <plugin
-         id="org.eclipse.wst.html.core"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-</feature>
diff --git a/features/org.eclipse.wst.web_core.feature.patch/license.html b/features/org.eclipse.wst.web_core.feature.patch/license.html
deleted file mode 100644
index 2347060..0000000
--- a/features/org.eclipse.wst.web_core.feature.patch/license.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>January 28, 2005</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION 
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF 
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE 
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED 
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED 
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE 
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE 
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY 
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU 
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse 
-Foundation is provided to you under the terms and conditions of the Eclipse 
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this 
-Content and is also available at <A 
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>. 
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code, 
-documentation and other files maintained in the Eclipse.org CVS repository 
-("Repository") in CVS modules ("Modules") and made available as downloadable 
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments 
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more 
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may 
-contain a list of the names and version numbers of the Plug-ins and/or Fragments 
-associated with a Feature. Plug-ins and Fragments are located in directories 
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named 
-"feature.xml" may contain a list of the names and version numbers of Included 
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained 
-in files named "about.html" ("Abouts"). The terms and conditions governing 
-Features and Included Features should be contained in files named "license.html" 
-("Feature Licenses"). Abouts and Feature Licenses may be located in any 
-directory of a Download or Module including, but not limited to the following 
-locations:</P>
-<UL>
-  <LI>The top-level (root) directory 
-  <LI>Plug-in and Fragment directories 
-  <LI>Subdirectories of the directory named "src" of certain Plug-ins 
-  <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed 
-using the Eclipse Update Manager, you must agree to a license ("Feature Update 
-License") during the installation process. If the Feature contains Included 
-Features, the Feature Update License should either provide you with the terms 
-and conditions governing the Included Features or inform you where you can 
-locate them. Feature Update Licenses may be found in the "license" property of 
-files named "feature.properties". Such Abouts, Feature Licenses and Feature 
-Update Licenses contain the terms and conditions (or references to such terms 
-and conditions) that govern your use of the associated Content in that 
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL 
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE 
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
-  <LI>Common Public License Version 1.0 (available at <A 
-  href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>) 
-
-  <LI>Apache Software License 1.1 (available at <A 
-  href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>) 
-
-  <LI>Apache Software License 2.0 (available at <A 
-  href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>) 
-
-  <LI>IBM Public License 1.0 (available at <A 
-  href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>) 
-
-  <LI>Metro Link Public License 1.00 (available at <A 
-  href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>) 
-
-  <LI>Mozilla Public License Version 1.1 (available at <A 
-  href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>) 
-  </LI></UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR 
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is 
-provided, please contact the Eclipse Foundation to determine what terms and 
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are 
-currently may have restrictions on the import, possession, and use, and/or 
-re-export to another country, of encryption software. BEFORE using any 
-encryption software, please check the country's laws, regulations and policies 
-concerning the import, possession, or use, and re-export of encryption software, 
-to see if this is permitted.</P></BODY></HTML>
diff --git a/features/org.eclipse.wst.web_core.feature/.cvsignore b/features/org.eclipse.wst.web_core.feature/.cvsignore
deleted file mode 100644
index 8a9b065..0000000
--- a/features/org.eclipse.wst.web_core.feature/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build.xml
-org.eclipse.wst.web_core.feature_1.0.0.bin.dist.zip
diff --git a/features/org.eclipse.wst.web_core.feature/.project b/features/org.eclipse.wst.web_core.feature/.project
deleted file mode 100644
index fa0ce1f..0000000
--- a/features/org.eclipse.wst.web_core.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.web_core.feature</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.pde.FeatureBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.FeatureNature</nature>
-	</natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.web_core.feature/build.properties b/features/org.eclipse.wst.web_core.feature/build.properties
deleted file mode 100644
index 7f47694..0000000
--- a/features/org.eclipse.wst.web_core.feature/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
-               eclipse_update_120.jpg,\
-               epl-v10.html,\
-               license.html,\
-               feature.properties
diff --git a/features/org.eclipse.wst.web_core.feature/eclipse_update_120.jpg b/features/org.eclipse.wst.web_core.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/features/org.eclipse.wst.web_core.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_core.feature/epl-v10.html b/features/org.eclipse.wst.web_core.feature/epl-v10.html
deleted file mode 100644
index ed4b196..0000000
--- a/features/org.eclipse.wst.web_core.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
-  <o:Revision>2</o:Revision>
-  <o:TotalTime>3</o:TotalTime>
-  <o:Created>2004-03-05T23:03:00Z</o:Created>
-  <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
-  <o:Pages>4</o:Pages>
-  <o:Words>1626</o:Words>
-  <o:Characters>9270</o:Characters>
-   <o:Lines>77</o:Lines>
-  <o:Paragraphs>18</o:Paragraphs>
-  <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
-  <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
-  <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
-	{font-family:Tahoma;
-	panose-1:2 11 6 4 3 5 4 4 2 4;
-	mso-font-charset:0;
-	mso-generic-font-family:swiss;
-	mso-font-pitch:variable;
-	mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
-	{mso-style-parent:"";
-	margin:0in;
-	margin-bottom:.0001pt;
-	mso-pagination:widow-orphan;
-	font-size:12.0pt;
-	font-family:"Times New Roman";
-	mso-fareast-font-family:"Times New Roman";}
-p
-	{margin-right:0in;
-	mso-margin-top-alt:auto;
-	mso-margin-bottom-alt:auto;
-	margin-left:0in;
-	mso-pagination:widow-orphan;
-	font-size:12.0pt;
-	font-family:"Times New Roman";
-	mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
-	{mso-style-name:"Balloon Text";
-	margin:0in;
-	margin-bottom:.0001pt;
-	mso-pagination:widow-orphan;
-	font-size:8.0pt;
-	font-family:Tahoma;
-	mso-fareast-font-family:"Times New Roman";}
-@page Section1
-	{size:8.5in 11.0in;
-	margin:1.0in 1.25in 1.0in 1.25in;
-	mso-header-margin:.5in;
-	mso-footer-margin:.5in;
-	mso-paper-source:0;}
-div.Section1
-	{page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
\ No newline at end of file
diff --git a/features/org.eclipse.wst.web_core.feature/feature.properties b/features/org.eclipse.wst.web_core.feature/feature.properties
deleted file mode 100644
index 2cbed5c..0000000
--- a/features/org.eclipse.wst.web_core.feature/feature.properties
+++ /dev/null
@@ -1,145 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-# 
-# Contributors:
-#     IBM Corporation - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=WST Web Core
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Web tools core.
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
-    IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
-   - Content may be structured and packaged into modules to facilitate delivering,\n\
-     extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
-     plug-in fragments ("Fragments"), and features ("Features").\n\
-   - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
-     in a directory named "plugins".\n\
-   - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
-     Each Feature may be packaged as a sub-directory in a directory named "features".\n\
-     Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
-     numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
-   - Features may also include other Features ("Included Features"). Within a Feature, files\n\
-     named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
-   - The top-level (root) directory\n\
-   - Plug-in and Fragment directories\n\
-   - Inside Plug-ins and Fragments packaged as JARs\n\
-   - Sub-directories of the directory named "src" of certain Plug-ins\n\
-   - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
-    - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
-    - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
-    - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
-    - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
-    - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
-    - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-    - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.web_core.feature/feature.xml b/features/org.eclipse.wst.web_core.feature/feature.xml
deleted file mode 100644
index 77e29b4..0000000
--- a/features/org.eclipse.wst.web_core.feature/feature.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
-      id="org.eclipse.wst.web_core.feature"
-      label="%featureName"
-      version="3.0.0.qualifier"
-      provider-name="%providerName">
-
-   <description>
-      %description
-   </description>
-
-   <copyright>
-      %copyright
-   </copyright>
-
-   <license url="%licenseURL">
-      %license
-   </license>
-
-   <url>
-      <update label="%updateSiteName" url="http://download.eclipse.org/webtools/updates/"/>
-   </url>
-
-   <requires>
-      <import plugin="org.eclipse.core.resources" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.core.runtime" version="3.2.0" match="compatible"/>
-      <import plugin="com.ibm.icu" version="3.4.4" match="compatible"/>
-      <import plugin="org.eclipse.core.commands" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.wst.server.core" version="1.0.102" match="compatible"/>
-      <import plugin="org.eclipse.jem.util" version="2.0.0" match="compatible"/>
-      <import plugin="org.eclipse.emf.ecore" version="2.2.0" match="compatible"/>
-      <import plugin="org.eclipse.wst.common.project.facet.core" version="1.1.0" match="compatible"/>
-      <import plugin="org.apache.xerces" version="2.9.0" match="compatible"/>
-      <import plugin="org.eclipse.wst.xml.core" version="1.1.300" match="equivalent"/>
-      <import plugin="org.eclipse.wst.sse.core" version="1.1.300" match="equivalent"/>
-      <import plugin="org.eclipse.core.runtime" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.core.resources" version="3.4.0" match="compatible"/>
-      <import plugin="com.ibm.icu" version="3.8.1" match="compatible"/>
-      <import plugin="org.eclipse.wst.common.uriresolver" version="1.1.301" match="equivalent"/>
-      <import plugin="org.eclipse.wst.css.core" version="1.1.200" match="equivalent"/>
-      <import plugin="org.eclipse.wst.common.frameworks" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.validation" version="1.2.0" match="compatible"/>
-      <import plugin="org.eclipse.wst.common.emfworkbench.integration" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.common.modulecore" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.common.environment" version="1.0.100" match="equivalent"/>
-   </requires>
-
-   <plugin
-         id="org.eclipse.wst.css.core"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.html.core"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.javascript.core"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.web"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-</feature>
diff --git a/features/org.eclipse.wst.web_core.feature/license.html b/features/org.eclipse.wst.web_core.feature/license.html
deleted file mode 100644
index 5644598..0000000
--- a/features/org.eclipse.wst.web_core.feature/license.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>June 06, 2007</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION 
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF 
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE 
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED 
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED 
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE 
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE 
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY 
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU 
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse 
-Foundation is provided to you under the terms and conditions of the Eclipse 
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this 
-Content and is also available at <A 
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>. 
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code, 
-documentation and other files maintained in the Eclipse.org CVS repository 
-("Repository") in CVS modules ("Modules") and made available as downloadable 
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments 
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more 
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may 
-contain a list of the names and version numbers of the Plug-ins and/or Fragments 
-associated with a Feature. Plug-ins and Fragments are located in directories 
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named 
-"feature.xml" may contain a list of the names and version numbers of Included 
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained 
-in files named "about.html" ("Abouts"). The terms and conditions governing 
-Features and Included Features should be contained in files named "license.html" 
-("Feature Licenses"). Abouts and Feature Licenses may be located in any 
-directory of a Download or Module including, but not limited to the following 
-locations:</P>
-<UL>
-  <LI>The top-level (root) directory 
-  <LI>Plug-in and Fragment directories 
-  <LI>Subdirectories of the directory named "src" of certain Plug-ins 
-  <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed 
-using the Eclipse Update Manager, you must agree to a license ("Feature Update 
-License") during the installation process. If the Feature contains Included 
-Features, the Feature Update License should either provide you with the terms 
-and conditions governing the Included Features or inform you where you can 
-locate them. Feature Update Licenses may be found in the "license" property of 
-files named "feature.properties". Such Abouts, Feature Licenses and Feature 
-Update Licenses contain the terms and conditions (or references to such terms 
-and conditions) that govern your use of the associated Content in that 
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL 
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE 
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
-  <LI>Common Public License Version 1.0 (available at <A 
-  href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>) 
-
-  <LI>Apache Software License 1.1 (available at <A 
-  href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>) 
-
-  <LI>Apache Software License 2.0 (available at <A 
-  href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>) 
-
-  <LI>IBM Public License 1.0 (available at <A 
-  href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>) 
-
-  <LI>Metro Link Public License 1.00 (available at <A 
-  href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>) 
-
-  <LI>Mozilla Public License Version 1.1 (available at <A 
-  href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>) 
-  </LI>
-    
-  <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A 
-  href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
-  </LI>
-</UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR 
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is 
-provided, please contact the Eclipse Foundation to determine what terms and 
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are 
-currently may have restrictions on the import, possession, and use, and/or 
-re-export to another country, of encryption software. BEFORE using any 
-encryption software, please check the country's laws, regulations and policies 
-concerning the import, possession, or use, and re-export of encryption software, 
-to see if this is permitted.</P></BODY></HTML>
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/build.properties b/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index f249e9f..0000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-# 
-# Contributors:
-#     IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes =\
-epl-v10.html,\
-eclipse_update_120.jpg,\
-feature.xml,\
-feature.properties,\
-license.html
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/eclipse_update_120.jpg b/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/epl-v10.html b/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/epl-v10.html
deleted file mode 100644
index 022ad29..0000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
-  <o:Revision>2</o:Revision>
-  <o:TotalTime>3</o:TotalTime>
-  <o:Created>2004-03-05T23:03:00Z</o:Created>
-  <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
-  <o:Pages>4</o:Pages>
-  <o:Words>1626</o:Words>
-  <o:Characters>9270</o:Characters>
-   <o:Lines>77</o:Lines>
-  <o:Paragraphs>18</o:Paragraphs>
-  <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
-  <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
-  <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
-	{font-family:Tahoma;
-	panose-1:2 11 6 4 3 5 4 4 2 4;
-	mso-font-charset:0;
-	mso-generic-font-family:swiss;
-	mso-font-pitch:variable;
-	mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
-	{mso-style-parent:"";
-	margin:0in;
-	margin-bottom:.0001pt;
-	mso-pagination:widow-orphan;
-	font-size:12.0pt;
-	font-family:"Times New Roman";
-	mso-fareast-font-family:"Times New Roman";}
-p
-	{margin-right:0in;
-	mso-margin-top-alt:auto;
-	mso-margin-bottom-alt:auto;
-	margin-left:0in;
-	mso-pagination:widow-orphan;
-	font-size:12.0pt;
-	font-family:"Times New Roman";
-	mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
-	{mso-style-name:"Balloon Text";
-	margin:0in;
-	margin-bottom:.0001pt;
-	mso-pagination:widow-orphan;
-	font-size:8.0pt;
-	font-family:Tahoma;
-	mso-fareast-font-family:"Times New Roman";}
-@page Section1
-	{size:8.5in 11.0in;
-	margin:1.0in 1.25in 1.0in 1.25in;
-	mso-header-margin:.5in;
-	mso-footer-margin:.5in;
-	mso-paper-source:0;}
-div.Section1
-	{page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/feature.properties b/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index 57260a4..0000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,145 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-# 
-# Contributors:
-#     IBM Corporation - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=WST Web Core Developer Resources
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Source code zips for WST Web core.
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
-    IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
-   - Content may be structured and packaged into modules to facilitate delivering,\n\
-     extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
-     plug-in fragments ("Fragments"), and features ("Features").\n\
-   - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
-     in a directory named "plugins".\n\
-   - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
-     Each Feature may be packaged as a sub-directory in a directory named "features".\n\
-     Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
-     numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
-   - Features may also include other Features ("Included Features"). Within a Feature, files\n\
-     named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
-   - The top-level (root) directory\n\
-   - Plug-in and Fragment directories\n\
-   - Inside Plug-ins and Fragments packaged as JARs\n\
-   - Sub-directories of the directory named "src" of certain Plug-ins\n\
-   - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
-    - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
-    - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
-    - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
-    - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
-    - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
-    - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-    - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/license.html b/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/license.html
deleted file mode 100644
index fec4a48..0000000
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplateFeature/license.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>June 06, 2007</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
-   (COLLECTIVELY &quot;CONTENT&quot;).  USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
-   CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW.  BY USING THE CONTENT, YOU AGREE THAT YOUR USE
-   OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
-   NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
-   CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-   
-<h3>Applicable Licenses</h3>   
-   
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
-   (&quot;EPL&quot;).  A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-   For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
-   modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-   
-<ul>
-	<li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content.  Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-	<li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
-	<li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.  Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;.  Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
-      and/or Fragments associated with that Feature.</li>
-	<li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>   
- 
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;).  Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
-	<li>The top-level (root) directory</li>
-	<li>Plug-in and Fragment directories</li>
-	<li>Inside Plug-ins and Fragments packaged as JARs</li>
-	<li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
-	<li>Feature directories</li>
-</ul>
-		
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process.  If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them.  Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.  SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
-	<li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-	<li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
-	<li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
-	<li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>	
-	<li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-	<li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-  <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A 
-  href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
-  </LI>
-</UL>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT.  If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
-   another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
-   possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-   
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>   
-</body>
-</html>
diff --git a/features/org.eclipse.wst.web_sdk.feature/.cvsignore b/features/org.eclipse.wst.web_sdk.feature/.cvsignore
deleted file mode 100644
index 2ad302e..0000000
--- a/features/org.eclipse.wst.web_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-build.xml
-features
-plugins
-org.eclipse.wst.web_sdk.feature_1.0.0.bin.dist.zip
diff --git a/features/org.eclipse.wst.web_sdk.feature/.project b/features/org.eclipse.wst.web_sdk.feature/.project
deleted file mode 100644
index b79f84b..0000000
--- a/features/org.eclipse.wst.web_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.web_sdk.feature</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.pde.FeatureBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.FeatureNature</nature>
-	</natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.web_sdk.feature/build.properties b/features/org.eclipse.wst.web_sdk.feature/build.properties
deleted file mode 100644
index d33acd6..0000000
--- a/features/org.eclipse.wst.web_sdk.feature/build.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-bin.includes = feature.xml,\
-               eclipse_update_120.jpg,\
-               epl-v10.html,\
-               license.html,\
-               feature.properties
-
-generate.feature@org.eclipse.wst.jsdt.feature.source=org.eclipse.wst.jsdt.feature
-generate.feature@org.eclipse.wst.web_ui.feature.source=org.eclipse.wst.web_ui.feature, feature@org.eclipse.wst.web_core.feature.source
-
diff --git a/features/org.eclipse.wst.web_sdk.feature/eclipse_update_120.jpg b/features/org.eclipse.wst.web_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/features/org.eclipse.wst.web_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_sdk.feature/epl-v10.html b/features/org.eclipse.wst.web_sdk.feature/epl-v10.html
deleted file mode 100644
index ed4b196..0000000
--- a/features/org.eclipse.wst.web_sdk.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
-  <o:Revision>2</o:Revision>
-  <o:TotalTime>3</o:TotalTime>
-  <o:Created>2004-03-05T23:03:00Z</o:Created>
-  <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
-  <o:Pages>4</o:Pages>
-  <o:Words>1626</o:Words>
-  <o:Characters>9270</o:Characters>
-   <o:Lines>77</o:Lines>
-  <o:Paragraphs>18</o:Paragraphs>
-  <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
-  <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
-  <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
-	{font-family:Tahoma;
-	panose-1:2 11 6 4 3 5 4 4 2 4;
-	mso-font-charset:0;
-	mso-generic-font-family:swiss;
-	mso-font-pitch:variable;
-	mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
-	{mso-style-parent:"";
-	margin:0in;
-	margin-bottom:.0001pt;
-	mso-pagination:widow-orphan;
-	font-size:12.0pt;
-	font-family:"Times New Roman";
-	mso-fareast-font-family:"Times New Roman";}
-p
-	{margin-right:0in;
-	mso-margin-top-alt:auto;
-	mso-margin-bottom-alt:auto;
-	margin-left:0in;
-	mso-pagination:widow-orphan;
-	font-size:12.0pt;
-	font-family:"Times New Roman";
-	mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
-	{mso-style-name:"Balloon Text";
-	margin:0in;
-	margin-bottom:.0001pt;
-	mso-pagination:widow-orphan;
-	font-size:8.0pt;
-	font-family:Tahoma;
-	mso-fareast-font-family:"Times New Roman";}
-@page Section1
-	{size:8.5in 11.0in;
-	margin:1.0in 1.25in 1.0in 1.25in;
-	mso-header-margin:.5in;
-	mso-footer-margin:.5in;
-	mso-paper-source:0;}
-div.Section1
-	{page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
\ No newline at end of file
diff --git a/features/org.eclipse.wst.web_sdk.feature/feature.properties b/features/org.eclipse.wst.web_sdk.feature/feature.properties
deleted file mode 100644
index c1e2ef3..0000000
--- a/features/org.eclipse.wst.web_sdk.feature/feature.properties
+++ /dev/null
@@ -1,145 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-# 
-# Contributors:
-#     IBM Corporation - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=WST Web Plug-in Developer Resources
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Source code zips for the WST web tools
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2000, 2006 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
-    IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
-   - Content may be structured and packaged into modules to facilitate delivering,\n\
-     extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
-     plug-in fragments ("Fragments"), and features ("Features").\n\
-   - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
-     in a directory named "plugins".\n\
-   - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
-     Each Feature may be packaged as a sub-directory in a directory named "features".\n\
-     Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
-     numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
-   - Features may also include other Features ("Included Features"). Within a Feature, files\n\
-     named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
-   - The top-level (root) directory\n\
-   - Plug-in and Fragment directories\n\
-   - Inside Plug-ins and Fragments packaged as JARs\n\
-   - Sub-directories of the directory named "src" of certain Plug-ins\n\
-   - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
-    - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
-    - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
-    - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
-    - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
-    - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
-    - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-    - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.web_sdk.feature/feature.xml b/features/org.eclipse.wst.web_sdk.feature/feature.xml
deleted file mode 100644
index 8fcdd0d..0000000
--- a/features/org.eclipse.wst.web_sdk.feature/feature.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
-      id="org.eclipse.wst.web_sdk.feature"
-      label="%featureName"
-      version="3.0.0.qualifier"
-      provider-name="%providerName">
-
-   <description>
-      %description
-   </description>
-
-   <copyright>
-      %copyright
-   </copyright>
-
-   <license url="license.html">
-      %license
-   </license>
-
-   <url>
-      <update label="%updateSiteName" url="http://download.eclipse.org/webtools/updates/"/>
-   </url>
-
-   <includes
-         id="org.eclipse.wst.web_ui.feature"
-         version="0.0.0"/>
-
-   <includes
-         id="org.eclipse.wst.web_ui.feature.source"
-         version="0.0.0"/>
-
-</feature>
diff --git a/features/org.eclipse.wst.web_sdk.feature/license.html b/features/org.eclipse.wst.web_sdk.feature/license.html
deleted file mode 100644
index 5644598..0000000
--- a/features/org.eclipse.wst.web_sdk.feature/license.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>June 06, 2007</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION 
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF 
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE 
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED 
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED 
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE 
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE 
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY 
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU 
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse 
-Foundation is provided to you under the terms and conditions of the Eclipse 
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this 
-Content and is also available at <A 
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>. 
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code, 
-documentation and other files maintained in the Eclipse.org CVS repository 
-("Repository") in CVS modules ("Modules") and made available as downloadable 
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments 
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more 
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may 
-contain a list of the names and version numbers of the Plug-ins and/or Fragments 
-associated with a Feature. Plug-ins and Fragments are located in directories 
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named 
-"feature.xml" may contain a list of the names and version numbers of Included 
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained 
-in files named "about.html" ("Abouts"). The terms and conditions governing 
-Features and Included Features should be contained in files named "license.html" 
-("Feature Licenses"). Abouts and Feature Licenses may be located in any 
-directory of a Download or Module including, but not limited to the following 
-locations:</P>
-<UL>
-  <LI>The top-level (root) directory 
-  <LI>Plug-in and Fragment directories 
-  <LI>Subdirectories of the directory named "src" of certain Plug-ins 
-  <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed 
-using the Eclipse Update Manager, you must agree to a license ("Feature Update 
-License") during the installation process. If the Feature contains Included 
-Features, the Feature Update License should either provide you with the terms 
-and conditions governing the Included Features or inform you where you can 
-locate them. Feature Update Licenses may be found in the "license" property of 
-files named "feature.properties". Such Abouts, Feature Licenses and Feature 
-Update Licenses contain the terms and conditions (or references to such terms 
-and conditions) that govern your use of the associated Content in that 
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL 
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE 
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
-  <LI>Common Public License Version 1.0 (available at <A 
-  href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>) 
-
-  <LI>Apache Software License 1.1 (available at <A 
-  href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>) 
-
-  <LI>Apache Software License 2.0 (available at <A 
-  href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>) 
-
-  <LI>IBM Public License 1.0 (available at <A 
-  href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>) 
-
-  <LI>Metro Link Public License 1.00 (available at <A 
-  href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>) 
-
-  <LI>Mozilla Public License Version 1.1 (available at <A 
-  href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>) 
-  </LI>
-    
-  <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A 
-  href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
-  </LI>
-</UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR 
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is 
-provided, please contact the Eclipse Foundation to determine what terms and 
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are 
-currently may have restrictions on the import, possession, and use, and/or 
-re-export to another country, of encryption software. BEFORE using any 
-encryption software, please check the country's laws, regulations and policies 
-concerning the import, possession, or use, and re-export of encryption software, 
-to see if this is permitted.</P></BODY></HTML>
diff --git a/features/org.eclipse.wst.web_ui.feature/.cvsignore b/features/org.eclipse.wst.web_ui.feature/.cvsignore
deleted file mode 100644
index c14487c..0000000
--- a/features/org.eclipse.wst.web_ui.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/features/org.eclipse.wst.web_ui.feature/.project b/features/org.eclipse.wst.web_ui.feature/.project
deleted file mode 100644
index 024b477..0000000
--- a/features/org.eclipse.wst.web_ui.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.web_ui.feature</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.pde.FeatureBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.FeatureNature</nature>
-	</natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.web_ui.feature/build.properties b/features/org.eclipse.wst.web_ui.feature/build.properties
deleted file mode 100644
index 7f47694..0000000
--- a/features/org.eclipse.wst.web_ui.feature/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
-               eclipse_update_120.jpg,\
-               epl-v10.html,\
-               license.html,\
-               feature.properties
diff --git a/features/org.eclipse.wst.web_ui.feature/eclipse_update_120.jpg b/features/org.eclipse.wst.web_ui.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/features/org.eclipse.wst.web_ui.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_ui.feature/epl-v10.html b/features/org.eclipse.wst.web_ui.feature/epl-v10.html
deleted file mode 100644
index ed4b196..0000000
--- a/features/org.eclipse.wst.web_ui.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
-  <o:Revision>2</o:Revision>
-  <o:TotalTime>3</o:TotalTime>
-  <o:Created>2004-03-05T23:03:00Z</o:Created>
-  <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
-  <o:Pages>4</o:Pages>
-  <o:Words>1626</o:Words>
-  <o:Characters>9270</o:Characters>
-   <o:Lines>77</o:Lines>
-  <o:Paragraphs>18</o:Paragraphs>
-  <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
-  <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
-  <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
-	{font-family:Tahoma;
-	panose-1:2 11 6 4 3 5 4 4 2 4;
-	mso-font-charset:0;
-	mso-generic-font-family:swiss;
-	mso-font-pitch:variable;
-	mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
-	{mso-style-parent:"";
-	margin:0in;
-	margin-bottom:.0001pt;
-	mso-pagination:widow-orphan;
-	font-size:12.0pt;
-	font-family:"Times New Roman";
-	mso-fareast-font-family:"Times New Roman";}
-p
-	{margin-right:0in;
-	mso-margin-top-alt:auto;
-	mso-margin-bottom-alt:auto;
-	margin-left:0in;
-	mso-pagination:widow-orphan;
-	font-size:12.0pt;
-	font-family:"Times New Roman";
-	mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
-	{mso-style-name:"Balloon Text";
-	margin:0in;
-	margin-bottom:.0001pt;
-	mso-pagination:widow-orphan;
-	font-size:8.0pt;
-	font-family:Tahoma;
-	mso-fareast-font-family:"Times New Roman";}
-@page Section1
-	{size:8.5in 11.0in;
-	margin:1.0in 1.25in 1.0in 1.25in;
-	mso-header-margin:.5in;
-	mso-footer-margin:.5in;
-	mso-paper-source:0;}
-div.Section1
-	{page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
\ No newline at end of file
diff --git a/features/org.eclipse.wst.web_ui.feature/feature.properties b/features/org.eclipse.wst.web_ui.feature/feature.properties
deleted file mode 100644
index e74829b..0000000
--- a/features/org.eclipse.wst.web_ui.feature/feature.properties
+++ /dev/null
@@ -1,145 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-# 
-# Contributors:
-#     IBM Corporation - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=WST Web UI
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Web UI tools.
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
-    IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
-   - Content may be structured and packaged into modules to facilitate delivering,\n\
-     extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
-     plug-in fragments ("Fragments"), and features ("Features").\n\
-   - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
-     in a directory named "plugins".\n\
-   - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
-     Each Feature may be packaged as a sub-directory in a directory named "features".\n\
-     Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
-     numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
-   - Features may also include other Features ("Included Features"). Within a Feature, files\n\
-     named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
-   - The top-level (root) directory\n\
-   - Plug-in and Fragment directories\n\
-   - Inside Plug-ins and Fragments packaged as JARs\n\
-   - Sub-directories of the directory named "src" of certain Plug-ins\n\
-   - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
-    - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
-    - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
-    - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
-    - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
-    - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
-    - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-    - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.web_ui.feature/feature.xml b/features/org.eclipse.wst.web_ui.feature/feature.xml
deleted file mode 100644
index 10c4dac..0000000
--- a/features/org.eclipse.wst.web_ui.feature/feature.xml
+++ /dev/null
@@ -1,161 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
-      id="org.eclipse.wst.web_ui.feature"
-      label="%featureName"
-      version="3.0.0.qualifier"
-      provider-name="%providerName">
-
-   <description>
-      %description
-   </description>
-
-   <copyright>
-      %copyright
-   </copyright>
-
-   <license url="%licenseURL">
-      %license
-   </license>
-
-   <url>
-      <update label="%updateSiteName" url="http://download.eclipse.org/webtools/updates/"/>
-   </url>
-
-   <includes
-         id="org.eclipse.wst.web_userdoc.feature"
-         version="0.0.0"/>
-
-   <includes
-         id="org.eclipse.wst.web_core.feature"
-         version="0.0.0"/>
-
-   <includes
-         id="org.eclipse.wst.jsdt.feature"
-         version="0.0.0"/>
-
-   <requires>
-      <import plugin="com.ibm.icu" version="3.4.4" match="compatible"/>
-      <import plugin="org.eclipse.core.runtime" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.core.resources" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.core.filebuffers" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.wst.validation" version="1.1.0" match="compatible"/>
-      <import plugin="org.eclipse.jface.text" version="3.2.0"/>
-      <import plugin="org.eclipse.wst.jsdt.core"/>
-      <import plugin="org.eclipse.wst.common.project.facet.core" version="1.1.0"/>
-      <import plugin="org.eclipse.swt"/>
-      <import plugin="org.eclipse.wst.common.modulecore" version="1.1.0"/>
-      <import plugin="org.eclipse.ui.ide" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.jface.text" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.ui.workbench.texteditor" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.ui" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.wst.sse.ui" version="1.0.101"/>
-      <import plugin="org.eclipse.debug.core" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.search" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.ltk.core.refactoring" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.wst.jsdt.ui"/>
-      <import plugin="org.eclipse.wst.jsdt.manipulation"/>
-      <import plugin="org.eclipse.debug.ui" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.ui.views" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.wst.common.project.facet.core" version="1.1.0" match="compatible"/>
-      <import plugin="org.eclipse.wst.server.ui" version="1.0.102" match="compatible"/>
-      <import plugin="org.eclipse.emf.ecore" version="2.2.0" match="compatible"/>
-      <import plugin="org.eclipse.ui.console" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.wst.sse.core" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.xml.core" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.html.core" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.xml.ui" version="1.0.100" match="equivalent"/>
-      <import plugin="org.eclipse.wst.css.core" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.common.uriresolver" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.ui.ide" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.ui.views" version="3.3.0" match="compatible"/>
-      <import plugin="org.eclipse.jface.text" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.ui.workbench.texteditor" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.ui" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.wst.xml.ui" version="1.0.400" match="equivalent"/>
-      <import plugin="org.eclipse.wst.sse.ui" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.css.core" version="1.1.200" match="equivalent"/>
-      <import plugin="org.eclipse.wst.sse.core" version="1.1.300" match="equivalent"/>
-      <import plugin="org.eclipse.wst.html.core" version="1.1.200" match="equivalent"/>
-      <import plugin="org.eclipse.wst.xml.core" version="1.1.300" match="equivalent"/>
-      <import plugin="org.eclipse.core.resources" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.core.runtime" version="3.4.0" match="compatible"/>
-      <import plugin="com.ibm.icu" version="3.8.1" match="compatible"/>
-      <import plugin="org.eclipse.ui.forms" version="3.3.100" match="equivalent"/>
-      <import plugin="org.eclipse.wst.css.ui" version="1.0.300" match="equivalent"/>
-      <import plugin="org.eclipse.wst.validation" version="1.2.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.javascript.core" version="1.0.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.common.frameworks" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.common.frameworks.ui" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.web" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.common.modulecore" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.common.project.facet.ui" version="1.3.0" match="compatible"/>
-      <import plugin="org.eclipse.wst.common.environment" version="1.0.100" match="equivalent"/>
-      <import plugin="org.eclipse.wst.css.ui" version="1.0.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.html.ui" version="1.0.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.jsdt.ui" version="1.0.0" match="equivalent"/>
-   </requires>
-
-   <plugin
-         id="org.eclipse.wst.jsdt.web.core"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.jsdt.web.ui"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.html.ui.infopop"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.javascript.ui.infopop"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.web.ui.infopop"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.css.ui"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.html.ui"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.javascript.ui"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.web.ui"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-</feature>
diff --git a/features/org.eclipse.wst.web_ui.feature/license.html b/features/org.eclipse.wst.web_ui.feature/license.html
deleted file mode 100644
index 5644598..0000000
--- a/features/org.eclipse.wst.web_ui.feature/license.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>June 06, 2007</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION 
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF 
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE 
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED 
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED 
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE 
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE 
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY 
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU 
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse 
-Foundation is provided to you under the terms and conditions of the Eclipse 
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this 
-Content and is also available at <A 
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>. 
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code, 
-documentation and other files maintained in the Eclipse.org CVS repository 
-("Repository") in CVS modules ("Modules") and made available as downloadable 
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments 
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more 
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may 
-contain a list of the names and version numbers of the Plug-ins and/or Fragments 
-associated with a Feature. Plug-ins and Fragments are located in directories 
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named 
-"feature.xml" may contain a list of the names and version numbers of Included 
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained 
-in files named "about.html" ("Abouts"). The terms and conditions governing 
-Features and Included Features should be contained in files named "license.html" 
-("Feature Licenses"). Abouts and Feature Licenses may be located in any 
-directory of a Download or Module including, but not limited to the following 
-locations:</P>
-<UL>
-  <LI>The top-level (root) directory 
-  <LI>Plug-in and Fragment directories 
-  <LI>Subdirectories of the directory named "src" of certain Plug-ins 
-  <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed 
-using the Eclipse Update Manager, you must agree to a license ("Feature Update 
-License") during the installation process. If the Feature contains Included 
-Features, the Feature Update License should either provide you with the terms 
-and conditions governing the Included Features or inform you where you can 
-locate them. Feature Update Licenses may be found in the "license" property of 
-files named "feature.properties". Such Abouts, Feature Licenses and Feature 
-Update Licenses contain the terms and conditions (or references to such terms 
-and conditions) that govern your use of the associated Content in that 
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL 
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE 
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
-  <LI>Common Public License Version 1.0 (available at <A 
-  href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>) 
-
-  <LI>Apache Software License 1.1 (available at <A 
-  href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>) 
-
-  <LI>Apache Software License 2.0 (available at <A 
-  href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>) 
-
-  <LI>IBM Public License 1.0 (available at <A 
-  href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>) 
-
-  <LI>Metro Link Public License 1.00 (available at <A 
-  href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>) 
-
-  <LI>Mozilla Public License Version 1.1 (available at <A 
-  href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>) 
-  </LI>
-    
-  <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A 
-  href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
-  </LI>
-</UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR 
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is 
-provided, please contact the Eclipse Foundation to determine what terms and 
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are 
-currently may have restrictions on the import, possession, and use, and/or 
-re-export to another country, of encryption software. BEFORE using any 
-encryption software, please check the country's laws, regulations and policies 
-concerning the import, possession, or use, and re-export of encryption software, 
-to see if this is permitted.</P></BODY></HTML>
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/build.properties b/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index dd8a618..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-# 
-# Contributors:
-#     IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes =\
-epl-v10.html,\
-eclipse_update_120.jpg,\
-feature.xml,\
-feature.properties,\
-license.html
-
-generate.feature@org.eclipse.wst.web_core.feature.source = org.eclipse.wst.web_core.feature
-
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/eclipse_update_120.jpg b/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/epl-v10.html b/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/epl-v10.html
deleted file mode 100644
index 022ad29..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
-  <o:Revision>2</o:Revision>
-  <o:TotalTime>3</o:TotalTime>
-  <o:Created>2004-03-05T23:03:00Z</o:Created>
-  <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
-  <o:Pages>4</o:Pages>
-  <o:Words>1626</o:Words>
-  <o:Characters>9270</o:Characters>
-   <o:Lines>77</o:Lines>
-  <o:Paragraphs>18</o:Paragraphs>
-  <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
-  <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
-  <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
-	{font-family:Tahoma;
-	panose-1:2 11 6 4 3 5 4 4 2 4;
-	mso-font-charset:0;
-	mso-generic-font-family:swiss;
-	mso-font-pitch:variable;
-	mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
-	{mso-style-parent:"";
-	margin:0in;
-	margin-bottom:.0001pt;
-	mso-pagination:widow-orphan;
-	font-size:12.0pt;
-	font-family:"Times New Roman";
-	mso-fareast-font-family:"Times New Roman";}
-p
-	{margin-right:0in;
-	mso-margin-top-alt:auto;
-	mso-margin-bottom-alt:auto;
-	margin-left:0in;
-	mso-pagination:widow-orphan;
-	font-size:12.0pt;
-	font-family:"Times New Roman";
-	mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
-	{mso-style-name:"Balloon Text";
-	margin:0in;
-	margin-bottom:.0001pt;
-	mso-pagination:widow-orphan;
-	font-size:8.0pt;
-	font-family:Tahoma;
-	mso-fareast-font-family:"Times New Roman";}
-@page Section1
-	{size:8.5in 11.0in;
-	margin:1.0in 1.25in 1.0in 1.25in;
-	mso-header-margin:.5in;
-	mso-footer-margin:.5in;
-	mso-paper-source:0;}
-div.Section1
-	{page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/feature.properties b/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index 1d92f12..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,133 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-# 
-# Contributors:
-#     IBM Corporation - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=WST Web UI Developer Resources
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Source code zips for WST Web UI.
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
-   - Content may be structured and packaged into modules to facilitate delivering,\n\
-     extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
-     plug-in fragments ("Fragments"), and features ("Features").\n\
-   - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
-     in a directory named "plugins".\n\
-   - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
-     Each Feature may be packaged as a sub-directory in a directory named "features".\n\
-     Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
-     numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
-   - Features may also include other Features ("Included Features"). Within a Feature, files\n\
-     named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
-   - The top-level (root) directory\n\
-   - Plug-in and Fragment directories\n\
-   - Inside Plug-ins and Fragments packaged as JARs\n\
-   - Sub-directories of the directory named "src" of certain Plug-ins\n\
-   - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
-    - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
-    - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
-    - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
-    - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
-    - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
-    - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-    - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/license.html b/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/license.html
deleted file mode 100644
index fec4a48..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplateFeature/license.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>June 06, 2007</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
-   (COLLECTIVELY &quot;CONTENT&quot;).  USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
-   CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW.  BY USING THE CONTENT, YOU AGREE THAT YOUR USE
-   OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
-   NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
-   CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-   
-<h3>Applicable Licenses</h3>   
-   
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
-   (&quot;EPL&quot;).  A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-   For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
-   modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-   
-<ul>
-	<li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content.  Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-	<li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
-	<li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.  Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;.  Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
-      and/or Fragments associated with that Feature.</li>
-	<li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>   
- 
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;).  Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
-	<li>The top-level (root) directory</li>
-	<li>Plug-in and Fragment directories</li>
-	<li>Inside Plug-ins and Fragments packaged as JARs</li>
-	<li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
-	<li>Feature directories</li>
-</ul>
-		
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process.  If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them.  Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.  SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
-	<li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-	<li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
-	<li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
-	<li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>	
-	<li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-	<li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-  <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A 
-  href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
-  </LI>
-</UL>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT.  If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
-   another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
-   possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-   
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>   
-</body>
-</html>
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.html b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index d4916df..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>	
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;).  A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content.  Check the Redistributor's license that was provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.ini b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index fda5a40..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=wtp_prod32.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.mappings b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index 0dfb735..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings

-# contains fill-ins for about.properties

-# java.io.Properties file (ISO 8859-1 with "\" escapes)

-# This file does not need to be translated.

-

-0=@build@

diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.properties b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index 3195c0a..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-# 
-# Contributors:
-#     IBM Corporation - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Web Standard Tools - Web UI\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005.  All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/plugin.properties b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index 0656fb9..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-# 
-# Contributors:
-#     IBM Corporation - initial API and implementation
-###############################################################################
-pluginName=Web Standard Tools - Web UI Source
-providerName=Eclipse.org
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/wtp_prod32.gif b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/wtp_prod32.gif
deleted file mode 100644
index eefb44a..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/wtp_prod32.gif
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/wtp_prod32.png b/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/wtp_prod32.png
deleted file mode 100644
index bfceab3..0000000
--- a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/wtp_prod32.png
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_userdoc.feature/.cvsignore b/features/org.eclipse.wst.web_userdoc.feature/.cvsignore
deleted file mode 100644
index 9cfe174..0000000
--- a/features/org.eclipse.wst.web_userdoc.feature/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build.xml
-org.eclipse.wst.web_userdoc.feature_1.0.0.jar
diff --git a/features/org.eclipse.wst.web_userdoc.feature/.project b/features/org.eclipse.wst.web_userdoc.feature/.project
deleted file mode 100644
index 1b5eb31..0000000
--- a/features/org.eclipse.wst.web_userdoc.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.web_userdoc.feature</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.pde.FeatureBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.FeatureNature</nature>
-	</natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.web_userdoc.feature/build.properties b/features/org.eclipse.wst.web_userdoc.feature/build.properties
deleted file mode 100644
index 7f47694..0000000
--- a/features/org.eclipse.wst.web_userdoc.feature/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
-               eclipse_update_120.jpg,\
-               epl-v10.html,\
-               license.html,\
-               feature.properties
diff --git a/features/org.eclipse.wst.web_userdoc.feature/eclipse_update_120.jpg b/features/org.eclipse.wst.web_userdoc.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/features/org.eclipse.wst.web_userdoc.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.web_userdoc.feature/epl-v10.html b/features/org.eclipse.wst.web_userdoc.feature/epl-v10.html
deleted file mode 100644
index ed4b196..0000000
--- a/features/org.eclipse.wst.web_userdoc.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
-  <o:Revision>2</o:Revision>
-  <o:TotalTime>3</o:TotalTime>
-  <o:Created>2004-03-05T23:03:00Z</o:Created>
-  <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
-  <o:Pages>4</o:Pages>
-  <o:Words>1626</o:Words>
-  <o:Characters>9270</o:Characters>
-   <o:Lines>77</o:Lines>
-  <o:Paragraphs>18</o:Paragraphs>
-  <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
-  <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
-  <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
-	{font-family:Tahoma;
-	panose-1:2 11 6 4 3 5 4 4 2 4;
-	mso-font-charset:0;
-	mso-generic-font-family:swiss;
-	mso-font-pitch:variable;
-	mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
-	{mso-style-parent:"";
-	margin:0in;
-	margin-bottom:.0001pt;
-	mso-pagination:widow-orphan;
-	font-size:12.0pt;
-	font-family:"Times New Roman";
-	mso-fareast-font-family:"Times New Roman";}
-p
-	{margin-right:0in;
-	mso-margin-top-alt:auto;
-	mso-margin-bottom-alt:auto;
-	margin-left:0in;
-	mso-pagination:widow-orphan;
-	font-size:12.0pt;
-	font-family:"Times New Roman";
-	mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
-	{mso-style-name:"Balloon Text";
-	margin:0in;
-	margin-bottom:.0001pt;
-	mso-pagination:widow-orphan;
-	font-size:8.0pt;
-	font-family:Tahoma;
-	mso-fareast-font-family:"Times New Roman";}
-@page Section1
-	{size:8.5in 11.0in;
-	margin:1.0in 1.25in 1.0in 1.25in;
-	mso-header-margin:.5in;
-	mso-footer-margin:.5in;
-	mso-paper-source:0;}
-div.Section1
-	{page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
\ No newline at end of file
diff --git a/features/org.eclipse.wst.web_userdoc.feature/feature.properties b/features/org.eclipse.wst.web_userdoc.feature/feature.properties
deleted file mode 100644
index 35a1216..0000000
--- a/features/org.eclipse.wst.web_userdoc.feature/feature.properties
+++ /dev/null
@@ -1,145 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-# 
-# Contributors:
-#     IBM Corporation - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=WST Web User Documentation
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=WST Web user documentation
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
-    IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
-   - Content may be structured and packaged into modules to facilitate delivering,\n\
-     extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
-     plug-in fragments ("Fragments"), and features ("Features").\n\
-   - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
-     in a directory named "plugins".\n\
-   - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
-     Each Feature may be packaged as a sub-directory in a directory named "features".\n\
-     Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
-     numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
-   - Features may also include other Features ("Included Features"). Within a Feature, files\n\
-     named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
-   - The top-level (root) directory\n\
-   - Plug-in and Fragment directories\n\
-   - Inside Plug-ins and Fragments packaged as JARs\n\
-   - Sub-directories of the directory named "src" of certain Plug-ins\n\
-   - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
-    - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
-    - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
-    - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
-    - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
-    - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
-    - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-    - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.web_userdoc.feature/feature.xml b/features/org.eclipse.wst.web_userdoc.feature/feature.xml
deleted file mode 100644
index bd82db8..0000000
--- a/features/org.eclipse.wst.web_userdoc.feature/feature.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
-      id="org.eclipse.wst.web_userdoc.feature"
-      label="%featureName"
-      version="3.0.0.qualifier"
-      provider-name="%providerName">
-
-   <description>
-      %description
-   </description>
-
-   <copyright>
-      %copyright
-   </copyright>
-
-   <license url="license.html">
-      %license
-   </license>
-
-   <url>
-      <update label="%updateSiteName" url="http://download.eclipse.org/webtools/updates/"/>
-   </url>
-
-   <plugin
-         id="org.eclipse.wst.doc.user"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.eclipse.wst.webtools.doc.user"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-</feature>
diff --git a/features/org.eclipse.wst.web_userdoc.feature/license.html b/features/org.eclipse.wst.web_userdoc.feature/license.html
deleted file mode 100644
index 5644598..0000000
--- a/features/org.eclipse.wst.web_userdoc.feature/license.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>June 06, 2007</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION 
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF 
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE 
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED 
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED 
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE 
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE 
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY 
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU 
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse 
-Foundation is provided to you under the terms and conditions of the Eclipse 
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this 
-Content and is also available at <A 
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>. 
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code, 
-documentation and other files maintained in the Eclipse.org CVS repository 
-("Repository") in CVS modules ("Modules") and made available as downloadable 
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments 
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more 
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may 
-contain a list of the names and version numbers of the Plug-ins and/or Fragments 
-associated with a Feature. Plug-ins and Fragments are located in directories 
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named 
-"feature.xml" may contain a list of the names and version numbers of Included 
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained 
-in files named "about.html" ("Abouts"). The terms and conditions governing 
-Features and Included Features should be contained in files named "license.html" 
-("Feature Licenses"). Abouts and Feature Licenses may be located in any 
-directory of a Download or Module including, but not limited to the following 
-locations:</P>
-<UL>
-  <LI>The top-level (root) directory 
-  <LI>Plug-in and Fragment directories 
-  <LI>Subdirectories of the directory named "src" of certain Plug-ins 
-  <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed 
-using the Eclipse Update Manager, you must agree to a license ("Feature Update 
-License") during the installation process. If the Feature contains Included 
-Features, the Feature Update License should either provide you with the terms 
-and conditions governing the Included Features or inform you where you can 
-locate them. Feature Update Licenses may be found in the "license" property of 
-files named "feature.properties". Such Abouts, Feature Licenses and Feature 
-Update Licenses contain the terms and conditions (or references to such terms 
-and conditions) that govern your use of the associated Content in that 
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL 
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE 
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
-  <LI>Common Public License Version 1.0 (available at <A 
-  href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>) 
-
-  <LI>Apache Software License 1.1 (available at <A 
-  href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>) 
-
-  <LI>Apache Software License 2.0 (available at <A 
-  href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>) 
-
-  <LI>IBM Public License 1.0 (available at <A 
-  href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>) 
-
-  <LI>Metro Link Public License 1.00 (available at <A 
-  href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>) 
-
-  <LI>Mozilla Public License Version 1.1 (available at <A 
-  href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>) 
-  </LI>
-    
-  <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A 
-  href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
-  </LI>
-</UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR 
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is 
-provided, please contact the Eclipse Foundation to determine what terms and 
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are 
-currently may have restrictions on the import, possession, and use, and/or 
-re-export to another country, of encryption software. BEFORE using any 
-encryption software, please check the country's laws, regulations and policies 
-concerning the import, possession, or use, and re-export of encryption software, 
-to see if this is permitted.</P></BODY></HTML>
diff --git a/features/org.eclipse.wst.xml_core.feature.patch/.project b/features/org.eclipse.wst.xml_core.feature.patch/.project
deleted file mode 100644
index 648c793..0000000
--- a/features/org.eclipse.wst.xml_core.feature.patch/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.xml_core.feature.patch</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.pde.FeatureBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.FeatureNature</nature>
-	</natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.xml_core.feature.patch/description.txt b/features/org.eclipse.wst.xml_core.feature.patch/description.txt
deleted file mode 100644
index 2d8148a..0000000
--- a/features/org.eclipse.wst.xml_core.feature.patch/description.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-This head trunk is deliberatly empty. 
-
-Please load the appropriate maintenance branch. 
-
diff --git a/features/org.eclipse.wst.xml_core.feature/feature.properties b/features/org.eclipse.wst.xml_core.feature/feature.properties
index 3544f59..5e5c12e 100644
--- a/features/org.eclipse.wst.xml_core.feature/feature.properties
+++ b/features/org.eclipse.wst.xml_core.feature/feature.properties
@@ -18,10 +18,7 @@
 featureName=WST XML Core
 
 # "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
+providerName=Eclipse Web Tools Platform
 
 # "description" property - description of the feature
 description=WST XML core.
@@ -45,8 +42,8 @@
 # "license" property - text of the "Feature Update License"
 # should be plain text version of license agreement pointed to be "licenseURL"
 license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
+Eclipse Foundation Software User Agreement\n\
+April 14, 2010\n\
 \n\
 Usage Of Content\n\
 \n\
@@ -54,42 +51,38 @@
 OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
 USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
 AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+NOTICES INDICATED OR REFERENCED BELOW.  BY USING THE CONTENT, YOU\n\
 AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
 AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+OR NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE\n\
 TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
 OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
 BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
 \n\
 Applicable Licenses\n\
 \n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+Unless otherwise indicated, all Content made available by the\n\
+Eclipse Foundation is provided to you under the terms and conditions of\n\
+the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
+provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
 For purposes of the EPL, "Program" will mean the Content.\n\
 \n\
 Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
+documentation and other files maintained in the Eclipse Foundation source code\n\
+repository ("Repository") in software modules ("Modules") and made available\n\
 as downloadable archives ("Downloads").\n\
 \n\
-   - Content may be structured and packaged into modules to facilitate delivering,\n\
-     extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
-     plug-in fragments ("Fragments"), and features ("Features").\n\
-   - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
-     in a directory named "plugins".\n\
-   - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
-     Each Feature may be packaged as a sub-directory in a directory named "features".\n\
-     Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
-     numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
-   - Features may also include other Features ("Included Features"). Within a Feature, files\n\
-     named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
+       - Content may be structured and packaged into modules to facilitate delivering,\n\
+         extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+         plug-in fragments ("Fragments"), and features ("Features").\n\
+       - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+         in a directory named "plugins".\n\
+       - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+         Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+         Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+         numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+       - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+         named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
 \n\
 The terms and conditions governing Plug-ins and Fragments should be\n\
 contained in files named "about.html" ("Abouts"). The terms and\n\
@@ -98,48 +91,77 @@
 Licenses may be located in any directory of a Download or Module\n\
 including, but not limited to the following locations:\n\
 \n\
-   - The top-level (root) directory\n\
-   - Plug-in and Fragment directories\n\
-   - Inside Plug-ins and Fragments packaged as JARs\n\
-   - Sub-directories of the directory named "src" of certain Plug-ins\n\
-   - Feature directories\n\
+       - The top-level (root) directory\n\
+       - Plug-in and Fragment directories\n\
+       - Inside Plug-ins and Fragments packaged as JARs\n\
+       - Sub-directories of the directory named "src" of certain Plug-ins\n\
+       - Feature directories\n\
 \n\
 Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
+Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
+Update License") during the installation process. If the Feature contains\n\
 Included Features, the Feature Update License should either provide you\n\
 with the terms and conditions governing the Included Features or inform\n\
 you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
+the "license" property of files named "feature.properties" found within a Feature.\n\
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
+terms and conditions (or references to such terms and conditions) that\n\
+govern your use of the associated Content in that directory.\n\
 \n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
 TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
 SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
 \n\
-    - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
-    - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
-    - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
-    - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
-    - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
-    - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-    - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
+       - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+       - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+       - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+       - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+       - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
 \n\
 IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
+TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
 is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
 govern that particular Content.\n\
 \n\
+\n\Use of Provisioning Technology\n\
+\n\
+The Eclipse Foundation makes available provisioning software, examples of which include,\n\
+but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
+the purpose of allowing users to install software, documentation, information and/or\n\
+other materials (collectively "Installable Software"). This capability is provided with\n\
+the intent of allowing such users to install, extend and update Eclipse-based products.\n\
+Information about packaging Installable Software is available at\n\
+http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
+\n\
+You may use Provisioning Technology to allow other parties to install Installable Software.\n\
+You shall be responsible for enabling the applicable license agreements relating to the\n\
+Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
+in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
+making it available in accordance with the Specification, you further acknowledge your\n\
+agreement to, and the acquisition of all necessary rights to permit the following:\n\
+\n\
+       1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
+          the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
+          extending or updating the functionality of an Eclipse-based product.\n\
+       2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
+          Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
+       3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
+          govern the use of the Installable Software ("Installable Software Agreement") and such\n\
+          Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
+          with the Specification. Such Installable Software Agreement must inform the user of the\n\
+          terms and conditions that govern the Installable Software and must solicit acceptance by\n\
+          the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
+          indication of agreement by the user, the provisioning Technology will complete installation\n\
+          of the Installable Software.\n\
+\n\
 Cryptography\n\
 \n\
 Content may contain encryption software. The country in which you are\n\
 currently may have restrictions on the import, possession, and use,\n\
 and/or re-export to another country, of encryption software. BEFORE\n\
 using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
+regulations and policies concerning the import, possession, or use, and\n\
+re-export of encryption software, to see if this is permitted.\n\
 \n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
+Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
 ########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.xml_core.feature/feature.xml b/features/org.eclipse.wst.xml_core.feature/feature.xml
index 3b63326..a452d90 100644
--- a/features/org.eclipse.wst.xml_core.feature/feature.xml
+++ b/features/org.eclipse.wst.xml_core.feature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.xml_core.feature"
       label="%featureName"
-      version="3.0.0.qualifier"
+      version="3.2.2.qualifier"
       provider-name="%providerName">
 
    <description>
@@ -17,33 +17,6 @@
       %license
    </license>
 
-   <url>
-      <update label="%updateSiteName" url="http://download.eclipse.org/webtools/updates/"/>
-   </url>
-
-   <requires>
-      <import plugin="org.eclipse.osgi"/>
-      <import plugin="org.eclipse.core.runtime" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.xsd" version="2.2.0" match="compatible"/>
-      <import plugin="org.eclipse.wst.xml.core" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.sse.core" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.core.runtime" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.core.resources" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.wst.common.uriresolver" version="1.1.301" match="equivalent"/>
-      <import plugin="org.eclipse.wst.sse.core" version="1.1.300" match="equivalent"/>
-      <import plugin="org.eclipse.wst.common.core" version="1.1.101" match="equivalent"/>
-      <import plugin="com.ibm.icu" version="3.8.1" match="compatible"/>
-      <import plugin="org.eclipse.emf.ecore" version="2.4.0" match="compatible"/>
-      <import plugin="org.eclipse.jface.text" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.ui" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.wst.xml.core" version="1.1.300" match="equivalent"/>
-      <import plugin="org.eclipse.wst.validation" version="1.2.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.common.uriresolver" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.text" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.core.filebuffers" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.emf.common" version="2.4.0" match="compatible"/>
-   </requires>
-
    <plugin
          id="javax.xml"
          download-size="190"
@@ -74,8 +47,8 @@
 
    <plugin
          id="org.eclipse.wst.standard.schemas"
-         download-size="0"
-         install-size="0"
+         download-size="152"
+         install-size="152"
          version="0.0.0"
          unpack="false"/>
 
diff --git a/features/org.eclipse.wst.xml_core.feature/license.html b/features/org.eclipse.wst.xml_core.feature/license.html
index 303e665..c184ca3 100644
--- a/features/org.eclipse.wst.xml_core.feature/license.html
+++ b/features/org.eclipse.wst.xml_core.feature/license.html
@@ -1,96 +1,107 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>June 06, 2007</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION 
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF 
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE 
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED 
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED 
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE 
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE 
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY 
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU 
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse 
-Foundation is provided to you under the terms and conditions of the Eclipse 
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this 
-Content and is also available at <A 
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>. 
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code, 
-documentation and other files maintained in the Eclipse.org CVS repository 
-("Repository") in CVS modules ("Modules") and made available as downloadable 
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments 
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more 
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may 
-contain a list of the names and version numbers of the Plug-ins and/or Fragments 
-associated with a Feature. Plug-ins and Fragments are located in directories 
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named 
-"feature.xml" may contain a list of the names and version numbers of Included 
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained 
-in files named "about.html" ("Abouts"). The terms and conditions governing 
-Features and Included Features should be contained in files named "license.html" 
-("Feature Licenses"). Abouts and Feature Licenses may be located in any 
-directory of a Download or Module including, but not limited to the following 
-locations:</P>
-<UL>
-  <LI>The top-level (root) directory 
-  <LI>Plug-in and Fragment directories 
-  <LI>Subdirectories of the directory named "src" of certain Plug-ins 
-  <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed 
-using the Eclipse Update Manager, you must agree to a license ("Feature Update 
-License") during the installation process. If the Feature contains Included 
-Features, the Feature Update License should either provide you with the terms 
-and conditions governing the Included Features or inform you where you can 
-locate them. Feature Update Licenses may be found in the "license" property of 
-files named "feature.properties". Such Abouts, Feature Licenses and Feature 
-Update Licenses contain the terms and conditions (or references to such terms 
-and conditions) that govern your use of the associated Content in that 
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL 
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE 
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
-  <LI>Common Public License Version 1.0 (available at <A 
-  href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
 
-  <LI>Apache Software License 1.1 (available at <A 
-  href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 14, 2010</p>
 
-  <LI>Apache Software License 2.0 (available at <A 
-  href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
+<h3>Usage Of Content</h3>
 
-  <LI>IBM Public License 1.0 (available at <A 
-  href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-  <LI>Metro Link Public License 1.00 (available at <A 
-  href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>) 
-  
-  <LI>Mozilla Public License Version 1.1 (available at <A 
-  href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>) </LI>
-  
-  <li>Common Development and Distribution License (CDDL) Version 1.0 (available at <A 
-  href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
-  </LI>
-</UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR 
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is 
-provided, please contact the Eclipse Foundation to determine what terms and 
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are 
-currently may have restrictions on the import, possession, and use, and/or 
-re-export to another country, of encryption software. BEFORE using any 
-encryption software, please check the country's laws, regulations and policies 
-concerning the import, possession, or use, and re-export of encryption software, 
-to see if this is permitted.</P></BODY></HTML>
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+   (COLLECTIVELY &quot;CONTENT&quot;).  USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+   CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW.  BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+   OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+   NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+   CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+   (&quot;EPL&quot;).  A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+   For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+   repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+       <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content.  Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+       <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+       <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.  Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;.  Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+      and/or Fragments associated with that Feature.</li>
+       <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;).  Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+       <li>The top-level (root) directory</li>
+       <li>Plug-in and Fragment directories</li>
+       <li>Inside Plug-ins and Fragments packaged as JARs</li>
+       <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+       <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process.  If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them.  Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.  SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+       <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+       <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+       <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+       <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+       <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT.  If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+   Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+   other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+   install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+       href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+   (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+   applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+   in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+   Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+       <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+       on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+       product.</li>
+       <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+       accessed and copied to the Target Machine.</li>
+       <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+       Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+       Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+       the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+       indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+   another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+   possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html>
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.html b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.html
similarity index 98%
rename from features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.html
rename to features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.html
index d4916df..fe81d46 100644
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.html
+++ b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.html
@@ -7,7 +7,7 @@
 <body lang="EN-US">
 <h2>About This Content</h2>
 
-<p>June 06, 2007</p>	
+<P>June, 2008</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
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.ini b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.ini
similarity index 100%
rename from features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.ini
rename to features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.ini
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.mappings b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.mappings
similarity index 99%
rename from features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.mappings
rename to features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.mappings
index 0dfb735..a28390a 100644
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.mappings
+++ b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.mappings
@@ -1,6 +1,6 @@
-# about.mappings

-# contains fill-ins for about.properties

-# java.io.Properties file (ISO 8859-1 with "\" escapes)

-# This file does not need to be translated.

-

-0=@build@

+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
+0=@build@
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.properties b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.properties
similarity index 95%
copy from features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.properties
copy to features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.properties
index 61f1e6e..e1c2716 100644
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.properties
+++ b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/about.properties
@@ -16,7 +16,7 @@
 #
 # Do not translate any values surrounded by {}
 
-blurb=Web Standard Tools - Web Core\n\
+blurb=Web Standard Tools - XML Core\n\
 \n\
 Version: {featureVersion}\n\
 Build id: {0}\n\
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/build.properties b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/build.properties
similarity index 100%
rename from features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/build.properties
rename to features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/build.properties
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/plugin.properties b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/plugin.properties
similarity index 85%
copy from features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/plugin.properties
copy to features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/plugin.properties
index c9d38d6..f392411 100644
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/plugin.properties
+++ b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/plugin.properties
@@ -8,5 +8,5 @@
 # Contributors:
 #     IBM Corporation - initial API and implementation
 ###############################################################################
-pluginName=Web Standard Tools - Web Core Source
-providerName=Eclipse.org
+pluginName=Web Standard Tools - XML Core Source
+providerName=Eclipse Web Tools Platform
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/wtp_prod32.gif b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/wtp_prod32.gif
similarity index 100%
rename from features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/wtp_prod32.gif
rename to features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/wtp_prod32.gif
Binary files differ
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/wtp_prod32.png b/features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/wtp_prod32.png
similarity index 100%
rename from features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/wtp_prod32.png
rename to features/org.eclipse.wst.xml_core.feature/sourceTemplateBundle/wtp_prod32.png
Binary files differ
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/feature.properties b/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/feature.properties
index be282aa..3bc44f5 100644
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/feature.properties
+++ b/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/feature.properties
@@ -18,10 +18,8 @@
 featureName=WST XML Core Developer Resources
 
 # "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
+providerName=Eclipse Web Tools Platform
 
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
 
 # "description" property - description of the feature
 description=Source code zips for WST XML core.
@@ -45,8 +43,8 @@
 # "license" property - text of the "Feature Update License"
 # should be plain text version of license agreement pointed to be "licenseURL"
 license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
+Eclipse Foundation Software User Agreement\n\
+April 14, 2010\n\
 \n\
 Usage Of Content\n\
 \n\
@@ -54,42 +52,38 @@
 OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
 USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
 AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+NOTICES INDICATED OR REFERENCED BELOW.  BY USING THE CONTENT, YOU\n\
 AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
 AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+OR NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE\n\
 TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
 OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
 BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
 \n\
 Applicable Licenses\n\
 \n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+Unless otherwise indicated, all Content made available by the\n\
+Eclipse Foundation is provided to you under the terms and conditions of\n\
+the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
+provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
 For purposes of the EPL, "Program" will mean the Content.\n\
 \n\
 Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
+documentation and other files maintained in the Eclipse Foundation source code\n\
+repository ("Repository") in software modules ("Modules") and made available\n\
 as downloadable archives ("Downloads").\n\
 \n\
-   - Content may be structured and packaged into modules to facilitate delivering,\n\
-     extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
-     plug-in fragments ("Fragments"), and features ("Features").\n\
-   - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
-     in a directory named "plugins".\n\
-   - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
-     Each Feature may be packaged as a sub-directory in a directory named "features".\n\
-     Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
-     numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
-   - Features may also include other Features ("Included Features"). Within a Feature, files\n\
-     named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
+       - Content may be structured and packaged into modules to facilitate delivering,\n\
+         extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+         plug-in fragments ("Fragments"), and features ("Features").\n\
+       - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+         in a directory named "plugins".\n\
+       - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+         Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+         Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+         numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+       - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+         named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
 \n\
 The terms and conditions governing Plug-ins and Fragments should be\n\
 contained in files named "about.html" ("Abouts"). The terms and\n\
@@ -98,48 +92,77 @@
 Licenses may be located in any directory of a Download or Module\n\
 including, but not limited to the following locations:\n\
 \n\
-   - The top-level (root) directory\n\
-   - Plug-in and Fragment directories\n\
-   - Inside Plug-ins and Fragments packaged as JARs\n\
-   - Sub-directories of the directory named "src" of certain Plug-ins\n\
-   - Feature directories\n\
+       - The top-level (root) directory\n\
+       - Plug-in and Fragment directories\n\
+       - Inside Plug-ins and Fragments packaged as JARs\n\
+       - Sub-directories of the directory named "src" of certain Plug-ins\n\
+       - Feature directories\n\
 \n\
 Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
+Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
+Update License") during the installation process. If the Feature contains\n\
 Included Features, the Feature Update License should either provide you\n\
 with the terms and conditions governing the Included Features or inform\n\
 you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
+the "license" property of files named "feature.properties" found within a Feature.\n\
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
+terms and conditions (or references to such terms and conditions) that\n\
+govern your use of the associated Content in that directory.\n\
 \n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
 TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
 SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
 \n\
-    - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
-    - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
-    - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
-    - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
-    - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
-    - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-    - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
+       - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+       - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+       - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+       - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+       - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
 \n\
 IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
+TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
 is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
 govern that particular Content.\n\
 \n\
+\n\Use of Provisioning Technology\n\
+\n\
+The Eclipse Foundation makes available provisioning software, examples of which include,\n\
+but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
+the purpose of allowing users to install software, documentation, information and/or\n\
+other materials (collectively "Installable Software"). This capability is provided with\n\
+the intent of allowing such users to install, extend and update Eclipse-based products.\n\
+Information about packaging Installable Software is available at\n\
+http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
+\n\
+You may use Provisioning Technology to allow other parties to install Installable Software.\n\
+You shall be responsible for enabling the applicable license agreements relating to the\n\
+Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
+in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
+making it available in accordance with the Specification, you further acknowledge your\n\
+agreement to, and the acquisition of all necessary rights to permit the following:\n\
+\n\
+       1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
+          the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
+          extending or updating the functionality of an Eclipse-based product.\n\
+       2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
+          Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
+       3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
+          govern the use of the Installable Software ("Installable Software Agreement") and such\n\
+          Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
+          with the Specification. Such Installable Software Agreement must inform the user of the\n\
+          terms and conditions that govern the Installable Software and must solicit acceptance by\n\
+          the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
+          indication of agreement by the user, the provisioning Technology will complete installation\n\
+          of the Installable Software.\n\
+\n\
 Cryptography\n\
 \n\
 Content may contain encryption software. The country in which you are\n\
 currently may have restrictions on the import, possession, and use,\n\
 and/or re-export to another country, of encryption software. BEFORE\n\
 using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
+regulations and policies concerning the import, possession, or use, and\n\
+re-export of encryption software, to see if this is permitted.\n\
 \n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
+Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
 ########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/license.html b/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/license.html
index fec4a48..c184ca3 100644
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/license.html
+++ b/features/org.eclipse.wst.xml_core.feature/sourceTemplateFeature/license.html
@@ -1,13 +1,14 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
 </head>
 
-<body lang="EN-US" link=blue vlink=purple>
+<body lang="EN-US">
 <h2>Eclipse Foundation Software User Agreement</h2>
-<p>June 06, 2007</p>
+<p>April 14, 2010</p>
 
 <h3>Usage Of Content</h3>
 
@@ -17,37 +18,37 @@
    OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
    NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
    CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-   
-<h3>Applicable Licenses</h3>   
-   
+
+<h3>Applicable Licenses</h3>
+
 <p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
    (&quot;EPL&quot;).  A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
    For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
 
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
-   modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-   
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+   repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
 <ul>
-	<li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content.  Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-	<li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
-	<li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.  Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;.  Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+       <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content.  Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+       <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+       <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.  Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;.  Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
       and/or Fragments associated with that Feature.</li>
-	<li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>   
- 
+       <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
 <p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
 Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;).  Abouts and Feature Licenses may be located in any directory of a Download or Module
 including, but not limited to the following locations:</p>
 
 <ul>
-	<li>The top-level (root) directory</li>
-	<li>Plug-in and Fragment directories</li>
-	<li>Inside Plug-ins and Fragments packaged as JARs</li>
-	<li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
-	<li>Feature directories</li>
+       <li>The top-level (root) directory</li>
+       <li>Plug-in and Fragment directories</li>
+       <li>Inside Plug-ins and Fragments packaged as JARs</li>
+       <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+       <li>Feature directories</li>
 </ul>
-		
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
 installation process.  If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
 inform you where you can locate them.  Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
 Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
@@ -57,26 +58,50 @@
 OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
 
 <ul>
-	<li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-	<li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
-	<li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
-	<li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>	
-	<li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-	<li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-  <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A 
-  href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
-  </LI>
-</UL>
+       <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+       <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+       <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+       <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+       <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
 
 <p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT.  If no About, Feature License, or Feature Update License is provided, please
 contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
 
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+   Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+   other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+   install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+       href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+   (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+   applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+   in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+   Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+       <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+       on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+       product.</li>
+       <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+       accessed and copied to the Target Machine.</li>
+       <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+       Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+       Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+       the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+       indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
 <h3>Cryptography</h3>
 
 <p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
    another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
    possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-   
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>   
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
 </body>
 </html>
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.html b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.html
index d4916df..fe81d46 100644
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.html
+++ b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/about.html
@@ -7,7 +7,7 @@
 <body lang="EN-US">
 <h2>About This Content</h2>
 
-<p>June 06, 2007</p>	
+<P>June, 2008</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
diff --git a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/plugin.properties b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/plugin.properties
index 8f43777..f392411 100644
--- a/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/plugin.properties
+++ b/features/org.eclipse.wst.xml_core.feature/sourceTemplatePlugin/plugin.properties
@@ -9,4 +9,4 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 pluginName=Web Standard Tools - XML Core Source
-providerName=Eclipse.org
+providerName=Eclipse Web Tools Platform
diff --git a/features/org.eclipse.wst.xml_sdk.feature/build.properties b/features/org.eclipse.wst.xml_sdk.feature/build.properties
index a45b41a..724050e 100644
--- a/features/org.eclipse.wst.xml_sdk.feature/build.properties
+++ b/features/org.eclipse.wst.xml_sdk.feature/build.properties
@@ -3,5 +3,4 @@
                epl-v10.html,\
                eclipse_update_120.jpg,\
                feature.properties
-
-generate.feature@org.eclipse.wst.xml_ui.feature.source=org.eclipse.wst.xml_ui.feature, feature@org.eclipse.wst.xml_core.feature.source
+generate.feature@org.eclipse.wst.xml_ui.feature.source=org.eclipse.wst.xml_ui.feature, feature@org.eclipse.wst.xml_core.feature.source 
diff --git a/features/org.eclipse.wst.xml_sdk.feature/feature.properties b/features/org.eclipse.wst.xml_sdk.feature/feature.properties
index f0132ff..8e4a6ef 100644
--- a/features/org.eclipse.wst.xml_sdk.feature/feature.properties
+++ b/features/org.eclipse.wst.xml_sdk.feature/feature.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2007 IBM Corporation and others.
+# Copyright (c) 2008 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -15,20 +15,17 @@
 # This file should be translated.
 
 # "featureName" property - name of the feature
-featureName=WST XML Plug-in Developer Resources
+featureName=Eclipse XML Editors and Tools SDK
 
 # "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
+providerName=Eclipse Web Tools Platform
 
 # "description" property - description of the feature
 description=Source code zips for the WST XML tools
 
 # "copyright" property - text of the "Feature Update Copyright"
 copyright=\
-Copyright (c) 2000, 2007 IBM Corporation and others.\n\
+Copyright (c) 2000, 2008 IBM Corporation and others.\n\
 All rights reserved. This program and the accompanying materials\n\
 are made available under the terms of the Eclipse Public License v1.0\n\
 which accompanies this distribution, and is available at\n\
@@ -45,8 +42,8 @@
 # "license" property - text of the "Feature Update License"
 # should be plain text version of license agreement pointed to be "licenseURL"
 license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
+Eclipse Foundation Software User Agreement\n\
+April 14, 2010\n\
 \n\
 Usage Of Content\n\
 \n\
@@ -54,42 +51,38 @@
 OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
 USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
 AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+NOTICES INDICATED OR REFERENCED BELOW.  BY USING THE CONTENT, YOU\n\
 AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
 AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+OR NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE\n\
 TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
 OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
 BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
 \n\
 Applicable Licenses\n\
 \n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+Unless otherwise indicated, all Content made available by the\n\
+Eclipse Foundation is provided to you under the terms and conditions of\n\
+the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
+provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
 For purposes of the EPL, "Program" will mean the Content.\n\
 \n\
 Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
+documentation and other files maintained in the Eclipse Foundation source code\n\
+repository ("Repository") in software modules ("Modules") and made available\n\
 as downloadable archives ("Downloads").\n\
 \n\
-   - Content may be structured and packaged into modules to facilitate delivering,\n\
-     extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
-     plug-in fragments ("Fragments"), and features ("Features").\n\
-   - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
-     in a directory named "plugins".\n\
-   - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
-     Each Feature may be packaged as a sub-directory in a directory named "features".\n\
-     Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
-     numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
-   - Features may also include other Features ("Included Features"). Within a Feature, files\n\
-     named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
+       - Content may be structured and packaged into modules to facilitate delivering,\n\
+         extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+         plug-in fragments ("Fragments"), and features ("Features").\n\
+       - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+         in a directory named "plugins".\n\
+       - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+         Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+         Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+         numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+       - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+         named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
 \n\
 The terms and conditions governing Plug-ins and Fragments should be\n\
 contained in files named "about.html" ("Abouts"). The terms and\n\
@@ -98,48 +91,77 @@
 Licenses may be located in any directory of a Download or Module\n\
 including, but not limited to the following locations:\n\
 \n\
-   - The top-level (root) directory\n\
-   - Plug-in and Fragment directories\n\
-   - Inside Plug-ins and Fragments packaged as JARs\n\
-   - Sub-directories of the directory named "src" of certain Plug-ins\n\
-   - Feature directories\n\
+       - The top-level (root) directory\n\
+       - Plug-in and Fragment directories\n\
+       - Inside Plug-ins and Fragments packaged as JARs\n\
+       - Sub-directories of the directory named "src" of certain Plug-ins\n\
+       - Feature directories\n\
 \n\
 Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
+Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
+Update License") during the installation process. If the Feature contains\n\
 Included Features, the Feature Update License should either provide you\n\
 with the terms and conditions governing the Included Features or inform\n\
 you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
+the "license" property of files named "feature.properties" found within a Feature.\n\
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
+terms and conditions (or references to such terms and conditions) that\n\
+govern your use of the associated Content in that directory.\n\
 \n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
 TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
 SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
 \n\
-    - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
-    - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
-    - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
-    - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
-    - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
-    - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-    - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
+       - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+       - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+       - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+       - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+       - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
 \n\
 IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
+TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
 is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
 govern that particular Content.\n\
 \n\
+\n\Use of Provisioning Technology\n\
+\n\
+The Eclipse Foundation makes available provisioning software, examples of which include,\n\
+but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
+the purpose of allowing users to install software, documentation, information and/or\n\
+other materials (collectively "Installable Software"). This capability is provided with\n\
+the intent of allowing such users to install, extend and update Eclipse-based products.\n\
+Information about packaging Installable Software is available at\n\
+http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
+\n\
+You may use Provisioning Technology to allow other parties to install Installable Software.\n\
+You shall be responsible for enabling the applicable license agreements relating to the\n\
+Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
+in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
+making it available in accordance with the Specification, you further acknowledge your\n\
+agreement to, and the acquisition of all necessary rights to permit the following:\n\
+\n\
+       1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
+          the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
+          extending or updating the functionality of an Eclipse-based product.\n\
+       2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
+          Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
+       3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
+          govern the use of the Installable Software ("Installable Software Agreement") and such\n\
+          Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
+          with the Specification. Such Installable Software Agreement must inform the user of the\n\
+          terms and conditions that govern the Installable Software and must solicit acceptance by\n\
+          the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
+          indication of agreement by the user, the provisioning Technology will complete installation\n\
+          of the Installable Software.\n\
+\n\
 Cryptography\n\
 \n\
 Content may contain encryption software. The country in which you are\n\
 currently may have restrictions on the import, possession, and use,\n\
 and/or re-export to another country, of encryption software. BEFORE\n\
 using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
+regulations and policies concerning the import, possession, or use, and\n\
+re-export of encryption software, to see if this is permitted.\n\
 \n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
+Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
 ########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.xml_sdk.feature/feature.xml b/features/org.eclipse.wst.xml_sdk.feature/feature.xml
index 6e14f59..52c6e11 100644
--- a/features/org.eclipse.wst.xml_sdk.feature/feature.xml
+++ b/features/org.eclipse.wst.xml_sdk.feature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.xml_sdk.feature"
       label="%featureName"
-      version="3.0.0.qualifier"
+      version="3.2.2.qualifier"
       provider-name="%providerName">
 
    <description>
@@ -17,16 +17,16 @@
       %license
    </license>
 
-   <url>
-      <update label="%updateSiteName" url="http://download.eclipse.org/webtools/updates/"/>
-   </url>
+   <includes
+         id="org.eclipse.wst.common_sdk.feature"
+         version="0.0.0"/>
 
-    <includes
+   <includes
          id="org.eclipse.wst.xml_ui.feature"
          version="0.0.0"/>
-    <includes
+
+   <includes
          id="org.eclipse.wst.xml_ui.feature.source"
          version="0.0.0"/>
 
-
 </feature>
diff --git a/features/org.eclipse.wst.xml_sdk.feature/license.html b/features/org.eclipse.wst.xml_sdk.feature/license.html
index 303e665..c184ca3 100644
--- a/features/org.eclipse.wst.xml_sdk.feature/license.html
+++ b/features/org.eclipse.wst.xml_sdk.feature/license.html
@@ -1,96 +1,107 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>June 06, 2007</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION 
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF 
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE 
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED 
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED 
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE 
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE 
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY 
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU 
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse 
-Foundation is provided to you under the terms and conditions of the Eclipse 
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this 
-Content and is also available at <A 
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>. 
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code, 
-documentation and other files maintained in the Eclipse.org CVS repository 
-("Repository") in CVS modules ("Modules") and made available as downloadable 
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments 
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more 
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may 
-contain a list of the names and version numbers of the Plug-ins and/or Fragments 
-associated with a Feature. Plug-ins and Fragments are located in directories 
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named 
-"feature.xml" may contain a list of the names and version numbers of Included 
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained 
-in files named "about.html" ("Abouts"). The terms and conditions governing 
-Features and Included Features should be contained in files named "license.html" 
-("Feature Licenses"). Abouts and Feature Licenses may be located in any 
-directory of a Download or Module including, but not limited to the following 
-locations:</P>
-<UL>
-  <LI>The top-level (root) directory 
-  <LI>Plug-in and Fragment directories 
-  <LI>Subdirectories of the directory named "src" of certain Plug-ins 
-  <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed 
-using the Eclipse Update Manager, you must agree to a license ("Feature Update 
-License") during the installation process. If the Feature contains Included 
-Features, the Feature Update License should either provide you with the terms 
-and conditions governing the Included Features or inform you where you can 
-locate them. Feature Update Licenses may be found in the "license" property of 
-files named "feature.properties". Such Abouts, Feature Licenses and Feature 
-Update Licenses contain the terms and conditions (or references to such terms 
-and conditions) that govern your use of the associated Content in that 
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL 
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE 
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
-  <LI>Common Public License Version 1.0 (available at <A 
-  href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
 
-  <LI>Apache Software License 1.1 (available at <A 
-  href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 14, 2010</p>
 
-  <LI>Apache Software License 2.0 (available at <A 
-  href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
+<h3>Usage Of Content</h3>
 
-  <LI>IBM Public License 1.0 (available at <A 
-  href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-  <LI>Metro Link Public License 1.00 (available at <A 
-  href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>) 
-  
-  <LI>Mozilla Public License Version 1.1 (available at <A 
-  href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>) </LI>
-  
-  <li>Common Development and Distribution License (CDDL) Version 1.0 (available at <A 
-  href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
-  </LI>
-</UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR 
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is 
-provided, please contact the Eclipse Foundation to determine what terms and 
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are 
-currently may have restrictions on the import, possession, and use, and/or 
-re-export to another country, of encryption software. BEFORE using any 
-encryption software, please check the country's laws, regulations and policies 
-concerning the import, possession, or use, and re-export of encryption software, 
-to see if this is permitted.</P></BODY></HTML>
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+   (COLLECTIVELY &quot;CONTENT&quot;).  USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+   CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW.  BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+   OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+   NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+   CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+   (&quot;EPL&quot;).  A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+   For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+   repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+       <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content.  Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+       <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+       <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.  Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;.  Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+      and/or Fragments associated with that Feature.</li>
+       <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;).  Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+       <li>The top-level (root) directory</li>
+       <li>Plug-in and Fragment directories</li>
+       <li>Inside Plug-ins and Fragments packaged as JARs</li>
+       <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+       <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process.  If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them.  Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.  SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+       <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+       <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+       <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+       <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+       <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT.  If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+   Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+   other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+   install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+       href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+   (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+   applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+   in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+   Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+       <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+       on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+       product.</li>
+       <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+       accessed and copied to the Target Machine.</li>
+       <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+       Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+       Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+       the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+       indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+   another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+   possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html>
diff --git a/features/org.eclipse.wst.xml_ui.feature.patch/.project b/features/org.eclipse.wst.xml_ui.feature.patch/.project
deleted file mode 100644
index 910c1f8..0000000
--- a/features/org.eclipse.wst.xml_ui.feature.patch/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.xml_ui.feature.patch</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.pde.FeatureBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.FeatureNature</nature>
-	</natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.xml_ui.feature.patch/build.properties b/features/org.eclipse.wst.xml_ui.feature.patch/build.properties
deleted file mode 100644
index 64f93a9..0000000
--- a/features/org.eclipse.wst.xml_ui.feature.patch/build.properties
+++ /dev/null
@@ -1 +0,0 @@
-bin.includes = feature.xml
diff --git a/features/org.eclipse.wst.xml_ui.feature.patch/feature.xml b/features/org.eclipse.wst.xml_ui.feature.patch/feature.xml
deleted file mode 100644
index 42b3c23..0000000
--- a/features/org.eclipse.wst.xml_ui.feature.patch/feature.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
-      id="org.eclipse.wst.xml_ui.feature.path"
-      label="Path Feature"
-      version="1.0.0">
-
-   <description url="http://www.example.com/description">
-      [Enter Feature Description here.]
-   </description>
-
-   <copyright url="http://www.example.com/copyright">
-      [Enter Copyright Description here.]
-   </copyright>
-
-   <license url="http://www.example.com/license">
-      [Enter License Description here.]
-   </license>
-
-   <requires>
-      <import feature="org.eclipse.wst.xml_ui.feature" version="1.5.5.v200707311635-zkiCfzO-IFUOjzR" patch="true"/>
-   </requires>
-
-</feature>
diff --git a/features/org.eclipse.wst.xml_ui.feature/feature.properties b/features/org.eclipse.wst.xml_ui.feature/feature.properties
index 14f341b..aed3499 100644
--- a/features/org.eclipse.wst.xml_ui.feature/feature.properties
+++ b/features/org.eclipse.wst.xml_ui.feature/feature.properties
@@ -18,10 +18,10 @@
 featureName=Eclipse XML Editors and Tools
 
 # "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
+providerName=Eclipse Web Tools Platform
 
 # "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
+updateSiteName=Eclipse Web Tools Platform (WTP) Repository
 
 # "description" property - description of the feature
 description=XML, DTD and XML Schema Editors, validators, and XML Catalog support
@@ -45,8 +45,8 @@
 # "license" property - text of the "Feature Update License"
 # should be plain text version of license agreement pointed to be "licenseURL"
 license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
+Eclipse Foundation Software User Agreement\n\
+April 14, 2010\n\
 \n\
 Usage Of Content\n\
 \n\
@@ -54,42 +54,38 @@
 OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
 USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
 AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+NOTICES INDICATED OR REFERENCED BELOW.  BY USING THE CONTENT, YOU\n\
 AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
 AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+OR NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE\n\
 TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
 OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
 BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
 \n\
 Applicable Licenses\n\
 \n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+Unless otherwise indicated, all Content made available by the\n\
+Eclipse Foundation is provided to you under the terms and conditions of\n\
+the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
+provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
 For purposes of the EPL, "Program" will mean the Content.\n\
 \n\
 Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
+documentation and other files maintained in the Eclipse Foundation source code\n\
+repository ("Repository") in software modules ("Modules") and made available\n\
 as downloadable archives ("Downloads").\n\
 \n\
-   - Content may be structured and packaged into modules to facilitate delivering,\n\
-     extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
-     plug-in fragments ("Fragments"), and features ("Features").\n\
-   - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
-     in a directory named "plugins".\n\
-   - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
-     Each Feature may be packaged as a sub-directory in a directory named "features".\n\
-     Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
-     numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
-   - Features may also include other Features ("Included Features"). Within a Feature, files\n\
-     named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
+       - Content may be structured and packaged into modules to facilitate delivering,\n\
+         extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+         plug-in fragments ("Fragments"), and features ("Features").\n\
+       - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+         in a directory named "plugins".\n\
+       - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+         Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+         Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+         numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+       - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+         named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
 \n\
 The terms and conditions governing Plug-ins and Fragments should be\n\
 contained in files named "about.html" ("Abouts"). The terms and\n\
@@ -98,48 +94,77 @@
 Licenses may be located in any directory of a Download or Module\n\
 including, but not limited to the following locations:\n\
 \n\
-   - The top-level (root) directory\n\
-   - Plug-in and Fragment directories\n\
-   - Inside Plug-ins and Fragments packaged as JARs\n\
-   - Sub-directories of the directory named "src" of certain Plug-ins\n\
-   - Feature directories\n\
+       - The top-level (root) directory\n\
+       - Plug-in and Fragment directories\n\
+       - Inside Plug-ins and Fragments packaged as JARs\n\
+       - Sub-directories of the directory named "src" of certain Plug-ins\n\
+       - Feature directories\n\
 \n\
 Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
+Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
+Update License") during the installation process. If the Feature contains\n\
 Included Features, the Feature Update License should either provide you\n\
 with the terms and conditions governing the Included Features or inform\n\
 you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
+the "license" property of files named "feature.properties" found within a Feature.\n\
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
+terms and conditions (or references to such terms and conditions) that\n\
+govern your use of the associated Content in that directory.\n\
 \n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
 TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
 SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
 \n\
-    - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
-    - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
-    - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
-    - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
-    - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
-    - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-    - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
+       - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+       - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+       - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+       - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+       - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
 \n\
 IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
+TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
 is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
 govern that particular Content.\n\
 \n\
+\n\Use of Provisioning Technology\n\
+\n\
+The Eclipse Foundation makes available provisioning software, examples of which include,\n\
+but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
+the purpose of allowing users to install software, documentation, information and/or\n\
+other materials (collectively "Installable Software"). This capability is provided with\n\
+the intent of allowing such users to install, extend and update Eclipse-based products.\n\
+Information about packaging Installable Software is available at\n\
+http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
+\n\
+You may use Provisioning Technology to allow other parties to install Installable Software.\n\
+You shall be responsible for enabling the applicable license agreements relating to the\n\
+Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
+in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
+making it available in accordance with the Specification, you further acknowledge your\n\
+agreement to, and the acquisition of all necessary rights to permit the following:\n\
+\n\
+       1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
+          the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
+          extending or updating the functionality of an Eclipse-based product.\n\
+       2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
+          Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
+       3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
+          govern the use of the Installable Software ("Installable Software Agreement") and such\n\
+          Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
+          with the Specification. Such Installable Software Agreement must inform the user of the\n\
+          terms and conditions that govern the Installable Software and must solicit acceptance by\n\
+          the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
+          indication of agreement by the user, the provisioning Technology will complete installation\n\
+          of the Installable Software.\n\
+\n\
 Cryptography\n\
 \n\
 Content may contain encryption software. The country in which you are\n\
 currently may have restrictions on the import, possession, and use,\n\
 and/or re-export to another country, of encryption software. BEFORE\n\
 using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
+regulations and policies concerning the import, possession, or use, and\n\
+re-export of encryption software, to see if this is permitted.\n\
 \n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
+Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
 ########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.xml_ui.feature/feature.xml b/features/org.eclipse.wst.xml_ui.feature/feature.xml
index 1be84c1..85c2584 100644
--- a/features/org.eclipse.wst.xml_ui.feature/feature.xml
+++ b/features/org.eclipse.wst.xml_ui.feature/feature.xml
@@ -2,8 +2,9 @@
 <feature
       id="org.eclipse.wst.xml_ui.feature"
       label="%featureName"
-      version="3.0.0.qualifier"
-      provider-name="%providerName">
+      version="3.2.2.qualifier"
+      provider-name="%providerName"
+      plugin="org.eclipse.wst.xml.ui">
 
    <description>
       %description
@@ -18,11 +19,14 @@
    </license>
 
    <url>
-      <update label="%updateSiteName" url="http://download.eclipse.org/webtools/updates/"/>
-      <discovery label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates"/>
+      <update label="%updateSiteName" url="http://download.eclipse.org/webtools/repository/helios"/>
    </url>
 
    <includes
+         id="org.eclipse.wst.common_ui.feature"
+         version="0.0.0"/>
+
+   <includes
          id="org.eclipse.wst.xml_userdoc.feature"
          version="0.0.0"/>
 
@@ -30,51 +34,6 @@
          id="org.eclipse.wst.xml_core.feature"
          version="0.0.0"/>
 
-   <requires>
-      <import plugin="org.eclipse.ui.views.properties.tabbed" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.core.runtime" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.jface.text" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.ui.workbench.texteditor" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.ui.ide" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.emf.ecore.edit" version="2.2.0" match="compatible"/>
-      <import plugin="org.eclipse.core.resources" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.xsd.edit" version="2.2.0" match="compatible"/>
-      <import plugin="org.eclipse.emf.edit.ui" version="2.2.0" match="compatible"/>
-      <import plugin="org.eclipse.ltk.core.refactoring" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.ltk.ui.refactoring" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.search" version="3.2.0" match="compatible"/>
-      <import plugin="org.eclipse.core.resources" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.core.runtime" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.jface.text" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.ui.ide" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.ui.workbench.texteditor" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.wst.common.ui" version="1.1.301" match="equivalent"/>
-      <import plugin="org.eclipse.wst.dtd.core" version="1.1.200" match="equivalent"/>
-      <import plugin="org.eclipse.wst.sse.core" version="1.1.300" match="equivalent"/>
-      <import plugin="org.eclipse.wst.sse.ui" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.xml.core" version="1.1.300" match="equivalent"/>
-      <import plugin="org.eclipse.wst.xml.ui" version="1.0.400" match="equivalent"/>
-      <import plugin="org.eclipse.wst.common.uriresolver" version="1.1.301" match="equivalent"/>
-      <import plugin="org.eclipse.ui.views.properties.tabbed" version="3.4.0" match="compatible"/>
-      <import plugin="com.ibm.icu" version="3.8.1" match="compatible"/>
-      <import plugin="org.eclipse.debug.ui" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.ui.editors" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.search" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.ui" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.ui.forms" version="3.3.100" match="equivalent"/>
-      <import plugin="org.eclipse.ui.views" version="3.3.0" match="compatible"/>
-      <import plugin="org.eclipse.wst.sse.core" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.validation" version="1.2.0" match="equivalent"/>
-      <import plugin="org.eclipse.emf.common" version="2.4.0" match="compatible"/>
-      <import plugin="org.eclipse.core.expressions" version="3.3.0" match="compatible"/>
-      <import plugin="org.eclipse.wst.common.uriresolver" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.common.core" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.wst.common.ui" version="1.1.0" match="equivalent"/>
-      <import plugin="org.eclipse.gef" version="3.4.0" match="compatible"/>
-      <import plugin="org.eclipse.wst.xsd.core" version="1.1.300" match="equivalent"/>
-      <import plugin="org.eclipse.core.filesystem" version="1.2.0" match="compatible"/>
-   </requires>
-
    <plugin
          id="org.eclipse.wst.dtd.ui"
          download-size="0"
diff --git a/features/org.eclipse.wst.xml_ui.feature/license.html b/features/org.eclipse.wst.xml_ui.feature/license.html
index 303e665..c184ca3 100644
--- a/features/org.eclipse.wst.xml_ui.feature/license.html
+++ b/features/org.eclipse.wst.xml_ui.feature/license.html
@@ -1,96 +1,107 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>June 06, 2007</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION 
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF 
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE 
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED 
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED 
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE 
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE 
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY 
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU 
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse 
-Foundation is provided to you under the terms and conditions of the Eclipse 
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this 
-Content and is also available at <A 
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>. 
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code, 
-documentation and other files maintained in the Eclipse.org CVS repository 
-("Repository") in CVS modules ("Modules") and made available as downloadable 
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments 
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more 
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may 
-contain a list of the names and version numbers of the Plug-ins and/or Fragments 
-associated with a Feature. Plug-ins and Fragments are located in directories 
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named 
-"feature.xml" may contain a list of the names and version numbers of Included 
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained 
-in files named "about.html" ("Abouts"). The terms and conditions governing 
-Features and Included Features should be contained in files named "license.html" 
-("Feature Licenses"). Abouts and Feature Licenses may be located in any 
-directory of a Download or Module including, but not limited to the following 
-locations:</P>
-<UL>
-  <LI>The top-level (root) directory 
-  <LI>Plug-in and Fragment directories 
-  <LI>Subdirectories of the directory named "src" of certain Plug-ins 
-  <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed 
-using the Eclipse Update Manager, you must agree to a license ("Feature Update 
-License") during the installation process. If the Feature contains Included 
-Features, the Feature Update License should either provide you with the terms 
-and conditions governing the Included Features or inform you where you can 
-locate them. Feature Update Licenses may be found in the "license" property of 
-files named "feature.properties". Such Abouts, Feature Licenses and Feature 
-Update Licenses contain the terms and conditions (or references to such terms 
-and conditions) that govern your use of the associated Content in that 
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL 
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE 
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
-  <LI>Common Public License Version 1.0 (available at <A 
-  href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
 
-  <LI>Apache Software License 1.1 (available at <A 
-  href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 14, 2010</p>
 
-  <LI>Apache Software License 2.0 (available at <A 
-  href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
+<h3>Usage Of Content</h3>
 
-  <LI>IBM Public License 1.0 (available at <A 
-  href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-  <LI>Metro Link Public License 1.00 (available at <A 
-  href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>) 
-  
-  <LI>Mozilla Public License Version 1.1 (available at <A 
-  href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>) </LI>
-  
-  <li>Common Development and Distribution License (CDDL) Version 1.0 (available at <A 
-  href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
-  </LI>
-</UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR 
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is 
-provided, please contact the Eclipse Foundation to determine what terms and 
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are 
-currently may have restrictions on the import, possession, and use, and/or 
-re-export to another country, of encryption software. BEFORE using any 
-encryption software, please check the country's laws, regulations and policies 
-concerning the import, possession, or use, and re-export of encryption software, 
-to see if this is permitted.</P></BODY></HTML>
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+   (COLLECTIVELY &quot;CONTENT&quot;).  USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+   CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW.  BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+   OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+   NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+   CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+   (&quot;EPL&quot;).  A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+   For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+   repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+       <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content.  Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+       <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+       <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.  Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;.  Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+      and/or Fragments associated with that Feature.</li>
+       <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;).  Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+       <li>The top-level (root) directory</li>
+       <li>Plug-in and Fragment directories</li>
+       <li>Inside Plug-ins and Fragments packaged as JARs</li>
+       <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+       <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process.  If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them.  Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.  SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+       <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+       <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+       <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+       <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+       <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT.  If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+   Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+   other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+   install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+       href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+   (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+   applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+   in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+   Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+       <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+       on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+       product.</li>
+       <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+       accessed and copied to the Target Machine.</li>
+       <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+       Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+       Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+       the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+       indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+   another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+   possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html>
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.html b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.html
similarity index 98%
copy from features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.html
copy to features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.html
index d4916df..fe81d46 100644
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.html
+++ b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.html
@@ -7,7 +7,7 @@
 <body lang="EN-US">
 <h2>About This Content</h2>
 
-<p>June 06, 2007</p>	
+<P>June, 2008</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
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.ini b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.ini
similarity index 100%
copy from features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.ini
copy to features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.ini
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.mappings b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.mappings
similarity index 99%
copy from features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.mappings
copy to features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.mappings
index 0dfb735..a28390a 100644
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.mappings
+++ b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.mappings
@@ -1,6 +1,6 @@
-# about.mappings

-# contains fill-ins for about.properties

-# java.io.Properties file (ISO 8859-1 with "\" escapes)

-# This file does not need to be translated.

-

-0=@build@

+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
+0=@build@
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.properties b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.properties
similarity index 95%
rename from features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.properties
rename to features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.properties
index 61f1e6e..04e10ea 100644
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/about.properties
+++ b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/about.properties
@@ -16,7 +16,7 @@
 #
 # Do not translate any values surrounded by {}
 
-blurb=Web Standard Tools - Web Core\n\
+blurb=Web Standard Tools - XML UI\n\
 \n\
 Version: {featureVersion}\n\
 Build id: {0}\n\
diff --git a/features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/build.properties b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/build.properties
similarity index 100%
rename from features/org.eclipse.wst.web_ui.feature/sourceTemplatePlugin/build.properties
rename to features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/build.properties
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/plugin.properties b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/plugin.properties
similarity index 91%
rename from features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/plugin.properties
rename to features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/plugin.properties
index c9d38d6..29b5f4d 100644
--- a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/plugin.properties
+++ b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/plugin.properties
@@ -8,5 +8,5 @@
 # Contributors:
 #     IBM Corporation - initial API and implementation
 ###############################################################################
-pluginName=Web Standard Tools - Web Core Source
+pluginName=Web Standard Tools - XML UI Source
 providerName=Eclipse.org
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/wtp_prod32.gif b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/wtp_prod32.gif
similarity index 100%
copy from features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/wtp_prod32.gif
copy to features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/wtp_prod32.gif
Binary files differ
diff --git a/features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/wtp_prod32.png b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/wtp_prod32.png
similarity index 100%
copy from features/org.eclipse.wst.web_core.feature/sourceTemplatePlugin/wtp_prod32.png
copy to features/org.eclipse.wst.xml_ui.feature/sourceTemplateBundle/wtp_prod32.png
Binary files differ
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/build.properties b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/build.properties
index 19b7468..dc737af 100644
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/build.properties
+++ b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/build.properties
@@ -14,6 +14,5 @@
 feature.xml,\
 feature.properties,\
 license.html
-
-generate.feature@org.eclipse.wst.xml_core.feature.source = org.eclipse.wst.xml_core.feature
+generate.feature@org.eclipse.wst.xml_core.feature.source=org.eclipse.wst.xml_core.feature
 
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/feature.properties b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/feature.properties
index 90609a9..5ed6336 100644
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/feature.properties
+++ b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/feature.properties
@@ -18,10 +18,8 @@
 featureName=WST XML UI Developer Resources
 
 # "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
+providerName=Eclipse Web Tools Platform
 
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
 
 # "description" property - description of the feature
 description=Source code zips for WST XML UI.
@@ -45,8 +43,8 @@
 # "license" property - text of the "Feature Update License"
 # should be plain text version of license agreement pointed to be "licenseURL"
 license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
+Eclipse Foundation Software User Agreement\n\
+April 14, 2010\n\
 \n\
 Usage Of Content\n\
 \n\
@@ -54,42 +52,38 @@
 OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
 USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
 AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+NOTICES INDICATED OR REFERENCED BELOW.  BY USING THE CONTENT, YOU\n\
 AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
 AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+OR NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE\n\
 TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
 OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
 BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
 \n\
 Applicable Licenses\n\
 \n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+Unless otherwise indicated, all Content made available by the\n\
+Eclipse Foundation is provided to you under the terms and conditions of\n\
+the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
+provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
 For purposes of the EPL, "Program" will mean the Content.\n\
 \n\
 Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
+documentation and other files maintained in the Eclipse Foundation source code\n\
+repository ("Repository") in software modules ("Modules") and made available\n\
 as downloadable archives ("Downloads").\n\
 \n\
-   - Content may be structured and packaged into modules to facilitate delivering,\n\
-     extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
-     plug-in fragments ("Fragments"), and features ("Features").\n\
-   - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
-     in a directory named "plugins".\n\
-   - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
-     Each Feature may be packaged as a sub-directory in a directory named "features".\n\
-     Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
-     numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
-   - Features may also include other Features ("Included Features"). Within a Feature, files\n\
-     named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
+       - Content may be structured and packaged into modules to facilitate delivering,\n\
+         extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+         plug-in fragments ("Fragments"), and features ("Features").\n\
+       - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+         in a directory named "plugins".\n\
+       - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+         Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+         Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+         numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+       - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+         named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
 \n\
 The terms and conditions governing Plug-ins and Fragments should be\n\
 contained in files named "about.html" ("Abouts"). The terms and\n\
@@ -98,48 +92,77 @@
 Licenses may be located in any directory of a Download or Module\n\
 including, but not limited to the following locations:\n\
 \n\
-   - The top-level (root) directory\n\
-   - Plug-in and Fragment directories\n\
-   - Inside Plug-ins and Fragments packaged as JARs\n\
-   - Sub-directories of the directory named "src" of certain Plug-ins\n\
-   - Feature directories\n\
+       - The top-level (root) directory\n\
+       - Plug-in and Fragment directories\n\
+       - Inside Plug-ins and Fragments packaged as JARs\n\
+       - Sub-directories of the directory named "src" of certain Plug-ins\n\
+       - Feature directories\n\
 \n\
 Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
+Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
+Update License") during the installation process. If the Feature contains\n\
 Included Features, the Feature Update License should either provide you\n\
 with the terms and conditions governing the Included Features or inform\n\
 you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
+the "license" property of files named "feature.properties" found within a Feature.\n\
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
+terms and conditions (or references to such terms and conditions) that\n\
+govern your use of the associated Content in that directory.\n\
 \n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
 TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
 SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
 \n\
-    - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
-    - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
-    - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
-    - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
-    - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
-    - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-    - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
+       - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+       - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+       - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+       - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+       - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
 \n\
 IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
+TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
 is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
 govern that particular Content.\n\
 \n\
+\n\Use of Provisioning Technology\n\
+\n\
+The Eclipse Foundation makes available provisioning software, examples of which include,\n\
+but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
+the purpose of allowing users to install software, documentation, information and/or\n\
+other materials (collectively "Installable Software"). This capability is provided with\n\
+the intent of allowing such users to install, extend and update Eclipse-based products.\n\
+Information about packaging Installable Software is available at\n\
+http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
+\n\
+You may use Provisioning Technology to allow other parties to install Installable Software.\n\
+You shall be responsible for enabling the applicable license agreements relating to the\n\
+Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
+in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
+making it available in accordance with the Specification, you further acknowledge your\n\
+agreement to, and the acquisition of all necessary rights to permit the following:\n\
+\n\
+       1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
+          the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
+          extending or updating the functionality of an Eclipse-based product.\n\
+       2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
+          Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
+       3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
+          govern the use of the Installable Software ("Installable Software Agreement") and such\n\
+          Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
+          with the Specification. Such Installable Software Agreement must inform the user of the\n\
+          terms and conditions that govern the Installable Software and must solicit acceptance by\n\
+          the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
+          indication of agreement by the user, the provisioning Technology will complete installation\n\
+          of the Installable Software.\n\
+\n\
 Cryptography\n\
 \n\
 Content may contain encryption software. The country in which you are\n\
 currently may have restrictions on the import, possession, and use,\n\
 and/or re-export to another country, of encryption software. BEFORE\n\
 using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
+regulations and policies concerning the import, possession, or use, and\n\
+re-export of encryption software, to see if this is permitted.\n\
 \n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
+Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
 ########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/license.html b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/license.html
index fec4a48..c184ca3 100644
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/license.html
+++ b/features/org.eclipse.wst.xml_ui.feature/sourceTemplateFeature/license.html
@@ -1,13 +1,14 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
 </head>
 
-<body lang="EN-US" link=blue vlink=purple>
+<body lang="EN-US">
 <h2>Eclipse Foundation Software User Agreement</h2>
-<p>June 06, 2007</p>
+<p>April 14, 2010</p>
 
 <h3>Usage Of Content</h3>
 
@@ -17,37 +18,37 @@
    OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
    NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
    CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-   
-<h3>Applicable Licenses</h3>   
-   
+
+<h3>Applicable Licenses</h3>
+
 <p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
    (&quot;EPL&quot;).  A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
    For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
 
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
-   modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-   
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+   repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
 <ul>
-	<li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content.  Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-	<li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
-	<li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.  Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;.  Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+       <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content.  Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+       <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+       <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.  Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;.  Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
       and/or Fragments associated with that Feature.</li>
-	<li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>   
- 
+       <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
 <p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
 Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;).  Abouts and Feature Licenses may be located in any directory of a Download or Module
 including, but not limited to the following locations:</p>
 
 <ul>
-	<li>The top-level (root) directory</li>
-	<li>Plug-in and Fragment directories</li>
-	<li>Inside Plug-ins and Fragments packaged as JARs</li>
-	<li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
-	<li>Feature directories</li>
+       <li>The top-level (root) directory</li>
+       <li>Plug-in and Fragment directories</li>
+       <li>Inside Plug-ins and Fragments packaged as JARs</li>
+       <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+       <li>Feature directories</li>
 </ul>
-		
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
 installation process.  If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
 inform you where you can locate them.  Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
 Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
@@ -57,26 +58,50 @@
 OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
 
 <ul>
-	<li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-	<li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
-	<li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
-	<li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>	
-	<li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-	<li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-  <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A 
-  href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
-  </LI>
-</UL>
+       <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+       <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+       <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+       <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+       <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
 
 <p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT.  If no About, Feature License, or Feature Update License is provided, please
 contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
 
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+   Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+   other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+   install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+       href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+   (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+   applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+   in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+   Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+       <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+       on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+       product.</li>
+       <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+       accessed and copied to the Target Machine.</li>
+       <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+       Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+       Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+       the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+       indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
 <h3>Cryptography</h3>
 
 <p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
    another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
    possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-   
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>   
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
 </body>
 </html>
diff --git a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.html b/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.html
index d4916df..fe81d46 100644
--- a/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.html
+++ b/features/org.eclipse.wst.xml_ui.feature/sourceTemplatePlugin/about.html
@@ -7,7 +7,7 @@
 <body lang="EN-US">
 <h2>About This Content</h2>
 
-<p>June 06, 2007</p>	
+<P>June, 2008</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
diff --git a/features/org.eclipse.wst.xml_userdoc.feature/feature.properties b/features/org.eclipse.wst.xml_userdoc.feature/feature.properties
index 29b3638..69a7c0a 100644
--- a/features/org.eclipse.wst.xml_userdoc.feature/feature.properties
+++ b/features/org.eclipse.wst.xml_userdoc.feature/feature.properties
@@ -18,10 +18,7 @@
 featureName=WST XML User Documentation
 
 # "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
+providerName=Eclipse Web Tools Platform
 
 # "description" property - description of the feature
 description=WST XML user documentation
@@ -45,8 +42,8 @@
 # "license" property - text of the "Feature Update License"
 # should be plain text version of license agreement pointed to be "licenseURL"
 license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
+Eclipse Foundation Software User Agreement\n\
+April 14, 2010\n\
 \n\
 Usage Of Content\n\
 \n\
@@ -54,42 +51,38 @@
 OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
 USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
 AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+NOTICES INDICATED OR REFERENCED BELOW.  BY USING THE CONTENT, YOU\n\
 AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
 AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+OR NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE\n\
 TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
 OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
 BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
 \n\
 Applicable Licenses\n\
 \n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+Unless otherwise indicated, all Content made available by the\n\
+Eclipse Foundation is provided to you under the terms and conditions of\n\
+the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
+provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
 For purposes of the EPL, "Program" will mean the Content.\n\
 \n\
 Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
+documentation and other files maintained in the Eclipse Foundation source code\n\
+repository ("Repository") in software modules ("Modules") and made available\n\
 as downloadable archives ("Downloads").\n\
 \n\
-   - Content may be structured and packaged into modules to facilitate delivering,\n\
-     extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
-     plug-in fragments ("Fragments"), and features ("Features").\n\
-   - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
-     in a directory named "plugins".\n\
-   - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
-     Each Feature may be packaged as a sub-directory in a directory named "features".\n\
-     Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
-     numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
-   - Features may also include other Features ("Included Features"). Within a Feature, files\n\
-     named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
+       - Content may be structured and packaged into modules to facilitate delivering,\n\
+         extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+         plug-in fragments ("Fragments"), and features ("Features").\n\
+       - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+         in a directory named "plugins".\n\
+       - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+         Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+         Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+         numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+       - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+         named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
 \n\
 The terms and conditions governing Plug-ins and Fragments should be\n\
 contained in files named "about.html" ("Abouts"). The terms and\n\
@@ -98,48 +91,77 @@
 Licenses may be located in any directory of a Download or Module\n\
 including, but not limited to the following locations:\n\
 \n\
-   - The top-level (root) directory\n\
-   - Plug-in and Fragment directories\n\
-   - Inside Plug-ins and Fragments packaged as JARs\n\
-   - Sub-directories of the directory named "src" of certain Plug-ins\n\
-   - Feature directories\n\
+       - The top-level (root) directory\n\
+       - Plug-in and Fragment directories\n\
+       - Inside Plug-ins and Fragments packaged as JARs\n\
+       - Sub-directories of the directory named "src" of certain Plug-ins\n\
+       - Feature directories\n\
 \n\
 Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
+Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
+Update License") during the installation process. If the Feature contains\n\
 Included Features, the Feature Update License should either provide you\n\
 with the terms and conditions governing the Included Features or inform\n\
 you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
+the "license" property of files named "feature.properties" found within a Feature.\n\
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
+terms and conditions (or references to such terms and conditions) that\n\
+govern your use of the associated Content in that directory.\n\
 \n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
 TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
 SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
 \n\
-    - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
-    - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
-    - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
-    - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
-    - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
-    - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-    - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
+       - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+       - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+       - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+       - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+       - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
 \n\
 IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
+TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
 is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
 govern that particular Content.\n\
 \n\
+\n\Use of Provisioning Technology\n\
+\n\
+The Eclipse Foundation makes available provisioning software, examples of which include,\n\
+but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
+the purpose of allowing users to install software, documentation, information and/or\n\
+other materials (collectively "Installable Software"). This capability is provided with\n\
+the intent of allowing such users to install, extend and update Eclipse-based products.\n\
+Information about packaging Installable Software is available at\n\
+http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
+\n\
+You may use Provisioning Technology to allow other parties to install Installable Software.\n\
+You shall be responsible for enabling the applicable license agreements relating to the\n\
+Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
+in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
+making it available in accordance with the Specification, you further acknowledge your\n\
+agreement to, and the acquisition of all necessary rights to permit the following:\n\
+\n\
+       1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
+          the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
+          extending or updating the functionality of an Eclipse-based product.\n\
+       2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
+          Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
+       3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
+          govern the use of the Installable Software ("Installable Software Agreement") and such\n\
+          Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
+          with the Specification. Such Installable Software Agreement must inform the user of the\n\
+          terms and conditions that govern the Installable Software and must solicit acceptance by\n\
+          the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
+          indication of agreement by the user, the provisioning Technology will complete installation\n\
+          of the Installable Software.\n\
+\n\
 Cryptography\n\
 \n\
 Content may contain encryption software. The country in which you are\n\
 currently may have restrictions on the import, possession, and use,\n\
 and/or re-export to another country, of encryption software. BEFORE\n\
 using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
+regulations and policies concerning the import, possession, or use, and\n\
+re-export of encryption software, to see if this is permitted.\n\
 \n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
+Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
 ########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.xml_userdoc.feature/feature.xml b/features/org.eclipse.wst.xml_userdoc.feature/feature.xml
index 673f794..335446c 100644
--- a/features/org.eclipse.wst.xml_userdoc.feature/feature.xml
+++ b/features/org.eclipse.wst.xml_userdoc.feature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.xml_userdoc.feature"
       label="%featureName"
-      version="3.0.0.qualifier"
+      version="3.2.100.qualifier"
       provider-name="%providerName">
 
    <description>
@@ -17,10 +17,6 @@
       %license
    </license>
 
-   <url>
-      <update label="%updateSiteName" url="http://download.eclipse.org/webtools/updates/"/>
-   </url>
-
    <plugin
          id="org.eclipse.wst.dtdeditor.doc.user"
          download-size="0"
diff --git a/features/org.eclipse.wst.xml_userdoc.feature/license.html b/features/org.eclipse.wst.xml_userdoc.feature/license.html
index 303e665..c184ca3 100644
--- a/features/org.eclipse.wst.xml_userdoc.feature/license.html
+++ b/features/org.eclipse.wst.xml_userdoc.feature/license.html
@@ -1,96 +1,107 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>June 06, 2007</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION 
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF 
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE 
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED 
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED 
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE 
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE 
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY 
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU 
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse 
-Foundation is provided to you under the terms and conditions of the Eclipse 
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this 
-Content and is also available at <A 
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>. 
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code, 
-documentation and other files maintained in the Eclipse.org CVS repository 
-("Repository") in CVS modules ("Modules") and made available as downloadable 
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments 
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more 
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may 
-contain a list of the names and version numbers of the Plug-ins and/or Fragments 
-associated with a Feature. Plug-ins and Fragments are located in directories 
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named 
-"feature.xml" may contain a list of the names and version numbers of Included 
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained 
-in files named "about.html" ("Abouts"). The terms and conditions governing 
-Features and Included Features should be contained in files named "license.html" 
-("Feature Licenses"). Abouts and Feature Licenses may be located in any 
-directory of a Download or Module including, but not limited to the following 
-locations:</P>
-<UL>
-  <LI>The top-level (root) directory 
-  <LI>Plug-in and Fragment directories 
-  <LI>Subdirectories of the directory named "src" of certain Plug-ins 
-  <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed 
-using the Eclipse Update Manager, you must agree to a license ("Feature Update 
-License") during the installation process. If the Feature contains Included 
-Features, the Feature Update License should either provide you with the terms 
-and conditions governing the Included Features or inform you where you can 
-locate them. Feature Update Licenses may be found in the "license" property of 
-files named "feature.properties". Such Abouts, Feature Licenses and Feature 
-Update Licenses contain the terms and conditions (or references to such terms 
-and conditions) that govern your use of the associated Content in that 
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL 
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE 
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
-  <LI>Common Public License Version 1.0 (available at <A 
-  href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
 
-  <LI>Apache Software License 1.1 (available at <A 
-  href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 14, 2010</p>
 
-  <LI>Apache Software License 2.0 (available at <A 
-  href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
+<h3>Usage Of Content</h3>
 
-  <LI>IBM Public License 1.0 (available at <A 
-  href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-  <LI>Metro Link Public License 1.00 (available at <A 
-  href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>) 
-  
-  <LI>Mozilla Public License Version 1.1 (available at <A 
-  href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>) </LI>
-  
-  <li>Common Development and Distribution License (CDDL) Version 1.0 (available at <A 
-  href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
-  </LI>
-</UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR 
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is 
-provided, please contact the Eclipse Foundation to determine what terms and 
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are 
-currently may have restrictions on the import, possession, and use, and/or 
-re-export to another country, of encryption software. BEFORE using any 
-encryption software, please check the country's laws, regulations and policies 
-concerning the import, possession, or use, and re-export of encryption software, 
-to see if this is permitted.</P></BODY></HTML>
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+   (COLLECTIVELY &quot;CONTENT&quot;).  USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+   CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW.  BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+   OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+   NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+   CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+   (&quot;EPL&quot;).  A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+   For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+   repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+       <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content.  Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+       <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+       <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.  Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;.  Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+      and/or Fragments associated with that Feature.</li>
+       <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;).  Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+       <li>The top-level (root) directory</li>
+       <li>Plug-in and Fragment directories</li>
+       <li>Inside Plug-ins and Fragments packaged as JARs</li>
+       <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+       <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process.  If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them.  Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.  SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+       <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+       <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+       <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+       <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+       <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT.  If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+   Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+   other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+   install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+       href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+   (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+   applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+   in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+   Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+       <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+       on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+       product.</li>
+       <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+       accessed and copied to the Target Machine.</li>
+       <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+       Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+       Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+       the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+       indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+   another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+   possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html>